diff --git a/.github/workflows/ContinuousIntegration.yml b/.github/workflows/ContinuousIntegration.yml index 6f987cf69..9b45c4785 100644 --- a/.github/workflows/ContinuousIntegration.yml +++ b/.github/workflows/ContinuousIntegration.yml @@ -2,7 +2,10 @@ name: Continuous Integration # This workflow is triggered on pushes and pull requests to the repository. +# This workflow will also run each Monday on the default branch (i.e. master) on: + schedule: + - cron: '0 0 * * 1' push: branches: '**' pull_request: @@ -13,20 +16,26 @@ jobs: runs-on: ${{matrix.os}} strategy: matrix: - os: [ ubuntu-18.04, macos-10.15 ] - cxx: [ g++-9, clang++ ] + os: [ ubuntu-20.04, macos-11 ] + cxx: [ clang++, g++-10 ] build_type: [ Debug, Release ] steps: + - name: Install hdf5 libraries for Linux + if: matrix.os == 'ubuntu-20.04' + run: sudo apt-get install libhdf5-dev + - name: Install hdf5 libraries for MacOS + if: matrix.os == 'macos-11' + run: brew install hdf5 - name: which CXX run: | which ${{matrix.cxx}} ${{matrix.cxx}} --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: mkdir bin run: mkdir bin - name: cmake - run: cmake -DPYTHON_EXECUTABLE=$(which python3) -D CMAKE_CXX_COMPILER=`which ${{matrix.cxx}}` -D CMAKE_BUILD_TYPE=${{matrix.build_type}} .. + run: cmake -DPYTHON_EXECUTABLE=$(which python3) -D CMAKE_CXX_COMPILER=`which ${{matrix.cxx}}` -D CMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER_FLAGS="-DNJOY_GNDSTK_DISABLE_HDF5" .. working-directory: ./bin - name: make run: make -j2 diff --git a/.gitignore b/.gitignore index 9fdab1763..66939940f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ build *~ metaconfigure/*.pyc docs/.build +debug +minsizerel +release diff --git a/CMakeLists.txt b/CMakeLists.txt index a33c52da1..c196e7c1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,101 +1,407 @@ -######################################################################## + +# ------------------------------------------------------------------------------ # Preamble -######################################################################## +# ------------------------------------------------------------------------------ cmake_minimum_required( VERSION 3.14 ) project( GNDStk LANGUAGES CXX ) -######################################################################## +# ------------------------------------------------------------------------------ # Project-wide setup -######################################################################## +# ------------------------------------------------------------------------------ set( CMAKE_CXX_STANDARD 17 ) set( CMAKE_CXX_STANDARD_REQUIRED YES ) option( GNDStk_unit_tests "Compile the GNDStk unit tests and integrate with ctest" ON - ) +) -######################################################################## +# ------------------------------------------------------------------------------ # Dependencies -######################################################################## +# ------------------------------------------------------------------------------ include( cmake/GNDStk_dependencies.cmake ) -######################################################################## +# ------------------------------------------------------------------------------ # Project targets -######################################################################## +# ------------------------------------------------------------------------------ -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# GNDStk : library -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# ------------------------ +# GNDStk: library +# ------------------------ -include_directories( src/ ) +include_directories( src/ versions/GNDS-v2.0/GNDS/src/ ) add_library( GNDStk INTERFACE ) -target_include_directories( GNDStk INTERFACE src/ ) -target_link_libraries( GNDStk +target_include_directories( GNDStk INTERFACE src/ simple-json/src/ ) +target_link_libraries( + GNDStk INTERFACE Log INTERFACE catch-adapter INTERFACE pugixml-adapter - INTERFACE nlohmann_json::nlohmann_json - ) + INTERFACE HighFive +) -add_executable( json2class.exe +add_executable( + json2class.exe EXCLUDE_FROM_ALL autogen/json2class.cpp - ) -target_link_libraries( json2class.exe +) +target_link_libraries( + json2class.exe PRIVATE GNDStk - PRIVATE nlohmann_json::nlohmann_json - ) +) + +set_target_properties( pugixml-adapter PROPERTIES POSITION_INDEPENDENT_CODE ON) + +# ------------------------ +# GNDStk: python bindings +# Include directories +# ------------------------ -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# GNDStk : python bindings -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +include_directories( + python/src/ + autogen/prototype/proto/src/ + versions/GNDS-v2.0 + versions/GNDS-v2.0/GNDS/src + versions/GNDS-v2.0/GNDS/python/src + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0 +) -include_directories( python/src/ ) +# ------------------------ +# GNDStk: python bindings +# Files compiled separately ("old" system) +# make GNDStk.python.old +# ------------------------ -pybind11_add_module( GNDStk.python +pybind11_add_module( + GNDStk.python.old EXCLUDE_FROM_ALL + python/src/GNDStk.python.cpp python/src/core/Node.python.cpp - python/src/Interpolation.python.cpp - python/src/GridStyle.python.cpp - python/src/v1.9/containers.python.cpp - python/src/v1.9/containers/Axis.python.cpp - python/src/v1.9/containers/Values.python.cpp - python/src/v1.9/containers/Link.python.cpp - python/src/v1.9/containers/Grid.python.cpp - python/src/v1.9/containers/Axes.python.cpp - python/src/v1.9/containers/XYs1d.python.cpp - python/src/v1.9/containers/Regions1d.python.cpp - python/src/v1.9/transport/CrossSection.python.cpp - python/src/v1.9/transport/Reaction.python.cpp - python/src/v1.9/transport/Reactions.python.cpp - python/src/v1.9/transport/ReactionSuite.python.cpp - python/src/v1.9/transport.python.cpp - python/src/v1.9/GNDS.python.cpp - ) + + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType.python.cpp + versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder.python.cpp + + versions/GNDS-v2.0/GNDS/python/src/v2.0.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Starts.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Lengths.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Array.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SelfScatteringKernel.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Sums.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Values.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearTerm.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ImaginaryAnomalousFactor.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BoundAtomCrossSection.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotopes.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Standard.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unresolved.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayMode.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/InternalConversionCoefficients.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Temperature.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Polynomial1d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Product.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearPlusInterference.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Branching1d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FreeGasApproximation.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotope.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MultiplicitySums.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringAtom.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nuclide.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageEnergy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PrimaryGamma.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spectrum.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OrphanProduct.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutronKE.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Time.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncidentEnergies.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Distribution.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Gridded3d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw1d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageProductEnergy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Q.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AngularTwoBody.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/R.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayPath.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Summand.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Title.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Continuum.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceReactions.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/G.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EnergyAngular.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Institution.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/String.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Width.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionSum.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringRadius.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Table.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nuclides.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearAmplitudeExpansion.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GaugeBoson.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spectra.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProductYields.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Theta.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/LevelSpacing.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/J.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptProductKE.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Widths.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MultiplicitySum.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Parameters.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Grid.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Add.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Slice.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProductYield.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MadlandNix.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BindingEnergy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DebyeWallerIntegral.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceSections.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Link.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageParameterCovariance.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Energy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Body.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Alias.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Uncertainty.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reactions.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs1d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Configurations.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Weighted.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Resolved.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionEnergyReleases.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Baryon.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncoherentPhotonScattering.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ENDFconversionFlags.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionComponent.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringAtoms.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Configuration.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptGammaEnergy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/E_max.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncompleteReactions.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionReconstructed.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Productions.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Charge.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PhotonEmissionProbabilities.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Probability.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionComponents.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs3d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SpinGroups.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/T_M.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SpinGroup.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DiscreteGamma.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Production.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CoulombPlusNuclearElastic.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ChemicalElements.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unorthodox.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FormFactor.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/S_table.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SimpleMaxwellianFission.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageEnergies.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Shell.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RealAnomalousFactor.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CoherentPhotonScattering.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Background.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayData.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/KalbachMann.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedBetaEnergy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Lepton.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Dates.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DoubleDifferentialCrossSection.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Authors.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ElapsedTimes.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringFactor.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Ls.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RutherfordScattering.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Fraction.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NBodyPhaseSpace.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ExternalFiles.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Conversion.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovarianceMatrix.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RMatrix.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EFH.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterLink.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ChemicalElement.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Constant1d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Baryons.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovariance.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncidentEnergy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NonNeutrinoEnergy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FastRegion.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Halflife.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Angular.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProjectileEnergyDomain.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ExternalFile.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceReaction.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Data.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ApplicationData.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptNeutronKE.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/HardSphereRadius.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reference.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nucleus.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Function2ds.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unspecified.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ShortRangeSelfScalingVariance.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spin.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Leptons.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Author.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceSection.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionEnergyRelease.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Channels.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unorthodoxes.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Gridded2d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OrphanProducts.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutron.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Slices.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ListOfCovariances.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Decay.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Axes.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Covariance.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Mass.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AngularEnergy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SCTApproximation.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutrons.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Multiplicity.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/WeightedFunctionals.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EFL.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Column.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Integer.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayModes.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs2d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Branching3d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceParameters.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResolvedRegion.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/UnresolvedRegion.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RealInterferenceTerm.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Intensity.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Discrete.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/TotalEnergy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovariances.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Regions1d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedGammaEnergy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NeutrinoEnergy.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ColumnData.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ElapsedTime.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ColumnHeaders.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PositronEmissionIntensity.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Recoil.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Evaluated.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Atomic.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionSums.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Resonances.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSection.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BreitWigner.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Date.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Uncorrelated.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotropic2d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/L.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Products.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/F.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Legendre.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/U.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Mixed.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/E_critical.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/T_effective.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Channel.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Parity.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Sum.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Double.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Summands.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GeneralEvaporation.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/TabulatedWidths.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Evaporation.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Yields.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Regions2d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ImaginaryInterferenceTerm.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OutputChannel.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Js.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EndfCompatible.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reaction.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Documentation.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MetaStable.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Rate.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceMatrix.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Styles.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Array.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Axis.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Aliases.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RowData.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Function1ds.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GaugeBosons.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonancesWithBackground.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Polynomial1d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Product.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Distribution.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Nuclides.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/CrossSection.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Products.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Double.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/OutputChannel.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Function1ds.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/g2d/Array.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/top/FissionFragmentData.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/top/ReactionSuite.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/top/PoPs.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/top/CovarianceSuite.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/general.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/top.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced.python.cpp + versions/GNDS-v2.0/GNDS/python/src/v2.0/g2d.python.cpp +) + +target_link_libraries( GNDStk.python.old PRIVATE GNDStk ) +target_compile_options(GNDStk.python.old PRIVATE "-fvisibility=hidden" ) +set_target_properties( GNDStk.python.old PROPERTIES OUTPUT_NAME GNDStk ) +set_target_properties( GNDStk.python.old PROPERTIES COMPILE_DEFINITIONS "PYBIND11" ) +set_target_properties( GNDStk.python.old PROPERTIES POSITION_INDEPENDENT_CODE ON) + +# ------------------------ +# GNDStk: python bindings +# Files compiled together (this is faster than compiling them separately) +# make GNDStk.python +# ------------------------ + +pybind11_add_module( + GNDStk.python + EXCLUDE_FROM_ALL + versions/GNDS-v2.0/GNDS/python/src/all.python.cpp +) + target_link_libraries( GNDStk.python PRIVATE GNDStk ) -target_compile_options( GNDStk.python PRIVATE "-fvisibility=hidden" ) +target_compile_options(GNDStk.python PRIVATE "-fvisibility=hidden" ) set_target_properties( GNDStk.python PROPERTIES OUTPUT_NAME GNDStk ) set_target_properties( GNDStk.python PROPERTIES COMPILE_DEFINITIONS "PYBIND11" ) -set_target_properties( pugixml-adapter PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties( GNDStk.python PROPERTIES POSITION_INDEPENDENT_CODE ON) -####################################################################### + +# ------------------------------------------------------------------------------ # Top-level Only -####################################################################### +# ------------------------------------------------------------------------------ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) - # unit testing if( GNDStk_unit_tests ) include( cmake/unit_testing.cmake ) endif() - endif() diff --git a/LICENSE b/LICENSE index 06042641a..df778cf60 100644 --- a/LICENSE +++ b/LICENSE @@ -7,4 +7,4 @@ Additionally, redistribution and use in source and binary forms, with or without 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Los Alamos National Security, LLC, Los Alamos National Laboratory, LANL, the U.S. Government, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index a8734aac2..0d05e30ed 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ +![Continuous Integration](https://github.com/njoy/GNDStk/workflows/Continuous%20Integration/badge.svg) + # GNDStk -Generalized Nuclear Database Structure toolkit +Toolkit for reading and interacting with GNDS formatted files. This toolkit provides a full C++ library along with python bindings. ## LICENSE This software is copyrighted by Los Alamos National Laboratory and distributed according to the conditions in the accompanying [LICENSE](LICENSE) file. diff --git a/autogen/.gitignore b/autogen/.gitignore deleted file mode 100644 index 321656c44..000000000 --- a/autogen/.gitignore +++ /dev/null @@ -1 +0,0 @@ -json2class.exe diff --git a/autogen/changes.json b/autogen/changes.json index 87832d157..8f27ad512 100644 --- a/autogen/changes.json +++ b/autogen/changes.json @@ -2,8 +2,8 @@ "name": { "// REMARK": [ "These give changes to apply to METADATUM or CHILD NODE names.", - "GNDS v1.9 does in fact have a child node named [double]. But", - "that name won't work in C++, so the following forces a change." + "GNDS does in fact have a child node named [double]. But that", + "name won't work in C++, so the following forces a change." ], "double": "Double" }, @@ -11,7 +11,6 @@ "metadata": { "type": { "Boolean": "bool", - "string": "std::string", "encoding": "enums::Encoding", "frame": "enums::Frame", "interaction": "enums::Interaction", @@ -40,7 +39,7 @@ "nuclear": "enums::Interaction::nuclear", "atomic": "enums::Interaction::atomic", "thermalNeutronScatteringLaw": - "enums::Interaction::thermalNeutronScatteringLaw", + "enums::Interaction::thermalNeutronScatteringLaw", "// INTERPOLATION": {}, "flat": "enums::Interpolation::flat", @@ -55,7 +54,7 @@ "row-major": "enums::StorageOrder::rowMajor", "column-major": "enums::StorageOrder::columnMajor", - "// MISCELLANEOUS CONTENT SEEN IN THE GNDS V1.9 SPEC": {}, + "// MISCELLANEOUS CONTENT SEEN IN THE GNDS SPECS": {}, "`' (i.e. unitless)": "", " \\\\kern-1ex": "", "`' (no label)": "", diff --git a/autogen/json2class-c.cpp b/autogen/json2class-c.cpp new file mode 100644 index 000000000..a3dae2fd5 --- /dev/null +++ b/autogen/json2class-c.cpp @@ -0,0 +1,953 @@ + +// ----------------------------------------------------------------------------- +// For the C interface +// ----------------------------------------------------------------------------- + +// two +// Forward args to two places: header and source +template +void two(writer &hdr, writer &src, Ts &&...args) +{ + hdr(std::forward(args)...); + src(std::forward(args)...); +} + +// ext +// For writing (or not writing) 'extern "C"' +template +void ext(writer &hdr, writer &src, const std::string &str, Ts &&...args) +{ + hdr("extern_c "+str, std::forward(args)...); + src( str, std::forward(args)...); +} + +// ppp +// Comment, prefixed in header file with "+++" +template +void ppp(writer &hdr, writer &src, const std::string &str, Ts &&...args) +{ + hdr("// +++ "+str, std::forward(args)...); + src("// " +str, std::forward(args)...); +} +template +void PPP(writer &hdr, writer &src, Ts &&...args) +{ + two(hdr,src); + ppp(hdr,src,std::forward(args)...); +} + +// mmm +// Comment, prefixed in header file with "---" +template +void mmm(writer &hdr, writer &src, const std::string &str, Ts &&...args) +{ + hdr("// --- "+str, std::forward(args)...); + src("// " +str, std::forward(args)...); +} +template +void MMM(writer &hdr, writer &src, Ts &&...args) +{ + two(hdr,src); + mmm(hdr,src,std::forward(args)...); +} + +// sig +// End C interface function signature; style dependent on hadFields bool +void sig(writer &hdr, writer &src, const bool hadFields = false) +{ + // header: end of parameters, semicolon for declaration + hdr(");"); + // source: end of parameters, left brace for definition + src(hadFields ? ") {" : ")\n{"); +} + +// ctype_param +// Get metadata type for parameter +std::string ctype_param(const InfoMetadata &m) +{ + return m.type == "std::string" + ? "char *const" + : m.type; +} + +// ctype_return +// Get metadata type for a return +std::string ctype_return(const InfoMetadata &m) +{ + return m.type == "std::string" + ? "const char *" + : m.type; +} + +// ctype +// Get child-node type, for the C interface +std::string ctype(const InfoChildren &c) +{ + // Why not ...2Const... in the first case? See: + // https://stackoverflow.com/questions/5055655 + // and: + // https://c-faq.com/ansi/constmismatch.html + // Remember that we're generating C code here, not C++ code. + return c.isVector + ? "ConstHandle2" + c.plain + " *const" + : "ConstHandle2Const" + c.plain; +} + +// section +template +void section(writer &hdr, writer &src, const std::string &str, Ts &&...args) +{ + two(hdr,src); + two(hdr,src); + two(hdr,src,largeComment); + two(hdr,src,str, std::forward(args)...); + two(hdr,src,largeComment); +} + + +// ----------------------------------------------------------------------------- +// fileCInterfaceCreateParams +// ----------------------------------------------------------------------------- + +void fileCInterfaceCreateParams(writer &hdr, writer &src, const PerClass &per) +{ + int count = 0; + const int total = per.nfields(); + + // metadata + for (const auto &m : per.metadata) { + two(hdr,src); + two(hdr,src,1,"const @ @@", + ctype_param(m), + m.name, + ++count < total ? "," : "", + false); + } + + // children + for (const auto &c : per.children) { + two(hdr,src); + two(hdr,src,1,"@ @@@", + ctype(c), + c.name, + c.isVector ? ", const size_t "+c.name+"Size" : "", + ++count < total ? "," : "", + false + ); + } + + // variants + // todo + + if (total) + two(hdr,src); +} + + +// ----------------------------------------------------------------------------- +// fileCInterfaceCreateCall +// ----------------------------------------------------------------------------- + +void fileCInterfaceCreateCall(writer &hdr, writer &src, const PerClass &per) +{ + // metadata + for (const auto &m : per.metadata) { + src(","); + src(2,"@", m.name, false); + } + + // children + for (const auto &c : per.children) { + src(","); + const std::string Child = c.plain; + const std::string child = c.name; + c.isVector + ? src(2,"std::vector{}", Child, false) + : src(2,"detail::tocpp(@)", Child, child, false); + } + + // variants + // todo + + src(); + src(1,");"); + for (const auto &c : per.children) { + if (!c.isVector) + continue; + const std::string Child = c.plain; + const std::string child = c.name; + src(1,"for (size_t @N = 0; @N < @Size; ++@N)", + Child, Child, child, Child); + src(2,"@@Add(handle, @[@N]);", + per.clname, Child, child, Child); + } + src(1,"return handle;"); + src("}"); +} + + +// ----------------------------------------------------------------------------- +// fileCInterfaceBasics +// ----------------------------------------------------------------------------- + +void fileCInterfaceBasics(writer &hdr, writer &src, const PerClass &per) +{ + // section comment + section( + hdr,src, + "// Basics\n" + "// Create, Assign, Delete" + ); + + // create: default, const + MMM(hdr,src,"Create, default, const"); + ext(hdr,src,"Handle2Const@", per.clname); + two(hdr,src,"@DefaultConst(", per.clname, false); + sig(hdr,src); + src(1,"return detail::createHandle"); + src(2,"(CLASSNAME, CLASSNAME+\"DefaultConst\");"); + src("}"); + + // create: default, non-const + PPP(hdr,src,"Create, default, non-const"); + ext(hdr,src,"Handle2@", per.clname); + two(hdr,src,"@Default(", per.clname, false); + sig(hdr,src); + src(1,"return detail::createHandle"); + src(2,"(CLASSNAME, CLASSNAME+\"Default\");"); + src("}"); + + // create: general, const + MMM(hdr,src,"Create, general, const"); + ext(hdr,src,"Handle2Const@", per.clname); + two(hdr,src,"@CreateConst(", per.clname, false); + fileCInterfaceCreateParams(hdr,src,per); + sig(hdr,src, per.nfields() != 0); + src(1,"ConstHandle2@ handle = detail::createHandle(", per.clname); + src(2,"CLASSNAME, CLASSNAME+\"CreateConst\"", false); + fileCInterfaceCreateCall(hdr,src,per); + + // create: general, non-const + PPP(hdr,src,"Create, general, non-const"); + ext(hdr,src,"Handle2@", per.clname); + two(hdr,src,"@Create(", per.clname, false); + fileCInterfaceCreateParams(hdr,src,per); + sig(hdr,src, per.nfields() != 0); + src(1,"ConstHandle2@ handle = detail::createHandle(", per.clname); + src(2,"CLASSNAME, CLASSNAME+\"Create\"", false); + fileCInterfaceCreateCall(hdr,src,per); + + // assign + PPP(hdr,src,"Assign"); + ppp(hdr,src,"Use this to assign one handled object to another. " + "Don't assign handles,"); + ppp(hdr,src,"as with to = from. That has a meaning that you probably " + "don't intend."); + ext(hdr,src,"void"); + two(hdr,src,"@Assign(", per.clname, false); + two(hdr,src,"ConstHandle2@ self, ConstHandle2Const@ from", + per.clname, per.clname, false); + sig(hdr,src); + src(1,"detail::assignHandle"); + src(2,"(CLASSNAME, CLASSNAME+\"Assign\", self, from);"); + src("}"); + + // delete + PPP(hdr,src,"Delete"); + ppp(hdr,src,"We'll attempt to remove no-longer-used objects " + "automatically, but you"); + ppp(hdr,src,"may improve performance if you delete them when " + "you're done with them."); + ext(hdr,src,"void"); + two(hdr,src,"@Delete(", per.clname, false); + two(hdr,src,"ConstHandle2Const@ self", per.clname, false); + sig(hdr,src); + src(1,"detail::deleteHandle"); + src(2,"(CLASSNAME, CLASSNAME+\"Delete\", self);"); + src("}"); +} // fileCInterfaceBasics + + +// ----------------------------------------------------------------------------- +// fileCInterfaceIO +// ----------------------------------------------------------------------------- + +void fileCInterfaceIO(writer &hdr, writer &src, const PerClass &per) +{ + // section comment + section( + hdr,src, + "// I/O\n" + "// Read, Write, Print\n" + "// Each returns 0 if failure, 1 if success." + ); + + // read from file + PPP(hdr,src,"Read from file"); + ppp(hdr,src,"File can be XML, JSON, or HDF5."); + ppp(hdr,src,"We'll examine the file's contents to determine " + "its type automatically."); + ext(hdr,src,"int"); + two(hdr,src,"@Read(", per.clname, false); + two(hdr,src,"ConstHandle2@ self, const char *const filename", + per.clname, false); + sig(hdr,src); + src(1,"return detail::readHandle"); + src(2,"(CLASSNAME, CLASSNAME+\"Read\", self, filename);"); + src("}"); + + // write to file + PPP(hdr,src,"Write to file"); + ppp(hdr,src,"File can be XML, JSON, or HDF5."); + ppp(hdr,src,"We'll use filename's extension to determine " + "the type you want written."); + ext(hdr,src,"int"); + two(hdr,src,"@Write(", per.clname, false); + two(hdr,src,"ConstHandle2Const@ self, const char *const filename", + per.clname, false); + sig(hdr,src); + src(1,"return detail::writeHandle"); + src(2,"(CLASSNAME, CLASSNAME+\"Write\", self, filename);"); + src("}"); + + // print + PPP(hdr,src,"Print to standard output, in our prettyprinting format"); + ext(hdr,src,"int"); + two(hdr,src,"@Print(", per.clname, false); + two(hdr,src,"ConstHandle2Const@ self", per.clname, false); + sig(hdr,src); + src(1,"return detail::printHandle"); + src(2,"(CLASSNAME, CLASSNAME+\"Print\", self);"); + src("}"); + + // print, XML + PPP(hdr,src,"Print to standard output, as XML"); + ext(hdr,src,"int"); + two(hdr,src,"@PrintXML(", per.clname, false); + two(hdr,src,"ConstHandle2Const@ self", per.clname, false); + sig(hdr,src); + src(1,"return detail::printHandle"); + src(2,"(CLASSNAME, CLASSNAME+\"PrintXML\", self, \"XML\");"); + src("}"); + + // print, JSON + PPP(hdr,src,"Print to standard output, as JSON"); + ext(hdr,src,"int"); + two(hdr,src,"@PrintJSON(", per.clname, false); + two(hdr,src,"ConstHandle2Const@ self", per.clname, false); + sig(hdr,src); + src(1,"return detail::printHandle"); + src(2,"(CLASSNAME, CLASSNAME+\"PrintJSON\", self, \"JSON\");"); + src("}"); +} // fileCInterfaceIO + + +// ----------------------------------------------------------------------------- +// fileCInterfaceVector +// ----------------------------------------------------------------------------- + +void fileCInterfaceVector( + writer &hdr, writer &src, + const PerClass &per, const std::string &type, + const bool isSection = true +) { + // section comment + if (isSection) + section(hdr,src,"// Data vector"); + else { + assert(type != ""); + two(hdr,src); + two(hdr,src,smallComment); + two(hdr,src,"// @", type); + two(hdr,src,smallComment); + } + + // dynamic type? + if (type == "") { + // for a C interface, these are probably sufficient + fileCInterfaceVector(hdr,src,per,"int", false); + fileCInterfaceVector(hdr,src,per,"unsigned",false); + fileCInterfaceVector(hdr,src,per,"float", false); + fileCInterfaceVector(hdr,src,per,"double", false); + return; + } + + // Example: + // type: "double" (parameter to the present function) + // Then: + // Class: "Foobar" (example class name) + // Types: "Doubles" + // fixme The determination of Types should probably be more general. + const std::string Class = per.clname; + const std::string Types = type == "std::string" + ? "Strings" + : capital(type) + 's'; + + // clear + PPP(hdr,src,"Clear"); + ext(hdr,src,"void"); + two(hdr,src,"@@Clear(", Class, Types, false); + two(hdr,src,"ConstHandle2@ self", Class, false); + sig(hdr,src); + src(1,"detail::vectorClear"); + src(2,"(CLASSNAME, CLASSNAME+\"@Clear\", self);", Types); + src("}"); + + // get size + PPP(hdr,src,"Get size"); + ext(hdr,src,"size_t"); + two(hdr,src,"@@Size(", Class, Types, false); + two(hdr,src,"ConstHandle2Const@ self", Class, false); + sig(hdr,src); + src(1,"return detail::vectorSize"); + src(2,"(CLASSNAME, CLASSNAME+\"@Size\", self);", Types); + src("}"); + + // get value + PPP(hdr,src,"Get value"); + ppp(hdr,src,"By index \\in [0,size)"); + ext(hdr,src,"@", type); + two(hdr,src,"@@Get(", Class, Types, false); + two(hdr,src,"ConstHandle2Const@ self, const size_t index", Class, false); + sig(hdr,src); + src(1,"return detail::vectorGet", type); + src(2,"(CLASSNAME, CLASSNAME+\"@Get\", self, index);", Types); + src("}"); + + // set value + PPP(hdr,src,"Set value"); + ppp(hdr,src,"By index \\in [0,size)"); + ext(hdr,src,"void"); + two(hdr,src,"@@Set(", Class, Types, false); + two(hdr,src,"ConstHandle2@ self, const size_t index, const @ value", + Class, type, false); + sig(hdr,src); + src(1,"detail::vectorSet", type); + src(2,"(CLASSNAME, CLASSNAME+\"@Set\", self, index, value);", Types); + src("}"); + + // fixme + // For now, we only have the following for non-std::string types. + // Supporting std::string here means we really need the equivalent + // of char** (pointer to pointer to char). + if (type != "std::string") { + // get pointer to existing values, const + MMM(hdr,src,"Get pointer to existing values, const"); + ext(hdr,src,"const @ *", type); + two(hdr,src,"@@GetArrayConst(", Class, Types, false); + two(hdr,src,"ConstHandle2Const@ self", Class, false); + sig(hdr,src); + src(1,"return detail::vectorGet", type); + src(2,"(CLASSNAME, CLASSNAME+\"@GetArrayConst\", self);", Types); + src("}"); + + // get pointer to existing values, non-const + PPP(hdr,src,"Get pointer to existing values, non-const"); + ext(hdr,src,"@ *", type); + two(hdr,src,"@@GetArray(", Class, Types, false); + two(hdr,src,"ConstHandle2@ self", Class, false); + sig(hdr,src); + src(1,"return detail::vectorGet", type); + src(2,"(CLASSNAME, CLASSNAME+\"@GetArray\", self);", Types); + src("}"); + + // set completely new values and size + PPP(hdr,src,"Set completely new values and size"); + ext(hdr,src,"void"); + two(hdr,src,"@@SetArray(", Class, Types, false); + two(hdr,src,"ConstHandle2@ self, const @ *const values, " + "const size_t size", + Class, type, false); + sig(hdr,src); + src(1,"return detail::vectorSet", type); + src(2,"(CLASSNAME, CLASSNAME+\"@SetArray\", self, size, values);", Types); + src("}"); + } +} // fileCInterfaceVector + + +// ----------------------------------------------------------------------------- +// fileCInterfaceMeta +// ----------------------------------------------------------------------------- + +void fileCInterfaceMeta( + writer &hdr, writer &src, + const PerClass &per, const InfoMetadata &m +) { + const std::string Class = per.clname; + const std::string Meta = UpperCamel(m.name); + const std::string meta = m.name; + + // section comment + section(hdr,src,"// Metadatum: @", meta); + + // has + PPP(hdr,src,"Has"); + ext(hdr,src,"int"); + two(hdr,src,"@@Has(", Class, Meta, false); + two(hdr,src,"ConstHandle2Const@ self", Class, false); + sig(hdr,src); + src(1,"return detail::hasField"); + src(2,"(CLASSNAME, CLASSNAME+\"@Has\", self, extract::@);", Meta, meta); + src("}"); + + // get + PPP(hdr,src,"Get"); + ppp(hdr,src,"Returns by value"); + ext(hdr,src,"@", ctype_return(m)); + two(hdr,src,"@@Get(", Class, Meta, false); + two(hdr,src,"ConstHandle2Const@ self", Class, false); + sig(hdr,src); + src(1,"return detail::getField"); + src(2,"(CLASSNAME, CLASSNAME+\"@Get\", self, extract::@);", Meta, meta); + src("}"); + + // set + PPP(hdr,src,"Set"); + ext(hdr,src,"void"); + two(hdr,src,"@@Set(", Class, Meta, false); + two(hdr,src,"ConstHandle2@ self, const @ @", + Class, ctype_param(m), meta, false); + sig(hdr,src); + src(1,"detail::setField"); + src(2,"(CLASSNAME, CLASSNAME+\"@Set\", self, extract::@, @);", + Meta, meta, meta); + src("}"); +} // void fileCInterfaceMeta + + +// ----------------------------------------------------------------------------- +// fileCInterfaceChild +// ----------------------------------------------------------------------------- + +void fileCInterfaceChild( + writer &hdr, writer &src, + const PerClass &per, const InfoChildren &c, const InfoSpecs &specs +) { + const std::string Class = per.clname; + const std::string Child = c.plain; + const std::string child = c.name; + + // section comment + section(hdr,src,"// Child: @", child); + + // has + PPP(hdr,src,"Has"); + ext(hdr,src,"int"); + two(hdr,src,"@@Has(", Class, Child, false); + two(hdr,src,"ConstHandle2Const@ self", Class, false); + sig(hdr,src); + src(1,"return detail::hasField"); + src(2,"(CLASSNAME, CLASSNAME+\"@Has\", self, extract::@);", Child, child); + src("}"); + + // ------------------------ + // scalar case + // ------------------------ + + if (!c.isVector) { + // get, const + MMM(hdr,src,"Get, const"); + ext(hdr,src,"Handle2Const@", Child); + two(hdr,src,"@@GetConst(", Class, Child, false); + two(hdr,src,"ConstHandle2Const@ self", Class, false); + sig(hdr,src); + src(1,"return detail::getField", Child); + src(2,"(CLASSNAME, CLASSNAME+\"@GetConst\", self, extract::@);", + Child, child); + src("}"); + + // get, non-const + PPP(hdr,src,"Get, non-const"); + ext(hdr,src,"Handle2@", Child); + two(hdr,src,"@@Get(", Class, Child, false); + two(hdr,src,"ConstHandle2@ self", Class, false); + sig(hdr,src); + src(1,"return detail::getField", Child); + src(2,"(CLASSNAME, CLASSNAME+\"@Get\", self, extract::@);", Child, child); + src("}"); + + // set + PPP(hdr,src,"Set"); + ext(hdr,src,"void"); + two(hdr,src,"@@Set(", Class, Child, false); + two(hdr,src,"ConstHandle2@ self, ConstHandle2Const@ @", + Class, Child, child, false); + sig(hdr,src); + src(1,"detail::setField", Child); + src(2,"(CLASSNAME, CLASSNAME+\"@Set\", self, extract::@, @);", + Child, child, child); + src("}"); + + // done with this child + return; + } + + // ------------------------ + // vector case + // ------------------------ + + // clear + PPP(hdr,src,"Clear"); + ext(hdr,src,"void"); + two(hdr,src,"@@Clear(", Class, Child, false); + two(hdr,src,"ConstHandle2@ self", Class, false); + sig(hdr,src); + src(1,"detail::clearContainer"); + src(2,"(CLASSNAME, CLASSNAME+\"@Clear\", self, extract::@);", Child, child); + src("}"); + + // size + PPP(hdr,src,"Size"); + ext(hdr,src,"size_t"); + two(hdr,src,"@@Size(", Class, Child, false); + two(hdr,src,"ConstHandle2Const@ self", Class, false); + sig(hdr,src); + src(1,"return detail::sizeOfContainer"); + src(2,"(CLASSNAME, CLASSNAME+\"@Size\", self, extract::@);", Child, child); + src("}"); + + // add + PPP(hdr,src,"Add"); + ext(hdr,src,"void"); + two(hdr,src,"@@Add(", Class, Child, false); + two(hdr,src,"ConstHandle2@ self, ", Class, false); + two(hdr,src,"ConstHandle2Const@ @", Child, child, false); + sig(hdr,src); + src(1,"detail::addToContainer", Child); + src(2,"(CLASSNAME, CLASSNAME+\"@Add\", self, extract::@, @);", + Child, child, child); + src("}"); + + // get, by index, const + MMM(hdr,src,"Get, by index \\in [0,size), const"); + ext(hdr,src,"Handle2Const@", Child); + two(hdr,src,"@@GetConst(", Class, Child, false); + two(hdr,src,"ConstHandle2Const@ self, ", Class, false); + two(hdr,src,"const size_t index_", false); + sig(hdr,src); + src(1,"return detail::getByIndex", Child); + src(2,"(CLASSNAME, CLASSNAME+\"@GetConst\", self, extract::@, index_);", + Child, child); + src("}"); + + // get, by index, non-const + PPP(hdr,src,"Get, by index \\in [0,size), non-const"); + ext(hdr,src,"Handle2@", Child); + two(hdr,src,"@@Get(", Class, Child, false); + two(hdr,src,"ConstHandle2@ self, ", Class, false); + two(hdr,src,"const size_t index_", false); + sig(hdr,src); + src(1,"return detail::getByIndex", Child); + src(2,"(CLASSNAME, CLASSNAME+\"@Get\", self, extract::@, index_);", + Child, child); + src("}"); + + // set, by index + PPP(hdr,src,"Set, by index \\in [0,size)"); + ext(hdr,src,"void"); + two(hdr,src,"@@Set(", Class, Child, false); + two(hdr,src); + two(hdr,src,1,"ConstHandle2@ self,", Class); + two(hdr,src,1,"const size_t index_,"); + two(hdr,src,1,"ConstHandle2Const@ @", Child, child); + sig(hdr,src,true); + src(1,"detail::setByIndex", Child); + src(2,"(CLASSNAME, CLASSNAME+\"@Set\", self, extract::@, index_, @);", + Child, child, child); + src("}"); + + // ------------------------ + // for this child's + // metadata + // ------------------------ + + // first make sure that we know about this class + const auto it = specs.class2data.find(NamespaceAndClass(c.ns,c.plain)); + if (it == specs.class2data.end()) { + log::warning( + "Unable to generate C interface has/get/set functions for:\n" + " class: {}::{}\n" + " child: {}::{}\n" + "Child class is unknown, so its metadata for has/get/set are unknown.", + per.nsname, Class, + c.ns, Child + ); + return; + } + + // has, get const, get non-const, set + for (const auto &m : it->second.metadata) { + const std::string Meta = UpperCamel(m.name); + const std::string meta = m.name; + + // subsection header + two(hdr,src); + two(hdr,src,smallComment); + two(hdr,src,"// Re: metadatum @", meta); + two(hdr,src,smallComment); + + // has, by metadatum + PPP(hdr,src,"Has, by @", meta); + ext(hdr,src,"int"); + two(hdr,src,"@@HasBy@(", Class, Child, Meta, false); + two(hdr,src); + two(hdr,src,1,"ConstHandle2Const@ self,", Class); + two(hdr,src,1,"const @ @", ctype_param(m), meta); + sig(hdr,src,true); + src(1,"return detail::hasByMetadatum"); + src(2,"(CLASSNAME, CLASSNAME+\"@HasBy@\",", Child, Meta); + src(2," self, extract::@, meta::@, @);", child, meta, meta); + src("}"); + + // get, by metadatum, const + MMM(hdr,src,"Get, by @, const", meta); + ext(hdr,src,"Handle2Const@", Child); + two(hdr,src,"@@GetBy@Const(", Class, Child, Meta, false); + two(hdr,src); + two(hdr,src,1,"ConstHandle2Const@ self,", Class); + two(hdr,src,1,"const @ @", ctype_param(m), meta); + sig(hdr,src,true); + src(1,"return detail::getByMetadatum", Child); + src(2,"(CLASSNAME, CLASSNAME+\"@GetBy@Const\",", Child, Meta); + src(2," self, extract::@, meta::@, @);", child, meta, meta); + src("}"); + + // get, by metadatum, non-const + PPP(hdr,src,"Get, by @, non-const", meta); + ext(hdr,src,"Handle2@", Child); + two(hdr,src,"@@GetBy@(", Class, Child, Meta, false); + two(hdr,src); + two(hdr,src,1,"ConstHandle2@ self,", Class); + two(hdr,src,1,"const @ @", ctype_param(m), meta); + sig(hdr,src,true); + src(1,"return detail::getByMetadatum", Child); + src(2,"(CLASSNAME, CLASSNAME+\"@GetBy@\",", Child, Meta); + src(2," self, extract::@, meta::@, @);", child, meta, meta); + src("}"); + + // set, by metadatum + PPP(hdr,src,"Set, by @", meta); + ext(hdr,src,"void"); + two(hdr,src,"@@SetBy@(", Class, Child, Meta, false); + two(hdr,src); + two(hdr,src,1,"ConstHandle2@ self,", Class); + two(hdr,src,1,"const @ @,", ctype_param(m), meta); + two(hdr,src,1,"ConstHandle2Const@ @", Child, child); + sig(hdr,src,true); + src(1,"detail::setByMetadatum", Child); + src(2,"(CLASSNAME, CLASSNAME+\"@SetBy@\",", Child, Meta); + src(2," self, extract::@, meta::@, @, @);", child, meta, meta, child); + src("}"); + } // metadata +} // fileCInterfaceChild + + +// ----------------------------------------------------------------------------- +// For the C interface +// ----------------------------------------------------------------------------- + +// ------------------------ +// fileCInterfaceHeader +// ------------------------ + +void fileCInterfaceHeader( + writer &hdr, const InfoSpecs &specs, + const PerClass &per, const Class2Dependencies &c2d +) { + // Initial remarks + hdr(); + hdr("// Interface for C"); + hdr("// This header file is designed to work with both C and C++"); + hdr("// Function definitions are in this file's .cpp source"); + hdr(); + + // Instructions + hdr(largeComment); + hdr(largeComment); + hdr("// Instructions for Users"); + hdr("//"); + hdr("// Constructs you're MORE likely to care about are preceded with:"); + hdr("// // +++ remark"); + hdr("// Constructs you're LESS likely to care about are preceded with:"); + hdr("// // --- remark"); + hdr("// Anything not marked as above can be ignored by most users."); + hdr("//"); + hdr("// @ is the basic handle type in this file. Example:", per.clname); + hdr("// // Create a default @ object:", per.clname); + hdr("// @ handle = @Default();", per.clname, per.clname); + hdr("// Functions involving @ are declared throughout this file.", + per.clname); + hdr(largeComment); + hdr(largeComment); + + // Preliminaries + section(hdr, "// Preliminaries"); + const std::string guard = + allcaps(specs.Project) + "_" + + allcaps(specs.VersionUnderscore) + "_" + + allcaps(per.nsname) + "_" + + allcaps(per.clname); + + hdr(); + hdr("#ifndef C_INTERFACE_@", guard); + hdr("#define C_INTERFACE_@", guard); + hdr(); + hdr("#include \"GNDStk.h\""); + for (const auto &dep : c2d.dependencies) + hdr("#include \"@/@/@.h\"", specs.Version, dep.nsname, dep.clname); + hdr(); + hdr("#ifdef __cplusplus"); + hdr(1,"#define extern_c extern \"C\""); + hdr("#else"); + hdr(1,"#define extern_c"); + hdr("#endif"); + hdr(); + hdr("// Proxy C struct for the handled C++ class"); + hdr("struct @Class { };", per.clname); + + // Handle types + section(hdr, "// Handle types"); + hdr(); + hdr("// +++ @", per.clname); + hdr("// +++ General handle, suitable for most users. " + "If you're not concerned about"); + hdr("// +++ strict \"const correctness\" in your C code, " + "you can probably use this in"); + hdr("// +++ place of any function parameter of a const-aware handle type."); + hdr("typedef struct @Class *@;", per.clname, per.clname); + hdr(); + hdr("// --- Const-aware handles."); + hdr("typedef const struct @Class *const ConstHandle2Const@;", + per.clname, per.clname); + hdr("typedef struct @Class *const ConstHandle2@;", + per.clname, per.clname); + hdr("typedef const struct @Class * Handle2Const@;", + per.clname, per.clname); + hdr("typedef struct @Class * Handle2@;", + per.clname, per.clname); +} // fileCInterfaceHeader + + +// ------------------------ +// fileCInterfaceSource +// ------------------------ + +void fileCInterfaceSource( + writer &src, const InfoSpecs &specs, + const PerClass &per, const Class2Dependencies &c2d +) { + // includes + src(); + src("#include \"@/@/@/@.hpp\"", + specs.Project, specs.Version, per.nsname, per.clname); + src("#include \"@.h\"", per.clname); + src(); + + // using namespace + src("using namespace njoy::GNDStk;"); + src("using namespace @::@;", specs.Project, specs.VersionUnderscore); + src(); + + // using + src("using C = @Class;", per.clname); + src("using CPP = multigroup::@;", per.clname); + src(); + + // class name + src("static const std::string CLASSNAME = \"@\";", per.clname); + + // extract: namespace begin + if (per.nfields()) { + src(); + src("namespace extract {"); + } + + // extract: metadata + for (const auto &m : per.metadata) + src(1,"static auto @ = [](auto &obj) { return &obj.@; };", + m.name, m.name); + + // extract: children + for (const auto &c : per.children) + src(1,"static auto @ = [](auto &obj) { return &obj.@; };", + c.name, c.name); + + // extract: variants + // todo + + // extract: namespace end + if (per.nfields()) src("}"); + + if (c2d.dependencies.size()) + src(); + for (const auto &dep : c2d.dependencies) + src("using CPP@ = @::@;", dep.clname, dep.nsname, dep.clname); +} // fileCInterfaceSource + + +// ------------------------ +// fileCInterfaceCommon +// ------------------------ + +void fileCInterfaceCommon( + writer &hdr, writer &src, + const InfoSpecs &specs, + const PerClass &per, const Class2Dependencies &c2d +) { + // Basics: create, assign, delete + fileCInterfaceBasics(hdr,src, per); + + // IO: read, write, print + fileCInterfaceIO(hdr,src, per); + + // Array support, if BlockData + if (per.isDataVector) + fileCInterfaceVector(hdr,src, per, per.elementType); + + // Functions regarding metadata + for (const auto &m : per.metadata) + fileCInterfaceMeta(hdr,src, per, m); + + // Functions regarding children + for (const auto &c : per.children) + fileCInterfaceChild(hdr,src, per, c, specs); + + // Functions regarding variants + // todo +} // fileCInterfaceCommon + + +// ------------------------ +// fileCInterface +// ------------------------ + +void fileCInterface( + const InfoSpecs &specs, const PerClass &per, const Class2Dependencies &c2d +) { + // header beginning + writer hdr(per.headerC); + fileCInterfaceHeader(hdr, specs, per, c2d); + + // source beginning + writer src(per.sourceC); + fileCInterfaceSource(src, specs, per, c2d); + + // common, or partially common, to both header and source + fileCInterfaceCommon(hdr,src, specs, per, c2d); + + // header: customization #include, then done + section(hdr, "// Custom functionality"); + hdr(); + hdr("#include \"@/@/@/src/custom.h\"", + specs.Version, per.nsname, per.clname); + hdr(); + hdr("#undef extern_c"); + hdr("#endif"); + + // source: customization #include, then done + section(src, "// Custom functionality"); + src(); + src("#include \"@/@/@/src/custom.cpp\"", + specs.Version, per.nsname, per.clname); +} // fileCInterface diff --git a/autogen/json2class-cpp.cpp b/autogen/json2class-cpp.cpp new file mode 100644 index 000000000..1ccb00054 --- /dev/null +++ b/autogen/json2class-cpp.cpp @@ -0,0 +1,1069 @@ + +// ----------------------------------------------------------------------------- +// writeClassPrefix +// ----------------------------------------------------------------------------- + +void writeClassPrefix(writer &out, const PerClass &per) +{ + // namespace + out("namespace @ {", per.nsname); + + // comment introducing class + out(); + out(largeComment); + out("// @::", per.nsname); + out("// class @", per.clname); + out(largeComment); + + // class begin + // A namespace prefix in Component<> prevents possible ambiguities with the + // Child<> object, for the class, brought in through key.hpp. Normally the + // class name is capitalized while the Child<> object isn't, but if the node + // name was already capitalized in the specs (an example we encountered was + // the name "XYs1d"), then the Child<> key would reflect that. Then, without + // the nsname:: below, we'd have an ambiguity. + out(); + out("class @ :", per.clname); + + if (per.isDataVector && per.elementType == "") { + out(1,"public Component<@::@,true>", per.nsname, per.clname); + } else if (per.isDataVector) { + out(1,"public Component<@::@>,", per.nsname, per.clname); + out(1,"public DataNode,@>", per.elementType, + per.cdata ? "true" : "false"); + } else if (per.isDataString) { + out(1,"public Component<@::@>,", per.nsname, per.clname); + out(1,"public DataNode", + std::string(per.cdata ? "true" : "false")); + } else { + out(1,"public Component<@::@>", per.nsname, per.clname); + } + + out("{"); + out(1,"friend class Component;"); +} // writeClassPrefix + + +// ----------------------------------------------------------------------------- +// writeClassForComponent +// ----------------------------------------------------------------------------- + +void writeClassForComponent(writer &out, const PerClass &per) +{ + // using [name for variant] = ... + if (per.variants.size()) + out(); + for (const auto &v : per.variants) { + out(1,"using @ = std::variant<", v.type); + int count = 0; + const int total = v.children.size(); + for (const auto &c : v.children) + out(2,"@@", c.type, sep(count,total)); + out(1,">;"); + } + + // ------------------------ + // Simple functions + // ------------------------ + + out(); + out(1,smallComment); + out(1,"// For Component"); + out(1,smallComment); + out(); + out(1,"// Names: this namespace and class, " + "and original nodes (as in XML <...>)"); + out(1,"static auto NAMESPACE() { return \"@\"; }", per.nsname); + out(1,"static auto CLASS() { return \"@\"; }", per.clname); + out(1,"static auto NODENAME() { return \"@\"; }", per.nameGNDS); + + // ------------------------ + // KEYS() + // ------------------------ + + // KEYS() begin + out(); + out(1,"// Core Interface multi-query to transfer information " + "to/from core Nodes"); + out(1,"static auto KEYS()"); + out(1,"{"); + + // KEYS() contents + int count = 0; + const int total = per.nfields() + int(per.isDataNode); + out(2,"return"); + + // comment + out(3,"// comment"); + out(3,"++Child(special::comment) / CommentConverter{}@", + std::string(total ? " |" : "")); + + // metadata + if (per.metadata.size()) { + out(); + out(3,"// metadata"); + } + for (const auto &m : per.metadata) { + out(3,"@{@}", m.typeFull, initializer(m)); + out(4,"/ Meta<>(\"@\")@@", + m.original, + // direct-specified converter, if any + m.converter == "" ? "" : (" / " + m.converter), + // separator between next entry + ++count < total ? " |" : "" + ); + } + + // children + if (per.children.size() || per.variants.size()) { + out(); + out(3,"// children"); + } + for (const auto &c : per.children) { + out(3,"@Child<@>", + c.isVector ? "++" : "--", + c.typeHalf // without any std::vector + ); + out(4,"(\"@\")@@@@", + c.original, + // direct-specified converter, if any + c.converter == "" ? "" : (" / " + c.converter), + // direct-specified filter, if any + c.filter == "" ? "" : (" + " + c.filter), + // simple filter: value required for metadatum label, if any; + // this augments (it doesn't replace) any direct-given filter + c.label == "" ? "" : (" | \"" + c.label + '"'), + // separator between next entry + ++count < total ? " |" : "" + ); + } + + // variants + for (const auto &v : per.variants) { + out(3,"@{}", v.typeHalf); // without any std::vector + out(4,"/ @(", v.isVector ? "++" : "--", false); + int n = 0; // for alternatives; not to be confused w/count + for (const auto &c : v.children) + out("@Child<>(\"@\")", n++ == 0 ? "" : " || ", c.name, false); + out(")@", + ++count < total ? " |" : "" + ); + } + + // data + if (per.isDataNode) { + out(); + out(3,"// data"); + out(3,"--Child(special::self) / DataConverter{}"); + } + + // KEYS() end + out(2,";"); + out(1,"}"); + + // ------------------------ + // FIELDNAMES() + // ------------------------ + + out(); + out(1,"// Data member names. " + "Usually - but not necessarily - the same as the node"); + out(1,"// names appearing in KEYS(). " + "These are used by Component's prettyprinter."); + out(1,"static const auto &FIELDNAMES()"); + out(1,"{"); + out(2,"static const std::vector names = {"); + + count = 0; + out(3,"\"comment\"@", std::string(total ? "," : "")); + for (const auto &m : per.metadata) + out(3,"\"@\"@", m.name, ++count < total ? "," : ""); + for (const auto &c : per.children) + out(3,"\"@\"@", c.name, ++count < total ? "," : ""); + for (const auto &v : per.variants) + out(3,"\"@\"@", v.name, ++count < total ? "," : ""); + + // Here, and in the Python case below, I'm not - for now - dealing with + // the case of a dynamic data type, as with the "valueType" flag discussed + // in the original GNDS specs. We may or may not really need support for + // that If we do, we'll perhaps end up with several names: at least ints, + // doubles, and strings. The way we use *references* in the C++ classes + // (referring from inside the class to the base DataNode in the + // vector case), isn't compatible, as-is, with the dynamic data type case. + // There, I suppose we'd need a reference to the variant that can contain + // vector. (For python bindings we call functions, rather + // than having references of some sort.) + if (per.isDataNode) { + if (per.isDataString) + out(3,"\"string\""); + else { + auto it = nameMap.find(per.elementType); + if (it != nameMap.end()) + out(3,"\"@\"", it->second.second); + else + out(3,"\"\""); // really shouldn't happen + } + } + + out(2,"};"); + out(2,"return names;"); + out(1,"}"); + + // ------------------------ + // PYTHONNAMES() + // ------------------------ + + out(); + out(1,"// Data member names, as they'll be presented " + "in the Python bindings."); + out(1,"static const auto &PYTHONNAMES()"); + out(1,"{"); + out(2,"static const std::vector names = {"); + + count = 0; + out(3,"\"comment\"@", std::string(total ? "," : "")); + for (const auto &m : per.metadata) + out(3,"\"@\"@", namePython(m.name), ++count < total ? "," : ""); + for (const auto &c : per.children) + out(3,"\"@\"@", namePython(c.name), ++count < total ? "," : ""); + for (const auto &v : per.variants) + out(3,"\"@\"@", namePython(v.name), ++count < total ? "," : ""); + + if (per.isDataNode) { + if (per.isDataString) + out(3,"\"string\""); + else { + auto it = nameMap.find(per.elementType); + if (it != nameMap.end()) + out(3,"\"@\"", it->second.second); + else + out(3,"\"\""); // really shouldn't happen + } + } + + out(2,"};"); + out(2,"return names;"); + out(1,"}"); +} // writeClassForComponent + + +// ----------------------------------------------------------------------------- +// writeClassSuffix +// ----------------------------------------------------------------------------- + +void writeClassSuffix( + writer &out, const PerClass &per, const InfoSpecs &specs +) { + // ------------------------ + // assignment + // ------------------------ + + out(); + out(1,smallComment); + out(1,"// Assignment operators"); + out(1,smallComment); + out(); + + // copy + out(1,"// copy"); + out(1,"@ &operator=(const @ &other)", per.clname, per.clname); + out(1,"{"); + out(2,"if (this != &other) {"); + if (printCtorCalls) + out(3,"std::cout << \"assign: @: copy\" << std::endl;", per.clname); + out(3,"Component::operator=(other);"); + if (per.isDataNode) + out(3,"DataNode::operator=(other);"); + out(3,"comment = other.comment;"); + if (per.nfields() > 0) { + for (const auto &m : per.metadata) + out(3,"@ = other.@;", m.name, m.name); + for (const auto &c : per.children) + out(3,"@ = other.@;", c.name, c.name); + for (const auto &v : per.variants) + out(3,"@ = other.@;", v.name, v.name); + } + out(2,"}"); + out(2,"return *this;"); + out(1,"}"); + out(); + + // move + out(1,"// move"); + out(1,"@ &operator=(@ &&other)", per.clname, per.clname); + out(1,"{"); + out(2,"if (this != &other) {"); + if (printCtorCalls) + out(3,"std::cout << \"assign: @: move\" << std::endl;", per.clname); + out(3,"Component::operator=(std::move(other));"); + if (per.isDataNode) + out(3,"DataNode::operator=(std::move(other));"); + out(3,"comment = std::move(other.comment);"); + if (per.nfields() > 0) { + for (const auto &m : per.metadata) + out(3,"@ = std::move(other.@);", m.name, m.name); + for (const auto &c : per.children) + out(3,"@ = std::move(other.@);", c.name, c.name); + for (const auto &v : per.variants) + out(3,"@ = std::move(other.@);", v.name, v.name); + } + out(2,"}"); + out(2,"return *this;"); + out(1,"}"); + + // ------------------------ + // customization #include + // ------------------------ + + out(); + out(1,smallComment); + out(1,"// Custom functionality"); + out(1,smallComment); + out(); + out(1,"#include \"@/@/@/@/src/custom.hpp\"", + specs.Project, specs.Version, per.nsname, per.clname); + + // this *follows* the customization #include (because it might be used there) + out(1,"#undef NJOY_GNDSTK_COMPONENT"); + + // ------------------------ + // class+namespace end + // ------------------------ + + out("}; // class @", per.clname); + out(); + out("} // namespace @", per.nsname); +} // writeClassSuffix + + +// ----------------------------------------------------------------------------- +// writeClass* +// For metadata, children, and variant children +// ----------------------------------------------------------------------------- + +// writeClassContentMetadata +void writeClassContentMetadata( + writer &out, const PerClass &per, + std::string &title +) { + if (per.metadata.size()) { + out(); + out(1,"// metadata"); + } + + for (const auto &m : per.metadata) { + if (m.type == "bool" && m.isOptional) { + std::cout + << title + << color::custom::red + << " Metadatum will be an optional bool (not recommended): " + << color::custom::blue << m.name + << color::reset << std::endl; + title = ""; + } + + if (per.isDataVector && per.elementType == "" && + (m.name == "length" || m.name == "start" || m.name == "valueType") + ) { + out(1,"mutable Field<@>", m.typeFull); + out(2,"@{this", m.name, false); + } else { + out(1,"Field<@>", m.typeFull); + out(2,"@{this", m.name, false); + } + if (m.defaultValue != "") + out(",defaults.@", m.name, false); + out("};"); + } +} + +// writeClassContentChildren +void writeClassContentChildren(writer &out, const PerClass &per) +{ + if (per.children.size()) { + out(); + out(1,"// children"); + } + + for (const auto &c : per.children) { + out(1,"Field<@>", c.typeFull); + out(2,"@{this};", c.name); + + if (debugging && c.name == "xs") { + // todo + // Consider some terminology changes... + // ns ==> nsname + // plain ==> key (as in, the JSON key) + // typeFull ==> ? + // typeHalf ==> ? + // Also ordering: + // nsname + // key + // name + // type + // typeFull + // typeHalf + std::cout << "name == " << c.name << std::endl; + std::cout << "ns == " << c.ns << std::endl; + std::cout << "plain == " << c.plain << std::endl; + std::cout << "type == " << c.type << std::endl; + std::cout << "typeFull == " << c.typeFull << std::endl; + std::cout << "typeHalf == " << c.typeHalf << std::endl; + } + } +} + +// writeClassContentVariants +void writeClassContentVariants(writer &out, const PerClass &per) +{ + if (per.variants.size()) { + out(); + out(1,"// children - variant"); + } + + for (const auto &v : per.variants) { + out(1,"Field<@>", v.typeFull); + out(2,"@{this};", v.name); + + for (const auto &c : v.children) { + out(1,"FieldPart @{@};", + v.name, c.type, c.name, v.name); + } + } +} + + +// ----------------------------------------------------------------------------- +// writeClassCtor* +// ----------------------------------------------------------------------------- + +// writeClassCtorComponent +void writeClassCtorComponent( + writer &out, const PerClass &per, const bool copyOrMove, + const bool newline = true +) { + out(2,"NJOY_GNDSTK_COMPONENT(@)", + std::string(copyOrMove ? "other.baseBlockData()" : "BlockData{}"), + newline); +} + + +// writeClassCtorBody +void writeClassCtorBody( + writer &out, + const std::string &kind, + const std::string &clname, + const std::string &argName +) { + out(1,"{"); + if (printCtorCalls) + out(2,"std::cout << \"ctor: @: @\" << std::endl;", clname, kind); + out(2,"Component::finish(@);", argName); + out(1,"}"); +} + + +// writeClassCtors +void writeClassCtors(writer &out, const PerClass &per) +{ + // ------------------------ + // macro + // ------------------------ + + int count; const int total = per.nfields(); + + out(); + out(1,"#define NJOY_GNDSTK_COMPONENT(blockdata) \\"); + out(1,"Component( \\"); + out(2,"blockdata, \\"); + out(2,"this->comment@ \\", std::string(total || per.isDataNode ? "," : "")); + count = 0; + for (const auto &m : per.metadata) + out(2,"this->@@ \\", m.name, + ++count < total || per.isDataNode ? "," : ""); + for (const auto &c : per.children) + out(2,"this->@@ \\", c.name, + ++count < total || per.isDataNode ? "," : ""); + for (const auto &v : per.variants) + out(2,"this->@@ \\", v.name, + ++count < total || per.isDataNode ? "," : ""); + if (per.isDataNode) + out(2,"static_cast(*this) \\"); + out(1,")"); + + // ------------------------ + // ctor: default + // ------------------------ + + out(); + out(1,"// default"); + out(1,"@() :", per.clname); + writeClassCtorComponent(out, per, false); + writeClassCtorBody(out, "default", per.clname, ""); + + // ------------------------ + // ctor: from fields + // ------------------------ + + if (total > 0) { + out(); + + // comment for this constructor + out(1,"// from fields, comment excluded"); + + // informational message, if applicable + for (const auto &m : per.metadata) + if (m.isDefaulted) { + out(1,"// optional replaces Defaulted; " + "this class knows the default(s)"); + break; + } + + // signature + count = 0; + out(1,"explicit @(", per.clname); + + for (const auto &m : per.metadata) { + out(2,"const wrapper<@>", + m.isDefaulted ? "std::optional<" + m.type + ">" : m.typeFull); + out(3,"&@@@", + m.name, count ? " = {}" : "", count+1 < total ? "," : ""); + count++; + } + for (const auto &c : per.children) { + out(2,"const wrapper<@>", + c.typeFull); + out(3,"&@@@", + c.name, count ? " = {}" : "", count+1 < total ? "," : ""); + count++; + } + for (const auto &v : per.variants) { + out(2,"const wrapper<@>", + v.typeFull); + out(3,"&@@@", + v.name, count ? " = {}" : "", count+1 < total ? "," : ""); + count++; + } + + // base constructor call + out(1,") :"); + writeClassCtorComponent(out, per, false, false); + + // initialize fields + out(","); + count = 0; + for (const auto &m : per.metadata) + if (m.isDefaulted) + out(2,"@(this,defaults.@,@)@", + m.name, m.name, m.name, sep(count,total)); + else + out(2,"@(this,@)@", m.name, m.name, sep(count,total)); + for (const auto &c : per.children) + out(2,"@(this,@)@", c.name, c.name, sep(count,total)); + for (const auto &v : per.variants) + out(2,"@(this,@)@", v.name, v.name, sep(count,total)); + + // body + writeClassCtorBody(out, "fields", per.clname, ""); + } + + // ------------------------ + // ctor: node + // ------------------------ + + out(); + out(1,"// from node"); + out(1,"explicit @(const Node &node) :", per.clname); + writeClassCtorComponent(out, per, false); + writeClassCtorBody(out, "node", per.clname, "node"); + + // ------------------------ + // ctor: vector + // ------------------------ + + if (per.isDataVector && per.elementType == "") { + out(); + out(1,"// from vector"); + out(1,"template>>"); + out(1,"explicit @(const std::vector &vector) :", + per.clname); + writeClassCtorComponent(out, per, false); + writeClassCtorBody(out, "vector", per.clname, "vector"); + } else if (per.isDataVector) { + out(); + out(1,"// from vector<@>", per.elementType); + out(1,"explicit @(const std::vector<@> &vector) :", + per.clname, per.elementType); + writeClassCtorComponent(out, per, false,false); + out(","); + out(2,"DataNode(vector)"); + writeClassCtorBody(out, "vector", per.clname, "vector"); + } else if (per.isDataString) { + // todo + // Perhaps construction from std::string here, as we do with std::vector + // above, but we need to be careful. What if the class has a std::string + // metadatum and no other fields? Then, I think, the constructor created + // here would conflict with the "from fields" constructor. And, actually, + // perhaps this sort of thing can happen in relation to std::vector too. + // With other priorities being more pressing, let's address these concerns + // only if and when necessary. + } + + // ------------------------ + // ctor: copy + // ------------------------ + + out(); + out(1,"// copy"); + out(1,"@(const @ &other) :", per.clname, per.clname); + writeClassCtorComponent(out, per, true, false); + out(","); + if (per.isDataNode) + out(2,"DataNode(other),"); + out(2,"comment(this,other.comment)@", std::string(total ? "," : "")); + count = 0; + for (const auto &m : per.metadata) + out(2,"@(this,other.@)@", m.name, m.name, sep(count,total)); + for (const auto &c : per.children) + out(2,"@(this,other.@)@", c.name, c.name, sep(count,total)); + for (const auto &v : per.variants) + out(2,"@(this,other.@)@", v.name, v.name, sep(count,total)); + writeClassCtorBody(out, "copy", per.clname, "other"); + + // ------------------------ + // ctor: move + // ------------------------ + + out(); + out(1,"// move"); + out(1,"@(@ &&other) :", per.clname, per.clname); + writeClassCtorComponent(out, per, true, false); + out(","); + if (per.isDataNode) + out(2,"DataNode(std::move(other)),"); + out(2,"comment(this,std::move(other.comment))@", + std::string(total ? "," : "")); + count = 0; + for (const auto &m : per.metadata) + out(2,"@(this,std::move(other.@))@", m.name, m.name, sep(count,total)); + for (const auto &c : per.children) + out(2,"@(this,std::move(other.@))@", c.name, c.name, sep(count,total)); + for (const auto &v : per.variants) + out(2,"@(this,std::move(other.@))@", v.name, v.name, sep(count,total)); + writeClassCtorBody(out, "move", per.clname, "other"); +} // writeClassCtors + + +// ----------------------------------------------------------------------------- +// writeClass +// ----------------------------------------------------------------------------- + +void writeClass( + const InfoSpecs &specs, std::string &title, + const PerClass &per, std::string &code) +{ + // false: no "file was autogenerated" message, because in writeClass we're + // writing certain class contents to a string, not writing an entire file. + writer out(false); + + // output: class begin + writeClassPrefix(out, per); + + // output: for the Component base + writeClassForComponent(out, per); + + // section: public interface + out(); + out(1,smallComment); + out(1,"// Public interface"); + out(1,smallComment); + out(); + out("public:"); + + // output: using directives + out(); + out(1,"using component_t = Component;"); + out(1,"using Component::construct;"); + if (per.isDataVector && per.elementType == "") + out(1,"using BlockData::operator=;"); + else if (per.isDataNode) + out(1,"using DataNode::operator=;"); + + // output: defaults (applicable only to metadata) + size_t ndefaults = 0; + for (const auto &m : per.metadata) + if (m.isDefaulted) + ++ndefaults; + if (ndefaults > 0) { + out(); + out(1,"// defaults"); + out(1,"static inline const struct Defaults {"); + for (const auto &m : per.metadata) + if (m.isDefaulted) + out(2,"static inline const @ @ = @;", + m.type, m.name, initializer(m)); + out(1,"} defaults;"); + } + + // section: data members + out(); + out(1,smallComment); + out(1,"// Data members"); + out(1,smallComment); + + // output: comment + out(); + out(1,"// comment"); + out(1,"Field> comment{this};"); + + // output: fields + writeClassContentMetadata(out, per, title); + writeClassContentChildren(out, per); + writeClassContentVariants(out, per); + + // output: data string or vector reference, if applicable + if (per.isDataNode) { + if (per.isDataString) { + out(); + out(1,"// data"); + out(1,"std::string &string = *this;"); + } else { + auto it = nameMap.find(per.elementType); + if (it != nameMap.end()) { + out(); + out(1,"// data"); + out(1,"std::vector<@> &@ = *this;", + it->second.first, it->second.second); + } else { + // This would mean either than our nameMap is missing something that + // it ought to have, or that we're dealing with one of those dynamic + // GNDS valueType-typed vectors, which is probably something we + // should try to avoid dealing with. Perhaps, here, in the event + // that we want anything in such a case, we'd make it a variant & + // to the variant in the base BodyText. + } + } + } + + // output: shortcuts + if (per.name2path.size()) { + out(); + out(1,"// shortcuts"); + out(1,"#define NJOY_GNDSTK_SHORTCUT(to,name) " + "decltype(to.name) &name = to.name"); + + for (const auto &cut : per.name2path) { + const std::string &name = cut.first; + const std::vector &path = cut.second; + std::string full; + for (const std::string &field : path) + full += field + "()."; + full.pop_back(); // trailing '.' + out(1,"NJOY_GNDSTK_SHORTCUT(@,@);", full, name); + } + + out(1,"#undef NJOY_GNDSTK_SHORTCUT"); + } + + // output: constructors + out(); + out(1,smallComment); + out(1,"// Constructors"); + out(1,smallComment); + writeClassCtors(out, per); + + // output: class end + writeClassSuffix(out, per, specs); + + // done + code = out.str(); +} // writeClass + + +// ----------------------------------------------------------------------------- +// For the C++ header files +// fileGNDStkVersion +// fileGNDStkKey +// fileGNDStkClass +// ----------------------------------------------------------------------------- + +// ------------------------ +// fileGNDStkVersion +// ------------------------ + +void fileGNDStkVersion(const InfoSpecs &specs) +{ + // ------------------------ + // Create a C++ header + // for this version + // ------------------------ + + { + writer out(specs.hppVersion); + + out(); + out("#ifndef @_@", + allcaps(specs.Project), allcaps(specs.VersionUnderscore)); + out("#define @_@", + allcaps(specs.Project), allcaps(specs.VersionUnderscore)); + + if (specs.Enumerators.size()) { + out(); + for (const auto &e : specs.Enumerators) + out("#include \"@/@/enums/@.hpp\"", + specs.Project, specs.Version, e.first); + } + + std::string nsname_last = ""; + for (const auto &c : specs.class2data) { + const std::string nsname = c.first.nsname; + const std::string clname = c.first.clname; + if (nsname != nsname_last) + out(); + nsname_last = nsname; + out("#include \"@/@/@/@.hpp\"", + specs.Project, specs.Version, nsname, clname); + } + + out(); + out("#endif"); + } + + // ------------------------ + // Create a C/C++ header + // for the C interface + // ------------------------ + + { + writer out(specs.hVersion); + out(); + out(largeComment); + out("// This header file is designed to work with both C and C++"); + out(largeComment); + out(); + out("#ifndef C_INTERFACE_@_@", + allcaps(specs.Project), allcaps(specs.VersionUnderscore)); + out("#define C_INTERFACE_@_@", + allcaps(specs.Project), allcaps(specs.VersionUnderscore)); + + out(); + out("#include \"GNDStk.h\""); + out(); + out("#ifdef __cplusplus"); + out(1,"// For C++"); + out(1,"#include \"@/@.hpp\"", specs.Project, specs.Version); + out("#endif"); + + std::string nsname_last = ""; + for (const auto &c : specs.class2data) { + const std::string nsname = c.first.nsname; + const std::string clname = c.first.clname; + if (nsname != nsname_last) + out(); + nsname_last = nsname; + out("#include \"@/@/@.h\"", specs.Version, nsname, clname); + } + + out(); + out("#endif"); + } +} // fileGNDStkVersion + + +// ------------------------ +// fileGNDStkKey +// ------------------------ + +void fileGNDStkKey(const InfoSpecs &specs) +{ + // ------------------------ + // Gather information + // ------------------------ + + // pair: key name, GNDS name + using pair = std::pair; + + // For metadata, collect into one place + std::set metadata; + + // For children, process on a per-file basis; *multi*map is + // in case the same namespace appears in more than one file. + // The multimap contains: namespace name, set + std::multimap> namespace2children; + + for (const auto &file : specs.JSONFiles) { + const json::object jmain = readJSONFile(file); + auto it = namespace2children.insert( + std::make_pair(getFileNamespace(jmain),std::set{})); + + for (const auto &node : jmain) { + if (isClass(node)) { + // nodes ==> children + it->second.insert(std::make_pair( + nameField(node,specs), + nameGNDS(node))); + + // attributes ==> metadata + const json::object attrs = + getMetadataJSON(node.second.get()); + for (const auto &attr : attrs) { + if (beginsin(attr.first, "//")) + continue; + metadata.insert(std::make_pair( + nameField(attr,specs), + nameGNDS(attr))); + } + } + } + } + + // ------------------------ + // comment, macro guard, + // outer namespaces + // ------------------------ + + writer out(specs.hppKey); + out(); + out("#ifndef @_@_KEY", + allcaps(specs.Project), allcaps(specs.VersionUnderscore)); + out("#define @_@_KEY", + allcaps(specs.Project), allcaps(specs.VersionUnderscore)); + out(); + out("// GNDStk Core Interface"); + out("#include \"GNDStk.hpp\""); + out(); + if (specs.Project == "GNDStk") // <== use namespace njoy only for this + out("namespace njoy {"); + out("namespace @ {", specs.Project); + out("namespace @ {", specs.VersionUnderscore); + out(); + out("using namespace njoy;"); + out("using namespace GNDStk;"); + + // ------------------------ + // Meta<> objects + // ------------------------ + + section(out,"// meta::"); + out(); + out("namespace meta {"); + + if (metadata.size() > 0) { + out(); + out(0,"#define NJOY_GNDSTK_MAKE_LOOKUP(nameField,nameGNDS) \\"); + out(1,"inline const auto nameField = makeLookup( \\"); + out(2,"#nameGNDS, \\"); + out(2,"[](const auto &obj) -> decltype(obj.nameField()) \\"); + out(2,"{ \\"); + out(3,"return obj.nameField(); \\"); + out(2,"} \\"); + out(1,")"); + out(0,"// nameField vs. nameGNDS: e.g. Double, vs. double in GNDS; " + "usually identical"); + out(); + for (const auto &meta : metadata) + out("NJOY_GNDSTK_MAKE_LOOKUP(@,@);", meta.first, meta.second); + out(); + out(0,"#undef NJOY_GNDSTK_MAKE_LOOKUP"); + out(); + } + + out("} // namespace meta"); + + // ------------------------ + // Child<> objects + // ------------------------ + + for (const auto &nspace : namespace2children) { + section(out, "// @::child::", nspace.first); + out(); + out("namespace @ {", nspace.first); + out("namespace child {"); + + const auto &children = nspace.second; + if (children.size() > 0) { + out(); + for (const auto &child : children) + out("inline const Child<> @(\"@\");", child.first, child.second); + out(); + } + + out("} // namespace child"); + out("using namespace child;"); + out("} // namespace @", nspace.first); + } + + // ------------------------ + // Using directives + // ------------------------ + + section(out, "// For convenience: using directives"); + out(); + out("namespace key {"); + out(1,"using namespace meta;"); + for (const auto &nspace : namespace2children) + out(1,"using namespace @::child;", nspace.first); + out("} // namespace key"); + out(); + out("using namespace key;"); + for (const auto &nspace : namespace2children) + out("using namespace @;", nspace.first); + + // ------------------------ + // finish + // ------------------------ + + out(); + out(); + out(largeComment); + out(largeComment); + out(); + out("} // namespace @", specs.VersionUnderscore); + out("} // namespace @", specs.Project); + if (specs.Project == "GNDStk") // <== end namespace njoy only for this + out("} // namespace njoy"); + out(); + out("#endif"); +} // fileGNDStkKey + + +// ------------------------ +// fileGNDStkClass +// ------------------------ + +void fileGNDStkClass( + const InfoSpecs &specs, const PerClass &per, const Class2Dependencies &c2d +) { + // class-specific hpp file + writer out(per.hppGNDStk); + const std::string guard = + allcaps(specs.Project) + "_" + + allcaps(specs.VersionUnderscore) + "_" + + allcaps(per.nsname) + "_" + + allcaps(per.clname); + + out(); + out("#ifndef @", guard); + out("#define @", guard); + + out(); + if (c2d.dependencies.size() == 0) // <== otherwise, comes in through deps + out("#include \"@/@/key.hpp\"", specs.Project, specs.Version); + for (const auto &dep : c2d.dependencies) + out("#include \"@/@/@/@.hpp\"", + specs.Project, specs.Version, dep.nsname, dep.clname); + + out(); + if (specs.Project == "GNDStk") + out("namespace njoy {"); + out("namespace @ {", specs.Project); + out("namespace @ {", specs.VersionUnderscore); + out(per.code,false); + out("} // namespace @", specs.VersionUnderscore); + out("} // namespace @", specs.Project); + if (specs.Project == "GNDStk") + out("} // namespace njoy"); + out(); + out("#endif"); +} // fileGNDStkClass diff --git a/autogen/json2class-f03.cpp b/autogen/json2class-f03.cpp new file mode 100644 index 000000000..be24176a1 --- /dev/null +++ b/autogen/json2class-f03.cpp @@ -0,0 +1,835 @@ + +// ----------------------------------------------------------------------------- +// For the Fortran 2003 interface +// ----------------------------------------------------------------------------- + +// nameMapFortran +const std::map nameMapFortran = +{ + { "type", "type1" } +}; + +// fname +std::string fname(const std::string &varname) +{ + const auto it = nameMapFortran.find(varname); + return it == nameMapFortran.end() ? varname : it->second; +} + +// ftype +// Get metadata type, for the Fortran interface +std::string ftype(const std::string &type) +{ + // string + if (type == "std::string") + return "type(c_ptr)"; + + // bool + if (type == "bool") + return "logical(c_bool)"; + + // integral + if (type == "int") + return "integer(c_int)"; + if (type == "unsigned") + return "integer(c_unsigned)"; // todo Actually, no unsigned in Fortran + + // floating-point + if (type == "float") + return "real(c_float)"; + if (type == "double") + return "real(c_double)"; + if (type == "long double") + return "real(c_long_double)"; + + // fixme + return "unknownType"; +} + + +// ----------------------------------------------------------------------------- +// fileF03InterfaceCreateParams +// ----------------------------------------------------------------------------- + +void fileF03InterfaceCreateParams(writer &src, const PerClass &per) +{ + int count = 0; + const int total = per.nfields(); + std::vector sizes; + + // Determine if any parameters will need need to have their sizes at the + // end of the parameter list. This is determined here because it affects + // whether or not commas may be needed earlier, after other parameters. + bool hasSizes = false; + for (const auto &m : per.metadata) + if (m.type == "std::string") + hasSizes = true; + + // metadata + for (const auto &m : per.metadata) { + const std::string varname = fname(m.name); + src(); + src(1,"@@ &", varname, ++count < total || hasSizes ? "," : "", false); + if (m.type == "std::string") + sizes.push_back(varname+"Size"); + } + + // children + for (const auto &c : per.children) { + const std::string varname = fname(c.name); + src(); + c.isVector + ? src(1,"@, @Size@ &", varname, varname, + ++count < total || hasSizes ? "," : "", false) + : src(1,"@@ &", varname, + ++count < total || hasSizes ? "," : "", false); + } + + // variants + // todo + + src(); + + // sizes + count = 0; + for (const std::string &s : sizes) + src(1,"@@ &", s, ++count < sizes.size() ? "," : ""); +} + + +// ----------------------------------------------------------------------------- +// fileF03InterfaceDeclareParams +// ----------------------------------------------------------------------------- + +void fileF03InterfaceDeclareParams(writer &src, const PerClass &per) +{ + // metadata + for (const auto &m : per.metadata) { + const std::string varname = fname(m.name); + if (m.type == "std::string") { + src(1,"integer(c_size_t), intent(in), value :: @Size", varname); + src(1,"character(c_char), intent(in) :: @(@Size)", varname, varname); + } else + src(1,"@, intent(in), value :: @", ftype(m.type), varname); + } + + // children + for (const auto &c : per.children) { + const std::string varname = fname(c.name); + if (c.isVector) { + src(1,"integer(c_size_t), intent(in), value :: @Size", varname); + src(1,"type(c_ptr), intent(in) :: @(@Size)", varname, varname); + } else + src(1,"type(c_ptr), intent(in), value :: @", varname); + } + + // variants + // todo +} + + +// ----------------------------------------------------------------------------- +// fileF03InterfaceBasics +// ----------------------------------------------------------------------------- + +void fileF03InterfaceBasics(writer &src, const PerClass &per) +{ + std::string sub; + + // section comment + sectionFortran( + src, + "!! Basics\n" + "!! Create, Assign, Delete" + ); + + // create: default, const + sub = per.clname + "DefaultConst"; + src(); + src("!! Create, default, const"); + src("function @() &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // create: default, non-const + sub = per.clname + "Default"; + src(); + src("!! Create, default, non-const"); + src("function @() &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // create: general, const + sub = per.clname + "CreateConst"; + src(); + src("!! Create, general, const"); + src("function @( &", sub, false); + fileF03InterfaceCreateParams(src,per); + src(") &"); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + fileF03InterfaceDeclareParams(src,per); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // create: general, non-const + sub = per.clname + "Create"; + src(); + src("!! Create, general, non-const"); + src("function @( &", sub, false); + fileF03InterfaceCreateParams(src,per); + src(") &"); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + fileF03InterfaceDeclareParams(src,per); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // assign + sub = per.clname + "Assign"; + src(); + src("!! Assign"); + src("subroutine @(handleLHS, handleRHS) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handleLHS"); + src(1,"type(c_ptr), intent(in), value :: handleRHS"); + src("end subroutine @", sub); + + // delete + sub = per.clname + "Delete"; + src(); + src("!! Delete"); + src("subroutine @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src("end subroutine @", sub); +} + + +// ----------------------------------------------------------------------------- +// fileF03InterfaceIO +// ----------------------------------------------------------------------------- + +void fileF03InterfaceIO(writer &src, const PerClass &per) +{ + std::string sub; + + // section comment + sectionFortran( + src, + "!! I/O\n" + "!! Read, Write, Print\n" + "!! Each returns 0 if failure, 1 if success." + ); + + // read from file + sub = per.clname + "Read"; + src(); + src("!! Read from file"); + + src("!! File can be XML, JSON, or HDF5."); + src("!! We'll examine the file's contents to determine " + "its type automatically."); + src("function @(handle, filename, filenameSize) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src(1,"integer(c_size_t), intent(in), value :: filenameSize"); + src(1,"character(c_char), intent(in) :: filename(filenameSize)"); + src(1,"integer(c_int) :: @", sub); + src("end function @", sub); + + // write to file + sub = per.clname + "Write"; + src(); + src("!! Write to file"); + src("!! File can be XML, JSON, or HDF5."); + src("!! We'll use filename's extension to determine " + "the type you want written."); + src("function @(handle, filename, filenameSize) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"integer(c_size_t), intent(in), value :: filenameSize"); + src(1,"character(c_char), intent(in) :: filename(filenameSize)"); + src(1,"integer(c_int) :: @", sub); + src("end function @", sub); + + // print + sub = per.clname + "Print"; + src(); + src("!! Print to standard output, in our prettyprinting format"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"integer(c_int) :: @", sub); + src("end function @", sub); + + // print, XML + sub = per.clname + "PrintXML"; + src(); + src("!! Print to standard output, as XML"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"integer(c_int) :: @", sub); + src("end function @", sub); + + // print, JSON + sub = per.clname + "PrintJSON"; + src(); + src("!! Print to standard output, as JSON"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"integer(c_int) :: @", sub); + src("end function @", sub); +} + + +// ----------------------------------------------------------------------------- +// fileF03InterfaceVector +// ----------------------------------------------------------------------------- + +void fileF03InterfaceVector( + writer &src, + const PerClass &per, const std::string &type, + const bool isSection = true +) { + // section comment + if (isSection) + sectionFortran(src,"!! Data vector"); + else { + assert(type != ""); + src(); + src(smallFortran); + src("!! @", type); + src(smallFortran); + } + + // dynamic type? + if (type == "") { + // Mirrors what we support in the C interface. + fileF03InterfaceVector(src, per, "int", false); + fileF03InterfaceVector(src, per, "unsigned", false); + fileF03InterfaceVector(src, per, "float", false); + fileF03InterfaceVector(src, per, "double", false); + return; + } + + // Example: + // type: "double" (parameter to the present function) + // Then: + // Class: "Foobar" (example class name) + // Types: "Doubles" + // fixme The determination of Types should probably be more general. + const std::string Class = per.clname; + const std::string Types = type == "std::string" + ? "Strings" + : capital(type) + 's'; + std::string sub; + + // clear + sub = Class + Types + "Clear"; + src(); + src("!! Clear"); + src("subroutine @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src("end subroutine @", sub); + + // get size + sub = Class + Types + "Size"; + src(); + src("!! Get size"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"integer(c_size_t) :: @", sub); + src("end function @", sub); + + // get value + sub = Class + Types + "Get"; + src(); + src("!! Get value"); + src("!! By index \\in [0,size)"); + src("function @(handle, arrayIndex) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"integer(c_size_t), intent(in), value :: arrayIndex"); + type == "std::string" + ? src(1,"type(c_ptr) :: @", sub) + : src(1,"@ :: @", ftype(type), sub); + src("end function @", sub); + + // set value + // Note: the type == std::string case occurs when we're dealing with + // basically an "array of strings", as would appear in XML as something + // like foo bar baz. Here, we're sending the array index, + // for example 1 for bar (always 0-indexed, even for Fortran, because + // we're interfacing down to C and then C++). The "valueAtIndexSize" + // parameter is, here, what its name suggests: the size of the to-be-set + // string value, for example 6 if we're replacing "bar" with "abcdef". + // It should not be confused with the size of the array. If it + // were that, then we'd call it arraySize, not valueAtIndexSize. + sub = Class + Types + "Set"; + src(); + src("!! Set value"); + src("!! By index \\in [0,size)"); + type == "std::string" + ? src("subroutine @(handle, arrayIndex, valueAtIndex, " + "valueAtIndexSize) &", sub) + : src("subroutine @(handle, arrayIndex, valueAtIndex) " + "&", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src(1,"integer(c_size_t), intent(in), value :: arrayIndex"); + if (type == "std::string") { + src(1,"integer(c_size_t), intent(in), value :: valueAtIndexSize"); + src(1,"character(c_char), intent(in) :: valueAtIndex(valueAtIndexSize)"); + } else + src(1,"@, intent(in), value :: valueAtIndex", ftype(type)); + src("end subroutine @", sub); + + // fixme + // For now, we only have the following for non-std::string types. + // Supporting std::string here means we really need the equivalent + // of char** (pointer to pointer to char) in the C interface, and + // something compatible with that in this (the Fortran) interface. + if (type != "std::string") { + // get pointer to existing values, const + sub = Class + Types + "GetArrayConst"; + src(); + src("!! Get pointer to existing values, const"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // get pointer to existing values, non-const + sub = Class + Types + "GetArray"; + src(); + src("!! Get pointer to existing values, non-const"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // set completely new values and size + sub = Class + Types + "SetArray"; + src(); + src("!! Set completely new values and size"); + src("subroutine @(handle, values, valuesSize) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src(1,"integer(c_size_t), intent(in), value :: valuesSize"); + src(1,"@, intent(in) :: values(valuesSize)", ftype(type)); + src("end subroutine @", sub); + } +} + + +// ----------------------------------------------------------------------------- +// fileF03InterfaceMeta +// ----------------------------------------------------------------------------- + +void fileF03InterfaceMeta( + writer &src, + const PerClass &per, const InfoMetadata &m +) { + const std::string Class = per.clname; + const std::string Meta = UpperCamel(m.name); + const std::string varname = fname(m.name); + std::string sub; + + // section comment + sectionFortran(src,"!! Metadatum: @", m.name); + + // has + sub = Class + Meta + "Has"; + src(); + src("!! Has"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"integer(c_int) :: @", sub); + src("end function @", sub); + + // get + sub = Class + Meta + "Get"; + src(); + src("!! Get"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"@ :: @", ftype(m.type), sub); + src("end function @", sub); + + // set + sub = Class + Meta + "Set"; + src(); + src("!! Set"); + m.type == "std::string" + ? src("subroutine @(handle, @, @Size) &", sub, varname, varname) + : src("subroutine @(handle, @) &", sub, varname); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + if (m.type == "std::string") { + src(1,"integer(c_size_t), intent(in), value :: @Size", varname); + src(1,"character(c_char), intent(in) :: @(@Size)", varname, varname); + } else + src(1,"@, intent(in), value :: @", ftype(m.type), varname); + src("end subroutine @", sub); +} + + +// ----------------------------------------------------------------------------- +// fileF03InterfaceChild +// ----------------------------------------------------------------------------- + +void fileF03InterfaceChild( + writer &src, + const PerClass &per, const InfoChildren &c, const InfoSpecs &specs +) { + const std::string Class = per.clname; + const std::string Child = c.plain; + const std::string child = c.name; + std::string sub; + + // section comment + sectionFortran(src,"!! Child: @", child); + + // has + // Applies to both the scalar and the vector cases, + // which are otherwise distinguished below + sub = Class + Child + "Has"; + src(); + src("!! Has"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"integer(c_int) :: @", sub); + src("end function @", sub); + + // ------------------------ + // scalar case + // ------------------------ + + if (!c.isVector) { + // get, const + sub = Class + Child + "GetConst"; + src(); + src("!! Get, const"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // get, non-const + sub = Class + Child + "Get"; + src(); + src("!! Get, non-const"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // set + sub = Class + Child + "Set"; + src(); + src("!! Set"); + src("subroutine @(handle, fieldHandle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src(1,"type(c_ptr), intent(in), value :: fieldHandle"); + src("end subroutine @", sub); + + // done with this child + return; + } + + // ------------------------ + // vector case + // ------------------------ + + // clear + sub = Class + Child + "Clear"; + src(); + src("!! Clear"); + src("subroutine @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src("end subroutine @", sub); + + // size + sub = Class + Child + "Size"; + src(); + src("!! Size"); + src("function @(handle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"integer(c_size_t) :: @", sub); + src("end function @", sub); + + // add + sub = Class + Child + "Add"; + src(); + src("!! Add"); + src("subroutine @(handle, fieldHandle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src(1,"type(c_ptr), intent(in), value :: fieldHandle"); + src("end subroutine @", sub); + + // get, by index, const + sub = Class + Child + "GetConst"; + src(); + src("!! Get, by index \\in [0,size), const"); + src("function @(handle, index) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + src(1,"integer(c_size_t), intent(in), value :: index"); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // get, by index, non-const + sub = Class + Child + "Get"; + src(); + src("!! Get, by index \\in [0,size), non-const"); + src("function @(handle, index) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src(1,"integer(c_size_t), intent(in), value :: index"); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // set, by index + sub = Class + Child + "Set"; + src(); + src("!! Set, by index \\in [0,size)"); + src("subroutine @(handle, index, fieldHandle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + src(1,"integer(c_size_t), intent(in), value :: index"); + src(1,"type(c_ptr), intent(in), value :: fieldHandle"); + src("end subroutine @", sub); + + // ------------------------ + // for this child's + // metadata + // ------------------------ + + // first make sure that we know about this class + const auto it = specs.class2data.find(NamespaceAndClass(c.ns,c.plain)); + if (it == specs.class2data.end()) { + log::warning( + "Unable to generate Fortran interface has/get/set functions for:\n" + " class: {}::{}\n" + " child: {}::{}\n" + "Child class is unknown, so its metadata for has/get/set are unknown.", + per.nsname, Class, + c.ns, Child + ); + return; + } + + // has, get const, get non-const, set + for (const auto &m : it->second.metadata) { + const std::string Meta = UpperCamel(m.name); + const std::string meta = m.name; + + // subsection header + src(); + src(smallFortran); + src("!! Re: metadatum @", meta); + src(smallFortran); + + // has, by metadatum + sub = Class + Child + "HasBy" + Meta; + src(); + src("!! Has, by @", meta); + m.type == "std::string" + ? src("function @(handle, meta, metaSize) &", sub) + : src("function @(handle, meta) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + if (m.type == "std::string") { + src(1,"integer(c_size_t), intent(in), value :: metaSize"); + src(1,"character(c_char), intent(in) :: meta(metaSize)"); + } else + src(1,"@, intent(in), value :: meta", ftype(m.type)); + src(1,"integer(c_int) :: @", sub); + src("end function @", sub); + + // get, by metadatum, const + sub = Class + Child + "GetBy" + Meta + "Const"; + src(); + src("!! Get, by @, const", meta); + m.type == "std::string" + ? src("function @(handle, meta, metaSize) &", sub) + : src("function @(handle, meta) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), intent(in), value :: handle"); + if (m.type == "std::string") { + src(1,"integer(c_size_t), intent(in), value :: metaSize"); + src(1,"character(c_char), intent(in) :: meta(metaSize)"); + } else + src(1,"@, intent(in), value :: meta", ftype(m.type)); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // get, by metadatum, non-const + sub = Class + Child + "GetBy" + Meta; + src(); + src("!! Get, by @, non-const", meta); + m.type == "std::string" + ? src("function @(handle, meta, metaSize) &", sub) + : src("function @(handle, meta) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + if (m.type == "std::string") { + src(1,"integer(c_size_t), intent(in), value :: metaSize"); + src(1,"character(c_char), intent(in) :: meta(metaSize)"); + } else + src(1,"@, intent(in), value :: meta", ftype(m.type)); + src(1,"type(c_ptr) :: @", sub); + src("end function @", sub); + + // set, by metadatum + sub = Class + Child + "SetBy" + Meta; + src(); + src("!! Set, by @", meta); + m.type == "std::string" + ? src("subroutine @(handle, meta, metaSize, fieldHandle) &", sub) + : src("subroutine @(handle, meta, fieldHandle) &", sub); + src(2,"bind(C, name='@')", sub); + src(1,"use iso_c_binding"); + src(1,"implicit none"); + src(1,"type(c_ptr), value :: handle"); + if (m.type == "std::string") { + src(1,"integer(c_size_t), intent(in), value :: metaSize"); + src(1,"character(c_char), intent(in) :: meta(metaSize)"); + } else + src(1,"@, intent(in), value :: meta", ftype(m.type)); + src(1,"type(c_ptr), intent(in), value :: fieldHandle"); + src("end subroutine @", sub); + } // metadata +} + + +// ----------------------------------------------------------------------------- +// fileF03Interface +// ----------------------------------------------------------------------------- + +void fileF03Interface( + const InfoSpecs &specs, const PerClass &per, const Class2Dependencies &c2d +) { + writer src(per.sourceF03, true, "!!"); + const std::string mod = per.nsname + per.clname; + + // Module begin + src(); + src("module @", mod); + src("use iso_c_binding"); + src("interface"); + + // Basics: create, assign, delete + fileF03InterfaceBasics(src, per); + + // IO: read, write, print + fileF03InterfaceIO(src, per); + + // Array support, if BlockData + if (per.isDataVector) + fileF03InterfaceVector(src, per, per.elementType); + + // Functions regarding metadata + for (const auto &m : per.metadata) + fileF03InterfaceMeta(src, per, m); + + // Functions regarding children + for (const auto &c : per.children) + fileF03InterfaceChild(src, per, c, specs); + + // Functions regarding variants + // todo + + // Module end + src(); + src(); + src(largeFortran); + src(largeFortran); + src(); + src("end interface"); + src("end module @", mod); +} diff --git a/autogen/json2class-fun.cpp b/autogen/json2class-fun.cpp new file mode 100644 index 000000000..f9cb4d38f --- /dev/null +++ b/autogen/json2class-fun.cpp @@ -0,0 +1,1458 @@ + +// ----------------------------------------------------------------------------- +// Miscellaneous short functions +// ----------------------------------------------------------------------------- + +// action_helper +void action_helper(std::string str) +{ + str.resize(80,' '); + // boldface + background color + foreground color + text + // std::cout << "\033[1m\033[48;2;80;80;80m\033[38;2;255;255;255m" << str; + // background color + foreground color + text + std::cout << "\033[48;2;80;80;80m\033[38;2;255;255;255m" << str; + std::cout << color::reset << std::endl; + + /* + // loud colors; may or may not want + static const int ncol = 80; + static const int last = ncol-1; + + for (int col = 0; col < ncol; ++col) { + int r = 255*(last-col)/last; + int g = 255 - std::abs(255*(last-col-col)/last); + int b = 255*col/last; + std::cout << "\033[48;2;" << r << ";" << g << ";" << b << "m" + << "\033[38;2;255;255;255m" + << (col < str.size() ? str[col] : ' '); + } + std::cout << color::reset << std::endl; + */ +} + +// action +// Print text describing an action the code is about to take +template +void action(const ARGS &...args) +{ + static const std::string inverse = "\033[7m"; + static const std::string background(80,' '); + std::cout << '\n'; + action_helper(""); + (action_helper(args), ...); + action_helper(""); + std::cout << color::reset << std::endl; +} + +// allws +// Is the string all whitespace? +bool allws(const std::string &str) +{ + for (const auto c : str) + if (!isspace(c)) + return false; + return true; +} + +// escape +// Escape any double quotes in the string +std::string escape(const std::string &str) +{ + std::string ret; + for (const auto c : str) { + if (c == '"') + ret += '\\'; + ret += c; + } + return ret; +} + +// initializer +// Based on m.type and m.defaultValue, make something appropriate to use +// for initialization, as with: m.type var{return value of this function} +std::string initializer(const InfoMetadata &m) +{ + // Leave an empty or all-whitespace m.defaultValue as-is. + // This is the "no initializer" case. + if (allws(m.defaultValue)) + return ""; + + // If of string type, add double quotes. + // We assume that the input does NOT have the quotes already! + // Note: we may not need all of these, but the GNDS manual does describe + // several string-like types, so we might as well include them. + if (m.type == "XMLName" || m.type == "UTF8Text" || + m.type == "printableText" || m.type == "quotedText" || + m.type == "tdText" || m.type == "string" || m.type == "std::string") + return '"' + escape(m.defaultValue) + '"'; + + // Leave as-is; + // applicable for non-string (int, double, etc.) cases + return m.defaultValue; +} + +// capital +// Capitalize the first letter +std::string capital(const std::string &str) +{ + std::string ret = str; + if (ret.size() > 0) + ret[0] = toupper(ret[0]); + return ret; +} + +// allcaps +// Capitalize all letters +std::string allcaps(const std::string &str) +{ + std::string ret = str; + for (size_t i = ret.size(); i--; ) + ret[i] = toupper(ret[i]); + return ret; +} + +// UpperCamel +std::string UpperCamel(const std::string &str) +{ + std::string ret; + for (size_t i = 0; i < str.size(); ++i) + if (str[i] != '_') + ret += i ? str[i] : toupper(str[i]); + else if (++i < str.size()) + ret += toupper(str[i]); + return ret; +} + +// replace +// Replace character +std::string replace(const std::string &str, const char from, const char to) +{ + std::string ret = str; + for (size_t i = ret.size(); i--; ) + if (ret[i] == from) + ret[i] = to; + return ret; +} + +// stringify +// Stringify JSON +std::string stringify(const json::value &j) +{ + std::ostringstream oss; + j.write(oss); + const std::string tmp = oss.str(); + return j.holds() + ? tmp.substr(1, tmp.size()-2) + : tmp; +} + +// isComment +// Does this JSON key look like a C++ style comment? +bool isComment(const std::string &key) +{ + return strncmp(key.data(), "//", 2) == 0; +} + +// isClass +// Does this JSON key/value pair appear to describe a class? +bool isClass(const json::pair &keyval) +{ + const auto &key = keyval.first; + const auto &val = keyval.second; + + // a comment? + if (isComment(key)) + return false; + + // not a class? + if (key == "__namespace__" || key == "namespace" || key == "Specifications") + return false; + + // not a node class? + if ((val.has("__class__") && + val["__class__"].get() != "nodes.Node") || + (val.has( "class" ) && + val[ "class" ].get() != "nodes.Node") + ) + return false; + + return true; +} + +// getTimes +const std::string &getTimes( + const PerClass &per, const std::string &key, const json::object &value +) { + const std::string times = "times"; // shorter, less easily misspelled + const std::string occurrence = "occurrence"; // accept; used in GNDS specs + + // need exactly one - not neither, not both + if (value.has(times) == value.has(occurrence)) { + log::error( + "In namespace \"{}\", class \"{}\":\n" + "Child node \"{}\" needs exactly one of \"times\" or \"occurrence\".\n" + "Or, did you possibly intend \"{}\" to be an attribute/metadatum?", + per.nsname, per.clname, key, key); + throw std::exception{}; + } + + return value.has(times) + ? value[times].get() + : value[occurrence].get(); +} + +// sep +std::string sep(int &count, const int total) +{ + return ++count < total ? "," : ""; +} + + +// ----------------------------------------------------------------------------- +// name* functions +// ----------------------------------------------------------------------------- + +// nameGNDS +// Name in a GNDS file (e.g., name of an XML element) +const std::string &nameGNDS( + const json::pair &keyval, + const std::string &nsname = "", + const bool print = false +) { + // For debugging + if (debugging && print) { + const std::string key = keyval.first; + const std::string name = keyval.second.has("name") + ? keyval.second["name"].get() + : key; + + std::cout + << "class: " + << std::setw(20) << std::left << nsname << " " + << std::setw(48) << std::left << key << " " + << (key == name ? " " : "*") << " " + << std::left << name << std::endl; + } + + // As-is, directly as stipulated in the key in the JSON spec, except + // that we allow a "name" entry in the key's value to override the key. + return keyval.second.has("name") + ? (std::string &)keyval.second["name"].get() + : (std::string &)keyval.first; +} + +// nameField +// Name of a field (metadatum or child node) in an autogenerated class +const std::string &nameField(const json::pair &keyval, const InfoSpecs &specs) +{ + const std::string &name = keyval.first; + // Here, we apply any name-modification map that may have been provided + // in a "changes" file. Such changes can fix, for example, the name "double" + // that appears in some GNDS specs as a JSON key, given that "double" is + // unsuitable for use as a variable name in C++. + const auto it = specs.mapName.find(name); + return it == specs.mapName.end() ? name : it->second; +} + +// nameClass +// Name of an autogenerated class +std::string nameClass(const json::pair &keyval, const InfoSpecs &specs) +{ + // Capitalized version of either the JSON key, or, if applicable, + // its change under the name-modification map in a "changes" file. + const std::string &name = keyval.first; + const auto it = specs.mapName.find(name); + return capital(it == specs.mapName.end() ? name : it->second); +} + +// namePython +// Name for Python +std::string namePython(const std::string &name) +{ + if (name.size() == 0) + return name; + std::string python; + python += std::tolower(name[0]); + for (auto it = name.begin()+1; it != name.end(); ++it) { + if (std::isupper(*it) && std::islower(*(it-1))) + python += '_'; + python += std::tolower(*it); + } + return python; +} + + +// ----------------------------------------------------------------------------- +// Functions for getting certain information from JSON input +// ----------------------------------------------------------------------------- + +// Get the JSON's "namespace" +const std::string &getFileNamespace(const json::object &j) +{ + return j.has("__namespace__") + ? j["__namespace__"].get() + : j[ "namespace" ].get(); +} + +// Get the JSON's "type", with any relevant specs.mapMetaType entry applied +const std::string &getMetadatumType( + const json::object &j, const InfoSpecs &specs +) { + const std::string &type = j["type"].get(); + const auto it = specs.mapMetaType.find(type); + return it == specs.mapMetaType.end() ? type : it->second; +} + +// Determine to what namespace childClass belongs. Context: we're (1) in a JSON +// spec with namespace parent.nsname, (2) in a parent node named parent.clname, +// and (3) wish to determine the proper namespace for the parent's child node +// named childClass. Parameter j is the JSON value ({...}) for this child node. +std::string getChildNamespace( + const json::object &j, const InfoSpecs &specs, + const PerClass &per, const std::string &childClass +) { + // childClass' namespace... + + // ...is explicitly given by "__namespace__"or "namespace" + if (j.has("__namespace__")) + return j["__namespace__"].get(); + if (j.has( "namespace" )) + return j[ "namespace" ].get(); + + // ...isn't given, and this child isn't in any of the JSONs :-( + if (specs.class2nspace.count(childClass) == 0) { + log::warning( + "{}::{} has a child of unknown class {}", + per.nsname, per.clname, childClass + ); + return "unknownNamespace"; + } + + // ...isn't given, but we've seen the child in exactly *one* namespace + if (specs.class2nspace.count(childClass) == 1) + return specs.class2nspace.find(childClass)->second; + + // ...isn't given, and we've seen the child in *multiple* namespaces, + // ...one of which is the parent's, which we'll assume is intended + const auto range = specs.class2nspace.equal_range(childClass); + for (auto it = range.first; it != range.second; ++it) + if (it->second == per.nsname) { + log::warning( + "{}::{} has a child {} that appears in the present\n" + "namespace but also in one or more other namespaces. We'll\n" + "assume that the one in the present namespace is intended.\n" + "If this is wrong, please provide a \"namespace\" entry.", + per.nsname, per.clname, childClass + ); + return per.nsname; + } + + // ...isn't given, and we've seen the child in *multiple* namespaces, + // ...none of which is the parent's; this is an ambiguous situation :-( + std::stringstream warn; + int count = 0; + for (auto it = range.first; it != range.second; ++it) + warn << (count++ == 0 ? "" : ", ") << it->second; + log::warning( + "{}::{} has a child of ambiguous class {}.\n" + "Child class {} appears in all of the following namespaces:\n{}", + per.nsname, per.clname, childClass, childClass, warn.str() + ); + + return "ambiguousNamespace"; +} + + +// ----------------------------------------------------------------------------- +// getClass* functions re: metadata, children, variant children +// ----------------------------------------------------------------------------- + +// ------------------------ +// getClassMetadata +// ------------------------ + +void getClassMetadata( + const json::object &j, const InfoSpecs &specs, + PerClass &per +) { + for (const auto &field : j) { + if (beginsin(field.first, "//")) + continue; + if (!field.second.holds()) + continue; + const json::object &metaRHS = field.second.get(); + + // Name + InfoMetadata m; + m.original = nameGNDS(field); + m.name = nameField(field,specs); + + // Converter, if given + m.converter = metaRHS.has("converter") + ? metaRHS["converter"].get() + : ""; + + // Type + m.type = getMetadatumType(metaRHS,specs); + + // Has default? + m.defaultValue = ""; + if (metaRHS.has("default") && !metaRHS["default"].holds()) { + m.defaultValue = stringify(metaRHS["default"]); + // Apply the "changes.json" change, if any, to the given value + const auto it = specs.mapMetaDefault.find(m.defaultValue); + if (it != specs.mapMetaDefault.end()) + m.defaultValue = it->second; + }; + if (m.defaultValue != "") { + // If it has a default, then presumably it isn't required... + if (metaRHS["required"].get()) { + log::error( + "In namespace \"{}\", class \"{}\",\n" + "metadatum \"{}\" has a default ({}), but is required.\n" + "If it really is required, then it shouldn't have a default.\n" + "If it really has a default, then presumably it isn't required.", + per.nsname, per.clname, m.name, m.defaultValue); + throw std::exception{}; + } + } + + // Optional? (not required, and has no default) + m.isOptional = + !metaRHS["required"].get() && + m.defaultValue == ""; + const std::string optPrefix = m.isOptional ? "std::optional<" : ""; + const std::string optSuffix = m.isOptional ? ">" : ""; + + // Defaulted? (not required, but does have a default) + m.isDefaulted = + !metaRHS["required"].get() && + m.defaultValue != ""; + const std::string defPrefix = m.isDefaulted ? "Defaulted<" : ""; + const std::string defSuffix = m.isDefaulted ? ">" : ""; + + // Full type, including any optional<> or Defaulted<> + m.typeFull = + optPrefix + defPrefix + + m.type + + defSuffix + optSuffix; + + // Add to per.metadata + per.metadata.push_back(m); + } +} // getClassMetadata + + +// ------------------------ +// getClassChildren +// ------------------------ + +void getClassChildren( + const json::object &j, const InfoSpecs &specs, + PerClass &per, Class2Dependencies &dep +) { + for (const auto &field : j) { + if (beginsin(field.first, "//")) + continue; + if (!field.second.holds()) + continue; + const json::object &elemRHS = field.second.get(); + + // Choice children are handled elsewhere + const std::string × = getTimes(per, field.first, elemRHS); + if (times == "choice" || times == "choice+" || times == "choice2+") + continue; + + // Name + InfoChildren c; + c.original = nameGNDS(field); + c.name = nameField(field,specs); + + // Converter, Filter, and Label, if given + c.converter = elemRHS.has("converter") + ? elemRHS["converter"].get() : ""; + c.filter = elemRHS.has("filter") + ? elemRHS["filter" ].get() : ""; + c.label = elemRHS.has("label") + ? elemRHS["label" ].get() : ""; + + // Type, excluding namespace + c.plain = nameClass(field,specs); + + // Type, including namespace + c.ns = getChildNamespace(elemRHS, specs, per, c.plain); + c.type = c.ns + "::" + c.plain; + + // Optional? + c.isOptional = !elemRHS["required"].get(); + const std::string optPrefix = c.isOptional ? "std::optional<" : ""; + const std::string optSuffix = c.isOptional ? ">" : ""; + + // Vector? + c.isVector = times == "0+" || times == "1+" || times == "2+"; + const std::string vecPrefix = c.isVector ? "std::vector<" : ""; + const std::string vecSuffix = c.isVector ? ">" : ""; + + // Full type, including any optional<> or vector<> + // If both, use optional; the reverse makes less sense + c.typeFull = + optPrefix + vecPrefix + + c.type + + vecSuffix + optSuffix; + + // Partial type, not including any vector. This is used in the context + // of this child node's entry in the multi-query key, where vector will + // be implicit if it's a "many" (not a "one") child. + c.typeHalf = + optPrefix + + c.type + + optSuffix; + + // Save as a dependency (if it's not its own dependency) + if (c.type != per.name()) + dep.dependencies.push_back( + NamespaceAndClass(c.ns,nameClass(field,specs))); + + // Add to per.children + per.children.push_back(c); + } +} // getClassChildren + + +// ------------------------ +// getClassVariants +// ------------------------ + +void getClassVariants( + const json::object &j, const InfoSpecs &specs, + PerClass &per, Class2Dependencies &dep +) { + // Initialize per.variants, a vector that has the "choice" + // children from the current class. Computing a map, + // first, turns out to be convenient, given the manner in which the choice + // children appear in the JSON specifications: listed in a "flat" manner, + // as child nodes, rather than grouped one level deeper inside of, say, + // a "choice" JSON key. Remark: this code supports the option of having + // multiple sets of choices under the current parent; for example, the + // parent can have {X or Y}, and (independently) have {A or B or C}. Our + // JSON "variant" key facilitates this: give the same value for X and Y, + // and the same value for A, B, and C. At the time of this writing, GNDS + // specifications appear to allow for only one choice-between-things (just + // X,Y, for example, or just A,B,C) in a given parent, but we believe that + // our extension may prove to be useful at some point. + + std::map map; + + // Pass 1 + // Collect "variant" names, and if ever it's absent, a to-be-determined + // name for all choice children for which it's absent + for (const auto &field : j) { + if (beginsin(field.first, "//")) + continue; + + // Is it a choice child? + if (!field.second.holds()) + continue; + const json::object &elemRHS = field.second.get(); + const std::string × = getTimes(per,field.first,elemRHS); + if (times != "choice" && times != "choice+" && times != "choice2+") + continue; + + // Variant name + const std::string variantName = elemRHS.has("variant") + ? elemRHS["variant"].get() + : ""; // to be determined + map.insert(std::make_pair(variantName,InfoVariants{})); + } + + // Pass 2 + for (const auto &field : j) { + if (beginsin(field.first, "//")) + continue; + + // Is it a choice child? + if (!field.second.holds()) + continue; + const json::object &elemRHS = field.second.get(); + const std::string × = getTimes(per,field.first,elemRHS); + if (times != "choice" && times != "choice+" && times != "choice2+") + continue; + + // Variant name + const std::string variantName = elemRHS.has("variant") + ? elemRHS["variant"].get() + : ""; + auto it = map.find(variantName); + assert(it != map.end()); // should be there from the earlier loop + + // For the individual child that's part of a choice... + InfoVariantsChildren c; + // ...its name + c.name = nameField(field,specs); + // ...its type, excluding namespace + c.plain = nameClass(field,specs); + // ...its type, including namespace + c.ns = getChildNamespace(elemRHS, specs, per, c.plain); + c.type = c.ns + "::" + c.plain; + // ...its vector-ness + c.isVector = times == "choice+" || times == "choice2+"; + + // The GNDS JSON specifications all have "required":false for individual + // choices in a set of choices; the concept of "the entire choice can be + // either required or optional" doesn't seem to exist. We could support + // it, but for now, we'll just ensure that "required":false is followed. + + assert(!elemRHS["required"].get()); + + InfoVariants &v = it->second; + v.isVector = c.isVector; + v.children.push_back(c); + + // Save as a dependency (if it's not its own dependency) + if (c.type != per.name()) + dep.dependencies.push_back( + NamespaceAndClass(c.ns,nameClass(field,specs))); + } + + // Pass 3 + for (auto &pair : map) { + InfoVariants &v = pair.second; + assert(v.children.size() > 0); + + const std::string vecPrefix = v.isVector ? "std::vector<" : ""; + const std::string vecSuffix = v.isVector ? ">" : ""; + + v.name = pair.first; + v.type = pair.first + "_t"; + + for (const auto &c : v.children) { + assert(c.isVector == v.isVector); + if (pair.first == "") + v.name += (v.name == "" ? "_" : "") + c.name; + } + v.typeHalf = v.type; + v.typeFull = vecPrefix + v.type + vecSuffix; + + per.variants.push_back(v); + } +} // getClassVariants + + +// ----------------------------------------------------------------------------- +// Miscellaneous functions for getting JSON content +// ----------------------------------------------------------------------------- + +// readJSONFile +json::object readJSONFile(const std::string &file, const bool print = false) +{ + // Depending on the call context, we might or might not print the file name + if (print) { + const std::string f = beginsin(file,"./") ? std::string(&file[2]) : file; + std::cout << color::custom::purple << f << color::reset << std::endl; + } + + std::ifstream ifs(file); + if (!ifs) { + log::error("Could not open file \"{}\"", file); + throw std::exception{}; + } + + json::object j; + ifs >> j; + return j; +} // readJSONFile + + +// getMetadataJSON +json::object getMetadataJSON(const json::object &j) +{ + static const std::string metastr = "metadata"; + static const std::string attrstr = "attributes"; + const bool meta = j.has(metastr); + const bool attr = j.has(attrstr); + + // not both + assert(!(meta && attr)); + + return + meta ? j[metastr].get() + : attr ? j[attrstr].get() + : json::object{}; +} // getMetadataJSON + + +// getChildrenJSON +json::object getChildrenJSON(const json::object &j) +{ + static const std::string chldstr = "children"; + static const std::string nodestr = "childNodes"; + const bool chld = j.has(chldstr); + const bool node = j.has(nodestr); + + // not both + assert(!(chld && node)); + + return + chld ? j[chldstr].get() + : node ? j[nodestr].get() + : json::object{}; +} // getChildrenJSON + + +// ----------------------------------------------------------------------------- +// commandLine and its helper functions +// ----------------------------------------------------------------------------- + +// ------------------------ +// readChangesFile +// ------------------------ + +void readChangesFile(const std::string &file, InfoSpecs &specs) +{ + const json::object jchanges = readJSONFile(file); + using pair = std::pair; + + // Changes to name? + if (jchanges.has("name")) + for (const auto &item : jchanges["name"].pairs()) + if (!isComment(item.first)) + specs.mapName.insert( + pair(item.first, item.second.get()) + ); + + // Changes to metadata/attributes? + const json::object metadata = getMetadataJSON(jchanges); + + // from/to pairs for "type" + if (metadata.has("type")) + for (const auto &item : metadata["type"].pairs()) + if (!isComment(item.first)) + specs.mapMetaType.insert( + pair(item.first,item.second.get()) + ); + // from/to pairs for "default" + if (metadata.has("default")) + for (const auto &item : metadata["default"].pairs()) + if (!isComment(item.first)) + specs.mapMetaDefault.insert( + pair(item.first,item.second.get()) + ); +} // readChangesFile + + +// ------------------------ +// printSingletons +// ------------------------ + +void printSingletons(const std::string &file) +{ + const json::object &jfile = readJSONFile(file,true); + + for (const auto &item : jfile) { + if (beginsin(item.first, "//")) + continue; + if (!item.second.holds()) + continue; + const json::object &rhs = item.second.get(); + + if (!isClass(item)) + continue; + + const bool hasdata = + (rhs.has("string" ) && !rhs["string" ].holds()) || + (rhs.has("vector" ) && !rhs["vector" ].holds()) || + (rhs.has("bodyText") && !rhs["bodyText"].holds()); + + const json::object metadata = getMetadataJSON(rhs); + const json::object children = getChildrenJSON(rhs); + + const std::string parent = item.first; + if (metadata.size() == 0 && children.size() == 1 && !hasdata) + std::cout + << color::custom::green + << " Entry has no metadata or data, and just one child: " + << color::custom::blue << parent << color::reset << std::endl; + if (metadata.size() == 0 && children.size() == 0 && !hasdata) + std::cout + << color::custom::yellow + << " Entry has no metadata, data, or children: " + << color::custom::blue << parent << color::reset << std::endl; + } +} // printSingletons + + +// ------------------------ +// commandLine +// ------------------------ + +// Gather information from the JSON file given on the command line +void commandLine( + const int argc, const char *const *const argv, + InfoSpecs &specs +) { + // Usage + if (argc < 2) { + std::cout << "Usage: " << argv[0] << " file.json" << std::endl; + exit(EXIT_FAILURE); + } + + // Input file + const json::object jmain = readJSONFile(argv[1]); + + // JSON keys we'll look for + static const std::string path = "Path"; + static const std::string project = "Project"; + static const std::string version = "Version"; + static const std::string input = "JSONDir"; + static const std::string files = "JSONFiles"; + static const std::string enums = "Enumerators"; + static const std::string changes = "Changes"; + + // Need "Version" + if (!jmain.has(version)) { + log::error("The input JSON file needs {}", version); + throw std::exception{}; + } + + // Need "JSONFiles" + if (!jmain.has(files)) { + log::error("The input JSON file needs {}", files); + throw std::exception{}; + } + + // Extract information from the command line JSON file... + + // ...these are optional: + specs.Path = jmain.has(path ) + ? jmain[path ].get() : "."; + specs.Project = jmain.has(project) + ? jmain[project].get() : "GNDStk"; + specs.JSONDir = jmain.has(input ) + ? jmain[input ].get() : "."; + + if (jmain.has(enums)) + for (const auto &e : jmain[enums].get()) { + specs.Enumerators.push_back( + std::make_pair(e.first,std::vector())); + for (const auto &sym : e.second.get()) + specs.Enumerators.back().second.push_back(sym.get()); + } + + // ...these are required: + specs.Version = jmain[version].get(); + for (const auto &str : jmain[files].get()) + specs.JSONFiles.push_back(str.get()); + + // Version, with '_'s in place of '.'s + specs.VersionUnderscore = replace(specs.Version, '.', '_'); + + // Prepend the JSON file names with their directory + for (std::string &file : specs.JSONFiles) + file = specs.JSONDir + '/' + file; + + // File names... + + // For C++ + const std::string cbase = + specs.Path + "/" + specs.Project + "/src/" + specs.Project + "/"; + specs.hppVersion = cbase + specs.Version + ".hpp"; + specs.hppKey = cbase + specs.Version + "/key.hpp"; + + // For the C interface + const std::string cppbase = specs.Path + "/" + specs.Project + "/c/src/"; + specs.hVersion = cppbase + specs.Version + ".h"; + // We don't currently know of anything that we'd have in the following + // file, so we won't create it. But I'll leave this in as a placeholder. + specs.cVersion = cppbase + specs.Version + ".cpp"; + + // For the python interface + const std::string pybase = specs.Path + "/" + specs.Project + "/python/src/"; + specs.allPython = pybase + "all.python.cpp"; + specs.cppPython = pybase + specs.Version + ".python.cpp"; + + // Changes? + if (jmain.has(changes)) + readChangesFile(jmain[changes].get(),specs); +} // commandLine + + +// ----------------------------------------------------------------------------- +// preprocess* functions +// ----------------------------------------------------------------------------- + +// preprocessClass +void preprocessClass( + InfoSpecs &specs, const std::string &nsname, const json::pair &keyval +) { + // Ensure that this JSON entry represents a class - as opposed + // to being, say, "namespace" or some other non-class entry. + if (!isClass(keyval)) + return; + + // Get the class name, then link this class with the current namespace. + // This information is used, later, for various purposes. + const std::string clname = nameClass(keyval,specs); + specs.class2nspace.insert(std::make_pair(clname,nsname)); + + // ------------------------ + // Create directories + // ------------------------ + + // For the present namespace: C++, Python, and C directories. The present + // namespace probably contains multiple classes, so these directories may + // have been created already, but that's fine. + const std::string nsdircpp = specs.Path + "/" + specs.Project + + "/src/" + specs.Project + "/" + specs.Version + "/" + nsname; + const std::string nsdirpy = specs.Path + "/" + specs.Project + + "/python/src/" + specs.Version + "/" + nsname; + const std::string nsdirc = specs.Path + "/" + specs.Project + + "/c/src/" + specs.Version + "/" + nsname; + const std::string nsdirf03 = specs.Path + "/" + specs.Project + + "/fortran/src/" + specs.Version + "/" + nsname; + + // For the present class: C++ and C source and test directories. + const std::string clsrccpp = nsdircpp + "/" + clname + "/src"; + const std::string cltestcpp = nsdircpp + "/" + clname + "/test"; + const std::string clsrcc = nsdirc + "/" + clname + "/src"; + const std::string cltestc = nsdirc + "/" + clname + "/test"; + // const std::string clsrcf03 = nsdirf03 + "/" + clname + "/src"; + // const std::string cltestf03 = nsdirf03 + "/" + clname + "/test"; + + // Create the above directories, if (and only if) they don't already exist. + system(("mkdir -p " + nsdircpp ).data()); + system(("mkdir -p " + nsdirpy ).data()); + system(("mkdir -p " + nsdirc ).data()); + system(("mkdir -p " + nsdirf03 ).data()); + system(("mkdir -p " + clsrccpp ).data()); + system(("mkdir -p " + cltestcpp).data()); + system(("mkdir -p " + clsrcc ).data()); + system(("mkdir -p " + cltestc ).data()); + // system(("mkdir -p " + clsrcf03 ).data()); + // system(("mkdir -p " + cltestf03).data()); + + // ------------------------ + // Create custom files + // ------------------------ + + // To allow for customization of the present class in the present namespace, + // create certain custom.* files. Do so, however, only where any such file + // isn't already there, or else we might be trashing someone's customization! + + // Below, the "false" parameters in the writer constructions prevent the + // file from getting our "autogenerated, do not modify" admonishment at the + // top. This makes sense, as the customization file are there precisely for + // users to, well, customize. + + // C++ custom.hpp + const std::string customhpp = clsrccpp + "/custom.hpp"; + if (!std::ifstream(customhpp)) { + std::cout + << color::custom::green << " Creating " << clsrccpp + "/" + << color::custom::blue << "custom.hpp" << color::reset << std::endl; + writer out(customhpp,false); // false: no "file was autogenerated" message + out(); + out(0,"private:"); + out(); + out(1,"static inline helpMap help = {};"); + } + + // As above, but for the C interface: create custom.h and custom.cpp if and + // where they don't already exist. + + // C custom.h + const std::string customh = clsrcc + "/custom.h"; + if (!std::ifstream(customh)) { + std::cout + << color::custom::green << " Creating " << clsrcc + "/" + << color::custom::blue << "custom.h" << color::reset << std::endl; + writer out(customh,false); + } + + // C custom.cpp + // Meaning, C++ source for the C interface to call. (That is, this isn't for + // C++ itself; remember that our C++ library is header-only.) + const std::string customcpp = clsrcc + "/custom.cpp"; + if (!std::ifstream(customcpp)) { + std::cout + << color::custom::green << " Creating " << clsrcc + "/" + << color::custom::blue << "custom.cpp" << color::reset << std::endl; + writer out(customcpp,false); + } + + // ------------------------ + // Create file-name maps + // ------------------------ + + // For this namespace: + // The cpp file for Python + // ns.first -> a PerNamespace + auto ns = specs.namespace2data.insert(std::make_pair(nsname,PerNamespace{})); + ns.first->second.cppPython = nsdirpy + ".python.cpp"; + ns.first->second.nsname = nsname; + + // For this namespace::class: + // The cpp file for Python + // The hpp file for GNDStk + // The C/C++ header, and the C++ backend source for the C interface + // The Fortran 2003 source + // cl.first -> a PerClass + auto cl = specs.class2data.insert( + std::make_pair(NamespaceAndClass{nsname,clname}, PerClass{})); + assert(cl.second); // should have been inserted - not there already + cl.first->second.cppPython = nsdirpy + "/" + clname + ".python.cpp"; + cl.first->second.hppGNDStk = nsdircpp + "/" + clname + ".hpp"; + cl.first->second.headerC = nsdirc + "/" + clname + ".h"; + cl.first->second.sourceC = nsdirc + "/" + clname + ".cpp"; + cl.first->second.sourceF03 = nsdirf03 + "/" + clname + ".f03"; +} // preprocessClass + + +// preprocessFiles +// This reads the JSON spec files and collects preliminary information that's +// used, later, when the spec files are processed in more detail. (Detailed +// processing requires knowledge obtained from this preliminary pass, which is +// why these things are done separately.) This preliminary processing includes +// creating a class-to-namespace map; creating directories into which output +// files will be placed; creating class-specific customization files when it's +// appropriate to do so; and creating maps from namespace to namespace-specific +// information, and from namespace::class to class-specific information. File +// names are computed as part of the "information" for the maps just mentioned. +void preprocessFiles(InfoSpecs &specs) +{ + // files + for (const std::string &file : specs.JSONFiles) { + const json::object jmain = readJSONFile(file,true); + const std::string nsname = getFileNamespace(jmain); + // classes in the file + for (const auto &cl : jmain) + preprocessClass(specs, nsname, cl); + } +} // preprocessFiles + + +// ----------------------------------------------------------------------------- +// validate* +// getClass +// getFilesAndClasses +// ----------------------------------------------------------------------------- + +// validateMetadata +void validateMetadata(const json::object &metadata) +{ + for (const auto &field : metadata) { + if (beginsin(field.first, "//")) + continue; + assert(field.second.has("type")); + assert(field.second.has("required")); + } +} + +// validateChildren +void validateChildren(const json::object &children, const PerClass &per) +{ + for (const auto &field : children) { + if (beginsin(field.first, "//")) + continue; + assert(field.second.has("required")); + + // Consistency check: certain occurrence values imply *not* required. + // Remark: the GNDS manual speaks of "choice2" and "choice2+" options + // for occurrence. We're not sure if those will remain in future GNDS + // specifications, so we won't worry now about how they might fit in. + const std::string × = getTimes( + per, + field.first, + field.second.get() + ); + if (times == "0+" || times == "choice" || times == "choice+") + assert(!field.second["required"].get()); // not required + + if (debugging) { + const std::string key = field.first; + const std::string name = field.second.has("name") + ? field.second["name"].get() + : key; + std::cout + << "child: " + << std::setw(20) << std::left << per.nsname << " " + << std::setw(48) << std::left << per.clname << " " + << std::setw(48) << std::left << key << " " + << (key == name ? " " : "*") << " " + << std::left << name << std::endl; + } + } +} + +// getClass +void getClass( + InfoSpecs &specs, const std::string &nsname, const json::pair &keyval +) { + if (!isClass(keyval)) + return; + const std::string clname = nameClass(keyval,specs); + + // find in class map + const auto it = specs.class2data.find(NamespaceAndClass(nsname,clname)); + PerClass &per = it->second; + + // collect dependencies, for the present class, as this function proceeds + Class2Dependencies dep; + dep.theClass = NamespaceAndClass(nsname,clname); + + // names + per.nsname = nsname; + per.clname = clname; + per.nameGNDS = nameGNDS(keyval,nsname,true); + + // metadata/children information + const json::object &classRHS = keyval.second.get(); + const json::object attrs = getMetadataJSON(classRHS); + const json::object elems = getChildrenJSON(classRHS); + validateMetadata(attrs); + validateChildren(elems, per); + getClassMetadata(attrs, specs, per); + getClassChildren(elems, specs, per, dep); + getClassVariants(elems, specs, per, dep); + + // data-node information + const bool + str = classRHS.has("string" ) && !classRHS["string" ].holds(), + vec = classRHS.has("vector" ) && !classRHS["vector" ].holds(), + body = classRHS.has("bodyText") && !classRHS["bodyText"].holds(); + assert(int(str) + int(vec) + int(body) <= 1); // no more than one + + per.isDataString = str; + per.isDataVector = vec || body; + if (vec) { + // A type change, as with metadata, may be warranted here as well + const std::string type = classRHS["vector"].get(); + const auto it = specs.mapMetaType.find(type); + per.elementType = it == specs.mapMetaType.end() ? type : it->second; + } else + per.elementType = ""; + per.isDataNode = + per.isDataString || + (per.isDataVector && per.elementType != ""); + per.cdata = + classRHS.has("cdata") && + classRHS["cdata"].get(); + + // save dependencies + specs.ClassDependenciesRaw.push_back(dep); +} // getClass + + +// getFilesAndClasses +void getFilesAndClasses(InfoSpecs &specs) +{ + // each file + for (const std::string &file : specs.JSONFiles) { + const json::object jmain = readJSONFile(file); + const std::string nsname = getFileNamespace(jmain); + // each class + for (const auto &cl : jmain) + getClass(specs, nsname, cl); + } +} // getFilesAndClasses + + +// ----------------------------------------------------------------------------- +// Functions relating to our topological sort +// Adapted from: http://coliru.stacked-crooked.com/a/7c0bf8d3443b804d +// ----------------------------------------------------------------------------- + +// insertDependency +void insertDependency( + const NamespaceAndClass &wanted, + std::vector &vecSource, + std::vector &vecTarget +) { + const auto iter = std::find_if( + vecSource.begin(), vecSource.end(), + [wanted](const Class2Dependencies &c2d) { return c2d.theClass == wanted; } + ); + + if (iter != vecSource.end()) { + const Class2Dependencies c2d = *iter; + vecSource.erase(iter); + for (const NamespaceAndClass &dep : c2d.dependencies) + insertDependency(dep, vecSource, vecTarget); + vecTarget.push_back(c2d); + } +} + +// sortDependencies +void sortDependencies(InfoSpecs &specs) +{ + while (specs.ClassDependenciesRaw.size() > 0) + insertDependency( + specs.ClassDependenciesRaw.begin()->theClass, + specs.ClassDependenciesRaw, + specs.ClassDependenciesSorted); +} + + +// ----------------------------------------------------------------------------- +// ShortcutDown +// Helper for the shortcuts() function +// ----------------------------------------------------------------------------- + +void ShortcutDown( + const InfoSpecs &specs, + const InfoChildren &child, + std::map &usednames, + std::vector &path, + std::multimap> &name2path, + std::set &optvec, + std::string &title, // might be modified + int down, + const bool warn, + bool consider // <== we've *not* already gone through an optional or vector? +) { + if (child.isOptional || child.isVector) + consider = false; // at least henceforth, if not already + + const std::string &nsname = child.ns; + const std::string &clname = child.plain; + const auto it = specs.class2data.find(NamespaceAndClass(nsname,clname)); + if (it == specs.class2data.end()) { + // We can't seem to find the namespace::class of the child object we're + // looking at. This is probably more-or-less an error situation, at least + // if somebody created all the children in their generated classes at the + // same time that they created the parent - basically, meaning everything + // was created in a single run of the code generator, which is how we + // intend for it to be used. In any event: right here, in the present + // context, we can't reason about shortcuts through the child if we can't + // find any information *about* the child. So, we'll just return. + return; + } + + for (const auto &grand : it->second.children) { + // grand: an InfoChildren + const auto used = usednames.find(grand.name); + if (used == usednames.end()) { + if (consider) { + // Create a preliminary shortcut, to be used later if, and only if, + // nothing elsewhere introduces a name conflict. If something else + // does, then we'll say, at that point, that the potential shortcut + // is ambiguous. (It would probably create confusion if we somehow + // chose one shortcut path over others, or tried to disambiguate by + // inventing different names based on the same original name.) + name2path.insert(std::make_pair(grand.name,path)); + } else { + // We've gone through an optional or vector, and thus won't ever + // be creating a shortcut to here. However, we'll record the fact + // that something of this name exists, even if only through an + // optional or vector, because such a scenario might be regarded + // as a good reason to *not* shortcut to other same-named objects + // that are otherwise valid for shurtcuts. + optvec.insert(grand.name); + } + } else if (warn && !used->second) { + std::cout + << title << color::custom::faded::yellow + << " Shortcut would conflict with existing field: " + << color::custom::yellow << grand.name + << color::reset << std::endl; + title = ""; + used->second = true; // so, don't report future conflicts w/same name + } + + // Note that we always dig further, regardless of what happened with the + // above conditionals. The current object might or might not, for whatever + // reason or reasons, be something to which we could shortcut. However, + // objects further down could potentially still be shortcut candidates, + // or could prove to be deal breakers for other candidates. + if (--down) { + path.push_back(grand.name); + ShortcutDown( + specs, grand, usednames, path, name2path, + optvec, title, down, warn, consider + ); + path.pop_back(); + } + down++; + } +} + + +// ----------------------------------------------------------------------------- +// shortcuts +// ----------------------------------------------------------------------------- + +void shortcuts(InfoSpecs &specs, int down, const bool warn) +{ + if (down == 1) + return; + + // ------------------------ + // For each class + // ------------------------ + + for (auto &s : specs.class2data) { + // s.first : a NamespaceAndClass + // s.second: a PerClass, which we'll call "current" (the current class) + + // The following, title, simply tells us the namespace::class we're + // currently examining. We'll arrange things so that it isn't printed + // at all (thus reducing/decluttering the code generator's output) if + // there's nothing to say - no shortcuts, no remarks about why some + // shortcut potential didn't pan out. If anything *is* said, title is + // printed and then set to "", so that it isn't needlessly re-printed. + std::string title = + color::custom::faded::purple + s.first.nsname + "::" + + color::custom::purple + s.first.clname + + color::reset + '\n'; + + // ------------------------ + // Existing field names + // in the current class + // ------------------------ + + // The bool is for diagnostic reporting, if we want to report only + // once, per name, about potential shortcut(s) conflicting with it. + std::map usednames; + + // comment; all of our generated classes have this + usednames.insert(std::make_pair("comment",false)); + + // metadata, children, variants + PerClass ¤t = s.second; + for (const auto &m : current.metadata) + usednames.insert(std::make_pair(m.name,false)); + for (const auto &c : current.children) + usednames.insert(std::make_pair(c.name,false)); + for (const auto &v : current.variants) + usednames.insert(std::make_pair(v.name,false)); + + // data (string or vector) + if (current.isDataNode) { + if (current.isDataString) + usednames.insert(std::make_pair("string",false)); + else { + // As in some other new(er) code-generator capabilities, I haven't + // handled the GNDS valueType (basically, dynamic data type) stuff + // here because it's inherently a messy concept and we may be able + // to avoid the need for it. (But possibly todo.) + auto it = nameMap.find(current.elementType); + if (it != nameMap.end()) + usednames.insert(std::make_pair(it->second.second,false)); + } + } + + // ------------------------ + // Visit children + // ------------------------ + + // For each object to which a shortcut may be possible (to be determined, + // based on criteria such as uniqueness), we'll have a map key:value pair. + // The key is the name of the object to which we may shortcut. The value + // is a vector of names, giving the path to the object. Example: say that + // the current class has x, which has y, which has foo. The potential foo + // shortcut would be represented by map key "foo", value {"x","y"}. Note + // that we use a multimap, because something might appear via multiple + // viable paths - without going through any optional, vector, or variant. + // An object of the same name being in multiple paths may mean that we + // won't shortcut to any of them (unless we decide on a reasonable way + // to disambiguate), but we can still use the multimap we'll be computing + // to print informational messages telling users about multuple paths. + std::multimap> name2path; + + // The above will contain key:value pairs for objects that appear to be + // valid for shortcutting - they don't go through optionals or vectors - + // except potentially for ambiguities. We'll also maintain (separately, + // as doing so is cleaner) a set of names that appear through optionals + // and/or vectors. We won't need paths here, as we'd never be using them, + // and also don't need to record names more than once for our purposes + // here (hence a plain set). This set can be used to exclude otherwise + // valid and unambiguous shortcuts, if we regard the existence of another + // object of the same name - even under an optional or a vector - to have + // introduced an ambiguity. todo: Consider variants here too! + std::set optvec; + + // Each "child" in the following is of class InfoChildren + for (const auto &child : current.children) { + // Path down which we're shortcutting + std::vector path; + path.push_back(child.name); + + // The "true" in the following call means we haven't already gone + // through an optional or vector. Which of course we haven't - at + // this point, because this is the initial call into the recursion. + down--; + ShortcutDown( + specs, child, usednames, path, name2path, + optvec, title, down, warn, true + ); + down++; + } + + // ------------------------ + // Identify unique + // shortcuts + // ------------------------ + + using namespace color; + std::set reportedAlready; + + // For each potential shortcut as determined above... + for (const auto &cut : name2path) { + const std::string &name = cut.first; + const std::vector &path = cut.second; + + // If a shortcut of this name would be ambiguous directly - because + // another otherwise viable shortcut of the same name exists - then + // report on this. We arrange to do the reporting just once. + if (name2path.count(name) > 1) { + if (warn && reportedAlready.find(name) == reportedAlready.end()) { + std::cout + << title << " " << custom::faded::yellow + << "Shortcut would be ambiguous: " + << custom::yellow << name << reset << std::endl; + title = ""; + + auto one = name2path.lower_bound(name); + auto end = name2path.upper_bound(name); + while (one != end) { + std::cout << " " << custom::faded::yellow; + for (const std::string &field : one->second) + std::cout << field << '.'; + std::cout << custom::yellow << name << reset << std::endl; + one++; + } + + // So we don't print the above message again, for the duplicates + reportedAlready.insert(name); + } + continue; + } + + // If a shortcut of this name *could* be considered ambiguous because + // the same name also exists beyond an optional or a vector, then the + // following code excludes it from being made into a shortcut. We may + // or may not want to have this condition. Todo: decide on this. + if (optvec.find(name) != optvec.end()) { + if (warn && reportedAlready.find(name) == reportedAlready.end()) { + std::cout + << title << " " << custom::faded::yellow + << "Shortcut would be ambiguous vis-à-vis optional/vector: " + << custom::yellow << name << reset << std::endl; + title = ""; + reportedAlready.insert(name); + } + continue; + } + + // Shortcut! + std::cout << title << custom::blue << " Shortcut: " << custom::green; + title = ""; + for (const std::string &field : path) + std::cout << field << '.'; + std::cout << custom::red << name << reset << std::endl; + + // Remember this shortcut. We'll use it soon, + // when writing code for the current class. + current.name2path.insert(cut); + } + } // each class in which we're looking for shortcuts +} diff --git a/autogen/json2class-map.cpp b/autogen/json2class-map.cpp new file mode 100644 index 000000000..192e9177c --- /dev/null +++ b/autogen/json2class-map.cpp @@ -0,0 +1,48 @@ + +// ----------------------------------------------------------------------------- +// nameMap +// ----------------------------------------------------------------------------- + +const std::map> nameMap = +{ + // ---------------------- ----------- ----------------- + // In per.elementType The A name to use + // or in per.metadata's appropriate for the function + // valueType defaultValue C++ type that returns them + // ---------------------- ----------- ----------------- + + // Described in the GNDS manual. + // I'm not sure which of the several types that map to std::string can, + // or would, appear in any GNDS specifications in such a way that we'd + // need it here, but listing all "string-like" types shouldn't hurt. + { "Integer32" , { "int" , "ints" } }, + { "UInteger32" , { "unsigned" , "uints" } }, + { "Float64" , { "double" , "doubles" } }, + { "XMLName" , { "std::string" , "strings" } }, + { "UTF8Text" , { "std::string" , "strings" } }, + { "printableText" , { "std::string" , "strings" } }, + { "quotedText" , { "std::string" , "strings" } }, + { "tdText" , { "std::string" , "strings" } }, + + // We allow these as well. + { "int" , { "int" , "ints" } }, + { "unsigned" , { "unsigned" , "uints" } }, + { "double" , { "double" , "doubles" } }, + { "string" , { "std::string" , "strings" } }, + { "std::string" , { "std::string" , "strings" } }, + + // Allow other sensible things. + { "char" , { "char" , "chars" } }, + { "signed char" , { "signed char" , "schars" } }, + { "short" , { "short" , "shorts" } }, + { "long" , { "long" , "longs" } }, + { "long long" , { "long long" , "longlongs" } }, + { "unsigned char" , { "unsigned char" , "uchars" } }, + { "unsigned short" , { "unsigned short" , "ushorts" } }, + { "unsigned int" , { "unsigned" , "uints" } }, + { "unsigned long" , { "unsigned long" , "ulongs" } }, + { "unsigned long long" , { "unsigned long long" , "ulonglongs" } }, + { "float" , { "float" , "floats" } }, + { "long double" , { "long double" , "longdoubles" } }, + { "quad" , { "long double" , "quads" } } +}; diff --git a/autogen/json2class-python.cpp b/autogen/json2class-python.cpp new file mode 100644 index 000000000..6ea280e64 --- /dev/null +++ b/autogen/json2class-python.cpp @@ -0,0 +1,536 @@ + +// ----------------------------------------------------------------------------- +// filePythonAll +// ----------------------------------------------------------------------------- + +void filePythonAll(const InfoSpecs &specs) +{ + writer out(specs.allPython); + + // ------------------------ + // core + // ------------------------ + + // comment + out(); + out(largeComment); + out("// core"); + out(largeComment); + + // includes + out(); + out("// core"); + out("#include \"GNDStk.python.cpp\""); + out(); + out("// node"); + out("#include \"core/Node.python.cpp\""); + out(); + + // ------------------------ + // version + // ------------------------ + + // comment + out(); + out(largeComment); + out("// @", specs.Version); + out(largeComment); + + // version + out(); + out("// @", specs.Version); + out("#include \"@.python.cpp\"", specs.Version); + + // enumerations + if (specs.Enumerators.size()) { + out(); + out("// enumerations"); + for (const auto &e : specs.Enumerators) + out("#include \"enums/@.python.cpp\"", e.first); + } + + // each namespace and its classes + for (const std::pair &ns : specs.namespace2data) { + out(); + out("// namespace @", ns.second.nsname); + out("#include \"@/@.python.cpp\"", specs.Version, ns.second.nsname); + for (const auto &c : specs.class2data) { + const std::string nsname = c.first.nsname; + const std::string clname = c.first.clname; + if (nsname == ns.second.nsname) + out("#include \"@/@/@.python.cpp\"", specs.Version, nsname, clname); + } + } +} // filePythonAll + + +// ----------------------------------------------------------------------------- +// filePythonVersion +// ----------------------------------------------------------------------------- + +void filePythonVersion(const InfoSpecs &specs) +{ + writer out(specs.cppPython); + out(); + out("#include "); + out("#include "); + out("#include "); + out(); + out("// project @", specs.Project); + out("namespace python_@ {", specs.Project); + + if (specs.Enumerators.size()) { + out(); + out(1,"// version @: enum wrapper declarations", specs.Version); + out(1,"namespace python_@ {", specs.VersionUnderscore); + out(1,"namespace python_enums {"); + for (const auto &e : specs.Enumerators) + out(2,"void wrap@(pybind11::module &);", e.first); + out(1,"} // namespace python_enums"); + out(1,"} // namespace python_@", specs.VersionUnderscore); + } + + out(); + out(1,"// version @: namespace wrapper declarations", specs.Version); + out(1,"namespace python_@ {", specs.VersionUnderscore); + for (const std::pair &ns : specs.namespace2data) + out(2,"void wrap@(pybind11::module &);", capital(ns.second.nsname)); + out(1,"} // namespace python_@", specs.VersionUnderscore); + + out(); + out(1,"// version @: wrapper", specs.Version); + out(1,"void wrap@(pybind11::module &module)", + capital(specs.VersionUnderscore)); + out(1,"{"); + out(2,"// @", specs.Version); + out(2,"pybind11::module submodule = module.def_submodule("); + out(3,"\"@\",", specs.VersionUnderscore); + if (specs.Project == "GNDStk") + out(3,"\"GNDS @\"", specs.Version); // "GNDS", not "GNDStk" + else + out(3,"\"@ @\"", specs.Project, specs.Version); + out(2,");"); + + if (specs.Enumerators.size()) { + out(); + out(2,"// @ enumerations", specs.Version); + for (const auto &e : specs.Enumerators) + out(2,"python_@::python_enums::wrap@(submodule);", + specs.VersionUnderscore, e.first); + } + + out(); + out(2,"// @ namespaces", specs.Version); + for (const std::pair &ns : specs.namespace2data) + out(2,"python_@::wrap@(submodule);", + specs.VersionUnderscore, capital(ns.second.nsname)); + out(1,"}"); + out(); + out("} // namespace python_@", specs.Project); +} // filePythonVersion + + +// ----------------------------------------------------------------------------- +// filePythonNamespace +// ----------------------------------------------------------------------------- + +void filePythonNamespace(const InfoSpecs &specs, const PerNamespace &per) +{ + writer out(per.cppPython); + out(); + out("#include "); + out("#include "); + out("#include "); + out(); + out("// project @", specs.Project); + out("// version @", specs.Version); + out("namespace python_@ {", specs.Project); + out("namespace python_@ {", specs.VersionUnderscore); + + out(); + out(1,"// namespace @: class wrapper declarations", per.nsname); + out(1,"namespace python_@ {", per.nsname); + for (const auto &cl : specs.ClassDependenciesSorted) + if (cl.theClass.nsname == per.nsname) + out(2,"void wrap@(pybind11::module &);", cl.theClass.clname); + out(1,"} // namespace python_@", per.nsname); + + out(); + out(1,"// namespace @: wrapper", per.nsname); + out(1,"void wrap@(pybind11::module &module)", capital(per.nsname)); + out(1,"{"); + out(2,"// @", per.nsname); + out(2,"pybind11::module submodule = module.def_submodule("); + out(3,"\"@\",", per.nsname); + if (specs.Project == "GNDStk") + out(3,"\"GNDS @ @\"", specs.Version, per.nsname); // "GNDS", not "GNDStk" + else + out(3,"\"@ @ @\"", specs.Project, specs.Version, per.nsname); + out(2,");"); + + out(); + out(2,"// @ classes", per.nsname); + for (const auto &cl : specs.ClassDependenciesSorted) + if (cl.theClass.nsname == per.nsname) + out(2,"python_@::wrap@(submodule);", per.nsname, cl.theClass.clname); + out(1,"}"); + out(); + out("} // namespace python_@", specs.VersionUnderscore); + out("} // namespace python_@", specs.Project); +} // filePythonNamespace + + +// ----------------------------------------------------------------------------- +// filePythonClass +// ----------------------------------------------------------------------------- + +void filePythonClass(const InfoSpecs &specs, const PerClass &per) +{ + const std::string &nsname = per.nsname; + const std::string &clname = per.clname; + writer out(per.cppPython); + + std::vector> dataTypesNames; + if (per.isDataVector) { + // try to find per.elementType in nameMap + auto it = nameMap.find(per.elementType); + if (it != nameMap.end()) { + // node has a fixed data type + dataTypesNames.emplace_back(it->second.first, it->second.second); + } else { + // node has a runtime data type: select types to expose + static std::array types = { "int", "double", "string" }; + for (const auto &type : types) { + it = nameMap.find(type); + dataTypesNames.emplace_back(it->second.first, it->second.second); + } + } + } + + // ------------------------ + // Begin file + // ------------------------ + + out(); + out("// system includes"); + out("#include "); + out("#include "); + out("#include "); + + out(); + out("// local includes"); + out("#include \"@/@/@/@.hpp\"", + specs.Project, specs.Version, nsname, clname); + out("#include \"definitions.hpp\""); + + out(); + out("namespace python_@ {", specs.Project); + out("namespace python_@ {", specs.VersionUnderscore); + out("namespace python_@ {", nsname); + + out(); + out("// wrapper for @::@", nsname, clname); + out("void wrap@(pybind11::module &module)", clname); + out("{"); + const std::string prefix = specs.Project == "GNDStk" ? "njoy::" : ""; + out(1,"using namespace @@;", + prefix, specs.Project); + out(1,"using namespace @@::@;", + prefix, specs.Project, specs.VersionUnderscore); + out(); + out(1,"// type aliases"); + out(1,"using cppCLASS = @::@;", nsname, clname); + + // using [variant name] = std::variant..., if necessary + for (const auto &v : per.variants) { + out(1,"using @ = std::variant<", v.type); + int count = 0; + const int total = v.children.size(); + for (const auto &c : v.children) + out(2,"@@", c.type, sep(count,total)); + out(1,">;"); + } + + out(); + out(1,"// create the Python object"); + out(1,"pybind11::class_ object("); + out(2,"module, \"@\",", clname); + out(2,"cppCLASS::component_t::documentation().data()"); + out(1,");"); + + // ------------------------ + // pybind11::init<...> + // for construction from + // metadata and children + // ------------------------ + + int count = 0; + const int total = per.nfields(); + + out(); + out(1,"// constructor: from fields"); + out(1,"object.def("); + out(2,"pybind11::init<"); + { + // init<> arguments + for (const auto &m : per.metadata) + out(3,"const @ &@", + m.isDefaulted ? "std::optional<" + m.type + ">" : m.typeFull, + sep(count,total)); + for (const auto &c : per.children) + out(3,"const @ &@", c.typeFull, sep(count,total)); + for (const auto &v : per.variants) + out(3,"const @ &@", v.typeFull, sep(count,total)); + } + out(2,">(),"); + + for (const auto &m : per.metadata) + out(2,"pybind11::arg(\"@\")@,", + namePython(m.name), + m.isOptional || m.isDefaulted ? " = std::nullopt" : ""); + for (const auto &c : per.children) + out(2,"pybind11::arg(\"@\")@,", + namePython(c.name), + c.isOptional ? " = std::nullopt" : ""); + for (const auto &v : per.variants) + out(2,"pybind11::arg(\"@\"),", + namePython(v.name)); + out(2,"cppCLASS::component_t::documentation(\"constructor\").data()"); + out(1,");"); // object.def( + + // ------------------------ + // pybind11::init<...> + // for construction from + // vector + // ------------------------ + + // vector type[s], as computed above + for (const auto &dataTypeName : dataTypesNames) { + out(); + out(1,"// constructor: from vector"); + out(1,"object.def("); + out(2,"pybind11::init<"); + out(3,"const std::vector<@> &", dataTypeName.first); + out(2,">(),"); + out(2,"pybind11::arg(\"@\"),", dataTypeName.second); + out(2,"cppCLASS::component_t::documentation(\"constructor\").data()"); + out(1,");"); // object.def( + } + + // ------------------------ + // def_property + // metadata + // ------------------------ + + // todo + // We need to ensure that what we're doing, below, works for optional, + // Defaulted, and variant. (At the time of this writing, I'm not using + // Defaulted or variant anywhere in the GNDS 2.0 specs.) + + for (const auto &m : per.metadata) { + const auto pyname = namePython(m.name); + out(); + out(1,"// get/set @", m.name); + out(1,"object.def_property("); + // name + out(2,"\"@\",", pyname); + // get + out(2,"[](const cppCLASS &self) -> decltype(auto)"); + out(2,"{"); + m.isDefaulted + ? out(3,"return self.@().value();", m.name) + : out(3,"return self.@();", m.name); + out(2,"},"); + // set + m.isDefaulted + ? out(2,"[](cppCLASS &self, const @ &value)", m.type) + : out(2,"[](cppCLASS &self, const @ &value)", m.typeFull); + out(2,"{"); + out(3,"self.@() = value;", m.name); + out(2,"},"); + // documentation + out(2,"cppCLASS::component_t::documentation(\"@\").data()", pyname); + out(1,");"); + } + + // ------------------------ + // def_property + // children + // ------------------------ + + for (const auto &c : per.children) { + const auto pyname = namePython(c.name); + out(); + out(1,"// get/set @", c.name); + out(1,"object.def_property("); + // name + out(2,"\"@\",", pyname); + // get + out(2,"[](const cppCLASS &self) -> decltype(auto)"); + out(2,"{"); + out(3,"return self.@();", c.name); + out(2,"},"); + // set + out(2,"[](cppCLASS &self, const @ &value)", c.typeFull); + out(2,"{"); + out(3,"self.@() = value;", c.name); + out(2,"},"); + // documentation + out(2,"cppCLASS::component_t::documentation(\"@\").data()", pyname); + out(1,");"); + } + + // ------------------------ + // def_property + // variants + // ------------------------ + + for (const auto &v : per.variants) { + if (!v.isVector) { + for (const auto &c : v.children) { + const auto pyname = namePython(c.name); + out(); + out(1,"object.def_property("); + // name + out(2,"\"@\",", pyname); + // get + out(2,"[](const cppCLASS &self) -> decltype(auto)"); + out(2,"{"); + out(3,"return self.@();", c.name); + out(2,"},"); + // set + out(2,"[](cppCLASS &self, const @ &value)", c.type); + out(2,"{"); + out(3,"self.@() = value;", c.name); + out(2,"},"); + // documentation + out(2,"cppCLASS::component_t::documentation(\"@\").data()", pyname); + out(1,");"); + } + } + const auto pyname = namePython(v.name); + out(); + out(1,"object.def_property("); + // name + out(2,"\"@\",", pyname); + // get + out(2,"[](const cppCLASS &self) -> decltype(auto)"); + out(2,"{"); + out(3,"return self.@();", v.name); + out(2,"},"); + // set + out(2,"[](cppCLASS &self, const @ &value)", v.typeFull); + out(2,"{"); + out(3,"self.@() = value;", v.name); + out(2,"},"); + // documentation + out(2,"cppCLASS::component_t::documentation(\"@\").data()", pyname); + out(1,");"); + } + + // ------------------------ + // def_property + // string + // ------------------------ + + if (per.isDataString) { + out(); + out(1,"// get/set data string"); + out(1,"object.def_property("); + out(2,"\"string\","); + out(2,"[](const cppCLASS &self) -> const std::string &"); + out(2,"{"); + out(3,"return self;"); + out(2,"},"); + out(2,"[](cppCLASS &self, const std::string &value)"); + out(2,"{"); + out(3,"self = value;"); + out(2,"},"); + out(2,"cppCLASS::component_t::documentation(\"string\").data()"); + out(1,");"); + } + + // ------------------------ + // def_property + // vector(s) + // ------------------------ + + for (const auto &dataTypeName : dataTypesNames) { + out(); + out(1,"// get/set vector<@>", dataTypeName.first); + out(1,"object.def_property("); + // name + out(2,"\"@\",", dataTypeName.second); + // get + out(2,"[](const cppCLASS &self) -> const std::vector<@> &", + dataTypeName.first); + out(2,"{"); + per.elementType == "" // vector is... + ? out(3,"return self.@();", dataTypeName.second) // ...of dynamic type + : out(3,"return self;"); // ...of a fixed type + out(2,"},"); + // set + out(2,"[](cppCLASS &self, const std::vector<@> &value)", + dataTypeName.first); + out(2,"{"); + per.elementType == "" // vector is... + ? out(3,"self.@() = value;", dataTypeName.second) // ...of dynamic type + : out(3,"self = value;"); // ...of a fixed type + out(2,"},"); + // documentation + out(2,"cppCLASS::component_t::documentation(\"@\").data()", + dataTypeName.second); + out(1,");"); + } + + // ------------------------ + // def_property + // shortcuts + // ------------------------ + + for (const auto &cut : per.name2path) { + const std::string &name = cut.first; + const auto pyname = namePython(name); + out(); + out(1,"// shortcut: get/set @", name); + out(1,"object.def_property("); + // name + out(2,"\"@\",", pyname); + // get + out(2,"[](const cppCLASS &self) -> decltype(auto)"); + out(2,"{"); + out(3,"return self.@();", name); + out(2,"},"); + // set + // todo For the benefit of clarity both here and where the shortcut + // references appear in the generated C++ classes, I suppose we should + // determine the direct type of the referenced object. Note that it will + // be some sort of Field<>, and, because Field<> is defined inside of + // Component<> (intentionally so - see the remarks where class Field + // is defined), we need to realize that Field inside a referencing + // class will have a different meaning than Field in a referenced + // context. We should think about ways to make this clearer in the code. + out(2,"[](cppCLASS &self, const std::decay_t &value)", + name); + out(2,"{"); + out(3,"self.@() = value;", name); + out(2,"},"); + // documentation + out(2,"cppCLASS::component_t::documentation(\"@\").data()", pyname); + out(1,");"); + } + + // ------------------------ + // finish + // ------------------------ + + out(); + out(1,"// add standard definitions"); + out(1,"addStandardComponentDefinitions(object);"); + out("}"); + + out(); + out("} // namespace python_@", nsname); + out("} // namespace python_@", specs.VersionUnderscore); + out("} // namespace python_@", specs.Project); +} // filePythonClass diff --git a/autogen/json2class-struct.cpp b/autogen/json2class-struct.cpp new file mode 100644 index 000000000..1de63d44a --- /dev/null +++ b/autogen/json2class-struct.cpp @@ -0,0 +1,235 @@ + +// NamespaceAndClass +struct NamespaceAndClass { + std::string nsname; // name of a namespace + std::string clname; // name of a class in the namespace + + NamespaceAndClass(const std::string &ns = "", const std::string &cl = "") : + nsname(ns), clname(cl) + { } + + bool operator==(const NamespaceAndClass &other) const + { + return nsname == other.nsname && clname == other.clname; + } + + bool operator<(const NamespaceAndClass &other) const + { + return + nsname < other.nsname ? true + : other.nsname < nsname ? false + : clname < other.clname; + } +}; + +// Class2Dependencies +// For a {namespace,class}, its {namespace,class} dependencies +struct Class2Dependencies { + NamespaceAndClass theClass; + std::vector dependencies; +}; + +// InfoMetadata +struct InfoMetadata { + // A JSON spec can make a metadatum be: + // - an optional, or + // - a Defaulted + // but (in contrast with child nodes) can't make it be a vector of metadata. + // An individual metadatum may be a vector in its own right, as in an XML + // construct such as (so that meta is a vector of + // integers). We mean here that there isn't a vector of such [meta] entries, + // and there shouldn't be (XML wouldn't allow it). + std::string original; // without e.g. the "double" to "Double" change + std::string name; + std::string converter;// converter: callable w/operator() string to/from type + std::string type; // underlying type + std::string typeFull; // WITH any optional<> or Defaulted<> + bool isOptional; + // todo Process and use the following - isVector - in order to properly + // create C interface functions in the event that metadata are vectors. For + // instance, a metadatum like size="10 20 30" might be something we'd want + // to implement as a std::vector. In this case, we'd probably want the + // C interface to have an int* and a size. At the moment, in its current + // form, the "C interface" generated by the code generator would end up using + // "std::vector" in the C functions, and that won't actually work if + // somebody tried to compile them. (C doesn't know about C++ classes.) + // Elsewhere in the code generator, the ctype_param() and ctype_return() + // functions essentially recognize std::string and transform it to char* for + // the C interface. Basically, the point here is that we need to make the + // transformation more general. It would be impossible to absolutely know, + // for any old arbitrary C++ type that somebody *could* use for a metadatum, + // how to do something sensible in C (unless we just used a generic pointer, + // essentially punting to the C programmer to point to some suitably + // initialized chunk of memory), but at least we could have the code + // generator do something reasonable for std::vector. + bool isVector; + bool isDefaulted; + std::string defaultValue; +}; + +// InfoChildren +struct InfoChildren { + // A JSON spec can make a child node be: + // - an optional, and/or + // - a vector + // but can't make it be a GNDStk::Defaulted. (The use of a default value for + // child nodes just doesn't exist in the GNDS specifications, even though the + // concept would seem to make sense.) + std::string original; // without e.g. the "double" to "Double" change + std::string name; + std::string converter;// converter: callable w/operator() Node to/from type + std::string filter; // filter: bool callable(const Node &) + std::string label; // filter: allow for node lookup by "label" metadatum + std::string ns; // enclosing namespace + std::string plain; // underlying type, excluding namespace + std::string type; // underlying type + std::string typeFull; // WITH any optional<> or vector<> + std::string typeHalf; // withOUT any vector<> + bool isOptional; + bool isVector; +}; + +// InfoVariantsChildren +struct InfoVariantsChildren { + std::string name; + std::string ns; // enclosing namespace + std::string plain; // underlying type, excluding namespace + std::string type; // underlying type + bool isVector; +}; + +// InfoVariants +struct InfoVariants { + std::string name; + std::string type; // underlying type + std::string typeFull; // WITH any optional<> or vector<> + std::string typeHalf; // withOUT any vector<> + bool isVector; + std::vector children; +}; + +// PerNamespace +struct PerNamespace { + std::string cppPython; // cpp file for this namespace's Python interface + std::string nsname; // name of this namespace +}; + +// PerClass +struct PerClass { + std::string cppPython; // cpp file for this class' Python interface + std::string hppGNDStk; // hpp file for this class in GNDStk + std::string headerC; // header that works with both C and C++ + std::string sourceC; // C++ backend source for the C interface + std::string sourceF03; // source for the Fortran 2003 interface + + std::string nsname; // name of this class' namespace + std::string clname; // name of this class + std::string nameGNDS; // name of this class as a GNDS node + + std::string name() const { return nsname + "::" + clname; } + + // Actual printed code for the class. We build this up and then print + // it later, after having determined a dependency-aware class ordering. + std::string code; + + // Information about the contents of the class... + // ...its metadata + // ...its regular children + // ...its variant children + std::vector metadata; + std::vector children; + std::vector variants; + int nfields() const + { return metadata.size() + children.size() + variants.size(); } + + // Data node? + // If (and only if) isDataVector, elementType is considered. If it's "", then + // this is the situation in GNDS in which the type of data residing in a node + // is to be determined dynamically, via a string metadatum called valueType. + // If elementType != "" (for example, elementType == "int" or "double"), then + // elementType stipulates the wanted type. + bool isDataString; // Example: This is a free-form text string + bool isDataVector; // Example: 1.2 3.45 6.789 + std::string elementType; + // isDataNode: for convenience: either isDataString; or, isDataVector AND + // per.elementType is NOT "" (so that we use DataNode instead of BlockData) + bool isDataNode; + bool cdata; // prefer "cdata" over plain data? + + // For shortcuts from objects of this class + std::multimap> name2path; +}; + + +// ----------------------------------------------------------------------------- +// InfoSpecs +// ----------------------------------------------------------------------------- + +// Overarching data structure reflecting all of the autogenerator's input +// as well as various processed information +struct InfoSpecs { + // From the JSON file on the command line + std::string Path; + std::string Project; + std::string JSONDir; + std::string Version; + std::vector JSONFiles; + std::vector>> Enumerators; + + // Version, but with '_'s in place of '.'s + std::string VersionUnderscore; + + // Directory-prefixed names + std::string allPython; // cpp file for this version's all.python.cpp file + std::string cppPython; // cpp file for this version's Python interface + std::string hppVersion; // hpp file for this version + std::string hppKey; // hpp file for this version's Meta and Child keys + std::string hVersion; // header file for both C and C++ + std::string cVersion; // C++ backend source for the C interface + + // Changes to apply to a metadatum's name or a child node's name. + // Example: "double" (GNDS v2.0, for example, actually has a "double" node) + // to "Double" for C++. + std::map mapName; + + // Changes to apply to metadata/attribute type. + // Examples: "Boolean" to "bool", "interpolation" to "enums::Interpolation". + // We'll give a string ==> std::string type change as a freebie. :-) + std::map mapMetaType = {{"string","std::string"}}; + + // Changes to apply to metadata/attribute default. + std::map mapMetaDefault; + + // For each class in the input JSON specifications, the namespace(s) + // in which it appears. + std::multimap class2nspace; + + // Class dependencies: as originally determined, and after being sorted. + // Elements of these vectors contain: + // theClass = {nsname,clname} + // dependencies = vector<{nsname,clname}> + // These are (1) the class in question, and (2) its dependencies. + std::vector ClassDependenciesRaw; + std::vector ClassDependenciesSorted; + + // Map from namespace to information about the namespace + std::map namespace2data; + + // Map from namespace::class to information about the class + static inline const std::function< + bool(const NamespaceAndClass &a, const NamespaceAndClass &b) + > compare = + [](const NamespaceAndClass &a, const NamespaceAndClass &b) + { + // In the event that we display entries in the map, we prefer putting + // everything in alphabetical order based primarily on the class name, + // with namespace only a secondary consideration. Someone looking for + // a class need only consider its name, and not initially worry about + // what namespace it's in. + return + a.clname < b.clname || ( + a.clname == b.clname && + a.nsname < b.nsname); + }; + std::map class2data{compare}; +}; // InfoSpecs diff --git a/autogen/json2class-writer.cpp b/autogen/json2class-writer.cpp new file mode 100644 index 000000000..b28a44c9e --- /dev/null +++ b/autogen/json2class-writer.cpp @@ -0,0 +1,200 @@ + +// Comment-related markup... + +// ...For C++ +const auto largeComment = "// " + std::string(77,'-'); +const auto smallComment = "// " + std::string(24,'-'); + +// ...For Fortran 2003 +// ...Needs just one !, but we'll use two, for more uniformity with C++) +const auto largeFortran = "!! " + std::string(77,'-'); +const auto smallFortran = "!! " + std::string(24,'-'); + + +// ----------------------------------------------------------------------------- +// writer +// ----------------------------------------------------------------------------- + +class writer { + std::ostream &s; + std::ofstream fstream; + std::ostringstream sstream; + + static inline const char substitute = '@'; + static inline const int indent = 3; + static inline const std::string message1 = "THIS FILE WAS AUTOGENERATED!\n"; + static inline const std::string message2 = "DO NOT MODIFY!\n"; + + // recurse is used to prevent multiple reports of equivalent errors + // as we step through the format string and arguments while printing. + static int recurse; + + // checkArgs + template + void checkArgs(const std::string &str, const T &value, Ts &&...args) + { + if (recurse == 0) { + using last = decltype( + std::get(std::make_tuple(value,args...))); + const size_t nsub = std::count(str.begin(),str.end(),substitute); + // a bool last argument is not interpreted as an argument to print... + const size_t narg = + 1 + sizeof...(args) - std::is_same_v,bool>; + if (narg != nsub) { + log::error( + "Number of '{}' substitution characters and arguments " + "don't match:\n" + "writer(\"{}\", ...)", substitute, str); + throw std::exception{}; + } + } + } + + // construct + void construct(const bool autogen, const std::string &comment) const + { + if (autogen) + s << "\n" + << comment << ' ' << message1 + << comment << ' ' << message2; + } + +public: + + // writer() + // Use a string stream + explicit writer( + const bool autogen = true, const std::string &comment = "//" + ) : + s(sstream) + { + construct(autogen,comment); + } + + // writer(file) + // Use a file stream + explicit writer( + const std::string &file, + const bool autogen = true, const std::string &comment = "//" + ) : + s(fstream), fstream(file) + { + construct(autogen,comment); + } + + // str() + std::string str() const + { + if (&s != &sstream) { + log::error( + "writer.str() is available only for a writer " + "that was default constructed" + ); + throw std::exception{}; + } + return sstream.str(); + } + + // ------------------------ + // operator() + // ------------------------ + + // char* cases are needed in addition to std::string, for disambiguation. + // level is the indentation level. + + // operator()(string, newline) + template>> + void operator()(const std::string &str = "", const T newline = true) + { + s << str; + if (newline) + s << std::endl; + } + + template>> + void operator()( + const char *const str, const T newline = true + ) { + operator()(std::string(str), newline); + } + + // operator()(level, string, newline) + void operator()( + const int level, const std::string &str = "", const bool newline = true + ) { + operator()(std::string(level*indent,' ') + str, newline); + } + + void operator()( + const int level, const char *const str, const bool newline = true + ) { + operator()(level, std::string(str), newline); + } + + // operator()(string, value, args) + template< + class T, class... Ts, + class = std::enable_if_t> + > + void operator()(const std::string &str, const T &value, Ts &&...args) + { + checkArgs(str, value, std::forward(args)...); + recurse++; + for (const auto &ch : str) + if (ch != substitute) + s << ch; + else { + s << value; + operator()(std::string(&ch+1), std::forward(args)...); + break; + } + recurse--; + } + + // operator()(level, string, value, args) + template< + class T, class... Ts, + class = std::enable_if_t> + > + void operator()( + const int level, const std::string &str, const T &value, Ts &&...args + ) { + checkArgs(str, value, std::forward(args)...); + recurse++; + operator()( + std::string(level*indent,' ') + str, + value, + std::forward(args)... + ); + recurse--; + } +}; + +int writer::recurse = 0; + + +// ----------------------------------------------------------------------------- +// Helpers +// ----------------------------------------------------------------------------- + +// section +template +void section(writer &out, const std::string &str, Ts &&...args) +{ + out(); + out(); + out(largeComment); + out(str, std::forward(args)...); + out(largeComment); +} + +// sectionFortran +template +void sectionFortran(writer &out, const std::string &str, Ts &&...args) +{ + out(); + out(); + out(largeFortran); + out(str, std::forward(args)...); + out(largeFortran); +} diff --git a/autogen/json2class.cpp b/autogen/json2class.cpp index ff4a91686..d862b9239 100644 --- a/autogen/json2class.cpp +++ b/autogen/json2class.cpp @@ -4,2379 +4,179 @@ // ----------------------------------------------------------------------------- #include "GNDStk.hpp" -#include "cstring" -using namespace njoy::GNDStk::core; +#include -// Report cases of nodes that have no metadata, and zero or one child node(s). -// Where these exist, a simplification of the spec may be worth considering. -const bool singletons = true; - - - -// ----------------------------------------------------------------------------- -// Data structures -// ----------------------------------------------------------------------------- - -// KeyValue -// Too bad the JSON library doesn't provide this more straightforwardly -using KeyValue = nlohmann::detail::iteration_proxy_value< - nlohmann::detail::iter_impl< - const nlohmann::basic_json<> - > ->; - -// NamespaceAndClass -struct NamespaceAndClass { - std::string nsname; // name of a namespace - std::string clname; // name of a class in the namespace - - NamespaceAndClass(const std::string &ns = "", const std::string &cl = "") : - nsname(ns), clname(cl) - { } - - bool operator==(const NamespaceAndClass &other) const - { - return nsname == other.nsname && clname == other.clname; - } - - bool operator<(const NamespaceAndClass &other) const - { - return - nsname < other.nsname ? true - : other.nsname < nsname ? false - : clname < other.clname; - } -}; - -// Class2Dependencies -// For a {namespace,class}, its {namespace,class} dependencies -struct Class2Dependencies { - NamespaceAndClass theClass; - std::vector dependencies; -}; - -// InfoMetadata -struct InfoMetadata { - // A .json spec can make a metadatum be: - // - a std::optional, or - // - a GNDStk::defaulted - // but (in contrast with child nodes) can't make it be a vector of metadata. - // An individual metadatum may be a vector in its own right, as in an XML - // construct such as (so that meta is a vector of - // integers). We mean here that there isn't a vector of such [meta] entries, - // and shouldn't be (XML wouldn't allow it). - std::string name; - std::string type; // underlying type - std::string typeFull; // WITH any optional<> or defaulted<> - bool isOptional; - bool isDefaulted; - std::string defaultValue; -}; - -// InfoChildren -struct InfoChildren { - // A .json spec can make a child node be: - // - a std::optional, and/or - // - a std::vector - // but can't make it be a GNDStk::defaulted. (The use of a default value for - // child nodes just doesn't exist in the GNDS specifications, even though the - // concept would seem to make sense.) - std::string name; - std::string type; // underlying type - std::string typeFull; // WITH any optional<> or vector<> - std::string typeHalf; // withOUT any vector<> - bool isOptional; - bool isVector; -}; - -// InfoVariantsChildren -struct InfoVariantsChildren { - std::string name; - std::string type; - bool isVector; -}; - -// InfoVariants -struct InfoVariants { - std::string name; - std::string type; // underlying type - std::string typeFull; // WITH any optional<> or vector<> - std::string typeHalf; // withOUT any vector<> - bool isVector; - std::vector children; -}; - -// PerNamespace -struct PerNamespace { - std::string cppPython; // cpp file for this namespace's Python interface - std::string nsname; // name of this namespace -}; - -// PerClass -struct PerClass { - std::string cppPython; // cpp file for this class' Python interface - std::string hppGNDStk; // hpp file for this class in GNDStk - - std::string nsname; // name of this class' namespace - std::string clname; // name of this class - std::string nameGNDS; // name of this class as a GNDS node - - std::string name() const { return nsname + "::" + clname; } - - // Actual printed code for the class. We build this up and then print - // it later, after having determined a dependency-aware class ordering. - std::string code; - - // Information about the contents of the class... - // ...its metadata - // ...its regular children - // ...its variant children - std::vector metadata; - std::vector children; - std::vector variants; - int nfields() const - { return metadata.size() + children.size() + variants.size(); } - - // Data node? - // If (and only if) isData, dataType is considered. If dataType == "", this - // is the situation in GNDS in which the type of data residing in a node is - // to be determined dynamically, via a string metadatum called valueType. If - // dataType != "" (for example, dataType == "int" or dataType == "double"), - // then dataType is considered to stipulate the given type. - bool isData; - std::string dataType; -}; - - - -// ----------------------------------------------------------------------------- -// InfoSpecs -// ----------------------------------------------------------------------------- - -// Overarching data structure reflecting all of the autogenerator's input -// as well as various processed information -struct InfoSpecs { - // From the .json file on the command line - std::string JSONDir; - std::vector JSONFiles; - std::string GNDSDir; - std::string Version; - - // Version, but with '_' in place of '.' - std::string VersionUnderscore; - - // Directory-prefixed names - std::string hppVersion; // hpp file for this version - std::string hppKey; // hpp file for this version's Meta<>/Child<> keys - - // Changes to apply to a metadatum's or child node's name. - // Example: "double" (GNDS v1.9 does have this) to "Double" for C++. - std::map mapName; - - // Changes to apply to metadata/attribute type and default. - // Examples: "Boolean" to "bool", "interpolation" to "enums::Interpolation". - std::map mapMetaType; - std::map mapMetaDefault; - - // For each class in the input JSON specifications, the namespace(s) - // in which it appears. - std::multimap class2nspace; - - // Class dependencies: as originally determined, and after being sorted. - // Elements of these vectors contain: - // theClass = {nsname,clname} - // dependencies = vector<{nsname,clname}> - // These are (1) the class in question, and (2) its dependencies. - std::vector ClassDependenciesRaw; - std::vector ClassDependenciesSorted; - - // Map from namespace to information about the namespace - std::map namespace2data; - - // Map from namespace::class to information about the class - std::map class2data; -}; - - - -// ----------------------------------------------------------------------------- -// Miscellaneous short functions -// ----------------------------------------------------------------------------- - -// Print text describing an action the code is about to take -void action(const std::string &str) -{ - std::cout - << "\n" - << colors::plain::blue << str << "..." << colors::reset << std::endl; -} - -// Is the string all whitespace? -bool allws(const std::string &str) -{ - for (const auto c : str) - if (!isspace(c)) - return false; - return true; -} - -// Escape any double quotes in the string -std::string escape(const std::string &str) -{ - std::string ret; - for (const auto c : str) { - if (c == '"') - ret += '\\'; - ret += c; - } - return ret; -} - -// initializer -// Based on m.type and m.defaultValue, make something appropriate to use -// for initialization, as with: m.type var{return value of this function} -std::string initializer(const InfoMetadata &m) -{ - // Leave an empty or all-whitespace m.defaultValue as-is. - // This is the "no initializer" case. - if (allws(m.defaultValue)) - return ""; - - // If of string type, add double quotes. - // We assume that the input does NOT have the quotes already! - // Note: we may not need all of these, but the GNDS manual does describe - // several string-like types, so we might as well include them. - if (m.type == "XMLName" || m.type == "UTF8Text" || - m.type == "printableText" || m.type == "quotedText" || - m.type == "tdText" || m.type == "string" || m.type == "std::string") - return '"' + escape(m.defaultValue) + '"'; - - // Leave as-is; - // applicable for non-string (int, double, etc.) cases - return m.defaultValue; -} - -// Capitalize the first letter -std::string capital(const std::string &str) -{ - std::string ret = str; - if (ret.size() > 0) - ret[0] = toupper(ret[0]); - return ret; -} - -// Capitalize all letters -std::string allcaps(const std::string &str) -{ - std::string ret = str; - for (auto i = ret.size(); i--; ) - ret[i] = toupper(ret[i]); - return ret; -} - -// Replace character -std::string replace(const std::string &str, const char from, const char to) -{ - std::string ret = str; - for (auto i = ret.size(); i--; ) - if (ret[i] == from) - ret[i] = to; - return ret; -} - -// Stringify JSON -// See: https://github.com/nlohmann/json/issues/642 -std::string stringify(const nlohmann::json &j) -{ - const auto tmp = j.dump(); - return j.type() == nlohmann::json::value_t::string - ? tmp.substr(1, tmp.size()-2) - : tmp; -} - -// Does this JSON key look like a C++ style comment? -bool isComment(const std::string &key) -{ - return strncmp(key.data(), "//", 2) == 0; -} - -// Does this JSON key/value pair appear to describe a class? -bool isClass(const KeyValue &keyval) -{ - const auto &key = keyval.key(); - const auto &val = keyval.value(); - - // a comment? - if (isComment(key)) - return false; - - // not a class? - if (key == "__namespace__" || key == "namespace" || key == "Specifications") - return false; - - // not a node class? - if ((val.contains("__class__") && val["__class__"] != "nodes.Node") || - (val.contains( "class" ) && val[ "class" ] != "nodes.Node")) - return false; - - return true; -} - - - -// ----------------------------------------------------------------------------- -// name* functions -// ----------------------------------------------------------------------------- - -// nameGNDS -// Name in GNDS (e.g., name of an XML element) -std::string nameGNDS(const KeyValue &keyval) -{ - // As-is, directly as stipulated in a key in the JSON spec, except - // that we allow a "name" entry to override the key. - return keyval.value().contains("name") - ? std::string(keyval.value()["name"]) - : keyval.key(); -} - -// nameField -// Name of a field (metadatum or child node) in an autogenerated class -std::string nameField(const KeyValue &keyval, const InfoSpecs &specs) -{ - // Like nameGNDS, except that we apply any name-modification map that - // may have been provided. That can fix, for example, the name "double", - // which appears in GNDS v1.9 but is unsuitable for a name in C++. - const std::string name = nameGNDS(keyval); - const auto it = specs.mapName.find(name); - return it == specs.mapName.end() ? name : it->second; -} - -// nameClass -// Name of an autogenerated class -std::string nameClass(const KeyValue &keyval, const InfoSpecs &specs) -{ - // Like nameField, but capitalized (per our class naming convention). - return capital(nameField(keyval,specs)); -} - -// namePython -// Name for Python -std::string namePython(const std::string &name) -{ - if (name.size() == 0) - return name; - std::string python; - python += std::tolower(name[0]); - for (auto it = name.begin()+1; it != name.end(); ++it) { - if (std::isupper(*it) && std::islower(*(it-1))) - python += '_'; - python += std::tolower(*it); - } - return python; -} - - - -// ----------------------------------------------------------------------------- -// Functions for getting certain information from JSON input -// ----------------------------------------------------------------------------- - -// Get the JSON's "namespace" -std::string getFileNamespace(const nlohmann::json &j) -{ - return j.contains("__namespace__") - ? j["__namespace__"] - : j[ "namespace" ]; -} - -// Get the JSON's "type", with any relevant specs.mapMetaType entry applied -std::string getMetadatumType(const nlohmann::json &j, const InfoSpecs &specs) -{ - const std::string type = j["type"]; - const auto it = specs.mapMetaType.find(type); - return it == specs.mapMetaType.end() ? type : it->second; -} - -// Determine to what namespace childClass belongs. Context: we're (1) in a JSON -// spec with namespace parent.nsname, (2) in a parent node named parent.clname, -// and (3) wish to determine the proper namespace for the parent's child node -// named "child". Parameter j is the JSON value ({...}) for this child node. -std::string getChildNamespace( - const nlohmann::json &j, const InfoSpecs &specs, - const PerClass &per, const std::string &childClass -) { - // childClass' namespace... - - // ...is explicitly given by "__namespace__"or "namespace" - if (j.contains("__namespace__")) return j["__namespace__"]; - if (j.contains( "namespace" )) return j[ "namespace" ]; - - // ...isn't given, and this child isn't in any of the JSONs :-( - if (specs.class2nspace.count(childClass) == 0) { - log::warning( - "{}::{} has child of unknown class {}", - per.nsname, per.clname, childClass - ); - return "unknownNamespace"; - } - - // ...isn't given, but we've seen the child in exactly *one* namespace - if (specs.class2nspace.count(childClass) == 1) - return specs.class2nspace.find(childClass)->second; - - // ...isn't given, and we've seen the child in *multiple* namespaces, - // ...one of which is the parent's, which we'll assume is intended - const auto range = specs.class2nspace.equal_range(childClass); - for (auto it = range.first; it != range.second; ++it) - if (it->second == per.nsname) { - // fixme: a *warning* might be in order, re: our assumption - return per.nsname; - } - - // ...isn't given, and we've seen the child in *multiple* namespaces, - // ...none of which is the parent's; this is an ambiguous situation :-( - std::stringstream warn; - int count = 0; - for (auto it = range.first; it != range.second; ++it) - warn << (count++ == 0 ? "" : ", ") << it->second; - log::warning( - "{}::{} has child of ambiguous class {}.\n" - "Child class {} appears in all of the following namespaces:\n{}", - per.nsname, per.clname, childClass, childClass, warn.str() - ); - - return "ambiguousNamespace"; -} - - - -// ----------------------------------------------------------------------------- -// getClass* functions re: metadata, children, variant children -// ----------------------------------------------------------------------------- - -// getClassMetadata -void getClassMetadata( - const nlohmann::json &j, const InfoSpecs &specs, PerClass &per -) { - for (const auto &field : j.items()) { - const auto &metaRHS = field.value(); - - // Name - InfoMetadata m; - m.name = nameField(field,specs); - - // Type - m.type = getMetadatumType(metaRHS,specs); - - // Has default? - m.defaultValue = ""; - if (metaRHS.contains("default") && !metaRHS["default"].is_null()) { - m.defaultValue = stringify(metaRHS["default"]); - const auto it = specs.mapMetaDefault.find(m.defaultValue); - if (it != specs.mapMetaDefault.end()) - m.defaultValue = it->second; - }; - if (m.defaultValue != "") { - // If it has a default, then presumably it isn't required... - assert(!metaRHS["required"]); - } - - // Optional? (not required, and has no default) - m.isOptional = !metaRHS["required"] && m.defaultValue == ""; - const std::string optPrefix = m.isOptional ? "std::optional<" : ""; - const std::string optSuffix = m.isOptional ? ">" : ""; - - // Defaulted? (not required, but does have a default) - m.isDefaulted = !metaRHS["required"] && m.defaultValue != ""; - const std::string defPrefix = m.isDefaulted ? "Defaulted<" : ""; - const std::string defSuffix = m.isDefaulted ? ">" : ""; - - // Full type, including any optional or defaulted - m.typeFull = - optPrefix + defPrefix + - m.type + - defSuffix + optSuffix; - - // Add to per.metadata - per.metadata.push_back(m); - } -} // getClassMetadata - - -// getClassChildren -void getClassChildren( - const nlohmann::json &j, const InfoSpecs &specs, - PerClass &per, Class2Dependencies &dep -) { - for (const auto &field : j.items()) { - const auto &elemRHS = field.value(); - - // Choice children are handled elsewhere - const std::string occ = elemRHS["occurrence"]; - if (occ == "choice" || occ == "choice+" || occ == "choice2+") - continue; - - // Name - InfoChildren c; - c.name = nameField(field,specs); - - // Type, including namespace - c.type = nameClass(field,specs); - const std::string ns = getChildNamespace(elemRHS, specs, per, c.type); - c.type = ns + "::" + c.type; - - // Optional? - c.isOptional = !elemRHS["required"]; - const std::string optPrefix = c.isOptional ? "std::optional<" : ""; - const std::string optSuffix = c.isOptional ? ">" : ""; - - // Vector? - c.isVector = occ == "0+" || occ == "1+" || occ == "2+"; - const std::string vecPrefix = c.isVector ? "std::vector<" : ""; - const std::string vecSuffix = c.isVector ? ">" : ""; - - // Full type, including any optional or vector - // If both, use optional; the reverse makes less sense - c.typeFull = - optPrefix + vecPrefix + - c.type + - vecSuffix + optSuffix; - - // Partial type, not including any vector. This is used in the context - // of this child node's entry in the multi-query key, where vector will - // be implicit if it's a "many" (not a "one") child. - c.typeHalf = - optPrefix + - c.type + - optSuffix; - - // Save as a dependency (if it's not its own dependency) - if (c.type != per.name()) - dep.dependencies.push_back( - NamespaceAndClass(ns,nameClass(field,specs))); - - // Add to per.children - per.children.push_back(c); - } -} // getClassChildren - - -// getClassVariants -void getClassVariants( - const nlohmann::json &j, const InfoSpecs &specs, - PerClass &per, Class2Dependencies &dep -) { - // Initialize per.variants, a vector that has the "choice" - // children from the current class. Computing a map, - // first, turns out to be convenient, given the manner in which the choice - // children appear in the JSON specifications: listed in a "flat" manner - // as child nodes, rather than grouped one level deeper inside of, say, - // a "choice" JSON key. Remark: this code supports the option of having - // multiple sets of choices under the current parent; for example, the - // parent can have {X or Y}, and (independently) have {A or B or C}. Our - // JSON "variant" key facilitates this: give the same value for X and Y, - // and the same value for A, B, and C. The GNDS v1.9 specifications only - // appear to allow for one choice-between-things (just X,Y or just A,B,C) - // in a given parent, but we believe our extension will prove to be useful. - - std::map map; - - // Pass 1 - // Collect "variant" names, and if ever it's absent, a to-be-determined - // name for all choice children for which it's absent - for (const auto &field : j.items()) { - // Is it a choice child? - const auto &elemRHS = field.value(); - const std::string occ = elemRHS["occurrence"]; - if (occ != "choice" && occ != "choice+" && occ != "choice2+") - continue; - - // Variant name - const std::string variantName = elemRHS.contains("variant") - ? elemRHS["variant"] - : ""; // to be determined - map.insert(std::make_pair(variantName,InfoVariants{})); - } - - // Pass 2 - for (const auto &field : j.items()) { - // Is it a choice child? - const auto &elemRHS = field.value(); - const std::string occ = elemRHS["occurrence"]; - if (occ != "choice" && occ != "choice+" && occ != "choice2+") - continue; - - // Variant name - const std::string variant = elemRHS.contains("variant") - ? elemRHS["variant"] - : ""; - auto it = map.find(variant); - assert(it != map.end()); // should be there from the earlier loop - - // For the individual child that's part of a choice... - InfoVariantsChildren c; - // ...its name - c.name = nameField(field,specs); - // ...its type, including namespace - c.type = nameClass(field,specs); - const std::string ns = getChildNamespace(elemRHS, specs, per, c.type); - c.type = ns + "::" + c.type; - // ...its vector-ness - c.isVector = occ == "choice+" || occ == "choice2+"; - - // The GNDS JSON specifications all have "required":false for individual - // choices in a set of choices; the concept of "the entire choice can be - // either required or optional" doesn't seem to exist. We could support - // it, but for now, we'll just ensure that "required":false is followed. - assert(!elemRHS["required"]); - - InfoVariants &v = it->second; - v.isVector = c.isVector; - v.children.push_back(c); - - // Save as a dependency (if it's not its own dependency) - if (c.type != per.name()) - dep.dependencies.push_back( - NamespaceAndClass(ns,nameClass(field,specs))); - } - - // Pass 3 - for (auto &pair : map) { - InfoVariants &v = pair.second; - assert(v.children.size() > 0); - - const std::string vecPrefix = v.isVector ? "std::vector<" : ""; - const std::string vecSuffix = v.isVector ? ">" : ""; - - v.name = pair.first; - v.type = pair.first + "_t"; - - for (const auto &c : v.children) { - assert(c.isVector == v.isVector); - if (pair.first == "") - v.name += (v.name == "" ? "_" : "") + c.name; - } - v.typeHalf = v.type; - v.typeFull = vecPrefix + v.type + vecSuffix; - - per.variants.push_back(v); - } -} // getClassVariants - - - -// ----------------------------------------------------------------------------- -// writer -// ----------------------------------------------------------------------------- - -// Comment-related markup -const auto largeComment = "// " + std::string(77,'-'); -const auto smallComment = "// " + std::string(24,'-'); - -class writer { - std::ostream &s; - std::ofstream fstream; - std::ostringstream sstream; - - static inline const char substitute = '@'; - static inline const int indent = 3; - static inline const std::string message = - "\n" - "// THIS FILE WAS AUTOGENERATED!\n" - "// DO NOT MODIFY!\n"; - - // recurse is used to prevent multiple reports of equivalent errors - // as we step through the format string and arguments while printing. - static int recurse; - - template - void checkArgs(const std::string &str, const T &value, Ts &&...args) - { - if (recurse == 0) { - using last = decltype( - std::get(std::make_tuple(value,args...))); - const size_t nsub = std::count(str.begin(), str.end(), substitute); - // a bool last argument is not interpreted as an argument to print... - const size_t narg = - 1 + sizeof...(args) - std::is_same_v,bool>; - if (narg != nsub) { - log::error( - "Number of '{}' substitution characters and arguments " - "don't match:\n" - "writer(\"{}\", ...)", substitute, str); - throw std::exception{}; - } - } - } - -public: - - // writer() - // Use a string stream - explicit writer(const bool autogen = true) : - s(sstream) - { - if (autogen) s << message; - } - - // writer(file) - // Use a file stream - explicit writer(const std::string &file, const bool autogen = true) : - s(fstream), fstream(file) - { - if (autogen) s << message; - } - - // str() - std::string str() const - { - if (&s != &sstream) { - log::error( - "writer.str() is available only for a writer " - "that was default constructed" - ); - throw std::exception{}; - } - return sstream.str(); - } - - // ------------------------ - // operator() - // ------------------------ - - // char* cases are needed in addition to std::string, for disambiguation. - // level is the indentation level. - - // operator()(string, newline) - template>> - void operator()(const std::string &str = "", const T newline = true) - { - s << str; - if (newline) - s << std::endl; - } - - template>> - void operator()( - const char *const str, const T newline = true - ) { - operator()(std::string(str), newline); - } - - // operator()(level, string, newline) - void operator()( - const int level, const std::string &str = "", const bool newline = true - ) { - operator()(std::string(level*indent,' ') + str, newline); - } - - void operator()( - const int level, const char *const str, const bool newline = true - ) { - operator()(level, std::string(str), newline); - } - - // operator()(string, value, args) - template< - class T, class... Ts, - class = std::enable_if_t> - > - void operator()(const std::string &str, const T &value, Ts &&...args) - { - checkArgs(str, value, std::forward(args)...); - recurse++; - for (const auto &ch : str) - if (ch != substitute) - s << ch; - else { - s << value; - operator()(std::string(&ch+1), std::forward(args)...); - break; - } - recurse--; - } - - // operator()(level, string, value, args) - template< - class T, class... Ts, - class = std::enable_if_t> - > - void operator()( - const int level, const std::string &str, const T &value, Ts &&...args - ) { - checkArgs(str, value, std::forward(args)...); - recurse++; - operator()( - std::string(level*indent,' ') + str, - value, - std::forward(args)... - ); - recurse--; - } -}; - -int writer::recurse = 0; - - - -// ----------------------------------------------------------------------------- -// write* -// Autogenerated admonishment, and class prefix/suffix -// ----------------------------------------------------------------------------- - -// Class prefix -void writeClassPrefix(writer &out, const PerClass &per) -{ - // comment introducing class - out(); - out(); - out(); - out(largeComment); - out("// @::", per.nsname); - out("// class @", per.clname); - out(largeComment); - - // namespace+class begin - out(); - out("namespace @ {", per.nsname); - out(); - out("class @ : public Component<@@> {", - per.clname, per.clname, - per.isData - ? (",true" + (per.dataType == "" ? "" : "," + per.dataType)) - : "" - ); -} // writeClassPrefix - - -// writeClassForComponent -void writeClassForComponent(writer &out, const PerClass &per) -{ - // using [name for variant] = ... - out(); - for (const auto &v : per.variants) { - out(1,"using @ = std::variant<", v.type); - int count = 0, total = v.children.size(); - for (const auto &c : v.children) - out(2,"@@", c.type, ++count == total ? "" : ","); - out(1,">;"); - } - - out(); - out(1,smallComment); - out(1,"// For Component"); - out(1,smallComment); - out(); - out(1,"friend class Component;"); - out(); - out(1,"// Current namespace, current class, and GNDS node name"); - out(1,"static auto namespaceName() { return \"@\"; }", per.nsname); - out(1,"static auto className() { return \"@\"; }", per.clname); - out(1,"static auto GNDSName() { return \"@\"; }", per.nameGNDS); - - // keys() begin - out(); - out(1,"// Core Interface multi-query to extract metadata and child nodes"); - out(1,"static auto keys()"); - out(1,"{"); - - // keys() contents - int count = 0, total = per.nfields(); - if (total == 0) - out(2,"return std::tuple<>{};"); - else { - out(2,"return"); - - // metadata - if (per.metadata.size()) - out(3,"// metadata"); - for (const auto &m : per.metadata) { - out(3,"@{@}", m.typeFull, initializer(m)); - out(4,"/ Meta<>(\"@\")@", m.name, ++count < total ? " |" : ""); - } - - // children - if (per.children.size() || per.variants.size()) - out(3,"// children"); - for (const auto &c : per.children) { - out(3,"@{}", c.typeHalf); // w/o any std::vector - out(4,"/ @Child<>(\"@\")@", - c.isVector ? "++" : "--", c.name, ++count < total ? " |" : ""); - } - - // variants - for (const auto &v : per.variants) { - out(3,"@{}", v.typeHalf); // w/o any std::vector - out(4,"/ @(", v.isVector ? "++" : "--", false); - int n = 0; // for alternatives; not to be confused w/count - for (const auto &c : v.children) - out("@Child<>(\"@\")", n++ == 0 ? "" : " || ", c.name, false); - out(")@", ++count < total ? " |" : ""); - } - - out(2,";"); - } - - // keys() end - out(1,"}"); - out(); - out("public:"); -} // writeClassForComponent - - -// Class suffix -void writeClassSuffix( - writer &out, const PerClass &per, const std::string &version -) { - // assignment - out(); - out(1,smallComment); - out(1,"// Assignment"); - out(1,smallComment); - out(); - out(1,"// copy"); - out(1,"@ &operator=(const @ &) = default;", per.clname, per.clname); - out(); - out(1,"// move"); - out(1,"@ &operator=(@ &&) = default;", per.clname, per.clname); - - // customization #include - out(); - out(1,smallComment); - out(1,"// Custom functionality"); - out(1,smallComment); - out(); - out(1,"#include \"GNDStk/@/@/@/src/custom.hpp\"", - version, per.nsname, per.clname); - - // class+namespace end - out(); - out("}; // class @", per.clname); - out(); - out("} // namespace @", per.nsname); -} // writeClassSuffix - - - - -// ----------------------------------------------------------------------------- -// writeClass* -// For metadata, children, and variant children -// ----------------------------------------------------------------------------- - -// writeClassContentMetadata -void writeClassContentMetadata(writer &out, const PerClass &per) -{ - if (per.metadata.size()) - out(2,"// metadata"); - for (const auto &m : per.metadata) { - per.isData && ( - m.name == "length" || m.name == "start" || m.name == "valueType") - ? out(2,"mutable @ @", m.typeFull, m.name, false) - : out(2, "@ @", m.typeFull, m.name, false); - if (m.defaultValue != "") - out("{@}", initializer(m), false); - out(";"); - } -} - -// writeClassContentChildren -void writeClassContentChildren(writer &out, const PerClass &per) -{ - if (per.children.size()) - out(2,"// children"); - for (const auto &c : per.children) - out(2,"@ @;", c.typeFull, c.name); -} - -// writeClassContentVariants -void writeClassContentVariants(writer &out, const PerClass &per) -{ - if (per.variants.size()) - out(2,"// children - variant"); - for (const auto &v : per.variants) - out(2,"@ @;", v.typeFull, v.name); -} - - - -// ----------------------------------------------------------------------------- -// writeClassGetters -// ----------------------------------------------------------------------------- - -void writeClassGetters(writer &out, const PerClass &per) -{ - out(); - out(1,smallComment); - out(1,"// Getters"); - out(1,"// const and non-const"); - out(1,smallComment); - - const auto write = - [&out](auto &&i, const bool isVector) - { - // i: info for metadatum, child, or variant - out(); - out(1,"// @", i.name); - out(1,"const @ &@() const", i.typeFull, i.name); - out(2,"{ return content.@; }", i.name); - out(1, "@ &@()", i.typeFull, i.name); - out(2,"{ return content.@; }", i.name); - - const auto indlab = - [&out,&i](const auto &T, const auto &par) - { - // T par: index or label parameter - out(); - out(1,"// @(@)", i.name, par); - out(1,"const @ &@(const @@) const", i.type, i.name, T, par); - out(2,"{ return getter(@(), @, \"@\"); }", i.name, par, i.name); - out(1, "@ &@(const @@)", i.type, i.name, T, par); - out(2,"{ return getter(@(), @, \"@\"); }", i.name, par, i.name); - }; - - if (isVector) { - // with index or label - indlab("std::size_t ", "index"); - indlab("std::string &", "label"); - } - }; - - // metadata, children, variants - for (const auto &m : per.metadata) write(m, false); - for (const auto &c : per.children) write(c, c.isVector); - for (const auto &v : per.variants) write(v, v.isVector); - - // variant alternatives - for (const auto &v : per.variants) { - for (const auto &c : v.children) { - const auto indlab = - [&out,&v,&c](const auto &T, const auto &par) - { - // T par: index or label parameter - out(); - out(1,"// @(@)", c.name, par); - out(1,"const @ *@(const @@) const", c.type, c.name, T, par); - out(2,"{ return getter<@>(@(), @, \"@\"); }", - c.type, v.name, par, c.name); - out(1, "@ *@(const @@)", c.type, c.name, T, par); - out(2,"{ return getter<@>(@(), @, \"@\"); }", - c.type, v.name, par, c.name); - }; - - if (v.isVector) { - // with index or label - indlab("std::size_t ", "index"); - indlab("std::string &", "label"); - } else { - out(); - out(1,"// @", c.name); - out(1,"const @ *@() const", c.type, c.name); - out(2,"{ return getter<@>(@(), \"@\"); }", c.type, v.name, c.name); - out(1, "@ *@()", c.type, c.name); - out(2,"{ return getter<@>(@(), \"@\"); }", c.type, v.name, c.name); - } - } - } -} // writeClassGetters - - - -// ----------------------------------------------------------------------------- -// writeClassSetter* -// ----------------------------------------------------------------------------- - -// writeClassSetterChild -template // InfoChildren or InfoVariants -void writeClassSetterChild( - writer &out, const PerClass &parent, const INFO &child -) { - // setter - // note that if type is optional, a T can still be sent - out(); - out(1,"// @(value)", child.name); - out(1,"@ &@(const @ &obj)", parent.clname, child.name, child.typeFull); - out(2,"{ @() = obj; return *this; }", child.name); - - const auto indlab = - [&out,&parent,&child](const auto &T, const auto &par) - { - // T par: index or label parameter - out(); - out(1,"// @(@,value)", child.name, par); - out(1,"@ &@(", parent.clname, child.name); - out(2,"const @@,", T, par); - out(2,"const @ &obj", child.type); - out(1,") {"); - out(2,"@(@) = obj; return *this;", child.name, par); - out(1,"}"); - }; - - // with index or label - if (child.isVector) { - indlab("std::size_t ", "index"); - indlab("std::string &", "label"); - } -} // writeClassSetterChild - - -// writeClassSetters -void writeClassSetters(writer &out, const PerClass &per) -{ - out(); - out(1,smallComment); - out(1,"// Setters"); - out(1,"// non-const"); - out(1,"// All return *this"); - out(1,smallComment); - - // Reminder: - // metadata can have: optional, defaulted (but not vector) - // children can have: optional, vector (but not defaulted) - - // metadata - for (const auto &m : per.metadata) { - out(); - out(1,"// @(value)", m.name); - - // special cases: we want to send length, start, and valueType - // to the BodyText base as well - const bool special = - per.isData && - (m.name == "length" || m.name == "start" || m.name == "valueType"); - - // setter - // note that if type is optional, a T can still be sent - out(1,"@ &@(const @ &obj)", per.clname, m.name, m.typeFull); - if (special && m.isDefaulted) - out(2,"{ BodyText::@(content.@ = obj); return *this; }", - m.name, m.name); - if (special && !m.isDefaulted) - out(2,"{ BodyText::@(@() = obj); return *this; }", - m.name, m.name); - if (!special && m.isDefaulted) - out(2,"{ content.@ = obj; return *this; }", - m.name); - if (!special && !m.isDefaulted) - out(2,"{ @() = obj; return *this; }", - m.name); - - // setter, if type is Defaulted - if (m.isDefaulted) { - out(1,"@ &@(const std::optional<@> &obj)", per.clname, m.name, m.type); - special - ? out(2,"{ BodyText::@(content.@ = obj); return *this; }", - m.name, m.name) - : out(2,"{ content.@ = obj; return *this; }", m.name); - } - } - - // children, variants - for (const auto &c : per.children) writeClassSetterChild(out, per, c); - for (const auto &v : per.variants) writeClassSetterChild(out, per, v); - - // variant alternatives - for (const auto &v : per.variants) { - if (v.isVector) { - // choice is a vector - for (const auto &c : v.children) { - const auto indlab = - [&out,&per,&v,&c](const auto &T, const auto &par) - { - // T par: index or label parameter - out(); - out(1,"// @(@,value)", c.name, par); - out(1,"@ &@(", per.clname, c.name); - out(2,"const @@,", T, par); - out(2,"const std::optional<@> &obj", c.type); - out(1,") {"); - out(2,"if (obj) @(@,obj.value());", v.name, par); - out(2,"return *this;"); - out(1,"}"); - }; - - // with index or label - indlab("std::size_t ", "index"); - indlab("std::string &", "label"); - } - } else { - // choice is a variant - for (const auto &c : v.children) { - out(); - out(1,"// @(value)", c.name); - out(1,"@ &@(const std::optional<@> &obj)", - per.clname, c.name, c.type); - out(2,"{ if (obj) @(obj.value()); return *this; }", v.name); - } - } - } -} // writeClassSetters - - - -// ----------------------------------------------------------------------------- -// writeClassCtor* -// ----------------------------------------------------------------------------- - -// writeClassCtorComponent -void writeClassCtorComponent( - writer &out, const PerClass &per, const bool hasOther -) { - out(2,"Component{"); - out(3, hasOther ? "other" : "BodyText{}", false); - - for (const auto &m : per.metadata) { // metadata - out(","); - out(3,"content.@", m.name, false); - } - for (const auto &c : per.children) { // children - out(","); - out(3,"content.@", c.name, false); - } - for (const auto &v : per.variants) { // variants - out(","); - out(3,"content.@", v.name, false); - } - - out(); - out(2,"}",false); -} // writeClassCtorComponent - - -// writeClassCtorBody -void writeClassCtorBody(writer &out, const std::string &argName) -{ - out(1,"{"); - out(2,"Component::finish(@);", argName); - out(1,"}"); -} // writeClassCtorBody - - -// writeClassCtors -void writeClassCtors(writer &out, const PerClass &per) -{ - // ctor: default - out(); - out(1,"// default"); - out(1,"@() :", per.clname); - writeClassCtorComponent(out, per, false); - out(); - writeClassCtorBody(out, ""); - - // ctor: copy - out(); - out(1,"// copy"); - out(1,"@(const @ &other) :", per.clname, per.clname); - writeClassCtorComponent(out, per, true); - out(","); - out(2,"content{other.content}"); - writeClassCtorBody(out, "other"); - - // ctor: move - out(); - out(1,"// move"); - out(1,"@(@ &&other) :", per.clname, per.clname); - writeClassCtorComponent(out, per, true); - out(","); - out(2,"content{std::move(other.content)}"); - writeClassCtorBody(out, "other"); - - // ctor: node - out(); - out(1,"// from node"); - out(1,"@(const Node &node) :", per.clname); - writeClassCtorComponent(out, per, false); - out(); - writeClassCtorBody(out, "node"); - - // ------------------------ - // ctor: fields - // ------------------------ - - const auto total = per.nfields(); - if (total != 0) { - out(); - out(1,"// from fields"); - for (const auto &m : per.metadata) - if (m.isDefaulted) { - out(1,"// std::optional replaces Defaulted; " - "this class knows the default(s)"); - break; - } - - // signature, and base constructor call - // Note: we don't need "explicit" unless this constructor can be called - // with one argument. We'll always write it, however, in case someone - // modifies the auto-generated constructor (say, giving its arguments - // defaults) in such a way that is *can* be called with one argument. - // But we'd rather nobody modify the auto-generated classes. - int count = 0; - out(1,"explicit @(", per.clname); - for (const auto &m : per.metadata) - out(2,"const @ &@@", - m.isDefaulted ? "std::optional<" + m.type + ">" : m.typeFull, - m.name, ++count < total ? "," : ""); - for (const auto &c : per.children) - out(2,"const @ &@@", c.typeFull, c.name, ++count < total ? "," : ""); - for (const auto &v : per.variants) - out(2,"const @ &@@", v.typeFull, v.name, ++count < total ? "," : ""); - - out(1,") :"); - writeClassCtorComponent(out, per, false); - - // initialize fields - out(","); - out(2,"content{"); - count = 0; - for (const auto &m : per.metadata) - out(3,"@@", - m.isDefaulted - ? "Defaulted<"+m.type+">(defaults."+m.name+","+m.name+")" - : m.name, - ++count < total ? "," : ""); - for (const auto &c : per.children) - out(3,"@@", c.name, ++count < total ? "," : ""); - for (const auto &v : per.variants) - out(3,"@@", v.name, ++count < total ? "," : ""); - out(2,"}"); - - // body - writeClassCtorBody(out, ""); - } - - // ------------------------ - // ctor: vector - // ------------------------ - - if (per.isData) { - out(); - out(1,"// from vector"); - out(1,"template>>"); - out(1,"@(const std::vector &vector) :", per.clname); - writeClassCtorComponent(out, per, false); - out(); - writeClassCtorBody(out, "vector"); - } -} // writeClassCtors - - - -// ----------------------------------------------------------------------------- -// writeClass -// ----------------------------------------------------------------------------- - -void writeClass(PerClass &per, const InfoSpecs &specs) -{ - // false: no "file was autogenerated" message, because in writeClass we're - // writing certain class contents to a string, not writing an entire file. - writer out(false); - - // output: class begin - writeClassPrefix(out,per); - - // output: for the Component base - writeClassForComponent(out,per); - - // output: using directives - out(); - out(1,"using Component::construct;"); - if (per.isData) - out(1,"using BodyText::operator=;"); - - // output: defaults (applicable only to metadata) - out(); - out(1,smallComment); - out(1,"// Relevant defaults"); - out(1,"// FYI for users"); - out(1,smallComment); - out(); - out(1,"static inline const struct Defaults {"); - for (auto &m : per.metadata) - if (m.isDefaulted) - out(2,"static inline const @ @ = @;", m.type, m.name, initializer(m)); - out(1,"} defaults;"); - - // output: content (the metadata/children computed earlier) - out(); - out(1,smallComment); - out(1,"// Raw GNDS content"); - out(1,smallComment); - out(); - out(1,"struct {"); - writeClassContentMetadata(out, per); - writeClassContentChildren(out, per); - writeClassContentVariants(out, per); - out(1,"} content;"); - - // output: getters, setters - if (per.metadata.size() || per.children.size() || per.variants.size()) { - writeClassGetters(out, per); - writeClassSetters(out, per); - } +using namespace njoy::GNDStk; - // output: constructors - out(); - out(1,smallComment); - out(1,"// Construction"); - out(1,smallComment); - writeClassCtors(out, per); +// Report cases of nodes that have no metadata, and zero or one child node(s). +// Where these exist, a simplification of the spec may be worth considering. +const bool singletons = true; - // output: class end - writeClassSuffix(out, per, specs.Version); +// Extra debug/informational printing? +const bool debugging = false; - // done - per.code = out.str(); -} // writeClass +// Put print statements in constructor and assignment calls. For debugging. +const bool printCtorCalls = false; +// Shortcut levels to utilize +// 0 = all +// 1 = none (child nodes are already there, by definition) +// 2 = to grandchildren +// 3 = to great-grandchildren +// ... +const int ShortcutLevels = 3; // ----------------------------------------------------------------------------- -// Miscellaneous functions for getting JSON content +// Local #includes // ----------------------------------------------------------------------------- -// readJSONFile -nlohmann::json readJSONFile(const std::string &file, const bool print = false) -{ - static const std::string underlineON = "\033[4m"; - static const std::string underlineOFF = "\033[24m"; - - // Depending on call context, we might want to print the file name - if (print) { - std::cout << " "; - std::cout << underlineON << "File:" << underlineOFF << " "; - std::cout << '"' << colors::vivid::green << file << colors::reset << '"'; - std::cout << std::endl; - } - - std::ifstream ifs(file); - if (!ifs) { - log::error("Could not open file \"{}\"", file); - throw std::exception{}; - } - - nlohmann::json j; - ifs >> j; - return j; -} // readJSONFile - - -// getMetadataJSON -template -auto getMetadataJSON(const nlohmann::json &j) -{ - static const std::string metastr = "metadata"; - static const std::string attrstr = "attributes"; - - const bool meta = j.contains(metastr); - const bool attr = j.contains(attrstr); - - if constexpr (required) { - assert(meta != attr); // exactly one - return meta ? j[metastr] : j[attrstr]; - } else { - assert(!(meta && attr)); // not both - return std::optional( - meta ? j[metastr] : attr ? j[attrstr] : nlohmann::json{}); - } -} // getMetadataJSON - +// nameMap +// A map> for certain name-change purposes +#include "json2class-map.cpp" -// getChildrenJSON -template -auto getChildrenJSON(const nlohmann::json &j) -{ - static const std::string chldstr = "children"; - static const std::string nodestr = "childNodes"; +// Data structures +#include "json2class-struct.cpp" - const bool chld = j.contains(chldstr); - const bool node = j.contains(nodestr); +// writer class +#include "json2class-writer.cpp" - if constexpr (required) { - assert(chld != node); // exactly one - return chld ? j[chldstr] : j[nodestr]; - } else { - assert(!(chld && node)); // not both - return std::optional( - chld ? j[chldstr] : node ? j[nodestr] : nlohmann::json{}); - } -} // getChildrenJSON +// Miscellaneous functions +#include "json2class-fun.cpp" +// Interfaces +#include "json2class-cpp.cpp" +#include "json2class-c.cpp" +#include "json2class-f03.cpp" +#include "json2class-python.cpp" // ----------------------------------------------------------------------------- -// commandLine and its helper functions +// main // ----------------------------------------------------------------------------- -// readChangesFile -void readChangesFile(const std::string &file, InfoSpecs &specs) -{ - const nlohmann::json jchanges = readJSONFile(file); - using pair = std::pair; - - // Changes to name? - if (jchanges.contains("name")) - for (const auto &item : jchanges["name"].items()) - if (!isComment(item.key())) - specs.mapName.insert(pair(item.key(),item.value())); - - // Changes to metadata/attributes? - const auto metadata = getMetadataJSON(jchanges); - if (metadata.has_value()) { - // from/to pairs for "type" - if (metadata->contains("type")) - for (const auto &item : (*metadata)["type"].items()) - if (!isComment(item.key())) - specs.mapMetaType.insert(pair(item.key(),item.value())); - // from/to pairs for "default" - if (metadata->contains("default")) - for (const auto &item : (*metadata)["default"].items()) - if (!isComment(item.key())) - specs.mapMetaDefault.insert(pair(item.key(),item.value())); - } -} // readChangesFile - - -// printSingletons -void printSingletons(const std::string &file) +int main(const int argc, const char *const *const argv) { - const nlohmann::json &jfile = readJSONFile(file,true); - - for (const auto &item : jfile.items()) { - const std::string parent = item.key(); - const nlohmann::json rhs = item.value(); - if (!isClass(item)) - continue; - - const auto metadata = getMetadataJSON(rhs); - const auto children = getChildrenJSON(rhs); - - if (metadata.size() == 0 && children.size() == 0) - log::info("Class \"{}\" has no metadata and no children", parent); - if (metadata.size() == 0 && children.size() == 1) - log::info("Class \"{}\" has no metadata and just one child", parent); - } -} // printSingletons - - -// commandLine -// Gather information from the .json file given on the command line -void commandLine( - const int argc, const char *const *const argv, - InfoSpecs &specs -) { - // Keys we'll look for - static const std::string input = "JSONDir"; - static const std::string files = "JSONFiles"; - static const std::string output = "GNDSDir"; - static const std::string version = "Version"; - static const std::string changes = "Changes"; - - // Usage - if (argc != 2) { - std::cout << "Usage: " << argv[0] << " file.json" << std::endl; - exit(EXIT_FAILURE); - } - - // Input file - const nlohmann::json jmain = readJSONFile(argv[1]); - - // Validate content - if (!(jmain.contains(input) && jmain.contains(output) && - jmain.contains(files) && jmain.contains(version))) { - log::error("The input json file needs {}, {}, {}, and {}", - input, files, output, version); - throw std::exception{}; - } + // For GNDStk's diagnostics + colors = true; - // Extract information from the command line .json - specs.JSONDir = jmain[input]; - specs.JSONFiles = std::vector(jmain[files]); - specs.GNDSDir = jmain[output]; - specs.Version = jmain[version]; - specs.VersionUnderscore = replace(specs.Version, '.', '_'); + // ------------------------ + // Read primary .json + // ------------------------ - // Prepend the JSON file names with their directory - for (std::string &file : specs.JSONFiles) - file = specs.JSONDir + '/' + file; + // READ INFORMATION from the JSON file on the command line + action( + "GNDStk Code Generator", + "Author: Martin Staley", + "Los Alamos National Laboratory" + ); + InfoSpecs specs; + commandLine(argc, argv, specs); - // File names - specs.hppVersion = specs.GNDSDir + "/src/GNDStk/" + specs.Version + ".hpp"; - specs.hppKey = specs.GNDSDir + "/src/GNDStk/" + specs.Version + "/key.hpp"; + // ------------------------ + // Simplifications? + // ------------------------ - // Report on "singletons" + // REPORT regarding potential simplifications if (singletons) { - action("Finding possible simplifications"); + action("Finding Potential Simplifications"); for (const std::string &file : specs.JSONFiles) printSingletons(file); } - // Changes? - if (jmain.contains(changes)) - readChangesFile(jmain[changes],specs); -} // commandLine - - - -// ----------------------------------------------------------------------------- -// preprocess* functions -// ----------------------------------------------------------------------------- - -// preprocessClass -void preprocessClass( - InfoSpecs &specs, const std::string &nsname, const KeyValue &keyval -) { - // Ensure that this JSON entry represents a class - as opposed - // to being, say, "namespace" or some other non-class entry. - if (!isClass(keyval)) - return; - - // Get the class name, then link this class with the current namespace. - // This information is used, later, for various purposes. - const std::string clname = nameClass(keyval,specs); - specs.class2nspace.insert(std::make_pair(clname,nsname)); - // ------------------------ - // Create directories and - // custom files as needed + // Preprocessing // ------------------------ - // Given the base GNDS directory and the GNDS version, as obtained earlier - // from the JSON input file to this tool, compute relevant directory names. - const std::string - // For the present namespace: C++ and Python directories. The present - // namespace probably contains multiple classes, so its directories - // may have been created already, but that's fine. - nsdir = specs.GNDSDir + "/src/GNDStk/" + specs.Version + "/" + nsname, - nsdirpy = specs.GNDSDir + "/python/src/" + specs.Version + "/" + nsname, - // For the present class: C++ source and test directories. - clsrc = nsdir + "/" + clname + "/src", - cltest = nsdir + "/" + clname + "/test"; - - // Create the above directories, if (and only if) they don't already exist. - system(("mkdir -p " + nsdir ).data()); - system(("mkdir -p " + nsdirpy).data()); - system(("mkdir -p " + clsrc ).data()); - system(("mkdir -p " + cltest ).data()); - - // To allow for customization of the present class in the present namespace, - // create a custom.hpp file in the C++ source directory for the class. But - // do so only if the customization file isn't already there, or else we might - // be trashing someone's customization! - const std::string custom = clsrc + "/custom.hpp"; - if (!std::ifstream(custom)) { - std::cout << " No customization file " << custom << "\n"; - std::cout << " ...so, creating a basic one" << std::endl; + // PREPROCESS, to get information needed upfront for detailed processing + action("Preprocessing"); + preprocessFiles(specs); + getFilesAndClasses(specs); - writer out(custom,false); // false: no "file was autogenerated" message - out(); - out(0,"private:"); - out(); - out(1,"static inline helpMap help = {};"); - } + // COMPUTE AN ORDERING that respects dependencies + sortDependencies(specs); // ------------------------ - // Create file-name maps + // Shortcuts // ------------------------ - // For this namespace: - // The cpp file for Python - auto ns = specs.namespace2data.insert(std::make_pair(nsname,PerNamespace{})); - ns.first->second.cppPython = nsdirpy + ".python.cpp"; - ns.first->second.nsname = nsname; - - // For this namespace::class: - // The cpp file for Python - // The hpp file for GNDStk - auto cl = specs.class2data.insert( - std::make_pair(NamespaceAndClass{nsname,clname}, PerClass{})); - assert(cl.second); // should have been inserted - not there already - cl.first->second.cppPython = nsdirpy + "/" + clname + ".python.cpp"; - cl.first->second.hppGNDStk = nsdir + "/" + clname + ".hpp"; -} // preprocessClass - - -// preprocessFiles -// This reads the JSON spec files and collects preliminary information that's -// used, later, when the spec files are processed in more detail. (Detailed -// processing requires knowledge obtained from this preliminary pass, which is -// why these things are done separately.) This preliminary processing includes -// creating a class-to-namespace map; creating directories into which output -// files will be placed; creating class-specific customization files when it's -// appropriate to do so; and creating maps from namespace to namespace-specific -// information, and from namespace::class to class-specific information. File -// names are computed as part of the "information" for the maps just mentioned. -void preprocessFiles(InfoSpecs &specs) -{ - action("Preprocessing input files"); - // files - for (const std::string &file : specs.JSONFiles) { - const nlohmann::json jmain = readJSONFile(file,true); - const std::string nsname = getFileNamespace(jmain); - // classes in the file - for (const auto &cl : jmain.items()) - preprocessClass(specs, nsname, cl); - } -} // preprocessFiles - - - -// ----------------------------------------------------------------------------- -// validate* -// getClass -// getFiles -// ----------------------------------------------------------------------------- - -// Helper: validateMetadata -void validateMetadata(const nlohmann::json &metadata) -{ - for (const auto &field : metadata.items()) { - assert(field.value().contains("type")); - assert(field.value().contains("required")); - } -} - - -// Helper: validateChildren -void validateChildren(const nlohmann::json &children) -{ - for (const auto &field : children.items()) { - assert(field.value().contains("occurrence")); - assert(field.value().contains("required")); - - // Consistency check: certain "occurrence" values imply *not* required. - // Remark: the GNDS manual speaks of "choice2" and "choice2+" options - // for occurrence. We're not sure if those will remain in future GNDS - // specifications, so we won't worry now about how they might fit in. - const std::string occ = field.value()["occurrence"]; - if (occ == "0+" || occ == "choice" || occ == "choice+") - assert(!field.value()["required"]); // not required - } -} - - -// getClass -void getClass( - InfoSpecs &specs, const std::string &nsname, const KeyValue &keyval -) { - const auto &classRHS = keyval.value(); - if (!isClass(keyval)) - return; - const std::string clname = nameClass(keyval,specs); - - // find in class map - const auto it = specs.class2data.find(NamespaceAndClass(nsname,clname)); - assert(it != specs.class2data.end()); - PerClass &per = it->second; - - // collect dependencies, for the present class, as this function proceeds - Class2Dependencies dep; - dep.theClass = NamespaceAndClass(nsname,clname); - - // names - per.nsname = nsname; - per.clname = clname; - per.nameGNDS = nameGNDS(keyval); - - // metadata/children information - const nlohmann::json attrs = getMetadataJSON(classRHS); - const nlohmann::json elems = getChildrenJSON(classRHS); - validateMetadata(attrs); - validateChildren(elems); - getClassMetadata(attrs, specs, per); - getClassChildren(elems, specs, per, dep); - getClassVariants(elems, specs, per, dep); + // COMPUTE SHORTCUTS + // The boolean tells us whether or not the code should print information + // about potential shortcuts that end up being unused for whatever reason. + // I suppose that this boolean should eventually be a command-line argument. + const int levelsDown = argc >= 3 ? atoi(argv[2]) : ShortcutLevels; + if (levelsDown != 1) + action("Computing Shortcuts"); + shortcuts(specs, levelsDown, false); - // data-node information - static const std::string datastr = "data"; - static const std::string bodystr = "bodyText"; - const bool data = classRHS.contains(datastr) && !classRHS[datastr].is_null(); - const bool body = classRHS.contains(bodystr) && !classRHS[bodystr].is_null(); - assert(!(data && body)); // not both - per.isData = data || body; - per.dataType = data ? classRHS[datastr] : ""; - - // per.code will contain printed C++ code for the class itself - writeClass(per,specs); - - // save dependencies - specs.ClassDependenciesRaw.push_back(dep); -} // getClass - - -// getFiles -void getFiles(InfoSpecs &specs) -{ - action("Creating classes"); - // files - for (const std::string &file : specs.JSONFiles) { - const nlohmann::json jmain = readJSONFile(file,true); - const std::string nsname = getFileNamespace(jmain); - // classes in the file - for (const auto &cl : jmain.items()) - getClass(specs, nsname, cl); - } -} // getFiles - - - -// ----------------------------------------------------------------------------- -// Functions relating to our topological sort -// Adapted from: http://coliru.stacked-crooked.com/a/7c0bf8d3443b804d -// ----------------------------------------------------------------------------- - -// insertDependency -void insertDependency( - const NamespaceAndClass &wanted, - std::vector &vecSource, - std::vector &vecTarget -) { - const auto iter = std::find_if( - vecSource.begin(), vecSource.end(), - [wanted](const Class2Dependencies &c2d) { return c2d.theClass == wanted; } - ); - - if (iter != vecSource.end()) { - const Class2Dependencies c2d = *iter; - vecSource.erase(iter); - for (const NamespaceAndClass &dep : c2d.dependencies) - insertDependency(dep, vecSource, vecTarget); - vecTarget.push_back(c2d); - } -} - -// sortDependencies -void sortDependencies(InfoSpecs &specs) -{ - while (specs.ClassDependenciesRaw.size() > 0) - insertDependency( - specs.ClassDependenciesRaw.begin()->theClass, - specs.ClassDependenciesRaw, - specs.ClassDependenciesSorted); -} - - - -// ----------------------------------------------------------------------------- -// Functions for creating output files -// ----------------------------------------------------------------------------- - -// fileGNDStkVersion -void fileGNDStkVersion(const InfoSpecs &specs) -{ - // Create an overarching file for this version - writer out(specs.hppVersion); - out(); - out("#ifndef NJOY_GNDSTK_@", allcaps(specs.VersionUnderscore)); - out("#define NJOY_GNDSTK_@", allcaps(specs.VersionUnderscore)); - - std::string nsname_last = ""; - for (auto &c : specs.class2data) { - const std::string nsname = c.first.nsname; - const std::string clname = c.first.clname; - if (nsname != nsname_last) - out(); - nsname_last = nsname; - out("#include \"GNDStk/@/@/@.hpp\"", specs.Version, nsname, clname); - } - - out(); - out("#include \"GNDStk/@/key.hpp\"", specs.Version); - out(); - out("#endif"); -} // fileGNDStkVersion - - -// fixme Reconsider the arrangement described here... -// fileGNDStkKey -const std::string file_key_comment = -R"***( -This file contains Meta and Child objects for metadata and child nodes in the -current GNDS version. These may prove to be useful if you wish to use the Core -Interface in conjunction with the autogenerated classes for this GNDS version. - -Within the outer njoy::GNDStk::version namespace below, the remaining namespace -arrangement was chosen to make the use of these objects smooth and logical. - -Meta and Child objects are collectively called "keys." Meta keys are placed -into key::meta. Child keys correspond to autogenerated classes, each of which -is already in some namespace; we thus use theNamespace::key::child::. That way, -an autogenerated class [ns::Foo] has [ns::key::foo] as its Child object, and -a "using namespace ns" allows the class and the Child object to be [Foo] and -[key::foo], respectively. (If we reordered ns:: and key::, that wouldn't work.) - -Within key::, we use meta:: and child:: around Meta and Child objects, just in -case there exist any identical GNDS metadata names and child-node names. (That -can, in fact, happen). The "using namespace meta" and "using namespace child" -directives then make the Meta<> and Child<> objects appear directly in key::, -so that "meta::" and "child::" are needed only to disambiguate identical names. -)***"; - -void fileGNDStkKey(const InfoSpecs &specs) -{ // ------------------------ - // Gather information + // C++ // ------------------------ - // pair: key name, GNDS name - using pair = std::pair; - - // For metadata, collect into one place - std::set metadata; - - // For children, process on a per-file basis; *multi*map is - // in case the same namespace appears in more than one file. - // The multimap contains: namespace name, set - std::multimap> namespace2children; - - for (const auto &file : specs.JSONFiles) { - const nlohmann::json jmain = readJSONFile(file); - auto it = namespace2children.insert( - std::make_pair(getFileNamespace(jmain),std::set{})); - - for (const auto &node : jmain.items()) { - if (isClass(node)) { - // nodes ==> children - it->second.insert(std::make_pair( - nameField(node,specs), - nameGNDS (node))); - - // attributes ==> metadata - const auto attrs = getMetadataJSON(node.value()); - for (const auto &attr : attrs.items()) - metadata.insert(std::make_pair( - nameField(attr,specs), - nameGNDS (attr))); - } - } - } + // PRINT CLASS CODE into temporary strings, which are written to the + // class-specific files later, after class dependencies are computed + action("Writing Code: C++"); + for (auto &c : specs.class2data) { + const std::string &nsname = c.first.nsname; + const std::string &clname = c.first.clname; + std::string title = + color::custom::faded::purple + nsname + "::" + + color::custom::purple + clname + color::reset + '\n'; + PerClass &per = c.second; + // after the following, per.code will contain printed + // C++ code for the class itself + writeClass(specs, title, per, per.code); + } + + // Create GNDStk hpp file for this GNDS version + fileGNDStkVersion(specs); - // ------------------------ - // comment, macro guard, - // outer namespaces - // ------------------------ + // Create GNDStk hpp file for Meta and Child keys + fileGNDStkKey(specs); - writer out(specs.hppKey); - out(); - out("/*",false); - out(file_key_comment,false); - out("*/"); - out(); - out("#ifndef NJOY_GNDSTK_@_KEY", allcaps(specs.VersionUnderscore)); - out("#define NJOY_GNDSTK_@_KEY", allcaps(specs.VersionUnderscore)); - out(); - out("namespace njoy {"); - out("namespace GNDStk {"); - out("namespace @ {", specs.VersionUnderscore); + // For each namespace::class: + // ...create GNDStk hpp file + for (const auto &obj : specs.ClassDependenciesSorted) + fileGNDStkClass( + specs, specs.class2data.find(obj.theClass)->second, obj); // ------------------------ - // Meta<> objects + // C Interface // ------------------------ - out(); - out(); - out(largeComment); - out("// key::meta::"); - out(largeComment); - out(); - out("namespace key {"); - out("namespace meta {"); - - if (metadata.size() > 0) { - out(); - for (const auto &meta : metadata) - out("inline const Meta<> @(\"@\");", meta.first, meta.second); - out(); - } - - out("} // namespace meta"); - out("using namespace meta;"); - out("} // namespace key"); + // For each namespace::class: + // ...create header file for the C interface + // ...create source file for the C interface + action("Writing Code: C Interface"); + for (const auto &obj : specs.ClassDependenciesSorted) + fileCInterface( + specs, specs.class2data.find(obj.theClass)->second, obj); // ------------------------ - // Child<> objects + // Fortran Interface // ------------------------ - for (const auto &nspace : namespace2children) { - out(); - out(); - out(largeComment); - out("// @::key::child::", nspace.first); - out(largeComment); - out(); - out("namespace @ {", nspace.first); - out("namespace key {"); - out("namespace child {"); - - const auto &children = nspace.second; - if (children.size() > 0) { - out(); - for (const auto &child : children) - out("inline const Child<> @(\"@\");", child.first, child.second); - out(); - } - - out("} // namespace child"); - out("using namespace child;"); - out("} // namespace key"); - out("} // namespace @", nspace.first); - } + // For each namespace::class: + // ...create source file for the Fortran interface + action("Writing Code: Fortran Interface"); + for (const auto &obj : specs.ClassDependenciesSorted) + fileF03Interface( + specs, specs.class2data.find(obj.theClass)->second, obj); // ------------------------ - // finish + // Python Interface // ------------------------ - out(); - out(); - out(largeComment); - out(largeComment); - out(); - out("} // namespace @", specs.VersionUnderscore); - out("} // namespace GNDStk"); - out("} // namespace njoy"); - out(); - out("#endif"); -} // fileGNDStkKey - - -// fileGNDStkClass -void fileGNDStkClass( - const InfoSpecs &specs, const PerClass &per, const Class2Dependencies &c2d -) { - // class-specific hpp file - writer out(per.hppGNDStk); - const std::string guard = - "NJOY_GNDSTK_" + allcaps(specs.VersionUnderscore) + "_" + - allcaps(per.nsname) + "_" + allcaps(per.clname); - - out(); - out("#ifndef @", guard); - out("#define @", guard); - out(); - out("// core interface"); - out("#include \"GNDStk.hpp\""); - - if (c2d.dependencies.size() > 0) { - out(); - out("// @ dependencies", specs.Version); - for (const auto &dep : c2d.dependencies) - out("#include \"GNDStk/@/@/@.hpp\"", - specs.Version, dep.nsname, dep.clname); - } - - out(); - out("namespace njoy {"); - out("namespace GNDStk {"); - out("namespace @ {", specs.VersionUnderscore); - out(); - out("using namespace njoy::GNDStk::core;"); - out(per.code,false); - out("} // namespace @", specs.VersionUnderscore); - out("} // namespace GNDStk"); - out("} // namespace njoy"); - out(); - out("#endif"); -} // fileGNDStkClass - - -// filePythonNamespace -void filePythonNamespace(const InfoSpecs &specs, const PerNamespace &per) -{ - writer out(per.cppPython); - out(); - out("#include "); - out("#include "); - out(); - out("namespace python = pybind11;"); - out(); - out("// @ interface", specs.Version); - out("namespace python_@ {", specs.VersionUnderscore); - - out(); - out("// @ declarations", per.nsname); - out("namespace python_@ {", per.nsname); - for (auto &cl : specs.ClassDependenciesSorted) - if (cl.theClass.nsname == per.nsname) - out(1,"void wrap@(python::module &);", cl.theClass.clname); - out("} // namespace python_@", per.nsname); - - out(); - out("// @ wrapper", per.nsname); - out("void wrap@(python::module &module)", capital(per.nsname)); - out("{"); - out(1,"// create the @ submodule", per.nsname); - out(1,"python::module submodule = module.def_submodule("); - out(2,"\"@\",", per.nsname); - out(2,"\"GNDS @ @\"", specs.Version, per.nsname); - out(1,");"); - - out(); - out(1,"// wrap @ components", per.nsname); - for (auto &cl : specs.ClassDependenciesSorted) - if (cl.theClass.nsname == per.nsname) - out(1,"python_@::wrap@(submodule);", per.nsname, cl.theClass.clname); - out("};"); - out(); - out("} // namespace python_@", specs.VersionUnderscore); -} // filePythonNamespace - - -// filePythonClass -void filePythonClass(const InfoSpecs &specs, const PerClass &per) -{ - const std::string &nsname = per.nsname; - const std::string &clname = per.clname; - writer out(per.cppPython); - - static const std::map> map = { - // ---------------------- ----------- ----------------- - // In per.dataType or The A name to use - // in per.metadata's appropriate for the function - // valueType defaultValue C++ type that returns them - // ---------------------- ----------- ----------------- - - // Described in the GNDS manual. - // I'm not sure which of the several types that map to std::string can, - // or would, appear in any GNDS specifications in such a way that we'd - // need it here, but listing all "string-like" types shouldn't hurt. - { "Integer32" , { "int" , "ints" } }, - { "UInteger32" , { "unsigned" , "uints" } }, - { "Float64" , { "double" , "doubles" } }, - { "XMLName" , { "std::string" , "strings" } }, - { "UTF8Text" , { "std::string" , "strings" } }, - { "printableText" , { "std::string" , "strings" } }, - { "quotedText" , { "std::string" , "strings" } }, - { "tdText" , { "std::string" , "strings" } }, - - // Our versions of the above. - { "int" , { "int" , "ints" } }, - { "unsigned" , { "unsigned" , "uints" } }, - { "double" , { "double" , "doubles" } }, - { "string" , { "std::string" , "strings" } }, - { "std::string" , { "std::string" , "strings" } }, - - // Allow other sensible things. - { "char" , { "char" , "chars" } }, - { "signed char" , { "signed char" , "schars" } }, - { "short" , { "short" , "shorts" } }, - { "long" , { "long" , "longs" } }, - { "long long" , { "long long" , "longlongs" } }, - { "unsigned char" , { "unsigned char" , "uchars" } }, - { "unsigned short" , { "unsigned short" , "ushorts" } }, - { "unsigned int" , { "unsigned" , "uints" } }, - { "unsigned long" , { "unsigned long" , "ulongs" } }, - { "unsigned long long" , { "unsigned long long" , "ulonglongs" } }, - { "float" , { "float" , "floats" } }, - { "long double" , { "long double" , "longdoubles" } }, - { "quad" , { "long double" , "quads" } } - }; - - std::vector< std::pair< std::string, std::string > > dataTypesNames; - if (per.isData) { - // try to find per.dataType in the map - auto it = map.find(per.dataType); - if (it != map.end()) { - // this is a node with a fixed data type - dataTypesNames.emplace_back( it->second.first, it->second.second ); - } - else { - // this is a node with a runtime data type: select types to expose - std::array< std::string, 3 > types = { "int", "double", "string" }; - for ( const auto& type : types ) { - it = map.find( type ); - dataTypesNames.emplace_back( it->second.first, it->second.second ); - } - } - } - - out(); - out("// system includes"); - out("#include "); - out("#include "); - - out(); - out("// local includes"); - out("#include \"GNDStk/@/@/@.hpp\"", specs.Version, nsname, clname); - out("#include \"definitions.hpp\""); - - out(); - out("// namespace aliases"); - out("namespace python = pybind11;"); - - out(); - out("namespace python_@ {", specs.VersionUnderscore); - out("namespace python_@ {", nsname); - - out(); - out("// @ wrapper", clname); - out("void wrap@(python::module &module)", clname); - out("{"); - out(1,"using namespace njoy::GNDStk;"); - out(1,"using namespace njoy::GNDStk::@;", specs.VersionUnderscore); - out(); - out(1,"// type aliases"); - out(1,"using Component = @::@;", nsname, clname); - - // using [variant name] = std::variant..., if necessary - for (const auto &v : per.variants) { - out(1,"using @ = std::variant<", v.type); - int count = 0, total = v.children.size(); - for (const auto &c : v.children) - out(2, "@@", c.type, ++count == total ? "" : ","); - out(1,">;"); - } - - out(); - out(1,"// create the component"); - out(1,"python::class_ component("); - out(2,"module,"); - out(2,"\"@\",", clname); - out(2,"Component::documentation().data()"); - out(1,");"); - out(); - out(1,"// wrap the component"); - out(1,"component"); - - // python::init<...> for attributes and children - out(2,".def("); - out(3,"python::init<"); - int count = 0, total = per.nfields(); - for (auto &m : per.metadata) - out(4,"const @ &@", - m.isDefaulted ? "std::optional<" + m.type + ">" : m.typeFull, - ++count < total ? "," : ""); - for (auto &c : per.children) - out(4,"const @ &@", c.typeFull, ++count < total ? "," : ""); - for (auto &v : per.variants) - out(4,"const @ &@", v.typeFull, ++count < total ? "," : ""); - out(3,">(),"); - for (auto &m : per.metadata) - out(3,"python::arg(\"@\")@,", - namePython(m.name), - m.isOptional || m.isDefaulted ? " = std::nullopt" : ""); - for (auto &c : per.children) - out(3,"python::arg(\"@\")@,", namePython(c.name), - c.isOptional ? " = std::nullopt" : ""); - for (auto &v : per.variants) - out(3,"python::arg(\"@\"),", namePython(v.name)); - out(3,"Component::documentation(\"constructor\").data()"); - out(2,")"); - - // python::init<...> for each data type and name pair - for ( const auto& dataTypeName : dataTypesNames ) { - out(2,".def("); - out(3,"python::init<"); - out(4,"const std::vector<@> &", dataTypeName.first); - out(3,">(),"); - out(3,"python::arg(\"@\"),", dataTypeName.second); - out(3,"Component::documentation(\"constructor\").data()"); - out(2,")"); - } - - // .def_property_readonly... - for (auto &m : per.metadata) { - const auto pyname = namePython(m.name); - out(2,".def_property_readonly("); - out(3,"\"@\",", pyname); - m.isDefaulted - ? out(3,"[](const Component &self) { return self.@().value(); },", - m.name) - : out(3,"&Component::@,", - m.name); - out(3,"Component::documentation(\"@\").data()", pyname); - out(2,")"); - } - - for (auto &c : per.children) { - const auto pyname = namePython(c.name); - out(2,".def_property_readonly("); - out(3,"\"@\",", pyname); - out(3,"python::overload_cast<>(&Component::@),", c.name); - out(3,"Component::documentation(\"@\").data()", pyname); - out(2,")"); - } - - for (auto &v : per.variants) { - if (!v.isVector) - for (auto &c : v.children) { - const auto pyname = namePython(c.name); - out(2,".def_property_readonly("); - out(3,"\"@\",", pyname); - out(3,"python::overload_cast<>(&Component::@),", c.name); - out(3,"Component::documentation(\"@\").data()", pyname); - out(2,")"); - } - const auto pyname = namePython(v.name); - out(2,".def_property_readonly("); - out(3,"\"@\",", pyname); - out(3,"python::overload_cast<>(&Component::@),", v.name); - out(3,"Component::documentation(\"@\").data()", pyname); - out(2,")"); - } - - for ( const auto& dataTypeName : dataTypesNames ) { - out(2,".def_property_readonly("); - out(3,"\"@\",", dataTypeName.second); - out(3,"[] (const Component &self) { return self.@(); },", dataTypeName.second); - out(3,"Component::documentation(\"@\").data()", dataTypeName.second); - out(2,")"); - } - - // finish - out(1,";"); - out(); - out(1,"// add standard component definitions"); - out(1,"addStandardComponentDefinitions< Component >( component );"); - out("}"); - out(); - out("} // namespace python_@", nsname); - out("} // namespace python_@", specs.VersionUnderscore); -} // filePythonClass - - - -// ----------------------------------------------------------------------------- -// main -// ----------------------------------------------------------------------------- - -int main(const int argc, const char *const *const argv) -{ - // For GNDStk's diagnostics - color = true; - - // READ INFORMATION from the JSON file on the command line - InfoSpecs specs; - commandLine(argc, argv, specs); - - // PREPROCESS, to get information needed upfront for detailed processing - preprocessFiles(specs); - - // PRINT CLASS CODE into temporary strings, which are written to the - // class-specific files later, after class dependencies are computed - getFiles(specs); - - // COMPUTE AN ORDERING that respects dependencies - sortDependencies(specs); - - // GNDStk hpp file for this GNDS version - fileGNDStkVersion(specs); - - // GNDStk hpp file for Meta and Child keys - fileGNDStkKey(specs); - - // GNDStk hpp file for each namespace::class - for (const auto &obj : specs.ClassDependenciesSorted) { - auto find = specs.class2data.find(obj.theClass); - assert(find != specs.class2data.end()); - fileGNDStkClass(specs, find->second, obj); - } - - // Python cpp file for each namespace - for (auto &obj : specs.namespace2data) + // For each namespace: + // ...create Python cpp file + // For each namespace::class: + // ...create Python cpp file + action("Writing Code: Python Interface"); + filePythonAll(specs); + filePythonVersion(specs); + for (const auto &obj : specs.namespace2data) filePythonNamespace(specs, obj.second); - - // Python cpp file for each namespace::class - for (auto &obj : specs.class2data) + for (const auto &obj : specs.class2data) filePythonClass(specs, obj.second); std::cout << std::endl; } diff --git a/autogen/prototype.json b/autogen/prototype.json deleted file mode 100644 index 856a88ec1..000000000 --- a/autogen/prototype.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "comment" : [ - "GNDSDir", - " Base GNDStk directory into which the autogenerator tool", - " should place src/GNDStk/version.hpp and src/GNDStk/version/*", - "", - "JSONDir", - " Directory where the listed .json input files are located", - "", - "TO AUTOGENERATE THE PROTOTYPE IN THE REAL GNDStk HIERARCHY", - " Set GNDSDir to .. if you run json2class.exe from within", - " GNDStk/autogen/, where GNDStk/ is the cloned repository", - "", - "Do NOT end the directories (JSONDir and GNDSDir) with a /" - ], - - "GNDSDir": "..", - "Version": "v1.9", - - "JSONDir": "prototype", - "JSONFiles": [ - "generalPurpose.json", - "reactionSuite.json" - ], - "Changes": "changes.json" -} diff --git a/autogen/prototype/.gitignore b/autogen/prototype/.gitignore deleted file mode 100644 index bd541c7e2..000000000 --- a/autogen/prototype/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -python -src diff --git a/autogen/prototype/generalPurpose.json b/autogen/prototype/generalPurpose.json index 0f0456417..a0f41ebc2 100644 --- a/autogen/prototype/generalPurpose.json +++ b/autogen/prototype/generalPurpose.json @@ -33,11 +33,11 @@ }, "children": { "axes": { - "occurrence": "1", + "times": "1", "required": false }, "values": { - "occurrence": "1", + "times": "1", "required": true } } @@ -52,12 +52,12 @@ }, "children": { "axis": { - "occurrence": "choice+", + "times": "choice+", "variant": "axis_grid", "required": false }, "grid": { - "occurrence": "choice+", + "times": "choice+", "variant": "axis_grid", "required": false } @@ -108,12 +108,12 @@ }, "children": { "values": { - "occurrence": "choice", + "times": "choice", "variant": "link_values", "required": false }, "link": { - "occurrence": "choice", + "times": "choice", "variant": "link_values", "required": false } @@ -154,11 +154,11 @@ }, "children": { "axes": { - "occurrence": "1", + "times": "1", "required": false }, "XYs1d": { - "occurrence": "1+", + "times": "1+", "required": true } }, diff --git a/autogen/prototype/proto/c/src/v1.9.h b/autogen/prototype/proto/c/src/v1.9.h new file mode 100644 index 000000000..09673a8f1 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9.h @@ -0,0 +1,35 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// ----------------------------------------------------------------------------- +// This header file is designed to work with both C and C++ +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9 +#define C_INTERFACE_PROTO_V1_9 + +#include "GNDStk.h" + +#ifdef __cplusplus + // For C++ + #include "proto/v1.9.hpp" +#endif + +#include "v1.9/containers/Axes.h" +#include "v1.9/containers/Axis.h" + +#include "v1.9/transport/CrossSection.h" + +#include "v1.9/containers/Grid.h" +#include "v1.9/containers/Link.h" + +#include "v1.9/transport/Reaction.h" +#include "v1.9/transport/ReactionSuite.h" +#include "v1.9/transport/Reactions.h" + +#include "v1.9/containers/Regions1d.h" +#include "v1.9/containers/Values.h" +#include "v1.9/containers/XYs1d.h" + +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Axes.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Axes.cpp new file mode 100644 index 000000000..60143f274 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Axes.cpp @@ -0,0 +1,175 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "proto/v1.9/containers/Axes.hpp" +#include "Axes.h" + +using namespace njoy::GNDStk; +using namespace proto::v1_9; + +using C = AxesClass; +using CPP = multigroup::Axes; + +static const std::string CLASSNAME = "Axes"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; +} + +using CPPAxis = containers::Axis; +using CPPGrid = containers::Grid; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAxes +AxesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Axes +AxesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAxes +AxesCreateConst( + const char *const href, +) { + ConstHandle2Axes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href + ); + return handle; +} + +// Create, general +Handle2Axes +AxesCreate( + const char *const href, +) { + ConstHandle2Axes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AxesAssign(ConstHandle2Axes self, ConstHandle2ConstAxes from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AxesDelete(ConstHandle2ConstAxes self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AxesRead(ConstHandle2Axes self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AxesWrite(ConstHandle2ConstAxes self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AxesPrint(ConstHandle2ConstAxes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AxesPrintXML(ConstHandle2ConstAxes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AxesPrintJSON(ConstHandle2ConstAxes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +AxesHrefHas(ConstHandle2ConstAxes self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +AxesHrefGet(ConstHandle2ConstAxes self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +AxesHrefSet(ConstHandle2Axes self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Axes/src/custom.cpp" diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Axes.h b/autogen/prototype/proto/c/src/v1.9/containers/Axes.h new file mode 100644 index 000000000..cddc43e82 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Axes.h @@ -0,0 +1,159 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Axes is the basic handle type in this file. Example: +// // Create a default Axes object: +// Axes handle = AxesDefault(); +// Functions involving Axes are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9_CONTAINERS_AXES +#define C_INTERFACE_PROTO_V1_9_CONTAINERS_AXES + +#include "GNDStk.h" +#include "v1.9/containers/Axis.h" +#include "v1.9/containers/Grid.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AxesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Axes +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AxesClass *Axes; + +// --- Const-aware handles. +typedef const struct AxesClass *const ConstHandle2ConstAxes; +typedef struct AxesClass *const ConstHandle2Axes; +typedef const struct AxesClass * Handle2ConstAxes; +typedef struct AxesClass * Handle2Axes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAxes +AxesDefaultConst(); + +// +++ Create, default +extern_c Handle2Axes +AxesDefault(); + +// --- Create, general, const +extern_c Handle2ConstAxes +AxesCreateConst( + const char *const href, +); + +// +++ Create, general +extern_c Handle2Axes +AxesCreate( + const char *const href, +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AxesAssign(ConstHandle2Axes self, ConstHandle2ConstAxes from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AxesDelete(ConstHandle2ConstAxes self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AxesRead(ConstHandle2Axes self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AxesWrite(ConstHandle2ConstAxes self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AxesPrint(ConstHandle2ConstAxes self); + +// +++ Print to standard output, as XML +extern_c int +AxesPrintXML(ConstHandle2ConstAxes self); + +// +++ Print to standard output, as JSON +extern_c int +AxesPrintJSON(ConstHandle2ConstAxes self); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxesHrefHas(ConstHandle2ConstAxes self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AxesHrefGet(ConstHandle2ConstAxes self); + +// +++ Set +extern_c void +AxesHrefSet(ConstHandle2Axes self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Axes/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Axes/src/custom.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Axes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Axes/src/custom.h b/autogen/prototype/proto/c/src/v1.9/containers/Axes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Axis.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Axis.cpp new file mode 100644 index 000000000..d8c2282c2 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Axis.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "proto/v1.9/containers/Axis.hpp" +#include "Axis.h" + +using namespace njoy::GNDStk; +using namespace proto::v1_9; + +using C = AxisClass; +using CPP = multigroup::Axis; + +static const std::string CLASSNAME = "Axis"; + +namespace extract { + static auto index = [](auto &obj) { return &obj.index; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAxis +AxisDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Axis +AxisDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAxis +AxisCreateConst( + const int index, + const char *const label, + const char *const unit +) { + ConstHandle2Axis handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + label, + unit + ); + return handle; +} + +// Create, general +Handle2Axis +AxisCreate( + const int index, + const char *const label, + const char *const unit +) { + ConstHandle2Axis handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + index, + label, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AxisAssign(ConstHandle2Axis self, ConstHandle2ConstAxis from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AxisDelete(ConstHandle2ConstAxis self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AxisRead(ConstHandle2Axis self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AxisWrite(ConstHandle2ConstAxis self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AxisPrint(ConstHandle2ConstAxis self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AxisPrintXML(ConstHandle2ConstAxis self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AxisPrintJSON(ConstHandle2ConstAxis self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// Has +int +AxisIndexHas(ConstHandle2ConstAxis self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IndexHas", self, extract::index); +} + +// Get +// Returns by value +int +AxisIndexGet(ConstHandle2ConstAxis self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +AxisIndexSet(ConstHandle2Axis self, const int index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AxisLabelHas(ConstHandle2ConstAxis self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +AxisLabelGet(ConstHandle2ConstAxis self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AxisLabelSet(ConstHandle2Axis self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +AxisUnitHas(ConstHandle2ConstAxis self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +AxisUnitGet(ConstHandle2ConstAxis self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +AxisUnitSet(ConstHandle2Axis self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Axis/src/custom.cpp" diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Axis.h b/autogen/prototype/proto/c/src/v1.9/containers/Axis.h new file mode 100644 index 000000000..8a5b3ec95 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Axis.h @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Axis is the basic handle type in this file. Example: +// // Create a default Axis object: +// Axis handle = AxisDefault(); +// Functions involving Axis are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9_CONTAINERS_AXIS +#define C_INTERFACE_PROTO_V1_9_CONTAINERS_AXIS + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AxisClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Axis +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AxisClass *Axis; + +// --- Const-aware handles. +typedef const struct AxisClass *const ConstHandle2ConstAxis; +typedef struct AxisClass *const ConstHandle2Axis; +typedef const struct AxisClass * Handle2ConstAxis; +typedef struct AxisClass * Handle2Axis; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAxis +AxisDefaultConst(); + +// +++ Create, default +extern_c Handle2Axis +AxisDefault(); + +// --- Create, general, const +extern_c Handle2ConstAxis +AxisCreateConst( + const int index, + const char *const label, + const char *const unit +); + +// +++ Create, general +extern_c Handle2Axis +AxisCreate( + const int index, + const char *const label, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AxisAssign(ConstHandle2Axis self, ConstHandle2ConstAxis from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AxisDelete(ConstHandle2ConstAxis self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AxisRead(ConstHandle2Axis self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AxisWrite(ConstHandle2ConstAxis self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AxisPrint(ConstHandle2ConstAxis self); + +// +++ Print to standard output, as XML +extern_c int +AxisPrintXML(ConstHandle2ConstAxis self); + +// +++ Print to standard output, as JSON +extern_c int +AxisPrintJSON(ConstHandle2ConstAxis self); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxisIndexHas(ConstHandle2ConstAxis self); + +// +++ Get +// +++ Returns by value +extern_c int +AxisIndexGet(ConstHandle2ConstAxis self); + +// +++ Set +extern_c void +AxisIndexSet(ConstHandle2Axis self, const int index); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxisLabelHas(ConstHandle2ConstAxis self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AxisLabelGet(ConstHandle2ConstAxis self); + +// +++ Set +extern_c void +AxisLabelSet(ConstHandle2Axis self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxisUnitHas(ConstHandle2ConstAxis self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AxisUnitGet(ConstHandle2ConstAxis self); + +// +++ Set +extern_c void +AxisUnitSet(ConstHandle2Axis self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Axis/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Axis/src/custom.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Axis/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Axis/src/custom.h b/autogen/prototype/proto/c/src/v1.9/containers/Axis/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Grid.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Grid.cpp new file mode 100644 index 000000000..d5cc9ab77 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Grid.cpp @@ -0,0 +1,315 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "proto/v1.9/containers/Grid.hpp" +#include "Grid.h" + +using namespace njoy::GNDStk; +using namespace proto::v1_9; + +using C = GridClass; +using CPP = multigroup::Grid; + +static const std::string CLASSNAME = "Grid"; + +namespace extract { + static auto index = [](auto &obj) { return &obj.index; }; + static auto interpolation = [](auto &obj) { return &obj.interpolation; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto style = [](auto &obj) { return &obj.style; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + +using CPPValues = containers::Values; +using CPPLink = containers::Link; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGrid +GridDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Grid +GridDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGrid +GridCreateConst( + const int index, + const enums::Interpolation interpolation, + const char *const label, + const enums::GridStyle style, + const char *const unit, +) { + ConstHandle2Grid handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + interpolation, + label, + style, + unit + ); + return handle; +} + +// Create, general +Handle2Grid +GridCreate( + const int index, + const enums::Interpolation interpolation, + const char *const label, + const enums::GridStyle style, + const char *const unit, +) { + ConstHandle2Grid handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + index, + interpolation, + label, + style, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +GridAssign(ConstHandle2Grid self, ConstHandle2ConstGrid from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +GridDelete(ConstHandle2ConstGrid self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +GridRead(ConstHandle2Grid self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +GridWrite(ConstHandle2ConstGrid self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +GridPrint(ConstHandle2ConstGrid self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +GridPrintXML(ConstHandle2ConstGrid self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +GridPrintJSON(ConstHandle2ConstGrid self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// Has +int +GridIndexHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IndexHas", self, extract::index); +} + +// Get +// Returns by value +int +GridIndexGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +GridIndexSet(ConstHandle2Grid self, const int index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// Has +int +GridInterpolationHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InterpolationHas", self, extract::interpolation); +} + +// Get +// Returns by value +enums::Interpolation +GridInterpolationGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationGet", self, extract::interpolation); +} + +// Set +void +GridInterpolationSet(ConstHandle2Grid self, const enums::Interpolation interpolation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InterpolationSet", self, extract::interpolation, interpolation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +GridLabelHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +GridLabelGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +GridLabelSet(ConstHandle2Grid self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: style +// ----------------------------------------------------------------------------- + +// Has +int +GridStyleHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StyleHas", self, extract::style); +} + +// Get +// Returns by value +enums::GridStyle +GridStyleGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StyleGet", self, extract::style); +} + +// Set +void +GridStyleSet(ConstHandle2Grid self, const enums::GridStyle style) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StyleSet", self, extract::style, style); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +GridUnitHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +GridUnitGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +GridUnitSet(ConstHandle2Grid self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Grid/src/custom.cpp" diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Grid.h b/autogen/prototype/proto/c/src/v1.9/containers/Grid.h new file mode 100644 index 000000000..198302b86 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Grid.h @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Grid is the basic handle type in this file. Example: +// // Create a default Grid object: +// Grid handle = GridDefault(); +// Functions involving Grid are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9_CONTAINERS_GRID +#define C_INTERFACE_PROTO_V1_9_CONTAINERS_GRID + +#include "GNDStk.h" +#include "v1.9/containers/Values.h" +#include "v1.9/containers/Link.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct GridClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Grid +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct GridClass *Grid; + +// --- Const-aware handles. +typedef const struct GridClass *const ConstHandle2ConstGrid; +typedef struct GridClass *const ConstHandle2Grid; +typedef const struct GridClass * Handle2ConstGrid; +typedef struct GridClass * Handle2Grid; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstGrid +GridDefaultConst(); + +// +++ Create, default +extern_c Handle2Grid +GridDefault(); + +// --- Create, general, const +extern_c Handle2ConstGrid +GridCreateConst( + const int index, + const enums::Interpolation interpolation, + const char *const label, + const enums::GridStyle style, + const char *const unit, +); + +// +++ Create, general +extern_c Handle2Grid +GridCreate( + const int index, + const enums::Interpolation interpolation, + const char *const label, + const enums::GridStyle style, + const char *const unit, +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +GridAssign(ConstHandle2Grid self, ConstHandle2ConstGrid from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +GridDelete(ConstHandle2ConstGrid self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +GridRead(ConstHandle2Grid self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +GridWrite(ConstHandle2ConstGrid self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +GridPrint(ConstHandle2ConstGrid self); + +// +++ Print to standard output, as XML +extern_c int +GridPrintXML(ConstHandle2ConstGrid self); + +// +++ Print to standard output, as JSON +extern_c int +GridPrintJSON(ConstHandle2ConstGrid self); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridIndexHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c int +GridIndexGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridIndexSet(ConstHandle2Grid self, const int index); + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridInterpolationHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c enums::Interpolation +GridInterpolationGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridInterpolationSet(ConstHandle2Grid self, const enums::Interpolation interpolation); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridLabelHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c const char * +GridLabelGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridLabelSet(ConstHandle2Grid self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: style +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridStyleHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c enums::GridStyle +GridStyleGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridStyleSet(ConstHandle2Grid self, const enums::GridStyle style); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridUnitHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c const char * +GridUnitGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridUnitSet(ConstHandle2Grid self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Grid/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Grid/src/custom.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Grid/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Grid/src/custom.h b/autogen/prototype/proto/c/src/v1.9/containers/Grid/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Link.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Link.cpp new file mode 100644 index 000000000..30f21f5ef --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Link.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "proto/v1.9/containers/Link.hpp" +#include "Link.h" + +using namespace njoy::GNDStk; +using namespace proto::v1_9; + +using C = LinkClass; +using CPP = multigroup::Link; + +static const std::string CLASSNAME = "Link"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLink +LinkDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Link +LinkDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLink +LinkCreateConst( + const char *const href +) { + ConstHandle2Link handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href + ); + return handle; +} + +// Create, general +Handle2Link +LinkCreate( + const char *const href +) { + ConstHandle2Link handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +LinkAssign(ConstHandle2Link self, ConstHandle2ConstLink from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LinkDelete(ConstHandle2ConstLink self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LinkRead(ConstHandle2Link self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LinkWrite(ConstHandle2ConstLink self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LinkPrint(ConstHandle2ConstLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LinkPrintXML(ConstHandle2ConstLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LinkPrintJSON(ConstHandle2ConstLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +LinkHrefHas(ConstHandle2ConstLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +LinkHrefGet(ConstHandle2ConstLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +LinkHrefSet(ConstHandle2Link self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Link/src/custom.cpp" diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Link.h b/autogen/prototype/proto/c/src/v1.9/containers/Link.h new file mode 100644 index 000000000..4f6009662 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Link.h @@ -0,0 +1,157 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Link is the basic handle type in this file. Example: +// // Create a default Link object: +// Link handle = LinkDefault(); +// Functions involving Link are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9_CONTAINERS_LINK +#define C_INTERFACE_PROTO_V1_9_CONTAINERS_LINK + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LinkClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Link +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LinkClass *Link; + +// --- Const-aware handles. +typedef const struct LinkClass *const ConstHandle2ConstLink; +typedef struct LinkClass *const ConstHandle2Link; +typedef const struct LinkClass * Handle2ConstLink; +typedef struct LinkClass * Handle2Link; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstLink +LinkDefaultConst(); + +// +++ Create, default +extern_c Handle2Link +LinkDefault(); + +// --- Create, general, const +extern_c Handle2ConstLink +LinkCreateConst( + const char *const href +); + +// +++ Create, general +extern_c Handle2Link +LinkCreate( + const char *const href +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +LinkAssign(ConstHandle2Link self, ConstHandle2ConstLink from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LinkDelete(ConstHandle2ConstLink self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LinkRead(ConstHandle2Link self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LinkWrite(ConstHandle2ConstLink self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LinkPrint(ConstHandle2ConstLink self); + +// +++ Print to standard output, as XML +extern_c int +LinkPrintXML(ConstHandle2ConstLink self); + +// +++ Print to standard output, as JSON +extern_c int +LinkPrintJSON(ConstHandle2ConstLink self); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LinkHrefHas(ConstHandle2ConstLink self); + +// +++ Get +// +++ Returns by value +extern_c const char * +LinkHrefGet(ConstHandle2ConstLink self); + +// +++ Set +extern_c void +LinkHrefSet(ConstHandle2Link self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Link/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Link/src/custom.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Link/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Link/src/custom.h b/autogen/prototype/proto/c/src/v1.9/containers/Link/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Regions1d.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Regions1d.cpp new file mode 100644 index 000000000..c7b5964bb --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Regions1d.cpp @@ -0,0 +1,505 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "proto/v1.9/containers/Regions1d.hpp" +#include "Regions1d.h" + +using namespace njoy::GNDStk; +using namespace proto::v1_9; + +using C = Regions1dClass; +using CPP = multigroup::Regions1d; + +static const std::string CLASSNAME = "Regions1d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto outerDomainValue = [](auto &obj) { return &obj.outerDomainValue; }; + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPAxes = containers::Axes; +using CPPXYs1d = containers::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRegions1d +Regions1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Regions1d +Regions1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRegions1d +Regions1dCreateConst( + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize +) { + ConstHandle2Regions1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + outerDomainValue, + detail::tocpp(axes), + std::vector{} + ); + for (size_t XYs1dN = 0; XYs1dN < XYs1dSize; ++XYs1dN) + Regions1dXYs1dAdd(handle, XYs1d[XYs1dN]); + return handle; +} + +// Create, general +Handle2Regions1d +Regions1dCreate( + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize +) { + ConstHandle2Regions1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + outerDomainValue, + detail::tocpp(axes), + std::vector{} + ); + for (size_t XYs1dN = 0; XYs1dN < XYs1dSize; ++XYs1dN) + Regions1dXYs1dAdd(handle, XYs1d[XYs1dN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Regions1dAssign(ConstHandle2Regions1d self, ConstHandle2ConstRegions1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Regions1dDelete(ConstHandle2ConstRegions1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Regions1dRead(ConstHandle2Regions1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Regions1dWrite(ConstHandle2ConstRegions1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Regions1dPrint(ConstHandle2ConstRegions1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Regions1dPrintXML(ConstHandle2ConstRegions1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Regions1dPrintJSON(ConstHandle2ConstRegions1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Regions1dLabelHas(ConstHandle2ConstRegions1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +Regions1dLabelGet(ConstHandle2ConstRegions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Regions1dLabelSet(ConstHandle2Regions1d self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +Regions1dOuterDomainValueHas(ConstHandle2ConstRegions1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +double +Regions1dOuterDomainValueGet(ConstHandle2ConstRegions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +Regions1dOuterDomainValueSet(ConstHandle2Regions1d self, const double outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +Regions1dAxesHas(ConstHandle2ConstRegions1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +Regions1dAxesGetConst(ConstHandle2ConstRegions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +Regions1dAxesGet(ConstHandle2Regions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +Regions1dAxesSet(ConstHandle2Regions1d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +Regions1dXYs1dHas(ConstHandle2ConstRegions1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Clear +void +Regions1dXYs1dClear(ConstHandle2Regions1d self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"XYs1dClear", self, extract::XYs1d); +} + +// Size +size_t +Regions1dXYs1dSize(ConstHandle2ConstRegions1d self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"XYs1dSize", self, extract::XYs1d); +} + +// Add +void +Regions1dXYs1dAdd(ConstHandle2Regions1d self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"XYs1dAdd", self, extract::XYs1d, XYs1d); +} + +// Get, by index \in [0,size), const +Handle2ConstXYs1d +Regions1dXYs1dGetConst(ConstHandle2ConstRegions1d self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d, index_); +} + +// Get, by index \in [0,size), non-const +Handle2XYs1d +Regions1dXYs1dGet(ConstHandle2Regions1d self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d, index_); +} + +// Set, by index \in [0,size) +void +Regions1dXYs1dSet( + ConstHandle2Regions1d self, + const size_t index_, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, index_, XYs1d); +} + +// Has, by index +int +Regions1dXYs1dHasByIndex( + ConstHandle2ConstRegions1d self, + const int index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByIndex", + self, extract::XYs1d, meta::index, index); +} + +// Get, by index, const +Handle2ConstXYs1d +Regions1dXYs1dGetByIndexConst( + ConstHandle2ConstRegions1d self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByIndexConst", + self, extract::XYs1d, meta::index, index); +} + +// Get, by index, non-const +Handle2XYs1d +Regions1dXYs1dGetByIndex( + ConstHandle2Regions1d self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByIndex", + self, extract::XYs1d, meta::index, index); +} + +// Set, by index +void +Regions1dXYs1dSetByIndex( + ConstHandle2Regions1d self, + const int index, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByIndex", + self, extract::XYs1d, meta::index, index, XYs1d); +} + +// Has, by interpolation +int +Regions1dXYs1dHasByInterpolation( + ConstHandle2ConstRegions1d self, + const enums::Interpolation interpolation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByInterpolation", + self, extract::XYs1d, meta::interpolation, interpolation); +} + +// Get, by interpolation, const +Handle2ConstXYs1d +Regions1dXYs1dGetByInterpolationConst( + ConstHandle2ConstRegions1d self, + const enums::Interpolation interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByInterpolationConst", + self, extract::XYs1d, meta::interpolation, interpolation); +} + +// Get, by interpolation, non-const +Handle2XYs1d +Regions1dXYs1dGetByInterpolation( + ConstHandle2Regions1d self, + const enums::Interpolation interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByInterpolation", + self, extract::XYs1d, meta::interpolation, interpolation); +} + +// Set, by interpolation +void +Regions1dXYs1dSetByInterpolation( + ConstHandle2Regions1d self, + const enums::Interpolation interpolation, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByInterpolation", + self, extract::XYs1d, meta::interpolation, interpolation, XYs1d); +} + +// Has, by label +int +Regions1dXYs1dHasByLabel( + ConstHandle2ConstRegions1d self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByLabel", + self, extract::XYs1d, meta::label, label); +} + +// Get, by label, const +Handle2ConstXYs1d +Regions1dXYs1dGetByLabelConst( + ConstHandle2ConstRegions1d self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByLabelConst", + self, extract::XYs1d, meta::label, label); +} + +// Get, by label, non-const +Handle2XYs1d +Regions1dXYs1dGetByLabel( + ConstHandle2Regions1d self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByLabel", + self, extract::XYs1d, meta::label, label); +} + +// Set, by label +void +Regions1dXYs1dSetByLabel( + ConstHandle2Regions1d self, + const char *const label, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByLabel", + self, extract::XYs1d, meta::label, label, XYs1d); +} + +// Has, by outerDomainValue +int +Regions1dXYs1dHasByOuterDomainValue( + ConstHandle2ConstRegions1d self, + const double outerDomainValue +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByOuterDomainValue", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, const +Handle2ConstXYs1d +Regions1dXYs1dGetByOuterDomainValueConst( + ConstHandle2ConstRegions1d self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByOuterDomainValueConst", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, non-const +Handle2XYs1d +Regions1dXYs1dGetByOuterDomainValue( + ConstHandle2Regions1d self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByOuterDomainValue", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue); +} + +// Set, by outerDomainValue +void +Regions1dXYs1dSetByOuterDomainValue( + ConstHandle2Regions1d self, + const double outerDomainValue, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByOuterDomainValue", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Regions1d/src/custom.cpp" diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Regions1d.h b/autogen/prototype/proto/c/src/v1.9/containers/Regions1d.h new file mode 100644 index 000000000..9996e0839 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Regions1d.h @@ -0,0 +1,357 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Regions1d is the basic handle type in this file. Example: +// // Create a default Regions1d object: +// Regions1d handle = Regions1dDefault(); +// Functions involving Regions1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9_CONTAINERS_REGIONS1D +#define C_INTERFACE_PROTO_V1_9_CONTAINERS_REGIONS1D + +#include "GNDStk.h" +#include "v1.9/containers/Axes.h" +#include "v1.9/containers/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Regions1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Regions1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Regions1dClass *Regions1d; + +// --- Const-aware handles. +typedef const struct Regions1dClass *const ConstHandle2ConstRegions1d; +typedef struct Regions1dClass *const ConstHandle2Regions1d; +typedef const struct Regions1dClass * Handle2ConstRegions1d; +typedef struct Regions1dClass * Handle2Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRegions1d +Regions1dDefaultConst(); + +// +++ Create, default +extern_c Handle2Regions1d +Regions1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstRegions1d +Regions1dCreateConst( + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize +); + +// +++ Create, general +extern_c Handle2Regions1d +Regions1dCreate( + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Regions1dAssign(ConstHandle2Regions1d self, ConstHandle2ConstRegions1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Regions1dDelete(ConstHandle2ConstRegions1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Regions1dRead(ConstHandle2Regions1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Regions1dWrite(ConstHandle2ConstRegions1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Regions1dPrint(ConstHandle2ConstRegions1d self); + +// +++ Print to standard output, as XML +extern_c int +Regions1dPrintXML(ConstHandle2ConstRegions1d self); + +// +++ Print to standard output, as JSON +extern_c int +Regions1dPrintJSON(ConstHandle2ConstRegions1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions1dLabelHas(ConstHandle2ConstRegions1d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +Regions1dLabelGet(ConstHandle2ConstRegions1d self); + +// +++ Set +extern_c void +Regions1dLabelSet(ConstHandle2Regions1d self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions1dOuterDomainValueHas(ConstHandle2ConstRegions1d self); + +// +++ Get +// +++ Returns by value +extern_c double +Regions1dOuterDomainValueGet(ConstHandle2ConstRegions1d self); + +// +++ Set +extern_c void +Regions1dOuterDomainValueSet(ConstHandle2Regions1d self, const double outerDomainValue); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions1dAxesHas(ConstHandle2ConstRegions1d self); + +// --- Get, const +extern_c Handle2ConstAxes +Regions1dAxesGetConst(ConstHandle2ConstRegions1d self); + +// +++ Get, non-const +extern_c Handle2Axes +Regions1dAxesGet(ConstHandle2Regions1d self); + +// +++ Set +extern_c void +Regions1dAxesSet(ConstHandle2Regions1d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions1dXYs1dHas(ConstHandle2ConstRegions1d self); + +// +++ Clear +extern_c void +Regions1dXYs1dClear(ConstHandle2Regions1d self); + +// +++ Size +extern_c size_t +Regions1dXYs1dSize(ConstHandle2ConstRegions1d self); + +// +++ Add +extern_c void +Regions1dXYs1dAdd(ConstHandle2Regions1d self, ConstHandle2ConstXYs1d XYs1d); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstXYs1d +Regions1dXYs1dGetConst(ConstHandle2ConstRegions1d self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2XYs1d +Regions1dXYs1dGet(ConstHandle2Regions1d self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +Regions1dXYs1dSet( + ConstHandle2Regions1d self, + const size_t index_, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Has, by index +extern_c int +Regions1dXYs1dHasByIndex( + ConstHandle2ConstRegions1d self, + const int index +); + +// --- Get, by index, const +extern_c Handle2ConstXYs1d +Regions1dXYs1dGetByIndexConst( + ConstHandle2ConstRegions1d self, + const int index +); + +// +++ Get, by index, non-const +extern_c Handle2XYs1d +Regions1dXYs1dGetByIndex( + ConstHandle2Regions1d self, + const int index +); + +// +++ Set, by index +extern_c void +Regions1dXYs1dSetByIndex( + ConstHandle2Regions1d self, + const int index, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Has, by interpolation +extern_c int +Regions1dXYs1dHasByInterpolation( + ConstHandle2ConstRegions1d self, + const enums::Interpolation interpolation +); + +// --- Get, by interpolation, const +extern_c Handle2ConstXYs1d +Regions1dXYs1dGetByInterpolationConst( + ConstHandle2ConstRegions1d self, + const enums::Interpolation interpolation +); + +// +++ Get, by interpolation, non-const +extern_c Handle2XYs1d +Regions1dXYs1dGetByInterpolation( + ConstHandle2Regions1d self, + const enums::Interpolation interpolation +); + +// +++ Set, by interpolation +extern_c void +Regions1dXYs1dSetByInterpolation( + ConstHandle2Regions1d self, + const enums::Interpolation interpolation, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Has, by label +extern_c int +Regions1dXYs1dHasByLabel( + ConstHandle2ConstRegions1d self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstXYs1d +Regions1dXYs1dGetByLabelConst( + ConstHandle2ConstRegions1d self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2XYs1d +Regions1dXYs1dGetByLabel( + ConstHandle2Regions1d self, + const char *const label +); + +// +++ Set, by label +extern_c void +Regions1dXYs1dSetByLabel( + ConstHandle2Regions1d self, + const char *const label, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Has, by outerDomainValue +extern_c int +Regions1dXYs1dHasByOuterDomainValue( + ConstHandle2ConstRegions1d self, + const double outerDomainValue +); + +// --- Get, by outerDomainValue, const +extern_c Handle2ConstXYs1d +Regions1dXYs1dGetByOuterDomainValueConst( + ConstHandle2ConstRegions1d self, + const double outerDomainValue +); + +// +++ Get, by outerDomainValue, non-const +extern_c Handle2XYs1d +Regions1dXYs1dGetByOuterDomainValue( + ConstHandle2Regions1d self, + const double outerDomainValue +); + +// +++ Set, by outerDomainValue +extern_c void +Regions1dXYs1dSetByOuterDomainValue( + ConstHandle2Regions1d self, + const double outerDomainValue, + ConstHandle2ConstXYs1d XYs1d +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Regions1d/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Regions1d/src/custom.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Regions1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Regions1d/src/custom.h b/autogen/prototype/proto/c/src/v1.9/containers/Regions1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Values.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Values.cpp new file mode 100644 index 000000000..a19c8fc16 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Values.cpp @@ -0,0 +1,495 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "proto/v1.9/containers/Values.hpp" +#include "Values.h" + +using namespace njoy::GNDStk; +using namespace proto::v1_9; + +using C = ValuesClass; +using CPP = multigroup::Values; + +static const std::string CLASSNAME = "Values"; + +namespace extract { + static auto valueType = [](auto &obj) { return &obj.valueType; }; + static auto start = [](auto &obj) { return &obj.start; }; + static auto length = [](auto &obj) { return &obj.length; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstValues +ValuesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Values +ValuesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstValues +ValuesCreateConst( + const char *const valueType, + const int start, + const int length +) { + ConstHandle2Values handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + valueType, + start, + length + ); + return handle; +} + +// Create, general +Handle2Values +ValuesCreate( + const char *const valueType, + const int start, + const int length +) { + ConstHandle2Values handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + valueType, + start, + length + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ValuesAssign(ConstHandle2Values self, ConstHandle2ConstValues from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ValuesDelete(ConstHandle2ConstValues self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ValuesRead(ConstHandle2Values self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ValuesWrite(ConstHandle2ConstValues self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ValuesPrint(ConstHandle2ConstValues self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ValuesPrintXML(ConstHandle2ConstValues self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ValuesPrintJSON(ConstHandle2ConstValues self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// Clear +void +ValuesIntsClear(ConstHandle2Values self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +ValuesIntsSize(ConstHandle2ConstValues self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +ValuesIntsGet(ConstHandle2ConstValues self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +ValuesIntsSet(ConstHandle2Values self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +ValuesIntsGetArrayConst(ConstHandle2ConstValues self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +ValuesIntsGetArray(ConstHandle2Values self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +ValuesIntsSetArray(ConstHandle2Values self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + +// ------------------------ +// unsigned +// ------------------------ + +// Clear +void +ValuesUnsignedsClear(ConstHandle2Values self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"UnsignedsClear", self); +} + +// Get size +size_t +ValuesUnsignedsSize(ConstHandle2ConstValues self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"UnsignedsSize", self); +} + +// Get value +// By index \in [0,size) +unsigned +ValuesUnsignedsGet(ConstHandle2ConstValues self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +ValuesUnsignedsSet(ConstHandle2Values self, const size_t index, const unsigned value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSet", self, index, value); +} + +// Get pointer to existing values, const +const unsigned * +ValuesUnsignedsGetArrayConst(ConstHandle2ConstValues self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +unsigned * +ValuesUnsignedsGetArray(ConstHandle2Values self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"UnsignedsGetArray", self); +} + +// Set completely new values and size +void +ValuesUnsignedsSetArray(ConstHandle2Values self, const unsigned *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"UnsignedsSetArray", self, size, values); +} + +// ------------------------ +// float +// ------------------------ + +// Clear +void +ValuesFloatsClear(ConstHandle2Values self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"FloatsClear", self); +} + +// Get size +size_t +ValuesFloatsSize(ConstHandle2ConstValues self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"FloatsSize", self); +} + +// Get value +// By index \in [0,size) +float +ValuesFloatsGet(ConstHandle2ConstValues self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +ValuesFloatsSet(ConstHandle2Values self, const size_t index, const float value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSet", self, index, value); +} + +// Get pointer to existing values, const +const float * +ValuesFloatsGetArrayConst(ConstHandle2ConstValues self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +float * +ValuesFloatsGetArray(ConstHandle2Values self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"FloatsGetArray", self); +} + +// Set completely new values and size +void +ValuesFloatsSetArray(ConstHandle2Values self, const float *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"FloatsSetArray", self, size, values); +} + +// ------------------------ +// double +// ------------------------ + +// Clear +void +ValuesDoublesClear(ConstHandle2Values self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +ValuesDoublesSize(ConstHandle2ConstValues self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +ValuesDoublesGet(ConstHandle2ConstValues self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +ValuesDoublesSet(ConstHandle2Values self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +ValuesDoublesGetArrayConst(ConstHandle2ConstValues self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +ValuesDoublesGetArray(ConstHandle2Values self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +ValuesDoublesSetArray(ConstHandle2Values self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: valueType +// ----------------------------------------------------------------------------- + +// Has +int +ValuesValueTypeHas(ConstHandle2ConstValues self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueTypeHas", self, extract::valueType); +} + +// Get +// Returns by value +const char * +ValuesValueTypeGet(ConstHandle2ConstValues self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueTypeGet", self, extract::valueType); +} + +// Set +void +ValuesValueTypeSet(ConstHandle2Values self, const char *const valueType) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueTypeSet", self, extract::valueType, valueType); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: start +// ----------------------------------------------------------------------------- + +// Has +int +ValuesStartHas(ConstHandle2ConstValues self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StartHas", self, extract::start); +} + +// Get +// Returns by value +int +ValuesStartGet(ConstHandle2ConstValues self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StartGet", self, extract::start); +} + +// Set +void +ValuesStartSet(ConstHandle2Values self, const int start) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StartSet", self, extract::start, start); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: length +// ----------------------------------------------------------------------------- + +// Has +int +ValuesLengthHas(ConstHandle2ConstValues self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LengthHas", self, extract::length); +} + +// Get +// Returns by value +int +ValuesLengthGet(ConstHandle2ConstValues self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LengthGet", self, extract::length); +} + +// Set +void +ValuesLengthSet(ConstHandle2Values self, const int length) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LengthSet", self, extract::length, length); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Values/src/custom.cpp" diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Values.h b/autogen/prototype/proto/c/src/v1.9/containers/Values.h new file mode 100644 index 000000000..fefc409bb --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/Values.h @@ -0,0 +1,338 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Values is the basic handle type in this file. Example: +// // Create a default Values object: +// Values handle = ValuesDefault(); +// Functions involving Values are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9_CONTAINERS_VALUES +#define C_INTERFACE_PROTO_V1_9_CONTAINERS_VALUES + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ValuesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Values +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ValuesClass *Values; + +// --- Const-aware handles. +typedef const struct ValuesClass *const ConstHandle2ConstValues; +typedef struct ValuesClass *const ConstHandle2Values; +typedef const struct ValuesClass * Handle2ConstValues; +typedef struct ValuesClass * Handle2Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstValues +ValuesDefaultConst(); + +// +++ Create, default +extern_c Handle2Values +ValuesDefault(); + +// --- Create, general, const +extern_c Handle2ConstValues +ValuesCreateConst( + const char *const valueType, + const int start, + const int length +); + +// +++ Create, general +extern_c Handle2Values +ValuesCreate( + const char *const valueType, + const int start, + const int length +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ValuesAssign(ConstHandle2Values self, ConstHandle2ConstValues from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ValuesDelete(ConstHandle2ConstValues self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ValuesRead(ConstHandle2Values self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ValuesWrite(ConstHandle2ConstValues self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ValuesPrint(ConstHandle2ConstValues self); + +// +++ Print to standard output, as XML +extern_c int +ValuesPrintXML(ConstHandle2ConstValues self); + +// +++ Print to standard output, as JSON +extern_c int +ValuesPrintJSON(ConstHandle2ConstValues self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// ------------------------ +// int +// ------------------------ + +// +++ Clear +extern_c void +ValuesIntsClear(ConstHandle2Values self); + +// +++ Get size +extern_c size_t +ValuesIntsSize(ConstHandle2ConstValues self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +ValuesIntsGet(ConstHandle2ConstValues self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +ValuesIntsSet(ConstHandle2Values self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +ValuesIntsGetArrayConst(ConstHandle2ConstValues self); + +// +++ Get pointer to existing values, non-const +extern_c int * +ValuesIntsGetArray(ConstHandle2Values self); + +// +++ Set completely new values and size +extern_c void +ValuesIntsSetArray(ConstHandle2Values self, const int *const values, const size_t size); + +// ------------------------ +// unsigned +// ------------------------ + +// +++ Clear +extern_c void +ValuesUnsignedsClear(ConstHandle2Values self); + +// +++ Get size +extern_c size_t +ValuesUnsignedsSize(ConstHandle2ConstValues self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c unsigned +ValuesUnsignedsGet(ConstHandle2ConstValues self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +ValuesUnsignedsSet(ConstHandle2Values self, const size_t index, const unsigned value); + +// --- Get pointer to existing values, const +extern_c const unsigned * +ValuesUnsignedsGetArrayConst(ConstHandle2ConstValues self); + +// +++ Get pointer to existing values, non-const +extern_c unsigned * +ValuesUnsignedsGetArray(ConstHandle2Values self); + +// +++ Set completely new values and size +extern_c void +ValuesUnsignedsSetArray(ConstHandle2Values self, const unsigned *const values, const size_t size); + +// ------------------------ +// float +// ------------------------ + +// +++ Clear +extern_c void +ValuesFloatsClear(ConstHandle2Values self); + +// +++ Get size +extern_c size_t +ValuesFloatsSize(ConstHandle2ConstValues self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c float +ValuesFloatsGet(ConstHandle2ConstValues self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +ValuesFloatsSet(ConstHandle2Values self, const size_t index, const float value); + +// --- Get pointer to existing values, const +extern_c const float * +ValuesFloatsGetArrayConst(ConstHandle2ConstValues self); + +// +++ Get pointer to existing values, non-const +extern_c float * +ValuesFloatsGetArray(ConstHandle2Values self); + +// +++ Set completely new values and size +extern_c void +ValuesFloatsSetArray(ConstHandle2Values self, const float *const values, const size_t size); + +// ------------------------ +// double +// ------------------------ + +// +++ Clear +extern_c void +ValuesDoublesClear(ConstHandle2Values self); + +// +++ Get size +extern_c size_t +ValuesDoublesSize(ConstHandle2ConstValues self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +ValuesDoublesGet(ConstHandle2ConstValues self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +ValuesDoublesSet(ConstHandle2Values self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +ValuesDoublesGetArrayConst(ConstHandle2ConstValues self); + +// +++ Get pointer to existing values, non-const +extern_c double * +ValuesDoublesGetArray(ConstHandle2Values self); + +// +++ Set completely new values and size +extern_c void +ValuesDoublesSetArray(ConstHandle2Values self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: valueType +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ValuesValueTypeHas(ConstHandle2ConstValues self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ValuesValueTypeGet(ConstHandle2ConstValues self); + +// +++ Set +extern_c void +ValuesValueTypeSet(ConstHandle2Values self, const char *const valueType); + + +// ----------------------------------------------------------------------------- +// Metadatum: start +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ValuesStartHas(ConstHandle2ConstValues self); + +// +++ Get +// +++ Returns by value +extern_c int +ValuesStartGet(ConstHandle2ConstValues self); + +// +++ Set +extern_c void +ValuesStartSet(ConstHandle2Values self, const int start); + + +// ----------------------------------------------------------------------------- +// Metadatum: length +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ValuesLengthHas(ConstHandle2ConstValues self); + +// +++ Get +// +++ Returns by value +extern_c int +ValuesLengthGet(ConstHandle2ConstValues self); + +// +++ Set +extern_c void +ValuesLengthSet(ConstHandle2Values self, const int length); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/Values/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Values/src/custom.cpp b/autogen/prototype/proto/c/src/v1.9/containers/Values/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/Values/src/custom.h b/autogen/prototype/proto/c/src/v1.9/containers/Values/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/XYs1d.cpp b/autogen/prototype/proto/c/src/v1.9/containers/XYs1d.cpp new file mode 100644 index 000000000..cef591c4d --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/XYs1d.cpp @@ -0,0 +1,364 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "proto/v1.9/containers/XYs1d.hpp" +#include "XYs1d.h" + +using namespace njoy::GNDStk; +using namespace proto::v1_9; + +using C = XYs1dClass; +using CPP = multigroup::XYs1d; + +static const std::string CLASSNAME = "XYs1d"; + +namespace extract { + static auto index = [](auto &obj) { return &obj.index; }; + static auto interpolation = [](auto &obj) { return &obj.interpolation; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto outerDomainValue = [](auto &obj) { return &obj.outerDomainValue; }; + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPAxes = containers::Axes; +using CPPValues = containers::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstXYs1d +XYs1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2XYs1d +XYs1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstXYs1d +XYs1dCreateConst( + const int index, + const enums::Interpolation interpolation, + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +) { + ConstHandle2XYs1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + interpolation, + label, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(values) + ); + return handle; +} + +// Create, general +Handle2XYs1d +XYs1dCreate( + const int index, + const enums::Interpolation interpolation, + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +) { + ConstHandle2XYs1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + index, + interpolation, + label, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(values) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +XYs1dAssign(ConstHandle2XYs1d self, ConstHandle2ConstXYs1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +XYs1dDelete(ConstHandle2ConstXYs1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +XYs1dRead(ConstHandle2XYs1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +XYs1dWrite(ConstHandle2ConstXYs1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +XYs1dPrint(ConstHandle2ConstXYs1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +XYs1dPrintXML(ConstHandle2ConstXYs1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +XYs1dPrintJSON(ConstHandle2ConstXYs1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dIndexHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IndexHas", self, extract::index); +} + +// Get +// Returns by value +int +XYs1dIndexGet(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +XYs1dIndexSet(ConstHandle2XYs1d self, const int index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dInterpolationHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InterpolationHas", self, extract::interpolation); +} + +// Get +// Returns by value +enums::Interpolation +XYs1dInterpolationGet(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationGet", self, extract::interpolation); +} + +// Set +void +XYs1dInterpolationSet(ConstHandle2XYs1d self, const enums::Interpolation interpolation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InterpolationSet", self, extract::interpolation, interpolation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dLabelHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +XYs1dLabelGet(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +XYs1dLabelSet(ConstHandle2XYs1d self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dOuterDomainValueHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +double +XYs1dOuterDomainValueGet(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +XYs1dOuterDomainValueSet(ConstHandle2XYs1d self, const double outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dAxesHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +XYs1dAxesGetConst(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +XYs1dAxesGet(ConstHandle2XYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +XYs1dAxesSet(ConstHandle2XYs1d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dValuesHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +XYs1dValuesGetConst(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +XYs1dValuesGet(ConstHandle2XYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +XYs1dValuesSet(ConstHandle2XYs1d self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/XYs1d/src/custom.cpp" diff --git a/autogen/prototype/proto/c/src/v1.9/containers/XYs1d.h b/autogen/prototype/proto/c/src/v1.9/containers/XYs1d.h new file mode 100644 index 000000000..609d9b0da --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/containers/XYs1d.h @@ -0,0 +1,265 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// XYs1d is the basic handle type in this file. Example: +// // Create a default XYs1d object: +// XYs1d handle = XYs1dDefault(); +// Functions involving XYs1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9_CONTAINERS_XYS1D +#define C_INTERFACE_PROTO_V1_9_CONTAINERS_XYS1D + +#include "GNDStk.h" +#include "v1.9/containers/Axes.h" +#include "v1.9/containers/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct XYs1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ XYs1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct XYs1dClass *XYs1d; + +// --- Const-aware handles. +typedef const struct XYs1dClass *const ConstHandle2ConstXYs1d; +typedef struct XYs1dClass *const ConstHandle2XYs1d; +typedef const struct XYs1dClass * Handle2ConstXYs1d; +typedef struct XYs1dClass * Handle2XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstXYs1d +XYs1dDefaultConst(); + +// +++ Create, default +extern_c Handle2XYs1d +XYs1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstXYs1d +XYs1dCreateConst( + const int index, + const enums::Interpolation interpolation, + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +); + +// +++ Create, general +extern_c Handle2XYs1d +XYs1dCreate( + const int index, + const enums::Interpolation interpolation, + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +XYs1dAssign(ConstHandle2XYs1d self, ConstHandle2ConstXYs1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +XYs1dDelete(ConstHandle2ConstXYs1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +XYs1dRead(ConstHandle2XYs1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +XYs1dWrite(ConstHandle2ConstXYs1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +XYs1dPrint(ConstHandle2ConstXYs1d self); + +// +++ Print to standard output, as XML +extern_c int +XYs1dPrintXML(ConstHandle2ConstXYs1d self); + +// +++ Print to standard output, as JSON +extern_c int +XYs1dPrintJSON(ConstHandle2ConstXYs1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dIndexHas(ConstHandle2ConstXYs1d self); + +// +++ Get +// +++ Returns by value +extern_c int +XYs1dIndexGet(ConstHandle2ConstXYs1d self); + +// +++ Set +extern_c void +XYs1dIndexSet(ConstHandle2XYs1d self, const int index); + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dInterpolationHas(ConstHandle2ConstXYs1d self); + +// +++ Get +// +++ Returns by value +extern_c enums::Interpolation +XYs1dInterpolationGet(ConstHandle2ConstXYs1d self); + +// +++ Set +extern_c void +XYs1dInterpolationSet(ConstHandle2XYs1d self, const enums::Interpolation interpolation); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dLabelHas(ConstHandle2ConstXYs1d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +XYs1dLabelGet(ConstHandle2ConstXYs1d self); + +// +++ Set +extern_c void +XYs1dLabelSet(ConstHandle2XYs1d self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dOuterDomainValueHas(ConstHandle2ConstXYs1d self); + +// +++ Get +// +++ Returns by value +extern_c double +XYs1dOuterDomainValueGet(ConstHandle2ConstXYs1d self); + +// +++ Set +extern_c void +XYs1dOuterDomainValueSet(ConstHandle2XYs1d self, const double outerDomainValue); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dAxesHas(ConstHandle2ConstXYs1d self); + +// --- Get, const +extern_c Handle2ConstAxes +XYs1dAxesGetConst(ConstHandle2ConstXYs1d self); + +// +++ Get, non-const +extern_c Handle2Axes +XYs1dAxesGet(ConstHandle2XYs1d self); + +// +++ Set +extern_c void +XYs1dAxesSet(ConstHandle2XYs1d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dValuesHas(ConstHandle2ConstXYs1d self); + +// --- Get, const +extern_c Handle2ConstValues +XYs1dValuesGetConst(ConstHandle2ConstXYs1d self); + +// +++ Get, non-const +extern_c Handle2Values +XYs1dValuesGet(ConstHandle2XYs1d self); + +// +++ Set +extern_c void +XYs1dValuesSet(ConstHandle2XYs1d self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/containers/XYs1d/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/containers/XYs1d/src/custom.cpp b/autogen/prototype/proto/c/src/v1.9/containers/XYs1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/containers/XYs1d/src/custom.h b/autogen/prototype/proto/c/src/v1.9/containers/XYs1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/transport/CrossSection.cpp b/autogen/prototype/proto/c/src/v1.9/transport/CrossSection.cpp new file mode 100644 index 000000000..5d135dfe3 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/transport/CrossSection.cpp @@ -0,0 +1,140 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "proto/v1.9/transport/CrossSection.hpp" +#include "CrossSection.h" + +using namespace njoy::GNDStk; +using namespace proto::v1_9; + +using C = CrossSectionClass; +using CPP = multigroup::CrossSection; + +static const std::string CLASSNAME = "CrossSection"; + +namespace extract { +} + +using CPPXYs1d = containers::XYs1d; +using CPPRegions1d = containers::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCrossSection +CrossSectionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2CrossSection +CrossSectionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCrossSection +CrossSectionCreateConst( +) { + ConstHandle2CrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general +Handle2CrossSection +CrossSectionCreate( +) { + ConstHandle2CrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create" + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CrossSectionAssign(ConstHandle2CrossSection self, ConstHandle2ConstCrossSection from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CrossSectionDelete(ConstHandle2ConstCrossSection self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CrossSectionRead(ConstHandle2CrossSection self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CrossSectionWrite(ConstHandle2ConstCrossSection self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CrossSectionPrint(ConstHandle2ConstCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CrossSectionPrintXML(ConstHandle2ConstCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CrossSectionPrintJSON(ConstHandle2ConstCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/transport/CrossSection/src/custom.cpp" diff --git a/autogen/prototype/proto/c/src/v1.9/transport/CrossSection.h b/autogen/prototype/proto/c/src/v1.9/transport/CrossSection.h new file mode 100644 index 000000000..b4ef0e9c9 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/transport/CrossSection.h @@ -0,0 +1,139 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CrossSection is the basic handle type in this file. Example: +// // Create a default CrossSection object: +// CrossSection handle = CrossSectionDefault(); +// Functions involving CrossSection are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9_TRANSPORT_CROSSSECTION +#define C_INTERFACE_PROTO_V1_9_TRANSPORT_CROSSSECTION + +#include "GNDStk.h" +#include "v1.9/containers/XYs1d.h" +#include "v1.9/containers/Regions1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CrossSectionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CrossSection +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CrossSectionClass *CrossSection; + +// --- Const-aware handles. +typedef const struct CrossSectionClass *const ConstHandle2ConstCrossSection; +typedef struct CrossSectionClass *const ConstHandle2CrossSection; +typedef const struct CrossSectionClass * Handle2ConstCrossSection; +typedef struct CrossSectionClass * Handle2CrossSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCrossSection +CrossSectionDefaultConst(); + +// +++ Create, default +extern_c Handle2CrossSection +CrossSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstCrossSection +CrossSectionCreateConst( +); + +// +++ Create, general +extern_c Handle2CrossSection +CrossSectionCreate( +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CrossSectionAssign(ConstHandle2CrossSection self, ConstHandle2ConstCrossSection from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CrossSectionDelete(ConstHandle2ConstCrossSection self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CrossSectionRead(ConstHandle2CrossSection self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CrossSectionWrite(ConstHandle2ConstCrossSection self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CrossSectionPrint(ConstHandle2ConstCrossSection self); + +// +++ Print to standard output, as XML +extern_c int +CrossSectionPrintXML(ConstHandle2ConstCrossSection self); + +// +++ Print to standard output, as JSON +extern_c int +CrossSectionPrintJSON(ConstHandle2ConstCrossSection self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/transport/CrossSection/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/transport/CrossSection/src/custom.cpp b/autogen/prototype/proto/c/src/v1.9/transport/CrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/transport/CrossSection/src/custom.h b/autogen/prototype/proto/c/src/v1.9/transport/CrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/transport/Reaction.cpp b/autogen/prototype/proto/c/src/v1.9/transport/Reaction.cpp new file mode 100644 index 000000000..055e881f6 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/transport/Reaction.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "proto/v1.9/transport/Reaction.hpp" +#include "Reaction.h" + +using namespace njoy::GNDStk; +using namespace proto::v1_9; + +using C = ReactionClass; +using CPP = multigroup::Reaction; + +static const std::string CLASSNAME = "Reaction"; + +namespace extract { + static auto ENDF_MT = [](auto &obj) { return &obj.ENDF_MT; }; + static auto fissionGenre = [](auto &obj) { return &obj.fissionGenre; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto crossSection = [](auto &obj) { return &obj.crossSection; }; +} + +using CPPCrossSection = transport::CrossSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstReaction +ReactionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Reaction +ReactionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstReaction +ReactionCreateConst( + const int ENDF_MT, + const char *const fissionGenre, + const char *const label, + ConstHandle2ConstCrossSection crossSection +) { + ConstHandle2Reaction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MT, + fissionGenre, + label, + detail::tocpp(crossSection) + ); + return handle; +} + +// Create, general +Handle2Reaction +ReactionCreate( + const int ENDF_MT, + const char *const fissionGenre, + const char *const label, + ConstHandle2ConstCrossSection crossSection +) { + ConstHandle2Reaction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MT, + fissionGenre, + label, + detail::tocpp(crossSection) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ReactionAssign(ConstHandle2Reaction self, ConstHandle2ConstReaction from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ReactionDelete(ConstHandle2ConstReaction self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ReactionRead(ConstHandle2Reaction self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ReactionWrite(ConstHandle2ConstReaction self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ReactionPrint(ConstHandle2ConstReaction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ReactionPrintXML(ConstHandle2ConstReaction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ReactionPrintJSON(ConstHandle2ConstReaction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +ReactionENDFMTHas(ConstHandle2ConstReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +int +ReactionENDFMTGet(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +ReactionENDFMTSet(ConstHandle2Reaction self, const int ENDF_MT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMTSet", self, extract::ENDF_MT, ENDF_MT); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: fissionGenre +// ----------------------------------------------------------------------------- + +// Has +int +ReactionFissionGenreHas(ConstHandle2ConstReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FissionGenreHas", self, extract::fissionGenre); +} + +// Get +// Returns by value +const char * +ReactionFissionGenreGet(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionGenreGet", self, extract::fissionGenre); +} + +// Set +void +ReactionFissionGenreSet(ConstHandle2Reaction self, const char *const fissionGenre) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FissionGenreSet", self, extract::fissionGenre, fissionGenre); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ReactionLabelHas(ConstHandle2ConstReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ReactionLabelGet(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ReactionLabelSet(ConstHandle2Reaction self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// Has +int +ReactionCrossSectionHas(ConstHandle2ConstReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossSectionHas", self, extract::crossSection); +} + +// Get, const +Handle2ConstCrossSection +ReactionCrossSectionGetConst(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGetConst", self, extract::crossSection); +} + +// Get, non-const +Handle2CrossSection +ReactionCrossSectionGet(ConstHandle2Reaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGet", self, extract::crossSection); +} + +// Set +void +ReactionCrossSectionSet(ConstHandle2Reaction self, ConstHandle2ConstCrossSection crossSection) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CrossSectionSet", self, extract::crossSection, crossSection); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/transport/Reaction/src/custom.cpp" diff --git a/autogen/prototype/proto/c/src/v1.9/transport/Reaction.h b/autogen/prototype/proto/c/src/v1.9/transport/Reaction.h new file mode 100644 index 000000000..564b14471 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/transport/Reaction.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Reaction is the basic handle type in this file. Example: +// // Create a default Reaction object: +// Reaction handle = ReactionDefault(); +// Functions involving Reaction are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9_TRANSPORT_REACTION +#define C_INTERFACE_PROTO_V1_9_TRANSPORT_REACTION + +#include "GNDStk.h" +#include "v1.9/transport/CrossSection.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ReactionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Reaction +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ReactionClass *Reaction; + +// --- Const-aware handles. +typedef const struct ReactionClass *const ConstHandle2ConstReaction; +typedef struct ReactionClass *const ConstHandle2Reaction; +typedef const struct ReactionClass * Handle2ConstReaction; +typedef struct ReactionClass * Handle2Reaction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstReaction +ReactionDefaultConst(); + +// +++ Create, default +extern_c Handle2Reaction +ReactionDefault(); + +// --- Create, general, const +extern_c Handle2ConstReaction +ReactionCreateConst( + const int ENDF_MT, + const char *const fissionGenre, + const char *const label, + ConstHandle2ConstCrossSection crossSection +); + +// +++ Create, general +extern_c Handle2Reaction +ReactionCreate( + const int ENDF_MT, + const char *const fissionGenre, + const char *const label, + ConstHandle2ConstCrossSection crossSection +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ReactionAssign(ConstHandle2Reaction self, ConstHandle2ConstReaction from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ReactionDelete(ConstHandle2ConstReaction self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ReactionRead(ConstHandle2Reaction self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ReactionWrite(ConstHandle2ConstReaction self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ReactionPrint(ConstHandle2ConstReaction self); + +// +++ Print to standard output, as XML +extern_c int +ReactionPrintXML(ConstHandle2ConstReaction self); + +// +++ Print to standard output, as JSON +extern_c int +ReactionPrintJSON(ConstHandle2ConstReaction self); + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionENDFMTHas(ConstHandle2ConstReaction self); + +// +++ Get +// +++ Returns by value +extern_c int +ReactionENDFMTGet(ConstHandle2ConstReaction self); + +// +++ Set +extern_c void +ReactionENDFMTSet(ConstHandle2Reaction self, const int ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Metadatum: fissionGenre +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionFissionGenreHas(ConstHandle2ConstReaction self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionFissionGenreGet(ConstHandle2ConstReaction self); + +// +++ Set +extern_c void +ReactionFissionGenreSet(ConstHandle2Reaction self, const char *const fissionGenre); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionLabelHas(ConstHandle2ConstReaction self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionLabelGet(ConstHandle2ConstReaction self); + +// +++ Set +extern_c void +ReactionLabelSet(ConstHandle2Reaction self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionCrossSectionHas(ConstHandle2ConstReaction self); + +// --- Get, const +extern_c Handle2ConstCrossSection +ReactionCrossSectionGetConst(ConstHandle2ConstReaction self); + +// +++ Get, non-const +extern_c Handle2CrossSection +ReactionCrossSectionGet(ConstHandle2Reaction self); + +// +++ Set +extern_c void +ReactionCrossSectionSet(ConstHandle2Reaction self, ConstHandle2ConstCrossSection crossSection); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/transport/Reaction/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/transport/Reaction/src/custom.cpp b/autogen/prototype/proto/c/src/v1.9/transport/Reaction/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/transport/Reaction/src/custom.h b/autogen/prototype/proto/c/src/v1.9/transport/Reaction/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/transport/ReactionSuite.cpp b/autogen/prototype/proto/c/src/v1.9/transport/ReactionSuite.cpp new file mode 100644 index 000000000..60fd786c7 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/transport/ReactionSuite.cpp @@ -0,0 +1,391 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "proto/v1.9/transport/ReactionSuite.hpp" +#include "ReactionSuite.h" + +using namespace njoy::GNDStk; +using namespace proto::v1_9; + +using C = ReactionSuiteClass; +using CPP = multigroup::ReactionSuite; + +static const std::string CLASSNAME = "ReactionSuite"; + +namespace extract { + static auto evaluation = [](auto &obj) { return &obj.evaluation; }; + static auto format = [](auto &obj) { return &obj.format; }; + static auto projectile = [](auto &obj) { return &obj.projectile; }; + static auto projectileFrame = [](auto &obj) { return &obj.projectileFrame; }; + static auto target = [](auto &obj) { return &obj.target; }; + static auto interaction = [](auto &obj) { return &obj.interaction; }; + static auto reactions = [](auto &obj) { return &obj.reactions; }; +} + +using CPPReactions = transport::Reactions; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstReactionSuite +ReactionSuiteDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2ReactionSuite +ReactionSuiteDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstReactionSuite +ReactionSuiteCreateConst( + const char *const evaluation, + const char *const format, + const char *const projectile, + const enums::Frame projectileFrame, + const char *const target, + const enums::Interaction interaction, + ConstHandle2ConstReactions reactions +) { + ConstHandle2ReactionSuite handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + evaluation, + format, + projectile, + projectileFrame, + target, + interaction, + detail::tocpp(reactions) + ); + return handle; +} + +// Create, general +Handle2ReactionSuite +ReactionSuiteCreate( + const char *const evaluation, + const char *const format, + const char *const projectile, + const enums::Frame projectileFrame, + const char *const target, + const enums::Interaction interaction, + ConstHandle2ConstReactions reactions +) { + ConstHandle2ReactionSuite handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + evaluation, + format, + projectile, + projectileFrame, + target, + interaction, + detail::tocpp(reactions) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ReactionSuiteAssign(ConstHandle2ReactionSuite self, ConstHandle2ConstReactionSuite from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ReactionSuiteDelete(ConstHandle2ConstReactionSuite self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ReactionSuiteRead(ConstHandle2ReactionSuite self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ReactionSuiteWrite(ConstHandle2ConstReactionSuite self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ReactionSuitePrint(ConstHandle2ConstReactionSuite self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ReactionSuitePrintXML(ConstHandle2ConstReactionSuite self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ReactionSuitePrintJSON(ConstHandle2ConstReactionSuite self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: evaluation +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteEvaluationHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EvaluationHas", self, extract::evaluation); +} + +// Get +// Returns by value +const char * +ReactionSuiteEvaluationGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaluationGet", self, extract::evaluation); +} + +// Set +void +ReactionSuiteEvaluationSet(ConstHandle2ReactionSuite self, const char *const evaluation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EvaluationSet", self, extract::evaluation, evaluation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteFormatHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FormatHas", self, extract::format); +} + +// Get +// Returns by value +const char * +ReactionSuiteFormatGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FormatGet", self, extract::format); +} + +// Set +void +ReactionSuiteFormatSet(ConstHandle2ReactionSuite self, const char *const format) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FormatSet", self, extract::format, format); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteProjectileHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProjectileHas", self, extract::projectile); +} + +// Get +// Returns by value +const char * +ReactionSuiteProjectileGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileGet", self, extract::projectile); +} + +// Set +void +ReactionSuiteProjectileSet(ConstHandle2ReactionSuite self, const char *const projectile) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProjectileSet", self, extract::projectile, projectile); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: projectileFrame +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteProjectileFrameHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProjectileFrameHas", self, extract::projectileFrame); +} + +// Get +// Returns by value +enums::Frame +ReactionSuiteProjectileFrameGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileFrameGet", self, extract::projectileFrame); +} + +// Set +void +ReactionSuiteProjectileFrameSet(ConstHandle2ReactionSuite self, const enums::Frame projectileFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProjectileFrameSet", self, extract::projectileFrame, projectileFrame); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: target +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteTargetHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TargetHas", self, extract::target); +} + +// Get +// Returns by value +const char * +ReactionSuiteTargetGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TargetGet", self, extract::target); +} + +// Set +void +ReactionSuiteTargetSet(ConstHandle2ReactionSuite self, const char *const target) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TargetSet", self, extract::target, target); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteInteractionHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InteractionHas", self, extract::interaction); +} + +// Get +// Returns by value +enums::Interaction +ReactionSuiteInteractionGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InteractionGet", self, extract::interaction); +} + +// Set +void +ReactionSuiteInteractionSet(ConstHandle2ReactionSuite self, const enums::Interaction interaction) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InteractionSet", self, extract::interaction, interaction); +} + + +// ----------------------------------------------------------------------------- +// Child: reactions +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteReactionsHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ReactionsHas", self, extract::reactions); +} + +// Get, const +Handle2ConstReactions +ReactionSuiteReactionsGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReactionsGetConst", self, extract::reactions); +} + +// Get, non-const +Handle2Reactions +ReactionSuiteReactionsGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReactionsGet", self, extract::reactions); +} + +// Set +void +ReactionSuiteReactionsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstReactions reactions) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ReactionsSet", self, extract::reactions, reactions); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/transport/ReactionSuite/src/custom.cpp" diff --git a/autogen/prototype/proto/c/src/v1.9/transport/ReactionSuite.h b/autogen/prototype/proto/c/src/v1.9/transport/ReactionSuite.h new file mode 100644 index 000000000..87b16f838 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/transport/ReactionSuite.h @@ -0,0 +1,281 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ReactionSuite is the basic handle type in this file. Example: +// // Create a default ReactionSuite object: +// ReactionSuite handle = ReactionSuiteDefault(); +// Functions involving ReactionSuite are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9_TRANSPORT_REACTIONSUITE +#define C_INTERFACE_PROTO_V1_9_TRANSPORT_REACTIONSUITE + +#include "GNDStk.h" +#include "v1.9/transport/Reactions.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ReactionSuiteClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ReactionSuite +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ReactionSuiteClass *ReactionSuite; + +// --- Const-aware handles. +typedef const struct ReactionSuiteClass *const ConstHandle2ConstReactionSuite; +typedef struct ReactionSuiteClass *const ConstHandle2ReactionSuite; +typedef const struct ReactionSuiteClass * Handle2ConstReactionSuite; +typedef struct ReactionSuiteClass * Handle2ReactionSuite; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstReactionSuite +ReactionSuiteDefaultConst(); + +// +++ Create, default +extern_c Handle2ReactionSuite +ReactionSuiteDefault(); + +// --- Create, general, const +extern_c Handle2ConstReactionSuite +ReactionSuiteCreateConst( + const char *const evaluation, + const char *const format, + const char *const projectile, + const enums::Frame projectileFrame, + const char *const target, + const enums::Interaction interaction, + ConstHandle2ConstReactions reactions +); + +// +++ Create, general +extern_c Handle2ReactionSuite +ReactionSuiteCreate( + const char *const evaluation, + const char *const format, + const char *const projectile, + const enums::Frame projectileFrame, + const char *const target, + const enums::Interaction interaction, + ConstHandle2ConstReactions reactions +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ReactionSuiteAssign(ConstHandle2ReactionSuite self, ConstHandle2ConstReactionSuite from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ReactionSuiteDelete(ConstHandle2ConstReactionSuite self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ReactionSuiteRead(ConstHandle2ReactionSuite self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ReactionSuiteWrite(ConstHandle2ConstReactionSuite self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ReactionSuitePrint(ConstHandle2ConstReactionSuite self); + +// +++ Print to standard output, as XML +extern_c int +ReactionSuitePrintXML(ConstHandle2ConstReactionSuite self); + +// +++ Print to standard output, as JSON +extern_c int +ReactionSuitePrintJSON(ConstHandle2ConstReactionSuite self); + + +// ----------------------------------------------------------------------------- +// Metadatum: evaluation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteEvaluationHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionSuiteEvaluationGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteEvaluationSet(ConstHandle2ReactionSuite self, const char *const evaluation); + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteFormatHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionSuiteFormatGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteFormatSet(ConstHandle2ReactionSuite self, const char *const format); + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteProjectileHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionSuiteProjectileGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteProjectileSet(ConstHandle2ReactionSuite self, const char *const projectile); + + +// ----------------------------------------------------------------------------- +// Metadatum: projectileFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteProjectileFrameHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c enums::Frame +ReactionSuiteProjectileFrameGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteProjectileFrameSet(ConstHandle2ReactionSuite self, const enums::Frame projectileFrame); + + +// ----------------------------------------------------------------------------- +// Metadatum: target +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteTargetHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionSuiteTargetGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteTargetSet(ConstHandle2ReactionSuite self, const char *const target); + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteInteractionHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c enums::Interaction +ReactionSuiteInteractionGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteInteractionSet(ConstHandle2ReactionSuite self, const enums::Interaction interaction); + + +// ----------------------------------------------------------------------------- +// Child: reactions +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteReactionsHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstReactions +ReactionSuiteReactionsGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2Reactions +ReactionSuiteReactionsGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteReactionsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstReactions reactions); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/transport/ReactionSuite/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/transport/ReactionSuite/src/custom.cpp b/autogen/prototype/proto/c/src/v1.9/transport/ReactionSuite/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/transport/ReactionSuite/src/custom.h b/autogen/prototype/proto/c/src/v1.9/transport/ReactionSuite/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/transport/Reactions.cpp b/autogen/prototype/proto/c/src/v1.9/transport/Reactions.cpp new file mode 100644 index 000000000..5f38797bd --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/transport/Reactions.cpp @@ -0,0 +1,347 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "proto/v1.9/transport/Reactions.hpp" +#include "Reactions.h" + +using namespace njoy::GNDStk; +using namespace proto::v1_9; + +using C = ReactionsClass; +using CPP = multigroup::Reactions; + +static const std::string CLASSNAME = "Reactions"; + +namespace extract { + static auto reaction = [](auto &obj) { return &obj.reaction; }; +} + +using CPPReaction = transport::Reaction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstReactions +ReactionsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Reactions +ReactionsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstReactions +ReactionsCreateConst( + ConstHandle2Reaction *const reaction, const size_t reactionSize +) { + ConstHandle2Reactions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ReactionN = 0; ReactionN < reactionSize; ++ReactionN) + ReactionsReactionAdd(handle, reaction[ReactionN]); + return handle; +} + +// Create, general +Handle2Reactions +ReactionsCreate( + ConstHandle2Reaction *const reaction, const size_t reactionSize +) { + ConstHandle2Reactions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ReactionN = 0; ReactionN < reactionSize; ++ReactionN) + ReactionsReactionAdd(handle, reaction[ReactionN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ReactionsAssign(ConstHandle2Reactions self, ConstHandle2ConstReactions from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ReactionsDelete(ConstHandle2ConstReactions self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ReactionsRead(ConstHandle2Reactions self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ReactionsWrite(ConstHandle2ConstReactions self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ReactionsPrint(ConstHandle2ConstReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ReactionsPrintXML(ConstHandle2ConstReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ReactionsPrintJSON(ConstHandle2ConstReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: reaction +// ----------------------------------------------------------------------------- + +// Has +int +ReactionsReactionHas(ConstHandle2ConstReactions self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ReactionHas", self, extract::reaction); +} + +// Clear +void +ReactionsReactionClear(ConstHandle2Reactions self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ReactionClear", self, extract::reaction); +} + +// Size +size_t +ReactionsReactionSize(ConstHandle2ConstReactions self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ReactionSize", self, extract::reaction); +} + +// Add +void +ReactionsReactionAdd(ConstHandle2Reactions self, ConstHandle2ConstReaction reaction) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ReactionAdd", self, extract::reaction, reaction); +} + +// Get, by index \in [0,size), const +Handle2ConstReaction +ReactionsReactionGetConst(ConstHandle2ConstReactions self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ReactionGetConst", self, extract::reaction, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Reaction +ReactionsReactionGet(ConstHandle2Reactions self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ReactionGet", self, extract::reaction, index_); +} + +// Set, by index \in [0,size) +void +ReactionsReactionSet( + ConstHandle2Reactions self, + const size_t index_, + ConstHandle2ConstReaction reaction +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ReactionSet", self, extract::reaction, index_, reaction); +} + +// Has, by ENDF_MT +int +ReactionsReactionHasByENDFMT( + ConstHandle2ConstReactions self, + const int ENDF_MT +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ReactionHasByENDFMT", + self, extract::reaction, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, const +Handle2ConstReaction +ReactionsReactionGetByENDFMTConst( + ConstHandle2ConstReactions self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByENDFMTConst", + self, extract::reaction, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, non-const +Handle2Reaction +ReactionsReactionGetByENDFMT( + ConstHandle2Reactions self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByENDFMT", + self, extract::reaction, meta::ENDF_MT, ENDF_MT); +} + +// Set, by ENDF_MT +void +ReactionsReactionSetByENDFMT( + ConstHandle2Reactions self, + const int ENDF_MT, + ConstHandle2ConstReaction reaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ReactionSetByENDFMT", + self, extract::reaction, meta::ENDF_MT, ENDF_MT, reaction); +} + +// Has, by fissionGenre +int +ReactionsReactionHasByFissionGenre( + ConstHandle2ConstReactions self, + const char *const fissionGenre +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ReactionHasByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, const +Handle2ConstReaction +ReactionsReactionGetByFissionGenreConst( + ConstHandle2ConstReactions self, + const char *const fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByFissionGenreConst", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, non-const +Handle2Reaction +ReactionsReactionGetByFissionGenre( + ConstHandle2Reactions self, + const char *const fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Set, by fissionGenre +void +ReactionsReactionSetByFissionGenre( + ConstHandle2Reactions self, + const char *const fissionGenre, + ConstHandle2ConstReaction reaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ReactionSetByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre, reaction); +} + +// Has, by label +int +ReactionsReactionHasByLabel( + ConstHandle2ConstReactions self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ReactionHasByLabel", + self, extract::reaction, meta::label, label); +} + +// Get, by label, const +Handle2ConstReaction +ReactionsReactionGetByLabelConst( + ConstHandle2ConstReactions self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByLabelConst", + self, extract::reaction, meta::label, label); +} + +// Get, by label, non-const +Handle2Reaction +ReactionsReactionGetByLabel( + ConstHandle2Reactions self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByLabel", + self, extract::reaction, meta::label, label); +} + +// Set, by label +void +ReactionsReactionSetByLabel( + ConstHandle2Reactions self, + const char *const label, + ConstHandle2ConstReaction reaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ReactionSetByLabel", + self, extract::reaction, meta::label, label, reaction); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/transport/Reactions/src/custom.cpp" diff --git a/autogen/prototype/proto/c/src/v1.9/transport/Reactions.h b/autogen/prototype/proto/c/src/v1.9/transport/Reactions.h new file mode 100644 index 000000000..20d9c21d5 --- /dev/null +++ b/autogen/prototype/proto/c/src/v1.9/transport/Reactions.h @@ -0,0 +1,264 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Reactions is the basic handle type in this file. Example: +// // Create a default Reactions object: +// Reactions handle = ReactionsDefault(); +// Functions involving Reactions are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_PROTO_V1_9_TRANSPORT_REACTIONS +#define C_INTERFACE_PROTO_V1_9_TRANSPORT_REACTIONS + +#include "GNDStk.h" +#include "v1.9/transport/Reaction.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ReactionsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Reactions +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ReactionsClass *Reactions; + +// --- Const-aware handles. +typedef const struct ReactionsClass *const ConstHandle2ConstReactions; +typedef struct ReactionsClass *const ConstHandle2Reactions; +typedef const struct ReactionsClass * Handle2ConstReactions; +typedef struct ReactionsClass * Handle2Reactions; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstReactions +ReactionsDefaultConst(); + +// +++ Create, default +extern_c Handle2Reactions +ReactionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstReactions +ReactionsCreateConst( + ConstHandle2Reaction *const reaction, const size_t reactionSize +); + +// +++ Create, general +extern_c Handle2Reactions +ReactionsCreate( + ConstHandle2Reaction *const reaction, const size_t reactionSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ReactionsAssign(ConstHandle2Reactions self, ConstHandle2ConstReactions from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ReactionsDelete(ConstHandle2ConstReactions self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ReactionsRead(ConstHandle2Reactions self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ReactionsWrite(ConstHandle2ConstReactions self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ReactionsPrint(ConstHandle2ConstReactions self); + +// +++ Print to standard output, as XML +extern_c int +ReactionsPrintXML(ConstHandle2ConstReactions self); + +// +++ Print to standard output, as JSON +extern_c int +ReactionsPrintJSON(ConstHandle2ConstReactions self); + + +// ----------------------------------------------------------------------------- +// Child: reaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionsReactionHas(ConstHandle2ConstReactions self); + +// +++ Clear +extern_c void +ReactionsReactionClear(ConstHandle2Reactions self); + +// +++ Size +extern_c size_t +ReactionsReactionSize(ConstHandle2ConstReactions self); + +// +++ Add +extern_c void +ReactionsReactionAdd(ConstHandle2Reactions self, ConstHandle2ConstReaction reaction); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstReaction +ReactionsReactionGetConst(ConstHandle2ConstReactions self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Reaction +ReactionsReactionGet(ConstHandle2Reactions self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ReactionsReactionSet( + ConstHandle2Reactions self, + const size_t index_, + ConstHandle2ConstReaction reaction +); + +// +++ Has, by ENDF_MT +extern_c int +ReactionsReactionHasByENDFMT( + ConstHandle2ConstReactions self, + const int ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstReaction +ReactionsReactionGetByENDFMTConst( + ConstHandle2ConstReactions self, + const int ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2Reaction +ReactionsReactionGetByENDFMT( + ConstHandle2Reactions self, + const int ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +ReactionsReactionSetByENDFMT( + ConstHandle2Reactions self, + const int ENDF_MT, + ConstHandle2ConstReaction reaction +); + +// +++ Has, by fissionGenre +extern_c int +ReactionsReactionHasByFissionGenre( + ConstHandle2ConstReactions self, + const char *const fissionGenre +); + +// --- Get, by fissionGenre, const +extern_c Handle2ConstReaction +ReactionsReactionGetByFissionGenreConst( + ConstHandle2ConstReactions self, + const char *const fissionGenre +); + +// +++ Get, by fissionGenre, non-const +extern_c Handle2Reaction +ReactionsReactionGetByFissionGenre( + ConstHandle2Reactions self, + const char *const fissionGenre +); + +// +++ Set, by fissionGenre +extern_c void +ReactionsReactionSetByFissionGenre( + ConstHandle2Reactions self, + const char *const fissionGenre, + ConstHandle2ConstReaction reaction +); + +// +++ Has, by label +extern_c int +ReactionsReactionHasByLabel( + ConstHandle2ConstReactions self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstReaction +ReactionsReactionGetByLabelConst( + ConstHandle2ConstReactions self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Reaction +ReactionsReactionGetByLabel( + ConstHandle2Reactions self, + const char *const label +); + +// +++ Set, by label +extern_c void +ReactionsReactionSetByLabel( + ConstHandle2Reactions self, + const char *const label, + ConstHandle2ConstReaction reaction +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1.9/transport/Reactions/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/prototype/proto/c/src/v1.9/transport/Reactions/src/custom.cpp b/autogen/prototype/proto/c/src/v1.9/transport/Reactions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/c/src/v1.9/transport/Reactions/src/custom.h b/autogen/prototype/proto/c/src/v1.9/transport/Reactions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/prototype/proto/fortran/src/v1.9/containers/Axes.f03 b/autogen/prototype/proto/fortran/src/v1.9/containers/Axes.f03 new file mode 100644 index 000000000..f54f4e885 --- /dev/null +++ b/autogen/prototype/proto/fortran/src/v1.9/containers/Axes.f03 @@ -0,0 +1,167 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module containersAxes +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AxesDefaultConst() & + bind(C, name='AxesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AxesDefaultConst +end function AxesDefaultConst + +!! Create, default +function AxesDefault() & + bind(C, name='AxesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AxesDefault +end function AxesDefault + +!! Create, general, const +function AxesCreateConst( & + href, & + hrefSize & +) & + bind(C, name='AxesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: AxesCreateConst +end function AxesCreateConst + +!! Create, general +function AxesCreate( & + href, & + hrefSize & +) & + bind(C, name='AxesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: AxesCreate +end function AxesCreate + +!! Assign +subroutine AxesAssign(handleLHS, handleRHS) & + bind(C, name='AxesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS, handleRHS +end subroutine AxesAssign + +!! Delete +subroutine AxesDelete(handle) & + bind(C, name='AxesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AxesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +function AxesRead(handle, filename, filenameSize) & + bind(C, name='AxesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AxesRead +end function AxesRead + +!! Write to file +function AxesWrite(handle, filename, filenameSize) & + bind(C, name='AxesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AxesWrite +end function AxesWrite + +!! Print to standard output, in our prettyprinting format +function AxesPrint(handle) & + bind(C, name='AxesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxesPrint +end function AxesPrint + +!! Print to standard output, as XML +function AxesPrintXML(handle) & + bind(C, name='AxesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxesPrintXML +end function AxesPrintXML + +!! Print to standard output, as JSON +function AxesPrintJSON(handle) & + bind(C, name='AxesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxesPrintJSON +end function AxesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function AxesHrefHas(handle) & + bind(C, name='AxesHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxesHrefHas +end function AxesHrefHas + +!! Get +function AxesHrefGet(handle) & + bind(C, name='AxesHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AxesHrefGet +end function AxesHrefGet + +!! Set +subroutine AxesHrefSet(handle, href, hrefSize) & + bind(C, name='AxesHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine AxesHrefSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module containersAxes diff --git a/autogen/prototype/proto/fortran/src/v1.9/containers/Axis.f03 b/autogen/prototype/proto/fortran/src/v1.9/containers/Axis.f03 new file mode 100644 index 000000000..3f3a4945d --- /dev/null +++ b/autogen/prototype/proto/fortran/src/v1.9/containers/Axis.f03 @@ -0,0 +1,245 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module containersAxis +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AxisDefaultConst() & + bind(C, name='AxisDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AxisDefaultConst +end function AxisDefaultConst + +!! Create, default +function AxisDefault() & + bind(C, name='AxisDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AxisDefault +end function AxisDefault + +!! Create, general, const +function AxisCreateConst( & + index, & + label, & + unit, & + labelSize, & + unitSize & +) & + bind(C, name='AxisCreateConst') + use iso_c_binding + implicit none + integer(c_int), value, intent(in) :: index + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: AxisCreateConst +end function AxisCreateConst + +!! Create, general +function AxisCreate( & + index, & + label, & + unit, & + labelSize, & + unitSize & +) & + bind(C, name='AxisCreate') + use iso_c_binding + implicit none + integer(c_int), value, intent(in) :: index + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: AxisCreate +end function AxisCreate + +!! Assign +subroutine AxisAssign(handleLHS, handleRHS) & + bind(C, name='AxisAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS, handleRHS +end subroutine AxisAssign + +!! Delete +subroutine AxisDelete(handle) & + bind(C, name='AxisDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AxisDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +function AxisRead(handle, filename, filenameSize) & + bind(C, name='AxisRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AxisRead +end function AxisRead + +!! Write to file +function AxisWrite(handle, filename, filenameSize) & + bind(C, name='AxisWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AxisWrite +end function AxisWrite + +!! Print to standard output, in our prettyprinting format +function AxisPrint(handle) & + bind(C, name='AxisPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisPrint +end function AxisPrint + +!! Print to standard output, as XML +function AxisPrintXML(handle) & + bind(C, name='AxisPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisPrintXML +end function AxisPrintXML + +!! Print to standard output, as JSON +function AxisPrintJSON(handle) & + bind(C, name='AxisPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisPrintJSON +end function AxisPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: index +!! ----------------------------------------------------------------------------- + +!! Has +function AxisIndexHas(handle) & + bind(C, name='AxisIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisIndexHas +end function AxisIndexHas + +!! Get +function AxisIndexGet(handle) & + bind(C, name='AxisIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisIndexGet +end function AxisIndexGet + +!! Set +subroutine AxisIndexSet(handle, index, indexSize) & + bind(C, name='AxisIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: indexSize + character(c_char), intent(in) :: index(indexSize) +end subroutine AxisIndexSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function AxisLabelHas(handle) & + bind(C, name='AxisLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisLabelHas +end function AxisLabelHas + +!! Get +function AxisLabelGet(handle) & + bind(C, name='AxisLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AxisLabelGet +end function AxisLabelGet + +!! Set +subroutine AxisLabelSet(handle, label, labelSize) & + bind(C, name='AxisLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine AxisLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function AxisUnitHas(handle) & + bind(C, name='AxisUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisUnitHas +end function AxisUnitHas + +!! Get +function AxisUnitGet(handle) & + bind(C, name='AxisUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AxisUnitGet +end function AxisUnitGet + +!! Set +subroutine AxisUnitSet(handle, unit, unitSize) & + bind(C, name='AxisUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine AxisUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module containersAxis diff --git a/autogen/prototype/proto/fortran/src/v1.9/containers/Grid.f03 b/autogen/prototype/proto/fortran/src/v1.9/containers/Grid.f03 new file mode 100644 index 000000000..b86fc3b05 --- /dev/null +++ b/autogen/prototype/proto/fortran/src/v1.9/containers/Grid.f03 @@ -0,0 +1,319 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module containersGrid +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function GridDefaultConst() & + bind(C, name='GridDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: GridDefaultConst +end function GridDefaultConst + +!! Create, default +function GridDefault() & + bind(C, name='GridDefault') + use iso_c_binding + implicit none + type(c_ptr) :: GridDefault +end function GridDefault + +!! Create, general, const +function GridCreateConst( & + index, & + interpolation, & + label, & + style, & + unit, & + labelSize, & + unitSize & +) & + bind(C, name='GridCreateConst') + use iso_c_binding + implicit none + integer(c_int), value, intent(in) :: index + unknownType, value, intent(in) :: interpolation + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + unknownType, value, intent(in) :: style + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: GridCreateConst +end function GridCreateConst + +!! Create, general +function GridCreate( & + index, & + interpolation, & + label, & + style, & + unit, & + labelSize, & + unitSize & +) & + bind(C, name='GridCreate') + use iso_c_binding + implicit none + integer(c_int), value, intent(in) :: index + unknownType, value, intent(in) :: interpolation + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + unknownType, value, intent(in) :: style + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: GridCreate +end function GridCreate + +!! Assign +subroutine GridAssign(handleLHS, handleRHS) & + bind(C, name='GridAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS, handleRHS +end subroutine GridAssign + +!! Delete +subroutine GridDelete(handle) & + bind(C, name='GridDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine GridDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +function GridRead(handle, filename, filenameSize) & + bind(C, name='GridRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GridRead +end function GridRead + +!! Write to file +function GridWrite(handle, filename, filenameSize) & + bind(C, name='GridWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GridWrite +end function GridWrite + +!! Print to standard output, in our prettyprinting format +function GridPrint(handle) & + bind(C, name='GridPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridPrint +end function GridPrint + +!! Print to standard output, as XML +function GridPrintXML(handle) & + bind(C, name='GridPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridPrintXML +end function GridPrintXML + +!! Print to standard output, as JSON +function GridPrintJSON(handle) & + bind(C, name='GridPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridPrintJSON +end function GridPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: index +!! ----------------------------------------------------------------------------- + +!! Has +function GridIndexHas(handle) & + bind(C, name='GridIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridIndexHas +end function GridIndexHas + +!! Get +function GridIndexGet(handle) & + bind(C, name='GridIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridIndexGet +end function GridIndexGet + +!! Set +subroutine GridIndexSet(handle, index, indexSize) & + bind(C, name='GridIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: indexSize + character(c_char), intent(in) :: index(indexSize) +end subroutine GridIndexSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: interpolation +!! ----------------------------------------------------------------------------- + +!! Has +function GridInterpolationHas(handle) & + bind(C, name='GridInterpolationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridInterpolationHas +end function GridInterpolationHas + +!! Get +function GridInterpolationGet(handle) & + bind(C, name='GridInterpolationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + unknownType :: GridInterpolationGet +end function GridInterpolationGet + +!! Set +subroutine GridInterpolationSet(handle, interpolation, interpolationSize) & + bind(C, name='GridInterpolationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: interpolationSize + character(c_char), intent(in) :: interpolation(interpolationSize) +end subroutine GridInterpolationSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function GridLabelHas(handle) & + bind(C, name='GridLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridLabelHas +end function GridLabelHas + +!! Get +function GridLabelGet(handle) & + bind(C, name='GridLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GridLabelGet +end function GridLabelGet + +!! Set +subroutine GridLabelSet(handle, label, labelSize) & + bind(C, name='GridLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine GridLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: style +!! ----------------------------------------------------------------------------- + +!! Has +function GridStyleHas(handle) & + bind(C, name='GridStyleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridStyleHas +end function GridStyleHas + +!! Get +function GridStyleGet(handle) & + bind(C, name='GridStyleGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + unknownType :: GridStyleGet +end function GridStyleGet + +!! Set +subroutine GridStyleSet(handle, style, styleSize) & + bind(C, name='GridStyleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: styleSize + character(c_char), intent(in) :: style(styleSize) +end subroutine GridStyleSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function GridUnitHas(handle) & + bind(C, name='GridUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridUnitHas +end function GridUnitHas + +!! Get +function GridUnitGet(handle) & + bind(C, name='GridUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GridUnitGet +end function GridUnitGet + +!! Set +subroutine GridUnitSet(handle, unit, unitSize) & + bind(C, name='GridUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine GridUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module containersGrid diff --git a/autogen/prototype/proto/fortran/src/v1.9/containers/Link.f03 b/autogen/prototype/proto/fortran/src/v1.9/containers/Link.f03 new file mode 100644 index 000000000..2171d3290 --- /dev/null +++ b/autogen/prototype/proto/fortran/src/v1.9/containers/Link.f03 @@ -0,0 +1,167 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module containersLink +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function LinkDefaultConst() & + bind(C, name='LinkDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: LinkDefaultConst +end function LinkDefaultConst + +!! Create, default +function LinkDefault() & + bind(C, name='LinkDefault') + use iso_c_binding + implicit none + type(c_ptr) :: LinkDefault +end function LinkDefault + +!! Create, general, const +function LinkCreateConst( & + href, & + hrefSize & +) & + bind(C, name='LinkCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: LinkCreateConst +end function LinkCreateConst + +!! Create, general +function LinkCreate( & + href, & + hrefSize & +) & + bind(C, name='LinkCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: LinkCreate +end function LinkCreate + +!! Assign +subroutine LinkAssign(handleLHS, handleRHS) & + bind(C, name='LinkAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS, handleRHS +end subroutine LinkAssign + +!! Delete +subroutine LinkDelete(handle) & + bind(C, name='LinkDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LinkDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +function LinkRead(handle, filename, filenameSize) & + bind(C, name='LinkRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LinkRead +end function LinkRead + +!! Write to file +function LinkWrite(handle, filename, filenameSize) & + bind(C, name='LinkWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LinkWrite +end function LinkWrite + +!! Print to standard output, in our prettyprinting format +function LinkPrint(handle) & + bind(C, name='LinkPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LinkPrint +end function LinkPrint + +!! Print to standard output, as XML +function LinkPrintXML(handle) & + bind(C, name='LinkPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LinkPrintXML +end function LinkPrintXML + +!! Print to standard output, as JSON +function LinkPrintJSON(handle) & + bind(C, name='LinkPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LinkPrintJSON +end function LinkPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function LinkHrefHas(handle) & + bind(C, name='LinkHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LinkHrefHas +end function LinkHrefHas + +!! Get +function LinkHrefGet(handle) & + bind(C, name='LinkHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LinkHrefGet +end function LinkHrefGet + +!! Set +subroutine LinkHrefSet(handle, href, hrefSize) & + bind(C, name='LinkHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine LinkHrefSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module containersLink diff --git a/autogen/prototype/proto/fortran/src/v1.9/containers/Regions1d.f03 b/autogen/prototype/proto/fortran/src/v1.9/containers/Regions1d.f03 new file mode 100644 index 000000000..ea27b8277 --- /dev/null +++ b/autogen/prototype/proto/fortran/src/v1.9/containers/Regions1d.f03 @@ -0,0 +1,505 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module containersRegions1d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Regions1dDefaultConst() & + bind(C, name='Regions1dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Regions1dDefaultConst +end function Regions1dDefaultConst + +!! Create, default +function Regions1dDefault() & + bind(C, name='Regions1dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Regions1dDefault +end function Regions1dDefault + +!! Create, general, const +function Regions1dCreateConst( & + label, & + outerDomainValue, & + axes, & + XYs1d, XYs1dSize, & + labelSize & +) & + bind(C, name='Regions1dCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), value, intent(in) :: outerDomainValue + type(c_ptr), value :: axes + integer(c_size_t), value :: XYs1dSize + type(c_ptr) :: XYs1d(XYs1dSize) + type(c_ptr) :: Regions1dCreateConst +end function Regions1dCreateConst + +!! Create, general +function Regions1dCreate( & + label, & + outerDomainValue, & + axes, & + XYs1d, XYs1dSize, & + labelSize & +) & + bind(C, name='Regions1dCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), value, intent(in) :: outerDomainValue + type(c_ptr), value :: axes + integer(c_size_t), value :: XYs1dSize + type(c_ptr) :: XYs1d(XYs1dSize) + type(c_ptr) :: Regions1dCreate +end function Regions1dCreate + +!! Assign +subroutine Regions1dAssign(handleLHS, handleRHS) & + bind(C, name='Regions1dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS, handleRHS +end subroutine Regions1dAssign + +!! Delete +subroutine Regions1dDelete(handle) & + bind(C, name='Regions1dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Regions1dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +function Regions1dRead(handle, filename, filenameSize) & + bind(C, name='Regions1dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Regions1dRead +end function Regions1dRead + +!! Write to file +function Regions1dWrite(handle, filename, filenameSize) & + bind(C, name='Regions1dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Regions1dWrite +end function Regions1dWrite + +!! Print to standard output, in our prettyprinting format +function Regions1dPrint(handle) & + bind(C, name='Regions1dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dPrint +end function Regions1dPrint + +!! Print to standard output, as XML +function Regions1dPrintXML(handle) & + bind(C, name='Regions1dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dPrintXML +end function Regions1dPrintXML + +!! Print to standard output, as JSON +function Regions1dPrintJSON(handle) & + bind(C, name='Regions1dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dPrintJSON +end function Regions1dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function Regions1dLabelHas(handle) & + bind(C, name='Regions1dLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dLabelHas +end function Regions1dLabelHas + +!! Get +function Regions1dLabelGet(handle) & + bind(C, name='Regions1dLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Regions1dLabelGet +end function Regions1dLabelGet + +!! Set +subroutine Regions1dLabelSet(handle, label, labelSize) & + bind(C, name='Regions1dLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine Regions1dLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: outerDomainValue +!! ----------------------------------------------------------------------------- + +!! Has +function Regions1dOuterDomainValueHas(handle) & + bind(C, name='Regions1dOuterDomainValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dOuterDomainValueHas +end function Regions1dOuterDomainValueHas + +!! Get +function Regions1dOuterDomainValueGet(handle) & + bind(C, name='Regions1dOuterDomainValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: Regions1dOuterDomainValueGet +end function Regions1dOuterDomainValueGet + +!! Set +subroutine Regions1dOuterDomainValueSet(handle, outerDomainValue, outerDomainValueSize) & + bind(C, name='Regions1dOuterDomainValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: outerDomainValueSize + character(c_char), intent(in) :: outerDomainValue(outerDomainValueSize) +end subroutine Regions1dOuterDomainValueSet + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function Regions1dAxesHas(handle) & + bind(C, name='Regions1dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dAxesHas +end function Regions1dAxesHas + +!! Get, const +function Regions1dAxesGetConst(handle) & + bind(C, name='Regions1dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Regions1dAxesGetConst +end function Regions1dAxesGetConst + +!! Get +function Regions1dAxesGet(handle) & + bind(C, name='Regions1dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Regions1dAxesGet +end function Regions1dAxesGet + +!! Set +subroutine Regions1dAxesSet(handle, fieldHandle) & + bind(C, name='Regions1dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), value :: fieldHandle +end subroutine Regions1dAxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function Regions1dXYs1dHas(handle) & + bind(C, name='Regions1dXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dXYs1dHas +end function Regions1dXYs1dHas + +!! Clear +subroutine Regions1dXYs1dClear(handle) & + bind(C, name='Regions1dXYs1dClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Regions1dXYs1dClear + +!! Size +function Regions1dXYs1dSize(handle) & + bind(C, name='Regions1dXYs1dSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: Regions1dXYs1dSize +end function Regions1dXYs1dSize + +!! Add +subroutine Regions1dXYs1dAdd(handle, fieldHandle) & + bind(C, name='Regions1dXYs1dAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions1dXYs1dAdd + +!! Get, by index \in [0,size), const +function Regions1dXYs1dGetConst(handle, index) & + bind(C, name='Regions1dXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Regions1dXYs1dGetConst +end function Regions1dXYs1dGetConst + +!! Get, by index \in [0,size) +function Regions1dXYs1dGet(handle, index) & + bind(C, name='Regions1dXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Regions1dXYs1dGet +end function Regions1dXYs1dGet + +!! Set, by index \in [0,size) +subroutine Regions1dXYs1dSet(handle, index, fieldHandle) & + bind(C, name='Regions1dXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions1dXYs1dSet + +!! ------------------------ +!! Re: metadatum index +!! ------------------------ + +!! Has, by index +function Regions1dXYs1dHasByIndex(handle, meta) & + bind(C, name='Regions1dXYs1dHasByIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), value, intent(in) :: meta + integer(c_int) :: Regions1dXYs1dHasByIndex +end function Regions1dXYs1dHasByIndex + +!! Get, by index, const +function Regions1dXYs1dGetByIndexConst(handle, meta) & + bind(C, name='Regions1dXYs1dGetByIndexConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), value, intent(in) :: meta + type(c_ptr) :: Regions1dXYs1dGetByIndexConst +end function Regions1dXYs1dGetByIndexConst + +!! Get, by index +function Regions1dXYs1dGetByIndex(handle, meta) & + bind(C, name='Regions1dXYs1dGetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), value, intent(in) :: meta + type(c_ptr) :: Regions1dXYs1dGetByIndex +end function Regions1dXYs1dGetByIndex + +!! Set, by index +subroutine Regions1dXYs1dSetByIndex(handle, meta, fieldHandle) & + bind(C, name='Regions1dXYs1dSetByIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), value, intent(in) :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions1dXYs1dSetByIndex + +!! ------------------------ +!! Re: metadatum interpolation +!! ------------------------ + +!! Has, by interpolation +function Regions1dXYs1dHasByInterpolation(handle, meta) & + bind(C, name='Regions1dXYs1dHasByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + unknownType, value, intent(in) :: meta + integer(c_int) :: Regions1dXYs1dHasByInterpolation +end function Regions1dXYs1dHasByInterpolation + +!! Get, by interpolation, const +function Regions1dXYs1dGetByInterpolationConst(handle, meta) & + bind(C, name='Regions1dXYs1dGetByInterpolationConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + unknownType, value, intent(in) :: meta + type(c_ptr) :: Regions1dXYs1dGetByInterpolationConst +end function Regions1dXYs1dGetByInterpolationConst + +!! Get, by interpolation +function Regions1dXYs1dGetByInterpolation(handle, meta) & + bind(C, name='Regions1dXYs1dGetByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + unknownType, value, intent(in) :: meta + type(c_ptr) :: Regions1dXYs1dGetByInterpolation +end function Regions1dXYs1dGetByInterpolation + +!! Set, by interpolation +subroutine Regions1dXYs1dSetByInterpolation(handle, meta, fieldHandle) & + bind(C, name='Regions1dXYs1dSetByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + unknownType, value, intent(in) :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions1dXYs1dSetByInterpolation + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function Regions1dXYs1dHasByLabel(handle, meta, metaSize) & + bind(C, name='Regions1dXYs1dHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: Regions1dXYs1dHasByLabel +end function Regions1dXYs1dHasByLabel + +!! Get, by label, const +function Regions1dXYs1dGetByLabelConst(handle, meta, metaSize) & + bind(C, name='Regions1dXYs1dGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Regions1dXYs1dGetByLabelConst +end function Regions1dXYs1dGetByLabelConst + +!! Get, by label +function Regions1dXYs1dGetByLabel(handle, meta, metaSize) & + bind(C, name='Regions1dXYs1dGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Regions1dXYs1dGetByLabel +end function Regions1dXYs1dGetByLabel + +!! Set, by label +subroutine Regions1dXYs1dSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='Regions1dXYs1dSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions1dXYs1dSetByLabel + +!! ------------------------ +!! Re: metadatum outerDomainValue +!! ------------------------ + +!! Has, by outerDomainValue +function Regions1dXYs1dHasByOuterDomainValue(handle, meta) & + bind(C, name='Regions1dXYs1dHasByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), value, intent(in) :: meta + integer(c_int) :: Regions1dXYs1dHasByOuterDomainValue +end function Regions1dXYs1dHasByOuterDomainValue + +!! Get, by outerDomainValue, const +function Regions1dXYs1dGetByOuterDomainValueConst(handle, meta) & + bind(C, name='Regions1dXYs1dGetByOuterDomainValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), value, intent(in) :: meta + type(c_ptr) :: Regions1dXYs1dGetByOuterDomainValueConst +end function Regions1dXYs1dGetByOuterDomainValueConst + +!! Get, by outerDomainValue +function Regions1dXYs1dGetByOuterDomainValue(handle, meta) & + bind(C, name='Regions1dXYs1dGetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), value, intent(in) :: meta + type(c_ptr) :: Regions1dXYs1dGetByOuterDomainValue +end function Regions1dXYs1dGetByOuterDomainValue + +!! Set, by outerDomainValue +subroutine Regions1dXYs1dSetByOuterDomainValue(handle, meta, fieldHandle) & + bind(C, name='Regions1dXYs1dSetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), value, intent(in) :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions1dXYs1dSetByOuterDomainValue + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module containersRegions1d diff --git a/autogen/prototype/proto/fortran/src/v1.9/containers/Values.f03 b/autogen/prototype/proto/fortran/src/v1.9/containers/Values.f03 new file mode 100644 index 000000000..dd941788e --- /dev/null +++ b/autogen/prototype/proto/fortran/src/v1.9/containers/Values.f03 @@ -0,0 +1,530 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module containersValues +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ValuesDefaultConst() & + bind(C, name='ValuesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ValuesDefaultConst +end function ValuesDefaultConst + +!! Create, default +function ValuesDefault() & + bind(C, name='ValuesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ValuesDefault +end function ValuesDefault + +!! Create, general, const +function ValuesCreateConst( & + valueType, & + start, & + length, & + valueTypeSize & +) & + bind(C, name='ValuesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: valueTypeSize + character(c_char), intent(in) :: valueType(valueTypeSize) + integer(c_int), value, intent(in) :: start + integer(c_int), value, intent(in) :: length + type(c_ptr) :: ValuesCreateConst +end function ValuesCreateConst + +!! Create, general +function ValuesCreate( & + valueType, & + start, & + length, & + valueTypeSize & +) & + bind(C, name='ValuesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: valueTypeSize + character(c_char), intent(in) :: valueType(valueTypeSize) + integer(c_int), value, intent(in) :: start + integer(c_int), value, intent(in) :: length + type(c_ptr) :: ValuesCreate +end function ValuesCreate + +!! Assign +subroutine ValuesAssign(handleLHS, handleRHS) & + bind(C, name='ValuesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS, handleRHS +end subroutine ValuesAssign + +!! Delete +subroutine ValuesDelete(handle) & + bind(C, name='ValuesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ValuesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +function ValuesRead(handle, filename, filenameSize) & + bind(C, name='ValuesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ValuesRead +end function ValuesRead + +!! Write to file +function ValuesWrite(handle, filename, filenameSize) & + bind(C, name='ValuesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ValuesWrite +end function ValuesWrite + +!! Print to standard output, in our prettyprinting format +function ValuesPrint(handle) & + bind(C, name='ValuesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ValuesPrint +end function ValuesPrint + +!! Print to standard output, as XML +function ValuesPrintXML(handle) & + bind(C, name='ValuesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ValuesPrintXML +end function ValuesPrintXML + +!! Print to standard output, as JSON +function ValuesPrintJSON(handle) & + bind(C, name='ValuesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ValuesPrintJSON +end function ValuesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Data vector +!! ----------------------------------------------------------------------------- + +!! ------------------------ +!! int +!! ------------------------ + +!! Clear +subroutine ValuesIntsClear(handle) & + bind(C, name='ValuesIntsClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ValuesIntsClear + +!! Get size +function ValuesIntsSize(handle) & + bind(C, name='ValuesIntsSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ValuesIntsSize +end function ValuesIntsSize + +!! Get value +!! By index \in [0,size) +function ValuesIntsGet(handle, arrayIndex) & + bind(C, name='ValuesIntsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + integer(c_int) :: ValuesIntsGet +end function ValuesIntsGet + +!! Set value +!! By index \in [0,size) +subroutine ValuesIntsSet(handle, arrayIndex, valueAtIndex) & + bind(C, name='ValuesIntsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + integer(c_int), intent(in), value :: valueAtIndex +end subroutine ValuesIntsSet + +!! Get pointer to existing values, const +function ValuesIntsGetArrayConst(handle) & + bind(C, name='ValuesIntsGetArrayConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ValuesIntsGetArrayConst +end function ValuesIntsGetArrayConst + +!! Get pointer to existing values +function ValuesIntsGetArray(handle) & + bind(C, name='ValuesIntsGetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ValuesIntsGetArray +end function ValuesIntsGetArray + +!! Set completely new values and size +subroutine ValuesIntsSetArray(handle, values, valuesSize) & + bind(C, name='ValuesIntsSetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: valuesSize + integer(c_int), intent(in) :: values(valuesSize) +end subroutine ValuesIntsSetArray + +!! ------------------------ +!! unsigned +!! ------------------------ + +!! Clear +subroutine ValuesUnsignedsClear(handle) & + bind(C, name='ValuesUnsignedsClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ValuesUnsignedsClear + +!! Get size +function ValuesUnsignedsSize(handle) & + bind(C, name='ValuesUnsignedsSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ValuesUnsignedsSize +end function ValuesUnsignedsSize + +!! Get value +!! By index \in [0,size) +function ValuesUnsignedsGet(handle, arrayIndex) & + bind(C, name='ValuesUnsignedsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + integer(c_unsigned) :: ValuesUnsignedsGet +end function ValuesUnsignedsGet + +!! Set value +!! By index \in [0,size) +subroutine ValuesUnsignedsSet(handle, arrayIndex, valueAtIndex) & + bind(C, name='ValuesUnsignedsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + integer(c_unsigned), intent(in), value :: valueAtIndex +end subroutine ValuesUnsignedsSet + +!! Get pointer to existing values, const +function ValuesUnsignedsGetArrayConst(handle) & + bind(C, name='ValuesUnsignedsGetArrayConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ValuesUnsignedsGetArrayConst +end function ValuesUnsignedsGetArrayConst + +!! Get pointer to existing values +function ValuesUnsignedsGetArray(handle) & + bind(C, name='ValuesUnsignedsGetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ValuesUnsignedsGetArray +end function ValuesUnsignedsGetArray + +!! Set completely new values and size +subroutine ValuesUnsignedsSetArray(handle, values, valuesSize) & + bind(C, name='ValuesUnsignedsSetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: valuesSize + integer(c_unsigned), intent(in) :: values(valuesSize) +end subroutine ValuesUnsignedsSetArray + +!! ------------------------ +!! float +!! ------------------------ + +!! Clear +subroutine ValuesFloatsClear(handle) & + bind(C, name='ValuesFloatsClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ValuesFloatsClear + +!! Get size +function ValuesFloatsSize(handle) & + bind(C, name='ValuesFloatsSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ValuesFloatsSize +end function ValuesFloatsSize + +!! Get value +!! By index \in [0,size) +function ValuesFloatsGet(handle, arrayIndex) & + bind(C, name='ValuesFloatsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + real(c_float) :: ValuesFloatsGet +end function ValuesFloatsGet + +!! Set value +!! By index \in [0,size) +subroutine ValuesFloatsSet(handle, arrayIndex, valueAtIndex) & + bind(C, name='ValuesFloatsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + real(c_float), intent(in), value :: valueAtIndex +end subroutine ValuesFloatsSet + +!! Get pointer to existing values, const +function ValuesFloatsGetArrayConst(handle) & + bind(C, name='ValuesFloatsGetArrayConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ValuesFloatsGetArrayConst +end function ValuesFloatsGetArrayConst + +!! Get pointer to existing values +function ValuesFloatsGetArray(handle) & + bind(C, name='ValuesFloatsGetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ValuesFloatsGetArray +end function ValuesFloatsGetArray + +!! Set completely new values and size +subroutine ValuesFloatsSetArray(handle, values, valuesSize) & + bind(C, name='ValuesFloatsSetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: valuesSize + real(c_float), intent(in) :: values(valuesSize) +end subroutine ValuesFloatsSetArray + +!! ------------------------ +!! double +!! ------------------------ + +!! Clear +subroutine ValuesDoublesClear(handle) & + bind(C, name='ValuesDoublesClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ValuesDoublesClear + +!! Get size +function ValuesDoublesSize(handle) & + bind(C, name='ValuesDoublesSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ValuesDoublesSize +end function ValuesDoublesSize + +!! Get value +!! By index \in [0,size) +function ValuesDoublesGet(handle, arrayIndex) & + bind(C, name='ValuesDoublesGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + real(c_double) :: ValuesDoublesGet +end function ValuesDoublesGet + +!! Set value +!! By index \in [0,size) +subroutine ValuesDoublesSet(handle, arrayIndex, valueAtIndex) & + bind(C, name='ValuesDoublesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + real(c_double), intent(in), value :: valueAtIndex +end subroutine ValuesDoublesSet + +!! Get pointer to existing values, const +function ValuesDoublesGetArrayConst(handle) & + bind(C, name='ValuesDoublesGetArrayConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ValuesDoublesGetArrayConst +end function ValuesDoublesGetArrayConst + +!! Get pointer to existing values +function ValuesDoublesGetArray(handle) & + bind(C, name='ValuesDoublesGetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ValuesDoublesGetArray +end function ValuesDoublesGetArray + +!! Set completely new values and size +subroutine ValuesDoublesSetArray(handle, values, valuesSize) & + bind(C, name='ValuesDoublesSetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: valuesSize + real(c_double), intent(in) :: values(valuesSize) +end subroutine ValuesDoublesSetArray + + +!! ----------------------------------------------------------------------------- +!! Metadatum: valueType +!! ----------------------------------------------------------------------------- + +!! Has +function ValuesValueTypeHas(handle) & + bind(C, name='ValuesValueTypeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ValuesValueTypeHas +end function ValuesValueTypeHas + +!! Get +function ValuesValueTypeGet(handle) & + bind(C, name='ValuesValueTypeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ValuesValueTypeGet +end function ValuesValueTypeGet + +!! Set +subroutine ValuesValueTypeSet(handle, valueType, valueTypeSize) & + bind(C, name='ValuesValueTypeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: valueTypeSize + character(c_char), intent(in) :: valueType(valueTypeSize) +end subroutine ValuesValueTypeSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: start +!! ----------------------------------------------------------------------------- + +!! Has +function ValuesStartHas(handle) & + bind(C, name='ValuesStartHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ValuesStartHas +end function ValuesStartHas + +!! Get +function ValuesStartGet(handle) & + bind(C, name='ValuesStartGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ValuesStartGet +end function ValuesStartGet + +!! Set +subroutine ValuesStartSet(handle, start, startSize) & + bind(C, name='ValuesStartSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: startSize + character(c_char), intent(in) :: start(startSize) +end subroutine ValuesStartSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: length +!! ----------------------------------------------------------------------------- + +!! Has +function ValuesLengthHas(handle) & + bind(C, name='ValuesLengthHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ValuesLengthHas +end function ValuesLengthHas + +!! Get +function ValuesLengthGet(handle) & + bind(C, name='ValuesLengthGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ValuesLengthGet +end function ValuesLengthGet + +!! Set +subroutine ValuesLengthSet(handle, length, lengthSize) & + bind(C, name='ValuesLengthSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: lengthSize + character(c_char), intent(in) :: length(lengthSize) +end subroutine ValuesLengthSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module containersValues diff --git a/autogen/prototype/proto/fortran/src/v1.9/containers/XYs1d.f03 b/autogen/prototype/proto/fortran/src/v1.9/containers/XYs1d.f03 new file mode 100644 index 000000000..ed85319e7 --- /dev/null +++ b/autogen/prototype/proto/fortran/src/v1.9/containers/XYs1d.f03 @@ -0,0 +1,368 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module containersXYs1d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function XYs1dDefaultConst() & + bind(C, name='XYs1dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: XYs1dDefaultConst +end function XYs1dDefaultConst + +!! Create, default +function XYs1dDefault() & + bind(C, name='XYs1dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: XYs1dDefault +end function XYs1dDefault + +!! Create, general, const +function XYs1dCreateConst( & + index, & + interpolation, & + label, & + outerDomainValue, & + axes, & + values, & + labelSize & +) & + bind(C, name='XYs1dCreateConst') + use iso_c_binding + implicit none + integer(c_int), value, intent(in) :: index + unknownType, value, intent(in) :: interpolation + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), value, intent(in) :: outerDomainValue + type(c_ptr), value :: axes + type(c_ptr), value :: values + type(c_ptr) :: XYs1dCreateConst +end function XYs1dCreateConst + +!! Create, general +function XYs1dCreate( & + index, & + interpolation, & + label, & + outerDomainValue, & + axes, & + values, & + labelSize & +) & + bind(C, name='XYs1dCreate') + use iso_c_binding + implicit none + integer(c_int), value, intent(in) :: index + unknownType, value, intent(in) :: interpolation + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), value, intent(in) :: outerDomainValue + type(c_ptr), value :: axes + type(c_ptr), value :: values + type(c_ptr) :: XYs1dCreate +end function XYs1dCreate + +!! Assign +subroutine XYs1dAssign(handleLHS, handleRHS) & + bind(C, name='XYs1dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS, handleRHS +end subroutine XYs1dAssign + +!! Delete +subroutine XYs1dDelete(handle) & + bind(C, name='XYs1dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine XYs1dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +function XYs1dRead(handle, filename, filenameSize) & + bind(C, name='XYs1dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: XYs1dRead +end function XYs1dRead + +!! Write to file +function XYs1dWrite(handle, filename, filenameSize) & + bind(C, name='XYs1dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: XYs1dWrite +end function XYs1dWrite + +!! Print to standard output, in our prettyprinting format +function XYs1dPrint(handle) & + bind(C, name='XYs1dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dPrint +end function XYs1dPrint + +!! Print to standard output, as XML +function XYs1dPrintXML(handle) & + bind(C, name='XYs1dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dPrintXML +end function XYs1dPrintXML + +!! Print to standard output, as JSON +function XYs1dPrintJSON(handle) & + bind(C, name='XYs1dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dPrintJSON +end function XYs1dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: index +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dIndexHas(handle) & + bind(C, name='XYs1dIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dIndexHas +end function XYs1dIndexHas + +!! Get +function XYs1dIndexGet(handle) & + bind(C, name='XYs1dIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dIndexGet +end function XYs1dIndexGet + +!! Set +subroutine XYs1dIndexSet(handle, index, indexSize) & + bind(C, name='XYs1dIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: indexSize + character(c_char), intent(in) :: index(indexSize) +end subroutine XYs1dIndexSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: interpolation +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dInterpolationHas(handle) & + bind(C, name='XYs1dInterpolationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dInterpolationHas +end function XYs1dInterpolationHas + +!! Get +function XYs1dInterpolationGet(handle) & + bind(C, name='XYs1dInterpolationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + unknownType :: XYs1dInterpolationGet +end function XYs1dInterpolationGet + +!! Set +subroutine XYs1dInterpolationSet(handle, interpolation, interpolationSize) & + bind(C, name='XYs1dInterpolationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: interpolationSize + character(c_char), intent(in) :: interpolation(interpolationSize) +end subroutine XYs1dInterpolationSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dLabelHas(handle) & + bind(C, name='XYs1dLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dLabelHas +end function XYs1dLabelHas + +!! Get +function XYs1dLabelGet(handle) & + bind(C, name='XYs1dLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs1dLabelGet +end function XYs1dLabelGet + +!! Set +subroutine XYs1dLabelSet(handle, label, labelSize) & + bind(C, name='XYs1dLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine XYs1dLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: outerDomainValue +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dOuterDomainValueHas(handle) & + bind(C, name='XYs1dOuterDomainValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dOuterDomainValueHas +end function XYs1dOuterDomainValueHas + +!! Get +function XYs1dOuterDomainValueGet(handle) & + bind(C, name='XYs1dOuterDomainValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: XYs1dOuterDomainValueGet +end function XYs1dOuterDomainValueGet + +!! Set +subroutine XYs1dOuterDomainValueSet(handle, outerDomainValue, outerDomainValueSize) & + bind(C, name='XYs1dOuterDomainValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: outerDomainValueSize + character(c_char), intent(in) :: outerDomainValue(outerDomainValueSize) +end subroutine XYs1dOuterDomainValueSet + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dAxesHas(handle) & + bind(C, name='XYs1dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dAxesHas +end function XYs1dAxesHas + +!! Get, const +function XYs1dAxesGetConst(handle) & + bind(C, name='XYs1dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs1dAxesGetConst +end function XYs1dAxesGetConst + +!! Get +function XYs1dAxesGet(handle) & + bind(C, name='XYs1dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs1dAxesGet +end function XYs1dAxesGet + +!! Set +subroutine XYs1dAxesSet(handle, fieldHandle) & + bind(C, name='XYs1dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), value :: fieldHandle +end subroutine XYs1dAxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: values +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dValuesHas(handle) & + bind(C, name='XYs1dValuesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dValuesHas +end function XYs1dValuesHas + +!! Get, const +function XYs1dValuesGetConst(handle) & + bind(C, name='XYs1dValuesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs1dValuesGetConst +end function XYs1dValuesGetConst + +!! Get +function XYs1dValuesGet(handle) & + bind(C, name='XYs1dValuesGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs1dValuesGet +end function XYs1dValuesGet + +!! Set +subroutine XYs1dValuesSet(handle, fieldHandle) & + bind(C, name='XYs1dValuesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), value :: fieldHandle +end subroutine XYs1dValuesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module containersXYs1d diff --git a/autogen/prototype/proto/fortran/src/v1.9/transport/CrossSection.f03 b/autogen/prototype/proto/fortran/src/v1.9/transport/CrossSection.f03 new file mode 100644 index 000000000..9e83bafe8 --- /dev/null +++ b/autogen/prototype/proto/fortran/src/v1.9/transport/CrossSection.f03 @@ -0,0 +1,126 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module transportCrossSection +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CrossSectionDefaultConst() & + bind(C, name='CrossSectionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionDefaultConst +end function CrossSectionDefaultConst + +!! Create, default +function CrossSectionDefault() & + bind(C, name='CrossSectionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionDefault +end function CrossSectionDefault + +!! Create, general, const +function CrossSectionCreateConst( & +) & + bind(C, name='CrossSectionCreateConst') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionCreateConst +end function CrossSectionCreateConst + +!! Create, general +function CrossSectionCreate( & +) & + bind(C, name='CrossSectionCreate') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionCreate +end function CrossSectionCreate + +!! Assign +subroutine CrossSectionAssign(handleLHS, handleRHS) & + bind(C, name='CrossSectionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS, handleRHS +end subroutine CrossSectionAssign + +!! Delete +subroutine CrossSectionDelete(handle) & + bind(C, name='CrossSectionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CrossSectionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +function CrossSectionRead(handle, filename, filenameSize) & + bind(C, name='CrossSectionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionRead +end function CrossSectionRead + +!! Write to file +function CrossSectionWrite(handle, filename, filenameSize) & + bind(C, name='CrossSectionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionWrite +end function CrossSectionWrite + +!! Print to standard output, in our prettyprinting format +function CrossSectionPrint(handle) & + bind(C, name='CrossSectionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionPrint +end function CrossSectionPrint + +!! Print to standard output, as XML +function CrossSectionPrintXML(handle) & + bind(C, name='CrossSectionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionPrintXML +end function CrossSectionPrintXML + +!! Print to standard output, as JSON +function CrossSectionPrintJSON(handle) & + bind(C, name='CrossSectionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionPrintJSON +end function CrossSectionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module transportCrossSection diff --git a/autogen/prototype/proto/fortran/src/v1.9/transport/Reaction.f03 b/autogen/prototype/proto/fortran/src/v1.9/transport/Reaction.f03 new file mode 100644 index 000000000..7ca22247c --- /dev/null +++ b/autogen/prototype/proto/fortran/src/v1.9/transport/Reaction.f03 @@ -0,0 +1,290 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module transportReaction +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ReactionDefaultConst() & + bind(C, name='ReactionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionDefaultConst +end function ReactionDefaultConst + +!! Create, default +function ReactionDefault() & + bind(C, name='ReactionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionDefault +end function ReactionDefault + +!! Create, general, const +function ReactionCreateConst( & + ENDF_MT, & + fissionGenre, & + label, & + crossSection, & + fissionGenreSize, & + labelSize & +) & + bind(C, name='ReactionCreateConst') + use iso_c_binding + implicit none + integer(c_int), value, intent(in) :: ENDF_MT + integer(c_size_t), intent(in), value :: fissionGenreSize + character(c_char), intent(in) :: fissionGenre(fissionGenreSize) + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), value :: crossSection + type(c_ptr) :: ReactionCreateConst +end function ReactionCreateConst + +!! Create, general +function ReactionCreate( & + ENDF_MT, & + fissionGenre, & + label, & + crossSection, & + fissionGenreSize, & + labelSize & +) & + bind(C, name='ReactionCreate') + use iso_c_binding + implicit none + integer(c_int), value, intent(in) :: ENDF_MT + integer(c_size_t), intent(in), value :: fissionGenreSize + character(c_char), intent(in) :: fissionGenre(fissionGenreSize) + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), value :: crossSection + type(c_ptr) :: ReactionCreate +end function ReactionCreate + +!! Assign +subroutine ReactionAssign(handleLHS, handleRHS) & + bind(C, name='ReactionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS, handleRHS +end subroutine ReactionAssign + +!! Delete +subroutine ReactionDelete(handle) & + bind(C, name='ReactionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ReactionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +function ReactionRead(handle, filename, filenameSize) & + bind(C, name='ReactionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionRead +end function ReactionRead + +!! Write to file +function ReactionWrite(handle, filename, filenameSize) & + bind(C, name='ReactionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionWrite +end function ReactionWrite + +!! Print to standard output, in our prettyprinting format +function ReactionPrint(handle) & + bind(C, name='ReactionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionPrint +end function ReactionPrint + +!! Print to standard output, as XML +function ReactionPrintXML(handle) & + bind(C, name='ReactionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionPrintXML +end function ReactionPrintXML + +!! Print to standard output, as JSON +function ReactionPrintJSON(handle) & + bind(C, name='ReactionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionPrintJSON +end function ReactionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: ENDF_MT +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionENDFMTHas(handle) & + bind(C, name='ReactionENDFMTHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionENDFMTHas +end function ReactionENDFMTHas + +!! Get +function ReactionENDFMTGet(handle) & + bind(C, name='ReactionENDFMTGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionENDFMTGet +end function ReactionENDFMTGet + +!! Set +subroutine ReactionENDFMTSet(handle, ENDF_MT, ENDF_MTSize) & + bind(C, name='ReactionENDFMTSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: ENDF_MTSize + character(c_char), intent(in) :: ENDF_MT(ENDF_MTSize) +end subroutine ReactionENDFMTSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: fissionGenre +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionFissionGenreHas(handle) & + bind(C, name='ReactionFissionGenreHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionFissionGenreHas +end function ReactionFissionGenreHas + +!! Get +function ReactionFissionGenreGet(handle) & + bind(C, name='ReactionFissionGenreGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionFissionGenreGet +end function ReactionFissionGenreGet + +!! Set +subroutine ReactionFissionGenreSet(handle, fissionGenre, fissionGenreSize) & + bind(C, name='ReactionFissionGenreSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: fissionGenreSize + character(c_char), intent(in) :: fissionGenre(fissionGenreSize) +end subroutine ReactionFissionGenreSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionLabelHas(handle) & + bind(C, name='ReactionLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionLabelHas +end function ReactionLabelHas + +!! Get +function ReactionLabelGet(handle) & + bind(C, name='ReactionLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionLabelGet +end function ReactionLabelGet + +!! Set +subroutine ReactionLabelSet(handle, label, labelSize) & + bind(C, name='ReactionLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ReactionLabelSet + + +!! ----------------------------------------------------------------------------- +!! Child: crossSection +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionCrossSectionHas(handle) & + bind(C, name='ReactionCrossSectionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionCrossSectionHas +end function ReactionCrossSectionHas + +!! Get, const +function ReactionCrossSectionGetConst(handle) & + bind(C, name='ReactionCrossSectionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionCrossSectionGetConst +end function ReactionCrossSectionGetConst + +!! Get +function ReactionCrossSectionGet(handle) & + bind(C, name='ReactionCrossSectionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionCrossSectionGet +end function ReactionCrossSectionGet + +!! Set +subroutine ReactionCrossSectionSet(handle, fieldHandle) & + bind(C, name='ReactionCrossSectionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), value :: fieldHandle +end subroutine ReactionCrossSectionSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module transportReaction diff --git a/autogen/prototype/proto/fortran/src/v1.9/transport/ReactionSuite.f03 b/autogen/prototype/proto/fortran/src/v1.9/transport/ReactionSuite.f03 new file mode 100644 index 000000000..2b825b905 --- /dev/null +++ b/autogen/prototype/proto/fortran/src/v1.9/transport/ReactionSuite.f03 @@ -0,0 +1,409 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module transportReactionSuite +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ReactionSuiteDefaultConst() & + bind(C, name='ReactionSuiteDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionSuiteDefaultConst +end function ReactionSuiteDefaultConst + +!! Create, default +function ReactionSuiteDefault() & + bind(C, name='ReactionSuiteDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionSuiteDefault +end function ReactionSuiteDefault + +!! Create, general, const +function ReactionSuiteCreateConst( & + evaluation, & + format, & + projectile, & + projectileFrame, & + target, & + interaction, & + reactions, & + evaluationSize, & + formatSize, & + projectileSize, & + targetSize & +) & + bind(C, name='ReactionSuiteCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: evaluationSize + character(c_char), intent(in) :: evaluation(evaluationSize) + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) + integer(c_size_t), intent(in), value :: projectileSize + character(c_char), intent(in) :: projectile(projectileSize) + unknownType, value, intent(in) :: projectileFrame + integer(c_size_t), intent(in), value :: targetSize + character(c_char), intent(in) :: target(targetSize) + unknownType, value, intent(in) :: interaction + type(c_ptr), value :: reactions + type(c_ptr) :: ReactionSuiteCreateConst +end function ReactionSuiteCreateConst + +!! Create, general +function ReactionSuiteCreate( & + evaluation, & + format, & + projectile, & + projectileFrame, & + target, & + interaction, & + reactions, & + evaluationSize, & + formatSize, & + projectileSize, & + targetSize & +) & + bind(C, name='ReactionSuiteCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: evaluationSize + character(c_char), intent(in) :: evaluation(evaluationSize) + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) + integer(c_size_t), intent(in), value :: projectileSize + character(c_char), intent(in) :: projectile(projectileSize) + unknownType, value, intent(in) :: projectileFrame + integer(c_size_t), intent(in), value :: targetSize + character(c_char), intent(in) :: target(targetSize) + unknownType, value, intent(in) :: interaction + type(c_ptr), value :: reactions + type(c_ptr) :: ReactionSuiteCreate +end function ReactionSuiteCreate + +!! Assign +subroutine ReactionSuiteAssign(handleLHS, handleRHS) & + bind(C, name='ReactionSuiteAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS, handleRHS +end subroutine ReactionSuiteAssign + +!! Delete +subroutine ReactionSuiteDelete(handle) & + bind(C, name='ReactionSuiteDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ReactionSuiteDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +function ReactionSuiteRead(handle, filename, filenameSize) & + bind(C, name='ReactionSuiteRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionSuiteRead +end function ReactionSuiteRead + +!! Write to file +function ReactionSuiteWrite(handle, filename, filenameSize) & + bind(C, name='ReactionSuiteWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionSuiteWrite +end function ReactionSuiteWrite + +!! Print to standard output, in our prettyprinting format +function ReactionSuitePrint(handle) & + bind(C, name='ReactionSuitePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuitePrint +end function ReactionSuitePrint + +!! Print to standard output, as XML +function ReactionSuitePrintXML(handle) & + bind(C, name='ReactionSuitePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuitePrintXML +end function ReactionSuitePrintXML + +!! Print to standard output, as JSON +function ReactionSuitePrintJSON(handle) & + bind(C, name='ReactionSuitePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuitePrintJSON +end function ReactionSuitePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: evaluation +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteEvaluationHas(handle) & + bind(C, name='ReactionSuiteEvaluationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteEvaluationHas +end function ReactionSuiteEvaluationHas + +!! Get +function ReactionSuiteEvaluationGet(handle) & + bind(C, name='ReactionSuiteEvaluationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteEvaluationGet +end function ReactionSuiteEvaluationGet + +!! Set +subroutine ReactionSuiteEvaluationSet(handle, evaluation, evaluationSize) & + bind(C, name='ReactionSuiteEvaluationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: evaluationSize + character(c_char), intent(in) :: evaluation(evaluationSize) +end subroutine ReactionSuiteEvaluationSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: format +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteFormatHas(handle) & + bind(C, name='ReactionSuiteFormatHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteFormatHas +end function ReactionSuiteFormatHas + +!! Get +function ReactionSuiteFormatGet(handle) & + bind(C, name='ReactionSuiteFormatGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteFormatGet +end function ReactionSuiteFormatGet + +!! Set +subroutine ReactionSuiteFormatSet(handle, format, formatSize) & + bind(C, name='ReactionSuiteFormatSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) +end subroutine ReactionSuiteFormatSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: projectile +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteProjectileHas(handle) & + bind(C, name='ReactionSuiteProjectileHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteProjectileHas +end function ReactionSuiteProjectileHas + +!! Get +function ReactionSuiteProjectileGet(handle) & + bind(C, name='ReactionSuiteProjectileGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteProjectileGet +end function ReactionSuiteProjectileGet + +!! Set +subroutine ReactionSuiteProjectileSet(handle, projectile, projectileSize) & + bind(C, name='ReactionSuiteProjectileSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: projectileSize + character(c_char), intent(in) :: projectile(projectileSize) +end subroutine ReactionSuiteProjectileSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: projectileFrame +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteProjectileFrameHas(handle) & + bind(C, name='ReactionSuiteProjectileFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteProjectileFrameHas +end function ReactionSuiteProjectileFrameHas + +!! Get +function ReactionSuiteProjectileFrameGet(handle) & + bind(C, name='ReactionSuiteProjectileFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + unknownType :: ReactionSuiteProjectileFrameGet +end function ReactionSuiteProjectileFrameGet + +!! Set +subroutine ReactionSuiteProjectileFrameSet(handle, projectileFrame, projectileFrameSize) & + bind(C, name='ReactionSuiteProjectileFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: projectileFrameSize + character(c_char), intent(in) :: projectileFrame(projectileFrameSize) +end subroutine ReactionSuiteProjectileFrameSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: target +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteTargetHas(handle) & + bind(C, name='ReactionSuiteTargetHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteTargetHas +end function ReactionSuiteTargetHas + +!! Get +function ReactionSuiteTargetGet(handle) & + bind(C, name='ReactionSuiteTargetGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteTargetGet +end function ReactionSuiteTargetGet + +!! Set +subroutine ReactionSuiteTargetSet(handle, target, targetSize) & + bind(C, name='ReactionSuiteTargetSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: targetSize + character(c_char), intent(in) :: target(targetSize) +end subroutine ReactionSuiteTargetSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: interaction +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteInteractionHas(handle) & + bind(C, name='ReactionSuiteInteractionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteInteractionHas +end function ReactionSuiteInteractionHas + +!! Get +function ReactionSuiteInteractionGet(handle) & + bind(C, name='ReactionSuiteInteractionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + unknownType :: ReactionSuiteInteractionGet +end function ReactionSuiteInteractionGet + +!! Set +subroutine ReactionSuiteInteractionSet(handle, interaction, interactionSize) & + bind(C, name='ReactionSuiteInteractionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: interactionSize + character(c_char), intent(in) :: interaction(interactionSize) +end subroutine ReactionSuiteInteractionSet + + +!! ----------------------------------------------------------------------------- +!! Child: reactions +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteReactionsHas(handle) & + bind(C, name='ReactionSuiteReactionsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteReactionsHas +end function ReactionSuiteReactionsHas + +!! Get, const +function ReactionSuiteReactionsGetConst(handle) & + bind(C, name='ReactionSuiteReactionsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteReactionsGetConst +end function ReactionSuiteReactionsGetConst + +!! Get +function ReactionSuiteReactionsGet(handle) & + bind(C, name='ReactionSuiteReactionsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteReactionsGet +end function ReactionSuiteReactionsGet + +!! Set +subroutine ReactionSuiteReactionsSet(handle, fieldHandle) & + bind(C, name='ReactionSuiteReactionsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), value :: fieldHandle +end subroutine ReactionSuiteReactionsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module transportReactionSuite diff --git a/autogen/prototype/proto/fortran/src/v1.9/transport/Reactions.f03 b/autogen/prototype/proto/fortran/src/v1.9/transport/Reactions.f03 new file mode 100644 index 000000000..035220f45 --- /dev/null +++ b/autogen/prototype/proto/fortran/src/v1.9/transport/Reactions.f03 @@ -0,0 +1,342 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module transportReactions +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ReactionsDefaultConst() & + bind(C, name='ReactionsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionsDefaultConst +end function ReactionsDefaultConst + +!! Create, default +function ReactionsDefault() & + bind(C, name='ReactionsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionsDefault +end function ReactionsDefault + +!! Create, general, const +function ReactionsCreateConst( & + reaction, reactionSize & +) & + bind(C, name='ReactionsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), value :: reactionSize + type(c_ptr) :: reaction(reactionSize) + type(c_ptr) :: ReactionsCreateConst +end function ReactionsCreateConst + +!! Create, general +function ReactionsCreate( & + reaction, reactionSize & +) & + bind(C, name='ReactionsCreate') + use iso_c_binding + implicit none + integer(c_size_t), value :: reactionSize + type(c_ptr) :: reaction(reactionSize) + type(c_ptr) :: ReactionsCreate +end function ReactionsCreate + +!! Assign +subroutine ReactionsAssign(handleLHS, handleRHS) & + bind(C, name='ReactionsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS, handleRHS +end subroutine ReactionsAssign + +!! Delete +subroutine ReactionsDelete(handle) & + bind(C, name='ReactionsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ReactionsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +function ReactionsRead(handle, filename, filenameSize) & + bind(C, name='ReactionsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionsRead +end function ReactionsRead + +!! Write to file +function ReactionsWrite(handle, filename, filenameSize) & + bind(C, name='ReactionsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionsWrite +end function ReactionsWrite + +!! Print to standard output, in our prettyprinting format +function ReactionsPrint(handle) & + bind(C, name='ReactionsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionsPrint +end function ReactionsPrint + +!! Print to standard output, as XML +function ReactionsPrintXML(handle) & + bind(C, name='ReactionsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionsPrintXML +end function ReactionsPrintXML + +!! Print to standard output, as JSON +function ReactionsPrintJSON(handle) & + bind(C, name='ReactionsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionsPrintJSON +end function ReactionsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: reaction +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionsReactionHas(handle) & + bind(C, name='ReactionsReactionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionsReactionHas +end function ReactionsReactionHas + +!! Clear +subroutine ReactionsReactionClear(handle) & + bind(C, name='ReactionsReactionClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ReactionsReactionClear + +!! Size +function ReactionsReactionSize(handle) & + bind(C, name='ReactionsReactionSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ReactionsReactionSize +end function ReactionsReactionSize + +!! Add +subroutine ReactionsReactionAdd(handle, fieldHandle) & + bind(C, name='ReactionsReactionAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionsReactionAdd + +!! Get, by index \in [0,size), const +function ReactionsReactionGetConst(handle, index) & + bind(C, name='ReactionsReactionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ReactionsReactionGetConst +end function ReactionsReactionGetConst + +!! Get, by index \in [0,size) +function ReactionsReactionGet(handle, index) & + bind(C, name='ReactionsReactionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ReactionsReactionGet +end function ReactionsReactionGet + +!! Set, by index \in [0,size) +subroutine ReactionsReactionSet(handle, index, fieldHandle) & + bind(C, name='ReactionsReactionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionsReactionSet + +!! ------------------------ +!! Re: metadatum ENDF_MT +!! ------------------------ + +!! Has, by ENDF_MT +function ReactionsReactionHasByENDFMT(handle, meta) & + bind(C, name='ReactionsReactionHasByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), value, intent(in) :: meta + integer(c_int) :: ReactionsReactionHasByENDFMT +end function ReactionsReactionHasByENDFMT + +!! Get, by ENDF_MT, const +function ReactionsReactionGetByENDFMTConst(handle, meta) & + bind(C, name='ReactionsReactionGetByENDFMTConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), value, intent(in) :: meta + type(c_ptr) :: ReactionsReactionGetByENDFMTConst +end function ReactionsReactionGetByENDFMTConst + +!! Get, by ENDF_MT +function ReactionsReactionGetByENDFMT(handle, meta) & + bind(C, name='ReactionsReactionGetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), value, intent(in) :: meta + type(c_ptr) :: ReactionsReactionGetByENDFMT +end function ReactionsReactionGetByENDFMT + +!! Set, by ENDF_MT +subroutine ReactionsReactionSetByENDFMT(handle, meta, fieldHandle) & + bind(C, name='ReactionsReactionSetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), value, intent(in) :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionsReactionSetByENDFMT + +!! ------------------------ +!! Re: metadatum fissionGenre +!! ------------------------ + +!! Has, by fissionGenre +function ReactionsReactionHasByFissionGenre(handle, meta, metaSize) & + bind(C, name='ReactionsReactionHasByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ReactionsReactionHasByFissionGenre +end function ReactionsReactionHasByFissionGenre + +!! Get, by fissionGenre, const +function ReactionsReactionGetByFissionGenreConst(handle, meta, metaSize) & + bind(C, name='ReactionsReactionGetByFissionGenreConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ReactionsReactionGetByFissionGenreConst +end function ReactionsReactionGetByFissionGenreConst + +!! Get, by fissionGenre +function ReactionsReactionGetByFissionGenre(handle, meta, metaSize) & + bind(C, name='ReactionsReactionGetByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ReactionsReactionGetByFissionGenre +end function ReactionsReactionGetByFissionGenre + +!! Set, by fissionGenre +subroutine ReactionsReactionSetByFissionGenre(handle, meta, metaSize, fieldHandle) & + bind(C, name='ReactionsReactionSetByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionsReactionSetByFissionGenre + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ReactionsReactionHasByLabel(handle, meta, metaSize) & + bind(C, name='ReactionsReactionHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ReactionsReactionHasByLabel +end function ReactionsReactionHasByLabel + +!! Get, by label, const +function ReactionsReactionGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ReactionsReactionGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ReactionsReactionGetByLabelConst +end function ReactionsReactionGetByLabelConst + +!! Get, by label +function ReactionsReactionGetByLabel(handle, meta, metaSize) & + bind(C, name='ReactionsReactionGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ReactionsReactionGetByLabel +end function ReactionsReactionGetByLabel + +!! Set, by label +subroutine ReactionsReactionSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ReactionsReactionSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionsReactionSetByLabel + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module transportReactions diff --git a/autogen/prototype/proto/python/runtests.sh b/autogen/prototype/proto/python/runtests.sh new file mode 100755 index 000000000..449471762 --- /dev/null +++ b/autogen/prototype/proto/python/runtests.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# this script copies the dynamic library for the GNDStk python module +# and runs all the unit tests it can find + +rm GNDStk*.so +cp ../../../../build/GNDStk*.so . +python -m unittest discover -v -p "Test*" diff --git a/autogen/prototype/proto/python/src/all.python.cpp b/autogen/prototype/proto/python/src/all.python.cpp new file mode 100644 index 000000000..e23a73f25 --- /dev/null +++ b/autogen/prototype/proto/python/src/all.python.cpp @@ -0,0 +1,38 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// ----------------------------------------------------------------------------- +// core +// ----------------------------------------------------------------------------- + +// core +#include "GNDStk.python.cpp" + +// node +#include "core/Node.python.cpp" + + +// ----------------------------------------------------------------------------- +// v1.9 +// ----------------------------------------------------------------------------- + +// v1.9 +#include "v1.9.python.cpp" + +// namespace containers +#include "v1.9/containers.python.cpp" +#include "v1.9/containers/Axes.python.cpp" +#include "v1.9/containers/Axis.python.cpp" +#include "v1.9/containers/Grid.python.cpp" +#include "v1.9/containers/Link.python.cpp" +#include "v1.9/containers/Regions1d.python.cpp" +#include "v1.9/containers/Values.python.cpp" +#include "v1.9/containers/XYs1d.python.cpp" + +// namespace transport +#include "v1.9/transport.python.cpp" +#include "v1.9/transport/CrossSection.python.cpp" +#include "v1.9/transport/Reaction.python.cpp" +#include "v1.9/transport/ReactionSuite.python.cpp" +#include "v1.9/transport/Reactions.python.cpp" diff --git a/autogen/prototype/proto/python/src/v1.9.python.cpp b/autogen/prototype/proto/python/src/v1.9.python.cpp new file mode 100644 index 000000000..6a63efd77 --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9.python.cpp @@ -0,0 +1,31 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +// project proto +namespace python_proto { + + // version v1.9: namespace wrapper declarations + namespace python_v1_9 { + void wrapContainers(pybind11::module &); + void wrapTransport(pybind11::module &); + } // namespace python_v1_9 + + // version v1.9: wrapper + void wrapV1_9(pybind11::module &module) + { + // v1.9 + pybind11::module submodule = module.def_submodule( + "v1_9", + "proto v1.9" + ); + + // v1.9 namespaces + python_v1_9::wrapContainers(submodule); + python_v1_9::wrapTransport(submodule); + } + +} // namespace python_proto diff --git a/autogen/prototype/proto/python/src/v1.9/containers.python.cpp b/autogen/prototype/proto/python/src/v1.9/containers.python.cpp new file mode 100644 index 000000000..4bf617c5c --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers.python.cpp @@ -0,0 +1,41 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +// v1.9 interface +namespace python_v1_9 { + +// containers declarations +namespace python_containers { + void wrapLink(pybind11::module &); + void wrapAxis(pybind11::module &); + void wrapValues(pybind11::module &); + void wrapGrid(pybind11::module &); + void wrapAxes(pybind11::module &); + void wrapXYs1d(pybind11::module &); + void wrapRegions1d(pybind11::module &); +} // namespace python_containers + +// wrapper for containers +void wrapContainers(pybind11::module &module) +{ + // create the containers submodule + pybind11::module submodule = module.def_submodule( + "containers", + "proto v1.9 containers" + ); + + // wrap containers components + python_containers::wrapLink(submodule); + python_containers::wrapAxis(submodule); + python_containers::wrapValues(submodule); + python_containers::wrapGrid(submodule); + python_containers::wrapAxes(submodule); + python_containers::wrapXYs1d(submodule); + python_containers::wrapRegions1d(submodule); +}; + +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/containers/Axes.python.cpp b/autogen/prototype/proto/python/src/v1.9/containers/Axes.python.cpp new file mode 100644 index 000000000..bb1c331da --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Axes.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Axes.hpp" +#include "definitions.hpp" + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Axes +void wrapAxes(pybind11::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::Axes; + using axis_grid_t = std::variant< + containers::Axis, + containers::Grid + >; + + // create the Python object + pybind11::class_ object( + module, "Axes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::vector & + >(), + pybind11::arg("href") = std::nullopt, + pybind11::arg("axis_grid"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + object.def_property( + "axis_grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis_grid(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.axis_grid() = value; + }, + cppCLASS::component_t::documentation("axis_grid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/containers/Axis.python.cpp b/autogen/prototype/proto/python/src/v1.9/containers/Axis.python.cpp new file mode 100644 index 000000000..16d6bbe35 --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Axis.python.cpp @@ -0,0 +1,91 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Axis.hpp" +#include "definitions.hpp" + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Axis +void wrapAxis(pybind11::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::Axis; + + // create the Python object + pybind11::class_ object( + module, "Axis", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("index") = std::nullopt, + pybind11::arg("label") = std::nullopt, + pybind11::arg("unit") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set index + object.def_property( + "index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.index(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/containers/Grid.python.cpp b/autogen/prototype/proto/python/src/v1.9/containers/Grid.python.cpp new file mode 100644 index 000000000..1e419d47d --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Grid.python.cpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Grid.hpp" +#include "definitions.hpp" + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Grid +void wrapGrid(pybind11::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::Grid; + using link_values_t = std::variant< + containers::Values, + containers::Link + >; + + // create the Python object + pybind11::class_ object( + module, "Grid", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const link_values_t & + >(), + pybind11::arg("index") = std::nullopt, + pybind11::arg("interpolation") = std::nullopt, + pybind11::arg("label") = std::nullopt, + pybind11::arg("style") = std::nullopt, + pybind11::arg("unit") = std::nullopt, + pybind11::arg("link_values"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set index + object.def_property( + "index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.index(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set interpolation + object.def_property( + "interpolation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interpolation().value(); + }, + [](cppCLASS &self, const enums::Interpolation &value) + { + self.interpolation() = value; + }, + cppCLASS::component_t::documentation("interpolation").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set style + object.def_property( + "style", + [](const cppCLASS &self) -> decltype(auto) + { + return self.style(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.style() = value; + }, + cppCLASS::component_t::documentation("style").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const containers::Values &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + object.def_property( + "link", + [](const cppCLASS &self) -> decltype(auto) + { + return self.link(); + }, + [](cppCLASS &self, const containers::Link &value) + { + self.link() = value; + }, + cppCLASS::component_t::documentation("link").data() + ); + + object.def_property( + "link_values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.link_values(); + }, + [](cppCLASS &self, const link_values_t &value) + { + self.link_values() = value; + }, + cppCLASS::component_t::documentation("link_values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/containers/Link.python.cpp b/autogen/prototype/proto/python/src/v1.9/containers/Link.python.cpp new file mode 100644 index 000000000..2ee4423bc --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Link.python.cpp @@ -0,0 +1,59 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Link.hpp" +#include "definitions.hpp" + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Link +void wrapLink(pybind11::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::Link; + + // create the Python object + pybind11::class_ object( + module, "Link", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string & + >(), + pybind11::arg("href"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/containers/Regions1d.python.cpp b/autogen/prototype/proto/python/src/v1.9/containers/Regions1d.python.cpp new file mode 100644 index 000000000..bac6e7c0c --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Regions1d.python.cpp @@ -0,0 +1,107 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Regions1d.hpp" +#include "definitions.hpp" + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Regions1d +void wrapRegions1d(pybind11::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::Regions1d; + + // create the Python object + pybind11::class_ object( + module, "Regions1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::vector & + >(), + pybind11::arg("label") = std::nullopt, + pybind11::arg("outer_domain_value") = std::nullopt, + pybind11::arg("axes") = std::nullopt, + pybind11::arg("xys1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set outerDomainValue + object.def_property( + "outer_domain_value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outerDomainValue(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.outerDomainValue() = value; + }, + cppCLASS::component_t::documentation("outer_domain_value").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/containers/Values.python.cpp b/autogen/prototype/proto/python/src/v1.9/containers/Values.python.cpp new file mode 100644 index 000000000..04ae6ea6d --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/Values.python.cpp @@ -0,0 +1,160 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/Values.hpp" +#include "definitions.hpp" + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::Values +void wrapValues(pybind11::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::Values; + + // create the Python object + pybind11::class_ object( + module, "Values", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("value_type") = std::nullopt, + pybind11::arg("start") = std::nullopt, + pybind11::arg("length") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set valueType + object.def_property( + "value_type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.valueType().value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.valueType() = value; + }, + cppCLASS::component_t::documentation("value_type").data() + ); + + // get/set start + object.def_property( + "start", + [](const cppCLASS &self) -> decltype(auto) + { + return self.start().value(); + }, + [](cppCLASS &self, const int &value) + { + self.start() = value; + }, + cppCLASS::component_t::documentation("start").data() + ); + + // get/set length + object.def_property( + "length", + [](const cppCLASS &self) -> decltype(auto) + { + return self.length(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.length() = value; + }, + cppCLASS::component_t::documentation("length").data() + ); + + // get/set vector + object.def_property( + "ints", + [](const cppCLASS &self) -> const std::vector & + { + return self.ints(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.ints() = value; + }, + cppCLASS::component_t::documentation("ints").data() + ); + + // get/set vector + object.def_property( + "doubles", + [](const cppCLASS &self) -> const std::vector & + { + return self.doubles(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.doubles() = value; + }, + cppCLASS::component_t::documentation("doubles").data() + ); + + // get/set vector + object.def_property( + "strings", + [](const cppCLASS &self) -> const std::vector & + { + return self.strings(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.strings() = value; + }, + cppCLASS::component_t::documentation("strings").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/containers/XYs1d.python.cpp b/autogen/prototype/proto/python/src/v1.9/containers/XYs1d.python.cpp new file mode 100644 index 000000000..bda5244de --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/containers/XYs1d.python.cpp @@ -0,0 +1,139 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/containers/XYs1d.hpp" +#include "definitions.hpp" + +namespace python_v1_9 { +namespace python_containers { + +// wrapper for containers::XYs1d +void wrapXYs1d(pybind11::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = containers::XYs1d; + + // create the Python object + pybind11::class_ object( + module, "XYs1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const containers::Values & + >(), + pybind11::arg("index") = std::nullopt, + pybind11::arg("interpolation") = std::nullopt, + pybind11::arg("label") = std::nullopt, + pybind11::arg("outer_domain_value") = std::nullopt, + pybind11::arg("axes") = std::nullopt, + pybind11::arg("values"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set index + object.def_property( + "index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.index(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set interpolation + object.def_property( + "interpolation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interpolation().value(); + }, + [](cppCLASS &self, const enums::Interpolation &value) + { + self.interpolation() = value; + }, + cppCLASS::component_t::documentation("interpolation").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set outerDomainValue + object.def_property( + "outer_domain_value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outerDomainValue(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.outerDomainValue() = value; + }, + cppCLASS::component_t::documentation("outer_domain_value").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const containers::Values &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_containers +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/proto.python.cpp b/autogen/prototype/proto/python/src/v1.9/proto.python.cpp new file mode 100644 index 000000000..ee71055af --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/proto.python.cpp @@ -0,0 +1,25 @@ + +#include +#include + +// v1.9 interface declarations +namespace python_v1_9 { + void wrapContainers(pybind11::module &); + void wrapTransport(pybind11::module &); +} + +namespace python_v1_9 { + +void wrapGNDS(pybind11::module &module) +{ + // create the core submodule + pybind11::module submodule = module.def_submodule( + "v1_9", + "GNDS 1.9 standard components" + ); + + python_v1_9::wrapContainers(submodule); + python_v1_9::wrapTransport(submodule); +} + +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/transport.python.cpp b/autogen/prototype/proto/python/src/v1.9/transport.python.cpp new file mode 100644 index 000000000..122e8b3ff --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/transport.python.cpp @@ -0,0 +1,35 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +// v1.9 interface +namespace python_v1_9 { + +// transport declarations +namespace python_transport { + void wrapCrossSection(pybind11::module &); + void wrapReaction(pybind11::module &); + void wrapReactions(pybind11::module &); + void wrapReactionSuite(pybind11::module &); +} // namespace python_transport + +// wrapper for transport +void wrapTransport(pybind11::module &module) +{ + // create the transport submodule + pybind11::module submodule = module.def_submodule( + "transport", + "proto v1.9 transport" + ); + + // wrap transport components + python_transport::wrapCrossSection(submodule); + python_transport::wrapReaction(submodule); + python_transport::wrapReactions(submodule); + python_transport::wrapReactionSuite(submodule); +}; + +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/transport/CrossSection.python.cpp b/autogen/prototype/proto/python/src/v1.9/transport/CrossSection.python.cpp new file mode 100644 index 000000000..c6c462c0d --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/transport/CrossSection.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/transport/CrossSection.hpp" +#include "definitions.hpp" + +namespace python_v1_9 { +namespace python_transport { + +// wrapper for transport::CrossSection +void wrapCrossSection(pybind11::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = transport::CrossSection; + using XYs1d_regions1d_t = std::variant< + containers::XYs1d, + containers::Regions1d + >; + + // create the Python object + pybind11::class_ object( + module, "CrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("xys1d_regions1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + object.def_property( + "xys1d_regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d_regions1d(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.XYs1d_regions1d() = value; + }, + cppCLASS::component_t::documentation("xys1d_regions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/transport/Reaction.python.cpp b/autogen/prototype/proto/python/src/v1.9/transport/Reaction.python.cpp new file mode 100644 index 000000000..cb59b079a --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/transport/Reaction.python.cpp @@ -0,0 +1,107 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/transport/Reaction.hpp" +#include "definitions.hpp" + +namespace python_v1_9 { +namespace python_transport { + +// wrapper for transport::Reaction +void wrapReaction(pybind11::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = transport::Reaction; + + // create the Python object + pybind11::class_ object( + module, "Reaction", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const int &, + const std::optional &, + const std::string &, + const transport::CrossSection & + >(), + pybind11::arg("endf_mt"), + pybind11::arg("fission_genre") = std::nullopt, + pybind11::arg("label"), + pybind11::arg("cross_section"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set ENDF_MT + object.def_property( + "endf_mt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDF_MT(); + }, + [](cppCLASS &self, const int &value) + { + self.ENDF_MT() = value; + }, + cppCLASS::component_t::documentation("endf_mt").data() + ); + + // get/set fissionGenre + object.def_property( + "fission_genre", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionGenre(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.fissionGenre() = value; + }, + cppCLASS::component_t::documentation("fission_genre").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set crossSection + object.def_property( + "cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSection(); + }, + [](cppCLASS &self, const transport::CrossSection &value) + { + self.crossSection() = value; + }, + cppCLASS::component_t::documentation("cross_section").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/transport/ReactionSuite.python.cpp b/autogen/prototype/proto/python/src/v1.9/transport/ReactionSuite.python.cpp new file mode 100644 index 000000000..9a69a43fc --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/transport/ReactionSuite.python.cpp @@ -0,0 +1,155 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/transport/ReactionSuite.hpp" +#include "definitions.hpp" + +namespace python_v1_9 { +namespace python_transport { + +// wrapper for transport::ReactionSuite +void wrapReactionSuite(pybind11::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = transport::ReactionSuite; + + // create the Python object + pybind11::class_ object( + module, "ReactionSuite", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string &, + const enums::Frame &, + const std::string &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("evaluation"), + pybind11::arg("format"), + pybind11::arg("projectile"), + pybind11::arg("projectile_frame"), + pybind11::arg("target"), + pybind11::arg("interaction") = std::nullopt, + pybind11::arg("reactions") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set evaluation + object.def_property( + "evaluation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaluation(); + }, + [](cppCLASS &self, const std::string &value) + { + self.evaluation() = value; + }, + cppCLASS::component_t::documentation("evaluation").data() + ); + + // get/set format + object.def_property( + "format", + [](const cppCLASS &self) -> decltype(auto) + { + return self.format(); + }, + [](cppCLASS &self, const std::string &value) + { + self.format() = value; + }, + cppCLASS::component_t::documentation("format").data() + ); + + // get/set projectile + object.def_property( + "projectile", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectile(); + }, + [](cppCLASS &self, const std::string &value) + { + self.projectile() = value; + }, + cppCLASS::component_t::documentation("projectile").data() + ); + + // get/set projectileFrame + object.def_property( + "projectile_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectileFrame(); + }, + [](cppCLASS &self, const enums::Frame &value) + { + self.projectileFrame() = value; + }, + cppCLASS::component_t::documentation("projectile_frame").data() + ); + + // get/set target + object.def_property( + "target", + [](const cppCLASS &self) -> decltype(auto) + { + return self.target(); + }, + [](cppCLASS &self, const std::string &value) + { + self.target() = value; + }, + cppCLASS::component_t::documentation("target").data() + ); + + // get/set interaction + object.def_property( + "interaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interaction(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.interaction() = value; + }, + cppCLASS::component_t::documentation("interaction").data() + ); + + // get/set reactions + object.def_property( + "reactions", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reactions(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.reactions() = value; + }, + cppCLASS::component_t::documentation("reactions").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v1_9 diff --git a/autogen/prototype/proto/python/src/v1.9/transport/Reactions.python.cpp b/autogen/prototype/proto/python/src/v1.9/transport/Reactions.python.cpp new file mode 100644 index 000000000..da41654ff --- /dev/null +++ b/autogen/prototype/proto/python/src/v1.9/transport/Reactions.python.cpp @@ -0,0 +1,59 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "proto/v1.9/transport/Reactions.hpp" +#include "definitions.hpp" + +namespace python_v1_9 { +namespace python_transport { + +// wrapper for transport::Reactions +void wrapReactions(pybind11::module &module) +{ + using namespace proto; + using namespace proto::v1_9; + + // type aliases + using cppCLASS = transport::Reactions; + + // create the Python object + pybind11::class_ object( + module, "Reactions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("reaction"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set reaction + object.def_property( + "reaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reaction(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.reaction() = value; + }, + cppCLASS::component_t::documentation("reaction").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_transport +} // namespace python_v1_9 diff --git a/python/test/v1_9/__init__.py b/autogen/prototype/proto/python/test/v1.9/__init__.py similarity index 100% rename from python/test/v1_9/__init__.py rename to autogen/prototype/proto/python/test/v1.9/__init__.py diff --git a/autogen/prototype/proto/python/test/v1.9/__init__.pyc b/autogen/prototype/proto/python/test/v1.9/__init__.pyc new file mode 100644 index 000000000..fdd90207b Binary files /dev/null and b/autogen/prototype/proto/python/test/v1.9/__init__.pyc differ diff --git a/python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Axis.py b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Axis.py similarity index 89% rename from python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Axis.py rename to autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Axis.py index 4969f1ff9..6fc894786 100644 --- a/python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Axis.py +++ b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Axis.py @@ -9,7 +9,7 @@ class Test_GNDStk_v1_9_containers_Axis( unittest.TestCase ) : """Unit test for the Section class.""" - chunk = ( '\n' ) + chunk = ( '' ) wrong = ( '' ) def test_component( self ) : @@ -32,17 +32,17 @@ def verify_chunk( self, chunk ) : # verify string self.assertEqual( self.chunk, chunk.to_xml_string() ) - # the data is given explicitly + # the data are given explicitly chunk = Axis( index = 1, label = 'energy_in', unit = 'eV' ) verify_chunk( self, chunk ) - # the data is read from a string + # the data are read from a string chunk = Axis.from_string( self.chunk ) verify_chunk( self, chunk ) - # the data is copied + # the data are copied copy = Axis( chunk ) verify_chunk( self, copy ) diff --git a/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Axis.pyc b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Axis.pyc new file mode 100644 index 000000000..55dc979f1 Binary files /dev/null and b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Axis.pyc differ diff --git a/python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Grid.py b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Grid.py similarity index 87% rename from python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Grid.py rename to autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Grid.py index 133fdd77a..ed102cbc4 100644 --- a/python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Grid.py +++ b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Grid.py @@ -12,14 +12,14 @@ class Test_GNDStk_v1_9_containers_Grid( unittest.TestCase ) : """Unit test for the Section class.""" chunk = ( '\n' - ' 1e-05 2e+07\n' - '\n' ) + ' 1e-05 2e+07\n' + '' ) chunkWithLink = ( '\n' ' \n' - '\n' ) + '' ) wrong = ( '\n' - ' 1e-05 2e+07\n' - '\n' ) + ' 1e-05 2e+07\n' + '' ) def test_component( self ) : @@ -57,19 +57,19 @@ def verify_chunk( self, chunk ) : # verify string self.assertEqual( self.chunk, chunk.to_xml_string() ) - # the data is given explicitly + # the data are given explicitly chunk = Grid( index = 2, label = "row_energy_bounds", unit = "eV", style = GridStyle.boundaries, link_values = Values( [ 1e-5, 2e7 ] ) ) verify_chunk( self, chunk ) - # the data is read from a string + # the data are read from a string chunk = Grid.from_string( self.chunk ) verify_chunk( self, chunk ) - # the data is copied + # the data are copied copy = Grid( chunk ) verify_chunk( self, copy ) diff --git a/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Grid.pyc b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Grid.pyc new file mode 100644 index 000000000..07eb98480 Binary files /dev/null and b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Grid.pyc differ diff --git a/python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Link.py b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Link.py similarity index 84% rename from python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Link.py rename to autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Link.py index 9e28cc6ac..65a2fc61b 100644 --- a/python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Link.py +++ b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Link.py @@ -9,8 +9,8 @@ class Test_GNDStk_v1_9_containers_Link( unittest.TestCase ) : """Unit test for the Section class.""" - chunk = ( '\n' ) - wrong = ( '\n' ) + chunk = ( '' ) + wrong = ( '' ) def test_component( self ) : @@ -22,17 +22,17 @@ def verify_chunk( self, chunk ) : # verify string self.assertEqual( self.chunk, chunk.to_xml_string() ) - # the data is given explicitly + # the data are given explicitly chunk = Link( href = '../../grid[@index=\'2\']/values' ) verify_chunk( self, chunk ) - # the data is read from a string + # the data are read from a string chunk = Link.from_string( self.chunk ) verify_chunk( self, chunk ) - # the data is copied + # the data are copied copy = Link( chunk ) verify_chunk( self, copy ) diff --git a/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Link.pyc b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Link.pyc new file mode 100644 index 000000000..abb7681c7 Binary files /dev/null and b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Link.pyc differ diff --git a/python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Values.py b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Values.py similarity index 80% rename from python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Values.py rename to autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Values.py index 117ea1178..a64ae9db4 100644 --- a/python/test/v1_9/containers/Test_GNDStk_v1_9_containers_Values.py +++ b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Values.py @@ -9,10 +9,10 @@ class Test_GNDStk_v1_9_containers_Values( unittest.TestCase ) : """Unit test for the Section class.""" - chunk_doubles = ( '2500 8.9172 2550 8.9155\n' ) - chunk_ints = ( '2500 9 2550 9\n' ) - chunk_strings = ( '2500 8.9172 2550 8.9155\n' ) - wrong = ( '2500 8.9172 2550 8.9155\n' ) + chunk_doubles = ( '2500 8.9172 2550 8.9155' ) + chunk_ints = ( '2500 9 2550 9' ) + chunk_strings = ( '2500 8.9172 2550 8.9155' ) + wrong = ( '2500 8.9172 2550 8.9155' ) def test_component( self ) : @@ -67,47 +67,47 @@ def verify_chunk_strings( self, chunk ) : # verify string self.assertEqual( self.chunk_strings, chunk.to_xml_string() ) - # the data is given explicitly (doubles) + # the data are given explicitly (doubles) chunk = Values( doubles = [ 2500., 8.9172, 2550., 8.9155 ] ) verify_chunk_doubles( self, chunk ) - # the data is read from a string + # the data are read from a string chunk = Values.from_string( self.chunk_doubles ) verify_chunk_doubles( self, chunk ) - # the data is copied + # the data are copied copy = Values( chunk ) verify_chunk_doubles( self, copy ) - # the data is given explicitly (ints) + # the data are given explicitly (ints) chunk = Values( ints = [ 2500, 9, 2550, 9 ] ) verify_chunk_ints( self, chunk ) - # the data is read from a string + # the data are read from a string chunk = Values.from_string( self.chunk_ints ) verify_chunk_ints( self, chunk ) - # the data is copied + # the data are copied copy = Values( chunk ) verify_chunk_ints( self, copy ) - # the data is given explicitly (strings) + # the data are given explicitly (strings) chunk = Values( strings = [ "2500", "8.9172", "2550", "8.9155" ] ) verify_chunk_strings( self, chunk ) - # the data is read from a string + # the data are read from a string chunk = Values.from_string( self.chunk_strings ) verify_chunk_strings( self, chunk ) - # the data is copied + # the data are copied copy = Values( chunk ) verify_chunk_strings( self, copy ) diff --git a/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Values.pyc b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Values.pyc new file mode 100644 index 000000000..30a1fd54f Binary files /dev/null and b/autogen/prototype/proto/python/test/v1.9/containers/Test_GNDStk_v1_9_containers_Values.pyc differ diff --git a/python/test/v1_9/containers/__init__.py b/autogen/prototype/proto/python/test/v1.9/containers/__init__.py similarity index 100% rename from python/test/v1_9/containers/__init__.py rename to autogen/prototype/proto/python/test/v1.9/containers/__init__.py diff --git a/autogen/prototype/proto/python/test/v1.9/containers/__init__.pyc b/autogen/prototype/proto/python/test/v1.9/containers/__init__.pyc new file mode 100644 index 000000000..56255e4e3 Binary files /dev/null and b/autogen/prototype/proto/python/test/v1.9/containers/__init__.pyc differ diff --git a/autogen/prototype/proto/src/proto/v1.9.hpp b/autogen/prototype/proto/src/proto/v1.9.hpp new file mode 100644 index 000000000..771423efb --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9.hpp @@ -0,0 +1,24 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9 +#define PROTO_V1_9 + +#include "proto/v1.9/containers/Axes.hpp" +#include "proto/v1.9/containers/Axis.hpp" + +#include "proto/v1.9/transport/CrossSection.hpp" + +#include "proto/v1.9/containers/Grid.hpp" +#include "proto/v1.9/containers/Link.hpp" + +#include "proto/v1.9/transport/Reaction.hpp" +#include "proto/v1.9/transport/ReactionSuite.hpp" +#include "proto/v1.9/transport/Reactions.hpp" + +#include "proto/v1.9/containers/Regions1d.hpp" +#include "proto/v1.9/containers/Values.hpp" +#include "proto/v1.9/containers/XYs1d.hpp" + +#endif diff --git a/autogen/prototype/proto/src/proto/v1.9/containers/Axes.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Axes.hpp new file mode 100644 index 000000000..da16fb44e --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Axes.hpp @@ -0,0 +1,205 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_CONTAINERS_AXES +#define PROTO_V1_9_CONTAINERS_AXES + +#include "proto/v1.9/containers/Axis.hpp" +#include "proto/v1.9/containers/Grid.hpp" + +namespace proto { +namespace v1_9 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Axes +// ----------------------------------------------------------------------------- + +class Axes : + public Component +{ + friend class Component; + + using axis_grid_t = std::variant< + containers::Axis, + containers::Grid + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "containers"; } + static auto CLASS() { return "Axes"; } + static auto NODENAME() { return "axes"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("href") | + + // children + axis_grid_t{} + / ++(Child<>("axis") || Child<>("grid")) + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "href", + "axis_grid" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "href", + "axis_grid" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + href{this}; + + // children - variant + Field> + axis_grid{this}; + FieldPart axis{axis_grid}; + FieldPart grid{axis_grid}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + this->axis_grid \ + ) + + // default + Axes() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Axes( + const wrapper> + &href, + const wrapper> + &axis_grid = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + href(this,href), + axis_grid(this,axis_grid) + { + Component::finish(); + } + + // from node + explicit Axes(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Axes(const Axes &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href), + axis_grid(this,other.axis_grid) + { + Component::finish(other); + } + + // move + Axes(Axes &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)), + axis_grid(this,std::move(other.axis_grid)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Axes &operator=(const Axes &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + href = other.href; + axis_grid = other.axis_grid; + } + return *this; + } + + // move + Axes &operator=(Axes &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + href = std::move(other.href); + axis_grid = std::move(other.axis_grid); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "proto/v1.9/containers/Axes/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Axes + +} // namespace containers +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/src/GNDStk/v1.9/containers/Axes/src/custom.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Axes/src/custom.hpp similarity index 100% rename from src/GNDStk/v1.9/containers/Axes/src/custom.hpp rename to autogen/prototype/proto/src/proto/v1.9/containers/Axes/src/custom.hpp diff --git a/autogen/prototype/proto/src/proto/v1.9/containers/Axes/test/Axes.test.cpp b/autogen/prototype/proto/src/proto/v1.9/containers/Axes/test/Axes.test.cpp new file mode 100644 index 000000000..d19c2836f --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Axes/test/Axes.test.cpp @@ -0,0 +1,338 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "proto/v1.9/containers/Axes.hpp" + +// convenience typedefs +using namespace njoy::GNDStk; +using namespace proto; +using namespace v1_9; + +using Axes = containers::Axes; +using Axis = containers::Axis; +using Grid = containers::Grid; +using Values = containers::Values; +using Link = containers::Link; + +std::string chunk(); +void verifyChunk( const Axes& ); +std::string invalidName(); + +SCENARIO( "Axes" ) { + njoy::GNDStk::sort = true; + + GIVEN( "valid data for the component" ) { + + std::string string = chunk(); + + WHEN( "autogenerated constructor: the data are given explicitly" ) { + + std::vector< std::variant< Axis, Grid > > axis = { + + Axis( 1, "energy_in", "eV" ), + Axis( 0, "radius", "fm" ) + }; + + using agvector = std::vector>; + + using v1_9::index; + THEN ( "Various getters work as expected" ) { + { + const Axes a1(std::nullopt, agvector{Axis(1)}); + Axes a2(std::nullopt, agvector{Axis(2)}); + const Axis *ptr1 = a1.axis.ptr(index(1)); + Axis *ptr2 = a2.axis.ptr(index(2)); + CHECK(ptr1 != nullptr); + CHECK(ptr2 != nullptr); + + const Axes a3(std::nullopt, agvector{Grid(1)}); + Axes a4(std::nullopt, agvector{Grid(2)}); + const Grid *ptr3 = a3.grid.ptr(index(1)); + Grid *ptr4 = a4.grid.ptr(index(2)); + CHECK(ptr3 != nullptr); + CHECK(ptr4 != nullptr); + } + + { + const Axes a1(std::nullopt, agvector{Axis(1)}); + Axes a2(std::nullopt, agvector{Axis(2)}); + const Grid *ptr1 = a1.grid.ptr(index(1)); + Grid *ptr2 = a2.grid.ptr(index(2)); + CHECK(ptr1 == nullptr); + CHECK(ptr2 == nullptr); + + const Axes a3(std::nullopt, agvector{Grid(1)}); + Axes a4(std::nullopt, agvector{Grid(2)}); + const Axis *ptr3 = a3.axis.ptr(index(1)); + Axis *ptr4 = a4.axis.ptr(index(2)); + CHECK(ptr3 == nullptr); + CHECK(ptr4 == nullptr); + } + } + + Axes chunk( std::nullopt, axis ); + + THEN( "the component can be constructed and members can be tested" ) { + + verifyChunk( chunk ); + } // THEN + + THEN( "it can be written in XML" ) { + + std::ostringstream out; + XML( Node( chunk ) ).write( out, false ); + + CHECK( out.str() == string ); + } // THEN + } // WHEN + + WHEN( "the data are constructed from a node" ) { + + Node node; + node << chunk(); + Axes chunk( node ); + + THEN( "the component can be constructed and members can be tested" ) { + + verifyChunk( chunk ); + } // THEN + + THEN( "it can be written in XML" ) { + + std::ostringstream out; + XML( Node( chunk ) ).write( out, false ); + + CHECK( out.str() == string ); + } // THEN + } // WHEN + } // GIVEN + + GIVEN( "a valid component instance" ) { + + WHEN( "the component is copied" ) { + + Node node; + node << chunk(); + Axes chunk( node ); + + // copy constructor + Axes copy( chunk ); + + // copy assignment + Axes assign; + assign = chunk; + + THEN( "the component can be constructed and members can be tested" ) { + + verifyChunk( copy ); + verifyChunk( assign ); + } // THEN + } // WHEN + + WHEN( "the data are moved" ) { + + Node node; + node << chunk(); + Axes chunk( node ); + Axes chunk2( node ); + + // move constructor + Axes move( std::move( chunk ) ); + + // move assignment + Axes assign; + assign = std::move( chunk2 ); + + THEN( "the component can be constructed and members can be tested" ) { + + verifyChunk( move ); + verifyChunk( assign ); + } // THEN + } // WHEN + } // GIVEN + + GIVEN( "invalid data" ) { + + WHEN( "when the wrong node is used" ) { + + Node node; + node << invalidName(); + + THEN( "an exception is thrown" ) { + + CHECK_THROWS( Axes( node ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO + +std::string chunk() { + + return +R"***( + + +)***"; +} + +void verifyChunk( const Axes& component ) { + + CHECK( std::nullopt == component.href() ); + + CHECK( 2 == component.axis_grid().size() ); + CHECK( 2 == component.axis_grid.size() ); + CHECK( 2 == component.axis.size() ); + CHECK( 2 == component.grid.size() ); + CHECK( 2 == component.size() ); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // indexing into the vector and accessing the variant directly + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + decltype(auto) axis_i0 = std::get< Axis >( component.axis_grid()[0] ); + + CHECK( std::nullopt != axis_i0.index() ); + CHECK( std::nullopt != axis_i0.label() ); + CHECK( std::nullopt != axis_i0.unit() ); + + CHECK( 0 == axis_i0.index().value() ); + CHECK( "radius" == axis_i0.label().value() ); + CHECK( "fm" == axis_i0.unit().value() ); + + decltype(auto) axis_i1 = std::get< Axis >( component.axis_grid()[1] ); + + CHECK( std::nullopt != axis_i1.index() ); + CHECK( std::nullopt != axis_i1.label() ); + CHECK( std::nullopt != axis_i1.unit() ); + + CHECK( 1 == axis_i1.index().value() ); + CHECK( "energy_in" == axis_i1.label().value() ); + CHECK( "eV" == axis_i1.unit().value() ); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // using the index based axis_grid getter and accessing the variant directly + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + using v1_9::index; + decltype(auto) axis_ii0 = std::get< Axis >( + component.axis_grid[index(0)]); + + CHECK( std::nullopt != axis_ii0.index() ); + CHECK( std::nullopt != axis_ii0.label() ); + CHECK( std::nullopt != axis_ii0.unit() ); + + CHECK( 0 == axis_ii0.index().value() ); + CHECK( "radius" == axis_ii0.label().value() ); + CHECK( "fm" == axis_ii0.unit().value() ); + + decltype(auto) axis_ii1 = std::get< Axis >( + component.axis_grid[index(1)]); + + CHECK( std::nullopt != axis_ii1.index() ); + CHECK( std::nullopt != axis_ii1.label() ); + CHECK( std::nullopt != axis_ii1.unit() ); + + CHECK( 1 == axis_ii1.index().value() ); + CHECK( "energy_in" == axis_ii1.label().value() ); + CHECK( "eV" == axis_ii1.unit().value() ); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // using the label based axis_grid getter and accessing the variant directly + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + decltype(auto) axis_iii0 = std::get< Axis >( + component.axis_grid[meta::label("radius")]); + + CHECK( std::nullopt != axis_iii0.index() ); + CHECK( std::nullopt != axis_iii0.label() ); + CHECK( std::nullopt != axis_iii0.unit() ); + + CHECK( 0 == axis_iii0.index().value() ); + CHECK( "radius" == axis_iii0.label().value() ); + CHECK( "fm" == axis_iii0.unit().value() ); + + decltype(auto) axis_iii1 = std::get< Axis >( + component.axis_grid[meta::label("energy_in")]); + + CHECK( std::nullopt != axis_iii1.index() ); + CHECK( std::nullopt != axis_iii1.label() ); + CHECK( std::nullopt != axis_iii1.unit() ); + + CHECK( 1 == axis_iii1.index().value() ); + CHECK( "energy_in" == axis_iii1.label().value() ); + CHECK( "eV" == axis_iii1.unit().value() ); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // using the index based axis getter + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + CHECK(component.axis(has(index(0)))); + CHECK(component.axis.has(index(0))); + CHECK(component.axis_grid.has(index)); + CHECK(component.axis_grid.has(index(0))); + decltype(auto) axis_iv0 = component.axis[index(0)]; + + CHECK( std::nullopt != axis_iv0.index() ); + CHECK( std::nullopt != axis_iv0.label() ); + CHECK( std::nullopt != axis_iv0.unit() ); + + CHECK( 0 == axis_iv0.index().value() ); + CHECK( "radius" == axis_iv0.label().value() ); + CHECK( "fm" == axis_iv0.unit().value() ); + + CHECK(component.axis(has(index(1)))); + CHECK(component.axis.has(index(1)) ); + CHECK(component.axis_grid.has(index)); + CHECK(component.axis_grid.has(index(1))); + decltype(auto) axis_iv1 = component.axis[index(1)]; + + CHECK( std::nullopt != axis_iv1.index() ); + CHECK( std::nullopt != axis_iv1.label() ); + CHECK( std::nullopt != axis_iv1.unit() ); + + CHECK( 1 == axis_iv1.index().value() ); + CHECK( "energy_in" == axis_iv1.label().value() ); + CHECK( "eV" == axis_iv1.unit().value() ); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // using the label based axis getter + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + CHECK(component.axis(has(meta::label("radius")))); + CHECK(component.axis.has(meta::label("radius"))); + CHECK(component.axis_grid.has(meta::label)); + CHECK(component.axis_grid.has(meta::label("radius"))); + decltype(auto) axis_v0 = component.axis[meta::label("radius")]; + + CHECK( std::nullopt != axis_v0.index() ); + CHECK( std::nullopt != axis_v0.label() ); + CHECK( std::nullopt != axis_v0.unit() ); + + CHECK( 0 == axis_v0.index().value() ); + CHECK( "radius" == axis_v0.label().value() ); + CHECK( "fm" == axis_v0.unit().value() ); + + CHECK(component.axis(has(meta::label("energy_in")))); + CHECK(component.axis.has(meta::label("energy_in"))); + CHECK(component.axis_grid.has(meta::label)); + CHECK(component.axis_grid.has(meta::label("energy_in"))); + decltype(auto) axis_v1 = component.axis[meta::label("energy_in")]; + + CHECK( std::nullopt != axis_v1.index() ); + CHECK( std::nullopt != axis_v1.label() ); + CHECK( std::nullopt != axis_v1.unit() ); + + CHECK( 1 == axis_v1.index().value() ); + CHECK( "energy_in" == axis_v1.label().value() ); + CHECK( "eV" == axis_v1.unit().value() ); +} + +std::string invalidName() { + + // wrong name for the node + return +R"***( + + )***"; +} diff --git a/src/GNDStk/v1.9/containers/Axes/test/CMakeLists.txt b/autogen/prototype/proto/src/proto/v1.9/containers/Axes/test/CMakeLists.txt similarity index 100% rename from src/GNDStk/v1.9/containers/Axes/test/CMakeLists.txt rename to autogen/prototype/proto/src/proto/v1.9/containers/Axes/test/CMakeLists.txt diff --git a/autogen/prototype/proto/src/proto/v1.9/containers/Axis.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Axis.hpp new file mode 100644 index 000000000..4ffea6fd6 --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Axis.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_CONTAINERS_AXIS +#define PROTO_V1_9_CONTAINERS_AXIS + +#include "proto/v1.9/key.hpp" + +namespace proto { +namespace v1_9 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Axis +// ----------------------------------------------------------------------------- + +class Axis : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "containers"; } + static auto CLASS() { return "Axis"; } + static auto NODENAME() { return "axis"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("index") | + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "index", + "label", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "index", + "label", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + index{this}; + Field> + label{this}; + Field> + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->label, \ + this->unit \ + ) + + // default + Axis() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Axis( + const wrapper> + &index, + const wrapper> + &label = {}, + const wrapper> + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + index(this,index), + label(this,label), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Axis(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Axis(const Axis &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + index(this,other.index), + label(this,other.label), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + Axis(Axis &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + index(this,std::move(other.index)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Axis &operator=(const Axis &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + index = other.index; + label = other.label; + unit = other.unit; + } + return *this; + } + + // move + Axis &operator=(Axis &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + index = std::move(other.index); + label = std::move(other.label); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "proto/v1.9/containers/Axis/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Axis + +} // namespace containers +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/autogen/prototype/proto/src/proto/v1.9/containers/Axis/src/custom.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Axis/src/custom.hpp new file mode 100644 index 000000000..94ea19739 --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Axis/src/custom.hpp @@ -0,0 +1,30 @@ + +private: + +static inline helpMap help = { + + { + "", + "A GNDS 1.9 basic container component: " + "an axis with an index, label and\n" + "optional unit\n\n" + "This component in used in the axes node, " + "which in turn is used in most\n" + "functional containers." + }, + + { + "constructor", + "Initialise the axis component\n\n" + "Arguments:\n" + " self the axis component\n" + " index the index of the axis component\n" + " label the label of the axis component\n" + " unit the unit of the axis component\n" + }, + + { "index", "The index of the axis component" }, + { "label", "The label of the axis component" }, + { "unit", "The unit of the axis component" } + +}; diff --git a/src/GNDStk/v1.9/containers/Axis/test/Axis.test.cpp b/autogen/prototype/proto/src/proto/v1.9/containers/Axis/test/Axis.test.cpp similarity index 88% rename from src/GNDStk/v1.9/containers/Axis/test/Axis.test.cpp rename to autogen/prototype/proto/src/proto/v1.9/containers/Axis/test/Axis.test.cpp index dd5adb194..878d83299 100644 --- a/src/GNDStk/v1.9/containers/Axis/test/Axis.test.cpp +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Axis/test/Axis.test.cpp @@ -1,12 +1,15 @@ + #define CATCH_CONFIG_MAIN #include "catch.hpp" -#include "GNDStk/v1.9/containers/Axis.hpp" +#include "proto/v1.9/containers/Axis.hpp" // other includes // convenience typedefs using namespace njoy::GNDStk; +using namespace proto; + using Axis = v1_9::containers::Axis; std::string chunk(); @@ -19,9 +22,9 @@ SCENARIO( "Axis" ) { std::string string = chunk(); - WHEN( "autogenerated constructor: the data is given explicitly" ) { + WHEN( "autogenerated constructor: the data are given explicitly" ) { - unsigned int index = 1; + unsigned index = 1; std::string label = "energy_in"; std::string unit = "eV"; @@ -41,7 +44,7 @@ SCENARIO( "Axis" ) { } // THEN } // WHEN - WHEN( "the data is constructed from a node" ) { + WHEN( "the data are constructed from a node" ) { Node node; node << chunk(); @@ -84,7 +87,7 @@ SCENARIO( "Axis" ) { } // THEN } // WHEN - WHEN( "the data is moved" ) { + WHEN( "the data are moved" ) { Node node; node << chunk(); @@ -124,8 +127,7 @@ SCENARIO( "Axis" ) { std::string chunk() { return -R"***( -)***"; +R"***()***"; } void verifyChunk( const Axis& component ) { @@ -147,6 +149,5 @@ std::string invalidName() { // wrong name for the node return -R"***( -)***"; +R"***()***"; } diff --git a/src/GNDStk/v1.9/containers/Axis/test/CMakeLists.txt b/autogen/prototype/proto/src/proto/v1.9/containers/Axis/test/CMakeLists.txt similarity index 100% rename from src/GNDStk/v1.9/containers/Axis/test/CMakeLists.txt rename to autogen/prototype/proto/src/proto/v1.9/containers/Axis/test/CMakeLists.txt diff --git a/autogen/prototype/proto/src/proto/v1.9/containers/Grid.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Grid.hpp new file mode 100644 index 000000000..cb2304fe1 --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Grid.hpp @@ -0,0 +1,270 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_CONTAINERS_GRID +#define PROTO_V1_9_CONTAINERS_GRID + +#include "GNDS/v2.0/enums/Interpolation.hpp" +#include "GNDS/v2.0/enums/GridStyle.hpp" + +#include "proto/v1.9/containers/Values.hpp" +#include "proto/v1.9/containers/Link.hpp" + +namespace proto { +namespace v1_9 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Grid +// ----------------------------------------------------------------------------- + +class Grid : + public Component +{ + friend class Component; + + using link_values_t = std::variant< + containers::Values, + containers::Link + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "containers"; } + static auto CLASS() { return "Grid"; } + static auto NODENAME() { return "grid"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("index") | + Defaulted{GNDS::v2_0::enums::Interpolation::linlin} + / Meta<>("interpolation") | + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("style") | + std::optional{} + / Meta<>("unit") | + + // children + link_values_t{} + / --(Child<>("values") || Child<>("link")) + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "index", + "interpolation", + "label", + "style", + "unit", + "link_values" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "index", + "interpolation", + "label", + "style", + "unit", + "link_values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const GNDS::v2_0::enums::Interpolation interpolation = GNDS::v2_0::enums::Interpolation::linlin; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + index{this}; + Field> + interpolation{this,defaults.interpolation}; + Field> + label{this}; + Field> + style{this}; + Field> + unit{this}; + + // children - variant + Field + link_values{this}; + FieldPart values{link_values}; + FieldPart link{link_values}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->interpolation, \ + this->label, \ + this->style, \ + this->unit, \ + this->link_values \ + ) + + // default + Grid() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Grid( + const wrapper> + &index, + const wrapper> + &interpolation = {}, + const wrapper> + &label = {}, + const wrapper> + &style = {}, + const wrapper> + &unit = {}, + const wrapper + &link_values = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + index(this,index), + interpolation(this,defaults.interpolation,interpolation), + label(this,label), + style(this,style), + unit(this,unit), + link_values(this,link_values) + { + Component::finish(); + } + + // from node + explicit Grid(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Grid(const Grid &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + index(this,other.index), + interpolation(this,other.interpolation), + label(this,other.label), + style(this,other.style), + unit(this,other.unit), + link_values(this,other.link_values) + { + Component::finish(other); + } + + // move + Grid(Grid &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + index(this,std::move(other.index)), + interpolation(this,std::move(other.interpolation)), + label(this,std::move(other.label)), + style(this,std::move(other.style)), + unit(this,std::move(other.unit)), + link_values(this,std::move(other.link_values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Grid &operator=(const Grid &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + index = other.index; + interpolation = other.interpolation; + label = other.label; + style = other.style; + unit = other.unit; + link_values = other.link_values; + } + return *this; + } + + // move + Grid &operator=(Grid &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + index = std::move(other.index); + interpolation = std::move(other.interpolation); + label = std::move(other.label); + style = std::move(other.style); + unit = std::move(other.unit); + link_values = std::move(other.link_values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "proto/v1.9/containers/Grid/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Grid + +} // namespace containers +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/src/GNDStk/v1.9/containers/Grid/src/custom.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Grid/src/custom.hpp similarity index 100% rename from src/GNDStk/v1.9/containers/Grid/src/custom.hpp rename to autogen/prototype/proto/src/proto/v1.9/containers/Grid/src/custom.hpp diff --git a/src/GNDStk/v1.9/containers/Grid/test/CMakeLists.txt b/autogen/prototype/proto/src/proto/v1.9/containers/Grid/test/CMakeLists.txt similarity index 100% rename from src/GNDStk/v1.9/containers/Grid/test/CMakeLists.txt rename to autogen/prototype/proto/src/proto/v1.9/containers/Grid/test/CMakeLists.txt diff --git a/autogen/prototype/proto/src/proto/v1.9/containers/Grid/test/Grid.test.cpp b/autogen/prototype/proto/src/proto/v1.9/containers/Grid/test/Grid.test.cpp new file mode 100644 index 000000000..89c6b571f --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Grid/test/Grid.test.cpp @@ -0,0 +1,311 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "proto/v1.9/containers/Grid.hpp" +using namespace GNDS::v2_0::enums; + +// other includes + +// convenience typedefs +using namespace njoy::GNDStk; +using namespace proto; + +using Values = v1_9::containers::Values; +using Link = v1_9::containers::Link; +using Grid = v1_9::containers::Grid; + +std::string chunk(); +void verifyChunk( const Grid& ); +std::string chunkWithLink(); +void verifyChunkWithLink( const Grid& ); +std::string invalidName(); + +SCENARIO( "Grid" ) { + + GIVEN( "valid data for the component with a Values component" ) { + + std::string string = chunk(); + + WHEN( "autogenerated constructor: the data are given explicitly" ) { + + unsigned index = 2; + std::string label = "row_energy_bounds"; + std::string unit = "eV"; + GridStyle style = GridStyle::boundaries; + std::vector< double > values = { 1e-5, 2e7 }; + + THEN ( "Various getters work as expected" ) { + { + const Grid g1(index,std::nullopt,label,style,unit,Values(values)); + Grid g2(index,std::nullopt,label,style,unit,Values(values)); + const Values *ptr1 = g1.values.ptr(); + Values *ptr2 = g2.values.ptr(); + CHECK(ptr1 != nullptr); + CHECK(ptr2 != nullptr); + + const Grid g3(index,std::nullopt,label,style,unit,Link("mylink")); + Grid g4(index,std::nullopt,label,style,unit,Link("mylink")); + const Link *ptr3 = g3.link.ptr(); + Link *ptr4 = g4.link.ptr(); + CHECK(ptr3 != nullptr); + CHECK(ptr4 != nullptr); + } + + { + const Grid g1(index,std::nullopt,label,style,unit,Values(values)); + Grid g2(index,std::nullopt,label,style,unit,Values(values)); + const Values *ptr1 = g1.values; + Values *ptr2 = g2.values; + const Values &ref1 = g1.values; + Values &ref2 = g2.values; + CHECK(ptr1 != nullptr); + CHECK(ptr2 != nullptr); + + const Grid g3(index,std::nullopt,label,style,unit,Link("mylink")); + Grid g4(index,std::nullopt,label,style,unit,Link("mylink")); + const Link *ptr3 = g3.link; + Link *ptr4 = g4.link; + const Link &ref3 = g3.link; + Link &ref4 = g4.link; + CHECK(ptr3 != nullptr); + CHECK(ptr4 != nullptr); + } + + { + const Grid g1(index,std::nullopt,label,style,unit,Values(values)); + Grid g2(index,std::nullopt,label,style,unit,Values(values)); + const Link *ptr1 = g1.link.ptr(); + Link *ptr2 = g2.link.ptr(); + CHECK(ptr1 == nullptr); + CHECK(ptr2 == nullptr); + + const Grid g3(index,std::nullopt,label,style,unit,Link("mylink")); + Grid g4(index,std::nullopt,label,style,unit,Link("mylink")); + const Values *ptr3 = g3.values.ptr(); + Values *ptr4 = g4.values.ptr(); + CHECK(ptr3 == nullptr); + CHECK(ptr4 == nullptr); + } + } + + Grid chunk( index, std::nullopt, label, style, unit, Values( values ) ); + + THEN( "the component can be constructed and members can be tested" ) { + + verifyChunk( chunk ); + } // THEN + + THEN( "it can be written in XML" ) { + + std::ostringstream out; + XML( Node( chunk ) ).write( out, false ); + + CHECK( out.str() == string ); + } // THEN + } // WHEN + + WHEN( "the data are constructed from a node" ) { + + Node node; + node << chunk(); + Grid chunk( node ); + + THEN( "the component can be constructed and members can be tested" ) { + + verifyChunk( chunk ); + } // THEN + + THEN( "it can be written in XML" ) { + + std::ostringstream out; + XML( Node( chunk ) ).write( out, false ); + + CHECK( out.str() == string ); + } // THEN + } // WHEN + } // GIVEN + + GIVEN( "valid data for the component with a Link component" ) { + + std::string string = chunkWithLink(); + + WHEN( "autogenerated constructor: the data are given explicitly" ) { + + unsigned index = 1; + std::string label = "column_energy_bounds"; + std::string unit = "eV"; + GridStyle style = GridStyle::link; + std::string href = "../../grid[@index='2']/values"; + + Grid chunk( index, std::nullopt, label, style, unit, + Link( href ) ); + + THEN( "the component can be constructed and members can be tested" ) { + + verifyChunkWithLink( chunk ); + } // THEN + + THEN( "it can be written in XML" ) { + + std::ostringstream out; + XML( Node( chunk ) ).write( out, false ); + + CHECK( out.str() == string ); + } // THEN + } // WHEN + + WHEN( "the data are constructed from a node" ) { + + Node node; + node << chunkWithLink(); + Grid chunk( node ); + + THEN( "the component can be constructed and members can be tested" ) { + + verifyChunkWithLink( chunk ); + } // THEN + + THEN( "it can be written in XML" ) { + + std::ostringstream out; + XML( Node( chunk ) ).write( out, false ); + + CHECK( out.str() == string ); + } // THEN + } // WHEN + } // GIVEN + + GIVEN( "a valid component instance" ) { + + WHEN( "the component is copied" ) { + + Node node; + node << chunk(); + Grid chunk( node ); + + // copy constructor + Grid copy( chunk ); + + // copy assignment + Grid assign; + assign = chunk; + + THEN( "the component can be constructed and members can be tested" ) { + + verifyChunk( copy ); + verifyChunk( assign ); + } // THEN + } // WHEN + + WHEN( "the data are moved" ) { + + Node node; + node << chunk(); + Grid chunk( node ); + Grid chunk2( node ); + + // move constructor + Grid move( std::move( chunk ) ); + + // move assignment + Grid assign; + assign = std::move( chunk2 ); + + THEN( "the component can be constructed and members can be tested" ) { + + verifyChunk( move ); + verifyChunk( assign ); + } // THEN + } // WHEN + } // GIVEN + + GIVEN( "invalid data" ) { + + WHEN( "when the wrong node is used" ) { + + Node node; + node << invalidName(); + + THEN( "an exception is thrown" ) { + + CHECK_THROWS( Grid( node ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO + +std::string chunk() { + + return +R"***( + 1e-05 2e+07 +)***"; +} + +void verifyChunk( const Grid& component ) { + + CHECK( std::nullopt != component.index() ); + CHECK( std::nullopt != component.label() ); + CHECK( std::nullopt != component.style() ); + CHECK( std::nullopt != component.unit() ); + + CHECK( 2 == component.index().value() ); + CHECK( "row_energy_bounds" == component.label().value() ); + CHECK( "eV" == component.unit().value() ); + CHECK( GridStyle::boundaries == component.style().value() ); + + CHECK( 2 == component.index() ); + CHECK( "row_energy_bounds" == component.label() ); + CHECK( "eV" == component.unit() ); + CHECK( GridStyle::boundaries == component.style() ); + + decltype(auto) values = std::get< Values >( component.link_values() ); + CHECK( 2 == values.length() ); + CHECK( 0 == values.start() ); + CHECK( "Float64" == values.valueType().value() ); + + CHECK( 2 == values.size() ); + CHECK( 2 == values.doubles().size() ); + + CHECK( 1e-5 == Approx( values.doubles()[0] ) ); + CHECK( 2e+7 == Approx( values.doubles()[1] ) ); +} + +std::string chunkWithLink() { + + return +R"***( + +)***"; +} + +void verifyChunkWithLink( const Grid& component ) { + + CHECK( std::nullopt != component.index() ); + CHECK( std::nullopt != component.label() ); + CHECK( std::nullopt != component.style() ); + CHECK( std::nullopt != component.unit() ); + + CHECK( 1 == component.index().value() ); + CHECK( "column_energy_bounds" == component.label().value() ); + CHECK( "eV" == component.unit().value() ); + CHECK( GridStyle::link == component.style().value() ); + + CHECK( 1 == component.index() ); + CHECK( "column_energy_bounds" == component.label() ); + CHECK( "eV" == component.unit() ); + CHECK( GridStyle::link == component.style() ); + + decltype(auto) link = std::get< Link >( component.link_values() ); + CHECK( "../../grid[@index='2']/values" == link.href() ); +} + +std::string invalidName() { + + // wrong name for the node + return +R"***( + +)***"; +} diff --git a/autogen/prototype/proto/src/proto/v1.9/containers/Link.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Link.hpp new file mode 100644 index 000000000..9bb354ba7 --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Link.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_CONTAINERS_LINK +#define PROTO_V1_9_CONTAINERS_LINK + +#include "proto/v1.9/key.hpp" + +namespace proto { +namespace v1_9 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Link +// ----------------------------------------------------------------------------- + +class Link : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "containers"; } + static auto CLASS() { return "Link"; } + static auto NODENAME() { return "link"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("href") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "href" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Link() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Link( + const wrapper + &href + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Link(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Link(const Link &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Link(Link &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Link &operator=(const Link &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + href = other.href; + } + return *this; + } + + // move + Link &operator=(Link &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "proto/v1.9/containers/Link/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Link + +} // namespace containers +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/src/GNDStk/v1.9/containers/Link/src/custom.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Link/src/custom.hpp similarity index 100% rename from src/GNDStk/v1.9/containers/Link/src/custom.hpp rename to autogen/prototype/proto/src/proto/v1.9/containers/Link/src/custom.hpp diff --git a/src/GNDStk/v1.9/containers/Link/test/CMakeLists.txt b/autogen/prototype/proto/src/proto/v1.9/containers/Link/test/CMakeLists.txt similarity index 100% rename from src/GNDStk/v1.9/containers/Link/test/CMakeLists.txt rename to autogen/prototype/proto/src/proto/v1.9/containers/Link/test/CMakeLists.txt diff --git a/src/GNDStk/v1.9/containers/Link/test/Link.test.cpp b/autogen/prototype/proto/src/proto/v1.9/containers/Link/test/Link.test.cpp similarity index 87% rename from src/GNDStk/v1.9/containers/Link/test/Link.test.cpp rename to autogen/prototype/proto/src/proto/v1.9/containers/Link/test/Link.test.cpp index a0c5d544c..c1534e6c5 100644 --- a/src/GNDStk/v1.9/containers/Link/test/Link.test.cpp +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Link/test/Link.test.cpp @@ -1,12 +1,15 @@ + #define CATCH_CONFIG_MAIN #include "catch.hpp" -#include "GNDStk/v1.9/containers/Link.hpp" +#include "proto/v1.9/containers/Link.hpp" // other includes // convenience typedefs using namespace njoy::GNDStk; +using namespace proto; + using Link = v1_9::containers::Link; std::string chunk(); @@ -19,7 +22,7 @@ SCENARIO( "Link" ) { std::string string = chunk(); - WHEN( "autogenerated constructor: the data is given explicitly" ) { + WHEN( "autogenerated constructor: the data are given explicitly" ) { std::string href = "../../grid[@index='2']/values"; @@ -39,7 +42,7 @@ SCENARIO( "Link" ) { } // THEN } // WHEN - WHEN( "the data is constructed from a node" ) { + WHEN( "the data are constructed from a node" ) { Node node; node << chunk(); @@ -82,7 +85,7 @@ SCENARIO( "Link" ) { } // THEN } // WHEN - WHEN( "the data is moved" ) { + WHEN( "the data are moved" ) { Node node; node << chunk(); @@ -122,8 +125,7 @@ SCENARIO( "Link" ) { std::string chunk() { return -R"***( -)***"; +R"***()***"; } void verifyChunk( const Link& component ) { @@ -135,6 +137,5 @@ std::string invalidName() { // wrong name for the node return -R"***( -)***"; +R"***()***"; } diff --git a/autogen/prototype/proto/src/proto/v1.9/containers/Regions1d.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Regions1d.hpp new file mode 100644 index 000000000..be131821a --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Regions1d.hpp @@ -0,0 +1,226 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_CONTAINERS_REGIONS1D +#define PROTO_V1_9_CONTAINERS_REGIONS1D + +#include "proto/v1.9/containers/Axes.hpp" +#include "proto/v1.9/containers/XYs1d.hpp" + +namespace proto { +namespace v1_9 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Regions1d +// ----------------------------------------------------------------------------- + +class Regions1d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "containers"; } + static auto CLASS() { return "Regions1d"; } + static auto NODENAME() { return "regions1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("outerDomainValue") | + + // children + --Child> + ("axes") | + ++Child + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "outerDomainValue", + "axes", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "outer_domain_value", + "axes", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + outerDomainValue{this}; + + // children + Field> + axes{this}; + Field> + XYs1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->outerDomainValue, \ + this->axes, \ + this->XYs1d \ + ) + + // default + Regions1d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Regions1d( + const wrapper> + &label, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &axes = {}, + const wrapper> + &XYs1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + outerDomainValue(this,outerDomainValue), + axes(this,axes), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit Regions1d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Regions1d(const Regions1d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + outerDomainValue(this,other.outerDomainValue), + axes(this,other.axes), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + Regions1d(Regions1d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + outerDomainValue(this,std::move(other.outerDomainValue)), + axes(this,std::move(other.axes)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Regions1d &operator=(const Regions1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + outerDomainValue = other.outerDomainValue; + axes = other.axes; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + Regions1d &operator=(Regions1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + outerDomainValue = std::move(other.outerDomainValue); + axes = std::move(other.axes); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "proto/v1.9/containers/Regions1d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Regions1d + +} // namespace containers +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/src/GNDStk/v1.9/containers/Regions1d/src/custom.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Regions1d/src/custom.hpp similarity index 100% rename from src/GNDStk/v1.9/containers/Regions1d/src/custom.hpp rename to autogen/prototype/proto/src/proto/v1.9/containers/Regions1d/src/custom.hpp diff --git a/src/GNDStk/v1.9/containers/Regions1d/test/CMakeLists.txt b/autogen/prototype/proto/src/proto/v1.9/containers/Regions1d/test/CMakeLists.txt similarity index 100% rename from src/GNDStk/v1.9/containers/Regions1d/test/CMakeLists.txt rename to autogen/prototype/proto/src/proto/v1.9/containers/Regions1d/test/CMakeLists.txt diff --git a/src/GNDStk/v1.9/containers/Regions1d/test/Regions1d.test.cpp b/autogen/prototype/proto/src/proto/v1.9/containers/Regions1d/test/Regions1d.test.cpp similarity index 81% rename from src/GNDStk/v1.9/containers/Regions1d/test/Regions1d.test.cpp rename to autogen/prototype/proto/src/proto/v1.9/containers/Regions1d/test/Regions1d.test.cpp index f8d93ec35..d774aca6b 100644 --- a/src/GNDStk/v1.9/containers/Regions1d/test/Regions1d.test.cpp +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Regions1d/test/Regions1d.test.cpp @@ -1,12 +1,16 @@ + #define CATCH_CONFIG_MAIN #include "catch.hpp" -#include "GNDStk/v1.9/containers/Regions1d.hpp" +#include "proto/v1.9/containers/Regions1d.hpp" +using namespace GNDS::v2_0::enums; // other includes // convenience typedefs using namespace njoy::GNDStk; +using namespace proto; + using Regions1d = v1_9::containers::Regions1d; using XYs1d = v1_9::containers::XYs1d; using Axes = v1_9::containers::Axes; @@ -20,29 +24,32 @@ void verifyChunk( const Regions1d& ); std::string invalidName(); SCENARIO( "Regions1d" ) { + njoy::GNDStk::sort = true; GIVEN( "valid data for the component" ) { std::string string = chunk(); - WHEN( "autogenerated constructor: the data is given explicitly" ) { + WHEN( "autogenerated constructor: the data are given explicitly" ) { Regions1d chunk( - std::nullopt, // optional label - std::nullopt, // optional outer domain value + std::nullopt, // optional label + std::nullopt, // optional outer domain value + Axes( std::nullopt, + std::vector< std::variant< Axis, Grid > >{ + Axis( 1, "energy_in", "eV" ), + Axis( 0, "crossSection", "b" ) } ), // optional axes std::vector< XYs1d >{ XYs1d( 0, std::nullopt, std::nullopt, std::nullopt, std::nullopt, - Values( std::vector< double >{ 0.0253, 4.34057, 30000, 1.62386 } ) ), + Values( std::vector< double >{ + 0.0253, 4.34057, 30000, 1.62386 } ) ), XYs1d( 1, std::nullopt, std::nullopt, std::nullopt, std::nullopt, - Values( std::vector< double >{ 30000, 1.65691, 2e+7, 2.35696 } ) ) - }, // vector of 1D functions - Axes( std::nullopt, - std::vector< std::variant< Axis, Grid > >{ - Axis( 1, "energy_in", "eV" ), - Axis( 0, "crossSection", "b" ) } ) // optional axes + Values( std::vector< double >{ + 30000, 1.65691, 2e+7, 2.35696 } ) ) + } // vector of 1D functions ); THEN( "the component can be constructed and members can be tested" ) { @@ -59,7 +66,7 @@ SCENARIO( "Regions1d" ) { } // THEN } // WHEN - WHEN( "the data is constructed from a node" ) { + WHEN( "the data are constructed from a node" ) { Node node; node << chunk(); @@ -102,7 +109,7 @@ SCENARIO( "Regions1d" ) { } // THEN } // WHEN - WHEN( "the data is moved" ) { + WHEN( "the data are moved" ) { Node node; node << chunk(); @@ -143,18 +150,17 @@ std::string chunk() { return R"***( - - 0.0253 4.34057 30000 1.62386 - - - 30000 1.65691 2e+07 2.35696 - - -)***"; + + 0.0253 4.34057 30000 1.62386 + + + 30000 1.65691 2e+07 2.35696 + +)***"; } void verifyChunk( const Regions1d& component ) { @@ -166,7 +172,8 @@ void verifyChunk( const Regions1d& component ) { // axes data CHECK( 2 == component.axes().value().axis_grid().size() ); - decltype(auto) axis0 = std::get< Axis >( component.axes().value().axis_grid()[0] ); + decltype(auto) axis0 = + std::get< Axis >( component.axes().value().axis_grid()[0] ); CHECK( std::nullopt != axis0.index() ); CHECK( std::nullopt != axis0.label() ); CHECK( std::nullopt != axis0.unit() ); @@ -174,7 +181,8 @@ void verifyChunk( const Regions1d& component ) { CHECK( "crossSection" == axis0.label().value() ); CHECK( "b" == axis0.unit().value() ); - decltype(auto) axis1 = std::get< Axis >( component.axes().value().axis_grid()[1] ); + decltype(auto) axis1 = + std::get< Axis >( component.axes().value().axis_grid()[1] ); CHECK( std::nullopt != axis1.index() ); CHECK( std::nullopt != axis1.label() ); CHECK( std::nullopt != axis1.unit() ); @@ -190,7 +198,7 @@ void verifyChunk( const Regions1d& component ) { CHECK( std::nullopt == xys1d0.label() ); CHECK( std::nullopt == xys1d0.outerDomainValue() ); CHECK( std::nullopt == xys1d0.axes() ); - CHECK( enums::Interpolation::linlin == xys1d0.interpolation() ); + CHECK( Interpolation::linlin == xys1d0.interpolation() ); CHECK( 4 == xys1d0.values().length() ); CHECK( 0 == xys1d0.values().start() ); CHECK( "Float64" == xys1d0.values().valueType().value() ); @@ -206,7 +214,7 @@ void verifyChunk( const Regions1d& component ) { CHECK( std::nullopt == xys1d1.label() ); CHECK( std::nullopt == xys1d1.outerDomainValue() ); CHECK( std::nullopt == xys1d1.axes() ); - CHECK( enums::Interpolation::linlin == xys1d1.interpolation() ); + CHECK( Interpolation::linlin == xys1d1.interpolation() ); CHECK( 4 == xys1d1.values().length() ); CHECK( 0 == xys1d1.values().start() ); CHECK( "Float64" == xys1d1.values().valueType().value() ); @@ -224,15 +232,14 @@ std::string invalidName() { return R"***( - 0.0253 4.34057 30000 1.62386 + 0.0253 4.34057 30000 1.62386 - 30000 1.65691 2e+07 2.35696 + 30000 1.65691 2e+07 2.35696 - -)***"; +)***"; } diff --git a/autogen/prototype/proto/src/proto/v1.9/containers/Values.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Values.hpp new file mode 100644 index 000000000..06684277c --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Values.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_CONTAINERS_VALUES +#define PROTO_V1_9_CONTAINERS_VALUES + +#include "proto/v1.9/key.hpp" + +namespace proto { +namespace v1_9 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class Values +// ----------------------------------------------------------------------------- + +class Values : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "containers"; } + static auto CLASS() { return "Values"; } + static auto NODENAME() { return "values"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + Defaulted{"double"} + / Meta<>("valueType") | + Defaulted{0} + / Meta<>("start") | + std::optional{} + / Meta<>("length") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "valueType", + "start", + "length" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value_type", + "start", + "length" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using BlockData::operator=; + + // defaults + static inline const struct Defaults { + static inline const std::string valueType = "double"; + static inline const int start = 0; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + mutable Field> + valueType{this,defaults.valueType}; + mutable Field> + start{this,defaults.start}; + mutable Field> + length{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->valueType, \ + this->start, \ + this->length \ + ) + + // default + Values() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit Values( + const wrapper> + &valueType, + const wrapper> + &start = {}, + const wrapper> + &length = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + valueType(this,defaults.valueType,valueType), + start(this,defaults.start,start), + length(this,length) + { + Component::finish(); + } + + // from node + explicit Values(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + template>> + explicit Values(const std::vector &vector) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(vector); + } + + // copy + Values(const Values &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + valueType(this,other.valueType), + start(this,other.start), + length(this,other.length) + { + Component::finish(other); + } + + // move + Values(Values &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + valueType(this,std::move(other.valueType)), + start(this,std::move(other.start)), + length(this,std::move(other.length)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Values &operator=(const Values &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + valueType = other.valueType; + start = other.start; + length = other.length; + } + return *this; + } + + // move + Values &operator=(Values &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + valueType = std::move(other.valueType); + start = std::move(other.start); + length = std::move(other.length); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "proto/v1.9/containers/Values/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Values + +} // namespace containers +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/autogen/prototype/proto/src/proto/v1.9/containers/Values/src/custom.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/Values/src/custom.hpp new file mode 100644 index 000000000..f05b411f1 --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Values/src/custom.hpp @@ -0,0 +1,53 @@ +private: + + static inline helpMap help = { + + { "", "A GNDS basic component: a list of values\n\n" + "This component is used in the nodes like XYs1D or the grid node." }, + { "constructor", "Initialise the values component\n\n" + "Arguments:\n" + " self the values component\n" + " values the values\n" + " start the starting index of the values\n" + " value_type the value type\n" }, + { "length", "The length of the values" }, + { "start", "The starting index of the values (default = 0)" }, + { "value_type", "The value type (default = 'Float64')" }, + { "doubles", "The underlying values" } + }; + + /** + * Custom construct function + */ + void construct() { + + if ( this->length() != std::nullopt ) { + + if ( this->length() != this->size() + this->start() ) { + + log::error( "Inconsistent size for \"values\" array" ); + log::info( "start: {}", this->start() ); + log::info( "length: {}", this->length().value() ); + log::info( "number of values: {}", this->size() ); + throw std::exception(); + } + } + } + +public: + + template < typename T, + typename = std::enable_if_t>> + Values( const std::optional< int >& length, + const std::optional< int >& start, + const std::optional< std::string >& valueType, + const std::vector< T >& values ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + valueType(this,defaults.valueType,valueType), + start(this,defaults.start,start), + length(this,length) + { + + *this = values; + Component::finish(); // ensure that construct() gets called + } diff --git a/src/GNDStk/v1.9/containers/Values/test/CMakeLists.txt b/autogen/prototype/proto/src/proto/v1.9/containers/Values/test/CMakeLists.txt similarity index 100% rename from src/GNDStk/v1.9/containers/Values/test/CMakeLists.txt rename to autogen/prototype/proto/src/proto/v1.9/containers/Values/test/CMakeLists.txt diff --git a/src/GNDStk/v1.9/containers/Values/test/Values.test.cpp b/autogen/prototype/proto/src/proto/v1.9/containers/Values/test/Values.test.cpp similarity index 87% rename from src/GNDStk/v1.9/containers/Values/test/Values.test.cpp rename to autogen/prototype/proto/src/proto/v1.9/containers/Values/test/Values.test.cpp index d8e132d5d..d2912e4a7 100644 --- a/src/GNDStk/v1.9/containers/Values/test/Values.test.cpp +++ b/autogen/prototype/proto/src/proto/v1.9/containers/Values/test/Values.test.cpp @@ -1,12 +1,15 @@ + #define CATCH_CONFIG_MAIN #include "catch.hpp" -#include "GNDStk/v1.9/containers/Values.hpp" +#include "proto/v1.9/containers/Values.hpp" // other includes // convenience typedefs using namespace njoy::GNDStk; +using namespace proto; + using Values = v1_9::containers::Values; std::string chunk(); @@ -23,7 +26,7 @@ SCENARIO( "Values" ) { std::string string = chunk(); - WHEN( "autogenerated constructor: the data is given explicitly" ) { + WHEN( "autogenerated constructor: the data are given explicitly" ) { std::vector< double > values = { 2500., 8.9172, 2550., 8.9155 }; @@ -43,7 +46,7 @@ SCENARIO( "Values" ) { } // THEN } // WHEN - WHEN( "the data is constructed from a node" ) { + WHEN( "the data are constructed from a node" ) { Node node; node << chunk(); @@ -68,7 +71,7 @@ SCENARIO( "Values" ) { std::string string = chunkInts(); - WHEN( "autogenerated constructor: the data is given explicitly" ) { + WHEN( "autogenerated constructor: the data are given explicitly" ) { std::vector< Integer32 > values = { 2500, 9, 2550, 9 }; @@ -88,7 +91,7 @@ SCENARIO( "Values" ) { } // THEN } // WHEN - WHEN( "the data is constructed from a node" ) { + WHEN( "the data are constructed from a node" ) { Node node; node << chunkInts(); @@ -113,7 +116,7 @@ SCENARIO( "Values" ) { std::string string = chunkStrings(); - WHEN( "autogenerated constructor: the data is given explicitly" ) { + WHEN( "autogenerated constructor: the data are given explicitly" ) { std::vector< UTF8Text > values = { "2500", "8.9172", "2550", "8.9155" }; @@ -133,7 +136,7 @@ SCENARIO( "Values" ) { } // THEN } // WHEN - WHEN( "the data is constructed from a node" ) { + WHEN( "the data are constructed from a node" ) { Node node; node << chunkStrings(); @@ -176,7 +179,7 @@ SCENARIO( "Values" ) { } // THEN } // WHEN - WHEN( "the data is moved" ) { + WHEN( "the data are moved" ) { Node node; node << chunk(); @@ -216,8 +219,7 @@ SCENARIO( "Values" ) { std::string chunk() { return -R"***(2500 8.9172 2550 8.9155 -)***"; +R"***(2500 8.9172 2550 8.9155)***"; } void verifyChunk( const Values& component ) { @@ -238,8 +240,7 @@ void verifyChunk( const Values& component ) { std::string chunkInts() { return -R"***(2500 9 2550 9 -)***"; +R"***(2500 9 2550 9)***"; } void verifyChunkInts( const Values& component ) { @@ -260,8 +261,7 @@ void verifyChunkInts( const Values& component ) { std::string chunkStrings() { return -R"***(2500 8.9172 2550 8.9155 -)***"; +R"***(2500 8.9172 2550 8.9155)***"; } void verifyChunkStrings( const Values& component ) { @@ -283,6 +283,5 @@ std::string invalidName() { // wrong name for the node return -R"***(2500 8.9172 2550 8.9155 -)***"; +R"***(2500 8.9172 2550 8.9155)***"; } diff --git a/autogen/prototype/proto/src/proto/v1.9/containers/XYs1d.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/XYs1d.hpp new file mode 100644 index 000000000..dac817b9d --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/containers/XYs1d.hpp @@ -0,0 +1,262 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_CONTAINERS_XYS1D +#define PROTO_V1_9_CONTAINERS_XYS1D + +#include "GNDS/v2.0/enums/Interpolation.hpp" + +#include "proto/v1.9/containers/Axes.hpp" +#include "proto/v1.9/containers/Values.hpp" + +namespace proto { +namespace v1_9 { +namespace containers { + +// ----------------------------------------------------------------------------- +// containers:: +// class XYs1d +// ----------------------------------------------------------------------------- + +class XYs1d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "containers"; } + static auto CLASS() { return "XYs1d"; } + static auto NODENAME() { return "XYs1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("index") | + Defaulted{GNDS::v2_0::enums::Interpolation::linlin} + / Meta<>("interpolation") | + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("outerDomainValue") | + + // children + --Child> + ("axes") | + --Child + ("values") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "index", + "interpolation", + "label", + "outerDomainValue", + "axes", + "values" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "index", + "interpolation", + "label", + "outer_domain_value", + "axes", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // defaults + static inline const struct Defaults { + static inline const GNDS::v2_0::enums::Interpolation interpolation = GNDS::v2_0::enums::Interpolation::linlin; + } defaults; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + index{this}; + Field> + interpolation{this,defaults.interpolation}; + Field> + label{this}; + Field> + outerDomainValue{this}; + + // children + Field> + axes{this}; + Field + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->interpolation, \ + this->label, \ + this->outerDomainValue, \ + this->axes, \ + this->values \ + ) + + // default + XYs1d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + // optional replaces Defaulted; this class knows the default(s) + explicit XYs1d( + const wrapper> + &index, + const wrapper> + &interpolation = {}, + const wrapper> + &label = {}, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &axes = {}, + const wrapper + &values = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + index(this,index), + interpolation(this,defaults.interpolation,interpolation), + label(this,label), + outerDomainValue(this,outerDomainValue), + axes(this,axes), + values(this,values) + { + Component::finish(); + } + + // from node + explicit XYs1d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + XYs1d(const XYs1d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + index(this,other.index), + interpolation(this,other.interpolation), + label(this,other.label), + outerDomainValue(this,other.outerDomainValue), + axes(this,other.axes), + values(this,other.values) + { + Component::finish(other); + } + + // move + XYs1d(XYs1d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + index(this,std::move(other.index)), + interpolation(this,std::move(other.interpolation)), + label(this,std::move(other.label)), + outerDomainValue(this,std::move(other.outerDomainValue)), + axes(this,std::move(other.axes)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + XYs1d &operator=(const XYs1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + index = other.index; + interpolation = other.interpolation; + label = other.label; + outerDomainValue = other.outerDomainValue; + axes = other.axes; + values = other.values; + } + return *this; + } + + // move + XYs1d &operator=(XYs1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + index = std::move(other.index); + interpolation = std::move(other.interpolation); + label = std::move(other.label); + outerDomainValue = std::move(other.outerDomainValue); + axes = std::move(other.axes); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "proto/v1.9/containers/XYs1d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class XYs1d + +} // namespace containers +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/src/GNDStk/v1.9/containers/XYs1d/src/custom.hpp b/autogen/prototype/proto/src/proto/v1.9/containers/XYs1d/src/custom.hpp similarity index 100% rename from src/GNDStk/v1.9/containers/XYs1d/src/custom.hpp rename to autogen/prototype/proto/src/proto/v1.9/containers/XYs1d/src/custom.hpp diff --git a/src/GNDStk/v1.9/containers/XYs1d/test/CMakeLists.txt b/autogen/prototype/proto/src/proto/v1.9/containers/XYs1d/test/CMakeLists.txt similarity index 100% rename from src/GNDStk/v1.9/containers/XYs1d/test/CMakeLists.txt rename to autogen/prototype/proto/src/proto/v1.9/containers/XYs1d/test/CMakeLists.txt diff --git a/src/GNDStk/v1.9/containers/XYs1d/test/XYs1d.test.cpp b/autogen/prototype/proto/src/proto/v1.9/containers/XYs1d/test/XYs1d.test.cpp similarity index 85% rename from src/GNDStk/v1.9/containers/XYs1d/test/XYs1d.test.cpp rename to autogen/prototype/proto/src/proto/v1.9/containers/XYs1d/test/XYs1d.test.cpp index 05c427b6a..bcc941304 100644 --- a/src/GNDStk/v1.9/containers/XYs1d/test/XYs1d.test.cpp +++ b/autogen/prototype/proto/src/proto/v1.9/containers/XYs1d/test/XYs1d.test.cpp @@ -1,12 +1,16 @@ + #define CATCH_CONFIG_MAIN #include "catch.hpp" -#include "GNDStk/v1.9/containers/XYs1d.hpp" +#include "proto/v1.9/containers/XYs1d.hpp" +using namespace GNDS::v2_0::enums; // other includes // convenience typedefs using namespace njoy::GNDStk; +using namespace proto; + using XYs1d = v1_9::containers::XYs1d; using Axes = v1_9::containers::Axes; using Axis = v1_9::containers::Axis; @@ -19,19 +23,21 @@ void verifyChunk( const XYs1d& ); std::string invalidName(); SCENARIO( "XYs1d" ) { + njoy::GNDStk::sort = true; GIVEN( "valid data for the component" ) { std::string string = chunk(); - WHEN( "autogenerated constructor: the data is given explicitly" ) { + WHEN( "autogenerated constructor: the data are given explicitly" ) { XYs1d chunk( std::nullopt, std::nullopt, std::nullopt, std::nullopt, Axes( std::nullopt, std::vector< std::variant< Axis, Grid > >{ Axis( 1, "energy_in", "eV" ), Axis( 0, "crossSection", "b" ) } ), - Values( std::vector< double >{ 1e-05, 1., 2.53e-2, 2., 2.5e+3, 3. } ) ); + Values( std::vector< double > + { 1e-05, 1., 2.53e-2, 2., 2.5e+3, 3. } ) ); THEN( "the component can be constructed and members can be tested" ) { @@ -47,7 +53,7 @@ SCENARIO( "XYs1d" ) { } // THEN } // WHEN - WHEN( "the data is constructed from a node" ) { + WHEN( "the data are constructed from a node" ) { Node node; node << chunk(); @@ -90,7 +96,7 @@ SCENARIO( "XYs1d" ) { } // THEN } // WHEN - WHEN( "the data is moved" ) { + WHEN( "the data are moved" ) { Node node; node << chunk(); @@ -135,9 +141,8 @@ R"***( - 1e-05 1 0.0253 2 2500 3 - -)***"; + 1e-05 1 0.0253 2 2500 3 +)***"; } void verifyChunk( const XYs1d& component ) { @@ -147,10 +152,11 @@ void verifyChunk( const XYs1d& component ) { CHECK( std::nullopt == component.outerDomainValue() ); CHECK( std::nullopt != component.axes() ); - CHECK( enums::Interpolation::linlin == component.interpolation() ); + CHECK( Interpolation::linlin == component.interpolation() ); // axes data - decltype(auto) axis0 = std::get< Axis >( component.axes().value().axis_grid()[0] ); + decltype(auto) axis0 = + std::get< Axis >( component.axes().value().axis_grid()[0] ); CHECK( std::nullopt != axis0.index() ); CHECK( std::nullopt != axis0.label() ); @@ -160,7 +166,8 @@ void verifyChunk( const XYs1d& component ) { CHECK( "crossSection" == axis0.label().value() ); CHECK( "b" == axis0.unit().value() ); - decltype(auto) axis1 = std::get< Axis >( component.axes().value().axis_grid()[1] ); + decltype(auto) axis1 = + std::get< Axis >( component.axes().value().axis_grid()[1] ); CHECK( std::nullopt != axis1.index() ); CHECK( std::nullopt != axis1.label() ); @@ -196,6 +203,5 @@ R"***( 1e-05 1. 2.53e-2 2. 2.5e+3 3. - -)***"; +)***"; } diff --git a/autogen/prototype/proto/src/proto/v1.9/key.hpp b/autogen/prototype/proto/src/proto/v1.9/key.hpp new file mode 100644 index 000000000..7bf9dab11 --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/key.hpp @@ -0,0 +1,116 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_KEY +#define PROTO_V1_9_KEY + +// GNDStk Core Interface +#include "GNDStk.hpp" + +namespace proto { +namespace v1_9 { + +using namespace njoy; +using namespace GNDStk; + + +// ----------------------------------------------------------------------------- +// meta:: +// ----------------------------------------------------------------------------- + +namespace meta { + +#define NJOY_GNDSTK_MAKE_LOOKUP(nameField,nameGNDS) \ + inline const auto nameField = makeLookup( \ + #nameGNDS, \ + [](const auto &obj) -> decltype(obj.nameField()) \ + { \ + return obj.nameField(); \ + } \ + ) +// nameField vs. nameGNDS: e.g. Double, vs. double in GNDS; usually identical + +NJOY_GNDSTK_MAKE_LOOKUP(ENDF_MT,ENDF_MT); +NJOY_GNDSTK_MAKE_LOOKUP(evaluation,evaluation); +NJOY_GNDSTK_MAKE_LOOKUP(fissionGenre,fissionGenre); +NJOY_GNDSTK_MAKE_LOOKUP(format,format); +NJOY_GNDSTK_MAKE_LOOKUP(href,href); +NJOY_GNDSTK_MAKE_LOOKUP(index,index); +NJOY_GNDSTK_MAKE_LOOKUP(interaction,interaction); +NJOY_GNDSTK_MAKE_LOOKUP(interpolation,interpolation); +NJOY_GNDSTK_MAKE_LOOKUP(label,label); +NJOY_GNDSTK_MAKE_LOOKUP(length,length); +NJOY_GNDSTK_MAKE_LOOKUP(outerDomainValue,outerDomainValue); +NJOY_GNDSTK_MAKE_LOOKUP(projectile,projectile); +NJOY_GNDSTK_MAKE_LOOKUP(projectileFrame,projectileFrame); +NJOY_GNDSTK_MAKE_LOOKUP(start,start); +NJOY_GNDSTK_MAKE_LOOKUP(style,style); +NJOY_GNDSTK_MAKE_LOOKUP(target,target); +NJOY_GNDSTK_MAKE_LOOKUP(unit,unit); +NJOY_GNDSTK_MAKE_LOOKUP(valueType,valueType); + +#undef NJOY_GNDSTK_MAKE_LOOKUP + +} // namespace meta + + +// ----------------------------------------------------------------------------- +// containers::child:: +// ----------------------------------------------------------------------------- + +namespace containers { +namespace child { + +inline const Child<> XYs1d("XYs1d"); +inline const Child<> axes("axes"); +inline const Child<> axis("axis"); +inline const Child<> grid("grid"); +inline const Child<> link("link"); +inline const Child<> regions1d("regions1d"); +inline const Child<> values("values"); + +} // namespace child +using namespace child; +} // namespace containers + + +// ----------------------------------------------------------------------------- +// transport::child:: +// ----------------------------------------------------------------------------- + +namespace transport { +namespace child { + +inline const Child<> crossSection("crossSection"); +inline const Child<> reaction("reaction"); +inline const Child<> reactionSuite("reactionSuite"); +inline const Child<> reactions("reactions"); + +} // namespace child +using namespace child; +} // namespace transport + + +// ----------------------------------------------------------------------------- +// For convenience: using directives +// ----------------------------------------------------------------------------- + +namespace key { + using namespace meta; + using namespace containers::child; + using namespace transport::child; +} // namespace key + +using namespace key; +using namespace containers; +using namespace transport; + + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/autogen/prototype/proto/src/proto/v1.9/transport/CrossSection.hpp b/autogen/prototype/proto/src/proto/v1.9/transport/CrossSection.hpp new file mode 100644 index 000000000..60bebc02e --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/transport/CrossSection.hpp @@ -0,0 +1,187 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_TRANSPORT_CROSSSECTION +#define PROTO_V1_9_TRANSPORT_CROSSSECTION + +#include "proto/v1.9/containers/XYs1d.hpp" +#include "proto/v1.9/containers/Regions1d.hpp" + +namespace proto { +namespace v1_9 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class CrossSection +// ----------------------------------------------------------------------------- + +class CrossSection : + public Component +{ + friend class Component; + + using XYs1d_regions1d_t = std::variant< + containers::XYs1d, + containers::Regions1d + >; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "transport"; } + static auto CLASS() { return "CrossSection"; } + static auto NODENAME() { return "crossSection"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + XYs1d_regions1d_t{} + / ++(Child<>("XYs1d") || Child<>("regions1d")) + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d_regions1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d_regions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children - variant + Field> + XYs1d_regions1d{this}; + FieldPart XYs1d{XYs1d_regions1d}; + FieldPart regions1d{XYs1d_regions1d}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d_regions1d \ + ) + + // default + CrossSection() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSection( + const wrapper> + &XYs1d_regions1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d_regions1d(this,XYs1d_regions1d) + { + Component::finish(); + } + + // from node + explicit CrossSection(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSection(const CrossSection &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d_regions1d(this,other.XYs1d_regions1d) + { + Component::finish(other); + } + + // move + CrossSection(CrossSection &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d_regions1d(this,std::move(other.XYs1d_regions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CrossSection &operator=(const CrossSection &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d_regions1d = other.XYs1d_regions1d; + } + return *this; + } + + // move + CrossSection &operator=(CrossSection &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d_regions1d = std::move(other.XYs1d_regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "proto/v1.9/transport/CrossSection/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CrossSection + +} // namespace transport +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/src/GNDStk/v1.9/transport/CrossSection/src/custom.hpp b/autogen/prototype/proto/src/proto/v1.9/transport/CrossSection/src/custom.hpp similarity index 100% rename from src/GNDStk/v1.9/transport/CrossSection/src/custom.hpp rename to autogen/prototype/proto/src/proto/v1.9/transport/CrossSection/src/custom.hpp diff --git a/autogen/prototype/proto/src/proto/v1.9/transport/Reaction.hpp b/autogen/prototype/proto/src/proto/v1.9/transport/Reaction.hpp new file mode 100644 index 000000000..c9f34ccb6 --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/transport/Reaction.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_TRANSPORT_REACTION +#define PROTO_V1_9_TRANSPORT_REACTION + +#include "proto/v1.9/transport/CrossSection.hpp" + +namespace proto { +namespace v1_9 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class Reaction +// ----------------------------------------------------------------------------- + +class Reaction : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "transport"; } + static auto CLASS() { return "Reaction"; } + static auto NODENAME() { return "reaction"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + int{} + / Meta<>("ENDF_MT") | + std::optional{} + / Meta<>("fissionGenre") | + std::string{} + / Meta<>("label") | + + // children + --Child + ("crossSection") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "ENDF_MT", + "fissionGenre", + "label", + "crossSection" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "endf_mt", + "fission_genre", + "label", + "cross_section" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + ENDF_MT{this}; + Field> + fissionGenre{this}; + Field + label{this}; + + // children + Field + crossSection{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MT, \ + this->fissionGenre, \ + this->label, \ + this->crossSection \ + ) + + // default + Reaction() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reaction( + const wrapper + &ENDF_MT, + const wrapper> + &fissionGenre = {}, + const wrapper + &label = {}, + const wrapper + &crossSection = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + ENDF_MT(this,ENDF_MT), + fissionGenre(this,fissionGenre), + label(this,label), + crossSection(this,crossSection) + { + Component::finish(); + } + + // from node + explicit Reaction(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reaction(const Reaction &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + ENDF_MT(this,other.ENDF_MT), + fissionGenre(this,other.fissionGenre), + label(this,other.label), + crossSection(this,other.crossSection) + { + Component::finish(other); + } + + // move + Reaction(Reaction &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + ENDF_MT(this,std::move(other.ENDF_MT)), + fissionGenre(this,std::move(other.fissionGenre)), + label(this,std::move(other.label)), + crossSection(this,std::move(other.crossSection)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Reaction &operator=(const Reaction &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + ENDF_MT = other.ENDF_MT; + fissionGenre = other.fissionGenre; + label = other.label; + crossSection = other.crossSection; + } + return *this; + } + + // move + Reaction &operator=(Reaction &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + ENDF_MT = std::move(other.ENDF_MT); + fissionGenre = std::move(other.fissionGenre); + label = std::move(other.label); + crossSection = std::move(other.crossSection); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "proto/v1.9/transport/Reaction/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Reaction + +} // namespace transport +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/src/GNDStk/v1.9/transport/Reaction/src/custom.hpp b/autogen/prototype/proto/src/proto/v1.9/transport/Reaction/src/custom.hpp similarity index 100% rename from src/GNDStk/v1.9/transport/Reaction/src/custom.hpp rename to autogen/prototype/proto/src/proto/v1.9/transport/Reaction/src/custom.hpp diff --git a/autogen/prototype/proto/src/proto/v1.9/transport/ReactionSuite.hpp b/autogen/prototype/proto/src/proto/v1.9/transport/ReactionSuite.hpp new file mode 100644 index 000000000..735f6e608 --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/transport/ReactionSuite.hpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_TRANSPORT_REACTIONSUITE +#define PROTO_V1_9_TRANSPORT_REACTIONSUITE + +#include "proto/v1.9/transport/Reactions.hpp" + +namespace proto { +namespace v1_9 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class ReactionSuite +// ----------------------------------------------------------------------------- + +class ReactionSuite : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "transport"; } + static auto CLASS() { return "ReactionSuite"; } + static auto NODENAME() { return "reactionSuite"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("evaluation") | + std::string{} + / Meta<>("format") | + std::string{} + / Meta<>("projectile") | + enums::Frame{} + / Meta<>("projectileFrame") | + std::string{} + / Meta<>("target") | + std::optional{} + / Meta<>("interaction") | + + // children + --Child> + ("reactions") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "evaluation", + "format", + "projectile", + "projectileFrame", + "target", + "interaction", + "reactions" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "evaluation", + "format", + "projectile", + "projectile_frame", + "target", + "interaction", + "reactions" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + evaluation{this}; + Field + format{this}; + Field + projectile{this}; + Field + projectileFrame{this}; + Field + target{this}; + Field> + interaction{this}; + + // children + Field> + reactions{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->evaluation, \ + this->format, \ + this->projectile, \ + this->projectileFrame, \ + this->target, \ + this->interaction, \ + this->reactions \ + ) + + // default + ReactionSuite() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ReactionSuite( + const wrapper + &evaluation, + const wrapper + &format = {}, + const wrapper + &projectile = {}, + const wrapper + &projectileFrame = {}, + const wrapper + &target = {}, + const wrapper> + &interaction = {}, + const wrapper> + &reactions = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + evaluation(this,evaluation), + format(this,format), + projectile(this,projectile), + projectileFrame(this,projectileFrame), + target(this,target), + interaction(this,interaction), + reactions(this,reactions) + { + Component::finish(); + } + + // from node + explicit ReactionSuite(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ReactionSuite(const ReactionSuite &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + evaluation(this,other.evaluation), + format(this,other.format), + projectile(this,other.projectile), + projectileFrame(this,other.projectileFrame), + target(this,other.target), + interaction(this,other.interaction), + reactions(this,other.reactions) + { + Component::finish(other); + } + + // move + ReactionSuite(ReactionSuite &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + evaluation(this,std::move(other.evaluation)), + format(this,std::move(other.format)), + projectile(this,std::move(other.projectile)), + projectileFrame(this,std::move(other.projectileFrame)), + target(this,std::move(other.target)), + interaction(this,std::move(other.interaction)), + reactions(this,std::move(other.reactions)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ReactionSuite &operator=(const ReactionSuite &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + evaluation = other.evaluation; + format = other.format; + projectile = other.projectile; + projectileFrame = other.projectileFrame; + target = other.target; + interaction = other.interaction; + reactions = other.reactions; + } + return *this; + } + + // move + ReactionSuite &operator=(ReactionSuite &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + evaluation = std::move(other.evaluation); + format = std::move(other.format); + projectile = std::move(other.projectile); + projectileFrame = std::move(other.projectileFrame); + target = std::move(other.target); + interaction = std::move(other.interaction); + reactions = std::move(other.reactions); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "proto/v1.9/transport/ReactionSuite/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ReactionSuite + +} // namespace transport +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/src/GNDStk/v1.9/transport/ReactionSuite/src/custom.hpp b/autogen/prototype/proto/src/proto/v1.9/transport/ReactionSuite/src/custom.hpp similarity index 100% rename from src/GNDStk/v1.9/transport/ReactionSuite/src/custom.hpp rename to autogen/prototype/proto/src/proto/v1.9/transport/ReactionSuite/src/custom.hpp diff --git a/autogen/prototype/proto/src/proto/v1.9/transport/Reactions.hpp b/autogen/prototype/proto/src/proto/v1.9/transport/Reactions.hpp new file mode 100644 index 000000000..9fb7364b4 --- /dev/null +++ b/autogen/prototype/proto/src/proto/v1.9/transport/Reactions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef PROTO_V1_9_TRANSPORT_REACTIONS +#define PROTO_V1_9_TRANSPORT_REACTIONS + +#include "proto/v1.9/transport/Reaction.hpp" + +namespace proto { +namespace v1_9 { +namespace transport { + +// ----------------------------------------------------------------------------- +// transport:: +// class Reactions +// ----------------------------------------------------------------------------- + +class Reactions : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "transport"; } + static auto CLASS() { return "Reactions"; } + static auto NODENAME() { return "reactions"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("reaction") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "reaction" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "reaction" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + reaction{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->reaction \ + ) + + // default + Reactions() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reactions( + const wrapper> + &reaction + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + reaction(this,reaction) + { + Component::finish(); + } + + // from node + explicit Reactions(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reactions(const Reactions &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + reaction(this,other.reaction) + { + Component::finish(other); + } + + // move + Reactions(Reactions &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + reaction(this,std::move(other.reaction)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Reactions &operator=(const Reactions &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + reaction = other.reaction; + } + return *this; + } + + // move + Reactions &operator=(Reactions &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + reaction = std::move(other.reaction); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "proto/v1.9/transport/Reactions/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Reactions + +} // namespace transport +} // namespace v1_9 +} // namespace proto + +#endif diff --git a/src/GNDStk/v1.9/transport/Reactions/src/custom.hpp b/autogen/prototype/proto/src/proto/v1.9/transport/Reactions/src/custom.hpp similarity index 100% rename from src/GNDStk/v1.9/transport/Reactions/src/custom.hpp rename to autogen/prototype/proto/src/proto/v1.9/transport/Reactions/src/custom.hpp diff --git a/autogen/prototype/prototype.json b/autogen/prototype/prototype.json new file mode 100644 index 000000000..138df990b --- /dev/null +++ b/autogen/prototype/prototype.json @@ -0,0 +1,36 @@ +{ + "remark" : [ + "Path", + " Path to the Project directory.", + " Optional (defaults to .).", + "", + "Project", + " Base project directory into which the code generator should", + " place files. IMPORTANT: this should be a **plain** name only,", + " without any directory path. Use Path for that, if it's needed.", + " Optional (defaults to GNDStk).", + "", + "Version", + " Version number for this project.", + "", + "JSONDir", + " Directory in which the .json input files are located.", + "", + "JSONFiles", + " The .json input files.", + "", + "Do NOT end directories with a /" + ], + + "Path": ".", + "Project": "proto", + "Version": "v1.9", + + "JSONDir": ".", + "JSONFiles": [ + "generalPurpose.json", + "reactionSuite.json" + ], + + "Changes": "../changes.json" +} diff --git a/autogen/prototype/reactionSuite.json b/autogen/prototype/reactionSuite.json index 56280918b..814478bae 100644 --- a/autogen/prototype/reactionSuite.json +++ b/autogen/prototype/reactionSuite.json @@ -30,7 +30,7 @@ }, "children": { "reactions": { - "occurrence": "1", + "times": "1", "required": false } } @@ -40,7 +40,7 @@ "metadata": {}, "children": { "reaction": { - "occurrence": "1+", + "times": "1+", "required": true } } @@ -63,7 +63,7 @@ }, "children": { "crossSection": { - "occurrence": "1", + "times": "1", "required": true } } @@ -73,12 +73,12 @@ "metadata": {}, "children": { "XYs1d": { - "occurrence": "choice+", + "times": "choice+", "variant": "XYs1d_regions1d", "required": false }, "regions1d": { - "occurrence": "choice+", + "times": "choice+", "variant": "XYs1d_regions1d", "required": false } diff --git a/autogen/simple/.gitignore b/autogen/simple/.gitignore new file mode 100644 index 000000000..6b7597707 --- /dev/null +++ b/autogen/simple/.gitignore @@ -0,0 +1,21 @@ + +[0-9] +*.o +*~ + +*.h +*.hh +*.cc + +*.exe + +file.h5 +file.json +file.xml +out +foobar.xml +foobar.json +foobar.h5 +m +j +0.cpp diff --git a/autogen/simple/clean b/autogen/simple/clean new file mode 100755 index 000000000..a4eb9d408 --- /dev/null +++ b/autogen/simple/clean @@ -0,0 +1,3 @@ +#!/bin/bash + +/bin/rm -f *.o *.exe out *~ diff --git a/autogen/simple/compile-c b/autogen/simple/compile-c new file mode 100755 index 000000000..0b7231f79 --- /dev/null +++ b/autogen/simple/compile-c @@ -0,0 +1,46 @@ +#!/bin/bash + +# C++ compilation command +COMPILE=" + clang++ -std=c++17 + -I../../../GNDStk/src + -I../../../GNDStk/simple-json/src + -I../../../GNDStk/c/src + -Imulti/src + -Imulti/c/src + -I../../../GNDStk/build/_deps/pugixml-adapter-src/src/src + -I../../../GNDStk/build/_deps/hdf5-src/include + -I../../../GNDStk/build/_deps/log-src/src + -I../../../GNDStk/build/_deps/spdlog-src/include + -I/usr/include/hdf5/serial + -DHIGHFIVE_USE_BOOST=OFF + -L/usr/lib/x86_64-linux-gnu/hdf5/serial + -lhdf5 + -fno-show-column + -Wno-unused-command-line-argument + -Wall -Wextra -Wpedantic " + +# pugixml +if [ ! -f "pugixml.o" ]; then + $COMPILE ../../../GNDStk/build/_deps/pugixml-adapter-src/src/src/pugixml.cpp -c & +fi + +# Compile C++ +$COMPILE -c ../../../GNDStk/c/src/GNDStk.cpp & +$COMPILE -c multi/c/src/v1/multigroup/Foobar.cpp & +$COMPILE -c multi/c/src/v1/multigroup/Isotope.cpp & +$COMPILE -c multi/c/src/v1/multigroup/Element.cpp & +$COMPILE -c multi/c/src/v1/multigroup/Library.cpp & +$COMPILE -c multi/c/src/v1/multigroup/Multigroup.cpp & + +wait $(jobs -p) + +# Compile C +clang \ + -I../../../GNDStk/c/src \ + -Imulti/c/src \ + example-01.c \ + *.o \ + -L/usr/lib/x86_64-linux-gnu/hdf5/serial \ + -lstdc++ -lm -lhdf5 \ + -o c.exe diff --git a/autogen/simple/compile-cpp b/autogen/simple/compile-cpp new file mode 100755 index 000000000..c2e805436 --- /dev/null +++ b/autogen/simple/compile-cpp @@ -0,0 +1,30 @@ +#!/bin/bash + +# C++ compilation command +COMPILE=" + clang++ -std=c++17 + -I../../../GNDStk/src + -I../../../GNDStk/simple-json/src + -Imulti/src + -I../../../GNDStk/build/_deps/pugixml-adapter-src/src/src + -I../../../GNDStk/build/_deps/hdf5-src/include + -I../../../GNDStk/build/_deps/log-src/src + -I../../../GNDStk/build/_deps/spdlog-src/include + -I/usr/include/hdf5/serial + -DHIGHFIVE_USE_BOOST=OFF + -L/usr/lib/x86_64-linux-gnu/hdf5/serial + -lhdf5 + -fno-show-column + -Wno-unused-command-line-argument + -Wall -Wextra -Wpedantic " + +# pugixml +if [ ! -f "pugixml.o" ]; then +$COMPILE ../../../GNDStk/build/_deps/pugixml-adapter-src/src/src/pugixml.cpp -c +fi + +# Compile +$COMPILE example-01.cpp pugixml.o -o cpp-01.exe & +$COMPILE example-02.cpp pugixml.o -o cpp-02.exe & + +wait $(jobs -p) diff --git a/autogen/simple/example-01.c b/autogen/simple/example-01.c new file mode 100644 index 000000000..fc7af5d31 --- /dev/null +++ b/autogen/simple/example-01.c @@ -0,0 +1,17 @@ + +#include +#include "v1.h" + +int main() +{ + // colored diagnostics and prettyprinting + colors(1); + + Foobar one = FoobarDefault(); + Foobar two = FoobarDefault(); + + FoobarAssign(one,two); + FoobarPrint(one); + FoobarPrintXML(one); + FoobarPrintJSON(one); +} diff --git a/autogen/simple/example-01.cpp b/autogen/simple/example-01.cpp new file mode 100644 index 000000000..b0f47c293 --- /dev/null +++ b/autogen/simple/example-01.cpp @@ -0,0 +1,103 @@ + +#include "multi/v1.hpp" +using namespace multi::v1; + +int main() +{ + /* + using detail::is_in_v; + std::cout << std::endl; + std::cout << (is_in_v) << std::endl; // f + std::cout << (is_in_v) << std::endl; // f + std::cout << (is_in_v) << std::endl; // f + std::cout << (is_in_v) << std::endl; // t + std::cout << (is_in_v) << std::endl; // t + std::cout << (is_in_v) << std::endl; // t + std::cout << (is_in_v) << std::endl; // t + std::cout << std::endl; + std::cout << (is_in_v) << std::endl; // f + std::cout << (is_in_v>) << std::endl; // f + std::cout << (is_in_v>) << std::endl; // f + std::cout << (is_in_v>) << std::endl; // t + std::cout << (is_in_v>) << std::endl; // t + std::cout << (is_in_v>) << std::endl; // t + std::cout << (is_in_v>) << std::endl; // t + std::cout << std::endl; + */ + + colors = true; + + // Make some elements. We can make elements ("outer + // objects") first, then add isotopes ("inner objects"). + Element H ("H", 1); + Element He("He",2); + Element Li("Li",3); + Element Be("Be",4); + + // Add some isotopes. With this short notation, we + // get vector push_back()s into an Element's vector + // of Isotopes. + H += Isotope(1); + H += Isotope(2); + H += Isotope(3); + + He += Isotope(3); + He += Isotope(4); + // ... + + He.add(Isotope(5)).add(Isotope(6)); + (He += Isotope(7)) += Isotope(8); + + // for fun... + He.isotope[mass_number(4)] = Isotope(4); + He [mass_number(4)] = Isotope(4); + (void)He[mass_number(3)]; + const auto &HeConst = He; + (void)HeConst[mass_number(3)]; + + std::cout << HeConst[mass_number(3)] << std::endl; + std::cout << HeConst[mass_number(4)] << std::endl; + + He.foobar = Foobar{}; + + // Make a couple of libraries. Here, we'll give them + // (vectors of) elements immediately. (Alternatively, + // those could have been added later, like we did for + // adding isotopes above.) + Library first("first library", {H,He}); + Library second("second library", {Li,Be}); + + // Make a multigroup object. + Multigroup multi("projectile name", {first,second}); + + // Example: use a basic getter to get the vector of + // elements from the second library. Getters are + // flexible (the good) but mean we have to require + // the "()" syntax (the ugly). :-/ + std::vector elems = second.element(); + assert(elems[0].symbol() == "Li"); + assert(elems[1].symbol() == "Be"); + + // Example: look stuff up by metadatum value. + Isotope deu = H.isotope[mass_number(2)]; + Isotope tri = H.isotope[mass_number(3)]; + + // If we instead write isotope() with no arguments + // to the getter, we get a vector of Isotope objects. + std::vector iso = H.isotope(); + + // Slightly fancier lookup, starting all the way up + // at the Multigroup object. + Isotope i = + multi.library[name("first library")] + .element[symbol("He")] + .isotope[mass_number(3)]; + + // Write as XML, JSON, and HDF5. + multi.write("file.xml"); + multi.write("file.json"); + multi.write("file.h5"); + + // Prettyprint. + multi.print(); +} diff --git a/autogen/simple/example-02.cpp b/autogen/simple/example-02.cpp new file mode 100644 index 000000000..42d409b21 --- /dev/null +++ b/autogen/simple/example-02.cpp @@ -0,0 +1,35 @@ + +#include "multi/v1.hpp" +using namespace multi::v1; + +int main() +{ + colors = true; + + // Try a Foobar all by itself + { + Foobar f(std::vector{ 1, 2, 3, 4, 5 }); + f.write("foobar.xml"); + f.write("foobar.json"); + f.write("foobar.h5"); + f.print(); + + // read from xml + std::cout << "\nTrying to read XML:" << std::endl; + f.read("foobar.xml"); + std::cout << "Back from XML:" << std::endl; + f.print(); + + // read from json + std::cout << "\nTrying to read JSON:" << std::endl; + f.read("foobar.json"); + std::cout << "Back from JSON:" << std::endl; + f.print(); + + // read from h5 + std::cout << "\nTrying to read H5:" << std::endl; + f.read("foobar.h5"); + std::cout << "Back from H5:" << std::endl; + f.print(); + } +} diff --git a/autogen/simple/multi-classes.json b/autogen/simple/multi-classes.json new file mode 100644 index 000000000..26e44cda9 --- /dev/null +++ b/autogen/simple/multi-classes.json @@ -0,0 +1,76 @@ +{ + "namespace": "multigroup", + + "multigroup": { + "metadata": { + "projectile": { + "type": "string", + "required": true + } + }, + "children": { + "library": { + "times": "1+", + "required": true + } + } + }, + + "library": { + "metadata": { + "name": { + "type": "string", + "required": true + } + }, + "children": { + "element": { + "times": "1+", + "required": true + } + } + }, + + + "element": { + "metadata": { + "symbol": { + "type": "string", + "required": false + }, + "atomic_number": { + "type": "int", + "required": true + } + }, + "children": { + "isotope": { + "times": "1+", + "required": true + }, + "foobar": { + "times": "1", + "required": false + } + } + }, + + "isotope": { + "metadata": { + "mass_number": { + "type": "int", + "required": true + } + } + }, + + "foobar": { + "metadata": { + "value": { + "type": "string", + "required": true + } + }, + "vector": "double" + } +} diff --git a/autogen/simple/multi.json b/autogen/simple/multi.json new file mode 100644 index 000000000..f7f5dbbf0 --- /dev/null +++ b/autogen/simple/multi.json @@ -0,0 +1,9 @@ +{ + "Project": "multi", + "Version": "v1", + + "JSONDir": ".", + "JSONFiles": [ + "multi-classes.json" + ] +} diff --git a/autogen/simple/multi/c/src/v1.cpp b/autogen/simple/multi/c/src/v1.cpp new file mode 100644 index 000000000..3980cc696 --- /dev/null +++ b/autogen/simple/multi/c/src/v1.cpp @@ -0,0 +1,2 @@ + +#include "v1.h" diff --git a/autogen/simple/multi/c/src/v1.h b/autogen/simple/multi/c/src/v1.h new file mode 100644 index 000000000..db667e4bb --- /dev/null +++ b/autogen/simple/multi/c/src/v1.h @@ -0,0 +1,25 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// ----------------------------------------------------------------------------- +// This header file is designed to work with both C and C++ +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_MULTI_V1 +#define C_INTERFACE_MULTI_V1 + +#include "GNDStk.h" + +#ifdef __cplusplus + // For C++ + #include "multi/v1.hpp" +#endif + +#include "v1/multigroup/Element.h" +#include "v1/multigroup/Foobar.h" +#include "v1/multigroup/Isotope.h" +#include "v1/multigroup/Library.h" +#include "v1/multigroup/Multigroup.h" + +#endif diff --git a/autogen/simple/multi/c/src/v1/multigroup/Element.cpp b/autogen/simple/multi/c/src/v1/multigroup/Element.cpp new file mode 100644 index 000000000..bd84e5162 --- /dev/null +++ b/autogen/simple/multi/c/src/v1/multigroup/Element.cpp @@ -0,0 +1,370 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "multi/v1/multigroup/Element.hpp" +#include "Element.h" + +using namespace njoy::GNDStk; +using namespace multi::v1; + +using C = ElementClass; +using CPP = multigroup::Element; + +static const std::string CLASSNAME = "Element"; + +namespace extract { + static auto symbol = [](auto &obj) { return &obj.symbol; }; + static auto atomic_number = [](auto &obj) { return &obj.atomic_number; }; + static auto isotope = [](auto &obj) { return &obj.isotope; }; + static auto foobar = [](auto &obj) { return &obj.foobar; }; +} + +using CPPIsotope = multigroup::Isotope; +using CPPFoobar = multigroup::Foobar; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstElement +ElementDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Element +ElementDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstElement +ElementCreateConst( + const char *const symbol, + const int atomic_number, + ConstHandle2Isotope *const isotope, const size_t isotopeSize, + ConstHandle2ConstFoobar foobar +) { + ConstHandle2Element handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + symbol, + atomic_number, + std::vector{}, + detail::tocpp(foobar) + ); + for (size_t IsotopeN = 0; IsotopeN < isotopeSize; ++IsotopeN) + ElementIsotopeAdd(handle, isotope[IsotopeN]); + return handle; +} + +// Create, general +Handle2Element +ElementCreate( + const char *const symbol, + const int atomic_number, + ConstHandle2Isotope *const isotope, const size_t isotopeSize, + ConstHandle2ConstFoobar foobar +) { + ConstHandle2Element handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + symbol, + atomic_number, + std::vector{}, + detail::tocpp(foobar) + ); + for (size_t IsotopeN = 0; IsotopeN < isotopeSize; ++IsotopeN) + ElementIsotopeAdd(handle, isotope[IsotopeN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ElementAssign(ConstHandle2Element self, ConstHandle2ConstElement from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ElementDelete(ConstHandle2ConstElement self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ElementRead(ConstHandle2Element self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ElementWrite(ConstHandle2ConstElement self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ElementPrint(ConstHandle2ConstElement self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ElementPrintXML(ConstHandle2ConstElement self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ElementPrintJSON(ConstHandle2ConstElement self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: symbol +// ----------------------------------------------------------------------------- + +// Has +int +ElementSymbolHas(ConstHandle2ConstElement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SymbolHas", self, extract::symbol); +} + +// Get +// Returns by value +const char * +ElementSymbolGet(ConstHandle2ConstElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SymbolGet", self, extract::symbol); +} + +// Set +void +ElementSymbolSet(ConstHandle2Element self, const char *const symbol) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SymbolSet", self, extract::symbol, symbol); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: atomic_number +// ----------------------------------------------------------------------------- + +// Has +int +ElementAtomicNumberHas(ConstHandle2ConstElement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AtomicNumberHas", self, extract::atomic_number); +} + +// Get +// Returns by value +int +ElementAtomicNumberGet(ConstHandle2ConstElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AtomicNumberGet", self, extract::atomic_number); +} + +// Set +void +ElementAtomicNumberSet(ConstHandle2Element self, const int atomic_number) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AtomicNumberSet", self, extract::atomic_number, atomic_number); +} + + +// ----------------------------------------------------------------------------- +// Child: isotope +// ----------------------------------------------------------------------------- + +// Has +int +ElementIsotopeHas(ConstHandle2ConstElement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IsotopeHas", self, extract::isotope); +} + +// Clear +void +ElementIsotopeClear(ConstHandle2Element self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"IsotopeClear", self, extract::isotope); +} + +// Size +size_t +ElementIsotopeSize(ConstHandle2ConstElement self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"IsotopeSize", self, extract::isotope); +} + +// Add +void +ElementIsotopeAdd(ConstHandle2Element self, ConstHandle2ConstIsotope isotope) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"IsotopeAdd", self, extract::isotope, isotope); +} + +// Get, by index \in [0,size), const +Handle2ConstIsotope +ElementIsotopeGetConst(ConstHandle2ConstElement self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IsotopeGetConst", self, extract::isotope, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Isotope +ElementIsotopeGet(ConstHandle2Element self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IsotopeGet", self, extract::isotope, index_); +} + +// Set, by index \in [0,size) +void +ElementIsotopeSet( + ConstHandle2Element self, + const size_t index_, + ConstHandle2ConstIsotope isotope +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"IsotopeSet", self, extract::isotope, index_, isotope); +} + +// Has, by mass_number +int +ElementIsotopeHasByMassNumber( + ConstHandle2ConstElement self, + const int mass_number +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeHasByMassNumber", + self, extract::isotope, meta::mass_number, mass_number); +} + +// Get, by mass_number, const +Handle2ConstIsotope +ElementIsotopeGetByMassNumberConst( + ConstHandle2ConstElement self, + const int mass_number +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeGetByMassNumberConst", + self, extract::isotope, meta::mass_number, mass_number); +} + +// Get, by mass_number, non-const +Handle2Isotope +ElementIsotopeGetByMassNumber( + ConstHandle2Element self, + const int mass_number +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeGetByMassNumber", + self, extract::isotope, meta::mass_number, mass_number); +} + +// Set, by mass_number +void +ElementIsotopeSetByMassNumber( + ConstHandle2Element self, + const int mass_number, + ConstHandle2ConstIsotope isotope +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeSetByMassNumber", + self, extract::isotope, meta::mass_number, mass_number, isotope); +} + + +// ----------------------------------------------------------------------------- +// Child: foobar +// ----------------------------------------------------------------------------- + +// Has +int +ElementFoobarHas(ConstHandle2ConstElement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FoobarHas", self, extract::foobar); +} + +// Get, const +Handle2ConstFoobar +ElementFoobarGetConst(ConstHandle2ConstElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FoobarGetConst", self, extract::foobar); +} + +// Get, non-const +Handle2Foobar +ElementFoobarGet(ConstHandle2Element self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FoobarGet", self, extract::foobar); +} + +// Set +void +ElementFoobarSet(ConstHandle2Element self, ConstHandle2ConstFoobar foobar) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FoobarSet", self, extract::foobar, foobar); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1/multigroup/Element/src/custom.cpp" diff --git a/autogen/simple/multi/c/src/v1/multigroup/Element.h b/autogen/simple/multi/c/src/v1/multigroup/Element.h new file mode 100644 index 000000000..88b21a3a9 --- /dev/null +++ b/autogen/simple/multi/c/src/v1/multigroup/Element.h @@ -0,0 +1,270 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Element is the basic handle type in this file. Example: +// // Create a default Element object: +// Element handle = ElementDefault(); +// Functions involving Element are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_MULTI_V1_MULTIGROUP_ELEMENT +#define C_INTERFACE_MULTI_V1_MULTIGROUP_ELEMENT + +#include "GNDStk.h" +#include "v1/multigroup/Isotope.h" +#include "v1/multigroup/Foobar.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ElementClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Element +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ElementClass *Element; + +// --- Const-aware handles. +typedef const struct ElementClass *const ConstHandle2ConstElement; +typedef struct ElementClass *const ConstHandle2Element; +typedef const struct ElementClass * Handle2ConstElement; +typedef struct ElementClass * Handle2Element; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstElement +ElementDefaultConst(); + +// +++ Create, default +extern_c Handle2Element +ElementDefault(); + +// --- Create, general, const +extern_c Handle2ConstElement +ElementCreateConst( + const char *const symbol, + const int atomic_number, + ConstHandle2Isotope *const isotope, const size_t isotopeSize, + ConstHandle2ConstFoobar foobar +); + +// +++ Create, general +extern_c Handle2Element +ElementCreate( + const char *const symbol, + const int atomic_number, + ConstHandle2Isotope *const isotope, const size_t isotopeSize, + ConstHandle2ConstFoobar foobar +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ElementAssign(ConstHandle2Element self, ConstHandle2ConstElement from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ElementDelete(ConstHandle2ConstElement self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ElementRead(ConstHandle2Element self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ElementWrite(ConstHandle2ConstElement self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ElementPrint(ConstHandle2ConstElement self); + +// +++ Print to standard output, as XML +extern_c int +ElementPrintXML(ConstHandle2ConstElement self); + +// +++ Print to standard output, as JSON +extern_c int +ElementPrintJSON(ConstHandle2ConstElement self); + + +// ----------------------------------------------------------------------------- +// Metadatum: symbol +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ElementSymbolHas(ConstHandle2ConstElement self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ElementSymbolGet(ConstHandle2ConstElement self); + +// +++ Set +extern_c void +ElementSymbolSet(ConstHandle2Element self, const char *const symbol); + + +// ----------------------------------------------------------------------------- +// Metadatum: atomic_number +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ElementAtomicNumberHas(ConstHandle2ConstElement self); + +// +++ Get +// +++ Returns by value +extern_c int +ElementAtomicNumberGet(ConstHandle2ConstElement self); + +// +++ Set +extern_c void +ElementAtomicNumberSet(ConstHandle2Element self, const int atomic_number); + + +// ----------------------------------------------------------------------------- +// Child: isotope +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ElementIsotopeHas(ConstHandle2ConstElement self); + +// +++ Clear +extern_c void +ElementIsotopeClear(ConstHandle2Element self); + +// +++ Size +extern_c size_t +ElementIsotopeSize(ConstHandle2ConstElement self); + +// +++ Add +extern_c void +ElementIsotopeAdd(ConstHandle2Element self, ConstHandle2ConstIsotope isotope); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstIsotope +ElementIsotopeGetConst(ConstHandle2ConstElement self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Isotope +ElementIsotopeGet(ConstHandle2Element self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ElementIsotopeSet( + ConstHandle2Element self, + const size_t index_, + ConstHandle2ConstIsotope isotope +); + +// +++ Has, by mass_number +extern_c int +ElementIsotopeHasByMassNumber( + ConstHandle2ConstElement self, + const int mass_number +); + +// --- Get, by mass_number, const +extern_c Handle2ConstIsotope +ElementIsotopeGetByMassNumberConst( + ConstHandle2ConstElement self, + const int mass_number +); + +// +++ Get, by mass_number, non-const +extern_c Handle2Isotope +ElementIsotopeGetByMassNumber( + ConstHandle2Element self, + const int mass_number +); + +// +++ Set, by mass_number +extern_c void +ElementIsotopeSetByMassNumber( + ConstHandle2Element self, + const int mass_number, + ConstHandle2ConstIsotope isotope +); + + +// ----------------------------------------------------------------------------- +// Child: foobar +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ElementFoobarHas(ConstHandle2ConstElement self); + +// --- Get, const +extern_c Handle2ConstFoobar +ElementFoobarGetConst(ConstHandle2ConstElement self); + +// +++ Get, non-const +extern_c Handle2Foobar +ElementFoobarGet(ConstHandle2Element self); + +// +++ Set +extern_c void +ElementFoobarSet(ConstHandle2Element self, ConstHandle2ConstFoobar foobar); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1/multigroup/Element/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/simple/multi/c/src/v1/multigroup/Element/src/custom.cpp b/autogen/simple/multi/c/src/v1/multigroup/Element/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/simple/multi/c/src/v1/multigroup/Element/src/custom.h b/autogen/simple/multi/c/src/v1/multigroup/Element/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/simple/multi/c/src/v1/multigroup/Foobar.cpp b/autogen/simple/multi/c/src/v1/multigroup/Foobar.cpp new file mode 100644 index 000000000..2fc58121c --- /dev/null +++ b/autogen/simple/multi/c/src/v1/multigroup/Foobar.cpp @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "multi/v1/multigroup/Foobar.hpp" +#include "Foobar.h" + +using namespace njoy::GNDStk; +using namespace multi::v1; + +using C = FoobarClass; +using CPP = multigroup::Foobar; + +static const std::string CLASSNAME = "Foobar"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFoobar +FoobarDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Foobar +FoobarDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFoobar +FoobarCreateConst( + const char *const value +) { + ConstHandle2Foobar handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value + ); + return handle; +} + +// Create, general +Handle2Foobar +FoobarCreate( + const char *const value +) { + ConstHandle2Foobar handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +FoobarAssign(ConstHandle2Foobar self, ConstHandle2ConstFoobar from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FoobarDelete(ConstHandle2ConstFoobar self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FoobarRead(ConstHandle2Foobar self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FoobarWrite(ConstHandle2ConstFoobar self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FoobarPrint(ConstHandle2ConstFoobar self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FoobarPrintXML(ConstHandle2ConstFoobar self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FoobarPrintJSON(ConstHandle2ConstFoobar self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// Clear +void +FoobarDoublesClear(ConstHandle2Foobar self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +FoobarDoublesSize(ConstHandle2ConstFoobar self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +FoobarDoublesGet(ConstHandle2ConstFoobar self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +FoobarDoublesSet(ConstHandle2Foobar self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +FoobarDoublesGetArrayConst(ConstHandle2ConstFoobar self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +FoobarDoublesGetArray(ConstHandle2Foobar self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +FoobarDoublesSetArray(ConstHandle2Foobar self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +FoobarValueHas(ConstHandle2ConstFoobar self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +const char * +FoobarValueGet(ConstHandle2ConstFoobar self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +FoobarValueSet(ConstHandle2Foobar self, const char *const value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1/multigroup/Foobar/src/custom.cpp" diff --git a/autogen/simple/multi/c/src/v1/multigroup/Foobar.h b/autogen/simple/multi/c/src/v1/multigroup/Foobar.h new file mode 100644 index 000000000..b43064d75 --- /dev/null +++ b/autogen/simple/multi/c/src/v1/multigroup/Foobar.h @@ -0,0 +1,192 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Foobar is the basic handle type in this file. Example: +// // Create a default Foobar object: +// Foobar handle = FoobarDefault(); +// Functions involving Foobar are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_MULTI_V1_MULTIGROUP_FOOBAR +#define C_INTERFACE_MULTI_V1_MULTIGROUP_FOOBAR + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FoobarClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Foobar +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FoobarClass *Foobar; + +// --- Const-aware handles. +typedef const struct FoobarClass *const ConstHandle2ConstFoobar; +typedef struct FoobarClass *const ConstHandle2Foobar; +typedef const struct FoobarClass * Handle2ConstFoobar; +typedef struct FoobarClass * Handle2Foobar; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFoobar +FoobarDefaultConst(); + +// +++ Create, default +extern_c Handle2Foobar +FoobarDefault(); + +// --- Create, general, const +extern_c Handle2ConstFoobar +FoobarCreateConst( + const char *const value +); + +// +++ Create, general +extern_c Handle2Foobar +FoobarCreate( + const char *const value +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +FoobarAssign(ConstHandle2Foobar self, ConstHandle2ConstFoobar from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FoobarDelete(ConstHandle2ConstFoobar self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FoobarRead(ConstHandle2Foobar self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FoobarWrite(ConstHandle2ConstFoobar self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FoobarPrint(ConstHandle2ConstFoobar self); + +// +++ Print to standard output, as XML +extern_c int +FoobarPrintXML(ConstHandle2ConstFoobar self); + +// +++ Print to standard output, as JSON +extern_c int +FoobarPrintJSON(ConstHandle2ConstFoobar self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// +++ Clear +extern_c void +FoobarDoublesClear(ConstHandle2Foobar self); + +// +++ Get size +extern_c size_t +FoobarDoublesSize(ConstHandle2ConstFoobar self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +FoobarDoublesGet(ConstHandle2ConstFoobar self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +FoobarDoublesSet(ConstHandle2Foobar self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +FoobarDoublesGetArrayConst(ConstHandle2ConstFoobar self); + +// +++ Get pointer to existing values, non-const +extern_c double * +FoobarDoublesGetArray(ConstHandle2Foobar self); + +// +++ Set completely new values and size +extern_c void +FoobarDoublesSetArray(ConstHandle2Foobar self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FoobarValueHas(ConstHandle2ConstFoobar self); + +// +++ Get +// +++ Returns by value +extern_c const char * +FoobarValueGet(ConstHandle2ConstFoobar self); + +// +++ Set +extern_c void +FoobarValueSet(ConstHandle2Foobar self, const char *const value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1/multigroup/Foobar/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/simple/multi/c/src/v1/multigroup/Foobar/src/custom.cpp b/autogen/simple/multi/c/src/v1/multigroup/Foobar/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/simple/multi/c/src/v1/multigroup/Foobar/src/custom.h b/autogen/simple/multi/c/src/v1/multigroup/Foobar/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/simple/multi/c/src/v1/multigroup/Isotope.cpp b/autogen/simple/multi/c/src/v1/multigroup/Isotope.cpp new file mode 100644 index 000000000..6da318dae --- /dev/null +++ b/autogen/simple/multi/c/src/v1/multigroup/Isotope.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "multi/v1/multigroup/Isotope.hpp" +#include "Isotope.h" + +using namespace njoy::GNDStk; +using namespace multi::v1; + +using C = IsotopeClass; +using CPP = multigroup::Isotope; + +static const std::string CLASSNAME = "Isotope"; + +namespace extract { + static auto mass_number = [](auto &obj) { return &obj.mass_number; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIsotope +IsotopeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Isotope +IsotopeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIsotope +IsotopeCreateConst( + const int mass_number +) { + ConstHandle2Isotope handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + mass_number + ); + return handle; +} + +// Create, general +Handle2Isotope +IsotopeCreate( + const int mass_number +) { + ConstHandle2Isotope handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + mass_number + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +IsotopeAssign(ConstHandle2Isotope self, ConstHandle2ConstIsotope from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IsotopeDelete(ConstHandle2ConstIsotope self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IsotopeRead(ConstHandle2Isotope self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IsotopeWrite(ConstHandle2ConstIsotope self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IsotopePrint(ConstHandle2ConstIsotope self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IsotopePrintXML(ConstHandle2ConstIsotope self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IsotopePrintJSON(ConstHandle2ConstIsotope self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: mass_number +// ----------------------------------------------------------------------------- + +// Has +int +IsotopeMassNumberHas(ConstHandle2ConstIsotope self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MassNumberHas", self, extract::mass_number); +} + +// Get +// Returns by value +int +IsotopeMassNumberGet(ConstHandle2ConstIsotope self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassNumberGet", self, extract::mass_number); +} + +// Set +void +IsotopeMassNumberSet(ConstHandle2Isotope self, const int mass_number) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MassNumberSet", self, extract::mass_number, mass_number); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1/multigroup/Isotope/src/custom.cpp" diff --git a/autogen/simple/multi/c/src/v1/multigroup/Isotope.h b/autogen/simple/multi/c/src/v1/multigroup/Isotope.h new file mode 100644 index 000000000..6544101df --- /dev/null +++ b/autogen/simple/multi/c/src/v1/multigroup/Isotope.h @@ -0,0 +1,157 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Isotope is the basic handle type in this file. Example: +// // Create a default Isotope object: +// Isotope handle = IsotopeDefault(); +// Functions involving Isotope are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_MULTI_V1_MULTIGROUP_ISOTOPE +#define C_INTERFACE_MULTI_V1_MULTIGROUP_ISOTOPE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IsotopeClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Isotope +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IsotopeClass *Isotope; + +// --- Const-aware handles. +typedef const struct IsotopeClass *const ConstHandle2ConstIsotope; +typedef struct IsotopeClass *const ConstHandle2Isotope; +typedef const struct IsotopeClass * Handle2ConstIsotope; +typedef struct IsotopeClass * Handle2Isotope; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstIsotope +IsotopeDefaultConst(); + +// +++ Create, default +extern_c Handle2Isotope +IsotopeDefault(); + +// --- Create, general, const +extern_c Handle2ConstIsotope +IsotopeCreateConst( + const int mass_number +); + +// +++ Create, general +extern_c Handle2Isotope +IsotopeCreate( + const int mass_number +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IsotopeAssign(ConstHandle2Isotope self, ConstHandle2ConstIsotope from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IsotopeDelete(ConstHandle2ConstIsotope self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IsotopeRead(ConstHandle2Isotope self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IsotopeWrite(ConstHandle2ConstIsotope self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IsotopePrint(ConstHandle2ConstIsotope self); + +// +++ Print to standard output, as XML +extern_c int +IsotopePrintXML(ConstHandle2ConstIsotope self); + +// +++ Print to standard output, as JSON +extern_c int +IsotopePrintJSON(ConstHandle2ConstIsotope self); + + +// ----------------------------------------------------------------------------- +// Metadatum: mass_number +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IsotopeMassNumberHas(ConstHandle2ConstIsotope self); + +// +++ Get +// +++ Returns by value +extern_c int +IsotopeMassNumberGet(ConstHandle2ConstIsotope self); + +// +++ Set +extern_c void +IsotopeMassNumberSet(ConstHandle2Isotope self, const int mass_number); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1/multigroup/Isotope/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/simple/multi/c/src/v1/multigroup/Isotope/src/custom.cpp b/autogen/simple/multi/c/src/v1/multigroup/Isotope/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/simple/multi/c/src/v1/multigroup/Isotope/src/custom.h b/autogen/simple/multi/c/src/v1/multigroup/Isotope/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/simple/multi/c/src/v1/multigroup/Library.cpp b/autogen/simple/multi/c/src/v1/multigroup/Library.cpp new file mode 100644 index 000000000..eeb3c46d1 --- /dev/null +++ b/autogen/simple/multi/c/src/v1/multigroup/Library.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "multi/v1/multigroup/Library.hpp" +#include "Library.h" + +using namespace njoy::GNDStk; +using namespace multi::v1; + +using C = LibraryClass; +using CPP = multigroup::Library; + +static const std::string CLASSNAME = "Library"; + +namespace extract { + static auto name = [](auto &obj) { return &obj.name; }; + static auto element = [](auto &obj) { return &obj.element; }; +} + +using CPPElement = multigroup::Element; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLibrary +LibraryDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Library +LibraryDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLibrary +LibraryCreateConst( + const char *const name, + ConstHandle2Element *const element, const size_t elementSize +) { + ConstHandle2Library handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + name, + std::vector{} + ); + for (size_t ElementN = 0; ElementN < elementSize; ++ElementN) + LibraryElementAdd(handle, element[ElementN]); + return handle; +} + +// Create, general +Handle2Library +LibraryCreate( + const char *const name, + ConstHandle2Element *const element, const size_t elementSize +) { + ConstHandle2Library handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + name, + std::vector{} + ); + for (size_t ElementN = 0; ElementN < elementSize; ++ElementN) + LibraryElementAdd(handle, element[ElementN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +LibraryAssign(ConstHandle2Library self, ConstHandle2ConstLibrary from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LibraryDelete(ConstHandle2ConstLibrary self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LibraryRead(ConstHandle2Library self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LibraryWrite(ConstHandle2ConstLibrary self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LibraryPrint(ConstHandle2ConstLibrary self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LibraryPrintXML(ConstHandle2ConstLibrary self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LibraryPrintJSON(ConstHandle2ConstLibrary self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// Has +int +LibraryNameHas(ConstHandle2ConstLibrary self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NameHas", self, extract::name); +} + +// Get +// Returns by value +const char * +LibraryNameGet(ConstHandle2ConstLibrary self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +LibraryNameSet(ConstHandle2Library self, const char *const name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Child: element +// ----------------------------------------------------------------------------- + +// Has +int +LibraryElementHas(ConstHandle2ConstLibrary self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ElementHas", self, extract::element); +} + +// Clear +void +LibraryElementClear(ConstHandle2Library self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ElementClear", self, extract::element); +} + +// Size +size_t +LibraryElementSize(ConstHandle2ConstLibrary self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ElementSize", self, extract::element); +} + +// Add +void +LibraryElementAdd(ConstHandle2Library self, ConstHandle2ConstElement element) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ElementAdd", self, extract::element, element); +} + +// Get, by index \in [0,size), const +Handle2ConstElement +LibraryElementGetConst(ConstHandle2ConstLibrary self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ElementGetConst", self, extract::element, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Element +LibraryElementGet(ConstHandle2Library self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ElementGet", self, extract::element, index_); +} + +// Set, by index \in [0,size) +void +LibraryElementSet( + ConstHandle2Library self, + const size_t index_, + ConstHandle2ConstElement element +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ElementSet", self, extract::element, index_, element); +} + +// Has, by symbol +int +LibraryElementHasBySymbol( + ConstHandle2ConstLibrary self, + const char *const symbol +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ElementHasBySymbol", + self, extract::element, meta::symbol, symbol); +} + +// Get, by symbol, const +Handle2ConstElement +LibraryElementGetBySymbolConst( + ConstHandle2ConstLibrary self, + const char *const symbol +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ElementGetBySymbolConst", + self, extract::element, meta::symbol, symbol); +} + +// Get, by symbol, non-const +Handle2Element +LibraryElementGetBySymbol( + ConstHandle2Library self, + const char *const symbol +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ElementGetBySymbol", + self, extract::element, meta::symbol, symbol); +} + +// Set, by symbol +void +LibraryElementSetBySymbol( + ConstHandle2Library self, + const char *const symbol, + ConstHandle2ConstElement element +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ElementSetBySymbol", + self, extract::element, meta::symbol, symbol, element); +} + +// Has, by atomic_number +int +LibraryElementHasByAtomicNumber( + ConstHandle2ConstLibrary self, + const int atomic_number +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ElementHasByAtomicNumber", + self, extract::element, meta::atomic_number, atomic_number); +} + +// Get, by atomic_number, const +Handle2ConstElement +LibraryElementGetByAtomicNumberConst( + ConstHandle2ConstLibrary self, + const int atomic_number +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ElementGetByAtomicNumberConst", + self, extract::element, meta::atomic_number, atomic_number); +} + +// Get, by atomic_number, non-const +Handle2Element +LibraryElementGetByAtomicNumber( + ConstHandle2Library self, + const int atomic_number +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ElementGetByAtomicNumber", + self, extract::element, meta::atomic_number, atomic_number); +} + +// Set, by atomic_number +void +LibraryElementSetByAtomicNumber( + ConstHandle2Library self, + const int atomic_number, + ConstHandle2ConstElement element +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ElementSetByAtomicNumber", + self, extract::element, meta::atomic_number, atomic_number, element); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1/multigroup/Library/src/custom.cpp" diff --git a/autogen/simple/multi/c/src/v1/multigroup/Library.h b/autogen/simple/multi/c/src/v1/multigroup/Library.h new file mode 100644 index 000000000..d9fa18fb7 --- /dev/null +++ b/autogen/simple/multi/c/src/v1/multigroup/Library.h @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Library is the basic handle type in this file. Example: +// // Create a default Library object: +// Library handle = LibraryDefault(); +// Functions involving Library are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_MULTI_V1_MULTIGROUP_LIBRARY +#define C_INTERFACE_MULTI_V1_MULTIGROUP_LIBRARY + +#include "GNDStk.h" +#include "v1/multigroup/Element.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LibraryClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Library +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LibraryClass *Library; + +// --- Const-aware handles. +typedef const struct LibraryClass *const ConstHandle2ConstLibrary; +typedef struct LibraryClass *const ConstHandle2Library; +typedef const struct LibraryClass * Handle2ConstLibrary; +typedef struct LibraryClass * Handle2Library; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstLibrary +LibraryDefaultConst(); + +// +++ Create, default +extern_c Handle2Library +LibraryDefault(); + +// --- Create, general, const +extern_c Handle2ConstLibrary +LibraryCreateConst( + const char *const name, + ConstHandle2Element *const element, const size_t elementSize +); + +// +++ Create, general +extern_c Handle2Library +LibraryCreate( + const char *const name, + ConstHandle2Element *const element, const size_t elementSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +LibraryAssign(ConstHandle2Library self, ConstHandle2ConstLibrary from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LibraryDelete(ConstHandle2ConstLibrary self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LibraryRead(ConstHandle2Library self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LibraryWrite(ConstHandle2ConstLibrary self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LibraryPrint(ConstHandle2ConstLibrary self); + +// +++ Print to standard output, as XML +extern_c int +LibraryPrintXML(ConstHandle2ConstLibrary self); + +// +++ Print to standard output, as JSON +extern_c int +LibraryPrintJSON(ConstHandle2ConstLibrary self); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LibraryNameHas(ConstHandle2ConstLibrary self); + +// +++ Get +// +++ Returns by value +extern_c const char * +LibraryNameGet(ConstHandle2ConstLibrary self); + +// +++ Set +extern_c void +LibraryNameSet(ConstHandle2Library self, const char *const name); + + +// ----------------------------------------------------------------------------- +// Child: element +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LibraryElementHas(ConstHandle2ConstLibrary self); + +// +++ Clear +extern_c void +LibraryElementClear(ConstHandle2Library self); + +// +++ Size +extern_c size_t +LibraryElementSize(ConstHandle2ConstLibrary self); + +// +++ Add +extern_c void +LibraryElementAdd(ConstHandle2Library self, ConstHandle2ConstElement element); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstElement +LibraryElementGetConst(ConstHandle2ConstLibrary self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Element +LibraryElementGet(ConstHandle2Library self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +LibraryElementSet( + ConstHandle2Library self, + const size_t index_, + ConstHandle2ConstElement element +); + +// +++ Has, by symbol +extern_c int +LibraryElementHasBySymbol( + ConstHandle2ConstLibrary self, + const char *const symbol +); + +// --- Get, by symbol, const +extern_c Handle2ConstElement +LibraryElementGetBySymbolConst( + ConstHandle2ConstLibrary self, + const char *const symbol +); + +// +++ Get, by symbol, non-const +extern_c Handle2Element +LibraryElementGetBySymbol( + ConstHandle2Library self, + const char *const symbol +); + +// +++ Set, by symbol +extern_c void +LibraryElementSetBySymbol( + ConstHandle2Library self, + const char *const symbol, + ConstHandle2ConstElement element +); + +// +++ Has, by atomic_number +extern_c int +LibraryElementHasByAtomicNumber( + ConstHandle2ConstLibrary self, + const int atomic_number +); + +// --- Get, by atomic_number, const +extern_c Handle2ConstElement +LibraryElementGetByAtomicNumberConst( + ConstHandle2ConstLibrary self, + const int atomic_number +); + +// +++ Get, by atomic_number, non-const +extern_c Handle2Element +LibraryElementGetByAtomicNumber( + ConstHandle2Library self, + const int atomic_number +); + +// +++ Set, by atomic_number +extern_c void +LibraryElementSetByAtomicNumber( + ConstHandle2Library self, + const int atomic_number, + ConstHandle2ConstElement element +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1/multigroup/Library/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/simple/multi/c/src/v1/multigroup/Library/src/custom.cpp b/autogen/simple/multi/c/src/v1/multigroup/Library/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/simple/multi/c/src/v1/multigroup/Library/src/custom.h b/autogen/simple/multi/c/src/v1/multigroup/Library/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/simple/multi/c/src/v1/multigroup/Multigroup.cpp b/autogen/simple/multi/c/src/v1/multigroup/Multigroup.cpp new file mode 100644 index 000000000..95a2844c8 --- /dev/null +++ b/autogen/simple/multi/c/src/v1/multigroup/Multigroup.cpp @@ -0,0 +1,292 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "multi/v1/multigroup/Multigroup.hpp" +#include "Multigroup.h" + +using namespace njoy::GNDStk; +using namespace multi::v1; + +using C = MultigroupClass; +using CPP = multigroup::Multigroup; + +static const std::string CLASSNAME = "Multigroup"; + +namespace extract { + static auto projectile = [](auto &obj) { return &obj.projectile; }; + static auto library = [](auto &obj) { return &obj.library; }; +} + +using CPPLibrary = multigroup::Library; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMultigroup +MultigroupDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default +Handle2Multigroup +MultigroupDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMultigroup +MultigroupCreateConst( + const char *const projectile, + ConstHandle2Library *const library, const size_t librarySize +) { + ConstHandle2Multigroup handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + projectile, + std::vector{} + ); + for (size_t LibraryN = 0; LibraryN < librarySize; ++LibraryN) + MultigroupLibraryAdd(handle, library[LibraryN]); + return handle; +} + +// Create, general +Handle2Multigroup +MultigroupCreate( + const char *const projectile, + ConstHandle2Library *const library, const size_t librarySize +) { + ConstHandle2Multigroup handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + projectile, + std::vector{} + ); + for (size_t LibraryN = 0; LibraryN < librarySize; ++LibraryN) + MultigroupLibraryAdd(handle, library[LibraryN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MultigroupAssign(ConstHandle2Multigroup self, ConstHandle2ConstMultigroup from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MultigroupDelete(ConstHandle2ConstMultigroup self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MultigroupRead(ConstHandle2Multigroup self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MultigroupWrite(ConstHandle2ConstMultigroup self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MultigroupPrint(ConstHandle2ConstMultigroup self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MultigroupPrintXML(ConstHandle2ConstMultigroup self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MultigroupPrintJSON(ConstHandle2ConstMultigroup self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// Has +int +MultigroupProjectileHas(ConstHandle2ConstMultigroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProjectileHas", self, extract::projectile); +} + +// Get +// Returns by value +const char * +MultigroupProjectileGet(ConstHandle2ConstMultigroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileGet", self, extract::projectile); +} + +// Set +void +MultigroupProjectileSet(ConstHandle2Multigroup self, const char *const projectile) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProjectileSet", self, extract::projectile, projectile); +} + + +// ----------------------------------------------------------------------------- +// Child: library +// ----------------------------------------------------------------------------- + +// Has +int +MultigroupLibraryHas(ConstHandle2ConstMultigroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LibraryHas", self, extract::library); +} + +// Clear +void +MultigroupLibraryClear(ConstHandle2Multigroup self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"LibraryClear", self, extract::library); +} + +// Size +size_t +MultigroupLibrarySize(ConstHandle2ConstMultigroup self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"LibrarySize", self, extract::library); +} + +// Add +void +MultigroupLibraryAdd(ConstHandle2Multigroup self, ConstHandle2ConstLibrary library) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"LibraryAdd", self, extract::library, library); +} + +// Get, by index \in [0,size), const +Handle2ConstLibrary +MultigroupLibraryGetConst(ConstHandle2ConstMultigroup self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"LibraryGetConst", self, extract::library, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Library +MultigroupLibraryGet(ConstHandle2Multigroup self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"LibraryGet", self, extract::library, index_); +} + +// Set, by index \in [0,size) +void +MultigroupLibrarySet( + ConstHandle2Multigroup self, + const size_t index_, + ConstHandle2ConstLibrary library +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"LibrarySet", self, extract::library, index_, library); +} + +// Has, by name +int +MultigroupLibraryHasByName( + ConstHandle2ConstMultigroup self, + const char *const name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"LibraryHasByName", + self, extract::library, meta::name, name); +} + +// Get, by name, const +Handle2ConstLibrary +MultigroupLibraryGetByNameConst( + ConstHandle2ConstMultigroup self, + const char *const name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LibraryGetByNameConst", + self, extract::library, meta::name, name); +} + +// Get, by name, non-const +Handle2Library +MultigroupLibraryGetByName( + ConstHandle2Multigroup self, + const char *const name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LibraryGetByName", + self, extract::library, meta::name, name); +} + +// Set, by name +void +MultigroupLibrarySetByName( + ConstHandle2Multigroup self, + const char *const name, + ConstHandle2ConstLibrary library +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"LibrarySetByName", + self, extract::library, meta::name, name, library); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1/multigroup/Multigroup/src/custom.cpp" diff --git a/autogen/simple/multi/c/src/v1/multigroup/Multigroup.h b/autogen/simple/multi/c/src/v1/multigroup/Multigroup.h new file mode 100644 index 000000000..4c4ac5aa6 --- /dev/null +++ b/autogen/simple/multi/c/src/v1/multigroup/Multigroup.h @@ -0,0 +1,226 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Multigroup is the basic handle type in this file. Example: +// // Create a default Multigroup object: +// Multigroup handle = MultigroupDefault(); +// Functions involving Multigroup are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_MULTI_V1_MULTIGROUP_MULTIGROUP +#define C_INTERFACE_MULTI_V1_MULTIGROUP_MULTIGROUP + +#include "GNDStk.h" +#include "v1/multigroup/Library.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MultigroupClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Multigroup +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MultigroupClass *Multigroup; + +// --- Const-aware handles. +typedef const struct MultigroupClass *const ConstHandle2ConstMultigroup; +typedef struct MultigroupClass *const ConstHandle2Multigroup; +typedef const struct MultigroupClass * Handle2ConstMultigroup; +typedef struct MultigroupClass * Handle2Multigroup; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMultigroup +MultigroupDefaultConst(); + +// +++ Create, default +extern_c Handle2Multigroup +MultigroupDefault(); + +// --- Create, general, const +extern_c Handle2ConstMultigroup +MultigroupCreateConst( + const char *const projectile, + ConstHandle2Library *const library, const size_t librarySize +); + +// +++ Create, general +extern_c Handle2Multigroup +MultigroupCreate( + const char *const projectile, + ConstHandle2Library *const library, const size_t librarySize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MultigroupAssign(ConstHandle2Multigroup self, ConstHandle2ConstMultigroup from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MultigroupDelete(ConstHandle2ConstMultigroup self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MultigroupRead(ConstHandle2Multigroup self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MultigroupWrite(ConstHandle2ConstMultigroup self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MultigroupPrint(ConstHandle2ConstMultigroup self); + +// +++ Print to standard output, as XML +extern_c int +MultigroupPrintXML(ConstHandle2ConstMultigroup self); + +// +++ Print to standard output, as JSON +extern_c int +MultigroupPrintJSON(ConstHandle2ConstMultigroup self); + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultigroupProjectileHas(ConstHandle2ConstMultigroup self); + +// +++ Get +// +++ Returns by value +extern_c const char * +MultigroupProjectileGet(ConstHandle2ConstMultigroup self); + +// +++ Set +extern_c void +MultigroupProjectileSet(ConstHandle2Multigroup self, const char *const projectile); + + +// ----------------------------------------------------------------------------- +// Child: library +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultigroupLibraryHas(ConstHandle2ConstMultigroup self); + +// +++ Clear +extern_c void +MultigroupLibraryClear(ConstHandle2Multigroup self); + +// +++ Size +extern_c size_t +MultigroupLibrarySize(ConstHandle2ConstMultigroup self); + +// +++ Add +extern_c void +MultigroupLibraryAdd(ConstHandle2Multigroup self, ConstHandle2ConstLibrary library); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstLibrary +MultigroupLibraryGetConst(ConstHandle2ConstMultigroup self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Library +MultigroupLibraryGet(ConstHandle2Multigroup self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +MultigroupLibrarySet( + ConstHandle2Multigroup self, + const size_t index_, + ConstHandle2ConstLibrary library +); + +// +++ Has, by name +extern_c int +MultigroupLibraryHasByName( + ConstHandle2ConstMultigroup self, + const char *const name +); + +// --- Get, by name, const +extern_c Handle2ConstLibrary +MultigroupLibraryGetByNameConst( + ConstHandle2ConstMultigroup self, + const char *const name +); + +// +++ Get, by name, non-const +extern_c Handle2Library +MultigroupLibraryGetByName( + ConstHandle2Multigroup self, + const char *const name +); + +// +++ Set, by name +extern_c void +MultigroupLibrarySetByName( + ConstHandle2Multigroup self, + const char *const name, + ConstHandle2ConstLibrary library +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v1/multigroup/Multigroup/src/custom.h" + +#undef extern_c +#endif diff --git a/autogen/simple/multi/c/src/v1/multigroup/Multigroup/src/custom.cpp b/autogen/simple/multi/c/src/v1/multigroup/Multigroup/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/simple/multi/c/src/v1/multigroup/Multigroup/src/custom.h b/autogen/simple/multi/c/src/v1/multigroup/Multigroup/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/autogen/simple/multi/python/src/v1/multigroup.python.cpp b/autogen/simple/multi/python/src/v1/multigroup.python.cpp new file mode 100644 index 000000000..0ce372277 --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup.python.cpp @@ -0,0 +1,37 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include + +// v1 interface +namespace python_v1 { + +// multigroup declarations +namespace python_multigroup { + void wrapIsotope(pybind11::module &); + void wrapFoobar(pybind11::module &); + void wrapElement(pybind11::module &); + void wrapLibrary(pybind11::module &); + void wrapMultigroup(pybind11::module &); +} // namespace python_multigroup + +// wrapper for multigroup +void wrapMultigroup(pybind11::module &module) +{ + // create the multigroup submodule + pybind11::module submodule = module.def_submodule( + "multigroup", + "multi v1 multigroup" + ); + + // wrap multigroup components + python_multigroup::wrapIsotope(submodule); + python_multigroup::wrapFoobar(submodule); + python_multigroup::wrapElement(submodule); + python_multigroup::wrapLibrary(submodule); + python_multigroup::wrapMultigroup(submodule); +}; + +} // namespace python_v1 diff --git a/autogen/simple/multi/python/src/v1/multigroup/Element.python.cpp b/autogen/simple/multi/python/src/v1/multigroup/Element.python.cpp new file mode 100644 index 000000000..380b0388e --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup/Element.python.cpp @@ -0,0 +1,107 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "multi/v1/multigroup/Element.hpp" +#include "definitions.hpp" + +namespace python_v1 { +namespace python_multigroup { + +// wrapper for multigroup::Element +void wrapElement(pybind11::module &module) +{ + using namespace multi; + using namespace multi::v1; + + // type aliases + using cppCLASS = multigroup::Element; + + // create the Python object + pybind11::class_ object( + module, "Element", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const int &, + const std::vector &, + const std::optional & + >(), + pybind11::arg("symbol") = std::nullopt, + pybind11::arg("atomic_number"), + pybind11::arg("isotope"), + pybind11::arg("foobar") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set symbol + object.def_property( + "symbol", + [](const cppCLASS &self) -> decltype(auto) + { + return self.symbol(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.symbol() = value; + }, + cppCLASS::component_t::documentation("symbol").data() + ); + + // get/set atomic_number + object.def_property( + "atomic_number", + [](const cppCLASS &self) -> decltype(auto) + { + return self.atomic_number(); + }, + [](cppCLASS &self, const int &value) + { + self.atomic_number() = value; + }, + cppCLASS::component_t::documentation("atomic_number").data() + ); + + // get/set isotope + object.def_property( + "isotope", + [](const cppCLASS &self) -> decltype(auto) + { + return self.isotope(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.isotope() = value; + }, + cppCLASS::component_t::documentation("isotope").data() + ); + + // get/set foobar + object.def_property( + "foobar", + [](const cppCLASS &self) -> decltype(auto) + { + return self.foobar(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.foobar() = value; + }, + cppCLASS::component_t::documentation("foobar").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_multigroup +} // namespace python_v1 diff --git a/autogen/simple/multi/python/src/v1/multigroup/Foobar.python.cpp b/autogen/simple/multi/python/src/v1/multigroup/Foobar.python.cpp new file mode 100644 index 000000000..b49f899d6 --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup/Foobar.python.cpp @@ -0,0 +1,82 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "multi/v1/multigroup/Foobar.hpp" +#include "definitions.hpp" + +namespace python_v1 { +namespace python_multigroup { + +// wrapper for multigroup::Foobar +void wrapFoobar(pybind11::module &module) +{ + using namespace multi; + using namespace multi::v1; + + // type aliases + using cppCLASS = multigroup::Foobar; + + // create the Python object + pybind11::class_ object( + module, "Foobar", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string & + >(), + pybind11::arg("value"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set vector + object.def_property( + "doubles", + [](const cppCLASS &self) -> const std::vector & + { + return self; + }, + [](cppCLASS &self, const std::vector &value) + { + self = value; + }, + cppCLASS::component_t::documentation("doubles").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_multigroup +} // namespace python_v1 diff --git a/autogen/simple/multi/python/src/v1/multigroup/Isotope.python.cpp b/autogen/simple/multi/python/src/v1/multigroup/Isotope.python.cpp new file mode 100644 index 000000000..6b79c3ad4 --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup/Isotope.python.cpp @@ -0,0 +1,59 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "multi/v1/multigroup/Isotope.hpp" +#include "definitions.hpp" + +namespace python_v1 { +namespace python_multigroup { + +// wrapper for multigroup::Isotope +void wrapIsotope(pybind11::module &module) +{ + using namespace multi; + using namespace multi::v1; + + // type aliases + using cppCLASS = multigroup::Isotope; + + // create the Python object + pybind11::class_ object( + module, "Isotope", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const int & + >(), + pybind11::arg("mass_number"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set mass_number + object.def_property( + "mass_number", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mass_number(); + }, + [](cppCLASS &self, const int &value) + { + self.mass_number() = value; + }, + cppCLASS::component_t::documentation("mass_number").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_multigroup +} // namespace python_v1 diff --git a/autogen/simple/multi/python/src/v1/multigroup/Library.python.cpp b/autogen/simple/multi/python/src/v1/multigroup/Library.python.cpp new file mode 100644 index 000000000..a60b61feb --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup/Library.python.cpp @@ -0,0 +1,75 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "multi/v1/multigroup/Library.hpp" +#include "definitions.hpp" + +namespace python_v1 { +namespace python_multigroup { + +// wrapper for multigroup::Library +void wrapLibrary(pybind11::module &module) +{ + using namespace multi; + using namespace multi::v1; + + // type aliases + using cppCLASS = multigroup::Library; + + // create the Python object + pybind11::class_ object( + module, "Library", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::vector & + >(), + pybind11::arg("name"), + pybind11::arg("element"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set name + object.def_property( + "name", + [](const cppCLASS &self) -> decltype(auto) + { + return self.name(); + }, + [](cppCLASS &self, const std::string &value) + { + self.name() = value; + }, + cppCLASS::component_t::documentation("name").data() + ); + + // get/set element + object.def_property( + "element", + [](const cppCLASS &self) -> decltype(auto) + { + return self.element(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.element() = value; + }, + cppCLASS::component_t::documentation("element").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_multigroup +} // namespace python_v1 diff --git a/autogen/simple/multi/python/src/v1/multigroup/Multigroup.python.cpp b/autogen/simple/multi/python/src/v1/multigroup/Multigroup.python.cpp new file mode 100644 index 000000000..6ad763c36 --- /dev/null +++ b/autogen/simple/multi/python/src/v1/multigroup/Multigroup.python.cpp @@ -0,0 +1,75 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include + +// local includes +#include "multi/v1/multigroup/Multigroup.hpp" +#include "definitions.hpp" + +namespace python_v1 { +namespace python_multigroup { + +// wrapper for multigroup::Multigroup +void wrapMultigroup(pybind11::module &module) +{ + using namespace multi; + using namespace multi::v1; + + // type aliases + using cppCLASS = multigroup::Multigroup; + + // create the Python object + pybind11::class_ object( + module, "Multigroup", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::vector & + >(), + pybind11::arg("projectile"), + pybind11::arg("library"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set projectile + object.def_property( + "projectile", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectile(); + }, + [](cppCLASS &self, const std::string &value) + { + self.projectile() = value; + }, + cppCLASS::component_t::documentation("projectile").data() + ); + + // get/set library + object.def_property( + "library", + [](const cppCLASS &self) -> decltype(auto) + { + return self.library(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.library() = value; + }, + cppCLASS::component_t::documentation("library").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_multigroup +} // namespace python_v1 diff --git a/autogen/simple/multi/src/multi/v1.hpp b/autogen/simple/multi/src/multi/v1.hpp new file mode 100644 index 000000000..4170993a7 --- /dev/null +++ b/autogen/simple/multi/src/multi/v1.hpp @@ -0,0 +1,14 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef MULTI_V1 +#define MULTI_V1 + +#include "multi/v1/multigroup/Element.hpp" +#include "multi/v1/multigroup/Foobar.hpp" +#include "multi/v1/multigroup/Isotope.hpp" +#include "multi/v1/multigroup/Library.hpp" +#include "multi/v1/multigroup/Multigroup.hpp" + +#endif diff --git a/autogen/simple/multi/src/multi/v1/key.hpp b/autogen/simple/multi/src/multi/v1/key.hpp new file mode 100644 index 000000000..bdaf92941 --- /dev/null +++ b/autogen/simple/multi/src/multi/v1/key.hpp @@ -0,0 +1,83 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef MULTI_V1_KEY +#define MULTI_V1_KEY + +// GNDStk Core Interface +#include "GNDStk.hpp" + +namespace multi { +namespace v1 { + +using namespace njoy; +using namespace GNDStk; + + +// ----------------------------------------------------------------------------- +// meta:: +// ----------------------------------------------------------------------------- + +namespace meta { + +#define NJOY_GNDSTK_MAKE_LOOKUP(nameField,nameGNDS) \ + inline const auto nameField = makeLookup( \ + #nameGNDS, \ + [](const auto &obj) -> decltype(obj.nameField()) \ + { \ + return obj.nameField(); \ + } \ + ) +// nameField vs. nameGNDS: e.g. Double, vs. double in GNDS; usually identical + +NJOY_GNDSTK_MAKE_LOOKUP(atomic_number,atomic_number); +NJOY_GNDSTK_MAKE_LOOKUP(mass_number,mass_number); +NJOY_GNDSTK_MAKE_LOOKUP(name,name); +NJOY_GNDSTK_MAKE_LOOKUP(projectile,projectile); +NJOY_GNDSTK_MAKE_LOOKUP(symbol,symbol); +NJOY_GNDSTK_MAKE_LOOKUP(value,value); + +#undef NJOY_GNDSTK_MAKE_LOOKUP + +} // namespace meta + + +// ----------------------------------------------------------------------------- +// multigroup::child:: +// ----------------------------------------------------------------------------- + +namespace multigroup { +namespace child { + +inline const Child<> element("element"); +inline const Child<> foobar("foobar"); +inline const Child<> isotope("isotope"); +inline const Child<> library("library"); +inline const Child<> multigroup("multigroup"); + +} // namespace child +using namespace child; +} // namespace multigroup + + +// ----------------------------------------------------------------------------- +// For convenience: using directives +// ----------------------------------------------------------------------------- + +namespace key { + using namespace meta; + using namespace multigroup::child; +} // namespace key + +using namespace key; +using namespace multigroup; + + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + +} // namespace v1 +} // namespace multi + +#endif diff --git a/autogen/simple/multi/src/multi/v1/multigroup/Element.hpp b/autogen/simple/multi/src/multi/v1/multigroup/Element.hpp new file mode 100644 index 000000000..b6f2e28bb --- /dev/null +++ b/autogen/simple/multi/src/multi/v1/multigroup/Element.hpp @@ -0,0 +1,226 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef MULTI_V1_MULTIGROUP_ELEMENT +#define MULTI_V1_MULTIGROUP_ELEMENT + +#include "multi/v1/multigroup/Isotope.hpp" +#include "multi/v1/multigroup/Foobar.hpp" + +namespace multi { +namespace v1 { +namespace multigroup { + +// ----------------------------------------------------------------------------- +// multigroup:: +// class Element +// ----------------------------------------------------------------------------- + +class Element : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "multigroup"; } + static auto CLASS() { return "Element"; } + static auto NODENAME() { return "element"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("symbol") | + int{} + / Meta<>("atomic_number") | + + // children + ++Child + ("isotope") | + --Child> + ("foobar") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "symbol", + "atomic_number", + "isotope", + "foobar" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "symbol", + "atomic_number", + "isotope", + "foobar" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + symbol{this}; + Field + atomic_number{this}; + + // children + Field> + isotope{this}; + Field> + foobar{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->symbol, \ + this->atomic_number, \ + this->isotope, \ + this->foobar \ + ) + + // default + Element() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Element( + const wrapper> + &symbol, + const wrapper + &atomic_number = {}, + const wrapper> + &isotope = {}, + const wrapper> + &foobar = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + symbol(this,symbol), + atomic_number(this,atomic_number), + isotope(this,isotope), + foobar(this,foobar) + { + Component::finish(); + } + + // from node + explicit Element(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Element(const Element &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + symbol(this,other.symbol), + atomic_number(this,other.atomic_number), + isotope(this,other.isotope), + foobar(this,other.foobar) + { + Component::finish(other); + } + + // move + Element(Element &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + symbol(this,std::move(other.symbol)), + atomic_number(this,std::move(other.atomic_number)), + isotope(this,std::move(other.isotope)), + foobar(this,std::move(other.foobar)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Element &operator=(const Element &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + symbol = other.symbol; + atomic_number = other.atomic_number; + isotope = other.isotope; + foobar = other.foobar; + } + return *this; + } + + // move + Element &operator=(Element &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + symbol = std::move(other.symbol); + atomic_number = std::move(other.atomic_number); + isotope = std::move(other.isotope); + foobar = std::move(other.foobar); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "multi/v1/multigroup/Element/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Element + +} // namespace multigroup +} // namespace v1 +} // namespace multi + +#endif diff --git a/autogen/simple/multi/src/multi/v1/multigroup/Element/src/custom.hpp b/autogen/simple/multi/src/multi/v1/multigroup/Element/src/custom.hpp new file mode 100644 index 000000000..b944fbfe2 --- /dev/null +++ b/autogen/simple/multi/src/multi/v1/multigroup/Element/src/custom.hpp @@ -0,0 +1,28 @@ + +private: + + static inline helpMap help = {}; + +public: + + // Custom 2-argument print() function. + // In order to be called by Component::print(), this function must be public, + // and must have the exact signature shown here, including both the constness + // of the second parameter, and of the function itself. + std::ostream &print(std::ostream &os, const int level) const + { + // When Component::print() calls a custom print() that takes indentation + // level (as opposed to a custom print() that takes only a std::ostream), + // it assumes that the custom print() takes care of its own indentation. + // So, prefer this print() over a std::ostream-only print() - for which + // Component::print() indents as it believes is appropriate - ONLY if you + // wish to do something nonstandard with indentation. + + // Here, we'll indent as GNDStk does: using GNDStk::indent*level spaces. + // GNDStk::indentTo() creates an appropriate std::string for that purpose. + os << indentTo(level) << "*** Custom Element print(), line 1\n"; + os << indentTo(level) << "*** Custom Element print(), line 2\n"; + os << indentTo(level) << "*** Custom Element print(), line 3"; + + return os; + } diff --git a/autogen/simple/multi/src/multi/v1/multigroup/Foobar.hpp b/autogen/simple/multi/src/multi/v1/multigroup/Foobar.hpp new file mode 100644 index 000000000..4e607e102 --- /dev/null +++ b/autogen/simple/multi/src/multi/v1/multigroup/Foobar.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef MULTI_V1_MULTIGROUP_FOOBAR +#define MULTI_V1_MULTIGROUP_FOOBAR + +#include "multi/v1/key.hpp" + +namespace multi { +namespace v1 { +namespace multigroup { + +// ----------------------------------------------------------------------------- +// multigroup:: +// class Foobar +// ----------------------------------------------------------------------------- + +class Foobar : + public Component, + public DataNode,false> +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "multigroup"; } + static auto CLASS() { return "Foobar"; } + static auto NODENAME() { return "foobar"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("value") | + + // data + --Child(special::self) / DataConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "doubles" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "doubles" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using DataNode::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + + // data + std::vector &doubles = *this; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + static_cast(*this) \ + ) + + // default + Foobar() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Foobar( + const wrapper + &value + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value) + { + Component::finish(); + } + + // from node + explicit Foobar(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Foobar(const std::vector &vector) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Foobar(const Foobar &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment), + value(this,other.value) + { + Component::finish(other); + } + + // move + Foobar(Foobar &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(std::move(other)), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Foobar &operator=(const Foobar &other) + { + if (this != &other) { + Component::operator=(other); + DataNode::operator=(other); + comment = other.comment; + value = other.value; + } + return *this; + } + + // move + Foobar &operator=(Foobar &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + DataNode::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "multi/v1/multigroup/Foobar/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Foobar + +} // namespace multigroup +} // namespace v1 +} // namespace multi + +#endif diff --git a/autogen/simple/multi/src/multi/v1/multigroup/Foobar/src/custom.hpp b/autogen/simple/multi/src/multi/v1/multigroup/Foobar/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/autogen/simple/multi/src/multi/v1/multigroup/Foobar/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/autogen/simple/multi/src/multi/v1/multigroup/Isotope.hpp b/autogen/simple/multi/src/multi/v1/multigroup/Isotope.hpp new file mode 100644 index 000000000..68a485350 --- /dev/null +++ b/autogen/simple/multi/src/multi/v1/multigroup/Isotope.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef MULTI_V1_MULTIGROUP_ISOTOPE +#define MULTI_V1_MULTIGROUP_ISOTOPE + +#include "multi/v1/key.hpp" + +namespace multi { +namespace v1 { +namespace multigroup { + +// ----------------------------------------------------------------------------- +// multigroup:: +// class Isotope +// ----------------------------------------------------------------------------- + +class Isotope : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "multigroup"; } + static auto CLASS() { return "Isotope"; } + static auto NODENAME() { return "isotope"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + int{} + / Meta<>("mass_number") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "mass_number" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "mass_number" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + mass_number{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->mass_number \ + ) + + // default + Isotope() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Isotope( + const wrapper + &mass_number + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + mass_number(this,mass_number) + { + Component::finish(); + } + + // from node + explicit Isotope(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Isotope(const Isotope &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + mass_number(this,other.mass_number) + { + Component::finish(other); + } + + // move + Isotope(Isotope &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + mass_number(this,std::move(other.mass_number)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Isotope &operator=(const Isotope &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + mass_number = other.mass_number; + } + return *this; + } + + // move + Isotope &operator=(Isotope &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + mass_number = std::move(other.mass_number); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "multi/v1/multigroup/Isotope/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Isotope + +} // namespace multigroup +} // namespace v1 +} // namespace multi + +#endif diff --git a/autogen/simple/multi/src/multi/v1/multigroup/Isotope/src/custom.hpp b/autogen/simple/multi/src/multi/v1/multigroup/Isotope/src/custom.hpp new file mode 100644 index 000000000..758ac991d --- /dev/null +++ b/autogen/simple/multi/src/multi/v1/multigroup/Isotope/src/custom.hpp @@ -0,0 +1,25 @@ + +private: + + static inline helpMap help = {}; + +public: + + // If a custom 1-argument print() function *and* a custom 2-argument print() + // function are both given, and both with the correct signature, then + // Component::print() will call the 2-argument version, and ignore the other. + + std::ostream &print(std::ostream &os) const + { + assert(false); // shouldn't happen, because the below print() is used! + return os; + } + + std::ostream &print(std::ostream &os, const int level) const + { + os << indentTo(level) << "*** Custom Isotope print(), line 1\n"; + os << indentTo(level) << "*** Custom Isotope print(), line 2\n"; + os << indentTo(level) << "*** Custom Isotope print(), line 3"; + + return os; + } diff --git a/autogen/simple/multi/src/multi/v1/multigroup/Library.hpp b/autogen/simple/multi/src/multi/v1/multigroup/Library.hpp new file mode 100644 index 000000000..caf49128c --- /dev/null +++ b/autogen/simple/multi/src/multi/v1/multigroup/Library.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef MULTI_V1_MULTIGROUP_LIBRARY +#define MULTI_V1_MULTIGROUP_LIBRARY + +#include "multi/v1/multigroup/Element.hpp" + +namespace multi { +namespace v1 { +namespace multigroup { + +// ----------------------------------------------------------------------------- +// multigroup:: +// class Library +// ----------------------------------------------------------------------------- + +class Library : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "multigroup"; } + static auto CLASS() { return "Library"; } + static auto NODENAME() { return "library"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("name") | + + // children + ++Child + ("element") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "name", + "element" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "name", + "element" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + name{this}; + + // children + Field> + element{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name, \ + this->element \ + ) + + // default + Library() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Library( + const wrapper + &name, + const wrapper> + &element = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + name(this,name), + element(this,element) + { + Component::finish(); + } + + // from node + explicit Library(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Library(const Library &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name), + element(this,other.element) + { + Component::finish(other); + } + + // move + Library(Library &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + name(this,std::move(other.name)), + element(this,std::move(other.element)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Library &operator=(const Library &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + name = other.name; + element = other.element; + } + return *this; + } + + // move + Library &operator=(Library &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + name = std::move(other.name); + element = std::move(other.element); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "multi/v1/multigroup/Library/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Library + +} // namespace multigroup +} // namespace v1 +} // namespace multi + +#endif diff --git a/autogen/simple/multi/src/multi/v1/multigroup/Library/src/custom.hpp b/autogen/simple/multi/src/multi/v1/multigroup/Library/src/custom.hpp new file mode 100644 index 000000000..3382adeec --- /dev/null +++ b/autogen/simple/multi/src/multi/v1/multigroup/Library/src/custom.hpp @@ -0,0 +1,19 @@ + +private: + + static inline helpMap help = {}; + +public: + + // Custom 1-argument print() function. + // In order to be called by Component::print(), this function must be public, + // and must have the exact signature shown here, including the constness of + // the function itself. + std::ostream &print(std::ostream &os) const + { + os << "*** Custom Library print(), line 1\n"; + os << "*** Custom Library print(), line 2\n"; + os << "*** Custom Library print(), line 3"; + + return os; + } diff --git a/autogen/simple/multi/src/multi/v1/multigroup/Multigroup.hpp b/autogen/simple/multi/src/multi/v1/multigroup/Multigroup.hpp new file mode 100644 index 000000000..e4e5ec8f3 --- /dev/null +++ b/autogen/simple/multi/src/multi/v1/multigroup/Multigroup.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef MULTI_V1_MULTIGROUP_MULTIGROUP +#define MULTI_V1_MULTIGROUP_MULTIGROUP + +#include "multi/v1/multigroup/Library.hpp" + +namespace multi { +namespace v1 { +namespace multigroup { + +// ----------------------------------------------------------------------------- +// multigroup:: +// class Multigroup +// ----------------------------------------------------------------------------- + +class Multigroup : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "multigroup"; } + static auto CLASS() { return "Multigroup"; } + static auto NODENAME() { return "multigroup"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("projectile") | + + // children + ++Child + ("library") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "projectile", + "library" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "projectile", + "library" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + projectile{this}; + + // children + Field> + library{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->projectile, \ + this->library \ + ) + + // default + Multigroup() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Multigroup( + const wrapper + &projectile, + const wrapper> + &library = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + projectile(this,projectile), + library(this,library) + { + Component::finish(); + } + + // from node + explicit Multigroup(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Multigroup(const Multigroup &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + projectile(this,other.projectile), + library(this,other.library) + { + Component::finish(other); + } + + // move + Multigroup(Multigroup &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + projectile(this,std::move(other.projectile)), + library(this,std::move(other.library)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Multigroup &operator=(const Multigroup &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + projectile = other.projectile; + library = other.library; + } + return *this; + } + + // move + Multigroup &operator=(Multigroup &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + projectile = std::move(other.projectile); + library = std::move(other.library); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "multi/v1/multigroup/Multigroup/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Multigroup + +} // namespace multigroup +} // namespace v1 +} // namespace multi + +#endif diff --git a/autogen/simple/multi/src/multi/v1/multigroup/Multigroup/src/custom.hpp b/autogen/simple/multi/src/multi/v1/multigroup/Multigroup/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/autogen/simple/multi/src/multi/v1/multigroup/Multigroup/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/autogen/v1.9/summary_basic.json b/autogen/v1.9/summary_basic.json index a3f4f65c2..3efc842da 100644 --- a/autogen/v1.9/summary_basic.json +++ b/autogen/v1.9/summary_basic.json @@ -160,7 +160,7 @@ "description": "This represents the allowed set and sequence of characters that represent the Boolean \\attrval{true} and \\attrval{false} values in general-purpose data containers.", "name": "Boolean", "allowedValueDescription": "The allowed strings are `true' and `false'. For a table cell, the allowed values are `\\texttt{}' and `\\texttt{}'.", - "comment": "the standard XML attribute value representation for Boolean values true and false are `true' and `false' respectively.", + "remark": "the standard XML attribute value representation for Boolean values true and false are `true' and `false' respectively.", "C_equivalent": "bool"}, "whiteSpace": { @@ -210,7 +210,7 @@ "description": "Floating point number that can be stored at reduced precision", "name": "Float32", "allowedValueDescription": "n/a", - "comment": "Since only ASCII representation of data types is being considered here, and since Float32 is a subset of Float64, this is probably not needed.", + "remark": "Since only ASCII representation of data types is being considered here, and since Float32 is a subset of Float64, this is probably not needed.", "implementationStatus": "Not implemented as of GNDS-1.9"}, "Integer64": { @@ -227,7 +227,7 @@ "\\noindent with the restriction that the value shall be in the range ", "[\\textbf{Integer64\\_Min}, \\textbf{Integer64\\_Max}]."], "C_equivalent": "int64\\_t", - "comment": "Currently not needed so not defined.", + "remark": "Currently not needed so not defined.", "implementationStatus": "Not implemented as of GNDS-1.9"}, "Hexadecimal": { @@ -235,7 +235,7 @@ "description": "Typical hexadecimal number", "name": "Hexadecimal", "allowedValueDescription": "n/a", - "comment": "Currently not needed so not defined.", + "remark": "Currently not needed so not defined.", "implementationStatus": "Not implemented as of GNDS-1.9"}, "Octal": { @@ -243,6 +243,6 @@ "description": "Typical octal number", "name": "Octal", "allowedValueDescription": "n/a", - "comment": "Currently not needed so not defined.", + "remark": "Currently not needed so not defined.", "implementationStatus": "Not implemented as of GNDS-1.9"} } diff --git a/autogen/v1.9/summary_documentation.json b/autogen/v1.9/summary_documentation.json index 393100fc7..fd3d5f64e 100644 --- a/autogen/v1.9/summary_documentation.json +++ b/autogen/v1.9/summary_documentation.json @@ -176,7 +176,7 @@ }, "affiliations": { "__class__": "nodes.ChildNode", - "description": "Institutional affilation(s) of the author", + "description": "Institutional affiliation(s) of the author", "name": "affiliations", "occurrence": "1", "required": false @@ -240,7 +240,7 @@ "affiliation": { "__class__": "nodes.ChildNode", "description": "Each affiliation is described in an \\element{affiliation} element.", - "name": "affilation", + "name": "affiliation", "occurrence": "1+", "required": true } diff --git a/autogen/v1.9.json b/autogen/v1.9/v1.9.json similarity index 85% rename from autogen/v1.9.json rename to autogen/v1.9/v1.9.json index 87bde7140..c178ac324 100644 --- a/autogen/v1.9.json +++ b/autogen/v1.9/v1.9.json @@ -1,5 +1,9 @@ { - "JSONDir": "v1.9", + "Path": ".", + "Project": "GNDStk", + "Version": "v1.9", + + "JSONDir": ".", "JSONFiles": [ "summary_abstract.json", "summary_appData.json", @@ -19,7 +23,5 @@ "summary_tsl.json" ], - "GNDSDir": "test", - "Version": "v1.9", - "Changes": "changes.json" + "Changes": "../changes.json" } diff --git a/c/src/GNDStk.cpp b/c/src/GNDStk.cpp new file mode 100644 index 000000000..e365193f6 --- /dev/null +++ b/c/src/GNDStk.cpp @@ -0,0 +1,85 @@ + +// ----------------------------------------------------------------------------- +// Interface for C +// Definitions +// ----------------------------------------------------------------------------- + +#include "GNDStk.h" + + +// ----------------------------------------------------------------------------- +// Some basic flags +// In C++, these are available via inline variables. +// For C, we make them functions. +// ----------------------------------------------------------------------------- + +// ------------------------ +// General +// ------------------------ + +void indent(const int value) +{ + njoy::GNDStk::indent = value; +} + +void align(const int value) +{ + njoy::GNDStk::align = bool(value); +} + +void colors(const int value) +{ + njoy::GNDStk::colors = bool(value); +} + +// ------------------------ +// Re: Component printing +// ------------------------ + +void comments(const int value) +{ + njoy::GNDStk::comments = bool(value); +} + +void columns(const long value) +{ + njoy::GNDStk::columns = value; +} + +void elements(const long value) +{ + njoy::GNDStk::elements = value; +} + +// ------------------------ +// Re: GNDStk diagnostics +// ------------------------ + +void notes(const int value) +{ + njoy::GNDStk::notes = bool(value); +} + +void warnings(const int value) +{ + njoy::GNDStk::warnings = bool(value); +} + +void debug(const int value) +{ + njoy::GNDStk::debug = bool(value); +} + +void context(const int value) +{ + njoy::GNDStk::context = bool(value); +} + +// ------------------------ +// Re: OpenMP +// ------------------------ + +void threads(const int value) +{ + njoy::GNDStk::threads = value; +} diff --git a/c/src/GNDStk.h b/c/src/GNDStk.h new file mode 100644 index 000000000..7196a56d1 --- /dev/null +++ b/c/src/GNDStk.h @@ -0,0 +1,55 @@ + +// ----------------------------------------------------------------------------- +// Interface for C +// Declarations +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDSTK +#define C_INTERFACE_GNDSTK + +// This file works in both C++ and C +#ifdef __cplusplus + // For C++ + #include "GNDStk.hpp" + #define extern_C extern "C" +#else + // For C + #define extern_C +#endif + + +// ----------------------------------------------------------------------------- +// Function declarations +// Definitions are in this file's .cpp +// ----------------------------------------------------------------------------- + +extern_C void indent(const int); +extern_C void align(const int); +extern_C void colors(const int); + +extern_C void comments(const int); +extern_C void columns(const long); +extern_C void elements(const long); + +extern_C void notes(const int); +extern_C void warnings(const int); +extern_C void debug(const int); +extern_C void context(const int); + +extern_C void threads(const int); + +// todo +// Obviously, we'll want much more here. I'll probably add additional +// C-style interfaces to GNDStk's C++ code gradually, as we discover what +// our C language users want. Note that we're speaking here about the C +// interface to the overarching GNDStk library, not a C interface to some +// particular set of generated C++ classes that somebody might have created +// with our code generator. Those C interfaces are (or will be) created +// automatically, by the code generator, just as the C++ classes are. + + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + +#undef extern_C +#endif diff --git a/cmake/GNDStk_dependencies.cmake b/cmake/GNDStk_dependencies.cmake index 46c409ac9..4e793e115 100644 --- a/cmake/GNDStk_dependencies.cmake +++ b/cmake/GNDStk_dependencies.cmake @@ -1,52 +1,46 @@ -include( FetchContent ) +include(FetchContent) ######################################################################## # Forward declarations ######################################################################## - ######################################################################## # Declare project dependencies ######################################################################## -FetchContent_Declare( catch-adapter - GIT_REPOSITORY http://github.com/njoy/catch-adapter - GIT_TAG origin/master - GIT_SHALLOW TRUE - ) - -FetchContent_Declare( Log - GIT_REPOSITORY http://github.com/njoy/Log - GIT_TAG origin/build/fetchcontent - GIT_SHALLOW TRUE - ) - -FetchContent_Declare( pugixml-adapter - GIT_REPOSITORY http://github.com/njoy/pugixml-adapter - GIT_TAG origin/master - GIT_SHALLOW TRUE - ) - -FetchContent_Declare(json - GIT_REPOSITORY https://github.com/nlohmann/json.git - GIT_TAG v3.7.3 - GIT_SHALLOW true - ) - -FetchContent_GetProperties(json) -set(JSON_BuildTests OFF CACHE INTERNAL "") -if(NOT json_POPULATED) - FetchContent_Populate(json) - add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL) -endif() - -FetchContent_Declare( pybind11 - GIT_REPOSITORY https://github.com/pybind/pybind11 - GIT_TAG v2.6.1 - GIT_SHALLOW TRUE - ) - +FetchContent_Declare(catch-adapter + GIT_REPOSITORY http://github.com/njoy/catch-adapter + GIT_TAG origin/master + GIT_SHALLOW TRUE +) + +FetchContent_Declare(Log + GIT_REPOSITORY http://github.com/njoy/Log + GIT_TAG origin/master + GIT_SHALLOW TRUE +) + +FetchContent_Declare(pugixml-adapter + GIT_REPOSITORY http://github.com/njoy/pugixml-adapter + GIT_TAG origin/master + GIT_SHALLOW TRUE +) + +FetchContent_Declare(hdf5 + GIT_REPOSITORY https://github.com/BlueBrain/HighFive.git + GIT_TAG v2.3.1 + GIT_SHALLOW TRUE +) +set(HIGHFIVE_USE_BOOST OFF CACHE INTERNAL "") +set(HIGHFIVE_UNIT_TESTS OFF CACHE INTERNAL "") +set(HIGHFIVE_EXAMPLES OFF CACHE INTERNAL "") + +FetchContent_Declare(pybind11 + GIT_REPOSITORY https://github.com/pybind/pybind11 + GIT_TAG v2.6.1 + GIT_SHALLOW TRUE +) ######################################################################## # Load dependencies @@ -56,6 +50,6 @@ FetchContent_MakeAvailable( catch-adapter Log pugixml-adapter - json + hdf5 pybind11 - ) +) diff --git a/cmake/unit_testing.cmake b/cmake/unit_testing.cmake index bf5bacd44..902b710da 100644 --- a/cmake/unit_testing.cmake +++ b/cmake/unit_testing.cmake @@ -10,7 +10,6 @@ enable_testing() # Unit testing directories ####################################################################### -add_subdirectory( src/GNDStk/test ) add_subdirectory( src/GNDStk/Defaulted/test ) add_subdirectory( src/GNDStk/Tree/test ) add_subdirectory( src/GNDStk/type2string/test ) @@ -20,28 +19,36 @@ add_subdirectory( src/GNDStk/string2type/test ) add_subdirectory( src/GNDStk/Meta/test ) add_subdirectory( src/GNDStk/XML/test ) add_subdirectory( src/GNDStk/JSON/test ) +add_subdirectory( src/GNDStk/HDF5/test ) add_subdirectory( src/GNDStk/Node/test ) -add_subdirectory( src/GNDStk/keyword/test ) add_subdirectory( src/GNDStk/Child/test ) add_subdirectory( src/GNDStk/convert/test ) add_subdirectory( src/GNDStk/utility/test ) add_subdirectory( src/GNDStk/Component/test ) -add_subdirectory( src/GNDStk/BodyText/test ) +add_subdirectory( src/GNDStk/BlockData/test ) add_subdirectory( src/GNDStk/precision/test ) -add_subdirectory( src/GNDStk/enums/Encoding/test ) -add_subdirectory( src/GNDStk/enums/Frame/test ) -add_subdirectory( src/GNDStk/enums/GridStyle/test ) -add_subdirectory( src/GNDStk/enums/Interaction/test ) -add_subdirectory( src/GNDStk/enums/Interpolation/test ) -add_subdirectory( src/GNDStk/enums/StorageOrder/test ) -add_subdirectory( src/GNDStk/enums/units/Energy/test ) -add_subdirectory( src/GNDStk/enums/units/Length/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType/test ) +add_subdirectory( versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder/test ) -add_subdirectory( src/GNDStk/v1.9/containers/Values/test ) -add_subdirectory( src/GNDStk/v1.9/containers/Axis/test ) -add_subdirectory( src/GNDStk/v1.9/containers/Link/test ) -add_subdirectory( src/GNDStk/v1.9/containers/Grid/test ) -add_subdirectory( src/GNDStk/v1.9/containers/Axes/test ) -add_subdirectory( src/GNDStk/v1.9/containers/XYs1d/test ) -add_subdirectory( src/GNDStk/v1.9/containers/Regions1d/test ) +add_subdirectory( autogen/prototype/proto/src/proto/v1.9/containers/Values/test ) +add_subdirectory( autogen/prototype/proto/src/proto/v1.9/containers/Axis/test ) +add_subdirectory( autogen/prototype/proto/src/proto/v1.9/containers/Link/test ) +add_subdirectory( autogen/prototype/proto/src/proto/v1.9/containers/Grid/test ) +add_subdirectory( autogen/prototype/proto/src/proto/v1.9/containers/Axes/test ) +add_subdirectory( autogen/prototype/proto/src/proto/v1.9/containers/XYs1d/test ) +add_subdirectory( autogen/prototype/proto/src/proto/v1.9/containers/Regions1d/test ) diff --git a/docs/build.rst b/docs/build.rst index 89d8e30de..0d4848f59 100644 --- a/docs/build.rst +++ b/docs/build.rst @@ -78,7 +78,7 @@ it depends -- automatically. The *bad* news is that the download may, for the same reason, take quite some time. Resist the temptation to terminate the command, perhaps believing that your computer has hung, and consider starting ``cmake ..`` before lunch hour if you have a slow Internet connection. The main -culprit appears to be the "nlohmann json" library, +culprit appears to be the `nlohmann/json` library, https://github.com/nlohmann/json. An excellent library, by all accounts, and invaluable as the workhorse for GNDStk's JSON capabilities; but responsible, at the time of the writing, for over 400MB -- about 95% -- of diff --git a/docs/class.rst b/docs/class.rst index 091a2ba8d..36169f9ae 100644 --- a/docs/class.rst +++ b/docs/class.rst @@ -18,3 +18,7 @@ XML ======================================== JSON ======================================== + +======================================== +HDF5 +======================================== diff --git a/docs/create.rst b/docs/create.rst index 16b328288..58302cb74 100644 --- a/docs/create.rst +++ b/docs/create.rst @@ -17,7 +17,7 @@ Metadata Need a legend for things like this.... -.. literalinclude:: files/code-tables/node-add-meta.cc +.. literalinclude:: files/code-tables/node-add-meta.cpp :language: cpp :linenos: @@ -25,6 +25,6 @@ Need a legend for things like this.... Children ---------------------------- -.. literalinclude:: files/code-tables/node-add-child.cc +.. literalinclude:: files/code-tables/node-add-child.cpp :language: cpp :linenos: diff --git a/docs/files/code-tables/node-add-child.cc b/docs/files/code-tables/node-add-child.cc deleted file mode 100644 index 820bb982b..000000000 --- a/docs/files/code-tables/node-add-child.cc +++ /dev/null @@ -1,27 +0,0 @@ - -// string -Node &add( const string &name = "" ); - -// value -Node &add( const T &val ); -Node &add( const Defaulted &def ); - -// Child, value -Node &add( const Child &kwd, const T &val = T{} ); - -// Child, value -Node &add( const Child &kwd, const T &val = T{} ); -Node &add( const Child &kwd, const Defaulted &def ); - -// Child, value -Node &add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const T &val = T{} ); -bool add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const optional &opt ); -bool add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const Defaulted &def ); - -// Child, value -Node &add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const T &val = T{} ); -bool add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const optional &opt ); -bool add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const Defaulted &def ); - -// Child<*> w/allow::many, container -void add( const Child &kwd, const CONTAINER &container ); diff --git a/docs/files/code-tables/node-add-child.cpp b/docs/files/code-tables/node-add-child.cpp new file mode 100644 index 000000000..97dd3372c --- /dev/null +++ b/docs/files/code-tables/node-add-child.cpp @@ -0,0 +1,27 @@ + +// string +Node &add( const string &name = emptyNodeName ); + +// value +Node &add( const T &val ); +Node &add( const Defaulted &def ); + +// Child, value +Node &add( const Child &kwd, const T &val = T{} ); + +// Child, value +Node &add( const Child &kwd, const T &val = T{} ); +Node &add( const Child &kwd, const Defaulted &def ); + +// Child, value +Node &add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const T &val = T{} ); +bool add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const optional &opt ); +bool add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const Defaulted &def ); + +// Child, value +Node &add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const T &val = T{} ); +bool add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const optional &opt ); +bool add( const Child,ALLOW,CONVERTER,FILTER> &kwd, const Defaulted &def ); + +// Child<*> w/allow::many, container +void add( const Child &kwd, const CONTAINER &container ); diff --git a/docs/files/code-tables/node-add-meta.cc b/docs/files/code-tables/node-add-meta.cpp similarity index 100% rename from docs/files/code-tables/node-add-meta.cc rename to docs/files/code-tables/node-add-meta.cpp diff --git a/docs/files/code-tables/node-call.cc b/docs/files/code-tables/node-call.cpp similarity index 100% rename from docs/files/code-tables/node-call.cc rename to docs/files/code-tables/node-call.cpp diff --git a/docs/files/code-tables/node-child-call.cc b/docs/files/code-tables/node-child-call.cpp similarity index 100% rename from docs/files/code-tables/node-child-call.cc rename to docs/files/code-tables/node-child-call.cpp diff --git a/docs/files/code-tables/node-child-child.cc b/docs/files/code-tables/node-child-child.cpp similarity index 100% rename from docs/files/code-tables/node-child-child.cc rename to docs/files/code-tables/node-child-child.cpp diff --git a/docs/files/code-tables/node-many-string.cc b/docs/files/code-tables/node-many-string.cpp similarity index 100% rename from docs/files/code-tables/node-many-string.cc rename to docs/files/code-tables/node-many-string.cpp diff --git a/docs/files/code-tables/node-meta-call.cc b/docs/files/code-tables/node-meta-call.cpp similarity index 100% rename from docs/files/code-tables/node-meta-call.cc rename to docs/files/code-tables/node-meta-call.cpp diff --git a/docs/files/code-tables/node-meta-meta.cc b/docs/files/code-tables/node-meta-meta.cpp similarity index 100% rename from docs/files/code-tables/node-meta-meta.cc rename to docs/files/code-tables/node-meta-meta.cpp diff --git a/docs/files/code-tables/node-meta-string.cc b/docs/files/code-tables/node-meta-string.cpp similarity index 100% rename from docs/files/code-tables/node-meta-string.cc rename to docs/files/code-tables/node-meta-string.cpp diff --git a/docs/files/code-tables/node-multi.cc b/docs/files/code-tables/node-multi.cc deleted file mode 100644 index 9b3fe048a..000000000 --- a/docs/files/code-tables/node-multi.cc +++ /dev/null @@ -1,3 +0,0 @@ - -auto operator()( const KeywordTup &kwds ) const; -auto operator()( const KeywordTup &kwds ); diff --git a/docs/files/code-tables/node-multi.cpp b/docs/files/code-tables/node-multi.cpp new file mode 100644 index 000000000..2d9090a6e --- /dev/null +++ b/docs/files/code-tables/node-multi.cpp @@ -0,0 +1,3 @@ + +auto operator()( const KeyTuple &keytup ) const; +auto operator()( const KeyTuple &keytup ); diff --git a/docs/files/code-tables/node-one-string.cc b/docs/files/code-tables/node-one-string.cpp similarity index 100% rename from docs/files/code-tables/node-one-string.cc rename to docs/files/code-tables/node-one-string.cpp diff --git a/docs/primer.rst b/docs/primer.rst index 724fb8f2b..d759fd35b 100644 --- a/docs/primer.rst +++ b/docs/primer.rst @@ -207,7 +207,7 @@ Here's a simple code that reads the XML format GNDS file named Obviously, but worth a reminder, this assumes that the file resides right there, in the directory from which this code is run. If it doesn't, include a suitable -absolute or relative path in the file name string. We, and no doubt everyone +absolute or relative path in the file name. We, and no doubt everyone reading this, have probably made this mistake often enough over the years. ``Tree`` is GNDStk's data structure for holding an entire GNDS hierarchy, a.k.a. @@ -259,11 +259,9 @@ explicitly, and can either be something from GNDStk's ``FileType`` enumerator: :language: cpp or can be a direct string: ``"xml"``, etc. A direct string is shorter and -slightly easier to type -- but, if mistyped, would lead to a run-time error, +slightly easier to type -- but, if mistyped, would lead to a runtime error, not a compile-time error, if that matters to you in this simple context. -**HDF5 is not supported at this time!** Just XML and JSON. - *You should seldom, if ever, need to provide the second argument*. Absent the second argument, **GNDStk determines the file type automatically**, and we doubt that you'll have any objections to that. If you do choose provide the second @@ -276,9 +274,9 @@ as we attempt to read the file pursuant to the (incorrect) forced format. GNDStk uses the "file magic number," not the file name, to determine file type automatically. The file magic number really means the first byte, or bytes, -of the file. XML files always begin with a ``<`` character. HDF files (not -supported yet) begin with ASCII 137 and a few other specific bytes. If the -first byte is neither of those values, then GNDStk assumes JSON format. +of the file. XML files always begin with a ``<`` character. HDF5 files begin +with ASCII 137 and a few other specific bytes. If the first byte is neither +of those values, then GNDStk assumes JSON format. A nice thing about using the file magic number, not the file name, is that it works for ``std::istream``, for which a "file name" isn't even available. @@ -325,7 +323,7 @@ then GNDStk will write file ``pu239.xml`` in JSON format, as you asked for in the second argument, but will warn that the file extension is inconsistent with the format you asked for. -What if the file name extension isn't given, or isn't recognized, *and* a format +What if the file extension isn't given, or isn't recognized, *and* a format isn't forced with a second argument? That is, what if we wrote, for example, ``pu239.write("pu239")``? In that case, ``write`` writes the ``Tree`` into a simple output format that we created largely for debugging purposes. You @@ -406,7 +404,7 @@ Several remarks are in order here. The comparison operator for ``Tree`` compares the two GNDS trees in an *order-agnostic* manner. GNDS fundamentally provides data in two places: nodes (think XML "elements") in its overall tree structure, and metadata (think XML -"attributes"). The GNDS standard does not, however, consider ordering to be +attributes). The GNDS standard does not, however, consider ordering to be important. One tree node's child nodes or metadata, anywhere or everywhere throughout the entire tree structure, could be reordered arbitrarily, but if each remains equivalent -- in the same respect that we consider two mathematical @@ -492,14 +490,31 @@ with what XML is able to represent. the node. For example, in HDF5 the attribute ``nodeIndex`` could be added to each child in a group. -For (1), GNDStk does the first suggested action: it groups all of a node's -attributes under a child node called ``attributes``. We consider that to be -cleaner than using an ``_attr`` suffix. - -For (2), GNDStk does exactly as illustrated: multiple elements of the same name -are suffixed with ``0``, ``1``, etc. And, then, a JSON name/value pair with the -name ``nodeName``, as suggested, is created in order to preserve the original -*unsuffixed* element's name. +For (1), GNDStk does largely the first suggested action (which we think is +somewhat cleaner than using an ``_attr`` suffix), but with a slight twist, +along with our preferred terminology of ``metadata`` in place of ``attributes``. +It groups a node's metadata -- attributes -- under a child node +called ``#metadata``. + +The ``#`` prefix is something we use in node names throughout GNDStk, +if and where +the nodes so named represent special things -- with special meaning, and needing +special treatment. The extra character allows special nodes to be identified +easily, in both the GNDStk code base itself or in files produced by GNDStk. +Moreover, one could imagine that a future GNDS version might -- just might -- +have a normal node with the name ``metadata``, or with some other name that +we might wish to use for a special purpose. If and where such situations occur, +our use of a special prefix character allows for an unambiguous interpretation. +(As an aside: in principle, we'd have preferred to use the S-like dollar sign, +``$``, to inside S for "special" node. Unfortunately, ``$`` has a particular +meaning in the C++ regular-expression library. As such, ``$`` is unsuitable +for use in identifying special nodes, as our various node-finding capabilities +support the use of regular expressions.) + +For (2), GNDStk does as suggested, except again with the ``#`` terminology as +described above, and an all-lowercase name. Multiple elements of the same name +are suffixed with ``0``, ``1``, etc. Then, a JSON name/value pair with the +name ``#nodename`` is created. Its value preserves the original element's name. For (3), GNDStk does nothing in particular right now. Our understanding of GNDS is that it's designed so that elements -- nodes -- can appear in any order. @@ -509,7 +524,7 @@ GNDS file that we've been using for our examples: .. literalinclude:: tutorial/xml-axes-fragment.xml :language: xml -Those ``axis`` child nodes already contain a 0-based ``index`` attribute, so +Those ``axis`` child nodes already contain a 0-based ``index`` metadatum, so perhaps the specification's admonishment #3 is something we can consider to have been satisfied already by whomever has created an existing, valid GNDS file (so that no further treatment is required); or something that *we* must satisfy if @@ -549,8 +564,8 @@ node. (Valid GNDS top-level nodes, per the standard, are ``reactionSuite``, about it for now. Naturally, GNDStk reverses the modifications when we *read* from a JSON file -into our internal format. Specifically: values in an ``attributes`` block are -transformed into metadata in the enclosing node, and values from ``nodeName`` +into our internal format. Specifically: values in a ``#metadata`` block are +transformed into metadata in the enclosing node, and values from ``#nodename`` name/value pairs replace index-suffixed names. At this time, GNDStk provides no other options, such as the ``_attr`` suffix @@ -560,7 +575,7 @@ We're not aware, at the time of this writing, of the existence any official JSON-format GNDS files. If and when such files come into existence, and if such files use a different scheme than we do for addressing the issues described above, then we'll provide capabilities at least for reading those -files, and perhaps for writing them in that manner as well. +files, and perhaps for writing files in that manner as well. @@ -770,7 +785,7 @@ the top of the ``n-094_Pu_239.xml`` GNDS file: :language: xml Here, an outer ``evaluated`` node (XML "element") contains four metadata -key/value pairs (XML "attributes") and two child elements. The first child +key/value pairs (XML attributes) and two child elements. The first child element, ``temperature``, contains two metadata pairs but no further child nodes. The second child element, ``projectileEnergyDomain``, contains three metadata pairs but no further child nodes. diff --git a/docs/query1.rst b/docs/query1.rst index f2ff55f71..b4c244a7b 100644 --- a/docs/query1.rst +++ b/docs/query1.rst @@ -27,7 +27,7 @@ Query Metadata Node.meta(string) ---------------------------- -.. literalinclude:: files/code-tables/node-meta-string.cc +.. literalinclude:: files/code-tables/node-meta-string.cpp :language: cpp :linenos: @@ -35,7 +35,7 @@ Node.meta(string) Node.meta(Meta) ---------------------------- -.. literalinclude:: files/code-tables/node-meta-meta.cc +.. literalinclude:: files/code-tables/node-meta-meta.cpp :language: cpp :linenos: @@ -43,7 +43,7 @@ Node.meta(Meta) Node(Meta) ---------------------------- -.. literalinclude:: files/code-tables/node-meta-call.cc +.. literalinclude:: files/code-tables/node-meta-call.cpp :language: cpp :linenos: @@ -55,7 +55,7 @@ Query Child Nodes Node.one(string) ---------------------------- -.. literalinclude:: files/code-tables/node-one-string.cc +.. literalinclude:: files/code-tables/node-one-string.cpp :language: cpp :linenos: @@ -63,7 +63,7 @@ Node.one(string) Node.many(string) ---------------------------- -.. literalinclude:: files/code-tables/node-many-string.cc +.. literalinclude:: files/code-tables/node-many-string.cpp :language: cpp :linenos: @@ -71,7 +71,7 @@ Node.many(string) Node.child(Child) ---------------------------- -.. literalinclude:: files/code-tables/node-child-child.cc +.. literalinclude:: files/code-tables/node-child-child.cpp :language: cpp :linenos: @@ -79,6 +79,6 @@ Node.child(Child) Node(Child) ---------------------------- -.. literalinclude:: files/code-tables/node-child-call.cc +.. literalinclude:: files/code-tables/node-child-call.cpp :language: cpp :linenos: diff --git a/docs/query2.rst b/docs/query2.rst index 93eaa82c8..8876c339f 100644 --- a/docs/query2.rst +++ b/docs/query2.rst @@ -11,7 +11,7 @@ Sequence Queries Node.operator(...) ---------------------------- -.. literalinclude:: files/code-tables/node-call.cc +.. literalinclude:: files/code-tables/node-call.cpp :language: cpp :linenos: @@ -23,7 +23,7 @@ Multi-Queries Node.operator( | ) ---------------------------- -.. literalinclude:: files/code-tables/node-multi.cc +.. literalinclude:: files/code-tables/node-multi.cpp :language: cpp :linenos: diff --git a/docs/ref-convert.rst b/docs/ref-convert.rst index 16bc171f4..ec663cb64 100644 --- a/docs/ref-convert.rst +++ b/docs/ref-convert.rst @@ -4,7 +4,7 @@ ******************************************************************************** ======================================== -Tree/XML/JSON +Tree/XML/JSON/HDF5 ======================================== ======================================== diff --git a/docs/ref-core.rst b/docs/ref-core.rst index 76058e2da..31e03c727 100644 --- a/docs/ref-core.rst +++ b/docs/ref-core.rst @@ -19,6 +19,10 @@ XML JSON ======================================== +======================================== +HDF5 +======================================== + ======================================== Meta ======================================== @@ -28,5 +32,5 @@ Child ======================================== ======================================== -KeywordTup +KeyTuple ======================================== diff --git a/docs/tutorial/employees.json b/docs/tutorial/employees.json index 37bb8442b..98371f024 100644 --- a/docs/tutorial/employees.json +++ b/docs/tutorial/employees.json @@ -2,30 +2,30 @@ "employees": { "employee0": { "name": { - "attributes": { + "#metadata": { "first": "Doc", "last": "Jones" } }, - "nodeName": "employee" + "#nodename": "employee" }, "employee1": { "name": { - "attributes": { + "#metadata": { "first": "Grumpy", "last": "Smith" } }, - "nodeName": "employee" + "#nodename": "employee" }, "employee2": { "name": { - "attributes": { + "#metadata": { "first": "Happy", "last": "Earp" } }, - "nodeName": "employee" + "#nodename": "employee" } } -} \ No newline at end of file +} diff --git a/docs/tutorial/file-types.hpp b/docs/tutorial/file-types.hpp index df64dc575..1106d833b 100644 --- a/docs/tutorial/file-types.hpp +++ b/docs/tutorial/file-types.hpp @@ -1,6 +1,6 @@ enum class FileType { - null, // Default, automagick, etc. - tree, // <== DON't use this for reading; just writing + guess, // Default, automagick, etc. + debug, // <== DON't use this for reading; just writing // Generally use one of these: xml, XML = xml, json, JSON = json, diff --git a/python/runtests.sh b/python/runtests.sh index c94247071..7a7dd0fa5 100755 --- a/python/runtests.sh +++ b/python/runtests.sh @@ -1,8 +1,8 @@ #!/bin/bash -# this script copies the dynamic library for the GNDStk python module -# and runs all the unit tests it can find +# This script copies the dynamic library for the GNDStk python module +# and runs all the unit tests it can find. -rm GNDStk.*.so -cp ../build/GNDStk.*.so . +rm GNDStk*.so +cp ../build/GNDStk*.so . python -m unittest discover -v -p "Test*" diff --git a/python/src/GNDStk.python.cpp b/python/src/GNDStk.python.cpp index 2a0ec7ad4..15379ec8b 100644 --- a/python/src/GNDStk.python.cpp +++ b/python/src/GNDStk.python.cpp @@ -1,49 +1,255 @@ + +// For e.g. uint32_t, which is used in pybind11.h. A recent attempted build +// with g++ reported that std::uint32_t wasn't a known type, which suggests +// that pybind11.h doesn't #include everything it should. +#include + // system includes #include #include -// other includes +// local includes +#include "GNDStk.hpp" + + +// ----------------------------------------------------------------------------- +// macros +// ----------------------------------------------------------------------------- + +// NJOY_GNDSTK_PROPERTY +#define NJOY_GNDSTK_PROPERTY(class,pyname,cppvar) \ +class.def_property_static( \ + #pyname, \ + [](pybind11::object) \ + { \ + return cppvar; \ + }, \ + [](pybind11::object, const std::decay_t &value) \ + { \ + cppvar = value; \ + } \ +) + +// NJOY_GNDSTK_COLOR +#define NJOY_GNDSTK_COLOR(class,pyname,cppvar) \ +class.def_property_static( \ + #pyname, \ + [](pybind11::object) \ + { \ + return cppvar; \ + }, \ + [](pybind11::object, const std::array &rgb) \ + { \ + cppvar = njoy::GNDStk::color::makeColor(rgb[0],rgb[1],rgb[2]); \ + } \ +); -// namespace aliases -namespace python = pybind11; +// ----------------------------------------------------------------------------- // core interface declarations -namespace core { +// ----------------------------------------------------------------------------- - void wrapNode( python::module& ); +namespace python_core { + void wrapNode(pybind11::module &); +} + + +// ----------------------------------------------------------------------------- +// v2.0 interface declarations +// ----------------------------------------------------------------------------- - void wrapGridStyle( python::module& ); - void wrapInterpolation( python::module& ); +// fixme +// I think something is conceptually backwards here. Rather than GNDStk's Python +// bindings wrapping (and thus essentially containing) GNDS 2.0's, we should +// probably have GNDS 2.0's python bindings wrap GNDStk's. With this current +// scheme, if we use the GNDStk Code Generator to make code for some totally +// different library (unrelated to GNDS proper), then containing GNDStk's python +// bindings in that library's python bindings is probably the right thing to do +// (after all, GNDStk forms the basis of the library's functionality), but we'd +// pick up "GNDS 2.0" in the process - which would be a bit odd, for some other +// library than GNDS 2.0. +namespace python_GNDS { + void wrapV2_0(pybind11::module &); } -// v1.9 interface declarations -namespace python_v1_9 { - void wrapGNDS( python::module& ); +// ----------------------------------------------------------------------------- +// Submodule: settings +// ----------------------------------------------------------------------------- + +void submodule_settings(pybind11::module &gnds) +{ + pybind11::module settings = gnds.def_submodule( + "settings", + "Global behavioral settings" + ); + + // ------------------------ + // Module: settings + // Class: read + // ------------------------ + + struct Read { }; + pybind11::class_ read(settings,"read"); + + NJOY_GNDSTK_PROPERTY(read, threads, njoy::GNDStk::threads); + + // ------------------------ + // Module: settings + // Class: write + // ------------------------ + + struct Write { }; + pybind11::class_ write(settings,"write"); + + NJOY_GNDSTK_PROPERTY(write, comments, njoy::GNDStk::comments); + NJOY_GNDSTK_PROPERTY(write, indent, njoy::GNDStk::indent ); + NJOY_GNDSTK_PROPERTY(write, align, njoy::GNDStk::align ); + NJOY_GNDSTK_PROPERTY(write, columns, njoy::GNDStk::columns ); + NJOY_GNDSTK_PROPERTY(write, elements, njoy::GNDStk::elements); + NJOY_GNDSTK_PROPERTY(write, colors, njoy::GNDStk::colors ); + NJOY_GNDSTK_PROPERTY(write, shades, njoy::GNDStk::shades ); + + // ------------------------ + // Module: settings + // Class: report + // ------------------------ + + struct Report { }; + pybind11::class_ report(settings,"report"); + + NJOY_GNDSTK_PROPERTY(report, notes, njoy::GNDStk::notes); + NJOY_GNDSTK_PROPERTY(report, warnings, njoy::GNDStk::warnings); + NJOY_GNDSTK_PROPERTY(report, context, njoy::GNDStk::context); + NJOY_GNDSTK_PROPERTY(report, debug, njoy::GNDStk::debug); + + // ------------------------ + // Module: settings + // Class: sort + // ------------------------ + + struct Sort { }; + pybind11::class_ sort(settings,"sort"); + + NJOY_GNDSTK_PROPERTY(sort, fields, njoy::GNDStk::sort); } + +// ----------------------------------------------------------------------------- +// Submodule: colors +// ----------------------------------------------------------------------------- + +void submodule_colors(pybind11::module &gnds) +{ + pybind11::module colors = gnds.def_submodule( + "colors", + "Colors for diagnostics and printing" + ); + + // ------------------------ + // Module: colors + // Class: required + // ------------------------ + + struct Required { }; + pybind11::class_ required(colors,"required"); + + NJOY_GNDSTK_COLOR(required, field, njoy::GNDStk::color::field); + NJOY_GNDSTK_COLOR(required, vector, njoy::GNDStk::color::vector); + NJOY_GNDSTK_COLOR(required, label, njoy::GNDStk::color::label); + NJOY_GNDSTK_COLOR(required, value, njoy::GNDStk::color::value); + NJOY_GNDSTK_COLOR(required, comment, njoy::GNDStk::color::comment); + + // ------------------------ + // Module: colors + // Class: optional + // ------------------------ + + struct Optional { }; + pybind11::class_ optional(colors,"optional"); + + NJOY_GNDSTK_COLOR(optional, field, njoy::GNDStk::color::optional::field); + NJOY_GNDSTK_COLOR(optional, vector, njoy::GNDStk::color::optional::vector); + NJOY_GNDSTK_COLOR(optional, label, njoy::GNDStk::color::optional::label); + NJOY_GNDSTK_COLOR(optional, value, njoy::GNDStk::color::optional::value); + + // ------------------------ + // Module: colors + // Class: data + // ------------------------ + + struct Data { }; + pybind11::class_ data(colors,"data"); + + NJOY_GNDSTK_COLOR(data, string, njoy::GNDStk::color::data::string); + NJOY_GNDSTK_COLOR(data, vector, njoy::GNDStk::color::data::vector); +} + + +// ----------------------------------------------------------------------------- +// Submodule: format +// ----------------------------------------------------------------------------- + +void submodule_format(pybind11::module &gnds) +{ + // todo + /* + pybind11::module format = gnds.def_submodule( + "format", + "Properties related to input/output (mostly output) formatting,\n" + "in particular (but not exclusively) for floating-point numbers" + ); + + // ------------------------ + // Module: format + // Class: todo + // ------------------------ + + struct Todo { }; + pybind11::class_ todo(format,"todo"); + + NJOY_GNDSTK_COLOR(todo, field, njoy::GNDStk::color::field); + NJOY_GNDSTK_COLOR(todo, vector, njoy::GNDStk::color::vector); + NJOY_GNDSTK_COLOR(todo, label, njoy::GNDStk::color::label); + NJOY_GNDSTK_COLOR(todo, value, njoy::GNDStk::color::value); + NJOY_GNDSTK_COLOR(todo, comment, njoy::GNDStk::color::comment); + */ +} + + +// ----------------------------------------------------------------------------- +// GNDStk python bindings +// ----------------------------------------------------------------------------- + /** * @brief GNDStk python bindings * * The name given here (GNDStk) must be the same as the name * set on the PROPERTIES OUTPUT_NAME in the CMakeLists.txt file. */ -PYBIND11_MODULE( GNDStk, module ) { - // create the core submodule - python::module submodule = module.def_submodule( +PYBIND11_MODULE(GNDStk,module) +{ + // ------------------------ + // Submodule: core + // ------------------------ - "core", - "core - GNDS core interface components" - ); + pybind11::module core = module.def_submodule( + "core", + "core - GNDStk core interface components" + ); - // wrap core components (in the core module) - core::wrapNode( submodule ); + // wrap core components (in the core module) + python_core::wrapNode(core); - // enumerations (in the GNDStk module) - core::wrapGridStyle( module ); - core::wrapInterpolation( module ); + // v2.0 components (in the v2_0 module, created in this function) + python_GNDS::wrapV2_0(module); - // v1.9 components (in the v1_9 module, created in this function) - python_v1_9::wrapGNDS( module ); + // Submodules + submodule_settings(module); + submodule_colors(module); + submodule_format(module); } + +#undef NJOY_GNDSTK_PROPERTY +#undef NJOY_GNDSTK_COLOR diff --git a/python/src/GridStyle.python.cpp b/python/src/GridStyle.python.cpp deleted file mode 100644 index 25d7b15ee..000000000 --- a/python/src/GridStyle.python.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// system includes -#include -#include - -// local includes -#include "GNDStk.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace core { - -void wrapGridStyle( python::module& module ) { - - // type aliases - using Component = njoy::GNDStk::enums::GridStyle; - - // wrap views created by this component - - // create the component - python::enum_< Component > component( - - module, - "GridStyle", - "Enumeration class giving acceptable grid style values", - python::arithmetic() - ); - - // wrap the component - component - .value( "none", Component::none ) - .value( "link", Component::link ) - .value( "points", Component::points ) - .value( "boundaries", Component::boundaries ) - .value( "parameters", Component::parameters ); -} - -} // namespace core diff --git a/python/src/Interpolation.python.cpp b/python/src/Interpolation.python.cpp deleted file mode 100644 index 8db3ecf03..000000000 --- a/python/src/Interpolation.python.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// system includes -#include -#include - -// local includes -#include "GNDStk.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace core { - -void wrapInterpolation( python::module& module ) { - - // type aliases - using Component = njoy::GNDStk::enums::Interpolation; - - // wrap views created by this component - - // create the component - python::enum_< Component > component( - - module, - "Interpolation", - "Enumeration class giving acceptable interpolation values", - python::arithmetic() - ); - - // wrap the component - component - .value( "flat", Component::flat ) - .value( "linlin", Component::linlin ) - .value( "linlog", Component::linlog ) - .value( "loglin", Component::loglin ) - .value( "loglog", Component::loglog ) - .value( "chargedparticle", Component::chargedparticle ); -} - -} // namespace core diff --git a/python/src/core/Node.python.cpp b/python/src/core/Node.python.cpp index ff2e7f377..cbd10639e 100644 --- a/python/src/core/Node.python.cpp +++ b/python/src/core/Node.python.cpp @@ -1,3 +1,9 @@ + +// For e.g. uint32_t, which is used in pybind11.h. A recent attempted build +// with g++ reported that std::uint32_t wasn't a known type, which suggests +// that pybind11.h doesn't #include everything it should. +#include + // system includes #include #include @@ -5,153 +11,153 @@ // local includes #include "GNDStk.hpp" -// namespace aliases -namespace python = pybind11; - -namespace core { - - void wrapNode( python::module& module ) { - - // type aliases - using Component = njoy::GNDStk::core::Node; - using ConstRefComponent = std::reference_wrapper< const Component >; +namespace python_core { - // create the core component - python::class_< Component > component( +void wrapNode(pybind11::module &module) +{ + // type aliases + using Component = njoy::GNDStk::Node; + using RefConstComponent = std::reference_wrapper< const Component >; + // create the core component + pybind11::class_< Component > component( module, "Node", "GNDS core node" - ); - - // wrap the core component - component - // add the default Node constructor to the python class - .def( - - python::init<>(), - "Initialise an empty node\n\n" - "Arguments:\n" - " self the node" - ) - // add the Node constructor using a string argument to the python class - .def( - - python::init< const std::string& >(), - python::arg( "name" ), - "Initialise the node with its name\n\n" - "Arguments:\n" - " self the node\n" - " name the name of the node" - ) - // add the copy constructor to the python class - .def( - - python::init< const Component& >(), - python::arg( "name" ), - "Initialise the node with a copy of a node\n\n" - "Arguments:\n" - " self the node\n" - " copy the node to be copied" - ) - // add a public member/field with read only access - // you can use def_readwrite to make it read/write - .def_readonly( - - "name", - &Component::name, - "The name of the node" - ) - .def_readonly( - - "metadata", - &Component::metadata, - "The metadata of the node" - ) - .def_property_readonly( - - "children", - // we cannot expose a vector of unique pointers, so we need to transform - // them into a vector of references first (since this is readonly, we use - // const references) - [] ( const Component& self ) -> std::vector< ConstRefComponent > { - - std::vector< ConstRefComponent > children; - for (auto& pointer : self.children ) { - - children.push_back( std::cref( *pointer ) ); - } - return children; - }, - "The children of the node" - ) - .def( - - "add", - // we need to define one of these for every type we want to use since - // python does not have a concept of templates - [] ( Component& self, const std::string& name, const std::string& value ) - { return self.add( name, value ); }, - python::arg( "name" ), python::arg( "value" ), - "Add the name,value pair as metadata to the node.\n\n" - "Arguments:\n" - " name the name of the metadata\n" - " value the value of the metadata\n" - ) // add a public member function - .def( - - "add", - // we need to define one of these for every type we want to use since - // python does not have a concept of templates - [] ( Component& self, const std::string& name, int value ) - { return self.add( name, value ); }, - python::arg( "name" ), python::arg( "value" ), - "Add the name,value pair as metadata to the node.\n\n" - "Arguments:\n" - " name the name of the metadata\n" - " value the value of the metadata\n" - ) // add a public member function - .def( - - "add", - // we need to define one of these for every type we want to use since - // python does not have a concept of templates - [] ( Component& self, const std::string& name, double value ) - { return self.add( name, value ); }, - python::arg( "name" ), python::arg( "value" ), - "Add the name,value pair as metadata to the node.\n\n" - "Arguments:\n" - " name the name of the metadata\n" - " value the value of the metadata\n" - ) // add a public member function - .def( - - "empty", - &Component::empty, - "Return whether or not the node is empty" - ) - // add a public member function - .def( - - "clear", - &Component::clear, - "Clear the content of the node and return the resulting empty node" - ) - // add a new custom function - .def( - - "to_string", - [] ( const Component& self ) -> std::string { - - if ( !self.empty() ) { - - std::ostringstream out; - self.write( out ); - return out.str(); - } - return ""; - }, - "Return a string representation of the node" - ); - } -} + ); + + // wrap the core component + component + // add the default Node constructor to the python class + .def( + pybind11::init<>(), + "Initialise an empty node\n\n" + "Arguments:\n" + " self the node" + ) + + // add the Node constructor using a string argument to the python class + .def( + pybind11::init(), + pybind11::arg("name"), + "Initialise the node with its name\n\n" + "Arguments:\n" + " self the node\n" + " name the name of the node" + ) + + // add the copy constructor to the python class + .def( + pybind11::init(), + pybind11::arg("name"), + "Initialise the node with a copy of a node\n\n" + "Arguments:\n" + " self the node\n" + " copy the node to be copied" + ) + + // add a public member/field with read only access + // you can use def_readwrite to make it read/write + .def_readonly( + "name", + &Component::name, + "The name of the node" + ) + + .def_readonly( + "metadata", + &Component::metadata, + "The metadata of the node" + ) + + .def_property_readonly( + "children", + // we cannot expose a vector of unique pointers, so we need + // to transform them into a vector of references first (since + // this is readonly, we use const references) + [] (const Component &self) -> std::vector + { + std::vector children; + for (const auto &pointer : self.children) + children.push_back(std::cref(*pointer)); + return children; + }, + "The children of the node" + ) + + .def( + "add", + // we need to define one of these for every type we want to use since + // python does not have a concept of templates + [] (Component &self, const std::string &name, const std::string &value) + { + return self.add(name,value); + }, + pybind11::arg("name"), pybind11::arg("value"), + "Add the name,value pair as metadata to the node.\n\n" + "Arguments:\n" + " name the name of the metadata\n" + " value the value of the metadata\n" + ) + + // add a public member function + .def( + "add", + // we need to define one of these for every type we want to use since + // python does not have a concept of templates + [] (Component &self, const std::string &name, int value) + { + return self.add(name,value); + }, + pybind11::arg("name"), pybind11::arg("value"), + "Add the name,value pair as metadata to the node.\n\n" + "Arguments:\n" + " name the name of the metadata\n" + " value the value of the metadata\n" + ) + + // add a public member function + .def( + "add", + // we need to define one of these for every type we want to use since + // python does not have a concept of templates + [] (Component &self, const std::string &name, double value) + { + return self.add(name,value); + }, + pybind11::arg("name"), pybind11::arg("value"), + "Add the name,value pair as metadata to the node.\n\n" + "Arguments:\n" + " name the name of the metadata\n" + " value the value of the metadata\n" + ) // add a public member function + + .def( + "empty", + &Component::empty, + "Return whether or not the node is empty" + ) + + // add a public member function + .def( + "clear", + &Component::clear, + "Clear the content of the node and return the resulting empty node" + ) + + // add a new custom function + .def( + "to_string", + [] (const Component &self) -> std::string + { + if (self.empty()) + return ""; + std::ostringstream oss; + self.write(oss); + return oss.str(); + }, + "Return a string representation of the node" + ); +} // void wrapNode + +} // namespace python_core diff --git a/python/src/definitions.hpp b/python/src/definitions.hpp index 230bd1d99..3112688d9 100644 --- a/python/src/definitions.hpp +++ b/python/src/definitions.hpp @@ -1,3 +1,4 @@ + #ifndef NJOY_GNDSTK_PYTHON_DEFINITIONS #define NJOY_GNDSTK_PYTHON_DEFINITIONS @@ -8,80 +9,293 @@ // other includes #include "GNDStk.hpp" -// namespace aliases -namespace python = pybind11; - /** - * @brief Add standard component definitions + * @brief Add standard definitions for classes derived from GNDStk::Component. * - * This adds the following standard properties/functions: - * init (copy), from_string + * This adds standard properties and functions for generated classes. * - * @param[in] component the component to which the definitions have to be added + * @param[in] object The Python object to which definitions should be added. */ -template < typename Component, typename PythonClass > -void addStandardComponentDefinitions( PythonClass& component ) { - - component - .def( - - python::init< const Component& >(), - python::arg( "component" ), - "Initialise the component with another instance\n\n" - "Arguments:\n" - " self the component\n" - " file the component to be copied" - ) - .def_static( - - "from_string", - [] ( const std::string& string ) -> Component { - - using namespace njoy::GNDStk::core; - - Node node; - node << string; - - return Component( node ); - }, - python::arg( "string" ), - "Read the component from an XML or json string\n\n" - "An exception is raised if something goes wrong while reading the\n" - "component\n\n" - "Arguments:\n" - " string the string representing the component" - ) - .def( - - "to_xml_string", - [] ( const Component& self ) -> std::string { - - using namespace njoy::GNDStk::core; - - std::ostringstream out; - XML( Node( self ) ).write( out, false ); - - return out.str(); - }, - "Write the component to an XML formatted string\n\n" - "Arguments:\n" - " self the component" - ) - .def( - - "to_xml_file", - [] ( const Component& self, const std::string& fileName ) { - - using namespace njoy::GNDStk::core; - - XML( Node( self ) ).write( fileName ); - }, - python::arg( "file_name" ), - "Write the component to an XML file\n\n" - "Arguments:\n" - " self the component\n" - " file_name the name of the XML file" - ); -} +template +void addStandardComponentDefinitions(pyCLASS &object) +{ + // ------------------------ + // Constructors + // ------------------------ + + // constructor: default + object.def( + pybind11::init<>(), + "Initialise the object with its default contents.\n\n" + "Arguments:\n" + " self The object." + ); + + // constructor: copy + object.def( + pybind11::init(), + pybind11::arg("from"), + "Initialise the object with another instance.\n\n" + "Arguments:\n" + " self The object.\n" + " from The object to be copied from." + ); + + // ------------------------ + // Get/set comment + // ------------------------ + + // get/set comment + object.def_property( + "comment", + [](const cppCLASS &self) -> decltype(auto) + { + return self.comment(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.comment() = value; + }, + "Array of comments to appear at the beginning of the node." + ); + + // ------------------------ + // Re: input from string; + // the type (XML, JSON, or + // HDF5) is auto-determined + // ------------------------ + + // from_string + object.def( + "from_string", + [](cppCLASS &self, const std::string &string) + { + self << string; + }, + pybind11::arg("string"), + "Read the object from an XML, JSON, or HDF5 string.\n" + "An exception is raised if something fails during the read.\n\n" + "Arguments:\n" + " string The string representing the object." + ); + + // ------------------------ + // re: XML + // ------------------------ + + // to_xml_string + object.def( + "to_xml_string", + [](const cppCLASS &self) -> decltype(auto) + { + std::ostringstream oss; + self.write(oss,"xml"); + return oss.str(); + }, + "Write the object to an XML formatted string.\n\n" + "Arguments:\n" + " self The object." + ); + + // to_xml_file + object.def( + "to_xml_file", + [](const cppCLASS &self, const std::string &filename) + { + self.write(filename,"xml"); + }, + pybind11::arg("file"), + "Write the object to an XML file.\n\n" + "Arguments:\n" + " self The object.\n" + " file The name of the XML file." + ); + + // ------------------------ + // re: JSON + // ------------------------ + +#ifndef NJOY_GNDSTK_DISABLE_JSON + // to_json_string + object.def( + "to_json_string", + [](const cppCLASS &self) -> decltype(auto) + { + std::ostringstream oss; + self.write(oss,"json"); + return oss.str(); + }, + "Write the object to a JSON formatted string.\n\n" + "Arguments:\n" + " self The object." + ); + + // to_json_file + object.def( + "to_json_file", + [](const cppCLASS &self, const std::string &filename) + { + self.write(filename,"json"); + }, + pybind11::arg("file"), + "Write the object to a JSON file.\n\n" + "Arguments:\n" + " self The object.\n" + " file The name of the JSON file." + ); +#endif + + // ------------------------ + // re: HDF5 + // ------------------------ + +#ifndef NJOY_GNDSTK_DISABLE_HDF5 + // to_hdf5_string + object.def( + "to_hdf5_string", + [](const cppCLASS &self) -> decltype(auto) + { + std::ostringstream oss; + self.write(oss,"hdf5"); + return oss.str(); + }, + "Write the object to an HDF5 formatted string.\n\n" + "Arguments:\n" + " self The object." + ); + + // to_hdf5_file + object.def( + "to_hdf5_file", + [](const cppCLASS &self, const std::string &filename) + { + self.write(filename,"hdf5"); + }, + pybind11::arg("file"), + "Write the object to an HDF5 file.\n\n" + "Arguments:\n" + " self The object.\n" + " file The name of the HDF5 file." + ); +#endif + + // ------------------------ + // for printing + // ------------------------ + + // These use GNDStk::Component's prettyprinter + + // prettyprint: for Python's __repr__ + object.def( + "__repr__", + [](const cppCLASS &self) -> decltype(auto) + { + njoy::GNDStk::printMode = njoy::GNDStk::PrintMode::python; + std::ostringstream oss; + self.print(oss,0); + return oss.str(); + } + ); + + // prettyprint: into string + object.def( + "print", + [](const cppCLASS &self) -> decltype(auto) + { + njoy::GNDStk::printMode = njoy::GNDStk::PrintMode::python; + std::ostringstream oss; + self.print(oss,0); + return oss.str(); + } + ); + + // ------------------------ + // write into string, as + // XML, JSON, HDF5, or our + // internal debug format + // ------------------------ + + // write into string, as XML + object.def( + "xml", + [](const cppCLASS &self) -> decltype(auto) + { + std::ostringstream oss; + self.write(oss,"xml"); + return oss.str(); + } + ); + +#ifndef NJOY_GNDSTK_DISABLE_JSON + // write into string, as JSON + object.def( + "json", + [](const cppCLASS &self) -> decltype(auto) + { + std::ostringstream oss; + self.write(oss,"json"); + return oss.str(); + } + ); +#endif + +#ifndef NJOY_GNDSTK_DISABLE_HDF5 + // write into string, as HDF5 + object.def( + "hdf5", + [](const cppCLASS &self) -> decltype(auto) + { + std::ostringstream oss; + self.write(oss,"hdf5"); + return oss.str(); + } + ); +#endif + + // write into string, in our internal debug format + object.def( + "debug", + [](const cppCLASS &self) -> decltype(auto) + { + std::ostringstream oss; + self.write(oss,"debug"); + return oss.str(); + } + ); + + // ------------------------ + // read/write from/to file + // ------------------------ + + // read + object.def( + "read", + [](cppCLASS &self, const std::string &filename) + { + self.read(filename); + }, + pybind11::arg("file"), + "Read the object from a file. " + "The file's type will be determined from its contents.\n\n" + "Arguments:\n" + " self The object.\n" + " file The name of the file." + ); + + // write + object.def( + "write", + [](const cppCLASS &self, const std::string &filename) + { + self.write(filename); + }, + pybind11::arg("file"), + "Write the object to a file. " + "The file's type will be determined from its extension.\n\n" + "Arguments:\n" + " self The object.\n" + " file The name of the file." + ); +} // addStandardComponentDefinitions #endif diff --git a/python/src/v1.9/GNDS.python.cpp b/python/src/v1.9/GNDS.python.cpp deleted file mode 100644 index afdf5a9bf..000000000 --- a/python/src/v1.9/GNDS.python.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// system includes -#include -#include - -// other includes - -// namespace aliases -namespace python = pybind11; - -// v1.9 interface declarations -namespace python_v1_9 { - - void wrapContainers( python::module& ); - void wrapTransport( python::module& ); -} - -namespace python_v1_9 { - - void wrapGNDS( python::module& module ) { - - // create the core submodule - python::module submodule = module.def_submodule( - - "v1_9", - "GNDS 1.9 standard components" - ); - - python_v1_9::wrapContainers( submodule ); - python_v1_9::wrapTransport( submodule ); - } -} // v1_9 namespace diff --git a/python/src/v1.9/containers.python.cpp b/python/src/v1.9/containers.python.cpp deleted file mode 100644 index 31ab9e593..000000000 --- a/python/src/v1.9/containers.python.cpp +++ /dev/null @@ -1,43 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#include -#include - -namespace python = pybind11; - -// v1.9 interface -namespace python_v1_9 { - -// containers declarations -namespace python_containers { - void wrapAxis(python::module &); - void wrapLink(python::module &); - void wrapValues(python::module &); - void wrapGrid(python::module &); - void wrapAxes(python::module &); - void wrapXYs1d(python::module &); - void wrapRegions1d(python::module &); -} // namespace python_containers - -// containers wrapper -void wrapContainers(python::module &module) -{ - // create the containers submodule - python::module submodule = module.def_submodule( - "containers", - "GNDS v1.9 containers" - ); - - // wrap containers components - python_containers::wrapAxis(submodule); - python_containers::wrapLink(submodule); - python_containers::wrapValues(submodule); - python_containers::wrapGrid(submodule); - python_containers::wrapAxes(submodule); - python_containers::wrapXYs1d(submodule); - python_containers::wrapRegions1d(submodule); -}; - -} // namespace python_v1_9 diff --git a/python/src/v1.9/containers/Axes.python.cpp b/python/src/v1.9/containers/Axes.python.cpp deleted file mode 100644 index b3bebd4f9..000000000 --- a/python/src/v1.9/containers/Axes.python.cpp +++ /dev/null @@ -1,67 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -// system includes -#include -#include - -// local includes -#include "GNDStk/v1.9/containers/Axes.hpp" -#include "definitions.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace python_v1_9 { -namespace python_containers { - -// Axes wrapper -void wrapAxes(python::module &module) -{ - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::v1_9; - - // type aliases - using Component = containers::Axes; - using axis_grid_t = std::variant< - containers::Axis, - containers::Grid - >; - - // create the component - python::class_ component( - module, - "Axes", - Component::documentation().data() - ); - - // wrap the component - component - .def( - python::init< - const std::optional &, - const std::vector & - >(), - python::arg("href") = std::nullopt, - python::arg("axis_grid"), - Component::documentation("constructor").data() - ) - .def_property_readonly( - "href", - &Component::href, - Component::documentation("href").data() - ) - .def_property_readonly( - "axis_grid", - python::overload_cast<>(&Component::axis_grid), - Component::documentation("axis_grid").data() - ) - ; - - // add standard component definitions - addStandardComponentDefinitions< Component >( component ); -} - -} // namespace python_containers -} // namespace python_v1_9 diff --git a/python/src/v1.9/containers/Axis.python.cpp b/python/src/v1.9/containers/Axis.python.cpp deleted file mode 100644 index 9fe2bd62f..000000000 --- a/python/src/v1.9/containers/Axis.python.cpp +++ /dev/null @@ -1,70 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -// system includes -#include -#include - -// local includes -#include "GNDStk/v1.9/containers/Axis.hpp" -#include "definitions.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace python_v1_9 { -namespace python_containers { - -// Axis wrapper -void wrapAxis(python::module &module) -{ - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::v1_9; - - // type aliases - using Component = containers::Axis; - - // create the component - python::class_ component( - module, - "Axis", - Component::documentation().data() - ); - - // wrap the component - component - .def( - python::init< - const std::optional &, - const std::optional &, - const std::optional & - >(), - python::arg("index") = std::nullopt, - python::arg("label") = std::nullopt, - python::arg("unit") = std::nullopt, - Component::documentation("constructor").data() - ) - .def_property_readonly( - "index", - &Component::index, - Component::documentation("index").data() - ) - .def_property_readonly( - "label", - &Component::label, - Component::documentation("label").data() - ) - .def_property_readonly( - "unit", - &Component::unit, - Component::documentation("unit").data() - ) - ; - - // add standard component definitions - addStandardComponentDefinitions< Component >( component ); -} - -} // namespace python_containers -} // namespace python_v1_9 diff --git a/python/src/v1.9/containers/Grid.python.cpp b/python/src/v1.9/containers/Grid.python.cpp deleted file mode 100644 index e8556d74e..000000000 --- a/python/src/v1.9/containers/Grid.python.cpp +++ /dev/null @@ -1,105 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -// system includes -#include -#include - -// local includes -#include "GNDStk/v1.9/containers/Grid.hpp" -#include "definitions.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace python_v1_9 { -namespace python_containers { - -// Grid wrapper -void wrapGrid(python::module &module) -{ - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::v1_9; - - // type aliases - using Component = containers::Grid; - using link_values_t = std::variant< - containers::Link, - containers::Values - >; - - // create the component - python::class_ component( - module, - "Grid", - Component::documentation().data() - ); - - // wrap the component - component - .def( - python::init< - const std::optional &, - const std::optional &, - const std::optional &, - const std::optional &, - const std::optional &, - const link_values_t & - >(), - python::arg("index") = std::nullopt, - python::arg("interpolation") = std::nullopt, - python::arg("label") = std::nullopt, - python::arg("style") = std::nullopt, - python::arg("unit") = std::nullopt, - python::arg("link_values"), - Component::documentation("constructor").data() - ) - .def_property_readonly( - "index", - &Component::index, - Component::documentation("index").data() - ) - .def_property_readonly( - "interpolation", - [](const Component &self) { return self.interpolation().value(); }, - Component::documentation("interpolation").data() - ) - .def_property_readonly( - "label", - &Component::label, - Component::documentation("label").data() - ) - .def_property_readonly( - "style", - &Component::style, - Component::documentation("style").data() - ) - .def_property_readonly( - "unit", - &Component::unit, - Component::documentation("unit").data() - ) - .def_property_readonly( - "link", - python::overload_cast<>(&Component::link), - Component::documentation("link").data() - ) - .def_property_readonly( - "values", - python::overload_cast<>(&Component::values), - Component::documentation("values").data() - ) - .def_property_readonly( - "link_values", - python::overload_cast<>(&Component::link_values), - Component::documentation("link_values").data() - ) - ; - - // add standard component definitions - addStandardComponentDefinitions< Component >( component ); -} - -} // namespace python_containers -} // namespace python_v1_9 diff --git a/python/src/v1.9/containers/Link.python.cpp b/python/src/v1.9/containers/Link.python.cpp deleted file mode 100644 index fd9ea1411..000000000 --- a/python/src/v1.9/containers/Link.python.cpp +++ /dev/null @@ -1,56 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -// system includes -#include -#include - -// local includes -#include "GNDStk/v1.9/containers/Link.hpp" -#include "definitions.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace python_v1_9 { -namespace python_containers { - -// Link wrapper -void wrapLink(python::module &module) -{ - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::v1_9; - - // type aliases - using Component = containers::Link; - - // create the component - python::class_ component( - module, - "Link", - Component::documentation().data() - ); - - // wrap the component - component - .def( - python::init< - const std::string & - >(), - python::arg("href"), - Component::documentation("constructor").data() - ) - .def_property_readonly( - "href", - &Component::href, - Component::documentation("href").data() - ) - ; - - // add standard component definitions - addStandardComponentDefinitions< Component >( component ); -} - -} // namespace python_containers -} // namespace python_v1_9 diff --git a/python/src/v1.9/containers/Regions1d.python.cpp b/python/src/v1.9/containers/Regions1d.python.cpp deleted file mode 100644 index 35ab3052f..000000000 --- a/python/src/v1.9/containers/Regions1d.python.cpp +++ /dev/null @@ -1,77 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -// system includes -#include -#include - -// local includes -#include "GNDStk/v1.9/containers/Regions1d.hpp" -#include "definitions.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace python_v1_9 { -namespace python_containers { - -// Regions1d wrapper -void wrapRegions1d(python::module &module) -{ - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::v1_9; - - // type aliases - using Component = containers::Regions1d; - - // create the component - python::class_ component( - module, - "Regions1d", - Component::documentation().data() - ); - - // wrap the component - component - .def( - python::init< - const std::optional &, - const std::optional &, - const std::vector &, - const std::optional & - >(), - python::arg("label") = std::nullopt, - python::arg("outer_domain_value") = std::nullopt, - python::arg("xys1d"), - python::arg("axes") = std::nullopt, - Component::documentation("constructor").data() - ) - .def_property_readonly( - "label", - &Component::label, - Component::documentation("label").data() - ) - .def_property_readonly( - "outer_domain_value", - &Component::outerDomainValue, - Component::documentation("outer_domain_value").data() - ) - .def_property_readonly( - "xys1d", - python::overload_cast<>(&Component::XYs1d), - Component::documentation("xys1d").data() - ) - .def_property_readonly( - "axes", - python::overload_cast<>(&Component::axes), - Component::documentation("axes").data() - ) - ; - - // add standard component definitions - addStandardComponentDefinitions< Component >( component ); -} - -} // namespace python_containers -} // namespace python_v1_9 diff --git a/python/src/v1.9/containers/Values.python.cpp b/python/src/v1.9/containers/Values.python.cpp deleted file mode 100644 index b9c28e406..000000000 --- a/python/src/v1.9/containers/Values.python.cpp +++ /dev/null @@ -1,106 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -// system includes -#include -#include - -// local includes -#include "GNDStk/v1.9/containers/Values.hpp" -#include "definitions.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace python_v1_9 { -namespace python_containers { - -// Values wrapper -void wrapValues(python::module &module) -{ - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::v1_9; - - // type aliases - using Component = containers::Values; - - // create the component - python::class_ component( - module, - "Values", - Component::documentation().data() - ); - - // wrap the component - component - .def( - python::init< - const std::optional &, - const std::optional &, - const std::optional & - >(), - python::arg("length") = std::nullopt, - python::arg("start") = std::nullopt, - python::arg("value_type") = std::nullopt, - Component::documentation("constructor").data() - ) - .def( - python::init< - const std::vector & - >(), - python::arg("ints"), - Component::documentation("constructor").data() - ) - .def( - python::init< - const std::vector & - >(), - python::arg("doubles"), - Component::documentation("constructor").data() - ) - .def( - python::init< - const std::vector & - >(), - python::arg("strings"), - Component::documentation("constructor").data() - ) - .def_property_readonly( - "length", - &Component::length, - Component::documentation("length").data() - ) - .def_property_readonly( - "start", - [](const Component &self) { return self.start().value(); }, - Component::documentation("start").data() - ) - .def_property_readonly( - "value_type", - [](const Component &self) { return self.valueType().value(); }, - Component::documentation("value_type").data() - ) - .def_property_readonly( - "ints", - [] (const Component &self) { return self.ints(); }, - Component::documentation("ints").data() - ) - .def_property_readonly( - "doubles", - [] (const Component &self) { return self.doubles(); }, - Component::documentation("doubles").data() - ) - .def_property_readonly( - "strings", - [] (const Component &self) { return self.strings(); }, - Component::documentation("strings").data() - ) - ; - - // add standard component definitions - addStandardComponentDefinitions< Component >( component ); -} - -} // namespace python_containers -} // namespace python_v1_9 diff --git a/python/src/v1.9/containers/XYs1d.python.cpp b/python/src/v1.9/containers/XYs1d.python.cpp deleted file mode 100644 index 9f231399f..000000000 --- a/python/src/v1.9/containers/XYs1d.python.cpp +++ /dev/null @@ -1,91 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -// system includes -#include -#include - -// local includes -#include "GNDStk/v1.9/containers/XYs1d.hpp" -#include "definitions.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace python_v1_9 { -namespace python_containers { - -// XYs1d wrapper -void wrapXYs1d(python::module &module) -{ - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::v1_9; - - // type aliases - using Component = containers::XYs1d; - - // create the component - python::class_ component( - module, - "XYs1d", - Component::documentation().data() - ); - - // wrap the component - component - .def( - python::init< - const std::optional &, - const std::optional &, - const std::optional &, - const std::optional &, - const std::optional &, - const containers::Values & - >(), - python::arg("index") = std::nullopt, - python::arg("interpolation") = std::nullopt, - python::arg("label") = std::nullopt, - python::arg("outer_domain_value") = std::nullopt, - python::arg("axes") = std::nullopt, - python::arg("values"), - Component::documentation("constructor").data() - ) - .def_property_readonly( - "index", - &Component::index, - Component::documentation("index").data() - ) - .def_property_readonly( - "interpolation", - [](const Component &self) { return self.interpolation().value(); }, - Component::documentation("interpolation").data() - ) - .def_property_readonly( - "label", - &Component::label, - Component::documentation("label").data() - ) - .def_property_readonly( - "outer_domain_value", - &Component::outerDomainValue, - Component::documentation("outer_domain_value").data() - ) - .def_property_readonly( - "axes", - python::overload_cast<>(&Component::axes), - Component::documentation("axes").data() - ) - .def_property_readonly( - "values", - python::overload_cast<>(&Component::values), - Component::documentation("values").data() - ) - ; - - // add standard component definitions - addStandardComponentDefinitions< Component >( component ); -} - -} // namespace python_containers -} // namespace python_v1_9 diff --git a/python/src/v1.9/transport.python.cpp b/python/src/v1.9/transport.python.cpp deleted file mode 100644 index 631a859bf..000000000 --- a/python/src/v1.9/transport.python.cpp +++ /dev/null @@ -1,37 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#include -#include - -namespace python = pybind11; - -// v1.9 interface -namespace python_v1_9 { - -// transport declarations -namespace python_transport { - void wrapCrossSection(python::module &); - void wrapReaction(python::module &); - void wrapReactions(python::module &); - void wrapReactionSuite(python::module &); -} // namespace python_transport - -// transport wrapper -void wrapTransport(python::module &module) -{ - // create the transport submodule - python::module submodule = module.def_submodule( - "transport", - "GNDS v1.9 transport" - ); - - // wrap transport components - python_transport::wrapCrossSection(submodule); - python_transport::wrapReaction(submodule); - python_transport::wrapReactions(submodule); - python_transport::wrapReactionSuite(submodule); -}; - -} // namespace python_v1_9 diff --git a/python/src/v1.9/transport/CrossSection.python.cpp b/python/src/v1.9/transport/CrossSection.python.cpp deleted file mode 100644 index 4bb4c39c2..000000000 --- a/python/src/v1.9/transport/CrossSection.python.cpp +++ /dev/null @@ -1,60 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -// system includes -#include -#include - -// local includes -#include "GNDStk/v1.9/transport/CrossSection.hpp" -#include "definitions.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace python_v1_9 { -namespace python_transport { - -// CrossSection wrapper -void wrapCrossSection(python::module &module) -{ - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::v1_9; - - // type aliases - using Component = transport::CrossSection; - using XYs1d_regions1d_t = std::variant< - containers::XYs1d, - containers::Regions1d - >; - - // create the component - python::class_ component( - module, - "CrossSection", - Component::documentation().data() - ); - - // wrap the component - component - .def( - python::init< - const std::vector & - >(), - python::arg("xys1d_regions1d"), - Component::documentation("constructor").data() - ) - .def_property_readonly( - "xys1d_regions1d", - python::overload_cast<>(&Component::XYs1d_regions1d), - Component::documentation("xys1d_regions1d").data() - ) - ; - - // add standard component definitions - addStandardComponentDefinitions< Component >( component ); -} - -} // namespace python_transport -} // namespace python_v1_9 diff --git a/python/src/v1.9/transport/Reaction.python.cpp b/python/src/v1.9/transport/Reaction.python.cpp deleted file mode 100644 index c034610a2..000000000 --- a/python/src/v1.9/transport/Reaction.python.cpp +++ /dev/null @@ -1,77 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -// system includes -#include -#include - -// local includes -#include "GNDStk/v1.9/transport/Reaction.hpp" -#include "definitions.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace python_v1_9 { -namespace python_transport { - -// Reaction wrapper -void wrapReaction(python::module &module) -{ - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::v1_9; - - // type aliases - using Component = transport::Reaction; - - // create the component - python::class_ component( - module, - "Reaction", - Component::documentation().data() - ); - - // wrap the component - component - .def( - python::init< - const int &, - const std::optional &, - const std::string &, - const transport::CrossSection & - >(), - python::arg("endf_mt"), - python::arg("fission_genre") = std::nullopt, - python::arg("label"), - python::arg("cross_section"), - Component::documentation("constructor").data() - ) - .def_property_readonly( - "endf_mt", - &Component::ENDF_MT, - Component::documentation("endf_mt").data() - ) - .def_property_readonly( - "fission_genre", - &Component::fissionGenre, - Component::documentation("fission_genre").data() - ) - .def_property_readonly( - "label", - &Component::label, - Component::documentation("label").data() - ) - .def_property_readonly( - "cross_section", - python::overload_cast<>(&Component::crossSection), - Component::documentation("cross_section").data() - ) - ; - - // add standard component definitions - addStandardComponentDefinitions< Component >( component ); -} - -} // namespace python_transport -} // namespace python_v1_9 diff --git a/python/src/v1.9/transport/ReactionSuite.python.cpp b/python/src/v1.9/transport/ReactionSuite.python.cpp deleted file mode 100644 index 664310fc2..000000000 --- a/python/src/v1.9/transport/ReactionSuite.python.cpp +++ /dev/null @@ -1,115 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -// system includes -#include -#include - -// local includes -#include "GNDStk/v1.9/transport/ReactionSuite.hpp" -#include "definitions.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace python_v1_9 { -namespace python_transport { - -// ReactionSuite wrapper -void wrapReactionSuite(python::module &module) -{ - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::v1_9; - - // type aliases - using Component = transport::ReactionSuite; - - // create the component - python::class_ component( - module, - "ReactionSuite", - Component::documentation().data() - ); - - // wrap the component - component - .def( - python::init< - const std::string &, - const std::string &, - const std::optional &, - const std::string &, - const enums::Frame &, - const std::string &, - const std::optional & - >(), - python::arg("evaluation"), - python::arg("format"), - python::arg("interaction") = std::nullopt, - python::arg("projectile"), - python::arg("projectile_frame"), - python::arg("target"), - python::arg("reactions") = std::nullopt, - Component::documentation("constructor").data() - ) - .def_property_readonly( - "evaluation", - &Component::evaluation, - Component::documentation("evaluation").data() - ) - .def_property_readonly( - "format", - &Component::format, - Component::documentation("format").data() - ) - .def_property_readonly( - "interaction", - &Component::interaction, - Component::documentation("interaction").data() - ) - .def_property_readonly( - "projectile", - &Component::projectile, - Component::documentation("projectile").data() - ) - .def_property_readonly( - "projectile_frame", - &Component::projectileFrame, - Component::documentation("projectile_frame").data() - ) - .def_property_readonly( - "target", - &Component::target, - Component::documentation("target").data() - ) - .def_property_readonly( - "reactions", - python::overload_cast<>(&Component::reactions), - Component::documentation("reactions").data() - ) - .def_static( - - "from_file", - [] ( const std::string& filename ) -> Component { - - using namespace njoy::GNDStk::core; - Tree tree( filename ); - - return Component( tree( child::reactionSuite ) ); - }, - python::arg( "filename" ), - "Read a reaction suite from an XML or json file\n\n" - "An exception is raised if something goes wrong while reading the\n" - "component\n\n" - "Arguments:\n" - " filename the name of the file" - ) - ; - - // add standard component definitions - addStandardComponentDefinitions< Component >( component ); -} - -} // namespace python_transport -} // namespace python_v1_9 diff --git a/python/src/v1.9/transport/Reactions.python.cpp b/python/src/v1.9/transport/Reactions.python.cpp deleted file mode 100644 index a32c28b59..000000000 --- a/python/src/v1.9/transport/Reactions.python.cpp +++ /dev/null @@ -1,56 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -// system includes -#include -#include - -// local includes -#include "GNDStk/v1.9/transport/Reactions.hpp" -#include "definitions.hpp" - -// namespace aliases -namespace python = pybind11; - -namespace python_v1_9 { -namespace python_transport { - -// Reactions wrapper -void wrapReactions(python::module &module) -{ - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::v1_9; - - // type aliases - using Component = transport::Reactions; - - // create the component - python::class_ component( - module, - "Reactions", - Component::documentation().data() - ); - - // wrap the component - component - .def( - python::init< - const std::vector & - >(), - python::arg("reaction"), - Component::documentation("constructor").data() - ) - .def_property_readonly( - "reaction", - python::overload_cast<>(&Component::reaction), - Component::documentation("reaction").data() - ) - ; - - // add standard component definitions - addStandardComponentDefinitions< Component >( component ); -} - -} // namespace python_transport -} // namespace python_v1_9 diff --git a/python/test/Test_GNDStk_BoundaryCondition.py b/python/test/Test_GNDStk_BoundaryCondition.py new file mode 100644 index 000000000..f2313ac86 --- /dev/null +++ b/python/test/Test_GNDStk_BoundaryCondition.py @@ -0,0 +1,63 @@ + +# standard imports +import unittest + +# local imports +from GNDStk.v2_0 import BoundaryCondition + +class Test_GNDStk_BoundaryCondition( unittest.TestCase ) : + """Unit test for the BoundaryCondition enumerator.""" + + def test_component( self ) : + + value = BoundaryCondition.EliminateShiftFunction + + self.assertTrue( value == BoundaryCondition.EliminateShiftFunction ) + self.assertFalse( value == BoundaryCondition.NegativeOrbitalMomentum ) + self.assertFalse( value == BoundaryCondition.Brune ) + self.assertFalse( value == BoundaryCondition.Given ) + + self.assertFalse( value != BoundaryCondition.EliminateShiftFunction ) + self.assertTrue( value != BoundaryCondition.NegativeOrbitalMomentum ) + self.assertTrue( value != BoundaryCondition.Brune ) + self.assertTrue( value != BoundaryCondition.Given ) + + value = BoundaryCondition.NegativeOrbitalMomentum + + self.assertFalse( value == BoundaryCondition.EliminateShiftFunction ) + self.assertTrue( value == BoundaryCondition.NegativeOrbitalMomentum ) + self.assertFalse( value == BoundaryCondition.Brune ) + self.assertFalse( value == BoundaryCondition.Given ) + + self.assertTrue( value != BoundaryCondition.EliminateShiftFunction ) + self.assertFalse( value != BoundaryCondition.NegativeOrbitalMomentum ) + self.assertTrue( value != BoundaryCondition.Brune ) + self.assertTrue( value != BoundaryCondition.Given ) + + value = BoundaryCondition.Brune + + self.assertFalse( value == BoundaryCondition.EliminateShiftFunction ) + self.assertFalse( value == BoundaryCondition.NegativeOrbitalMomentum ) + self.assertTrue( value == BoundaryCondition.Brune ) + self.assertFalse( value == BoundaryCondition.Given ) + + self.assertTrue( value != BoundaryCondition.EliminateShiftFunction ) + self.assertTrue( value != BoundaryCondition.NegativeOrbitalMomentum ) + self.assertFalse( value != BoundaryCondition.Brune ) + self.assertTrue( value != BoundaryCondition.Given ) + + value = BoundaryCondition.Given + + self.assertFalse( value == BoundaryCondition.EliminateShiftFunction ) + self.assertFalse( value == BoundaryCondition.NegativeOrbitalMomentum ) + self.assertFalse( value == BoundaryCondition.Brune ) + self.assertTrue( value == BoundaryCondition.Given ) + + self.assertTrue( value != BoundaryCondition.EliminateShiftFunction ) + self.assertTrue( value != BoundaryCondition.NegativeOrbitalMomentum ) + self.assertTrue( value != BoundaryCondition.Brune ) + self.assertFalse( value != BoundaryCondition.Given ) + +if __name__ == '__main__' : + + unittest.main() diff --git a/python/test/Test_GNDStk_GridStyle.py b/python/test/Test_GNDStk_GridStyle.py index 3da97e03e..9c7e2e2e7 100644 --- a/python/test/Test_GNDStk_GridStyle.py +++ b/python/test/Test_GNDStk_GridStyle.py @@ -1,10 +1,9 @@ + # standard imports import unittest -# third party imports - # local imports -from GNDStk import GridStyle +from GNDStk.v2_0 import GridStyle class Test_GNDStk_GridStyle( unittest.TestCase ) : """Unit test for the GridStyle enumerator.""" diff --git a/python/test/Test_GNDStk_Interpolation.py b/python/test/Test_GNDStk_Interpolation.py index 37fcdda22..677ef2383 100644 --- a/python/test/Test_GNDStk_Interpolation.py +++ b/python/test/Test_GNDStk_Interpolation.py @@ -1,10 +1,9 @@ + # standard imports import unittest -# third party imports - # local imports -from GNDStk import Interpolation +from GNDStk.v2_0 import Interpolation class Test_GNDStk_Interpolation( unittest.TestCase ) : """Unit test for the Interpolation enumerator.""" diff --git a/python/test/Test_GNDStk_Interpolation.pyc b/python/test/Test_GNDStk_Interpolation.pyc new file mode 100644 index 000000000..feefb9231 Binary files /dev/null and b/python/test/Test_GNDStk_Interpolation.pyc differ diff --git a/python/test/__init__.pyc b/python/test/__init__.pyc new file mode 100644 index 000000000..b65ba59b5 Binary files /dev/null and b/python/test/__init__.pyc differ diff --git a/python/test/core/Test_GNDStk_core_Node.pyc b/python/test/core/Test_GNDStk_core_Node.pyc new file mode 100644 index 000000000..e48dd2c5e Binary files /dev/null and b/python/test/core/Test_GNDStk_core_Node.pyc differ diff --git a/python/test/core/__init__.pyc b/python/test/core/__init__.pyc new file mode 100644 index 000000000..f09dbaae2 Binary files /dev/null and b/python/test/core/__init__.pyc differ diff --git a/simple-json/src/.gitignore b/simple-json/src/.gitignore new file mode 100644 index 000000000..7b95a2978 --- /dev/null +++ b/simple-json/src/.gitignore @@ -0,0 +1,2 @@ + +*.hh diff --git a/simple-json/src/json-array.hpp b/simple-json/src/json-array.hpp new file mode 100644 index 000000000..0971037cd --- /dev/null +++ b/simple-json/src/json-array.hpp @@ -0,0 +1,45 @@ + +// ----------------------------------------------------------------------------- +// array +// In JSON: [...], with zero or more comma-separated values. +// ----------------------------------------------------------------------------- + +class array : public std::vector { +public: + JSON_IO(array); + + // ------------------------ + // Construction + // ------------------------ + + // inherited + using vector::vector; + + // from std::vector (instance of base class) + array(const vector &base) : vector(base) { } + array(vector &&base) : vector(std::move(base)) { } + + // from std::vector + template>> + array(const std::vector &vec) : + vector(vec.begin(), vec.end()) + { } + + // ------------------------ + // Assignment + // ------------------------ + + template>> + array &operator=(FROM &&from) + { + return vector::operator=(std::forward(from)), *this; + } + + // ------------------------ + // Other + // ------------------------ + + // values + const std::vector &values() const { return *this; } + std::vector &values() { return *this; } +}; diff --git a/simple-json/src/json-atom.hpp b/simple-json/src/json-atom.hpp new file mode 100644 index 000000000..e8ba7e417 --- /dev/null +++ b/simple-json/src/json-atom.hpp @@ -0,0 +1,138 @@ + +// ----------------------------------------------------------------------------- +// atom +// ----------------------------------------------------------------------------- + +#if defined(JSON_RAW) + +// ------------------------ +// Raw pointer version +// ------------------------ + +template +class atom { + static inline constexpr bool plain = sizeof(T) <= sizeof(std::shared_ptr); + std::conditional_t val; + +public: + + // construction: default + atom() + { + if constexpr ( plain) val = T(); + if constexpr (!plain) val = new T(); + } + + // construction: from T (exactly) + template>> + atom(const FROM &from) + { + if constexpr ( plain) val = from; + if constexpr (!plain) val = new T(from); + } + + // construction: copy + atom(const atom &other) + { + if constexpr ( plain) val = other.val; + if constexpr (!plain) val = new T(*other.val); + } + + // construction: move + atom(atom &&other) + { + val = std::move(other.val); + if constexpr (!plain) + other.val = nullptr; + } + + // assignment: copy + atom &operator=(const atom &other) + { + if constexpr ( plain) return val = other.val, *this; + if constexpr (!plain) return *val = *other.val, *this; + } + + // assignment: move + atom &operator=(atom &&other) + { + val = std::move(other.val); + if constexpr ( plain) return *this; + if constexpr (!plain) return other.val = nullptr, *this; + } + + // assignment: general + template>> + atom &operator=(FROM &&from) + { + if constexpr ( plain) return val = std::move(from), *this; + if constexpr (!plain) return *val = std::move(from), *this; + } + + // conversion: to T + operator const T &() const + { if constexpr (plain) return val; else return *val; } + operator T &() + { if constexpr (plain) return val; else return *val; } + + // destructor + ~atom() + { + if constexpr (!plain) + delete val; + } +}; + +// ------------------------ +// Shared pointer version +// ------------------------ + +#elif defined(JSON_SHARED) + +template +class atom { + static inline constexpr bool plain = sizeof(T) <= sizeof(std::shared_ptr); + std::conditional_t> val; + +public: + + // construction: default + atom() + { + if constexpr ( plain) val = T(); + if constexpr (!plain) val = std::make_shared(); + } + + // construction: from T (exactly) + template>> + atom(const FROM &from) + { + if constexpr ( plain) val = from; + if constexpr (!plain) val = std::make_shared(from); + } + + // conversion: to T + operator const T &() const + { if constexpr (plain) return val; else return *val; } + operator T &() + { if constexpr (plain) return val; else return *val; } + + // assignment + template>> + atom &operator=(FROM &&from) + { + if constexpr ( plain) return val = std::move(from), *this; + if constexpr (!plain) return *val = std::move(from), *this; + } +}; + +// ------------------------ +// atom == T +// ------------------------ + +#else + +template +using atom = T; + +#endif diff --git a/simple-json/src/json-boolean.hpp b/simple-json/src/json-boolean.hpp new file mode 100644 index 000000000..6b9caef7a --- /dev/null +++ b/simple-json/src/json-boolean.hpp @@ -0,0 +1,31 @@ + +// ----------------------------------------------------------------------------- +// boolean +// In JSON: lower-case true or false. +// ----------------------------------------------------------------------------- + +class boolean { + bool b; + +public: + JSON_IO(boolean); + + // ------------------------ + // Construction + // ------------------------ + + // default + boolean() : b(false) { } + + // from bool (exactly) + template>> + boolean(const BOOL &from) : b(from) { } + + // ------------------------ + // Conversion + // ------------------------ + + // to bool + operator const bool &() const { return b; } + operator bool &() { return b; } +}; diff --git a/simple-json/src/json-chars.hpp b/simple-json/src/json-chars.hpp new file mode 100644 index 000000000..1c0d90999 --- /dev/null +++ b/simple-json/src/json-chars.hpp @@ -0,0 +1,73 @@ + +// ----------------------------------------------------------------------------- +// chars +// ----------------------------------------------------------------------------- + +class chars { + std::string str; + + // SIZE here is overkill, but should be adequate + static inline constexpr size_t SIZE = 100; + static inline char buffer[SIZE]; + +public: + + // ------------------------ + // Construction + // ------------------------ + + // default + chars() { } + + // from any T in number::variant + template>> + chars( + #ifdef JSON_CHARS + const T &from, const std::chars_format &format = json::format + #else + const T &from + #endif + ) { + std::to_chars_result res; + + if constexpr (integral) { + res = same + ? std::to_chars(buffer, buffer+SIZE, (unsigned short)from) + : same + ? std::to_chars(buffer, buffer+SIZE, ( signed short)from) + : std::to_chars(buffer, buffer+SIZE, from); + } else { + #ifdef JSON_CHARS + res = std::to_chars(buffer, buffer+SIZE, from, format); + #else + error("Cannot construct a json::chars from a floating point " + "value unless\nJSON_CHARS is #defined. This further " + "requires that std::to_chars()\nbe available for " + "floating points. (It isn't for some compilers.)"); + // error() throws; this return just suppresses warnings from + // some compilers about res being uninitialized below. + return; + #endif + } + + if (res.ec == std::errc()) // std::errc() == default => no error + str = (*res.ptr = '\0', buffer); + else + error("Error returned by std::to_chars(). Message is:\n" + + std::make_error_code(res.ec).message() + '.'); + } + + // ------------------------ + // Conversion + // ------------------------ + + // to std::string + operator const std::string &() const { return str; } + operator std::string &() { return str; } + + // to literal (whose construction from std::string is explicit) + operator literal() const + { + return literal(str); + } +}; diff --git a/simple-json/src/json-detail-post.hpp b/simple-json/src/json-detail-post.hpp new file mode 100644 index 000000000..896b0c95b --- /dev/null +++ b/simple-json/src/json-detail-post.hpp @@ -0,0 +1,319 @@ + +namespace detail { + +// variant2tuple +template +struct variant2tuple { }; +template +struct variant2tuple> { using type = std::tuple; }; + + +// ----------------------------------------------------------------------------- +// Re: printing +// ----------------------------------------------------------------------------- + +// name: specific cases +#define JSON_NAME(type) \ + inline std::string name(const type &) { return #type; } + +JSON_NAME(unsigned char) +JSON_NAME(unsigned short) +JSON_NAME(unsigned int) +JSON_NAME(unsigned long) +JSON_NAME(unsigned long long) +JSON_NAME(signed char) +JSON_NAME(short) +JSON_NAME(int) +JSON_NAME(long) +JSON_NAME(long long) +JSON_NAME(double) +JSON_NAME(long double) +JSON_NAME(float) +JSON_NAME(null) +JSON_NAME(boolean) +JSON_NAME(string) +JSON_NAME(key) +JSON_NAME(array) +JSON_NAME(object) +JSON_NAME(literal) + +#undef JSON_NAME + +// name: for atom +// Remark: If preprocessor directives are such that atom == T, then name(), +// as defined below, without the class = require<> SFINAE, would be infinitely +// recursive. It presumably wouldn't be called, because, above, we define each +// case we intend to use. To be exceedingly proper, though, we have the SFINAE. +template,T>>> +std::string name(const atom &) +{ + return name(T()); +} + +// name: for number +inline std::string name(const number &n) +{ + return std::visit( + [](const auto &alt) { return "number/" + name(alt); }, + static_cast(n) + ); +} + +// print, for array and object +template +void print( + const T &obj, std::ostream &os, + const std::string &color, const char ch +) { + std::string str = colors ? color : ""; + if constexpr (same) + str += name(obj) + (indent < 0 ? "" : " " ); + if constexpr (same) + str += name(obj) + (indent < 0 ? "=" : " = "); + os << std::setw(0) << str + ch + (colors ? json::color::reset : ""); +} + +// print, for other types +template +void print( + const T &obj, std::ostream &os, const std::string &content, + const std::string &color, const int level +) { + std::string str = same ? content : name(obj); + if constexpr (same) + str += (indent < 0 ? "=" : " = ") + content; + + const std::streamsize setw = os.width(); + const size_t len = str.size(); // pre-colorized + + if (colors) + str = color + str + json::color::reset; + + level || setw < 0 || size_t(setw) <= len + ? os << std::setw(0) << str + : os.flags() & std::ios::left + ? os << std::setw(0) << str << std::string(setw-len, os.fill()) + : os << std::setw(0) << std::string(setw-len, os.fill()) << str; +} + + +// ----------------------------------------------------------------------------- +// Miscellaneous small functions +// ----------------------------------------------------------------------------- + +// comma +inline void comma(std::ostream &os, const int level, int n) +{ + if (n) + os << ','; + if (indent >= 0) + os << '\n'; + if (indent >= 1 && level >= 1) + os << std::string(indent*level, ' '); +} + +// token +// First, skip whitespace. Then, read and return a token. Depending on the +// template argument, the token must consist of either (1) alpha characters +// only, or (2) alphanumeric characters, '.', '-', or '+'. +template // <== alpha characters only +std::string token(std::istream &is, const std::string &context) +{ + std::string result; int ch; + is >> std::ws; + + if constexpr (justAlpha) + while (isalpha(is.peek())) + result += char(is.get()); + else + while ((isalnum(ch = is.peek()) || ch == '.' || ch == '-' || ch == '+')) + result += char(is.get()); + if (!result.empty()) + return result; + + const std::string found = "Found " + ((ch = is.get()) == EOF + ? "EOF" : "'" + std::string(1,ch) + "'") + "... instead."; + const std::string expected = context + "Expected a token consisting of "; + justAlpha + ? error(expected + "alphabetic characters.\n" + found, &is) + : error(expected + "alphanumeric characters, ., -, or +.\n" + found, &is); + return ""; // error throws; this just suppresses compiler warnings +} + +// expect +inline void expect( + std::istream &is, const char want, + const std::string &context +) { + const int ch = (is >> std::ws).get(); + if (ch != want) { + const std::string got = ch == EOF ? "EOF" : "'" + std::string(1,ch) + "'"; + warning(context + "Expected the character '" + want + "'.\nFound " + + got + " instead.\nWe'll pretend we saw a '" + want + "' " + "before the " + got + ", but further problems could arise.", &is); + is.unget(); + } +} + +// nocasecmp +// Case-insensitive std::string comparison. +// The old C language strcasecmp() is nonstandard. A modern, true caseless +// std::string comparison would depend on, e.g., locale, but the following +// should suffice for our purposes. +inline bool nocasecmp(const std::string &one, const std::string &two) +{ + return std::equal( + one.begin(), one.end(), + two.begin(), two.end(), + [](const char a, const char b) { return tolower(a) == tolower(b); } + ); +} + + +// ----------------------------------------------------------------------------- +// many +// ----------------------------------------------------------------------------- + +template +literal many( + std::vector &vec, std::istream &is, const unsigned flags, + const char prefix, const char suffix, const std::string &context +) { + vec.clear(); + expect(is,prefix,context); + std::string text(1,prefix); + + int ch; + while ((ch = (is >> std::ws).peek()) != EOF && ch != suffix) { + // comma + if (vec.size()) { + expect(is,',',context); + if (flags & literal::self) + text += ','; + } + + // value or key:value, with value read in-place for efficiency + value *vptr = nullptr; + if constexpr (same) { + // array + // ELEMENT == value (from array's base std::vector) + vec.push_back(value()); + vptr = &vec.back(); + } else { + // object + // ELEMENT == pair (from object's base std::vector) + json::key key; + key.read(is); + expect(is,':',context); + if (flags & literal::self) + text += '"' + key + "\":"; + vec.push_back(pair(key,value())); + vptr = &vec.back().second; + } + + text += vptr->read(is,flags); + } + + expect(is,suffix,context); + return literal(flags & literal::self ? text+suffix : ""); +} // many + + +// ----------------------------------------------------------------------------- +// Support for reading string escapes of the form \u#### +// ----------------------------------------------------------------------------- + +// ------------------------ +// Constants, functions +// ------------------------ + +// Ranges for surrogates. +// Remark: each of [himin..himax] and [lomin..lomax] +// has 1024 values inclusive. Also, lomin == himax+1. +inline constexpr int himin = 0xD800; // 0b 11011 000 00000000 +inline constexpr int himax = 0xDBFF; // 0b 11011 011 11111111 +inline constexpr int lomin = 0xDC00; // 0b 11011 100 00000000 +inline constexpr int lomax = 0xDFFF; // 0b 11011 111 11111111 +inline constexpr unsigned tweak = + unsigned(himin << 10) + unsigned(lomin) - 0x10000u; + +// High/low surrogate? +inline bool hi(const int p) { return himin <= p && p <= himax; } +inline bool lo(const int p) { return lomin <= p && p <= lomax; } + +// ------------------------ +// codepoint +// ------------------------ + +// \uabcd ==> (a << 12) + (b << 8) + (c << 4) + (d << 0) +inline int codepoint( + const std::string &context, std::istream &is, + std::string &token // representation of hex number, for diagnostic printing +) { + int ret = 0, ch; + token = "\\u"; + for (const unsigned shift : { 12u, 8u, 4u, 0u }) { + if ((ch = is.get()) == EOF) + error(context + + "Expected 4-character hex code; reached EOF instead.", &is); + else if ('0' <= ch && ch <= '9') ret += int((unsigned(ch)-48u) << shift); + else if ('A' <= ch && ch <= 'F') ret += int((unsigned(ch)-55u) << shift); + else if ('a' <= ch && ch <= 'f') ret += int((unsigned(ch)-87u) << shift); + else + error(context + + "Invalid hex digit found while reading \\u####.", &is); + token += ch; + } + return ret; +} + +// ------------------------ +// unicode +// ------------------------ + +inline void unicode( + const std::string &context, std::istream &is, + std::string &str +) { + std::string one, two; + int first = codepoint(context,is,one), second; + + static const std::string + hi_before_lo = "A high surrogate must precede the low surrogate", + lo_follow_hi = "A low surrogate must follow the high surrogate"; + + if (lo(first)) + error(context + hi_before_lo + " " + one + ".\n" + + "There was no such high surrogate.", &is); + if (hi(first)) { + if (is.get() != '\\' || is.get() != 'u') + error(context + lo_follow_hi + " " + one + ".\n" + + "There is no such low surrogate.", &is); + if (!lo(second = codepoint(context,is,two))) + error(context + lo_follow_hi + " " + one + ".\n" + + two + " is not a low surrogate.", &is); + first = (unsigned(first) << 10u) + unsigned(second) - tweak; + } + + if (first <= 127) { + // 0bbbbbbb (ASCII case) + str += int(first); + } else if (first <= 2047) { + // 110bbbbb 10bbbbbb + str += int(0b11000000u | ((unsigned(first) >> 6u) )); + str += int(0b10000000u | ((unsigned(first) ) & 0b00111111u)); + } else if (first <= 65535) { + // 1110bbbb 10bbbbbb 10bbbbbb + str += int(0b11100000u | ((unsigned(first) >> 12u) )); + str += int(0b10000000u | ((unsigned(first) >> 6u) & 0b00111111u)); + str += int(0b10000000u | ((unsigned(first) ) & 0b00111111u)); + } else { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + str += int(0b11110000u | ((unsigned(first) >> 18u) )); + str += int(0b10000000u | ((unsigned(first) >> 12u) & 0b00111111u)); + str += int(0b10000000u | ((unsigned(first) >> 6u) & 0b00111111u)); + str += int(0b10000000u | ((unsigned(first) ) & 0b00111111u)); + } +} + +} // namespace detail diff --git a/simple-json/src/json-detail-pre.hpp b/simple-json/src/json-detail-pre.hpp new file mode 100644 index 000000000..6b3fbb65f --- /dev/null +++ b/simple-json/src/json-detail-pre.hpp @@ -0,0 +1,63 @@ + +namespace detail { + +// ----------------------------------------------------------------------------- +// base +// ----------------------------------------------------------------------------- + +template +struct Base { + using type = T; +}; + +#if defined(JSON_RAW) || defined(JSON_SHARED) +template +struct Base> { + using type = T; +}; +#endif + +template +using base = typename Base::type; + + +// ----------------------------------------------------------------------------- +// inVariant +// count == number of times atom is exactly the same as a type in the variant +// ----------------------------------------------------------------------------- + +template +struct inVariant { }; + +template +struct inVariant> +{ + static inline constexpr int count = (same,As> + ...); +}; + + +// ----------------------------------------------------------------------------- +// Re: printing +// ----------------------------------------------------------------------------- + +class SHAPE { }; // ==> print types only +class WRITE { }; // ==> print values; essentially regular JSON +class DEBUG { }; // ==> print both; probably for debugging + +// Remark: We need detail:: in the macro; it's used outside of namespace detail. +#define JSON_IO(type) \ + template \ + void print(std::ostream &os, const int level) const; \ + std::ostream &shape(std::ostream &os = std::cout) const \ + { return print(os,0), os; } \ + std::ostream &write(std::ostream &os = std::cout) const \ + { return print(os,0), os; } \ + std::ostream &debug(std::ostream &os = std::cout) const \ + { return print(os,0), os; } \ + friend std::ostream &operator<<(std::ostream &os, const type &j) \ + { return j.write(os); } \ + template::compatible>> \ + literal read(std::istream &is, const unsigned flags = 0) + +} // namespace detail diff --git a/simple-json/src/json-diagnostic.hpp b/simple-json/src/json-diagnostic.hpp new file mode 100644 index 000000000..95fc91963 --- /dev/null +++ b/simple-json/src/json-diagnostic.hpp @@ -0,0 +1,185 @@ + +// json::exception +struct exception : public std::runtime_error +{ + using runtime_error::runtime_error; +}; + +// color:: +namespace color { + // rgb() + inline std::string rgb(const int r, const int g, const int b) + { + return "\033[38;2;" + + std::to_string(r < 0 ? 0 : r > 255 ? 255 : r) + ';' + + std::to_string(g < 0 ? 0 : g > 255 ? 255 : g) + ';' + + std::to_string(b < 0 ? 0 : b > 255 ? 255 : b) + 'm'; + } + + // some specific colors + inline const std::string black = rgb( 0, 0, 0 ); + inline const std::string white = rgb( 255, 255, 255 ); + inline const std::string purple = rgb( 140, 110, 200 ); + inline const std::string green = rgb( 41, 171, 135 ); + inline const std::string yellow = rgb( 220, 220, 40 ); + inline const std::string orange = rgb( 255, 136, 50 ); + inline const std::string red = rgb( 198, 45, 66 ); + inline const std::string indigo = rgb( 90, 110, 190 ); + inline const std::string blue = rgb( 0, 157, 196 ); + inline const std::string cerulean = rgb( 30, 170, 215 ); + inline const std::string cyan = rgb( 80, 250, 250 ); + + // all colors/decorations off + inline const std::string reset = "\033[0m"; + + // for JSON content when colors == true; user changeable (not const) + inline std::string key = green; + inline std::string null = orange; + inline std::string boolean = white; + inline std::string number = cerulean; + inline std::string string = cyan; + inline std::string array = yellow; + inline std::string object = red; + inline std::string literal = purple; +} + +// error (forward declaration; used in the below detail) +inline void error(const std::string &msg, std::istream *const is = nullptr); + + +// ----------------------------------------------------------------------------- +// detail::diagnostic +// ----------------------------------------------------------------------------- + +namespace detail { + +inline std::string diagnostic( + std::istream *const isptr, + const std::string &col, // possibly a color + const std::string &label, + const std::string &msg, + const bool print = true // actually print (else just return std::string) +) { + const std::string prefix = diagnostics::colors ? col : ""; + const std::string suffix = diagnostics::colors ? color::reset : ""; + const std::string spaces(std::max(0,diagnostics::indent), ' '); + std::string result; // for the return value + + // ------------------------ + // label + // ------------------------ + + // for std::cerr only; label won't appear in the return value + if (print) + std::cerr << prefix << label << suffix << '\n'; + + // ------------------------ + // line number and column + // ------------------------ + + // The following isn't exactly efficient, but, for better or for worse, + // C++ streams don't keep track of "line numbers" (insofar as the concept + // is necessarily meaningful for general input streams), and a diagnostic + // would have minimal value without a viable line number at which someone + // can look for the problem. :-/ Note also that the efficiency of our line + // number computation is irrelevant unless a warning or error occurs, at + // which point a user would presumably fix the issue. + bool quit = false; + + if (isptr != nullptr) { // else we're not dealing with any stream + std::istream &is = *isptr; + // save current stream state and position + const std::istream::iostate currentState = is.rdstate(); + is.clear(); + const std::streampos currentPos = is.tellg(); + + // seek to the beginning, to determine line and column + std::ostringstream oss; + if (is.seekg(0), is && is.tellg() == 0) { // <== seek must be successful + // line and column numbers will be 1-indexed, not 0-indexed; + // we think users will expect this + size_t line = 1, col = 1; + std::streampos pos; int ch; + + while ((ch = is.get(), pos = is.tellg()) >= 0 && pos < currentPos) + if (ch == '\n') { + ++line; + col = 1; + } else + ++col; + + oss << spaces << "Around line " << line << ", column " << col << '.'; + } else + oss << spaces << "Undetermined line and column."; + + if (print) + std::cerr << prefix << oss.str() << suffix << '\n'; + result += oss.str() + '\n'; + + // restore current stream state and position + is.clear(); + quit = (is.seekg(currentPos), !(is && is.tellg() == currentPos)); + is.setstate(currentState); + } + + // ------------------------ + // message + // ------------------------ + + std::string outline = ""; // as in, "line to send to output" + for (size_t i = 0; i <= msg.size(); ++i) { // "<=", to get \0 terminator + const char ch = msg.data()[i]; + if (ch == '\n' || ch == '\0') { + if (print) + outline == "" + ? std::cerr << '\n' + : std::cerr << prefix << spaces << outline << suffix << '\n'; + result += outline + (ch == '\n' ? "\n" : ""); + outline = ""; + } else + outline += ch; + } + if (print) + std::cerr << std::flush; + + // ------------------------ + // finish + // ------------------------ + + if (quit) + error("Unable to recover. istream.seekg() failed after attempt\n" + "to determine line number for previous diagnostic."); + + return result; +} + +} // namespace detail + + +// ----------------------------------------------------------------------------- +// note, warning, error +// ----------------------------------------------------------------------------- + +// note +// Returns a std::string. +inline std::string +note(const std::string &msg, std::istream *const is = nullptr) +{ + return detail::diagnostic(is, color::blue, "note", msg, notes); +} + +// warning +// Returns a std::string. +inline std::string +warning(const std::string &msg, std::istream *const is = nullptr) +{ + return detail::diagnostic(is, color::yellow, "warning", msg, warnings); +} + +// error +// Throws a json::exception. +inline void +error(const std::string &msg, std::istream *const is) +{ + throw exception(detail::diagnostic(is, color::red, "error", msg, errors)); +} diff --git a/simple-json/src/json-literal.hpp b/simple-json/src/json-literal.hpp new file mode 100644 index 000000000..1dc3cb3a8 --- /dev/null +++ b/simple-json/src/json-literal.hpp @@ -0,0 +1,71 @@ + +// ----------------------------------------------------------------------------- +// literal +// Content to be printed exactly as-is, without quotes or any processing. +// Special type for our API. +// ----------------------------------------------------------------------------- + +class literal { + std::string str; + +public: + JSON_IO(literal); + + // ------------------------ + // Flags + // ------------------------ + + // See the read() functions in various classes. The following allow for + // specification of which standard JSON types should be read as literals. + // A flag to indicate the present (literal) class itself is excluded; it + // isn't meaningful for these purposes. Note that these are given directly + // as unsigned ints (not, say, as enumerator values); their expected use is + // in bitwise operations. Remark: These are not, in any particular respect, + // tightly associated with the functionality of this literal class. Their + // purpose, however, like that of this class, is to support our ability to + // handle literal JSON content. Placing them here (not, say, in a namespace + // with a similar but different name) helps us to avoid name clutter. + static inline constexpr unsigned + // standard JSON types + null = 0b0000001, + boolean = 0b0000010, + number = 0b0000100, + string = 0b0001000, + array = 0b0010000, + object = 0b0100000, + // none/all of the above + none = 0b0000000, + all = 0b0111111, + // self + self = 0b1000000; + + // ------------------------ + // Construction + // ------------------------ + + // default + literal() { } + + // from std::string + // Explicit, so that std::string prefers json::string's constructor, not + // json::literal's. We want to get literal only when it's explicitly wanted. + explicit literal(const std::string &s) : str(s) { } + + // ------------------------ + // Assignment + // ------------------------ + + template>> + literal &operator=(FROM &&from) + { + return str = from, *this; + } + + // ------------------------ + // Conversion + // ------------------------ + + // to std::string + operator const std::string &() const { return str; } + operator std::string &() { return str; } +}; diff --git a/simple-json/src/json-null.hpp b/simple-json/src/json-null.hpp new file mode 100644 index 000000000..1279e29b1 --- /dev/null +++ b/simple-json/src/json-null.hpp @@ -0,0 +1,52 @@ + +// ----------------------------------------------------------------------------- +// null +// In JSON: lower-case null. +// ----------------------------------------------------------------------------- + +// Remark: +// +// In one of class null's constructors, and in some of the constructors in some +// of our other classes, we have what may seem at first to be an unnecessary or +// even unwanted use of require<>. Below, for example, instead of: +// +// template +// null(const T &) { } +// +// why not just have the following instead? +// +// null(const std::nullptr_t &) { } +// +// We do this because the first form forces an initializer to have *exactly* the +// given type, not just to be convertible to that type. Why not convertibility? +// It turns out that our primary "JSON value" class, json::value, will make use +// of a std::variant to contain an instance of any of our individual JSON types. +// Construction would be ambiguous if a parameter could be converted to what is +// needed in the constructor of more than one of the variant's alternatives. By +// requiring an exact match in selected cases, we prevent such ambiguities. + +class null { +public: + JSON_IO(null); + + // ------------------------ + // Construction + // ------------------------ + + // default + null() { } + + // from std::nullptr_t (exactly) + template>> + null(const NULLPTR &) { } + + // ------------------------ + // Conversion + // ------------------------ + + // to std::nullptr_t + operator const std::nullptr_t &() const + { static constexpr std::nullptr_t ret = nullptr; return ret; } + operator std::nullptr_t &() + { static std::nullptr_t ret = nullptr; return ret; } +}; diff --git a/simple-json/src/json-number.hpp b/simple-json/src/json-number.hpp new file mode 100644 index 000000000..b4ce7a45b --- /dev/null +++ b/simple-json/src/json-number.hpp @@ -0,0 +1,167 @@ + +// ----------------------------------------------------------------------------- +// number +// In JSON: integral or floating point number. +// ----------------------------------------------------------------------------- + +class number : public std::variant< + // unsigned integers + atom, + atom, + atom, + atom, + atom, + // signed integers + atom, + atom, + atom, + atom, + atom, + // floating points + atom, + atom, + atom +> { + // ------------------------ + // Helper: readableAs + // ------------------------ + + // Are the std::string's contents *completely* readable as a T? For example, + // "123" is completely readable as an int, but "123foo" is not. Neither is, + // say, "3.1415927", which in other interpretations might qualify as int 3. + // If yes, place the so-read value into the out parameter. Remark: The out + // parameter need not be of type T. In some calls it is, but in others, OUT + // is (derived from) a std::variant that has T as an alternative. + template>> + static bool readableAs(const std::string &str, OUT &out) noexcept + { + #ifndef JSON_CHARS + if constexpr (integral) + #endif + { + // Readable? + T ret; + const char *c = &str[0], *const end = c + str.size(); + while (isspace(*c)) ++c; + auto [ptr,err] = std::from_chars(*c == '+' ? ++c : c, end, ret); + if (err != std::errc()) return false; + // Completely? + while (isspace(*ptr)) ++ptr; + return ptr == end ? out = ret, true : false; + } + #ifndef JSON_CHARS + else { + try { + // Readable? + size_t idx; + if constexpr (same) out = std::stod (str,&idx); + if constexpr (same) out = std::stold(str,&idx); + if constexpr (same) out = std::stof (str,&idx); + // Completely? + while (isspace(str[idx])) ++idx; + return idx == str.size(); + } catch (...) { + } + return false; + } + #endif + } + +public: + + // ------------------------ + // types + // ------------------------ + + template + class types { + // Are T/U integral/floating? + static constexpr bool + tintegral = json::integral, tfloating = json::floating, + uintegral = json::integral, ufloating = json::floating; + + public: + + // types: integral, floating + using integral = std::conditional_t< + tintegral, T, std::conditional_t>; + using floating = std::conditional_t< + tfloating, T, std::conditional_t>; + + // Are T and U compatible, for our purposes? + // True iff T and U aren't both integral and aren't both floating point, + // and are both either void, or in number's variant. + static constexpr bool compatible = + !(tintegral && uintegral) && (invar || same) && + !(tfloating && ufloating) && (invar || same); + }; + + JSON_IO(number); + + // ------------------------ + // Construction + // ------------------------ + + // inherited + using variant::variant; + + // default (override inherited, because we want to select int) + number() : variant(0) { } + + // from std::variant<...> (instance of base class) + number(const variant &base) : variant(base) { } + number(variant &&base) : variant(std::move(base)) { } + + // ------------------------ + // Assignment + // ------------------------ + + template>> + number &operator=(FROM &&from) + { + return variant::operator=(std::forward(from)), *this; + } + + // ------------------------ + // Conversion + // ------------------------ + + // to types T in number's variant; also allow T == bool + // Returns by value, so that we don't need to assume that the underlying + // variant holds exactly a T. Also, then, we need only a const version. + template || same>> + operator T() const + { + return std::visit( + [](const auto &alt) { return T(alt); }, + static_cast(*this) + ); + } + + // ------------------------ + // Other + // ------------------------ + + // holds + template>> + bool holds() const { return std::holds_alternative>(*this); } + + // get + template>> + const T &get() const { return std::get>(*this); } + template>> + T &get() { return std::get>(*this); } + + // make + template || same>> + bool make(T &to) const + { + return std::visit( + [&to](const auto &alt) + { + return detail::base>(to=T(alt)) == alt; + }, + static_cast(*this) + ); + } +}; diff --git a/simple-json/src/json-object-def.hpp b/simple-json/src/json-object-def.hpp new file mode 100644 index 000000000..29359b5d1 --- /dev/null +++ b/simple-json/src/json-object-def.hpp @@ -0,0 +1,33 @@ + +// operator[]: const +inline const value &object::operator[](const key &key) const +{ + for (const pair &elem : *this) + if (elem.first == key) + return elem.second; + error("const json::object[key=\"" + key + "\"]: key not found."); + + // error() throws; the following just suppresses compilation errors. + static const value ret; + return ret; +} + +// operator[]: non-const +// Feature, not defect: referring to an element creates it, if it isn't +// already there. Use operator[] const if you don't want this behavior. +inline value &object::operator[](const key &key) +{ + for (pair &elem : *this) + if (elem.first == key) + return elem.second; + return push_back(pair(key,value())), back().second; +} + +// has key +inline bool object::has(const key &key) const +{ + for (const pair &elem : *this) + if (elem.first == key) + return true; + return false; +} diff --git a/simple-json/src/json-object.hpp b/simple-json/src/json-object.hpp new file mode 100644 index 000000000..94149c4f4 --- /dev/null +++ b/simple-json/src/json-object.hpp @@ -0,0 +1,53 @@ + +// ----------------------------------------------------------------------------- +// object +// In JSON: {...}, with zero or more comma-separated key:value pairs. +// ----------------------------------------------------------------------------- + +class object : public std::vector { +public: + JSON_IO(object); + + // ------------------------ + // Construction + // ------------------------ + + // inherited + using vector::vector; + + // from std::vector (instance of base class) + object(const vector &base) : vector(base) { } + object(vector &&base) : vector(std::move(base)) { } + + // ------------------------ + // Assignment + // ------------------------ + + template>> + object &operator=(FROM &&from) + { + return vector::operator=(std::forward(from)), *this; + } + + // ------------------------ + // operator[] + // ------------------------ + + // vector's: [index] + using vector::operator[]; + + // ours: [key] + const value &operator[](const key &) const; + value &operator[](const key &); + + // ------------------------ + // Other + // ------------------------ + + // key:value pairs + const std::vector &pairs() const { return *this; } + std::vector &pairs() { return *this; } + + // has key + bool has(const key &) const; +}; diff --git a/simple-json/src/json-print.hpp b/simple-json/src/json-print.hpp new file mode 100644 index 000000000..c62b6a46b --- /dev/null +++ b/simple-json/src/json-print.hpp @@ -0,0 +1,175 @@ + +// ----------------------------------------------------------------------------- +// Member functions: print +// ----------------------------------------------------------------------------- + +// ------------------------ +// null +// ------------------------ + +template +void null::print(std::ostream &os, const int level) const +{ + detail::print(*this, os, "null", color::null, level); +} + +// ------------------------ +// boolean +// ------------------------ + +template +void boolean::print(std::ostream &os, const int level) const +{ + detail::print(*this, os, b?"true":"false", color::boolean, level); +} + +// ------------------------ +// number +// ------------------------ + +template +void number::print(std::ostream &os, const int level) const +{ + std::string str; + if constexpr (!same) + std::visit( + [&os,&str](const auto &alt) + { + using T = detail::base>; + #ifdef JSON_CHARS + (void)os; // suppress compiler warnings that os is unused + str = chars(static_cast(alt)); + #else + if constexpr (integral) + str = chars(static_cast(alt)); + else { + std::ostringstream oss; + oss << std::setw(os.width()) << alt; + str = oss.str(); + } + #endif + }, + static_cast(*this) + ); + detail::print(*this, os, str, color::number, level); +} + +// ------------------------ +// string +// key +// ------------------------ + +// Remark: JSON allows forward slashes, /, to be escaped, but does not require +// them to be. See, for example, the following discussion: +// https://stackoverflow.com/questions/1580647 +// We'll escape them by default, but allow users to switch off this behavior by +// setting the global bool json::forward to false. That flag defaults to true, +// except if JSON_UNESCAPED_SLASHES is #defined prior to #including json.hpp. A +// #define JSON_UNESCAPED_SLASHES is thus another way to prevent escaping of \. +// +// As for single quotes: in read(), we *accepted* escaped single quotes. Doing +// so allowed us to read input strings that were delimited by single quotes, +// even though double quotes are the JSON standard. Now, however, we're writing, +// not reading, and we delimit JSON strings correctly: with double quotes. We +// thus have no need here to escape single quotes. + +template +template +void String::print(std::ostream &os, const int level) const +{ + std::string str; + if constexpr (!same) { + str += '"'; + for (const char ch : *this) { + // contents + ch == '"' ? str += "\\\"" : + ch == '\\' ? str += "\\\\" : + ch == '\b' ? str += "\\b" : + ch == '\f' ? str += "\\f" : + ch == '\n' ? str += "\\n" : + ch == '\r' ? str += "\\r" : + ch == '\t' ? str += "\\t" : + ch == '/' && forward ? str += "\\/" : + str += ch; + // todo There's more to do regarding unprintable chars, \u output, etc. + } + str += '"'; + } + detail::print(*this, os, str, b ? color::string : color::key, level); +} + +// ------------------------ +// array +// ------------------------ + +template +void array::print(std::ostream &os, const int level) const +{ + detail::print(*this, os, color::array, '['); + + // array's values + for (size_t n = 0; n < size(); ++n) { + // , + detail::comma(os, level+1, n); + // value + (*this)[n].template print(os, level+1); + } + + os << + (indent >= 0 ? "\n" : "") + (colors ? color::array : "") + + (indent >= 1 && level >= 1 ? std::string(indent*level, ' ') : "") + ']' + + (colors ? color::reset : ""); +} + +// ------------------------ +// object +// ------------------------ + +template +void object::print(std::ostream &os, const int level) const +{ + detail::print(*this, os, color::object, '{'); + + // object's key:value pairs + for (size_t n = 0; n < size(); ++n) { + // , + detail::comma(os, level+1, n); + // key:value + (*this)[n].first.template print(os, 0); + os << (indent >= 0 ? ": " : ":"); + (*this)[n].second.template print(os, level+1); + } + + os << + (indent >= 0 ? "\n" : "") + (colors ? color::object : "") + + (indent >= 1 && level >= 1 ? std::string(indent*level, ' ') : "") + '}' + + (colors ? color::reset : ""); +} + +// ------------------------ +// literal +// ------------------------ + +// Print the contents literally, with no processing or assumptions at all. +template +void literal::print(std::ostream &os, const int level) const +{ + detail::print(*this, os, str, color::literal, level); +} + +// ------------------------ +// value +// ------------------------ + +template +void value::print(std::ostream &os, const int level) const +{ + std::visit( + [&os,level](const auto &alt) + { + using T = detail::base>; + static_cast(alt).template print(os,level); + }, + static_cast(*this) + ); +} diff --git a/simple-json/src/json-read.hpp b/simple-json/src/json-read.hpp new file mode 100644 index 000000000..2617f65be --- /dev/null +++ b/simple-json/src/json-read.hpp @@ -0,0 +1,249 @@ + +// ----------------------------------------------------------------------------- +// Member functions: read +// ----------------------------------------------------------------------------- + +// ------------------------ +// null +// ------------------------ + +template +literal null::read(std::istream &is, const unsigned flags) +{ + static const std::string context = "While trying to read a json::null.\n"; + const std::string tok = detail::token(is,context); + + if (tok != "null") { + const std::string msg = context + "Unrecognized value: " + tok + '.'; + if (detail::nocasecmp(tok,"null")) + warning(msg+"\nWe'll take it as lower-case null, and continue.", &is); + else + error(msg,&is); // throws + } + return literal(flags & literal::self ? "null" : ""); +} + +// ------------------------ +// boolean +// ------------------------ + +template +literal boolean::read(std::istream &is, const unsigned flags) +{ + static const std::string context = "While trying to read a json::boolean.\n"; + const std::string tok = detail::token(is,context); + + if (tok != "true" && tok != "false") { + const std::string msg = context + "Unrecognized value: " + tok + '.'; + if (detail::nocasecmp(tok,"true")) + warning(msg+"\nWe'll take it as lower-case true, and continue.", &is); + else if (detail::nocasecmp(tok,"false")) + warning(msg+"\nWe'll take it as lower-case false, and continue.", &is); + else + error(msg,&is); // throws + } + b = tolower(tok[0]) == 't'; + return literal(flags & literal::self ? b ? "true" : "false" : ""); +} + +// ------------------------ +// number +// ------------------------ + +// Remark: We'll rig class number's read() function so it uses the first of its +// variant's types that it can (examining the types in the order in which they +// appear in the variant) when it reads a number. Users can always convert what +// we provide into a "longer" type. Also, read() allows specific integral and/or +// floating point types to be requested, overriding our default. Note that we'll +// select "more-restrictive" integral types: unsigned, and shorter. For floating +// points, we'll prefer good old-fashioned dog-eared double, with float the last +// choice. Having float be first would no doubt lead to all manner of grief. + +// A caller can use T and/or U to specify up to one integral type and up to one +// floating point type. (Any such type(s) must still be in our variant.) +template +literal number::read(std::istream &is, const unsigned flags) +{ + static const std::string context = "While trying to read a json::number.\n"; + const std::string tok = detail::token(is,context); + + using integral = typename types::integral; + using floating = typename types::floating; + static constexpr bool gaveIntegral = !same; + static constexpr bool gaveFloating = !same; + + // If an integral type was given in T or U, then attempt to read the + // token into a value of that type. Failure isn't necessarily an error; + // if a floating point type was also given, then we'll try that next. + if constexpr (gaveIntegral) + if (readableAs(tok,*this)) + return literal(flags & literal::self ? tok : ""); + + // If a floating point type was given in T or U, then attempt to read + // the token into a value of that type. + if constexpr (gaveFloating) + if (readableAs(tok,*this)) + return literal(flags & literal::self ? tok : ""); + + // If integral and floating point types were both given, but the above + // attempts both failed, then that's an error. + if constexpr (gaveIntegral && gaveFloating) + error(context + + "Unable to interpret \"" + tok + "\" as either the requested\n" + "integral type or the requested floating point type.", &is); + + bool found = false; // so far + std::apply( + [this,&tok,&found](const auto &... alt) + { + // The fold expression is rigged to terminate if and when found + // becomes true. But if gaveIntegral, we won't accept additional + // integral types (the requested one would have been tried above + // already, without success), and similarly for gaveFloating. + (( found || (found = + !(gaveIntegral && + json::integral>>) && + !(gaveFloating && + json::floating>>) && + (readableAs>>(tok,*this)) + ) + ), ...); + }, + detail::variant2tuple::type() + ); + + if (!found) + error(context + "Unable to interpret \"" + tok + "\" as a number " + "or other JSON type.", &is); + return literal(flags & literal::self ? tok : ""); +} + +// ------------------------ +// string (and key) +// Via String +// ------------------------ + +template +template +literal String::read(std::istream &is, const unsigned flags) +{ + static const std::string context = b + ? "While trying to read a json::string.\n" + : "While trying to read a json::key.\n"; + + const bool single = (is >> std::ws).get() == '\''; + if (single) + warning( + context + + "We'll accept the single-quoted string '" + + (is.peek() != EOF ? std::string(1,is.peek()) : "") + + "..., but double quotes are standard.\n" + "An ending single quote will be expected.", + &is + ); + else + detail::expect(is.unget(), '"', context); + + const char delimiter = single ? '\'' : '"'; + *this = ""; + int ch; + + while ((ch = is.get()) != EOF && ch != delimiter) + if (ch != '\\') { + // plain character (not backslash) + *this += ch; + } else switch (ch = is.get()) { + // backslash; so, get the next character + case '"' : *this += '"' ; break; // standard + case '\\' : *this += '\\' ; break; // standard + case 'b' : *this += '\b' ; break; // standard + case 'f' : *this += '\f' ; break; // standard + case 'n' : *this += '\n' ; break; // standard + case 'r' : *this += '\r' ; break; // standard + case 't' : *this += '\t' ; break; // standard + case '/' : *this += '/' ; break; // we'll accept \/ + case '\'' : *this += '\'' ; break; // we'll accept \' + + case 'u': + detail::unicode(context, is, *this); + break; + + case EOF: // a \ appeared right before EOF + error(context + "String escape \\ appears right before EOF.", &is); + break; + + default : // unrecognized escape + error(context + "Unrecognized string escape \\" + + char(ch) + '.', &is); + break; + } + + if (ch != delimiter) + error(context + "Unterminated string " + delimiter + *this + "....", &is); + + // Note that any json::literal return indeed gets delimiting quotes. + return literal(flags & literal::self ? '"' + *this + '"' : ""); +} + +// ------------------------ +// array +// ------------------------ + +template +literal array::read(std::istream &is, const unsigned flags) +{ + static const std::string context = "While trying to read a json::array.\n"; + return detail::many(*this, is, flags, '[', ']', context); +} + +// ------------------------ +// object +// ------------------------ + +template +literal object::read(std::istream &is, const unsigned flags) +{ + static const std::string context = "While trying to read a json::object.\n"; + return detail::many(*this, is, flags, '{', '}', context); +} + +// ------------------------ +// literal +// ------------------------ + +template +literal literal::read(std::istream &is, const unsigned flags) +{ + str = value().read(is, literal::self); + return literal(flags & literal::self ? str : ""); +} + +// ------------------------ +// value +// ------------------------ + +template +literal value::read(std::istream &is, const unsigned flags) +{ + static const std::string context = "While trying to read a json::value.\n"; + const int peek = (is >> std::ws).peek(); + if (peek == EOF) + error(context + "Expected a value (null, boolean, number, " + "string, array, or object).", &is); + + return + peek == 'n' || peek == 'N' + ? read(is, flags, literal::null) + : peek == 't' || peek == 'T' || peek == 'f' || peek == 'F' + ? read(is, flags, literal::boolean) + : peek == '"' || peek == '\'' + ? read(is, flags, literal::string) + : peek == '[' + ? read(is, flags, literal::array) + : peek == '{' + ? read(is, flags, literal::object) + : read(is, flags, literal::number); + // Remark: number being the fallback makes the most sense. JSON doesn't + // precisely say what "numbers" look like, but I think it's safe for us + // to say that they shouldn't begin with n, t, f, ", etc. +} diff --git a/simple-json/src/json-string.hpp b/simple-json/src/json-string.hpp new file mode 100644 index 000000000..56ce96bc4 --- /dev/null +++ b/simple-json/src/json-string.hpp @@ -0,0 +1,48 @@ + +// ----------------------------------------------------------------------------- +// string +// In JSON: string, in double quotes. +// ----------------------------------------------------------------------------- + +// Capital S String. We'll use for json::string, for json::key. +// Most constructs involving String can be defined for generic , so that +// code isn't replicated. It's worthwhile, though, to distinguish strings for +// JSON purposes (i.e. string as one of the JSON types), and strings for key +// purposes. For example, class value's variant can hold a string, but not a +// key; and class object's vector is of key:value pairs, not string:value pairs. +// Also, consider our system for creating colorized JSON output, which allows +// each of string and key to have its own color. By having two distinct types, +// the correct color can be selected naturally, in a non-hacky manner. + +template +class String : public std::string { +public: + JSON_IO(String); + + // ------------------------ + // Construction + // ------------------------ + + // inherited + using std::string::string; + + // from std::string (instance of base class) + String(const std::string &base) : std::string(base) { } + String(std::string &&base) : std::string(std::move(base)) { } + + // from char (exactly) + template>> + String(const CHAR &from) : std::string{from} { } + + // ------------------------ + // Assignment + // ------------------------ + + template>> + String &operator=(FROM &&from) + { + return std::string::operator=(std::forward(from)), *this; + } +}; + +using string = String; diff --git a/simple-json/src/json-value-make.hpp b/simple-json/src/json-value-make.hpp new file mode 100644 index 000000000..eb54b5497 --- /dev/null +++ b/simple-json/src/json-value-make.hpp @@ -0,0 +1,87 @@ + +// ----------------------------------------------------------------------------- +// value::make +// ----------------------------------------------------------------------------- + +// Remark about the cases where read() is called. +// read() can print warnings, or even print outright errors and then throw. +// Given that our make() function is designed to return false if our "make" +// process doesn't work, a case could be made that, here, we should suppress +// any diagnostics from read() and quietly return false upon read() failure. +// Importantly, we do catch any exceptions read() throws, returning false in +// that situation. We decided, however, not to suppress read()'s diagnostics. +// Notice that we do check for "reasonableness" first; for example, if we'll +// be trying to read a boolean from the literal, we check first that the +// literal begins with 't' or 'f'. json::literals are intended, after all, +// to contain valid JSON content, even if they're also sufficiently flexible +// to contain general gibberish. With this in mind, if OUT is one of the types +// below, and the literal seems to begin reasonably, then calling out content +// that proves to be invalid - as read() will do - seems fair enough. + +template +bool value::make(OUT &to, const bool allowLiteral) const +{ + null n; boolean b; string s; array a; object o; + + // If OUT == exactly what *this value actually holds right now. + // The constexpr-if is necessary, vis-à-vis holds's SFINAE requirement. + if constexpr (invar || invar) + if (holds()) + return to = get(), true; + + // If OUT == std::nullptr_t + if constexpr (same) + return make(n,allowLiteral) ? to = n, true : false; + + // If OUT == bool + if constexpr (same) { + if (holds()) return get().make(to); + return make(b,allowLiteral) ? to = b, true : false; + } + + // If OUT == std::string + if constexpr (same) + return make(s,allowLiteral) ? to = s, true : false; + + // If OUT == std::vector + if constexpr (same>) + return make(a,allowLiteral) ? to = a, true : false; + + // If OUT == std::vector + if constexpr (same>) + return make(o,allowLiteral) ? to = o, true : false; + + // At this point, invar || invar + + // If OUT \in {null,boolean,number,string,array,object} AND literal applies, + // then attempt to read() as long as the literal initially looks reasonable. + if constexpr (invar) { + if (holds() && allowLiteral) { + char c = '\0'; + for (const char ch : std::string(get())) + if (!isspace(c = tolower(ch))) + break; + if ((same && (c == 'n')) || + (same && (c == 't' || c == 'f' )) || + (same) || + (same && (c == '"' || c == '\'')) || + (same && (c == '[')) || + (same && (c == '{'))) { + try { + // todo This works, but I think it also allows trailing + // non-whitespace, unlike readableAs(). Think about this. + return to.read(std::istringstream(get())), true; + } catch (...) { } + } + } + } + + // If OUT == something in number, try a couple of things. + if constexpr (invar) + return holds() + ? get().make(to) + : holds() ? number::readableAs(get(),to) : false; + + // Well, nothing worked. + return false; +} diff --git a/simple-json/src/json-value.hpp b/simple-json/src/json-value.hpp new file mode 100644 index 000000000..ffa192fca --- /dev/null +++ b/simple-json/src/json-value.hpp @@ -0,0 +1,262 @@ + +// ----------------------------------------------------------------------------- +// value +// As in, the value of a JSON key:value pair. This will be an instance +// of a JSON standard type, or of our special literal type. +// ----------------------------------------------------------------------------- + +class value : public std::variant< + // JSON standard types + atom, + atom, + atom, + atom, + atom, + atom, + // our type + atom +> { + // ------------------------ + // Helper constructs + // ------------------------ + + // read + template + literal read( + std::istream &is, const unsigned flags, const unsigned lit + ) { + std::string text; + if (flags & lit) { + // This value <== a literal representation of JCLASS + JCLASS tmp; + *this = literal(text = tmp.template read(is, literal::self)); + } else { + // This value <== a JCLASS + // read variant (= JCLASS()) in-place for efficiency + text = (*this = JCLASS(), get()).template read(is,flags); + } + return literal(flags & literal::self ? text : ""); + } + + // converts + template + static inline constexpr bool converts = + invar || + same || same || same || + same> || same>; + +public: + JSON_IO(value); + + // ------------------------ + // Construction + // ------------------------ + + // inherited + using variant::variant; + + // default (override inherited, because we want to select object) + value() : variant(object()) { } + + // from std::variant<...> (instance of base class) + value(const variant &base) : variant(base) { } + value(variant &&base) : variant(std::move(base)) { } + + // from std::nullptr_t + // from bool + // from std::initializer_list ==> array + // from std::initializer_list ==> object + value(const std::nullptr_t &from) : variant(null(from)) { } + value(const bool &from) : variant(boolean(from)) { } + value(const std::initializer_list &from) : variant(array(from)) { } + value(const std::initializer_list &from) : variant(object(from)) { } + + // The following is necessary for correct handling of parameters (in terms + // of what kinds of values they produce) when atom != T. If atom == T, + // then this is unnecessary but harmless. + template< + class T, + class = require || constructible> + > + value(const T &from) + { + if constexpr (invar) + *this = number(from); + else + *this = string(from); + } + + // ------------------------ + // Assignment + // ------------------------ + + template>> + value &operator=(FROM &&from) + { + return variant::operator=(std::forward(from)), *this; + } + + // ------------------------ + // Conversion + // ------------------------ + + // Remark: A question arises about how to handle conversion of json::value + // to bool (not to json::boolean, that is, but to C++ bool). I.e., what do + // we do with bool(v), for a json::value v? If we assume *this is a number, + // we can use number's conversion operator. It returns by value, for maximum + // usability. If we assume *this is a boolean, we can return a const or non- + // const reference to the boolean's underlying bool. We could determine at + // run time if *this contains a number or a boolean, but then must restrict + // ourselves to return by value either way, because return type is fixed at + // compile time. We decided to interpret bool(v) as meaning we'll need *this + // to be a json::boolean. A const or non-const reference is then returned, + // consistent with the return when T underlies other alternatives json::value + // can take - std::nullptr_t within null, array's base of std::vector, + // etc. We think this is the best choice, overall. It does mean that if *this + // contains a number that you want to make into bool (think 0=false, 1=true), + // then you'll need to write something like bool(int(v)), not bool(v). + + // to T in number's variant + // Assumes number, and forwards to number's conversion. + // Returns by value; so, const only. + template>> + operator T() const + { + return T(get()); + } + + // to various specific Ts: const + // T is std::nullptr_t, bool, std::string, std::vector (json:: + // array's base), or std::vector (json::object's base), or else + // is one of the alternatives in json::value's variant. + template>> + operator const T &() const + { + if constexpr (same) + return get(); // then our null ==> C++ std::nullptr_t (T) + else if constexpr (same) + return get(); // then our boolean ==> C++ bool (T) + else if constexpr (same>) + return get(); // then our array ==> C++ std::vector (T) + else if constexpr (same>) + return get(); // then our object ==> C++ std::vector (T) + else if constexpr (invar) + return get(); // T as-is + // T is std::string henceforth, by process of elimination... + else if (holds()) + return get(); // then our string ==> C++ std::string (T) + else + return get(); // then our literal ==> C++ std::string (T) + } + + // to various specific Ts: non-const + template>> + operator T &() + { + return const_cast((const T &)(std::as_const(*this))); + } + + // ------------------------ + // operator[] + // ------------------------ + + // Remark: json::array, json::object, and json::value (the present class) + // all have operator[]s: + // - array has [index] through its vector base. + // - object has [index] through its vector base, + // AND also has [key] to support lookup by key. + // - value allows [index] or [key], as defined below. + // Consider the relevant return types for array and object's operator[]s: + // array [index] ==> value + // object[index] ==> key:value pair + // object[key ] ==> value + // What happens, below, if somebody sends an index (the integral option + // in the SFINAE requirement), not a key? In principle, an index is usable + // in two places: array (returning a value), and object (returning a pair). + // We'll only know at run time whether *this value is an array, an object, + // or perhaps neither (in the "neither" case, these shouldn't be called!), + // but the return type must be determined at compile time. With the [index] + // case arguably being ambiguous (return array value, or object pair?), we + // could simply disallow it, and only support [key]. However, we believe + // that a flexible operator[] is convenient to have, and decided to do the + // following. If [index], decide at run time if *this is array or an object. + // If it's an array, then return "array[index]" - a value. If it's an object, + // then return "object[index].second" - also a value (the second part of the + // key:value pair). If it's a [key], then handle it in the only way possible: + // assume *this is an object, and return "object[key]", which itself finds + // the key:value pair for that key and returns its .second - a value. In all + // of these cases, then, the following operator[]s return [const] value &. + + // const + template || constructible>> + const value &operator[](const T &t) const + { + if constexpr (integral) + return holds() ? get()[t] : get()[t].second; + else + return get()[t]; + } + + // non-const + template || constructible>> + value &operator[](const T &t) + { + // We must define this directly, as written below, instead of doing: + // return const_cast(std::as_const(*this).operator[](t)); + // because of the subtle difference between object's const and non-const + // versions. See the "feature, not defect" remark for object::operator[]. + if constexpr (integral) + return holds() ? get()[t] : get()[t].second; + else + return get()[t]; + } + + // ------------------------ + // Other + // ------------------------ + + // values; assumes *this holds an array + // pairs (key:value pairs); assumes *this holds an object + const std::vector &values() const { return get(); } + std::vector &values() { return get(); } + const std::vector &pairs() const { return get(); } + std::vector &pairs() { return get(); } + + // has key + // Assumes this value is an object + bool has(const key &key) const + { + return get().has(key); + } + + // holds + template + require || invar, bool> holds() const + { + if constexpr (invar) + return std::holds_alternative>(*this); + else + return holds() && get().holds(); + } + + // get: const + template + require || invar, const T &> get() const + { + if constexpr (invar) + return std::get>(*this); + else + return get().get(); + } + + // get: non-const + template + require || invar, T &> get() + { + return const_cast(std::as_const(*this).template get()); + } + + // make + template || converts>> + bool make(T &, const bool = true) const; +}; diff --git a/simple-json/src/json.hpp b/simple-json/src/json.hpp new file mode 100644 index 000000000..ad61373b4 --- /dev/null +++ b/simple-json/src/json.hpp @@ -0,0 +1,169 @@ + +#ifndef JSON_GUARD +#define JSON_GUARD + +#ifndef JSON_INTEGRAL +#define JSON_INTEGRAL int +#endif + +#ifndef JSON_FLOATING +#define JSON_FLOATING double +#endif + +// Includes: C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// ----------------------------------------------------------------------------- +// Some variables, classes, etc. +// ----------------------------------------------------------------------------- + +namespace json { + +// Variables: for JSON content +// Regarding json::forward, see: +// https://stackoverflow.com/questions/1580647 +inline int indent = 3; +inline bool colors = false; +inline bool forward = +#ifdef JSON_UNESCAPED_SLASHES + false; // if a user wants us to *not* escape forward slashes, / +#else + true; // by default, we escape forward slashes in JSON strings +#endif + +// Variables: for diagnostics on/off +inline bool notes = true; +inline bool warnings = true; +inline bool errors = true; + +// Variables: for diagnostics properties +namespace diagnostics { + inline int indent = json::indent; + inline bool colors = true; +} + +// Variables: for floating point to_chars() +#ifdef JSON_CHARS + inline constexpr std::chars_format fixed = std::chars_format::fixed; + inline constexpr std::chars_format scientific = std::chars_format::scientific; + inline constexpr std::chars_format general = std::chars_format::general; + inline std::chars_format format = general; +#endif + +// Classes, types +template +class String; +using key = String; +class value; +using pair = std::pair; + +// ------------------------ +// Shorthand for some +// std:: constructs +// ------------------------ + +// Alias for std::enable_if_t. +template + using require = std::enable_if_t; + +// Aliases for miscellaneous std::is_*_v bools. +template + inline constexpr bool same = std::is_same_v; +template + inline constexpr bool assignable = std::is_assignable_v; +template + inline constexpr bool convertible = std::is_convertible_v; +template + inline constexpr bool constructible = std::is_constructible_v; +template + inline constexpr bool integral = std::is_integral_v; +template + inline constexpr bool floating = std::is_floating_point_v; + +// See https://stackoverflow.com/questions/42797279 +using std::size_t; + + +// ----------------------------------------------------------------------------- +// Includes: JSON +// ----------------------------------------------------------------------------- + +// Errors, warnings, notes. +#include "json-diagnostic.hpp" + +// Constructs that are needed prior to the class definitions below. +class literal; +#include "json-atom.hpp" +#include "json-detail-pre.hpp" + +// invar +template +inline constexpr bool invar = detail::inVariant::count; + +// Class definitions. +#include "json-number.hpp" +#include "json-literal.hpp" +#include "json-null.hpp" +#include "json-boolean.hpp" +#include "json-string.hpp" +#include "json-array.hpp" +#include "json-object.hpp" +#include "json-value.hpp" +#include "json-value-make.hpp" +#include "json-chars.hpp" + +// Constructs that require knowledge of the class definitions above. +#include "json-detail-post.hpp" + +// Definitions of read() and print() for null, boolean, number, string, array, +// object, literal, and value. Some of these use post-class details #included +// just above; this is why they're here. +#include "json-read.hpp" +#include "json-print.hpp" + +// Definitions of object's operator[] and its has() function. Given here, +// not in-class, because they need class value's definition to be complete. +#include "json-object-def.hpp" + + +// ----------------------------------------------------------------------------- +// Finish stream output. (They needed literal's definition first.) +// ----------------------------------------------------------------------------- + +#undef JSON_IO +#define JSON_IO(type) \ + inline std::istream &operator>>(std::istream &is, type &j) \ + { j.template read(is); return is; } + +JSON_IO(null) +JSON_IO(boolean) +JSON_IO(number) +template +JSON_IO(String) +JSON_IO(array) +JSON_IO(object) +JSON_IO(literal) +JSON_IO(value) + +#undef JSON_IO + +} // namespace json +#endif diff --git a/src/GNDStk.hpp b/src/GNDStk.hpp index c665be5ae..6981a69b2 100644 --- a/src/GNDStk.hpp +++ b/src/GNDStk.hpp @@ -1,31 +1,50 @@ -#pragma once +#ifndef NJOY_GNDSTK +#define NJOY_GNDSTK -// ------------------------ +// ----------------------------------------------------------------------------- // External libraries -// ------------------------ +// ----------------------------------------------------------------------------- + +// To circumvent errors in other libraries +#include +#undef CHAR_WIDTH #include "pugixml.hpp" -#include "nlohmann/json.hpp" +#ifndef NJOY_GNDSTK_DISABLE_JSON +#include "json.hpp" +#endif +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +#include +#include +#endif #include "Log.hpp" +// OpenMP +#ifdef _OPENMP +#include +#endif + -// ------------------------ +// ----------------------------------------------------------------------------- // C++ #includes -// ------------------------ +// ----------------------------------------------------------------------------- // miscellaneous #include +#include #include #include -#ifdef GNDSTK_PRECISION +#ifdef NJOY_GNDSTK_PRECISION #include #endif #include #include #include #include +#include +#include #include #include #include @@ -48,97 +67,61 @@ #include -// ------------------------ +// ----------------------------------------------------------------------------- // GNDStk #includes -// ------------------------ +// ----------------------------------------------------------------------------- + +// See https://stackoverflow.com/questions/42797279 +using std::size_t; namespace njoy { namespace GNDStk { -// basic +// Basic #include "GNDStk/utility.hpp" #include "GNDStk/precision.hpp" -#include "GNDStk/enums.hpp" +#include "GNDStk/enumeration.hpp" -// external-library wrappers +// External-library wrappers #include "GNDStk/XML.hpp" #include "GNDStk/JSON.hpp" +#include "GNDStk/HDF5.hpp" -// string/Node to/from type +// std::string/Node to/from type #include "GNDStk/string2type.hpp" #include "GNDStk/type2string.hpp" // Meta, Child, and related -#include "GNDStk/convert_t.hpp" #include "GNDStk/Meta.hpp" #include "GNDStk/Child.hpp" -#include "GNDStk/keyword.hpp" #include "GNDStk/or.hpp" -// optional, with default +// Like std::optional, but with a default #include "GNDStk/Defaulted.hpp" -// sets of Meta/Child -#include "GNDStk/basic.hpp" -#include "GNDStk/misc.hpp" - -// Tree: primary constructs +// Main classes #include "GNDStk/Node.hpp" #include "GNDStk/Tree.hpp" -// fixme This really belongs with basic.hpp and misc.hpp above, but I had to -// move it here due to some ordering issues that arose when I de-templated -// Node and Tree. We'll deal with this later; it's an internal issue, not -// something that will affect users in any manner. -#include "GNDStk/common.hpp" - // Node to/from type #include "GNDStk/node2type.hpp" #include "GNDStk/type2node.hpp" -// xml/json/tree conversions +// Node/XML/JSON/HDF5 conversions #include "GNDStk/convert.hpp" -// fixme See above fixme -namespace basic { using namespace common; } -namespace misc { using namespace common; } - // Miscellaneous support constructs for Standard Interface classes #include "GNDStk/Support.hpp" +#include "GNDStk/Lookup.hpp" // Base classes for primary Standard Interface data classes -#include "GNDStk/BodyText.hpp" +#include "GNDStk/BlockData.hpp" #include "GNDStk/Component.hpp" - -// ------------------------ -// GNDStk "core interface" -// ------------------------ - -/* -In a user code, writing this: - - using namespace njoy::GNDStk::core; - -gives the same effect as writing this: - - using namespace njoy::GNDStk; - using namespace njoy::GNDStk::basic; - -Meaning: We consider our "core interface" to consist of everything in GNDStk:: -proper, plus our basic:: set of Meta and Child objects. Those are the ones with - type, so that they return metadata and nodes in their original tree form. -Note that basic:: itself brings in Meta and Child objects from its own nested -meta:: and child:: namespaces. Those are separate because there's a small amount -of overlap between allowable GNDS metadatum names and node names. With this -scheme, if a name you wish to use isn't one of the overlapping names, just use -it. If it is, then prefix with meta:: or child:: as necessary. -*/ - -namespace core { - using namespace GNDStk; - using namespace basic; -} +// Helper constructs for C language interfaces +#include "GNDStk/CInterface.hpp" } // namespace GNDStk } // namespace njoy + +#endif diff --git a/src/GNDStk/BlockData.hpp b/src/GNDStk/BlockData.hpp new file mode 100644 index 000000000..aced99ae5 --- /dev/null +++ b/src/GNDStk/BlockData.hpp @@ -0,0 +1,166 @@ + +// Printing style +enum class PrintMode { + cpp, + python +}; +inline PrintMode printMode = PrintMode::cpp; + +// Printing-related colors. +// todo Eventually, this probably belongs in a more context-agnostic +// location, such as GNDStk's utility.hpp file or something like it. +#include "GNDStk/BlockData/src/colors.hpp" + +// Miscellaneous helper constructs. +#include "GNDStk/BlockData/src/detail.hpp" + + +// ----------------------------------------------------------------------------- +// BlockData +// The case is specialized and has the fun stuff. This one +// needs just a bit of content, to allow for uniform treatment of BlockData. +// ----------------------------------------------------------------------------- + +template +class BlockData { +public: + using VariantOfVectors = std::variant; + using VariantOfScalars = std::variant; + static inline constexpr bool runtime = false; + template + static inline constexpr bool supported = false; +}; + + +// ----------------------------------------------------------------------------- +// BlockData +// +// Designed to be flexible, smart, and safe. Does lots of checks, and, for the +// DATATYPE == void case, can essentially re-form itself depending on what type +// of data someone tries to extract. +// +// For efficiency in the DATATYPE == void case, an application may want to copy +// to its own vector (e.g. auto myvec = myblockdata.get>()) +// in order to do work on (or with) the vector there, before copying it back. +// ----------------------------------------------------------------------------- + +template +class BlockData { +public: + + #include "GNDStk/BlockData/src/types.hpp" + + // For convenience in various SFINAE and if-constexpr constructs + static inline constexpr bool runtime = detail::is_void_v; + template + struct is_supported { + static inline constexpr bool value = + ( runtime && detail::is_in_v) || + (!runtime && ( + std::is_constructible_v || + std::is_convertible_v + )); + }; + template + static inline constexpr bool supported = is_supported::value; + + enum class Active { string, vector }; + +private: + + // For internal use + mutable Active act = Active::string; + + // Raw string, directly from "plain character data" in a GNDS file. + // We'll allow callers to set this by using a setter. + std::string rawstring; + + // Vector of . + // *** This will be used if, and only if, DATATYPE == void. + // Mutable, so that we can defer processing of the raw string into + // a vector until, and unless, a caller *asks* for the vector. + mutable VariantOfVectors variant; + + // Vector of + // *** This will be used if, and only if, DATATYPE != void. + // data_t is used in a few places where, without it, we'd create compilation + // errors by using "void" in invalid ways. The "int" below is arbitrary - + // basically a placeholder - because the following is used only if !runtime. + using data_t = std::conditional_t; + mutable std::vector vector; + +public: + + // Parameters that affect interpretation of the raw string: + // struct vars { length, start, valueType } + // Includes public getters and setters for those. + // We won't use valueType if DATATYPE != void. + #include "GNDStk/BlockData/src/params.hpp" + + // trim + // Flag: should the conversion of BlockData data back into textual data, + // in a Node, trim zeros from the start and end of the output? + mutable bool trim = true; + + // Getters and setters for the raw string: + #include "GNDStk/BlockData/src/string.hpp" + + // active() + Active active() const { return act; } + + // clear() + // Clears the vector, or the active vector alternative in the variant. + BlockData &clear() + { + if constexpr (runtime) + std::visit([](auto &&alt) { alt.clear(); }, variant); + else + vector.clear(); + + act = Active::vector; + return *this; + } + + // size() + // Returns the size of the vector, or of the active vector alternative in + // the variant. Depending on what someone may or may not have done with the + // current BlockData object, size() might or might not reflect the values of + // length and/or start, or reflect the current contents of the raw string. + size_t size() const + { + if constexpr (runtime) + return std::visit([](auto &&alt) { return alt.size(); }, variant); + else + return vector.size(); + } + + // Various vector get() functions, and the type-specific doubles() etc. + #include "GNDStk/BlockData/src/get.hpp" + + // Read/write data, from/to a Node + #include "GNDStk/BlockData/src/fromNode.hpp" + #include "GNDStk/BlockData/src/toNode.hpp" + + // Print to ostream + #include "GNDStk/BlockData/src/print.hpp" + + // Pull/push length/start/valueType from/to derived-class object + #include "GNDStk/BlockData/src/sync.hpp" + + // Assignment + // From string or vector; the former == calling our raw string setter + #include "GNDStk/BlockData/src/assign.hpp" + + // Conversion to vector + // *** Available if, and only if, DATATYPE != void. + template< + class T = DATATYPE, + class = std::enable_if_t> + > + operator std::vector() const + { + // get(), not vector; get() handles properly if the string is active + return get(); + } + +}; // class BlockData diff --git a/src/GNDStk/BlockData/src/assign.hpp b/src/GNDStk/BlockData/src/assign.hpp new file mode 100644 index 000000000..c809b3a80 --- /dev/null +++ b/src/GNDStk/BlockData/src/assign.hpp @@ -0,0 +1,75 @@ + +// ----------------------------------------------------------------------------- +// Assignment from string +// Same effect as the string(new string) setter +// ----------------------------------------------------------------------------- + +BlockData &operator=(const std::string &str) +{ + return string(str); +} + + +// ----------------------------------------------------------------------------- +// Assignment from vector +// ----------------------------------------------------------------------------- + +/* +DISCUSSION + +Elsewhere, a BlockData object can be made from a GNDS node. From GNDS, we get +a text string (copied to the rawstring field), from which a vector of values +can be created on an as-needed basis. A GNDS node might also give us any of +length, start, and valueType, which, when pulling data from the Node, we'll +use if they're there, or otherwise assume to be our defaults. + +Here, we're allowing for an assignment BlockData = vector. For this assignment, +the caller should send the full, complete vector of values that's appropriate +for the GNDS Node whose data this BlockData object is intended to represent. + +Specifically: the vector should contain whatever leading and/or trailing 0s +the full data vector is supposed to have. The length and start values are +completely ignored by this function; they're neither used nor set. Future +vector accesses though our various get() functions simply access the vector +exactly as-is. Length and start won't come into play until - and unless - a +caller uses the string setter (or assignment to string) and subsequently +triggers a remake of the vector. (Which would then be a newly-created vector, +based on the value of the raw string - not the vector from which we're +assigning here.) + +As for valueType, this function attempts to guess it from the vector's element +type, and sets it to "", the empty string, if we don't recognize that type. + +If a vector that's assigned from, here, is still in play when this BlockData's +data are written to a Node (see the toNode() function), then toNode() will +recompute length and start automatically, based on the vector's beginning and +ending content, if the "trim" flag is set. See toNode() for more information. +*/ + +template +std::enable_if_t, BlockData &> +operator=(const std::vector &vec) +{ + // set the raw string to "", because it's no longer considered meaningful + rawstring = ""; + + // length, start, valueType + length(vec.size()); + start(0); + valueType(detail::Type2Names::value[0]); + + // assign vector + if constexpr (runtime) + variant = vec; + else if constexpr (std::is_same_v) + vector = vec; + else { + vector.clear(); + vector.reserve(vec.size()); + for (const T &element : vec) + vector.push_back(DATATYPE(element)); + } + + act = Active::vector; + return *this; +} diff --git a/src/GNDStk/BlockData/src/colors.hpp b/src/GNDStk/BlockData/src/colors.hpp new file mode 100644 index 000000000..c0d701613 --- /dev/null +++ b/src/GNDStk/BlockData/src/colors.hpp @@ -0,0 +1,703 @@ + +inline bool shades = true; + +namespace color { + +// makeColor +// Here, not in detail::, because it may be of interest to users. +inline std::string makeColor(const int r, const int g, const int b) +{ + return "\033[38;2;" + + std::to_string(r < 0 ? 0 : r > 255 ? 255 : r) + ";" + + std::to_string(g < 0 ? 0 : g > 255 ? 255 : g) + ";" + + std::to_string(b < 0 ? 0 : b > 255 ? 255 : b) + "m"; +} + + +// ----------------------------------------------------------------------------- +// Simple ANSI colors +// ----------------------------------------------------------------------------- + +// Specific colors: +// color::plain::* +// color::bold::* +// Reset/clear: +// color::reset +// These are ANSI color escape sequences. They'll work on many terminals, +// perhaps most, but working isn't guaranteed. The GNDStk::colors flag +// can be set to false (so that colors aren't used) if the escapes don't +// work, or if someone simply doesn't want colors. + +// color::plain:: +namespace plain { + inline const std::string + black = "\033[30;1m", + red = "\033[31;1m", + green = "\033[32;1m", + blue = "\033[34;1m", + cyan = "\033[36;1m", + magenta = "\033[35;1m", + yellow = "\033[33;1m", + white = "\033[37;1m"; +} + +// color::bold:: +namespace bold { + inline const std::string + black = "\033[30;21m", + red = "\033[31;21m", + green = "\033[32;21m", + blue = "\033[34;21m", + cyan = "\033[36;21m", + magenta = "\033[35;21m", + yellow = "\033[33;21m", + white = "\033[37;21m"; +} + +// color::reset +inline const std::string reset = "\033[0m"; + + +// ----------------------------------------------------------------------------- +// blue2red +// ----------------------------------------------------------------------------- + +template>> +std::string blue2red(T min, T value, T max) +{ + static const int ncolors = 511; + static const int rgb[ncolors][3] = { + { 0, 0, 255 }, // blue... + { 0, 1, 254 }, // decrease, while increasing green... + { 0, 2, 253 }, + { 0, 3, 252 }, + { 0, 4, 251 }, + { 0, 5, 250 }, + { 0, 6, 249 }, + { 0, 7, 248 }, + { 0, 8, 247 }, + { 0, 9, 246 }, + { 0, 10, 245 }, + { 0, 11, 244 }, + { 0, 12, 243 }, + { 0, 13, 242 }, + { 0, 14, 241 }, + { 0, 15, 240 }, + { 0, 16, 239 }, + { 0, 17, 238 }, + { 0, 18, 237 }, + { 0, 19, 236 }, + { 0, 20, 235 }, + { 0, 21, 234 }, + { 0, 22, 233 }, + { 0, 23, 232 }, + { 0, 24, 231 }, + { 0, 25, 230 }, + { 0, 26, 229 }, + { 0, 27, 228 }, + { 0, 28, 227 }, + { 0, 29, 226 }, + { 0, 30, 225 }, + { 0, 31, 224 }, + { 0, 32, 223 }, + { 0, 33, 222 }, + { 0, 34, 221 }, + { 0, 35, 220 }, + { 0, 36, 219 }, + { 0, 37, 218 }, + { 0, 38, 217 }, + { 0, 39, 216 }, + { 0, 40, 215 }, + { 0, 41, 214 }, + { 0, 42, 213 }, + { 0, 43, 212 }, + { 0, 44, 211 }, + { 0, 45, 210 }, + { 0, 46, 209 }, + { 0, 47, 208 }, + { 0, 48, 207 }, + { 0, 49, 206 }, + { 0, 50, 205 }, + { 0, 51, 204 }, + { 0, 52, 203 }, + { 0, 53, 202 }, + { 0, 54, 201 }, + { 0, 55, 200 }, + { 0, 56, 199 }, + { 0, 57, 198 }, + { 0, 58, 197 }, + { 0, 59, 196 }, + { 0, 60, 195 }, + { 0, 61, 194 }, + { 0, 62, 193 }, + { 0, 63, 192 }, + { 0, 64, 191 }, + { 0, 65, 190 }, + { 0, 66, 189 }, + { 0, 67, 188 }, + { 0, 68, 187 }, + { 0, 69, 186 }, + { 0, 70, 185 }, + { 0, 71, 184 }, + { 0, 72, 183 }, + { 0, 73, 182 }, + { 0, 74, 181 }, + { 0, 75, 180 }, + { 0, 76, 179 }, + { 0, 77, 178 }, + { 0, 78, 177 }, + { 0, 79, 176 }, + { 0, 80, 175 }, + { 0, 81, 174 }, + { 0, 82, 173 }, + { 0, 83, 172 }, + { 0, 84, 171 }, + { 0, 85, 170 }, + { 0, 86, 169 }, + { 0, 87, 168 }, + { 0, 88, 167 }, + { 0, 89, 166 }, + { 0, 90, 165 }, + { 0, 91, 164 }, + { 0, 92, 163 }, + { 0, 93, 162 }, + { 0, 94, 161 }, + { 0, 95, 160 }, + { 0, 96, 159 }, + { 0, 97, 158 }, + { 0, 98, 157 }, + { 0, 99, 156 }, + { 0, 100, 155 }, + { 0, 101, 154 }, + { 0, 102, 153 }, + { 0, 103, 152 }, + { 0, 104, 151 }, + { 0, 105, 150 }, + { 0, 106, 149 }, + { 0, 107, 148 }, + { 0, 108, 147 }, + { 0, 109, 146 }, + { 0, 110, 145 }, + { 0, 111, 144 }, + { 0, 112, 143 }, + { 0, 113, 142 }, + { 0, 114, 141 }, + { 0, 115, 140 }, + { 0, 116, 139 }, + { 0, 117, 138 }, + { 0, 118, 137 }, + { 0, 119, 136 }, + { 0, 120, 135 }, + { 0, 121, 134 }, + { 0, 122, 133 }, + { 0, 123, 132 }, + { 0, 124, 131 }, + { 0, 125, 130 }, + { 0, 126, 129 }, + { 0, 127, 128 }, + { 0, 128, 127 }, + { 0, 129, 126 }, + { 0, 130, 125 }, + { 0, 131, 124 }, + { 0, 132, 123 }, + { 0, 133, 122 }, + { 0, 134, 121 }, + { 0, 135, 120 }, + { 0, 136, 119 }, + { 0, 137, 118 }, + { 0, 138, 117 }, + { 0, 139, 116 }, + { 0, 140, 115 }, + { 0, 141, 114 }, + { 0, 142, 113 }, + { 0, 143, 112 }, + { 0, 144, 111 }, + { 0, 145, 110 }, + { 0, 146, 109 }, + { 0, 147, 108 }, + { 0, 148, 107 }, + { 0, 149, 106 }, + { 0, 150, 105 }, + { 0, 151, 104 }, + { 0, 152, 103 }, + { 0, 153, 102 }, + { 0, 154, 101 }, + { 0, 155, 100 }, + { 0, 156, 99 }, + { 0, 157, 98 }, + { 0, 158, 97 }, + { 0, 159, 96 }, + { 0, 160, 95 }, + { 0, 161, 94 }, + { 0, 162, 93 }, + { 0, 163, 92 }, + { 0, 164, 91 }, + { 0, 165, 90 }, + { 0, 166, 89 }, + { 0, 167, 88 }, + { 0, 168, 87 }, + { 0, 169, 86 }, + { 0, 170, 85 }, + { 0, 171, 84 }, + { 0, 172, 83 }, + { 0, 173, 82 }, + { 0, 174, 81 }, + { 0, 175, 80 }, + { 0, 176, 79 }, + { 0, 177, 78 }, + { 0, 178, 77 }, + { 0, 179, 76 }, + { 0, 180, 75 }, + { 0, 181, 74 }, + { 0, 182, 73 }, + { 0, 183, 72 }, + { 0, 184, 71 }, + { 0, 185, 70 }, + { 0, 186, 69 }, + { 0, 187, 68 }, + { 0, 188, 67 }, + { 0, 189, 66 }, + { 0, 190, 65 }, + { 0, 191, 64 }, + { 0, 192, 63 }, + { 0, 193, 62 }, + { 0, 194, 61 }, + { 0, 195, 60 }, + { 0, 196, 59 }, + { 0, 197, 58 }, + { 0, 198, 57 }, + { 0, 199, 56 }, + { 0, 200, 55 }, + { 0, 201, 54 }, + { 0, 202, 53 }, + { 0, 203, 52 }, + { 0, 204, 51 }, + { 0, 205, 50 }, + { 0, 206, 49 }, + { 0, 207, 48 }, + { 0, 208, 47 }, + { 0, 209, 46 }, + { 0, 210, 45 }, + { 0, 211, 44 }, + { 0, 212, 43 }, + { 0, 213, 42 }, + { 0, 214, 41 }, + { 0, 215, 40 }, + { 0, 216, 39 }, + { 0, 217, 38 }, + { 0, 218, 37 }, + { 0, 219, 36 }, + { 0, 220, 35 }, + { 0, 221, 34 }, + { 0, 222, 33 }, + { 0, 223, 32 }, + { 0, 224, 31 }, + { 0, 225, 30 }, + { 0, 226, 29 }, + { 0, 227, 28 }, + { 0, 228, 27 }, + { 0, 229, 26 }, + { 0, 230, 25 }, + { 0, 231, 24 }, + { 0, 232, 23 }, + { 0, 233, 22 }, + { 0, 234, 21 }, + { 0, 235, 20 }, + { 0, 236, 19 }, + { 0, 237, 18 }, + { 0, 238, 17 }, + { 0, 239, 16 }, + { 0, 240, 15 }, + { 0, 241, 14 }, + { 0, 242, 13 }, + { 0, 243, 12 }, + { 0, 244, 11 }, + { 0, 245, 10 }, + { 0, 246, 9 }, + { 0, 247, 8 }, + { 0, 248, 7 }, + { 0, 249, 6 }, + { 0, 250, 5 }, + { 0, 251, 4 }, + { 0, 252, 3 }, + { 0, 253, 2 }, + { 0, 254, 1 }, + { 0, 255, 0 }, // green... + { 1, 254, 0 }, // decrease, while increasing red... + { 2, 253, 0 }, + { 3, 252, 0 }, + { 4, 251, 0 }, + { 5, 250, 0 }, + { 6, 249, 0 }, + { 7, 248, 0 }, + { 8, 247, 0 }, + { 9, 246, 0 }, + { 10, 245, 0 }, + { 11, 244, 0 }, + { 12, 243, 0 }, + { 13, 242, 0 }, + { 14, 241, 0 }, + { 15, 240, 0 }, + { 16, 239, 0 }, + { 17, 238, 0 }, + { 18, 237, 0 }, + { 19, 236, 0 }, + { 20, 235, 0 }, + { 21, 234, 0 }, + { 22, 233, 0 }, + { 23, 232, 0 }, + { 24, 231, 0 }, + { 25, 230, 0 }, + { 26, 229, 0 }, + { 27, 228, 0 }, + { 28, 227, 0 }, + { 29, 226, 0 }, + { 30, 225, 0 }, + { 31, 224, 0 }, + { 32, 223, 0 }, + { 33, 222, 0 }, + { 34, 221, 0 }, + { 35, 220, 0 }, + { 36, 219, 0 }, + { 37, 218, 0 }, + { 38, 217, 0 }, + { 39, 216, 0 }, + { 40, 215, 0 }, + { 41, 214, 0 }, + { 42, 213, 0 }, + { 43, 212, 0 }, + { 44, 211, 0 }, + { 45, 210, 0 }, + { 46, 209, 0 }, + { 47, 208, 0 }, + { 48, 207, 0 }, + { 49, 206, 0 }, + { 50, 205, 0 }, + { 51, 204, 0 }, + { 52, 203, 0 }, + { 53, 202, 0 }, + { 54, 201, 0 }, + { 55, 200, 0 }, + { 56, 199, 0 }, + { 57, 198, 0 }, + { 58, 197, 0 }, + { 59, 196, 0 }, + { 60, 195, 0 }, + { 61, 194, 0 }, + { 62, 193, 0 }, + { 63, 192, 0 }, + { 64, 191, 0 }, + { 65, 190, 0 }, + { 66, 189, 0 }, + { 67, 188, 0 }, + { 68, 187, 0 }, + { 69, 186, 0 }, + { 70, 185, 0 }, + { 71, 184, 0 }, + { 72, 183, 0 }, + { 73, 182, 0 }, + { 74, 181, 0 }, + { 75, 180, 0 }, + { 76, 179, 0 }, + { 77, 178, 0 }, + { 78, 177, 0 }, + { 79, 176, 0 }, + { 80, 175, 0 }, + { 81, 174, 0 }, + { 82, 173, 0 }, + { 83, 172, 0 }, + { 84, 171, 0 }, + { 85, 170, 0 }, + { 86, 169, 0 }, + { 87, 168, 0 }, + { 88, 167, 0 }, + { 89, 166, 0 }, + { 90, 165, 0 }, + { 91, 164, 0 }, + { 92, 163, 0 }, + { 93, 162, 0 }, + { 94, 161, 0 }, + { 95, 160, 0 }, + { 96, 159, 0 }, + { 97, 158, 0 }, + { 98, 157, 0 }, + { 99, 156, 0 }, + { 100, 155, 0 }, + { 101, 154, 0 }, + { 102, 153, 0 }, + { 103, 152, 0 }, + { 104, 151, 0 }, + { 105, 150, 0 }, + { 106, 149, 0 }, + { 107, 148, 0 }, + { 108, 147, 0 }, + { 109, 146, 0 }, + { 110, 145, 0 }, + { 111, 144, 0 }, + { 112, 143, 0 }, + { 113, 142, 0 }, + { 114, 141, 0 }, + { 115, 140, 0 }, + { 116, 139, 0 }, + { 117, 138, 0 }, + { 118, 137, 0 }, + { 119, 136, 0 }, + { 120, 135, 0 }, + { 121, 134, 0 }, + { 122, 133, 0 }, + { 123, 132, 0 }, + { 124, 131, 0 }, + { 125, 130, 0 }, + { 126, 129, 0 }, + { 127, 128, 0 }, + { 128, 127, 0 }, + { 129, 126, 0 }, + { 130, 125, 0 }, + { 131, 124, 0 }, + { 132, 123, 0 }, + { 133, 122, 0 }, + { 134, 121, 0 }, + { 135, 120, 0 }, + { 136, 119, 0 }, + { 137, 118, 0 }, + { 138, 117, 0 }, + { 139, 116, 0 }, + { 140, 115, 0 }, + { 141, 114, 0 }, + { 142, 113, 0 }, + { 143, 112, 0 }, + { 144, 111, 0 }, + { 145, 110, 0 }, + { 146, 109, 0 }, + { 147, 108, 0 }, + { 148, 107, 0 }, + { 149, 106, 0 }, + { 150, 105, 0 }, + { 151, 104, 0 }, + { 152, 103, 0 }, + { 153, 102, 0 }, + { 154, 101, 0 }, + { 155, 100, 0 }, + { 156, 99, 0 }, + { 157, 98, 0 }, + { 158, 97, 0 }, + { 159, 96, 0 }, + { 160, 95, 0 }, + { 161, 94, 0 }, + { 162, 93, 0 }, + { 163, 92, 0 }, + { 164, 91, 0 }, + { 165, 90, 0 }, + { 166, 89, 0 }, + { 167, 88, 0 }, + { 168, 87, 0 }, + { 169, 86, 0 }, + { 170, 85, 0 }, + { 171, 84, 0 }, + { 172, 83, 0 }, + { 173, 82, 0 }, + { 174, 81, 0 }, + { 175, 80, 0 }, + { 176, 79, 0 }, + { 177, 78, 0 }, + { 178, 77, 0 }, + { 179, 76, 0 }, + { 180, 75, 0 }, + { 181, 74, 0 }, + { 182, 73, 0 }, + { 183, 72, 0 }, + { 184, 71, 0 }, + { 185, 70, 0 }, + { 186, 69, 0 }, + { 187, 68, 0 }, + { 188, 67, 0 }, + { 189, 66, 0 }, + { 190, 65, 0 }, + { 191, 64, 0 }, + { 192, 63, 0 }, + { 193, 62, 0 }, + { 194, 61, 0 }, + { 195, 60, 0 }, + { 196, 59, 0 }, + { 197, 58, 0 }, + { 198, 57, 0 }, + { 199, 56, 0 }, + { 200, 55, 0 }, + { 201, 54, 0 }, + { 202, 53, 0 }, + { 203, 52, 0 }, + { 204, 51, 0 }, + { 205, 50, 0 }, + { 206, 49, 0 }, + { 207, 48, 0 }, + { 208, 47, 0 }, + { 209, 46, 0 }, + { 210, 45, 0 }, + { 211, 44, 0 }, + { 212, 43, 0 }, + { 213, 42, 0 }, + { 214, 41, 0 }, + { 215, 40, 0 }, + { 216, 39, 0 }, + { 217, 38, 0 }, + { 218, 37, 0 }, + { 219, 36, 0 }, + { 220, 35, 0 }, + { 221, 34, 0 }, + { 222, 33, 0 }, + { 223, 32, 0 }, + { 224, 31, 0 }, + { 225, 30, 0 }, + { 226, 29, 0 }, + { 227, 28, 0 }, + { 228, 27, 0 }, + { 229, 26, 0 }, + { 230, 25, 0 }, + { 231, 24, 0 }, + { 232, 23, 0 }, + { 233, 22, 0 }, + { 234, 21, 0 }, + { 235, 20, 0 }, + { 236, 19, 0 }, + { 237, 18, 0 }, + { 238, 17, 0 }, + { 239, 16, 0 }, + { 240, 15, 0 }, + { 241, 14, 0 }, + { 242, 13, 0 }, + { 243, 12, 0 }, + { 244, 11, 0 }, + { 245, 10, 0 }, + { 246, 9, 0 }, + { 247, 8, 0 }, + { 248, 7, 0 }, + { 249, 6, 0 }, + { 250, 5, 0 }, + { 251, 4, 0 }, + { 252, 3, 0 }, + { 253, 2, 0 }, + { 254, 1, 0 }, + { 255, 0, 0 } // red + }; + + if (max == min) + return makeColor(rgb[0][0], rgb[0][1], rgb[0][2]); + if (max < min) + std::swap(min,max); + value = value < min ? min : value > max ? max : value; + + int n = ncolors*(value-min)/(max-min); + n = n < 0 ? 0 : n > ncolors-1 ? ncolors-1 : n; + + return makeColor(rgb[n][0], rgb[n][1], rgb[n][2]); +} // blue2red + + +// ----------------------------------------------------------------------------- +// Some custom colors +// ----------------------------------------------------------------------------- + +// color::custom:: +namespace custom { + inline const std::string + red = makeColor( 200, 40, 80 ), + yellow = makeColor( 220, 220, 40 ), + green = makeColor( 20, 200, 120 ), + blue = makeColor( 40, 160, 250 ), + purple = makeColor( 142, 110, 202 ); + + // color::custom::faded:: + namespace faded { + inline const std::string + red = makeColor( (200+128)/2, ( 40+128)/2, ( 80+128)/2 ), + yellow = makeColor( (220+128)/2, (220+128)/2, ( 40+128)/2 ), + green = makeColor( ( 20+128)/2, (200+128)/2, (120+128)/2 ), + blue = makeColor( ( 40+128)/2, (160+128)/2, (250+128)/2 ), + purple = makeColor( (142+128)/2, (110+128)/2, (202+128)/2 ); + } + + inline const std::string + black = makeColor( 0, 0, 0 ), + gray = makeColor( 128, 128, 128 ), + white = makeColor( 255, 255, 255 ); +} + + +// ----------------------------------------------------------------------------- +// For Component prettyprinting +// Non-const, so you can change them if they don't work well with your window's +// color scheme, or if you just prefer something else. All of the following are +// in color::. The empty string, "", means no special color treatment, so that +// you'll get the text color your terminal already uses. +// ----------------------------------------------------------------------------- + +// Component-derived class labels +inline std::string field = custom::blue; + +// Vector labels +inline std::string vector = custom::green; + +// General labels +inline std::string label = custom::red; + +// General values +inline std::string value = custom::purple; + +// Comments that appear in a Component.comment vector. +inline std::string comment = custom::yellow; + +// Re: data nodes +namespace data { + // Strings and vectors in data nodes. Emphasis: only strings and vectors + // specifically in DATA NODES, not those appearing in other ways. + inline std::string string = custom::white; + inline std::string vector = custom::white; +} + +// If an object is optional or GNDStk::Defaulted, the color for its label, +// or for its value, can be modified by using the following. +namespace optional { + inline std::string field = custom::faded::blue; + inline std::string vector = custom::faded::green; + inline std::string label = custom::faded::red; + inline std::string value = custom::faded::purple; +} + + +// ----------------------------------------------------------------------------- +// simple +// Set the color strings to use simple ANSI colors. +// These may work on your terminal if full RGB terminal-text colors don't. +// ----------------------------------------------------------------------------- + +inline void simple() +{ + // Shading isn't compatible with *simple* coloring. + shades = false; + + // Note: the given values seemed to work reasonably well on terminal + // applications we tried. One such app, in particular, was "terminator" + // on a Linux platform. We like terminator - it allows a single terminal + // window to be split, recursively, horizontally or vertically, allowing + // someone to run multiple logically-related codes on different command + // prompts, within the same overall window on their screen.) We noticed, + // however, that terminator prints all of the basic ANSI "bold" colors + // not just colored, but *underlined* as well. So, we avoided using bold + // colors, as we found underlines to be more distracting than helpful. + + field = plain::blue; + vector = plain::green; + label = plain::red; + value = plain::magenta; + comment = plain::yellow; + + data::string = plain::white; + data::vector = plain::white; + + optional::field = field; + optional::vector = vector; + optional::label = label; + optional::value = value; +} + +} // namespace color diff --git a/src/GNDStk/BlockData/src/detail.hpp b/src/GNDStk/BlockData/src/detail.hpp new file mode 100644 index 000000000..083acaa7b --- /dev/null +++ b/src/GNDStk/BlockData/src/detail.hpp @@ -0,0 +1,152 @@ + +namespace detail { + +// ----------------------------------------------------------------------------- +// Miscellaneous +// ----------------------------------------------------------------------------- + +// scalarize +template +auto scalarize(const std::variant) +{ + return std::variant{}; +} + +// getBounds +template +auto getBounds(const std::vector &vec) +{ + T zero; + if constexpr (std::is_same_v) + zero = ""; + else + zero = T(0); + std::pair bnd(0,vec.size()); + while (bnd.first < bnd.second && vec[bnd.first ] == zero) ++bnd.first; + while (bnd.first < bnd.second && vec[bnd.second-1] == zero) --bnd.second; + return bnd; +} + + +// ----------------------------------------------------------------------------- +// SFINAE constructs for detecting whether or not a class has certain members. +// Adapted from an answer here: https://stackoverflow.com/questions/1005476 +// ----------------------------------------------------------------------------- + +// ------------------------ +// has_index +// ------------------------ + +template +struct has_index { + static constexpr bool value = false; +}; + +template +struct has_index< + // Just using T{}.index() on the next line can lead to an ambiguity between + // this specialization and the one for std::variant below, arising from the + // fact that std::variant has an index function. Hence the conditional_t. + T, decltype((void)std::conditional_t,void,T>{}.index(),0) +> { + static constexpr bool value = true; +}; + +// for variant: does any alternative have .index()? +template +struct has_index> { + static constexpr bool value = (has_index::value || ...); +}; + +template +inline constexpr bool has_index_v = has_index>::value; + +// ------------------------ +// has_label +// ------------------------ + +template +struct has_label { + static constexpr bool value = false; +}; + +template +struct has_label< + // std::variant doesn't have a label function, like it has an index function, + // but, for the sake of consistency, we'll do here as we did with has_index. + T, decltype((void)std::conditional_t,void,T>{}.label(),0) +> { + static constexpr bool value = true; +}; + +// for variant: does any alternative have .label()? +template +struct has_label> { + static constexpr bool value = (has_label::value || ...); +}; + +template +inline constexpr bool has_label_v = has_label>::value; + + +// ----------------------------------------------------------------------------- +// element2element +// ----------------------------------------------------------------------------- + +// Remark: PrecisionContext::data, not PrecisionContext::metadata, is the right +// precision context (in terms of our functionality for handling floating-point +// precision) in the code for which element2element() is called. We could bypass +// element2element() entirely, using convert_t{}(...) instead, except that then +// PrecisionContext::metadata would ultimately get used for floating-point T. +// So, below, we recognize floating-point T directly, and handle it correctly. + +// string ==> arithmetic +template>> +void element2element(const std::string &str, T &value) +{ + if constexpr (std::is_floating_point_v) + value = Precision{}.read(str); + else + convert_t{}(str,value); +} + +// arithmetic ==> arithmetic +template +void element2element(const FROM &from, TO &to) +{ + convert_t{}(from,to); +} + +// arithmetic ==> string +template>> +void element2element(const T &value, std::string &str) +{ + if constexpr (std::is_floating_point_v) + str = Precision{}.write(value); + else + convert_t{}(value,str); +} + + +// ----------------------------------------------------------------------------- +// colorize +// colorize_comment +// ----------------------------------------------------------------------------- + +inline std::string colorize( + const std::string &text, + const std::string &color +) { + return GNDStk::colors && color != "" + ? color + text + GNDStk::color::reset + : text; +} + +inline std::string colorize_comment( + const std::string &text, + const std::string &color = "" +) { + return colorize((printMode == PrintMode::cpp ? "// " : "# ") + text, color); +} + +} // namespace detail diff --git a/src/GNDStk/BlockData/src/fromNode.hpp b/src/GNDStk/BlockData/src/fromNode.hpp new file mode 100644 index 000000000..e96c12ccd --- /dev/null +++ b/src/GNDStk/BlockData/src/fromNode.hpp @@ -0,0 +1,39 @@ + +// ----------------------------------------------------------------------------- +// BlockData::fromNode(Node) +// ----------------------------------------------------------------------------- + +void fromNode(const Node &node) +{ + // length, start, and valueType might be present in the Node, but we won't + // fetch any of them here. Elsewhere, the current BlockData object should + // have had its length, start, and valueType pulled from those respective + // values in an object of a class derived from Component, which in turn + // derived from BlockData. That object's content will have been pulled from + // the same Node. Here, we just get the Node's values: plain character data, + // in XML terminology. + + bool found = false; + rawstring = node.data(found); + + if (!found) { + rawstring = ""; + + // Warning, re: why are we in BlockData if there's no block + // data? Perhaps the Node has a non-default length and/or start, so that + // the values are all supposed to be...zero. Until and unless we discover + // otherwise, however, we doubt that that would be the case, and will + // consider a Node's lack of plain character data, in the present context, + // to be something that merits a warning. + log::warning( + "Component marked as having block data, " + "but no such content was found in the GNDS node." + ); + log::member("BlockData::fromNode(Node, with name \"{}\")", node.name); + } + + // Above, we set the raw string. The following reflects this, so that the + // vector, or a vector in the variant, will be rebuilt from the raw string + // if and when a caller asks for it. + act = Active::string; +} diff --git a/src/GNDStk/BlockData/src/get.hpp b/src/GNDStk/BlockData/src/get.hpp new file mode 100644 index 000000000..278c0a7ef --- /dev/null +++ b/src/GNDStk/BlockData/src/get.hpp @@ -0,0 +1,568 @@ + +// ----------------------------------------------------------------------------- +// Cases +// ----------------------------------------------------------------------------- + +/* +------------------------ +When DATATYPE == void +------------------------ + +Case 1 +Return reference to [const] vector: + get> const + get> +T must be such that vector is in our variant. + +Case 2 +Return reference to [const] T: + get(n) const + get(n) +T must be such that vector is in our variant. + +Case 3 +Return reference to [const] variants>: + get() const + get() + +Case 4 +Return (by value) a variant: + get(n) const + operator[](n) const +A reference return isn't possible with the above two, because there's +no variant to reference; it's computed on-the-fly. The value +return means, further, that non-const version aren't necessary. + +Case 5 +Type-specific getters with specific names: + const std::vector &name() const + std::vector &name() + const T &name(n) const + T &name(n) +For example, name == doubles when T == double. + +------------------------ +When DATATYPE != void +------------------------ + +Case 1 +Return reference to [const] vector: + get> const + get> +T must == DATATYPE. + +Case 2 +Return reference to [const] T: + get(n) const + get(n) +T must == DATATYPE. + +Case 3 +Return reference to [const] vector + get() const + get() + +Case 4 +Return reference to [const] DATATYPE: + get(n) const + operator[](n) const + get(n) + operator[](n) + +Case 5 +Type-specific getters with a specific name: + const std::vector &name() const + std::vector &name() + const DATATYPE &name(n) const + DATATYPE &name(n) +For example, name == doubles if DATATYPE == double. Unlike in the DATATYPE == +void case, we won't have this set of functions for each of name == doubles, +name == ints, name == strings, etc., but only for the name that's appropriate +for type DATATYPE. +*/ + + +// ----------------------------------------------------------------------------- +// 1. get>() +// ----------------------------------------------------------------------------- + +/* +------------------------ +DESCRIPTION +------------------------ + +If active == string: + + Warn if T appears to conflict with valueType. + Warn if length appears to be wrong. + + Make the vector in the variant contain data from the raw string. + INCLUDE any leading and trailing zeros, per start and length. + Note that length == 0 is interpreted as no particular length prescribed. + + Briefly: create vector = [0 ... 0 values_from_raw_string 0 ... 0]. + For the T == string case, 0 really means "" (empty string). + +If active == vector: + + If the variant already contains a vector: + Return it; we're done. + *** Under the correct and normal use of BlockData, *** + *** this simple action will probably be the most common. *** + + Else: + Convert the variant's vector into a vector. + Print a note to the effect that this might be unintentional. + The note can be suppressed if the call *is* intentional. + +In the active == vector case, length, start, and valueType aren't considered +to be relevant, and play no role. We consider those values to be meaningful +ONLY in relation to BlockData's raw string, and we deal with them here only +if and when we make the vector from the raw string. + +That way, callers can access, manipulate, and even completely change the +vector's contents or its type - basically, can work in peace with a vector, +as someone working with data would surely often want to do - without length, +start, or valueType interfering with the process. Those values are considered +to be relevant ONLY when we absolutely must deal with the raw string. This +generally happens only during creation of the current object from a Node, +or creation of a Node from the current object. (And if we create a Node from +a vector in the current object, then we'll compute length, etc. for ourselves. +See the toNode() function for more information about that.) + +Therefore, if you want length, start, and valueType to be used, then proceed +as follows. Set the raw string to what you wish, using the string() setter. +Set length, start, or valueType as you wish, either before or after possibly +setting the string. Finally, after doing all that, do a get>(). +Then the vector in the variant will be remade, per the new string and/or the +length etc. parameters, as described earlier in this remark, if and when a +get> function is next called. + +The return value of the const version is a const reference to a (possibly +newly converted-to from the raw string, possibly existing, or possibly remade) +vector in the variant. Note that because the variant was declared to be +mutable, we were indeed able to rebuild the vector if doing so was necessary. +But we'll still return a *const* reference in that case, because the present +object is conceptually const, and a caller shouldn't therefore be allowed to +modify the vector outside of BlockData's machinery. + +Of course we also have a non-const version, for a non-const *this. +*/ + + +// const +template +std::enable_if_t< + ( runtime && detail::is_in_v) || + (!runtime && std::is_same_v>), + const VECTOR & +> get() const +{ + // Element type requested + using T = typename VECTOR::value_type; + + + // ------------------------ + // if active == string + // ------------------------ + + if (active() == Active::string) { + static const std::string context_rebuilding = + "BlockData::get>(), remade from raw string"; + + // Completely rebuild the vector from the raw string, making use of + // length, start, and valueType. + + // For this get(), the caller has stipulated a particular vector type. + // We'll print a warning if that vector type appears to conflict with + // valueType. Regardless, we'll return what the caller requested. Note + // that valueType == "" is acceptable with any element type. + if (valueType() != "" && !detail::Type2Names::find(valueType())) { + log::warning( + "Vector element type may be inconsistent with valueType \"{}\";\n" + "we'll create the requested std::vector<> anyway", + valueType() + ); + log::member(context_rebuilding); + } + + // Initialize + VECTOR *to; + if constexpr (runtime) { + variant = VECTOR{}; + to = &std::get(variant); // std::get, not this get :-) + } else { + vector.clear(); + to = &vector; + } + + T zero; + if constexpr (std::is_same_v) + zero = ""; + else + zero = T(0); + + // [*****----------]: leading 0s + for (size_t i = 0; i < start(); ++i) + to->push_back(zero); + + // [-----*****-----]: values from the raw string + if constexpr (std::is_floating_point_v) { + // Below, the "false" means "don't clear the vector." We need that + // here, because leading 0s from the earlier loop might be present. + detail::Precision{}. + read(rawstring,*to,false); + } else { + // The above read would ultimately do the following for non-floating- + // point T, but only after extra logic that we might as well avoid. + std::istringstream iss(rawstring); + T element; + while (iss >> element) + to->push_back(element); + } + + // Print a warning if length appears to be impossible because we already + // have more than that number of values. (But length == 0 is ignored.) + if (0 < length() && length() < to->size()) { + log::warning( + "The value of length == {} appears to be wrong, because we\n" + "already have {} values from start == {}, plus {} values read\n" + "from the raw string, for a total of {} values.", + length(), + start(), + start(), + to->size() - start(), + to->size() + ); + log::member(context_rebuilding); + } + + // [----------*****]: trailing 0s + for (size_t i = to->size(); i < length(); ++i) + to->push_back(zero); + + act = Active::vector; // was string; now is vector + return *to; + } // if (active == Active::string) + + + // ------------------------ + // if active == vector + // ------------------------ + + if constexpr (runtime) { + // VARIANT CASE... + // Do we already have a vector of the requested type? + if (std::holds_alternative(variant)) + return std::get(variant); + + // If we reach this point, it means two things. (1) We're NOT remaking + // a vector from the raw string (that case was handled first). (2) The + // caller wants a vector of a different type than the type the variant + // currently holds (or we'd have returned immediately above). + // + // So, for example, perhaps the variant currently has a vector, + // and a call get>() was made, meaning that the caller + // wants a vector. + // + // BlockData is intended to store just one vector - one that represents + // values in a GNDS node that has block data. We don't, and shouldn't, + // try to juggle multiple vectors of different types. Therefore, we'll + // attempt to convert the existing vector to one of the requested type, + // then place the new vector into the variant (replacing the old one.) + // + // This is arguably an odd situation, but one that might - might - have + // some utility. (We're not sure yet.) So, we'll print an informational + // note (not even a warning), then proceed. + + log::info( + "Re-forming vector of one type into vector of another type;\n" + "was this intentional?"); + log::member("BlockData::get>()"); + + // Initialize a new vector that will soon replace the old one + VECTOR newVector; + newVector.reserve(size()); + + // Convert elements from the old vector to the new vector + std::visit( + [&newVector](auto &&oldVector) + { + for (const auto &from : oldVector) { + newVector.push_back(T()); + detail::element2element(from,newVector.back()); + } + }, + variant + ); + + // Replace the existing vector with the new vector + variant = newVector; + return std::get(variant); + + } else { + // VECTOR CASE... + // The vector is (via SFINAE) already of the requested type + return vector; + } +} + + +// non-const +template +std::enable_if_t< + ( runtime && detail::is_in_v) || + (!runtime && std::is_same_v>), + VECTOR & +> get() +{ + return const_cast(std::as_const(*this).template get()); +} + + +// ----------------------------------------------------------------------------- +// 2. get(n) +// ----------------------------------------------------------------------------- + +// For DATATYPE == void (so that we have a variants>): +// These trigger a complete rebuild of the vector, if it isn't already of type +// vector for the given T. This is intentional, in order to provide maximum +// flexibility. However, be aware of it, for the sake of efficiency! In general, +// when using a BlockData object, we recommend sticking with one underlying +// type, not dynamically changing from one type to another. + +// For DATATYPE != void (so that we have a vector): +// T == DATATYPE is required, so that returning an element of the +// vector will return a reference to T. (A constructibility/ +// convertibility requirement that we have in other BlockData-related code thus +// needs to be more stringent here. We can't just be able to make a T from a +// DATATYPE. They must in fact be the same type, because we return a reference.) + +// For both of the above cases: +// If the string (not the variant or the vector) is active, then a rebuild from +// the string is necessary, and will happen in the get>() call. + +// const +template +std::enable_if_t< + supported && (runtime || std::is_same_v), + const T & +> +get(const size_t n) const +{ + try { + return get>()[n]; + } catch (...) { + log::member("BlockData::get({})", n); + throw; + } +} + +// non-const +template +std::enable_if_t< + supported && (runtime || std::is_same_v), + T & +> +get(const size_t n) +{ + return const_cast(std::as_const(*this).template get(n)); +} + + +// ----------------------------------------------------------------------------- +// 3. get() +// If DATATYPE == void, returns a variants>. +// If DATATYPE != void, returns a vector<>. +// ----------------------------------------------------------------------------- + +// const +std::conditional_t< + runtime, + const VariantOfVectors &, + const std::vector & +> get() const +{ + if constexpr (runtime) { + detail::Names2Type( + valueType(), + [this](auto &&t) + { + // clang seems to need this-> explicitly to *not* emit a warning + this->get>>(); + } + ); + // We can't return the specific variant alternative that was just put + // in place; it depended on a runtime check. So, we return the entire + // variant, for whatever use that might have to a caller. + return variant; + } else { + // Simpler, but we do still need a get (in case the *string* is active). + get>(); + return vector; + } +} + +// non-const +std::conditional_t< + runtime, + VariantOfVectors &, + std::vector & +> get() +{ + return const_cast< + std::conditional_t< + runtime, + VariantOfVectors &, + std::vector & + > + >(std::as_const(*this).get()); +} + + +// ----------------------------------------------------------------------------- +// 4. get(n) +// +// If DATATYPE == void, returns a variant (by value, because the +// returned object must be made on-the-fly from our variants>). +// +// If DATATYPE != void, returns a scalar of type [const] DATATYPE (by reference, +// because it's available directly in our vector). +// ----------------------------------------------------------------------------- + +// ------------------------ +// const +// ------------------------ + +// get(n) +std::conditional_t< + runtime, + VariantOfScalars, + const data_t & +> get(const size_t n) const +{ + try { + get(); + if constexpr (runtime) { + return std::visit( + [n](auto &&alt) { return VariantOfScalars(alt[n]); }, + variant + ); + } else { + return vector[n]; + } + } catch (...) { + log::member("BlockData::get({})", n); + throw; + } +} + +// operator[](n): useful alternative form +std::conditional_t< + runtime, + VariantOfScalars, + const data_t & +> operator[](const size_t n) const +{ + return get(n); +} + + +// ------------------------ +// non-const +// ------------------------ + +// If DATATYPE == void: +// Not needed, because the const versions return by value. +// +// If DATATYPE != void: +// Meaningful, because returns are by reference in this (DATATYPE != void) case. +// So, we'll enable non-const versions for this case only. + +// In case anyone wonders, D (not just DATATYPE) is needed below because SFINAE +// applies when template argument *deduction* is taking place. DATATYPE is +// already fixed, by context - we're in BlockData - and thus it +// isn't being deduced here. Templating these (otherwise non-template) functions +// with an argument that defaults to DATATYPE, then using that argument in the +// SFINAE, is a simple trick that makes the SFINAE work as intended. As for +// VOID, it's necessary in order for the following to be unambiguous with the +// template versions of get(n) that are defined elsewhere in this file. + +// get(n) +template +std::enable_if_t && !detail::is_void_v, data_t &> +get(const size_t n) +{ + try { + get(); + return vector[n]; + } catch (...) { + log::member("BlockData::get({})", n); + throw; + } +} + +// operator[](n) +template +std::enable_if_t, data_t &> +operator[](const size_t n) +{ + return get(n); +} + + +// ----------------------------------------------------------------------------- +// 5. Type-specific "get()" functions. +// Function names reflect the types: strings(), ints(), doubles(), etc. +// These provide convenient, shorthand access to specific gets. +// ----------------------------------------------------------------------------- + +// Cases: +// vector, const +// vector, non-const +// element, const +// element, non-const + +#define NJOY_GNDSTK_MAKE_GETTER(name,TYPE) \ + \ + template \ + std::enable_if_t< \ + detail::is_void_v || std::is_same_v, \ + const std::vector & \ + > name() const { return get>(); } \ + \ + template \ + std::enable_if_t< \ + detail::is_void_v || std::is_same_v, \ + std::vector & \ + > name() { return get>(); } \ + \ + template \ + std::enable_if_t< \ + detail::is_void_v || std::is_same_v, \ + const TYPE & \ + > name(const size_t n) const { return get(n); } \ + \ + template \ + std::enable_if_t< \ + detail::is_void_v || std::is_same_v, \ + TYPE & \ + > name(const size_t n) { return get(n); } + +NJOY_GNDSTK_MAKE_GETTER(strings, std::string) +NJOY_GNDSTK_MAKE_GETTER(chars, char) +NJOY_GNDSTK_MAKE_GETTER(schars, signed char) +NJOY_GNDSTK_MAKE_GETTER(shorts, short) +NJOY_GNDSTK_MAKE_GETTER(ints, int) +NJOY_GNDSTK_MAKE_GETTER(longs, long) +NJOY_GNDSTK_MAKE_GETTER(longlongs, long long) +NJOY_GNDSTK_MAKE_GETTER(uchars, unsigned char) +NJOY_GNDSTK_MAKE_GETTER(ushorts, unsigned short) +NJOY_GNDSTK_MAKE_GETTER(uints, unsigned) +NJOY_GNDSTK_MAKE_GETTER(ulongs, unsigned long) +NJOY_GNDSTK_MAKE_GETTER(ulonglongs, unsigned long long) +NJOY_GNDSTK_MAKE_GETTER(floats, float) +NJOY_GNDSTK_MAKE_GETTER(doubles, double) +NJOY_GNDSTK_MAKE_GETTER(longdoubles, long double) + +#undef NJOY_GNDSTK_MAKE_GETTER diff --git a/src/GNDStk/BlockData/src/params.hpp b/src/GNDStk/BlockData/src/params.hpp new file mode 100644 index 000000000..d53397152 --- /dev/null +++ b/src/GNDStk/BlockData/src/params.hpp @@ -0,0 +1,95 @@ + +// ----------------------------------------------------------------------------- +// length, start, valueType +// We place these into a struct so our setters can have the names themselves. +// ----------------------------------------------------------------------------- + +/* +Quoted [slightly edited] from the official JSON specification files for GNDS: + + length + The total number of data values including leading and trailing zero + values that are not stored. This attribute should only be used when + the sum of start and the number of listed values do not add to the + total number of data values. This should only happen when there are + trailing zeros not listed in the block data. + + start + Default: 0 + For start = N, the first N values are zero and are not stored. + + valueType + Specifies the type of data in the body (e.g., "Integer32", "Float64"). + Only one type of data can be stored in each instance of a values node. + +In some places, e.g. the JSON-format GNDS spec files, these are listed in +a different order: valueType, start, length. Ordering doesn't really matter. +We just chose to use alphabetical) ordering here. +*/ + +private: + +// toNode() works with a conceptually const object, but may update these to be +// consistent with vector data; so, mutable. +struct { + // Any of these might or might not have appeared in a particular node that + // had block data. For uniformity, we have them all here, and with defaults. + mutable size_t length = 0; + mutable size_t start = 0; + mutable std::string valueType = ""; +} vars; + + +// ----------------------------------------------------------------------------- +// Getters +// Note: we intentionally return by (non-const!) reference, because the values +// in question are mutable. +// ----------------------------------------------------------------------------- + +public: + +// length +size_t &length() const +{ + return vars.length; +} + +// start +size_t &start() const +{ + return vars.start; +} + +// valueType +std::string &valueType() const +{ + return vars.valueType; +} + + +// ----------------------------------------------------------------------------- +// Setters +// Builder pattern for all: return *this. +// Arguments of optional type allow for more flexibility in derived classes. +// ----------------------------------------------------------------------------- + +BlockData &length(const std::optional &opt) +{ + if (opt.has_value()) + vars.length = opt.value(); + return *this; +} + +BlockData &start(const std::optional &opt) +{ + if (opt.has_value()) + vars.start = opt.value(); + return *this; +} + +BlockData &valueType(const std::optional &opt) +{ + if (opt.has_value()) + vars.valueType = opt.value(); + return *this; +} diff --git a/src/GNDStk/BlockData/src/print.hpp b/src/GNDStk/BlockData/src/print.hpp new file mode 100644 index 000000000..55cbd7521 --- /dev/null +++ b/src/GNDStk/BlockData/src/print.hpp @@ -0,0 +1,92 @@ + +// ----------------------------------------------------------------------------- +// print +// Used by Component's prettyprinting. +// ----------------------------------------------------------------------------- + +std::ostream &print(std::ostream &os, const int level) const +{ + try { + + // If empty, don't even print a newline + if ((active() == Active::string && rawstring == "") || + (active() == Active::vector && size() == 0)) + return os; + + // ------------------------ + // If string is active + // ------------------------ + + if (active() == Active::string) { + // Print the string exactly as-is, without column formatting + // or any indentation; then also print a newline + return GNDStk::colors && color::data::string != "" + ? os << color::data::string << rawstring << color::reset + << std::endl + : os << rawstring << std::endl; + } + + // ------------------------ + // If vector is active + // ------------------------ + + // Coloring? + const bool coloring = GNDStk::colors && color::data::vector != ""; + + // Indentation (string, with some number of spaces) + const std::string indent(GNDStk::indent*level,' '); + + const auto printLambda = + [&os,&indent,coloring](auto &&alt) + { + using T = std::decay_t; + const size_t size = alt.size(); + const size_t end = (GNDStk::elements < 0) + ? size + : std::min(size,size_t(GNDStk::elements)); + + // Print, using column formatting + for (size_t i = 0; i < end; ++i) { + const T &element = alt[i]; + + // value's whitespace prefix + i == 0 + ? os << indent // at the very beginning, or... + : GNDStk::columns <= 0 || + i % size_t(GNDStk::columns) != 0 + ? os << ' ' // still on the current line, or... + : os << '\n' << indent; // starting the next line + + // value + using namespace detail; + if (coloring) os << color::data::vector; + if constexpr (std::is_floating_point_v) + os << Precision{}.write(element); + else + os << element; + if (coloring) os << color::reset; + }; + + // If applicable, print a message saying the data were truncated + if (end < size) { + if (end > 0) + os << '\n'; + os << indent << detail::colorize_comment( + "truncated; actual #elements == " + std::to_string(size), + color::data::vector + ); + } + }; + + if constexpr (runtime) + std::visit(printLambda,variant); + else + printLambda(vector); + + return os << std::endl; + + } catch (...) { + log::member("BlockData.print()"); + throw; + } +} diff --git a/src/GNDStk/BlockData/src/string.hpp b/src/GNDStk/BlockData/src/string.hpp new file mode 100644 index 000000000..7b40d34e3 --- /dev/null +++ b/src/GNDStk/BlockData/src/string.hpp @@ -0,0 +1,25 @@ + +// ----------------------------------------------------------------------------- +// Getters and setters for the raw string +// ----------------------------------------------------------------------------- + +// getter +// string() +// Not to be confused with strings() (plural), which returns vector. +// Returns const &; the raw string can be *changed* only through the setter. +const std::string &string() const +{ + return rawstring; +} + +// setter +// string(new string) +// Builder pattern: return *this, so callers can use this function smoothly +// in conjunction with the setters for length, start, and valueType. +BlockData &string(const std::string &str) +{ + clear(); // <== the vector, because it's no longer considered meaningful + rawstring = str; + act = Active::string; + return *this; +} diff --git a/src/GNDStk/BlockData/src/sync.hpp b/src/GNDStk/BlockData/src/sync.hpp new file mode 100644 index 000000000..f73166935 --- /dev/null +++ b/src/GNDStk/BlockData/src/sync.hpp @@ -0,0 +1,22 @@ + +// pullFromDerived(derived) +// Make this BlockData's length, start, and valueType be consistent with any or +// all such parameters that exist in the given object. Remember that this class, +// BlockData, is a base of Component, which is a base of some other class. +template +void pullFromDerived(const DERIVED &derived) +{ + length (derived.length ()); + start (derived.start ()); + valueType(derived.valueType()); +} + +// pushToDerived(derived) +// The reverse of the above. +template +void pushToDerived(DERIVED &derived) const +{ + derived.length () = length (); + derived.start () = start (); + derived.valueType() = valueType(); +} diff --git a/src/GNDStk/BlockData/src/toNode.hpp b/src/GNDStk/BlockData/src/toNode.hpp new file mode 100644 index 000000000..074556449 --- /dev/null +++ b/src/GNDStk/BlockData/src/toNode.hpp @@ -0,0 +1,91 @@ + +// ----------------------------------------------------------------------------- +// BlockData::toNode +// This is called by Component's conversion-to-Node (not toNode()) function. +// It's "toNode()" here, not a conversion, because we're simply writing text +// that Component's full conversion-to-Node will place into the Node itself. +// ----------------------------------------------------------------------------- + +// Use either (1) the original raw string, or (2) either the variant of vectors +// or the vector (depending on DATATYPE ==/!= void), based on whether or not the +// raw string is active. If a vector (not the raw string) is active, then we'll +// also compute length, start, and valueType. +void toNode(std::string &text) const +{ + // Use the raw string? + if (active() == Active::string) { + text = rawstring; + return; + } + + // Use the vector... + const bool isStringVector = + ( runtime && std::holds_alternative>(variant)) || + (!runtime && std::is_same_v); + + if constexpr ( + runtime || + (!runtime && std::is_same_v) + ) { + // the runtime if's get() calls below won't + // necessarily make sense without the above if-constexpr + if (isStringVector && !trim && + // only bother with the warning if trim would make a difference... + size() > 0 && + (get(0) == "" || get(size()-1) == "") + ) { + log::warning( + "BlockData.toNode() called with BlockData " + "trim flag == false, but active\n" + "data are in a vector. Printing " + "leading/trailing empty strings\n" + "won't preserve them, so we'll treat as if trim == true." + ); + } + } + + // Re: leading/trailing 0s + const auto bounds = + trim || isStringVector + ? runtime + ? std::visit([](auto &&vec) { return detail::getBounds(vec); }, variant) + : detail::getBounds(vector) + : std::make_pair(size_t(0),size()); + + // Compute length, start, and valueType + vars.length = size(); // independent of trim + vars.start = bounds.first; // dependent on trim, per the bounds computation + if constexpr (runtime) + vars.valueType = detail::visitType2Names(variant); + else + vars.valueType = detail::Type2Names::value[0]; + + // Values + std::ostringstream oss; + + const auto toNodeLambda = + [bounds,&oss](auto &&vec) + { + using T = std::decay_t; + size_t count = 0; + + for (size_t i = bounds.first; i < bounds.second; ++i) { + oss << (count++ ? " " : ""); + if constexpr (std::is_floating_point_v) { + oss << detail::Precision< + detail::PrecisionContext::data, + T + >{}.write(vec[i]); + } else { + oss << vec[i]; + } + } + }; + + if constexpr (runtime) + std::visit(toNodeLambda,variant); + else + toNodeLambda(vector); + + text = oss.str(); +} diff --git a/src/GNDStk/BodyText/src/types.hpp b/src/GNDStk/BlockData/src/types.hpp similarity index 96% rename from src/GNDStk/BodyText/src/types.hpp rename to src/GNDStk/BlockData/src/types.hpp index 3eca8c0e1..46f7c3502 100644 --- a/src/GNDStk/BodyText/src/types.hpp +++ b/src/GNDStk/BlockData/src/types.hpp @@ -21,7 +21,7 @@ using VariantOfVectors = std::variant< // unsigned integrals std::vector, std::vector, - std::vector, + std::vector, std::vector, std::vector, diff --git a/src/GNDStk/BlockData/test/BlockData.test.cpp b/src/GNDStk/BlockData/test/BlockData.test.cpp new file mode 100644 index 000000000..ab5c35d60 --- /dev/null +++ b/src/GNDStk/BlockData/test/BlockData.test.cpp @@ -0,0 +1,192 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDStk.hpp" + +using namespace njoy::GNDStk; + + +// ----------------------------------------------------------------------------- +// Scenario for DATATYPE == void +// ----------------------------------------------------------------------------- + +SCENARIO("Testing GNDStk BlockData with DATATYPE == void") { + // Most BlockData functionality is tested in the individual test files. + // There are just a few things we'll do here. + + // Ensure that we can make const and non-const and BlockData + // objects. Note that BlockData has only a default constructor. + + GIVEN("A const BlockData cbtextt") { + const BlockData cbtextt; + THEN("It constructed correctly, and its data are as expected") { + CHECK(cbtextt.length () == 0); + CHECK(cbtextt.size () == 0); + CHECK(cbtextt.valueType() == ""); + CHECK(cbtextt.string () == ""); + } + } + + GIVEN("A const BlockData cbtextf") { + const BlockData cbtextf; + THEN("It constructed correctly") { + // no data for + } + } + + GIVEN("A non-const BlockData nbtextt") { + BlockData nbtextt; + THEN("It constructed correctly, and its data are as expected") { + CHECK(nbtextt.length () == 0); + CHECK(nbtextt.size () == 0); + CHECK(nbtextt.valueType() == ""); + CHECK(nbtextt.string () == ""); + } + } + + GIVEN("A non-const BlockData nbtextf") { + BlockData nbtextf; + THEN("It constructed correctly") { + // no data for + } + } + + // clear() and size() are defined (at the time of this writing) in the + // BlockData.hpp file itself, so we'll test them here. size() actually + // was used in various tests, and thus was indirectly tested elsewhere. + + GIVEN("A BlockData") { + // clear + WHEN("We test clear()") { + BlockData b; + + // try int + THEN("size() works correctly for vector") { + b = std::vector{1,2,3,4,5}; + CHECK(b.size() == 5); + b.clear(); + CHECK(b.size() == 0); + } + + // try double + THEN("size() works correctly for vector") { + b = std::vector{1.1, 2.2, 3.3, 4.4, 5.5}; + CHECK(b.size() == 5); + b.clear(); + CHECK(b.size() == 0); + } + + // try string + THEN("size() works correctly for vector") { + b = std::vector{"one","two","three","four","five"}; + CHECK(b.size() == 5); + b.clear(); + CHECK(b.size() == 0); + } + } + + // size + WHEN("We test size()") { + BlockData b; + + // try int + THEN("size() works correctly for vector") { + b = std::vector{1,2,3,4,5}; + CHECK(b.size() == 5); + b = std::vector{1}; + CHECK(b.size() == 1); + b = std::vector{}; + CHECK(b.size() == 0); + } + + // try double + THEN("size() works correctly for vector") { + b = std::vector{1.1, 2.2, 3.3, 4.4, 5.5}; + CHECK(b.size() == 5); + b = std::vector{1.1}; + CHECK(b.size() == 1); + b = std::vector{}; + CHECK(b.size() == 0); + } + + // try string + THEN("size() works correctly for vector") { + b = std::vector{"one","two","three","four","five"}; + CHECK(b.size() == 5); + b = std::vector{"one"}; + CHECK(b.size() == 1); + b = std::vector{}; + CHECK(b.size() == 0); + } + } + } +} // SCENARIO + + +// ----------------------------------------------------------------------------- +// Scenario for DATATYPE != void +// ----------------------------------------------------------------------------- + +SCENARIO("Testing GNDStk BlockData with DATATYPE != void") { + + GIVEN("A const BlockData cbtextt") { + const BlockData cbtextt; + THEN("It constructed correctly, and its data are as expected") { + CHECK(cbtextt.length () == 0); + CHECK(cbtextt.size () == 0); + CHECK(cbtextt.valueType() == ""); + CHECK(cbtextt.string () == ""); + } + } + + GIVEN("A const BlockData cbtextf") { + const BlockData cbtextf; + THEN("It constructed correctly") { + // no data for + } + } + + GIVEN("A non-const BlockData nbtextt") { + BlockData nbtextt; + THEN("It constructed correctly, and its data are as expected") { + CHECK(nbtextt.length () == 0); + CHECK(nbtextt.size () == 0); + CHECK(nbtextt.valueType() == ""); + CHECK(nbtextt.string () == ""); + } + } + + GIVEN("A non-const BlockData nbtextf") { + BlockData nbtextf; + THEN("It constructed correctly") { + // no data for + } + } + + GIVEN("A BlockData") { + // clear + WHEN("We test clear()") { + BlockData b; + THEN("size() works correctly") { + b = std::vector{1,2,3,4,5}; + CHECK(b.size() == 5); + b.clear(); + CHECK(b.size() == 0); + } + } + + // size + WHEN("We test size()") { + BlockData b; + THEN("size() works correctly") { + b = std::vector{"one","two","three","four","five"}; + CHECK(b.size() == 5); + b = std::vector{"one"}; + CHECK(b.size() == 1); + b = std::vector{}; + CHECK(b.size() == 0); + } + } + } +} // SCENARIO diff --git a/src/GNDStk/BlockData/test/CMakeLists.txt b/src/GNDStk/BlockData/test/CMakeLists.txt new file mode 100644 index 000000000..3adff35bc --- /dev/null +++ b/src/GNDStk/BlockData/test/CMakeLists.txt @@ -0,0 +1,29 @@ + +add_executable( + GNDStk.BlockData.test + BlockData.test.cpp + assign.test.cpp + convert.test.cpp + detail.test.cpp + fromNode.test.cpp + get.test.cpp + params.test.cpp + string.test.cpp + sync.test.cpp + toNode.test.cpp + types.test.cpp + print.test.cpp +) + +target_compile_options( GNDStk.BlockData.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.BlockData.test PUBLIC GNDStk ) +add_test( NAME GNDStk.BlockData COMMAND GNDStk.BlockData.test ) diff --git a/src/GNDStk/BodyText/test/assign.test.cpp b/src/GNDStk/BlockData/test/assign.test.cpp similarity index 88% rename from src/GNDStk/BodyText/test/assign.test.cpp rename to src/GNDStk/BlockData/test/assign.test.cpp index 7326ae81d..8da3e023f 100644 --- a/src/GNDStk/BodyText/test/assign.test.cpp +++ b/src/GNDStk/BlockData/test/assign.test.cpp @@ -2,20 +2,20 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; // ----------------------------------------------------------------------------- -// Scenario for DATA == void +// Scenario for DATATYPE == void // ----------------------------------------------------------------------------- -SCENARIO("BodyText assignment operators") { - GIVEN("A default-constructed BodyText object") { +SCENARIO("BlockData assignment operators") { + GIVEN("A default-constructed BlockData object") { // Default value of raw string is as expected WHEN("We examine the raw string") { THEN("It is as expected") { - BodyText b; + BlockData b; CHECK(b.string() == ""); } } @@ -23,7 +23,7 @@ SCENARIO("BodyText assignment operators") { // Assignment from string works WHEN("We assign from a string") { THEN("The raw string has the correct value, and vector size() == 0") { - BodyText b; + BlockData b; // to ensure it clears the vector below... b = std::vector(10); @@ -40,7 +40,7 @@ SCENARIO("BodyText assignment operators") { // Assignment from vector works WHEN("We assign from a vector") { THEN("The variant has the correct value, and raw string == \"\"") { - BodyText b; + BlockData b; // to ensure it clears the raw string etc. below... b = "foo bar"; @@ -70,7 +70,7 @@ SCENARIO("BodyText assignment operators") { // Assign from vector; should set valueType WHEN("We assign from a vector") { THEN("valueType is set correctly") { - BodyText b; + BlockData b; b.string("foo").valueType("unknown"); CHECK(b.valueType() == "unknown"); @@ -83,7 +83,7 @@ SCENARIO("BodyText assignment operators") { // Assign from vector; should set valueType WHEN("We assign from a vector") { THEN("valueType is set correctly") { - BodyText b; + BlockData b; b.string("foo").valueType("unknown"); CHECK(b.valueType() == "unknown"); @@ -96,7 +96,7 @@ SCENARIO("BodyText assignment operators") { // For now, non-{int,double} sets valueType == "" WHEN("We assign from a vector") { THEN("valueType is set correctly") { - BodyText b; + BlockData b; b.string("foo").valueType("unknown"); CHECK(b.valueType() == "unknown"); @@ -111,16 +111,16 @@ SCENARIO("BodyText assignment operators") { // ----------------------------------------------------------------------------- -// Scenario for DATA != void +// Scenario for DATATYPE != void // ----------------------------------------------------------------------------- -SCENARIO("BodyText assignment operators") { - GIVEN("A default-constructed BodyText object") { +SCENARIO("BlockData assignment operators") { + GIVEN("A default-constructed BlockData object") { // Default value of raw string is as expected WHEN("We examine the raw string") { THEN("It is as expected") { - BodyText b; + BlockData b; CHECK(b.string() == ""); } } @@ -128,7 +128,7 @@ SCENARIO("BodyText assignment operators") { // Assignment from string works WHEN("We assign from a string") { THEN("The raw string has the correct value, and vector size() == 0") { - BodyText b; + BlockData b; // to ensure it clears the vector below... b = std::vector(10); @@ -145,7 +145,7 @@ SCENARIO("BodyText assignment operators") { // Assignment from vector works WHEN("We assign from a vector") { THEN("The vector has the correct value, and raw string == \"\"") { - BodyText b; + BlockData b; // to ensure it clears the raw string etc. below... b = "foo bar"; @@ -175,7 +175,7 @@ SCENARIO("BodyText assignment operators") { // Assign from vector; should set valueType WHEN("We assign from a vector") { THEN("valueType is set correctly") { - BodyText b; + BlockData b; b.string("foo").valueType("unknown"); CHECK(b.valueType() == "unknown"); @@ -188,7 +188,7 @@ SCENARIO("BodyText assignment operators") { // Assign from vector; should set valueType WHEN("We assign from a vector") { THEN("valueType is set correctly") { - BodyText b; + BlockData b; b.string("foo").valueType("unknown"); CHECK(b.valueType() == "unknown"); @@ -201,7 +201,7 @@ SCENARIO("BodyText assignment operators") { // For now, non-{int,double} sets valueType == "" WHEN("We assign from a vector") { THEN("valueType is set correctly") { - BodyText b; + BlockData b; b.string("foo").valueType("unknown"); CHECK(b.valueType() == "unknown"); diff --git a/src/GNDStk/BlockData/test/convert.test.cpp b/src/GNDStk/BlockData/test/convert.test.cpp new file mode 100644 index 000000000..b41c3848c --- /dev/null +++ b/src/GNDStk/BlockData/test/convert.test.cpp @@ -0,0 +1,53 @@ + +#include "catch.hpp" +#include "GNDStk.hpp" + +using namespace njoy::GNDStk; + +SCENARIO("BlockData conversion to vector") { + GIVEN("A BlockData object") { + + { + using T = int; + BlockData b; + b.start(2).length(6).string("-12 34 -56"); + std::vector myVector = b; + CHECK(myVector.size() == 6); + CHECK(myVector[0] == 0); + CHECK(myVector[1] == 0); + CHECK(myVector[2] == -12); + CHECK(myVector[3] == 34); + CHECK(myVector[4] == -56); + CHECK(myVector[5] == 0); + } + + { + using T = double; + BlockData b; + b.start(2).length(6).string("1.2 3.4 5.6"); + std::vector myVector = b; + CHECK(myVector.size() == 6); + CHECK(myVector[0] == 0); + CHECK(myVector[1] == 0); + CHECK(myVector[2] == 1.2); + CHECK(myVector[3] == 3.4); + CHECK(myVector[4] == 5.6); + CHECK(myVector[5] == 0); + } + + { + using T = std::string; + BlockData b; + b.start(2).length(6).string("ab cd ef"); + std::vector myVector = b; + CHECK(myVector.size() == 6); + CHECK(myVector[0] == ""); + CHECK(myVector[1] == ""); + CHECK(myVector[2] == "ab"); + CHECK(myVector[3] == "cd"); + CHECK(myVector[4] == "ef"); + CHECK(myVector[5] == ""); + } + + } // GIVEN +} // SCENARIO diff --git a/src/GNDStk/BlockData/test/detail.test.cpp b/src/GNDStk/BlockData/test/detail.test.cpp new file mode 100644 index 000000000..c1df565b6 --- /dev/null +++ b/src/GNDStk/BlockData/test/detail.test.cpp @@ -0,0 +1,286 @@ + +#include "catch.hpp" +#include "GNDStk.hpp" + +using namespace njoy::GNDStk; +inline std::string bar = "bar"; + +// ----------------------------------------------------------------------------- +// Scenario +// ----------------------------------------------------------------------------- + +SCENARIO("Testing various BlockData-related detail:: constructs") { + + // ------------------------ + // scalarize + // ------------------------ + + GIVEN("Some variants of vectors") { + using vc = std::variant< + std::vector + >; + using vci = std::variant< + std::vector, + std::vector + >; + using vcid = std::variant< + std::vector, + std::vector, + std::vector + >; + + // Double parenthesis are needed for the CHECK macro, + // because of the commas... + THEN("detail::scalarize() works correctly") { + CHECK(( + std::is_same_v< + decltype(detail::scalarize(vc{})), + std::variant + > + )); + CHECK(( + std::is_same_v< + decltype(detail::scalarize(vci{})), + std::variant + > + )); + CHECK(( + std::is_same_v< + decltype(detail::scalarize(vcid{})), + std::variant + > + )); + } + } // GIVEN + + + // ------------------------ + // element2element + // ------------------------ + + GIVEN("Testing detail::element2element") { + WHEN("We use element2element(from int, to string)") { + const int from = 123; + std::string to; + detail::element2element(from,to); + CHECK(to == "123"); + } + + WHEN("We use element2element(from double, to string)") { + const double from = 4.56; + std::string to; + detail::element2element(from,to); + CHECK(to == "4.56"); + } + + WHEN("We use element2element(from string, to int)") { + const std::string from = "987"; + int to; + detail::element2element(from,to); + CHECK(to == 987); + } + + WHEN("We use element2element(from string, to double)") { + const std::string from = "6.54"; + double to; + detail::element2element(from,to); + CHECK(Approx(to) == 6.54); + } + + WHEN("We use element2element(from int, to double)") { + const int from = 345; + double to; + detail::element2element(from,to); + CHECK(to == double(345)); + } + + WHEN("We use element2element(from double, to int)") { + const double from = 6.78; + int to; + detail::element2element(from,to); + CHECK(to == 6); + } + } + + + // ------------------------ + // getBounds + // ------------------------ + + GIVEN("Testing detail::getBounds") { + + // ------------------------ + // Various vectors + // ------------------------ + + WHEN("We try vectors of varying sizes") { + + THEN("Bounds are correct when size == 0") { + std::vector v = {}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 0); + CHECK(bounds.second == 0); + } + + THEN("Bounds are correct when size == 1, with a 0") { + std::vector v = {0}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 1); + CHECK(bounds.second == 1); + } + + THEN("Bounds are correct when size == 2, all 0") { + std::vector v = {0, 0}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 2); + CHECK(bounds.second == 2); + } + + THEN("Bounds are correct when size == 3, all non-0") { + std::vector v = {2, 3, 5}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 0); + CHECK(bounds.second == 3); + } + + THEN("Bounds are correct when there are trailing 0s") { + std::vector v = {2, 3, 5, 0, 0, 0}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 0); + CHECK(bounds.second == 3); + } + + THEN("Bounds are correct when there are leading 0s") { + std::vector v = {0, 0, 2, 3, 5}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 2); + CHECK(bounds.second == 5); + } + + THEN("Bounds are correct when there are leading and trailing 0s") { + std::vector v = {0, 0, 2, 3, 5, 0, 0, 0}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 2); + CHECK(bounds.second == 5); + } + + } // WHEN + + + // ------------------------ + // Various vectors + // ------------------------ + + WHEN("We try vectors of varying sizes") { + + THEN("Bounds are correct when size == 0") { + std::vector v = {}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 0); + CHECK(bounds.second == 0); + } + + THEN("Bounds are correct when size == 1, with a 0") { + std::vector v = {0}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 1); + CHECK(bounds.second == 1); + } + + THEN("Bounds are correct when size == 3, all 0") { + std::vector v = {0, 0, 0}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 3); + CHECK(bounds.second == 3); + } + + THEN("Bounds are correct when size == 3, all non-0") { + std::vector v = {1.2, 3.4, 5.6}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 0); + CHECK(bounds.second == 3); + } + + THEN("Bounds are correct when there are trailing 0s") { + std::vector v = {1.2, 3.4, 5.6, 0, 0}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 0); + CHECK(bounds.second == 3); + } + + THEN("Bounds are correct when there are leading 0s") { + std::vector v = {0, 0, 0, 1.2, 3.4, 5.6}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 3); + CHECK(bounds.second == 6); + } + + THEN("Bounds are correct when there are leading and trailing 0s") { + std::vector v = {0, 0, 0, 1.2, 3.4, 5.6, 0, 0}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 3); + CHECK(bounds.second == 6); + } + + } + + + // ------------------------ + // Various vectors + // ------------------------ + + WHEN("We try vectors of varying sizes") { + + THEN("Bounds are correct when size == 0") { + std::vector v = {}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 0); + CHECK(bounds.second == 0); + } + + THEN("Bounds are correct when size == 1, with a \"\"") { + std::vector v = {""}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 1); + CHECK(bounds.second == 1); + } + + THEN("Bounds are correct when size == 2, all \"\"") { + std::vector v = {"", ""}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 2); + CHECK(bounds.second == 2); + } + + THEN("Bounds are correct when size == 2, all non-\"\"") { + std::vector v = {"abc", "def"}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 0); + CHECK(bounds.second == 2); + } + + THEN("Bounds are correct when there are trailing \"\"s") { + std::vector v = {"abc", "def", "", "", ""}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 0); + CHECK(bounds.second == 2); + } + + THEN("Bounds are correct when there are leading \"\"s") { + std::vector v = {"", "", "abc", "def"}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 2); + CHECK(bounds.second == 4); + } + + THEN("Bounds are correct when there are leading and trailing \"\"s") { + std::vector v = {"", "", "abc", "def", "", "", ""}; + const auto bounds = detail::getBounds(v); + CHECK(bounds.first == 2); + CHECK(bounds.second == 4); + } + + } // WHEN + } // GIVEN + +} // SCENARIO diff --git a/src/GNDStk/BlockData/test/fromNode.test.cpp b/src/GNDStk/BlockData/test/fromNode.test.cpp new file mode 100644 index 000000000..695fdc378 --- /dev/null +++ b/src/GNDStk/BlockData/test/fromNode.test.cpp @@ -0,0 +1,115 @@ + +#include "catch.hpp" +#include "GNDStk.hpp" + +using namespace njoy::GNDStk; + + +// ----------------------------------------------------------------------------- +// Scenario for DATATYPE == void +// ----------------------------------------------------------------------------- + +SCENARIO("BlockData fromNode()") { + + GIVEN("A Node with no \"block data\"") { + WHEN("BlockData.fromNode(the node) is called") { + THEN("The BlockData's raw string is \"\", as expected") { + BlockData b; + b.string("This string should be replaced"); + CHECK(b.string() != ""); + + Node node; + node << ""; + b.fromNode(node); + CHECK(b.string() == ""); + } + } + } + + GIVEN("A Node with some \"block data\"") { + WHEN("BlockData.fromNode(the node) is called") { + THEN("The BlockData's raw string equals the text from the Node") { + BlockData b; + b.string("This string should be replaced"); + CHECK(b.string() != ""); + + Node node; + + node << "some plain character data"; + b.fromNode(node); + CHECK(b.string() == "some plain character data"); + + // it shouldn't matter, but leading spaces are preserved + node << " data with leading spaces"; + b.fromNode(node); + CHECK(b.string() == " data with leading spaces"); + + // ditto for trailing spaces + node << "data with trailing spaces "; + b.fromNode(node); + CHECK(b.string() == "data with trailing spaces "); + + // ditto for both together + node << " data "; + b.fromNode(node); + CHECK(b.string() == " data "); + } + } + } + +} // SCENARIO + + +// ----------------------------------------------------------------------------- +// Scenario for DATATYPE != void +// ----------------------------------------------------------------------------- + +SCENARIO("BlockData fromNode()") { + + GIVEN("A Node with no \"block data\"") { + WHEN("BlockData.fromNode(the node) is called") { + THEN("The BlockData's raw string is \"\", as expected") { + BlockData b; + b.string("This string should be replaced"); + CHECK(b.string() != ""); + + Node node; + node << ""; + b.fromNode(node); + CHECK(b.string() == ""); + } + } + } + + GIVEN("A Node with some \"block data\"") { + WHEN("BlockData.fromNode(the node) is called") { + THEN("The BlockData's raw string equals the text from the Node") { + BlockData b; + b.string("This string should be replaced"); + CHECK(b.string() != ""); + + Node node; + + node << "some plain character data"; + b.fromNode(node); + CHECK(b.string() == "some plain character data"); + + // it shouldn't matter, but leading spaces are preserved + node << " data with leading spaces"; + b.fromNode(node); + CHECK(b.string() == " data with leading spaces"); + + // ditto for trailing spaces + node << "data with trailing spaces "; + b.fromNode(node); + CHECK(b.string() == "data with trailing spaces "); + + // ditto for both together + node << " data "; + b.fromNode(node); + CHECK(b.string() == " data "); + } + } + } + +} // SCENARIO diff --git a/src/GNDStk/BlockData/test/get.test.cpp b/src/GNDStk/BlockData/test/get.test.cpp new file mode 100644 index 000000000..375a4d0f3 --- /dev/null +++ b/src/GNDStk/BlockData/test/get.test.cpp @@ -0,0 +1,695 @@ + +#include "catch.hpp" +#include "GNDStk.hpp" + +using namespace njoy::GNDStk; + + + +// ----------------------------------------------------------------------------- +// 1. Scenario: get() +// ----------------------------------------------------------------------------- + +// Helper +template +void scenario_get_vector() +{ + // We'll deal with these vector types for the test. They should cover + // sufficient cases (int, double, string, and none of the above) + // that we get good coverage, without this test being excessively long. + using ivec = std::vector; + using fvec = std::vector; + using svec = std::vector; + using uvec = std::vector; + + // We'll leave valueType at its default of "", which is compatible with + // every possible get type T. This simply means we won't get spammed + // with warnings about the asked-for T possibly being incompatible with + // valueType. Either way - with or without a "" for valueType - get + // gives us back a vector. + + // ------------------------ + // vector + // ------------------------ + + // 0 elements in string + { BlockData b; b.start(0).length(0).string(""); + CHECK((b.template get() == ivec{})); } + { BlockData b; b.start(0).length(4).string(""); + CHECK((b.template get() == ivec{{0,0,0,0}})); } + { BlockData b; b.start(1).length(5).string(""); + CHECK((b.template get() == ivec{{0,0,0,0,0}})); } + { BlockData b; b.start(2).length(6).string(""); + CHECK((b.template get() == ivec{{0,0,0,0,0,0}})); } + + // 1 element in string + { BlockData b; b.start(0).length(0).string("-12"); + CHECK((b.template get() == ivec(1,-12))); } + { BlockData b; b.start(0).length(4).string("-12"); + CHECK((b.template get() == ivec{{-12,0,0,0}})); } + { BlockData b; b.start(1).length(5).string("-12"); + CHECK((b.template get() == ivec{{0,-12,0,0,0}})); } + { BlockData b; b.start(2).length(6).string("-12"); + CHECK((b.template get() == ivec{{0,0,-12,0,0,0}})); } + + // 3 elements in string + { BlockData b; b.start(0).length(0).string("-12 34 -56"); + CHECK((b.template get() == ivec{{-12,34,-56}})); } + { BlockData b; b.start(0).length(4).string("-12 34 -56"); + CHECK((b.template get() == ivec{{-12,34,-56,0}})); } + { BlockData b; b.start(1).length(5).string("-12 34 -56"); + CHECK((b.template get() == ivec{{0,-12,34,-56,0}})); } + { BlockData b; b.start(2).length(6).string("-12 34 -56"); + CHECK((b.template get() == ivec{{0,0,-12,34,-56,0}})); } + + // ------------------------ + // vector + // ------------------------ + + // 0 elements in string + { BlockData b; b.start(0).length(0).string(""); + CHECK((b.template get() == fvec{})); } + { BlockData b; b.start(0).length(4).string(""); + CHECK((b.template get() == fvec{{0,0,0,0}})); } + { BlockData b; b.start(1).length(5).string(""); + CHECK((b.template get() == fvec{{0,0,0,0,0}})); } + { BlockData b; b.start(2).length(6).string(""); + CHECK((b.template get() == fvec{{0,0,0,0,0,0}})); } + + // 1 element in string + { BlockData b; b.start(0).length(0).string("1.2"); + CHECK((b.template get() == fvec(1,1.2))); } + { BlockData b; b.start(0).length(4).string("1.2"); + CHECK((b.template get() == fvec{{1.2,0,0,0}})); } + { BlockData b; b.start(1).length(5).string("1.2"); + CHECK((b.template get() == fvec{{0,1.2,0,0,0}})); } + { BlockData b; b.start(2).length(6).string("1.2"); + CHECK((b.template get() == fvec{{0,0,1.2,0,0,0}})); } + + // 3 elements in string + { BlockData b; b.start(0).length(0).string("1.2 3.4 5.6"); + CHECK((b.template get() == fvec{{1.2,3.4,5.6}})); } + { BlockData b; b.start(0).length(4).string("1.2 3.4 5.6"); + CHECK((b.template get() == fvec{{1.2,3.4,5.6,0}})); } + { BlockData b; b.start(1).length(5).string("1.2 3.4 5.6"); + CHECK((b.template get() == fvec{{0,1.2,3.4,5.6,0}})); } + { BlockData b; b.start(2).length(6).string("1.2 3.4 5.6"); + CHECK((b.template get() == fvec{{0,0,1.2,3.4,5.6,0}})); } + + // ------------------------ + // vector + // ------------------------ + + // 0 elements in string + { BlockData b; b.start(0).length(0).string(""); + CHECK((b.template get() == svec{})); } + { BlockData b; b.start(0).length(4).string(""); + CHECK((b.template get() == svec{{"","","",""}})); } + { BlockData b; b.start(1).length(5).string(""); + CHECK((b.template get() == svec{{"","","","",""}})); } + { BlockData b; b.start(2).length(6).string(""); + CHECK((b.template get() == svec{{"","","","","",""}})); } + + // 1 element in string + { BlockData b; b.start(0).length(0).string("ab"); + CHECK((b.template get() == svec(1,"ab"))); } + { BlockData b; b.start(0).length(4).string("ab"); + CHECK((b.template get() == svec{{"ab","","",""}})); } + { BlockData b; b.start(1).length(5).string("ab"); + CHECK((b.template get() == svec{{"","ab","","",""}})); } + { BlockData b; b.start(2).length(6).string("ab"); + CHECK((b.template get() == svec{{"","","ab","","",""}})); } + + // 3 elements in string + { BlockData b; b.start(0).length(0).string("ab cd ef"); + CHECK((b.template get() == svec{{"ab","cd","ef"}})); } + { BlockData b; b.start(0).length(4).string("ab cd ef"); + CHECK((b.template get() == svec{{"ab","cd","ef",""}})); } + { BlockData b; b.start(1).length(5).string("ab cd ef"); + CHECK((b.template get() == svec{{"","ab","cd","ef",""}})); } + { BlockData b; b.start(2).length(6).string("ab cd ef"); + CHECK((b.template get() == svec{{"","","ab","cd","ef",""}})); } + + // ------------------------ + // vector + // ------------------------ + + // 0 elements in string + { BlockData b; b.start(0).length(0).string(""); + CHECK((b.template get() == uvec{})); } + { BlockData b; b.start(0).length(4).string(""); + CHECK((b.template get() == uvec{{0,0,0,0}})); } + { BlockData b; b.start(1).length(5).string(""); + CHECK((b.template get() == uvec{{0,0,0,0,0}})); } + { BlockData b; b.start(2).length(6).string(""); + CHECK((b.template get() == uvec{{0,0,0,0,0,0}})); } + + // 1 element in string + { BlockData b; b.start(0).length(0).string("12"); + CHECK((b.template get() == uvec(1,12))); } + { BlockData b; b.start(0).length(4).string("12"); + CHECK((b.template get() == uvec{{12,0,0,0}})); } + { BlockData b; b.start(1).length(5).string("12"); + CHECK((b.template get() == uvec{{0,12,0,0,0}})); } + { BlockData b; b.start(2).length(6).string("12"); + CHECK((b.template get() == uvec{{0,0,12,0,0,0}})); } + + // 3 elements in string + { BlockData b; b.start(0).length(0).string("12 34 56"); + CHECK((b.template get() == uvec{{12,34,56}})); } + { BlockData b; b.start(0).length(4).string("12 34 56"); + CHECK((b.template get() == uvec{{12,34,56,0}})); } + { BlockData b; b.start(1).length(5).string("12 34 56"); + CHECK((b.template get() == uvec{{0,12,34,56,0}})); } + { BlockData b; b.start(2).length(6).string("12 34 56"); + CHECK((b.template get() == uvec{{0,0,12,34,56,0}})); } +} + +// For BlockData +SCENARIO("BlockData get()") { + GIVEN("A BlockData object") { + scenario_get_vector(); + } +} + +// For BlockData +SCENARIO("BlockData get()") { + GIVEN("A BlockData object") { + scenario_get_vector(); + } +} + + + +// ----------------------------------------------------------------------------- +// 2. Scenario: get(n) +// ----------------------------------------------------------------------------- + +// Helper +template +void scenario_get_template_n() +{ + // ------------------------ + // vector + // ------------------------ + + // 0 elements in string + { BlockData b; b.start(0).length(0).string(""); } + { BlockData b; b.start(0).length(4).string(""); + CHECK(b.template get(1) == 0); } + { BlockData b; b.start(1).length(5).string(""); + CHECK(b.template get(2) == 0); } + { BlockData b; b.start(2).length(6).string(""); + CHECK(b.template get(3) == 0); } + + // 1 element in string + { BlockData b; b.start(0).length(0).string("-12"); + CHECK(b.template get(0) == -12); } + { BlockData b; b.start(0).length(4).string("-12"); + CHECK(b.template get(1) == 0); } + { BlockData b; b.start(1).length(5).string("-12"); + CHECK(b.template get(2) == 0); } + { BlockData b; b.start(2).length(6).string("-12"); + CHECK(b.template get(3) == 0); } + + // 3 elements in string + { BlockData b; b.start(0).length(0).string("-12 34 -56"); + CHECK(b.template get(0) == -12); } + { BlockData b; b.start(0).length(4).string("-12 34 -56"); + CHECK(b.template get(1) == 34); } + { BlockData b; b.start(1).length(5).string("-12 34 -56"); + CHECK(b.template get(2) == 34); } + { BlockData b; b.start(2).length(6).string("-12 34 -56"); + CHECK(b.template get(3) == 34); } + + // ------------------------ + // vector + // ------------------------ + + // 0 elements in string + { BlockData b; b.start(0).length(0).string(""); } + { BlockData b; b.start(0).length(4).string(""); + CHECK(b.template get(1) == 0); } + { BlockData b; b.start(1).length(5).string(""); + CHECK(b.template get(2) == 0); } + { BlockData b; b.start(2).length(6).string(""); + CHECK(b.template get(3) == 0); } + + // 1 element in string + { BlockData b; b.start(0).length(0).string("1.2"); + CHECK(b.template get(0) == 1.2); } + { BlockData b; b.start(0).length(4).string("1.2"); + CHECK(b.template get(1) == 0); } + { BlockData b; b.start(1).length(5).string("1.2"); + CHECK(b.template get(2) == 0); } + { BlockData b; b.start(2).length(6).string("1.2"); + CHECK(b.template get(3) == 0); } + + // 3 elements in string + { BlockData b; b.start(0).length(0).string("1.2 3.4 5.6"); + CHECK(b.template get(0) == 1.2); } + { BlockData b; b.start(0).length(4).string("1.2 3.4 5.6"); + CHECK(b.template get(1) == 3.4); } + { BlockData b; b.start(1).length(5).string("1.2 3.4 5.6"); + CHECK(b.template get(2) == 3.4); } + { BlockData b; b.start(2).length(6).string("1.2 3.4 5.6"); + CHECK(b.template get(3) == 3.4); } + + // ------------------------ + // vector + // ------------------------ + + // 0 elements in string + { BlockData b; b.start(0).length(0).string(""); } + { BlockData b; b.start(0).length(4).string(""); + CHECK(b.template get(1) == ""); } + { BlockData b; b.start(1).length(5).string(""); + CHECK(b.template get(2) == ""); } + { BlockData b; b.start(2).length(6).string(""); + CHECK(b.template get(3) == ""); } + + // 1 element in string + { BlockData b; b.start(0).length(0).string("ab"); + CHECK(b.template get(0) == "ab"); } + { BlockData b; b.start(0).length(4).string("ab"); + CHECK(b.template get(1) == ""); } + { BlockData b; b.start(1).length(5).string("ab"); + CHECK(b.template get(2) == ""); } + { BlockData b; b.start(2).length(6).string("ab"); + CHECK(b.template get(3) == ""); } + + // 3 elements in string + { BlockData b; b.start(0).length(0).string("ab cd ef"); + CHECK(b.template get(0) == "ab"); } + { BlockData b; b.start(0).length(4).string("ab cd ef"); + CHECK(b.template get(1) == "cd"); } + { BlockData b; b.start(1).length(5).string("ab cd ef"); + CHECK(b.template get(2) == "cd"); } + { BlockData b; b.start(2).length(6).string("ab cd ef"); + CHECK(b.template get(3) == "cd"); } + + // ------------------------ + // vector + // ------------------------ + + // 0 elements in string + { BlockData b; b.start(0).length(0).string(""); } + { BlockData b; b.start(0).length(4).string(""); + CHECK(b.template get(1) == 0); } + { BlockData b; b.start(1).length(5).string(""); + CHECK(b.template get(2) == 0); } + { BlockData b; b.start(2).length(6).string(""); + CHECK(b.template get(3) == 0); } + + // 1 element in string + { BlockData b; b.start(0).length(0).string("12"); + CHECK(b.template get(0) == 12); } + { BlockData b; b.start(0).length(4).string("12"); + CHECK(b.template get(1) == 0); } + { BlockData b; b.start(1).length(5).string("12"); + CHECK(b.template get(2) == 0); } + { BlockData b; b.start(2).length(6).string("12"); + CHECK(b.template get(3) == 0); } + + // 3 elements in string + { BlockData b; b.start(0).length(0).string("12 34 56"); + CHECK(b.template get(0) == 12); } + { BlockData b; b.start(0).length(4).string("12 34 56"); + CHECK(b.template get(1) == 34); } + { BlockData b; b.start(1).length(5).string("12 34 56"); + CHECK(b.template get(2) == 34); } + { BlockData b; b.start(2).length(6).string("12 34 56"); + CHECK(b.template get(3) == 34); } +} + +// For BlockData +SCENARIO("BlockData get(n)") { + GIVEN("A BlockData object") { + scenario_get_template_n(); + } +} + +// For BlockData +SCENARIO("BlockData get(n)") { + GIVEN("A BlockData object") { + scenario_get_template_n(); + } +} + + + +// ----------------------------------------------------------------------------- +// 3. Scenario: get() +// ----------------------------------------------------------------------------- + +// For BlockData +SCENARIO("BlockData get()") { + GIVEN("A BlockData object") { + + using ivec = std::vector; + using fvec = std::vector; + using svec = std::vector; + + BlockData b; + + b.start(2).length(6).string("-12 34 -56"); + b.valueType("Integer32"); + CHECK(( std::holds_alternative(b.get()))); + CHECK((!std::holds_alternative(b.get()))); + CHECK((!std::holds_alternative(b.get()))); + CHECK((std::get(b.get()) == ivec{{0,0,-12,34,-56,0}})); + + b.start(2).length(6).string("1.2 3.4 5.6"); + b.valueType("Float64"); + CHECK((!std::holds_alternative(b.get()))); + CHECK(( std::holds_alternative(b.get()))); + CHECK((!std::holds_alternative(b.get()))); + CHECK((std::get(b.get()) == fvec{{0,0,1.2,3.4,5.6,0}})); + + b.start(2).length(6).string("ab cd ef"); + b.valueType(""); + CHECK((!std::holds_alternative(b.get()))); + CHECK((!std::holds_alternative(b.get()))); + CHECK(( std::holds_alternative(b.get()))); + CHECK((std::get(b.get()) == svec{{"","","ab","cd","ef",""}})); + + } // GIVEN +} // SCENARIO + + +// For BlockData +SCENARIO("BlockData get()") { + GIVEN("A BlockData object") { + + using ivec = std::vector; + using fvec = std::vector; + using svec = std::vector; + + { + BlockData b; + b.start(2).length(6).string("-12 34 -56"); + CHECK((b.get() == ivec{{0,0,-12,34,-56,0}})); + } + + { + BlockData b; + b.start(2).length(6).string("1.2 3.4 5.6"); + CHECK((b.get() == fvec{{0,0,1.2,3.4,5.6,0}})); + } + + { + BlockData b; + b.start(2).length(6).string("ab cd ef"); + CHECK((b.get() == svec{{"","","ab","cd","ef",""}})); + } + + } // GIVEN +} // SCENARIO + + + +// ----------------------------------------------------------------------------- +// 4. Scenario: get(n) +// ----------------------------------------------------------------------------- + +// For BlockData +SCENARIO("BlockData get(n)") { + GIVEN("A BlockData object") { + + BlockData b; + + // ------------------------ + // get(n) form + // ------------------------ + + b.start(2).length(6).string("-12 34 -56"); + b.valueType("Integer32"); + CHECK(( std::holds_alternative(b.get(0)))); + CHECK((!std::holds_alternative(b.get(0)))); + CHECK((!std::holds_alternative(b.get(0)))); + CHECK(( std::get( b.get(0) ) == 0 )); + CHECK(( std::get( b.get(1) ) == 0 )); + CHECK(( std::get( b.get(2) ) == -12 )); + CHECK(( std::get( b.get(3) ) == 34 )); + CHECK(( std::get( b.get(4) ) == -56 )); + CHECK(( std::get( b.get(5) ) == 0 )); + // test type changes (inefficient, but they work)... + CHECK(b.get(2) == -12); + CHECK(b.get(3) == double(34)); + CHECK(b.get(4) == "-56"); + + b.start(2).length(6).string("1.2 3.4 5.6"); + b.valueType("Float64"); + CHECK((!std::holds_alternative(b.get(0)))); + CHECK(( std::holds_alternative(b.get(0)))); + CHECK((!std::holds_alternative(b.get(0)))); + CHECK(( std::get( b.get(0) ) == 0 )); + CHECK(( std::get( b.get(1) ) == 0 )); + CHECK(( std::get( b.get(2) ) == 1.2 )); + CHECK(( std::get( b.get(3) ) == 3.4 )); + CHECK(( std::get( b.get(4) ) == 5.6 )); + CHECK(( std::get( b.get(5) ) == 0 )); + // test type changes... + CHECK(b.get(2) == 1); // truncated from 1.2 + // having converted to vector, the .#s aren't there any longer... + CHECK(b.get(2) == "1"); + CHECK(b.get(3) == 3); + CHECK(b.get(4) == "5"); + + b.start(2).length(8).string("ab cd ef 123 4.5"); + b.valueType(""); + CHECK((!std::holds_alternative(b.get(0)))); + CHECK((!std::holds_alternative(b.get(0)))); + CHECK(( std::holds_alternative(b.get(0)))); + CHECK(( std::get( b.get(0) ) == "" )); + CHECK(( std::get( b.get(1) ) == "" )); + CHECK(( std::get( b.get(2) ) == "ab" )); + CHECK(( std::get( b.get(3) ) == "cd" )); + CHECK(( std::get( b.get(4) ) == "ef" )); + CHECK(( std::get( b.get(5) ) == "123")); + CHECK(( std::get( b.get(6) ) == "4.5")); + CHECK(( std::get( b.get(7) ) == "" )); + + // ------------------------ + // operator[] form + // ------------------------ + + b.start(2).length(6).string("-12 34 -56"); + b.valueType("Integer32"); + CHECK(( std::holds_alternative(b[0]))); + CHECK((!std::holds_alternative(b[0]))); + CHECK((!std::holds_alternative(b[0]))); + CHECK(( std::get( b[0] ) == 0 )); + CHECK(( std::get( b[1] ) == 0 )); + CHECK(( std::get( b[2] ) == -12 )); + CHECK(( std::get( b[3] ) == 34 )); + CHECK(( std::get( b[4] ) == -56 )); + CHECK(( std::get( b[5] ) == 0 )); + + b.start(2).length(6).string("1.2 3.4 5.6"); + b.valueType("Float64"); + CHECK((!std::holds_alternative(b[0]))); + CHECK(( std::holds_alternative(b[0]))); + CHECK((!std::holds_alternative(b[0]))); + CHECK(( std::get( b[0] ) == 0 )); + CHECK(( std::get( b[1] ) == 0 )); + CHECK(( std::get( b[2] ) == 1.2 )); + CHECK(( std::get( b[3] ) == 3.4 )); + CHECK(( std::get( b[4] ) == 5.6 )); + CHECK(( std::get( b[5] ) == 0 )); + + b.start(2).length(6).string("ab cd ef"); + b.valueType(""); + CHECK((!std::holds_alternative(b[0]))); + CHECK((!std::holds_alternative(b[0]))); + CHECK(( std::holds_alternative(b[0]))); + CHECK(( std::get( b[0] ) == "" )); + CHECK(( std::get( b[1] ) == "" )); + CHECK(( std::get( b[2] ) == "ab" )); + CHECK(( std::get( b[3] ) == "cd" )); + CHECK(( std::get( b[4] ) == "ef" )); + CHECK(( std::get( b[5] ) == "" )); + + } // GIVEN +} // SCENARIO + + +// For BlockData +SCENARIO("BlockData get(n)") { + GIVEN("A BlockData object") { + + // ------------------------ + // get(n) form + // ------------------------ + + { + BlockData b; + b.start(2).length(6).string("-12 34 -56"); + CHECK(( b.get(0) == 0 )); + CHECK(( b.get(1) == 0 )); + CHECK(( b.get(2) == -12 )); + CHECK(( b.get(3) == 34 )); + CHECK(( b.get(4) == -56 )); + CHECK(( b.get(5) == 0 )); + } + + { + BlockData b; + b.start(2).length(6).string("1.2 3.4 5.6"); + CHECK(( b.get(0) == 0 )); + CHECK(( b.get(1) == 0 )); + CHECK(( b.get(2) == 1.2 )); + CHECK(( b.get(3) == 3.4 )); + CHECK(( b.get(4) == 5.6 )); + CHECK(( b.get(5) == 0 )); + } + + { + BlockData b; + b.start(2).length(8).string("ab cd ef 123 4.5"); + CHECK(( b.get(0) == "" )); + CHECK(( b.get(1) == "" )); + CHECK(( b.get(2) == "ab" )); + CHECK(( b.get(3) == "cd" )); + CHECK(( b.get(4) == "ef" )); + CHECK(( b.get(5) == "123")); + CHECK(( b.get(6) == "4.5")); + CHECK(( b.get(7) == "" )); + } + + // ------------------------ + // operator[] form + // ------------------------ + + { + BlockData b; + b.start(2).length(6).string("-12 34 -56"); + CHECK(( b[0] == 0 )); + CHECK(( b[1] == 0 )); + CHECK(( b[2] == -12 )); + CHECK(( b[3] == 34 )); + CHECK(( b[4] == -56 )); + CHECK(( b[5] == 0 )); + } + + { + BlockData b; + b.start(2).length(6).string("1.2 3.4 5.6"); + CHECK(( b[0] == 0 )); + CHECK(( b[1] == 0 )); + CHECK(( b[2] == 1.2 )); + CHECK(( b[3] == 3.4 )); + CHECK(( b[4] == 5.6 )); + CHECK(( b[5] == 0 )); + } + + { + BlockData b; + b.start(2).length(6).string("ab cd ef"); + CHECK(( b[0] == "" )); + CHECK(( b[1] == "" )); + CHECK(( b[2] == "ab" )); + CHECK(( b[3] == "cd" )); + CHECK(( b[4] == "ef" )); + CHECK(( b[5] == "" )); + } + + } // GIVEN +} // SCENARIO + + + +// ----------------------------------------------------------------------------- +// 5. Scenario: doubles() etc. +// ----------------------------------------------------------------------------- + +// Helper +template +void scenario_get_named() +{ + { + BlockData b; + + b.start(2).length(6).string("-12 34 -56"); + auto result = b.ints(); + CHECK((std::is_same_v>)); + + CHECK(result[0] == 0 ); + CHECK(result[1] == 0 ); + CHECK(result[2] == -12 ); + CHECK(result[3] == 34 ); + CHECK(result[4] == -56 ); + CHECK(result[5] == 0 ); + + CHECK(result[0] == b.ints(0) ); + CHECK(result[1] == b.ints(1) ); + CHECK(result[2] == b.ints(2) ); + CHECK(result[3] == b.ints(3) ); + CHECK(result[4] == b.ints(4) ); + CHECK(result[5] == b.ints(5) ); + } + + { + BlockData b; + + b.start(2).length(6).string("1.2 3.4 5.6"); + const BlockData &bconst = b; // ensure it works with const + const auto result = bconst.doubles(); + CHECK((std::is_same_v>)); + + CHECK(result[0] == 0 ); + CHECK(result[1] == 0 ); + CHECK(result[2] == 1.2 ); + CHECK(result[3] == 3.4 ); + CHECK(result[4] == 5.6 ); + CHECK(result[5] == 0 ); + + CHECK(result[0] == bconst.doubles(0) ); + CHECK(result[1] == bconst.doubles(1) ); + CHECK(result[2] == bconst.doubles(2) ); + CHECK(result[3] == bconst.doubles(3) ); + CHECK(result[4] == bconst.doubles(4) ); + CHECK(result[5] == bconst.doubles(5) ); + } + + { + BlockData b; + + b.start(2).length(6).string("ab cd ef"); + const auto &result = b.strings(); + CHECK((std::is_same_v &>)); + + CHECK(result[0] == "" ); + CHECK(result[1] == "" ); + CHECK(result[2] == "ab" ); + CHECK(result[3] == "cd" ); + CHECK(result[4] == "ef" ); + CHECK(result[5] == "" ); + + CHECK(result[0] == b.strings(0) ); + CHECK(result[1] == b.strings(1) ); + CHECK(result[2] == b.strings(2) ); + CHECK(result[3] == b.strings(3) ); + CHECK(result[4] == b.strings(4) ); + CHECK(result[5] == b.strings(5) ); + } +} + +// For BlockData +SCENARIO("BlockData type-specific get functions: " + "doubles() etc.") { + GIVEN("A BlockData object") { + scenario_get_named(); + } +} + +// For BlockData +SCENARIO("BlockData type-specific get functions: " + "doubles() etc.") { + GIVEN("A BlockData object") { + scenario_get_named(); + } +} diff --git a/src/GNDStk/BlockData/test/params.test.cpp b/src/GNDStk/BlockData/test/params.test.cpp new file mode 100644 index 000000000..3fb952fc9 --- /dev/null +++ b/src/GNDStk/BlockData/test/params.test.cpp @@ -0,0 +1,133 @@ + +#include "catch.hpp" +#include "GNDStk.hpp" + +using namespace njoy::GNDStk; + + +// ----------------------------------------------------------------------------- +// Helper +// ----------------------------------------------------------------------------- + +template +void scenario_params() +{ + // Default values of parameters are as expected + WHEN("We examine the default length, start, and valueType") { + THEN("They are as expected") { + BlockData b; + CHECK(b.length() == 0); + CHECK(b.start() == 0); + CHECK(b.valueType() == ""); + } + } + + // length setter/getter works + WHEN("We set length, then get and verify") { + THEN("It works for a plain value") { + BlockData b; + b.length(12); + CHECK(b.length() == 12); + } + THEN("It works for optional-with-value") { + BlockData b; + b.length(std::optional(34)); + CHECK(b.length() == 34); + } + THEN("It works for optional-without-value (remains unchanged)") { + BlockData b; + b.length(56); + b.length(std::optional(std::nullopt)); + CHECK(b.length() == 56); + } + } + + // start setter/getter works + WHEN("We set start, then get and verify") { + THEN("It works for a plain value") { + BlockData b; + b.start(11); + CHECK(b.start() == 11); + } + THEN("It works for optional-with-value") { + BlockData b; + b.start(std::optional(13)); + CHECK(b.start() == 13); + } + THEN("It works for optional-without-value (remains unchanged)") { + BlockData b; + b.start(17); + b.start(std::optional(std::nullopt)); + CHECK(b.start() == 17); + } + } + + // valueType setter/getter works + WHEN("We set valueType, then get and verify") { + THEN("It works for a plain value") { + BlockData b; + b.valueType("unknown"); + CHECK(b.valueType() == "unknown"); + } + THEN("It works for optional-with-value") { + BlockData b; + b.valueType(std::optional("Integer32")); + CHECK(b.valueType() == "Integer32"); + } + THEN("It works for optional-without-value (remains unchanged)") { + BlockData b; + b.valueType("Float64"); + b.valueType(std::optional(std::nullopt)); + CHECK(b.valueType() == "Float64"); + } + } + + // Combo of the above, using builder-pattern nature of the setters + WHEN("We set length/start/valueType together, then get and verify") { + THEN("It works for a plain value") { + BlockData b; + b.length(1) + .start(2) + .valueType("a"); + CHECK(b.length() == 1); + CHECK(b.start() == 2); + CHECK(b.valueType() == "a"); + } + THEN("It works for optional-with-value") { + BlockData b; + b.length(std::optional(3)) + .start(std::optional(4)) + .valueType(std::optional("b")); + CHECK(b.length() == 3); + CHECK(b.start() == 4); + CHECK(b.valueType() == "b"); + } + THEN("It works for optional-without-value (remains unchanged)") { + BlockData b; + b.length(100).start(200).valueType("c"); + b.length(std::optional(std::nullopt)) + .start(std::optional(std::nullopt)) + .valueType(std::optional(std::nullopt)); + CHECK(b.length() == 100); + CHECK(b.start() == 200); + CHECK(b.valueType() == "c"); + } + } +} + + +// ----------------------------------------------------------------------------- +// Scenarios +// ----------------------------------------------------------------------------- + +SCENARIO("BlockData length/start/valueType") { + GIVEN("A default-constructed BlockData object") { + scenario_params(); + } +} + +SCENARIO("BlockData length/start/valueType") { + GIVEN("A default-constructed BlockData object") { + scenario_params(); + } +} diff --git a/src/GNDStk/BlockData/test/print.test.cpp b/src/GNDStk/BlockData/test/print.test.cpp new file mode 100644 index 000000000..22ef16af6 --- /dev/null +++ b/src/GNDStk/BlockData/test/print.test.cpp @@ -0,0 +1,440 @@ + +#include "catch.hpp" +#include "GNDStk.hpp" + +using namespace njoy::GNDStk; + + +// ----------------------------------------------------------------------------- +// Scenario: raw string is active +// ----------------------------------------------------------------------------- + +// Helper: scenario_print_string_active +template +void scenario_print_string_active() +{ + // string is active, but empty + GIVEN("A BlockData with an empty raw string") { + WHEN("BlockData.print() is called") { + THEN("Nothing is printed") { + BlockData b; + b.string(""); + + // with no indentation + std::ostringstream oss; + b.print(oss,0); + CHECK(oss.str() == ""); + + // the same (nothing is printed) even if indentation is nonzero + oss.str(""); + b.print(oss,2); + CHECK(oss.str() == ""); + } + } + } + + // string is active, and contains values + GIVEN("A BlockData with a non-empty raw string") { + WHEN("BlockData.print() is called") { + THEN("The raw string and a newline are printed") { + BlockData b; + b.string("foo bar baz"); + + njoy::GNDStk::colors = false; + njoy::GNDStk::shades = false; + + // with no indentation + std::ostringstream oss; + b.print(oss,0); + CHECK(oss.str() == "foo bar baz\n"); + + // the same, even if indentation is nonzero; indentation isn't + // applied when the raw string (as opposed to the ) is active + oss.str(""); + b.print(oss,2); + CHECK(oss.str() == "foo bar baz\n"); + } + } + } +} + +// For DATATYPE == void +SCENARIO("BlockData print(), when the raw string is active") +{ + scenario_print_string_active(); +} + +// For DATATYPE == double +SCENARIO("BlockData print(), when the raw string is active") +{ + scenario_print_string_active(); +} + + +// ----------------------------------------------------------------------------- +// Scenario: vector is active +// ----------------------------------------------------------------------------- + +SCENARIO("BlockData print(), when a vector is active") +{ + // vector is active, but empty + GIVEN("A BlockData with an empty vector") { + WHEN("BlockData.print() is called") { + THEN("Nothing is printed") { + BlockData b; + b = std::vector{}; + + // with no indentation + std::ostringstream oss; + b.print(oss,0); + CHECK(oss.str() == ""); + + // the same (nothing is printed) even if indentation is nonzero + oss.str(""); + b.print(oss,2); + CHECK(oss.str() == ""); + } + } + } + + // vector is active, and contains values + GIVEN("A BlockData with a non-empty vector") { + WHEN("BlockData.print() is called") { + THEN("The vector and a newline are printed") { + BlockData b; + b = std::vector{{2, 3, 5, 7, 11, 13, 17, 19, 21, 23}}; + std::ostringstream oss; + + // Cases: + // indent: 0, 3 (number of spaces per indentation level) + // columns: 0, 1, 2, 5, 10, 11 (note that 10 == vector size) + // level: 0, 1, 2 (indentation level) + // Note: columns <= 0 means unlimited: so, all values on one line. + // Lots of cases, but we want to check that our prettyprinting + // functionality works perfectly, and doesn't do anything that's + // unexpected around "boundaries" like columns==10 with 10 values. + + oss.str(""); indent = 0; columns = 0; b.print(oss,0); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 0; columns = 0; b.print(oss,1); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 0; columns = 0; b.print(oss,2); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 0; columns = 1; b.print(oss,0); + CHECK(oss.str() == "2\n3\n5\n7\n11\n13\n17\n19\n21\n23\n"); + + oss.str(""); indent = 0; columns = 1; b.print(oss,1); + CHECK(oss.str() == "2\n3\n5\n7\n11\n13\n17\n19\n21\n23\n"); + + oss.str(""); indent = 0; columns = 1; b.print(oss,2); + CHECK(oss.str() == "2\n3\n5\n7\n11\n13\n17\n19\n21\n23\n"); + + oss.str(""); indent = 0; columns = 2; b.print(oss,0); + CHECK(oss.str() == "2 3\n5 7\n11 13\n17 19\n21 23\n"); + + oss.str(""); indent = 0; columns = 2; b.print(oss,1); + CHECK(oss.str() == "2 3\n5 7\n11 13\n17 19\n21 23\n"); + + oss.str(""); indent = 0; columns = 2; b.print(oss,2); + CHECK(oss.str() == "2 3\n5 7\n11 13\n17 19\n21 23\n"); + + oss.str(""); indent = 0; columns = 5; b.print(oss,0); + CHECK(oss.str() == "2 3 5 7 11\n13 17 19 21 23\n"); + + oss.str(""); indent = 0; columns = 5; b.print(oss,1); + CHECK(oss.str() == "2 3 5 7 11\n13 17 19 21 23\n"); + + oss.str(""); indent = 0; columns = 5; b.print(oss,2); + CHECK(oss.str() == "2 3 5 7 11\n13 17 19 21 23\n"); + + oss.str(""); indent = 0; columns = 10; b.print(oss,0); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 0; columns = 10; b.print(oss,1); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 0; columns = 10; b.print(oss,2); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 0; columns = 11; b.print(oss,0); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 0; columns = 11; b.print(oss,1); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 0; columns = 11; b.print(oss,2); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 0; b.print(oss,0); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 0; b.print(oss,1); + CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 0; b.print(oss,2); + CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 1; b.print(oss,0); + CHECK(oss.str() == "2\n3\n5\n7\n11\n13\n17\n19\n21\n23\n"); + + oss.str(""); indent = 3; columns = 1; b.print(oss,1); + CHECK(oss.str() == + " 2\n 3\n 5\n 7\n 11\n" + " 13\n 17\n 19\n 21\n 23\n"); + + oss.str(""); indent = 3; columns = 1; b.print(oss,2); + CHECK(oss.str() == + " 2\n 3\n 5\n 7\n 11\n" + " 13\n 17\n 19\n 21\n 23\n"); + + oss.str(""); indent = 3; columns = 2; b.print(oss,0); + CHECK(oss.str() == "2 3\n5 7\n11 13\n17 19\n21 23\n"); + + oss.str(""); indent = 3; columns = 2; b.print(oss,1); + CHECK( + oss.str() == + " 2 3\n 5 7\n 11 13\n 17 19\n 21 23\n" + ); + + oss.str(""); indent = 3; columns = 2; b.print(oss,2); + CHECK( + oss.str() == + " 2 3\n 5 7\n 11 13\n 17 19\n 21 23\n" + ); + + oss.str(""); indent = 3; columns = 5; b.print(oss,0); + CHECK(oss.str() == "2 3 5 7 11\n13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 5; b.print(oss,1); + CHECK(oss.str() == " 2 3 5 7 11\n 13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 5; b.print(oss,2); + CHECK(oss.str() == " 2 3 5 7 11\n 13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 10; b.print(oss,0); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 10; b.print(oss,1); + CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 10; b.print(oss,2); + CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 11; b.print(oss,0); + CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 11; b.print(oss,1); + CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); + + oss.str(""); indent = 3; columns = 11; b.print(oss,2); + CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); + } + } + } +} + + + +// ----------------------------------------------------------------------------- +// Scenario: vector is active; test GNDStk::elements +// ----------------------------------------------------------------------------- + +// Helper: test_elements +template +void test_elements( + const BlockData &b, + const int indent, + const size_t columns, + const int level, + const long elements, + const std::string &want +) { + njoy::GNDStk::indent = indent; + njoy::GNDStk::columns = columns; + njoy::GNDStk::elements = elements; + + std::ostringstream oss; + b.print(oss,level); + + std::cout << "test_elements:" << std::endl; + std::cout << oss.str() << std::endl; + + CHECK(oss.str() == want); +} + +SCENARIO("BlockData print(), vector, trying GNDStk::elements") +{ + // vector is active, but empty + GIVEN("A BlockData with an empty vector") { + WHEN("BlockData.print() is called") { + THEN("Nothing is printed") { + BlockData b; + b = std::vector{}; + + using njoy::GNDStk::elements; + for (elements = -10; elements <= 10; ++elements) { + // with no indentation + std::ostringstream oss; + b.print(oss,0); + CHECK(oss.str() == ""); + + // the same (nothing is printed) even if indentation is nonzero + oss.str(""); + b.print(oss,2); + CHECK(oss.str() == ""); + } + } + } + } + + // vector is active, and contains values + GIVEN("A BlockData with a non-empty vector") { + WHEN("BlockData.print() is called") { + THEN("The vector and a newline are printed") { + BlockData b; + b = std::vector{{2.3, 5.7, 11.13, 17.19, 21.23}}; + + // Cases: + // indent: 3 (number of spaces per indentation level) + // columns: 0, 2, 3 (0 means unlimited) + // level: 0, 1, 2 (indentation level) + // elements: -1, 0, 1, 2, 3 (-1 means none; so, print all values) + // Lots of cases; we want prettyprinting to be perfect. + + // Integral parameters below are: indent, columns, level, elements + test_elements(b, 3, 0, 0, -1, + "2.3 5.7 11.13 17.19 21.23\n"); + test_elements(b, 3, 0, 0, +0, + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 0, 0, +1, + "2.3\n" + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 0, 0, +2, + "2.3 5.7\n" + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 0, 0, +3, + "2.3 5.7 11.13\n" + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 0, 1, -1, + " 2.3 5.7 11.13 17.19 21.23\n"); + test_elements(b, 3, 0, 1, +0, + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 0, 1, +1, + " 2.3\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 0, 1, +2, + " 2.3 5.7\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 0, 1, +3, + " 2.3 5.7 11.13\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 0, 2, -1, + " 2.3 5.7 11.13 17.19 21.23\n"); + test_elements(b, 3, 0, 2, +0, + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 0, 2, +1, + " 2.3\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 0, 2, +2, + " 2.3 5.7\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 0, 2, +3, + " 2.3 5.7 11.13\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 0, -1, + "2.3 5.7\n" + "11.13 17.19\n" + "21.23\n"); + test_elements(b, 3, 2, 0, +0, + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 0, +1, + "2.3\n" + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 0, +2, + "2.3 5.7\n" + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 0, +3, + "2.3 5.7\n" + "11.13\n" + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 1, -1, + " 2.3 5.7\n" + " 11.13 17.19\n" + " 21.23\n"); + test_elements(b, 3, 2, 1, +0, + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 1, +1, + " 2.3\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 1, +2, + " 2.3 5.7\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 1, +3, + " 2.3 5.7\n" + " 11.13\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 2, -1, + " 2.3 5.7\n" + " 11.13 17.19\n" + " 21.23\n"); + test_elements(b, 3, 2, 2, +0, + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 2, +1, + " 2.3\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 2, +2, + " 2.3 5.7\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 2, 2, +3, + " 2.3 5.7\n" + " 11.13\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 0, -1, + "2.3 5.7 11.13\n" + "17.19 21.23\n"); + test_elements(b, 3, 3, 0, +0, + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 0, +1, + "2.3\n" + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 0, +2, + "2.3 5.7\n" + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 0, +3, + "2.3 5.7 11.13\n" + "// truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 1, -1, + " 2.3 5.7 11.13\n" + " 17.19 21.23\n"); + test_elements(b, 3, 3, 1, +0, + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 1, +1, + " 2.3\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 1, +2, + " 2.3 5.7\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 1, +3, + " 2.3 5.7 11.13\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 2, -1, + " 2.3 5.7 11.13\n" + " 17.19 21.23\n"); + test_elements(b, 3, 3, 2, +0, + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 2, +1, + " 2.3\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 2, +2, + " 2.3 5.7\n" + " // truncated; actual #elements == 5\n"); + test_elements(b, 3, 3, 2, +3, + " 2.3 5.7 11.13\n" + " // truncated; actual #elements == 5\n"); + } + } + } +} diff --git a/src/GNDStk/BodyText/test/string.test.cpp b/src/GNDStk/BlockData/test/string.test.cpp similarity index 79% rename from src/GNDStk/BodyText/test/string.test.cpp rename to src/GNDStk/BlockData/test/string.test.cpp index 549b38041..fb8e8ed39 100644 --- a/src/GNDStk/BodyText/test/string.test.cpp +++ b/src/GNDStk/BlockData/test/string.test.cpp @@ -2,20 +2,20 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; // ----------------------------------------------------------------------------- // Helper // ----------------------------------------------------------------------------- -template +template void scenario_string() { // Default value of raw string is as expected WHEN("We examine the raw string") { THEN("It is as expected") { - BodyText b; + BlockData b; CHECK(b.string() == ""); } } @@ -23,7 +23,7 @@ void scenario_string() // Raw string setter/getter works WHEN("We set the raw string") { THEN("It has the correct value, and vector size() == 0 too") { - BodyText b; + BlockData b; // to ensure it clears below... b = std::vector(10); @@ -40,7 +40,7 @@ void scenario_string() // Test in conjunction with length, start, and valueType WHEN("We set string, length, start, and valueType together") { THEN("All values check out") { - BodyText b; + BlockData b; b.string("3 4 5 6").length(10).start(2).valueType("Integer32"); CHECK(b.length() == 10); @@ -56,14 +56,14 @@ void scenario_string() // Scenarios // ----------------------------------------------------------------------------- -SCENARIO("BodyText string()") { - GIVEN("A default-constructed BodyText object") { +SCENARIO("BlockData string()") { + GIVEN("A default-constructed BlockData object") { scenario_string(); } } -SCENARIO("BodyText string()") { - GIVEN("A default-constructed BodyText object") { +SCENARIO("BlockData string()") { + GIVEN("A default-constructed BlockData object") { scenario_string(); } } diff --git a/src/GNDStk/BlockData/test/sync.test.cpp b/src/GNDStk/BlockData/test/sync.test.cpp new file mode 100644 index 000000000..9a088d851 --- /dev/null +++ b/src/GNDStk/BlockData/test/sync.test.cpp @@ -0,0 +1,345 @@ + +#include "catch.hpp" +#include "GNDStk.hpp" + +using namespace njoy::GNDStk; + + +// ----------------------------------------------------------------------------- +// Scenario: pull +// Content == any of {length,start,valueType} +// ----------------------------------------------------------------------------- + +// Helper +template +void scenario_pull() +{ + WHEN("pullFromDerived() is called") { + // none of length, start, valueType + THEN("Push to Content{} works") { + struct : public BlockData { + struct { + } Content; + } derived; + BlockData &b = derived; + b.length(100).start(200).valueType("300"); + b.pullFromDerived(derived); // should do nothing here + CHECK(b.length() == 100); + CHECK(b.start() == 200); + CHECK(b.valueType() == "300"); + } + + // length only + THEN("Push to Content{length} works") { + struct : public BlockData { + struct { + int length = 10; + } Content; + const int &length() const { return Content.length; } + int &length() { return Content.length; } + } derived; + BlockData &b = derived; + b.length(11).start(12).valueType("13"); + b.pullFromDerived(derived); + CHECK(b.length() == 10); + CHECK(b.start() == 12); + CHECK(b.valueType() == "13"); + } + + // start only + THEN("Push to Content{start} works") { + struct : public BlockData { + struct { + int start = 14; + } Content; + const int &start() const { return Content.start; } + int &start() { return Content.start; } + } derived; + BlockData &b = derived; + b.length(15).start(16).valueType("17"); + b.pullFromDerived(derived); + CHECK(b.length() == 15); + CHECK(b.start() == 14); + CHECK(b.valueType() == "17"); + } + + // valueType only + THEN("Push to Content{valueType} works") { + struct : public BlockData { + struct { + std::string valueType = "18"; + } Content; + const std::string &valueType() const { return Content.valueType; } + std::string &valueType() { return Content.valueType; } + } derived; + BlockData &b = derived; + b.length(19).start(20).valueType("21"); + b.pullFromDerived(derived); + CHECK(b.length() == 19); + CHECK(b.start() == 20); + CHECK(b.valueType() == "18"); + } + + // all but length + THEN("Push to Content{start,valueType} works") { + struct : public BlockData { + struct { + int start = 22; + std::string valueType = "23"; + } Content; + const int &start() const { return Content.start; } + int &start() { return Content.start; } + const std::string &valueType() const { return Content.valueType; } + std::string &valueType() { return Content.valueType; } + } derived; + BlockData &b = derived; + b.length(24).start(25).valueType("26"); + b.pullFromDerived(derived); + CHECK(b.length() == 24); + CHECK(b.start() == 22); + CHECK(b.valueType() == "23"); + } + + // all but start + THEN("Push to Content{length,valueType} works") { + struct : public BlockData { + struct { + int length = 27; + std::string valueType = "28"; + } Content; + const int &length() const { return Content.length; } + int &length() { return Content.length; } + const std::string &valueType() const { return Content.valueType; } + std::string &valueType() { return Content.valueType; } + } derived; + BlockData &b = derived; + b.length(29).start(30).valueType("31"); + b.pullFromDerived(derived); + CHECK(b.length() == 27); + CHECK(b.start() == 30); + CHECK(b.valueType() == "28"); + } + + // all but valueType + THEN("Push to Content{length,start} works") { + struct : public BlockData { + struct { + int length = 32; + int start = 33; + } Content; + const int &length() const { return Content.length; } + int &length() { return Content.length; } + const int &start() const { return Content.start; } + int &start() { return Content.start; } + } derived; + BlockData &b = derived; + b.length(34).start(35).valueType("36"); + b.pullFromDerived(derived); + CHECK(b.length() == 32); + CHECK(b.start() == 33); + CHECK(b.valueType() == "36"); + } + + // all three + THEN("Push to Content{length,start,valueType} works") { + struct : public BlockData { + struct { + int length = 37; + int start = 38; + std::string valueType = "39"; + } Content; + const int &length() const { return Content.length; } + int &length() { return Content.length; } + const int &start() const { return Content.start; } + int &start() { return Content.start; } + const std::string &valueType() const { return Content.valueType; } + std::string &valueType() { return Content.valueType; } + } derived; + BlockData &b = derived; + b.length(40).start(41).valueType("42"); + b.pullFromDerived(derived); + CHECK(b.length() == 37); + CHECK(b.start() == 38); + CHECK(b.valueType() == "39"); + } + } +} + + +SCENARIO("BlockData pull from Content") { + GIVEN("A BlockData object") { + scenario_pull(); + } +} + +SCENARIO("BlockData pull from Content") { + GIVEN("A BlockData object") { + scenario_pull(); + } +} + + +// ----------------------------------------------------------------------------- +// Scenario: push +// Content == any of {length,start,valueType} +// ----------------------------------------------------------------------------- + +// Helper +template +void scenario_push() +{ + WHEN("pushToDerived() is called") { + // none of length, start, valueType + THEN("Push to Content{} works") { + struct : public BlockData { + struct { + int ignored = 123456; // not length, start, or valueType + } Content; + const int &ignored() const { return Content.ignored; } + int &ignored() { return Content.ignored; } + } derived; + BlockData &b = derived; + b.length(0).start(0).valueType("0"); + b.pushToDerived(derived); // should do nothing here + CHECK(derived.ignored() == 123456); + } + + // length only + THEN("Push to Content{length} works") { + struct : public BlockData { + struct { + int length = 10; + } Content; + const int &length() const { return Content.length; } + int &length() { return Content.length; } + } derived; + BlockData &b = derived; + b.length(11).start(12).valueType("13"); + b.pushToDerived(derived); + CHECK(derived.length() == 11); + } + + // start only + THEN("Push to Content{start} works") { + struct : public BlockData { + struct { + int start = 14; + } Content; + const int &start() const { return Content.start; } + int &start() { return Content.start; } + } derived; + BlockData &b = derived; + b.length(15).start(16).valueType("17"); + b.pushToDerived(derived); + CHECK(derived.start() == 16); + } + + // valueType only + THEN("Push to Content{valueType} works") { + struct : public BlockData { + struct { + std::string valueType = "18"; + } Content; + const std::string &valueType() const { return Content.valueType; } + std::string &valueType() { return Content.valueType; } + } derived; + BlockData &b = derived; + b.length(19).start(20).valueType("21"); + b.pushToDerived(derived); + CHECK(derived.valueType() == "21"); + } + + // all but length + THEN("Push to Content{start,valueType} works") { + struct : public BlockData { + struct { + int start = 22; + std::string valueType = "23"; + } Content; + const int &start() const { return Content.start; } + int &start() { return Content.start; } + const std::string &valueType() const { return Content.valueType; } + std::string &valueType() { return Content.valueType; } + } derived; + BlockData &b = derived; + b.length(24).start(25).valueType("26"); + b.pushToDerived(derived); + CHECK(derived.start() == 25); + CHECK(derived.valueType() == "26"); + } + + // all but start + THEN("Push to Content{length,valueType} works") { + struct : public BlockData { + struct { + int length = 27; + std::string valueType = "28"; + } Content; + const int &length() const { return Content.length; } + int &length() { return Content.length; } + const std::string &valueType() const { return Content.valueType; } + std::string &valueType() { return Content.valueType; } + } derived; + BlockData &b = derived; + b.length(29).start(30).valueType("31"); + b.pushToDerived(derived); + CHECK(derived.length() == 29); + CHECK(derived.valueType() == "31"); + } + + // all but valueType + THEN("Push to Content{length,start} works") { + struct : public BlockData { + struct { + int length = 32; + int start = 33; + } Content; + const int &length() const { return Content.length; } + int &length() { return Content.length; } + const int &start() const { return Content.start; } + int &start() { return Content.start; } + } derived; + BlockData &b = derived; + b.length(34).start(35).valueType("36"); + b.pushToDerived(derived); + CHECK(derived.length() == 34); + CHECK(derived.start() == 35); + } + + // all three + THEN("Push to Content{length,start,valueType} works") { + struct : public BlockData { + struct { + int length = 37; + int start = 38; + std::string valueType = "39"; + } Content; + const int &length() const { return Content.length; } + int &length() { return Content.length; } + const int &start() const { return Content.start; } + int &start() { return Content.start; } + const std::string &valueType() const { return Content.valueType; } + std::string &valueType() { return Content.valueType; } + } derived; + BlockData &b = derived; + b.length(40).start(41).valueType("42"); + b.pushToDerived(derived); + CHECK(derived.length() == 40); + CHECK(derived.start() == 41); + CHECK(derived.valueType() == "42"); + } + } +} + + +SCENARIO("BlockData push to Content") { + GIVEN("A BlockData object") { + scenario_push(); + } +} + +SCENARIO("BlockData push to Content") { + GIVEN("A BlockData object") { + scenario_push(); + } +} diff --git a/src/GNDStk/BlockData/test/toNode.test.cpp b/src/GNDStk/BlockData/test/toNode.test.cpp new file mode 100644 index 000000000..6bd63314a --- /dev/null +++ b/src/GNDStk/BlockData/test/toNode.test.cpp @@ -0,0 +1,248 @@ + +#include "catch.hpp" +#include "GNDStk.hpp" + +using namespace njoy::GNDStk; + + +// ----------------------------------------------------------------------------- +// Helper +// ----------------------------------------------------------------------------- + +// Tests use either void for each template parameter, or int, double, +// std::string, and char, in that order. In the former case, we're testing +// toNode() for the generic BlockData<...,void>. In the latter case, we're +// testing toNode() for non-generic BlockData. +template +void scenario_toNode() +{ + // Default-constructed BlockData + GIVEN("A default-constructed BlockData") { + WHEN("toNode() is called") { + THEN("The computed text string is empty") { + std::string text = "abc"; + struct : public BlockData { + struct { + } Content; + } derived; + BlockData &b = derived; + + // w/trim == true (shouldn't matter here; applies to vector) + b.trim = true; + b.toNode(text); + CHECK(text == ""); + + // w/trim == false (shouldn't matter here; applies to vector) + b.trim = false; + b.toNode(text); + CHECK(text == ""); + } + } + } + + // BlockData, after being given a particular raw string and parameters + GIVEN("A BlockData, with given raw string and parameters") { + WHEN("toNode() is called") { + THEN("The computed text string is as expected, " + "and the parameters remain as given" + ) { + struct : public BlockData { + struct { + } Content; + } derived; + BlockData &b = derived; + + b.string("0 12 34 56 0 0") + .start(100).length(200).valueType("hello"); + + // Someone who sets the raw string directly (as opposed to using + // a vector) is stating that they want *exactly* that raw string, + // including any 0s or anything else. To have BlockData's trim flag + // be relevant, use a vector. + + // w/trim == true (shouldn't matter here; applies to vector) + std::string text = "abc"; + b.trim = true; + b.toNode(text); + CHECK(text == "0 12 34 56 0 0"); + CHECK(b.start() == 100); + CHECK(b.length() == 200); + CHECK(b.valueType() == "hello"); + + // w/trim == false (shouldn't matter here; applies to vector) + text = "abc"; + b.trim = false; + b.toNode(text); + CHECK(text == "0 12 34 56 0 0"); + CHECK(b.start() == 100); + CHECK(b.length() == 200); + CHECK(b.valueType() == "hello"); + } + } + } + + // BlockData, after being given a particular vector + GIVEN("A BlockData, assigned from a particular vector") { + WHEN("toNode() is called") { + THEN("The computed text string is as expected, " + "and the parameters were computed properly" + ) { + struct : public BlockData { + struct { + } Content; + } derived; + BlockData &b = derived; + + // what's set here should be replaced upon assignment from vector + b.string("a b c").start(10).length(20).valueType("foobar"); + + // assign from vector + b = std::vector{{0, 0, 12, 34, 56, 78, 0, 0, 0, 0, 0}}; + + // w/trim == true + std::string text = "this should be replaced"; + b.trim = true; + b.toNode(text); + CHECK(text == "12 34 56 78"); + CHECK(b.start() == 2); + CHECK(b.length() == 11); + CHECK(b.valueType() == "Integer32"); + + // w/trim == false + text = "this should be replaced"; + b.trim = false; + b.toNode(text); + CHECK(text == "0 0 12 34 56 78 0 0 0 0 0"); + CHECK(b.start() == 0); + CHECK(b.length() == 11); + CHECK(b.valueType() == "Integer32"); + } + } + } + + // BlockData, after being given a particular vector + GIVEN("A BlockData, assigned from a particular vector") { + WHEN("toNode() is called") { + THEN("The computed text string is as expected, " + "and the parameters were computed properly" + ) { + struct : public BlockData { + struct { + } Content; + } derived; + BlockData &b = derived; + + // what's set here should be replaced upon assignment from vector + b.string("d e f").start(100).length(200).valueType("foobar"); + + // assign from vector + b = std::vector{{0, 0, 0, 1.234, 5.678, 0, 0 }}; + + // w/trim == true + std::string text = "this should be replaced"; + b.trim = true; + b.toNode(text); + CHECK(text == "1.234 5.678"); + CHECK(b.start() == 3); + CHECK(b.length() == 7); + CHECK(b.valueType() == "Float64"); + + // w/trim == false + text = "this should be replaced"; + b.trim = false; + b.toNode(text); + CHECK(text == "0 0 0 1.234 5.678 0 0"); + CHECK(b.start() == 0); + CHECK(b.length() == 7); + CHECK(b.valueType() == "Float64"); + } + } + } + + // BlockData, after being given a particular vector + // A key point here is to ensure that ""s (string "zeros") are properly + // trimmed at the beginning and end. + GIVEN("A BlockData, assigned from a particular vector") { + WHEN("toNode() is called") { + THEN("The computed text string is as expected, " + "and the parameters were computed properly" + ) { + struct : public BlockData { + struct { + } Content; + } derived; + BlockData &b = derived; + + // what's set here should be replaced upon assignment from vector + b.string("d e f").start(100).length(200).valueType("foobar"); + + // assign from vector + b = std::vector{{"","","","foo","bar","baz","",""}}; + + // w/trim == true + std::string text = "this should be replaced"; + b.trim = true; + b.toNode(text); + CHECK(text == "foo bar baz"); + CHECK(b.start() == 3); + CHECK(b.length() == 8); + CHECK(b.valueType() == "UTF8Text"); + + // w/trim == false + // toNode() should treat this (the std::string) case as if trim + // were true. If it didn't, we'd end up with, well, leading and + // trailing *empty* strings, which, well, amount to leading and + // trailing nothing. + text = "this should be replaced"; + b.trim = false; + b.toNode(text); + CHECK(text == "foo bar baz"); + CHECK(b.start() == 3); + CHECK(b.length() == 8); + CHECK(b.valueType() == "UTF8Text"); + } + } + } + + // BlockData, after being given a particular vector + // For T something other than int, double, and std::string + GIVEN("A BlockData, assigned from a particular vector") { + WHEN("toNode() is called") { + THEN("The computed text string is as expected, " + "and the parameters were computed properly" + ) { + struct : public BlockData { + struct { + } Content; + } derived; + BlockData &b = derived; + + // what's set here should be replaced upon assignment from vector + b.string("x y z").start(100).length(200).valueType("foobar"); + + // assign from vector + b = std::vector{{0,0,0,0,0,'a','b','c','d',0}}; + + std::string text = "this should be replaced"; + b.toNode(text); + CHECK(text == "a b c d"); + CHECK(b.start() == 5); + CHECK(b.length() == 10); + CHECK(b.valueType() == "char"); + } + } + } +} + + +// ----------------------------------------------------------------------------- +// Scenario +// ----------------------------------------------------------------------------- + +SCENARIO("BlockData toNode()") { + scenario_toNode(); +} + +SCENARIO("BlockData toNode()") { + scenario_toNode(); +} diff --git a/src/GNDStk/BlockData/test/types.test.cpp b/src/GNDStk/BlockData/test/types.test.cpp new file mode 100644 index 000000000..ffbee513b --- /dev/null +++ b/src/GNDStk/BlockData/test/types.test.cpp @@ -0,0 +1,121 @@ + +#include "catch.hpp" +#include "GNDStk.hpp" + +using namespace njoy::GNDStk; + +// ----------------------------------------------------------------------------- +// Scenario +// ----------------------------------------------------------------------------- + +SCENARIO("BlockData data types") { + GIVEN("std::vector for certain specific Ts") { + + WHEN("Via BlockData, we make variants of vectors and of scalars") { + // vector type + using vv = BlockData::VariantOfVectors; + THEN("The variant-of-vector size should be correct") { + CHECK(std::variant_size_v == 15); + } + vv vectors; + + // scalar type + using vs = BlockData::VariantOfScalars; + THEN("The variant-of-scalar size should be correct") { + CHECK(std::variant_size_v == 15); + } + vs scalars; + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,"a"); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == "a"); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,'b'); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == 'b'); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,-100); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == -100); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,-200); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == -200); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,-300); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == -300); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,-400); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == -400); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,-500); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == -500); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,100); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == 100); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,200); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == 200); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,300); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == 300); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,400); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == 400); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,500); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == 500); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,-1.2f); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == -1.2f); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,3.4); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == 3.4); + } + + THEN("Transforming to vector, and access, work") { + vectors = std::vector(10,-5.6); + scalars = std::get>(vectors)[0]; + CHECK(std::get(scalars) == -5.6); + } + } // WHEN + + } // GIVEN +} // SCENARIO diff --git a/src/GNDStk/BodyText.hpp b/src/GNDStk/BodyText.hpp deleted file mode 100644 index 7b963fd0c..000000000 --- a/src/GNDStk/BodyText.hpp +++ /dev/null @@ -1,148 +0,0 @@ - -// Printing-related colors. -// todo Eventually, this probably belongs in a more context-agnostic -// location, such as GNDStk's utility.hpp file or something like it. -#include "GNDStk/BodyText/src/colors.hpp" - -// Miscellaneous helper constructs. -#include "GNDStk/BodyText/src/detail.hpp" - - -// ----------------------------------------------------------------------------- -// BodyText -// The case is specialized and has the fun stuff. This one needs -// just a bit of content, in order to facilitate uniform treatment of BodyText. -// ----------------------------------------------------------------------------- - -template -class BodyText { -public: - using VariantOfVectors = std::variant; - using VariantOfScalars = std::variant; - static inline constexpr bool runtime = false; - template - static inline constexpr bool supported = false; -}; - - -// ----------------------------------------------------------------------------- -// BodyText -// -// Designed to be flexible, smart, and safe. Does lots of checks, and, for the -// DATA == void case, can essentially re-form itself depending on what type of -// data someone tries to extract. -// -// For efficiency in the DATA == void case, an application might want to copy -// to its own vector (e.g. auto myvec = mybodytext.get>()) -// in order to do work on (or with) the vector there, before copying it back. -// ----------------------------------------------------------------------------- - -template -class BodyText { -public: - - #include "GNDStk/BodyText/src/types.hpp" - - // For convenience in various SFINAE and if-constexpr constructs - static inline constexpr bool runtime = detail::isVoid; - template - struct is_supported { - static inline constexpr bool value = - ( runtime && detail::isAlternative) || - (!runtime && ( - std::is_constructible_v || - std::is_convertible_v - )); - }; - template - static inline constexpr bool supported = is_supported::value; - - enum class Active { string, vector }; - -private: - - // For internal use - mutable Active act = Active::string; - - // Raw string, directly from "plain character data" in a GNDS file. - // We'll allow callers to set this by using a setter. - std::string rawstring; - - // Vector of . - // Mutable, so that we can defer processing of the raw string into - // a vector until, and unless, a caller *asks* for the vector. - // This will be used if, and only if, DATA == void. - mutable VariantOfVectors variant; - - // Vector of - // This will be used if, and only if, DATA != void. - // data_t is used in a few places where, without it, we'd create compilation - // errors by using "void" in invalid ways. The "int" below is arbitrary - - // essentially a placeholder; the following is only used when !runtime. - using data_t = std::conditional_t; - mutable std::vector vector; - -public: - - // Parameters that affect interpretation of the raw string: - // struct vars { length, start, valueType } - // Includes public getters and setters for those. - // We won't use valueType if DATA != void. - #include "GNDStk/BodyText/src/params.hpp" - - // trim - // Flag: should the conversion of BodyText data back into textual data, - // in a Node, trim zeros from the start and end of the output? - mutable bool trim = true; - - // Getters and setters for the raw string: - #include "GNDStk/BodyText/src/string.hpp" - - // active() - Active active() const { return act; } - - // clear() - // Clears the vector, or the active vector alternative in the variant. - BodyText &clear() - { - if constexpr (runtime) - std::visit([](auto &&alt) { alt.clear(); }, variant); - else - vector.clear(); - - act = Active::vector; - return *this; - } - - // size() - // Returns the size of the vector, or of the active vector alternative in - // the variant. Depending on what someone may or may not have done with the - // current BodyText object, size() might or might not reflect the values of - // length and/or start, or reflect the current contents of the raw string. - std::size_t size() const - { - if constexpr (runtime) - return std::visit([](auto &&alt) { return alt.size(); }, variant); - else - return vector.size(); - } - - // Various vector get() functions, and the type-specific doubles() etc. - #include "GNDStk/BodyText/src/get.hpp" - - // Read/write data, from/to a Node - #include "GNDStk/BodyText/src/fromNode.hpp" - #include "GNDStk/BodyText/src/toNode.hpp" - - // Write to ostream - // Not to be confused with the process of writing data to a Node - #include "GNDStk/BodyText/src/write.hpp" - - // Pull/push length/start/valueType from/to derived-class struct content - #include "GNDStk/BodyText/src/sync.hpp" - - // Assignment - // From string or vector; the former == calling our raw string setter - #include "GNDStk/BodyText/src/assign.hpp" - -}; // class BodyText diff --git a/src/GNDStk/BodyText/src/assign.hpp b/src/GNDStk/BodyText/src/assign.hpp deleted file mode 100644 index b1b975822..000000000 --- a/src/GNDStk/BodyText/src/assign.hpp +++ /dev/null @@ -1,75 +0,0 @@ - -// ----------------------------------------------------------------------------- -// Assignment from string -// Same effect as the string(new string) setter -// ----------------------------------------------------------------------------- - -BodyText &operator=(const std::string &str) -{ - return string(str); -} - - -// ----------------------------------------------------------------------------- -// Assignment from vector -// ----------------------------------------------------------------------------- - -/* -DISCUSSION - -Elsewhere, a BodyText object can be made from a GNDS node. From GNDS, we get -a text string (copied to the rawstring field), from which a vector of values -can be created on an as-needed basis. A GNDS node might also give us any of -length, start, and valueType, which, when pulling data from the Node, we'll -use if they're there, or otherwise assume to be our defaults. - -Here, we're allowing for an assignment BodyText = vector. For this assignment, -the caller should send the full, complete vector of values that's appropriate -for the GNDS Node whose data this BodyText object is intended to represent. - -Specifically: the vector should contain whatever leading and/or trailing 0s -the full data vector is supposed to have. The length and start values are -completely ignored by this function; they're neither used nor set. Future -vector accesses though our various get() functions simply access the vector -exactly as-is. Length and start won't come into play until - and unless - a -caller uses the string setter (or assignment to string) and subsequently -triggers a remake of the vector. (Which would then be a newly-created vector, -based on the value of the raw string - not the vector from which we're -assigning here.) - -As for valueType, this function attempts to guess it from the vector's element -type, and sets it to "", the empty string, if we don't recognize that type. - -If a vector that's assigned from, here, is still in play when this BodyText's -data are written to a Node (see the toNode() function), then toNode() will -recompute length and start automatically, based on the vector's beginning and -ending content, if the "trim" flag is set. See toNode() for more information. -*/ - -template -std::enable_if_t, BodyText &> -operator=(const std::vector &vec) -{ - // set the raw string to "", because it's no longer considered meaningful - rawstring = ""; - - // length, start, valueType - length(vec.size()); - start(0); - valueType(detail::MapTypeString::value[0]); - - // assign vector - if constexpr (runtime) - variant = vec; - else if constexpr (std::is_same_v) - vector = vec; - else { - vector.clear(); - vector.reserve(vec.size()); - for (const T &element : vec) - vector.push_back(DATA(element)); - } - - act = Active::vector; - return *this; -} diff --git a/src/GNDStk/BodyText/src/colors.hpp b/src/GNDStk/BodyText/src/colors.hpp deleted file mode 100644 index f8850fde7..000000000 --- a/src/GNDStk/BodyText/src/colors.hpp +++ /dev/null @@ -1,89 +0,0 @@ - -namespace colors { - -// ----------------------------------------------------------------------------- -// Colors themselves -// ----------------------------------------------------------------------------- - -// Specific colors: -// colors::plain::* -// colors::vivid::* -// Reset/clear: -// colors::reset -// Note that all of these are ANSI color escape sequences. They'll work on many -// terminals, perhaps most, but working isn't guaranteed. GNDStk::color is false -// by default, so colors aren't actually used unless someone sets it to true. - -namespace plain { - -inline const std::string - black = "\033[30;1m", - red = "\033[31;1m", - green = "\033[32;1m", - blue = "\033[34;1m", - cyan = "\033[36;1m", - magenta = "\033[35;1m", - purple = magenta, - violet = magenta, - yellow = "\033[33;1m", - white = "\033[37;1m"; - -} // namespace plain - -namespace vivid { - -inline const std::string - black = "\033[30;21m", - red = "\033[31;21m", - green = "\033[32;21m", - blue = "\033[34;21m", - cyan = "\033[36;21m", - magenta = "\033[35;21m", - purple = magenta, - violet = magenta, - yellow = "\033[33;21m", - white = "\033[37;21m"; - -} // namespace vivid - -inline const std::string reset = "\033[0m"; - - - -// ----------------------------------------------------------------------------- -// For Component printing -// Non-const, so that you can change them if they don't work well with your -// window's color scheme, or if you just prefer something else. -// ----------------------------------------------------------------------------- - -// Use: -// colors::part -// Where part is a particular portion of the relevant printed output. -// Available parts appear below. "" means no special color treatment, -// so that users get whatever text color their terminal already uses. - -// General labels, and colon separator between label and value -inline std::string label = ""; -inline std::string colon = ""; - -// Component labels + begin/end curly braces -inline std::string component = plain::magenta; -inline std::string brace = plain::magenta; - -// Vector labels + begin/end square brackets -inline std::string vector = plain::yellow; -inline std::string bracket = plain::yellow; - -// If optional/defaulted, label (but not curly braces or square brackets, -// where applicable) are modified to these. Both are blue-ish, reflecting -// the general similarities between std::optional and GNDStk::Defaulted. -inline std::string optional = plain::cyan; -inline std::string defaulted = plain::blue; - -// Values in nodes with "body text" -inline std::string value = plain::white; - -// Comments -inline std::string comment = plain::red; - -} // namespace colors diff --git a/src/GNDStk/BodyText/src/detail.hpp b/src/GNDStk/BodyText/src/detail.hpp deleted file mode 100644 index dd5053e9e..000000000 --- a/src/GNDStk/BodyText/src/detail.hpp +++ /dev/null @@ -1,170 +0,0 @@ - -namespace detail { - -// ----------------------------------------------------------------------------- -// Miscellaneous -// ----------------------------------------------------------------------------- - -// scalarize -template -auto scalarize(const std::variant) -{ - return std::variant{}; -} - -// decays, decays_t -// Like std::decay and std::decay_t, but for tuple -template -struct decays { }; -template -struct decays> { - using type = std::tuple ...>; -}; - -template -using decays_t = typename decays::type; - - - -// ----------------------------------------------------------------------------- -// SFINAE constructs for detecting whether or not a class has certain members. -// Adapted from an answer here: https://stackoverflow.com/questions/1005476 -// ----------------------------------------------------------------------------- - -// ------------------------ -// Helpers -// ------------------------ - -// has_length -template -struct has_length - : std::false_type { }; - -template -struct has_length - : std::true_type { }; - -// has_start -template -struct has_start - : std::false_type { }; - -template -struct has_start - : std::true_type { }; - -// has_valueType -template -struct has_valueType - : std::false_type { }; - -template -struct has_valueType - : std::true_type { }; - -// has_index -template -struct has_index - : std::false_type { }; - -template -struct has_index - : std::true_type { }; - -template -struct has_index> { - // for variant: does any alternative have index? - static constexpr bool value = (has_index::value || ...); -}; - -// has_label -template -struct has_label - : std::false_type { }; - -template -struct has_label - : std::true_type { }; - -template -struct has_label> { - // for variant: does any alternative have label? - static constexpr bool value = (has_label::value || ...); -}; - - -// ------------------------ -// Prefer these. -// They apply std::decay, -// and don't need ::value -// ------------------------ - -template -inline constexpr bool hasLength = has_length >::value; -template -inline constexpr bool hasStart = has_start >::value; -template -inline constexpr bool hasValueType = has_valueType>::value; -template -inline constexpr bool hasIndex = has_index >::value; -template -inline constexpr bool hasLabel = has_label >::value; - - - -// ----------------------------------------------------------------------------- -// element2element -// ----------------------------------------------------------------------------- - -// Remark: PrecisionContext::data, not PrecisionContext::metadata, is the right -// precision context (in terms of our functionality for handling floating-point -// precision) in the code for which element2element() is called. We could bypass -// element2element() entirely, using convert_t{}(...) instead, except that then -// PrecisionContext::metadata would ultimately get used for floating-point T. -// So, below, we recognize floating-point T directly, and handle it correctly. - -// string ==> arithmetic -template>> -void element2element(const std::string &str, T &value) -{ - if constexpr (std::is_floating_point_v) - value = Precision{}.read(str); - else - convert_t{}(str,value); -} - -// arithmetic ==> arithmetic -template -void element2element(const FROM &from, TO &to) -{ - convert_t{}(from,to); -} - -// arithmetic ==> string -template>> -void element2element(const T &value, std::string &str) -{ - if constexpr (std::is_floating_point_v) - str = Precision{}.write(value); - else - convert_t{}(value,str); -} - - - -// ----------------------------------------------------------------------------- -// getBounds -// ----------------------------------------------------------------------------- - -template -auto getBounds(const std::vector &vec) -{ - T zero; - if constexpr (std::is_same_v) zero = ""; else zero = T(0); - std::pair bnd(0,vec.size()); - while (bnd.first < bnd.second && vec[bnd.first ] == zero) ++bnd.first; - while (bnd.first < bnd.second && vec[bnd.second-1] == zero) --bnd.second; - return bnd; -} - -} // namespace detail diff --git a/src/GNDStk/BodyText/src/fromNode.hpp b/src/GNDStk/BodyText/src/fromNode.hpp deleted file mode 100644 index c54b50027..000000000 --- a/src/GNDStk/BodyText/src/fromNode.hpp +++ /dev/null @@ -1,39 +0,0 @@ - -// ----------------------------------------------------------------------------- -// BodyText::fromNode(Node) -// ----------------------------------------------------------------------------- - -void fromNode(const Node &node) -{ - // length, start, and valueType might be present in the Node, but we won't - // fetch any of them here. Elsewhere, the current BodyText object should have - // its length, start, and valueType pulled from those respective values in - // an object of a class derived from Component (which in turn derives from - // BodyText). That object's content will have been pulled from the same Node. - // Here, we just get the Node's values: "plain character data" in XML terms. - - bool found = false; - rawstring = node.pcdata(found); - - if (!found) { - rawstring = ""; - - // Warning, re: why are we in BodyText if there's no body text? - // Perhaps it's possible that the Node has a non-default length and/or - // start, so that the values are all supposed to be...zero. Until and - // unless we discover otherwise, however, we doubt that that would be - // the case, and will consider a Node's lack of plain character data, - // in the present context, to be something that merits a warning. - log::warning( - "Component marked as having \"body text\", a.k.a. XML \"pcdata\" " - "(plain\ncharacter data), " - "but no such content was found in the GNDS node." - ); - log::member("BodyText::fromNode(Node, with name \"{}\")", node.name); - } - - // Above, we set the raw string. The following reflects this, so that the - // vector, or a vector in the variant, will be rebuilt from the raw string - // if and when a caller asks for it. - act = Active::string; -} diff --git a/src/GNDStk/BodyText/src/get.hpp b/src/GNDStk/BodyText/src/get.hpp deleted file mode 100644 index c2ff03d81..000000000 --- a/src/GNDStk/BodyText/src/get.hpp +++ /dev/null @@ -1,563 +0,0 @@ - -// ----------------------------------------------------------------------------- -// Cases -// ----------------------------------------------------------------------------- - -/* ------------------------- -When DATA == void ------------------------- - -Case 1 -Return reference to [const] vector: - get> const - get> -T must be such that vector is in our variant. - -Case 2 -Return reference to [const] T: - get(n) const - get(n) -T must be such that vector is in our variant. - -Case 3 -Return reference to [const] variants>: - get() const - get() - -Case 4 -Return (by value) a variant: - get(n) const - operator[](n) const -A reference return isn't possible with the above two, because there's -no variant to reference; it's computed on-the-fly. The value -return means, further, that non-const version aren't necessary. - -Case 5 -Type-specific getters with specific names: - const std::vector &name() const - std::vector &name() - const T &name(n) const - T &name(n) -For example, name == doubles when T == double. - ------------------------- -When DATA != void ------------------------- - -Case 1 -Return reference to [const] vector: - get> const - get> -T must == DATA. - -Case 2 -Return reference to [const] T: - get(n) const - get(n) -T must == DATA. - -Case 3 -Return reference to [const] vector - get() const - get() - -Case 4 -Return reference to [const] DATA: - get(n) const - operator[](n) const - get(n) - operator[](n) - -Case 5 -Type-specific getters with a specific name: - const std::vector &name() const - std::vector &name() - const DATA &name(n) const - DATA &name(n) -For example, name == doubles if DATA == double. Unlike in the DATA == void case, -we won't have this set of functions for each of name == doubles, name == ints, -name == strings, etc., but only for the name that's appropriate for type DATA. -*/ - - - -// ----------------------------------------------------------------------------- -// 1. get>() -// ----------------------------------------------------------------------------- - -/* ------------------------- -DESCRIPTION ------------------------- - -If active == string: - - Warn if T appears to conflict with valueType. - Warn if length appears to be wrong. - - Make the vector in the variant contain data from the raw string. - INCLUDE any leading and trailing zeros, per start and length. - Note that length == 0 is interpreted as no particular length prescribed. - - Briefly: create vector = [0 ... 0 values_from_raw_string 0 ... 0]. - For the T == string case, 0 really means "" (empty string). - -If active == vector: - - If the variant already contains a vector: - Return it; we're done. - *** Under the correct and normal use of BodyText, *** - *** this simple action will probably be the most common. *** - - Else: - Convert the variant's vector into a vector. - Print a note to the effect that this might be unintentional. - The note can be suppressed if the call *is* intentional. - -In the active == vector case, length, start, and valueType aren't considered -to be relevant, and play no role. We consider those values to be meaningful -ONLY in relation to BodyText's raw string, and we deal with them here only -if and when we make the vector from the raw string. - -That way, callers can access, manipulate, and even completely change the -vector's contents or its type - basically, can work in peace with a vector, -as someone working with data would surely often want to do - without length, -start, or valueType interfering with the process. Those values are considered -to be relevant ONLY when we absolutely must deal with the raw string. This -generally happens only during creation of the current object from a Node, -or creation of a Node from the current object. (And if we create a Node from -a vector in the current object, then we'll compute length, etc. for ourselves. -See the toNode() function for more information about that.) - -Therefore, if you want length, start, and valueType to be used, then proceed -as follows. Set the raw string to what you wish, using the string() setter. -Set length, start, or valueType as you wish, either before or after possibly -setting the string. Finally, after doing all that, do a get>(). -Then the vector in the variant will be remade, per the new string and/or the -length etc. parameters, as described earlier in this descriptive comment, if -and when a get> function is next called. - -The return value of the const version is a const reference to a (possibly -newly converted-to from the raw string, possibly existing, or possibly remade) -vector in the variant. Note that because the variant was declared to be -mutable, we were indeed able to rebuild the vector if doing so was necessary. -But we'll still return a *const* reference in that case, because the present -object is conceptually const, and a caller shouldn't therefore be allowed to -modify the vector outside of BodyText's machinery. - -Of course we also have a non-const version, for a non-const *this. -*/ - - -// const -template -std::enable_if_t< - ( runtime && detail::isAlternative) || - (!runtime && std::is_same_v>), - const VECTOR & -> get() const -{ - // Element type requested - using T = typename VECTOR::value_type; - - - // ------------------------ - // if active == string - // ------------------------ - - if (active() == Active::string) { - static const std::string context_rebuilding = - "BodyText::get>(), remade from raw string"; - - // Completely rebuild the vector from the raw string, making use of - // length, start, and valueType. - - // For this get(), the caller has stipulated a particular vector type. - // We'll print a warning if that vector type appears to conflict with - // valueType. Regardless, we'll return what the caller requested. Note - // that valueType == "" is acceptable with any element type. - if (valueType() != "" && !detail::MapTypeString::find(valueType())) { - log::warning( - "Vector element type may be inconsistent with valueType \"{}\";\n" - "we'll create the requested std::vector<> anyway", - valueType() - ); - log::member(context_rebuilding); - } - - // Initialize - VECTOR *to; - if constexpr (runtime) { - variant = VECTOR{}; - to = &std::get(variant); // std::get, not this get :-) - } else { - vector.clear(); - to = &vector; - } - - T zero; - if constexpr (std::is_same_v) zero = ""; else zero = T(0); - - // [*****----------]: leading 0s - for (std::size_t i = 0; i < start(); ++i) - to->push_back(zero); - - // [-----*****-----]: values from the raw string - std::istringstream iss(rawstring); - if constexpr (std::is_floating_point_v) { - std::string str; - while (iss >> str) - to->push_back( - detail::Precision{}.read(str) - ); - } else { - T element; - while (iss >> element) - to->push_back(element); - } - - // Print a warning if length appears to be impossible because we already - // have more than that number of values. (But length == 0 is ignored.) - if (0 < length() && length() < to->size()) { - log::warning( - "The value of length == {} appears to be wrong, because we\n" - "already have {} values from start == {}, plus {} values read\n" - "from the raw string, for a total of {} values.", - length(), - start(), - start(), - to->size() - start(), - to->size() - ); - log::member(context_rebuilding); - } - - // [----------*****]: trailing 0s - for (std::size_t i = to->size(); i < length(); ++i) - to->push_back(zero); - - act = Active::vector; // was string; now is vector - return *to; - } // if (active == Active::string) - - - // ------------------------ - // if active == vector - // ------------------------ - - if constexpr (runtime) { - // VARIANT CASE... - // Do we already have a vector of the requested type? - if (std::holds_alternative(variant)) - return std::get(variant); - - // If we reach this point, it means two things. (1) We're NOT remaking - // a vector from the raw string (that case was handled first). (2) The - // caller wants a vector of a different type than the type the variant - // currently holds (or we'd have returned immediately above). - // - // So, for example, perhaps the variant currently has a vector, - // and a call get>() was made, meaning that the caller - // wants a vector. - // - // BodyText is intended to store just one vector - one that represents - // values in a GNDS node that has "body text." We don't, and shouldn't, - // try to juggle multiple vectors of different types. Therefore, we'll - // attempt to convert the existing vector to one of the requested type, - // then place the new vector into the variant (replacing the old one.) - // - // This is arguably an odd situation, but one that might - might - have - // some utility. (We're not sure yet.) So, we'll print an informational - // note (not even a warning), then proceed. - - log::info( - "Re-forming vector of one type into vector of another type;\n" - "was this intentional?"); - log::member("BodyText::get>()"); - - // Initialize a new vector that will soon replace the old one - VECTOR newVector; - newVector.reserve(size()); - - // Convert elements from the old vector to the new vector - std::visit( - [&newVector](auto &&oldVector) - { - for (const auto &from : oldVector) { - newVector.push_back(T()); - detail::element2element(from,newVector.back()); - } - }, - variant - ); - - // Replace the existing vector with the new vector - variant = newVector; - return std::get(variant); - - } else { - // VECTOR CASE... - // The vector is (via SFINAE) already of the requested type - return vector; - } -} - - -// non-const -template -std::enable_if_t< - ( runtime && detail::isAlternative) || - (!runtime && std::is_same_v>), - VECTOR & -> get() -{ - return const_cast(std::as_const(*this).template get()); -} - - - -// ----------------------------------------------------------------------------- -// 2. get(n) -// ----------------------------------------------------------------------------- - -// For DATA == void (so that we have a variants>): -// These trigger a complete rebuild of the vector, if it isn't already of type -// vector for the given T. This is intentional, in order to provide maximum -// flexibility. However, be aware of it, for the sake of efficiency! In general, -// when using a BodyText object, we recommend sticking with one underlying type. - -// For DATA != void (so that we have a vector): -// T == DATA is required, so that returning an element of the vector will -// return a reference to T. (A constructibility/convertibility requirement that -// we have in other BodyText-related code thus needs to be more stringent here. -// We can't just be able to make a T from a DATA. Those must in fact be the same -// type, because we return a reference.) - -// For both of the above cases: -// If the string (not the variant or the vector) is active, then a rebuild from -// the string is necessary, and will happen in the get>() call. - -// const -template -std::enable_if_t< - supported && (runtime || std::is_same_v), - const T & -> -get(const std::size_t n) const -{ - try { - return get>()[n]; - } catch (...) { - log::member("BodyText::get({})", n); - throw; - } -} - -// non-const -template -std::enable_if_t< - supported && (runtime || std::is_same_v), - T & -> -get(const std::size_t n) -{ - return const_cast(std::as_const(*this).template get(n)); -} - - - -// ----------------------------------------------------------------------------- -// 3. get() -// If DATA == void, returns a variants>. -// If DATA != void, returns a vector<>. -// ----------------------------------------------------------------------------- - -// const -std::conditional_t< - runtime, - const VariantOfVectors &, - const std::vector & -> get() const -{ - if constexpr (runtime) { - detail::MapStringType( - valueType(), - [this](auto &&t) { get>>(); } - ); - // We can't return the specific variant alternative that was just put - // in place; it depended on a run-time check. So, we return the whole - // variant, for whatever use that might have to a caller. - return variant; - } else { - // Simpler, but we do still need a get (in case the *string* is active). - get>(); - return vector; - } -} - -// non-const -std::conditional_t< - runtime, - VariantOfVectors &, - std::vector & -> get() -{ - return const_cast< - std::conditional_t< - runtime, - VariantOfVectors &, - std::vector & - > - >(std::as_const(*this).get()); -} - - - -// ----------------------------------------------------------------------------- -// 4. get(n) -// -// If DATA == void, returns a variant (by value, because the returned -// object must be made on-the-fly from our variants>). -// -// If DATA != void, returns a scalar of type [const] DATA (by reference, because -// it's available directly in our vector). -// ----------------------------------------------------------------------------- - -// ------------------------ -// const -// ------------------------ - -// get(n) -std::conditional_t< - runtime, - VariantOfScalars, - const data_t & -> get(const std::size_t n) const -{ - try { - get(); - if constexpr (runtime) { - return std::visit( - [n](auto &&alt) { return VariantOfScalars(alt[n]); }, - variant - ); - } else { - return vector[n]; - } - } catch (...) { - log::member("BodyText::get({})", n); - throw; - } -} - -// operator[](n): useful alternative form -std::conditional_t< - runtime, - VariantOfScalars, - const data_t & -> operator[](const std::size_t n) const -{ - return get(n); -} - - -// ------------------------ -// non-const -// ------------------------ - -// If DATA == void: -// Not needed, because the const versions return by value. -// -// If DATA != void: -// Meaningful, because returns are by reference in this (DATA != void) case. -// So, we'll enable non-const versions for this case only. - -// In case anyone wonders, D (not just DATA) is needed below because SFINAE -// applies when template argument *deduction* is taking place. DATA is already -// fixed, by context - we're in BodyText - and thus it isn't being -// deduced here. Templating these (otherwise non-template) functions with an -// argument that defaults to DATA, then using that argument in the SFINAE, is -// a simple trick that makes the SFINAE work as intended. As for VOID, it's -// necessary in order for the following to be unambiguous with the template -// versions of get(n) that are defined elsewhere in this file. - -// get(n) -template -std::enable_if_t && !detail::isVoid, data_t &> -get(const std::size_t n) -{ - try { - get(); - return vector[n]; - } catch (...) { - log::member("BodyText::get({})", n); - throw; - } -} - -// operator[](n) -template -std::enable_if_t, data_t &> -operator[](const std::size_t n) -{ - return get(n); -} - - - -// ----------------------------------------------------------------------------- -// 5. Type-specific "get()" functions. -// Function names reflect the types: strings(), ints(), doubles(), etc. -// These provide convenient, shorthand access to specific gets. -// ----------------------------------------------------------------------------- - -// Cases: -// vector, const -// vector, non-const -// element, const -// element, non-const - -#define GNDSTK_MAKE_GETTER(name,TYPE) \ - \ - template \ - std::enable_if_t< \ - detail::isVoid || \ - std::is_same_v, const std::vector & \ - > name() const { return get>(); } \ - \ - template \ - std::enable_if_t< \ - detail::isVoid || \ - std::is_same_v, std::vector & \ - > name() { return get>(); } \ - \ - template \ - std::enable_if_t< \ - detail::isVoid || \ - std::is_same_v, const TYPE & \ - > name(const std::size_t n) const { return get(n); } \ - \ - template \ - std::enable_if_t< \ - detail::isVoid || \ - std::is_same_v, TYPE & \ - > name(const std::size_t n) { return get(n); } - -GNDSTK_MAKE_GETTER(strings, std::string) -GNDSTK_MAKE_GETTER(chars, char) -GNDSTK_MAKE_GETTER(schars, signed char) -GNDSTK_MAKE_GETTER(shorts, short) -GNDSTK_MAKE_GETTER(ints, int) -GNDSTK_MAKE_GETTER(longs, long) -GNDSTK_MAKE_GETTER(longlongs, long long) -GNDSTK_MAKE_GETTER(uchars, unsigned char) -GNDSTK_MAKE_GETTER(ushorts, unsigned short) -GNDSTK_MAKE_GETTER(uints, unsigned int) -GNDSTK_MAKE_GETTER(ulongs, unsigned long) -GNDSTK_MAKE_GETTER(ulonglongs, unsigned long long) -GNDSTK_MAKE_GETTER(floats, float) -GNDSTK_MAKE_GETTER(doubles, double) -GNDSTK_MAKE_GETTER(longdoubles, long double) - -#undef GNDSTK_MAKE_GETTER diff --git a/src/GNDStk/BodyText/src/params.hpp b/src/GNDStk/BodyText/src/params.hpp deleted file mode 100644 index c545310f1..000000000 --- a/src/GNDStk/BodyText/src/params.hpp +++ /dev/null @@ -1,98 +0,0 @@ - -// ----------------------------------------------------------------------------- -// length, start, valueType -// We place these into a struct so our setters can use the names themselves. -// ----------------------------------------------------------------------------- - -/* -Quoted [slightly edited] from the official JSON specification files for GNDS: - - length - The total number of data values including leading and trailing zero - values that are not stored. This attribute should only be used when - the sum of start and the number of listed values do not add to the - total number of data values. This should only happen when there are - trailing zeros not listed in the body text. - - start - Default: 0 - For start = N, the first N values are zero and are not stored. - - valueType - Specifies the type of data in the body (e.g., "Integer32", "Float64"). - Only one type of data can be stored in each instance of a values node. - -In some places, e.g. the JSON-format GNDS spec files, these are listed in -a different order: valueType, start, length. Ordering doesn't really matter. -We'll just note, here, that throughout our code, we'll use the length, start, -valueType ordering, to be consistent with the (alphabetical) ordering that -our GNDS Standard Interface code autogeneration tool produces. -*/ - -private: - -// toNode() works with a conceptually const object but may update these to be -// consistent with vector data; so, mutable. -mutable struct { - // Any of these might or might not have appeared in a particular node that - // had body text. For uniformity, we have them all here, and with defaults. - std::size_t length = 0; - std::size_t start = 0; - std::string valueType = ""; -} vars; - - -// ----------------------------------------------------------------------------- -// Getters -// ----------------------------------------------------------------------------- - -public: - -// length -std::size_t length() const -{ - return vars.length; -} - -// start -std::size_t start() const -{ - return vars.start; -} - -// valueType -const std::string &valueType() const -{ - return vars.valueType; -} - - -// ----------------------------------------------------------------------------- -// Setters -// Builder pattern for all: return *this. -// Arguments of std::optional allow for more flexibility in derived classes. -// ----------------------------------------------------------------------------- - -// length -BodyText &length(const std::optional &opt) -{ - if (opt.has_value()) - vars.length = opt.value(); - return *this; -} - -// start -BodyText &start(const std::optional &opt) -{ - if (opt.has_value()) - vars.start = opt.value(); - return *this; -} - -// valueType -BodyText &valueType(const std::optional &opt) -{ - if (opt.has_value()) - vars.valueType = opt.value(); - return *this; -} diff --git a/src/GNDStk/BodyText/src/string.hpp b/src/GNDStk/BodyText/src/string.hpp deleted file mode 100644 index 6ffef6fca..000000000 --- a/src/GNDStk/BodyText/src/string.hpp +++ /dev/null @@ -1,25 +0,0 @@ - -// ----------------------------------------------------------------------------- -// Getters and setters for the raw string -// ----------------------------------------------------------------------------- - -// getter -// string() -// Not to be confused with strings() (plural), which returns vector. -// Returns const &; the raw string can be *changed* only through the setter. -const std::string &string() const -{ - return rawstring; -} - -// setter -// string(new string) -// Builder pattern: return *this, so callers can use this function smoothly -// in conjunction with the setters for length, start, and valueType. -BodyText &string(const std::string &str) -{ - clear(); // <== the vector, because it's no longer considered meaningful - rawstring = str; - act = Active::string; - return *this; -} diff --git a/src/GNDStk/BodyText/src/sync.hpp b/src/GNDStk/BodyText/src/sync.hpp deleted file mode 100644 index 98fa02830..000000000 --- a/src/GNDStk/BodyText/src/sync.hpp +++ /dev/null @@ -1,28 +0,0 @@ - -// pullFromDerived(derived) -// Make this BodyText's length, start, and valueType be consistent with any or -// all such parameters that exist in the given object. Remember that this class, -// BodyText, is a base of Component, which is a base of some other class. -template -void pullFromDerived(const T &obj) -{ - if constexpr (detail::hasLength) - length(obj.content.length); - if constexpr (detail::hasStart) - start(obj.content.start); - if constexpr (detail::hasValueType) - valueType(obj.content.valueType); -} - -// pushToDerived(derived) -// The reverse of the above. -template -void pushToDerived(T &obj) const -{ - if constexpr (detail::hasLength) - obj.content.length = length(); - if constexpr (detail::hasStart) - obj.content.start = start(); - if constexpr (detail::hasValueType) - obj.content.valueType = valueType(); -} diff --git a/src/GNDStk/BodyText/src/toNode.hpp b/src/GNDStk/BodyText/src/toNode.hpp deleted file mode 100644 index 3f9dde5dc..000000000 --- a/src/GNDStk/BodyText/src/toNode.hpp +++ /dev/null @@ -1,93 +0,0 @@ - -// ----------------------------------------------------------------------------- -// BodyText::toNode -// This is called by Component's conversion-to-Node (not toNode()) function. -// It's "toNode()" here, not a conversion, because we're simply writing text -// that Component's full conversion-to-Node will place into the Node itself. -// ----------------------------------------------------------------------------- - -// Use either (1) the original raw string, or (2) the variant of vectors or the -// vector (depending on DATA ==/!= void), based on whether or not the string -// is active. length, start, and valueType might be computed too, in which case -// they're also changed in the derived class in order to keep things consistent. -template -void toNode(std::string &text, DERIVED &derived) const -{ - // Use the raw string? - if (active() == Active::string) { - text = rawstring; - return; - } - - // Use the vector... - const bool isStringVector = - ( runtime && std::holds_alternative>(variant)) || - (!runtime && std::is_same_v); - - if constexpr ( - runtime || - (!runtime && std::is_same_v) - ) { - // the run-time if's get() calls below won't - // necessarily make sense without the above if-constexpr - if (isStringVector && !trim && - // only bother with the warning if trim would make a difference... - size() > 0 && - (get(0) == "" || get(size()-1) == "") - ) { - log::warning( - "BodyText.toNode() called with BodyText " - "trim flag == false, but active\n" - "data are in a vector. Printing " - "leading/trailing empty strings\n" - "won't preserve them, so we'll treat as if trim == true." - ); - } - } - - // Re: leading/trailing 0s - const auto bounds = - trim || isStringVector - ? runtime - ? std::visit([](auto &&vec) { return detail::getBounds(vec); }, variant) - : detail::getBounds(vector) - : std::make_pair(size_t(0),size()); - - // Compute length, start, and valueType - vars.length = size(); // independent of trim - vars.start = bounds.first; // dependent on trim, per the bounds computation - if constexpr (runtime) - vars.valueType = detail::visitMapTypeString(variant); - else - vars.valueType = detail::MapTypeString::value[0]; - pushToDerived(derived); - - // Values - std::ostringstream oss; - - const auto toNodeLambda = - [bounds,&oss](auto &&vec) - { - using T = std::decay_t; - std::size_t count = 0; - - for (auto i = bounds.first; i < bounds.second; ++i) { - oss << (count++ ? " " : ""); - if constexpr (std::is_floating_point_v) { - oss << detail::Precision< - detail::PrecisionContext::data, - T - >{}.write(vec[i]); - } else { - oss << vec[i]; - } - } - }; - - if constexpr (runtime) - std::visit(toNodeLambda,variant); - else - toNodeLambda(vector); - - text = oss.str(); -} diff --git a/src/GNDStk/BodyText/src/write.hpp b/src/GNDStk/BodyText/src/write.hpp deleted file mode 100644 index 98dbb4a64..000000000 --- a/src/GNDStk/BodyText/src/write.hpp +++ /dev/null @@ -1,72 +0,0 @@ - -// ----------------------------------------------------------------------------- -// write -// To an ostream (not to a Node; that a different thing) -// ----------------------------------------------------------------------------- - -std::ostream &write(std::ostream &os, const int level) const -{ - // If empty, don't even write a newline - if ((active() == Active::string && rawstring == "") || - (active() == Active::vector && size() == 0)) - return os; - - // ------------------------ - // If string is active - // ------------------------ - - if (active() == Active::string) { - // write the string exactly as-is, without our column formatting - // or any indentation; then also write a newline - GNDStk::color && GNDStk::colors::value != "" - ? os << colors::value << rawstring << colors::reset - : os << rawstring; - return os << std::endl; - } - - // ------------------------ - // If vector is active - // ------------------------ - - // Indentation (string, with some number of spaces) - const auto indent = std::string(GNDStk::indent*level,' '); - - const auto writeLambda = - [&os,&indent](auto &&alt) - { - std::size_t count = 0; - using T = std::decay_t; - - // use our column formatting - for (auto &element : alt) { - count == 0 - ? os << indent - : GNDStk::across == 0 || count % GNDStk::across != 0 - ? os << ' ' - : os << '\n' << indent; - - if (GNDStk::color && GNDStk::colors::value != "") - os << colors::value; - - if constexpr (std::is_floating_point_v) - os << detail::Precision< - detail::PrecisionContext::data, - T - >{}.write(element); - else - os << element; - - if (GNDStk::color && GNDStk::colors::value != "") - os << colors::reset; - - count++; - }; - }; - - if constexpr (runtime) - std::visit(writeLambda,variant); - else - writeLambda(vector); - - return os << std::endl; -} diff --git a/src/GNDStk/BodyText/test/BodyText.test.cpp b/src/GNDStk/BodyText/test/BodyText.test.cpp deleted file mode 100644 index 09cb28cc8..000000000 --- a/src/GNDStk/BodyText/test/BodyText.test.cpp +++ /dev/null @@ -1,192 +0,0 @@ - -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk.hpp" - -using namespace njoy::GNDStk::core; - - -// ----------------------------------------------------------------------------- -// Scenario for DATA == void -// ----------------------------------------------------------------------------- - -SCENARIO("Testing GNDStk BodyText with DATA == void") { - // Most BodyText functionality is tested in the individual test files. - // There are just a few things we'll do here. - - // Ensure that we can make const and non-const and BodyText - // objects. Note that BodyText has only a default constructor. - - GIVEN("A const BodyText cbtextt") { - const BodyText cbtextt; - THEN("It constructed correctly, and its data are as expected") { - CHECK(cbtextt.length () == 0); - CHECK(cbtextt.size () == 0); - CHECK(cbtextt.valueType() == ""); - CHECK(cbtextt.string () == ""); - } - } - - GIVEN("A const BodyText cbtextf") { - const BodyText cbtextf; - THEN("It constructed correctly") { - // no data for - } - } - - GIVEN("A non-const BodyText nbtextt") { - BodyText nbtextt; - THEN("It constructed correctly, and its data are as expected") { - CHECK(nbtextt.length () == 0); - CHECK(nbtextt.size () == 0); - CHECK(nbtextt.valueType() == ""); - CHECK(nbtextt.string () == ""); - } - } - - GIVEN("A non-const BodyText nbtextf") { - BodyText nbtextf; - THEN("It constructed correctly") { - // no data for - } - } - - // clear() and size() are defined (at the time of this writing) in the - // BodyText.hpp file itself, so we'll test them here. size() actually - // was used in various tests, and thus was indirectly tested elsewhere. - - GIVEN("A BodyText") { - // clear - WHEN("We test clear()") { - BodyText b; - - // try int - THEN("size() works correctly for vector") { - b = std::vector{1,2,3,4,5}; - CHECK(b.size() == 5); - b.clear(); - CHECK(b.size() == 0); - } - - // try double - THEN("size() works correctly for vector") { - b = std::vector{1.1, 2.2, 3.3, 4.4, 5.5}; - CHECK(b.size() == 5); - b.clear(); - CHECK(b.size() == 0); - } - - // try string - THEN("size() works correctly for vector") { - b = std::vector{"one","two","three","four","five"}; - CHECK(b.size() == 5); - b.clear(); - CHECK(b.size() == 0); - } - } - - // size - WHEN("We test size()") { - BodyText b; - - // try int - THEN("size() works correctly for vector") { - b = std::vector{1,2,3,4,5}; - CHECK(b.size() == 5); - b = std::vector{1}; - CHECK(b.size() == 1); - b = std::vector{}; - CHECK(b.size() == 0); - } - - // try double - THEN("size() works correctly for vector") { - b = std::vector{1.1, 2.2, 3.3, 4.4, 5.5}; - CHECK(b.size() == 5); - b = std::vector{1.1}; - CHECK(b.size() == 1); - b = std::vector{}; - CHECK(b.size() == 0); - } - - // try string - THEN("size() works correctly for vector") { - b = std::vector{"one","two","three","four","five"}; - CHECK(b.size() == 5); - b = std::vector{"one"}; - CHECK(b.size() == 1); - b = std::vector{}; - CHECK(b.size() == 0); - } - } - } -} // SCENARIO - - -// ----------------------------------------------------------------------------- -// Scenario for DATA != void -// ----------------------------------------------------------------------------- - -SCENARIO("Testing GNDStk BodyText with DATA != void") { - - GIVEN("A const BodyText cbtextt") { - const BodyText cbtextt; - THEN("It constructed correctly, and its data are as expected") { - CHECK(cbtextt.length () == 0); - CHECK(cbtextt.size () == 0); - CHECK(cbtextt.valueType() == ""); - CHECK(cbtextt.string () == ""); - } - } - - GIVEN("A const BodyText cbtextf") { - const BodyText cbtextf; - THEN("It constructed correctly") { - // no data for - } - } - - GIVEN("A non-const BodyText nbtextt") { - BodyText nbtextt; - THEN("It constructed correctly, and its data are as expected") { - CHECK(nbtextt.length () == 0); - CHECK(nbtextt.size () == 0); - CHECK(nbtextt.valueType() == ""); - CHECK(nbtextt.string () == ""); - } - } - - GIVEN("A non-const BodyText nbtextf") { - BodyText nbtextf; - THEN("It constructed correctly") { - // no data for - } - } - - GIVEN("A BodyText") { - // clear - WHEN("We test clear()") { - BodyText b; - THEN("size() works correctly") { - b = std::vector{1,2,3,4,5}; - CHECK(b.size() == 5); - b.clear(); - CHECK(b.size() == 0); - } - } - - // size - WHEN("We test size()") { - BodyText b; - THEN("size() works correctly") { - b = std::vector{"one","two","three","four","five"}; - CHECK(b.size() == 5); - b = std::vector{"one"}; - CHECK(b.size() == 1); - b = std::vector{}; - CHECK(b.size() == 0); - } - } - } -} // SCENARIO diff --git a/src/GNDStk/BodyText/test/CMakeLists.txt b/src/GNDStk/BodyText/test/CMakeLists.txt deleted file mode 100644 index 37cdf9076..000000000 --- a/src/GNDStk/BodyText/test/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ - -add_executable( GNDStk.BodyText.test - BodyText.test.cpp - assign.test.cpp - detail.test.cpp - fromNode.test.cpp - get.test.cpp - params.test.cpp - string.test.cpp - sync.test.cpp - toNode.test.cpp - types.test.cpp - write.test.cpp ) -target_compile_options( GNDStk.BodyText.test PRIVATE ${${PREFIX}_common_flags} -$<$:${${PREFIX}_strict_flags}>$<$: -${${PREFIX}_DEBUG_flags} -$<$:${${PREFIX}_coverage_flags}>> -$<$: -${${PREFIX}_RELEASE_flags} -$<$:${${PREFIX}_link_time_optimization_flags}> -$<$:${${PREFIX}_nonportable_optimization_flags}>> - -${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.BodyText.test PUBLIC GNDStk ) -add_test( NAME GNDStk.BodyText COMMAND GNDStk.BodyText.test ) diff --git a/src/GNDStk/BodyText/test/detail.test.cpp b/src/GNDStk/BodyText/test/detail.test.cpp deleted file mode 100644 index 5083a4f2e..000000000 --- a/src/GNDStk/BodyText/test/detail.test.cpp +++ /dev/null @@ -1,421 +0,0 @@ - -#include "catch.hpp" -#include "GNDStk.hpp" - -using namespace njoy::GNDStk::core; -inline std::string bar = "bar"; - -// ----------------------------------------------------------------------------- -// Scenario -// ----------------------------------------------------------------------------- - -SCENARIO("Testing various BodyText-related detail:: constructs") { - - // ------------------------ - // scalarize - // ------------------------ - - GIVEN("Some variants of vectors") { - using vc = std::variant< - std::vector - >; - using vci = std::variant< - std::vector, - std::vector - >; - using vcid = std::variant< - std::vector, - std::vector, - std::vector - >; - - // Double parenthesis are needed for the CHECK macro, - // because of the commas... - THEN("detail::scalarize() works correctly") { - CHECK(( - std::is_same_v< - decltype(detail::scalarize(vc{})), - std::variant - > - )); - CHECK(( - std::is_same_v< - decltype(detail::scalarize(vci{})), - std::variant - > - )); - CHECK(( - std::is_same_v< - decltype(detail::scalarize(vcid{})), - std::variant - > - )); - } - } // GIVEN - - - // ------------------------ - // decays - // ------------------------ - - GIVEN("Testing detail::decays") { - using tup1 = std::tuple<>; - using tup2 = std::tuple; - using tup3 = std::tuple; - using tup4 = std::tuple; - using tup5 = std::tuple; - - CHECK((std::is_same_v, std::tuple<>>)); - CHECK((std::is_same_v, std::tuple>)); - CHECK((std::is_same_v, std::tuple>)); - CHECK((std::is_same_v, std::tuple>)); - CHECK((std::is_same_v, std::tuple>)); - } // GIVEN - - - // ------------------------ - // hasLength, hasStart, - // hasValueType - // ------------------------ - - GIVEN("Testing detail::hasLength, hasStart, and hasValueType") { - WHEN("A struct's content has length, start, and valueType") { - struct { - struct { - int length; - const double start = 0; - const std::string &valueType = bar; - } content; - } foo; - THEN("Our SFINAE helpers detect this") { - CHECK((detail::hasLength == true)); - CHECK((detail::hasStart == true)); - CHECK((detail::hasValueType == true)); - } - } - - WHEN("A struct's content has start and valueType") { - struct { - struct { - const double start = 0; - const std::string &valueType = bar; - } content; - } foo; - THEN("Our SFINAE helpers detect this") { - CHECK((detail::hasLength == false)); - CHECK((detail::hasStart == true)); - CHECK((detail::hasValueType == true)); - } - } - - WHEN("A struct's content has length and valueType") { - struct { - struct { - int length; - const std::string &valueType = bar; - } content; - } foo; - THEN("Our SFINAE helpers detect this") { - CHECK((detail::hasLength == true)); - CHECK((detail::hasStart == false)); - CHECK((detail::hasValueType == true)); - } - } - - WHEN("A struct's content has length and start") { - struct { - struct { - int length; - const double start = 0; - } content; - } foo; - THEN("Our SFINAE helpers detect this") { - CHECK((detail::hasLength == true)); - CHECK((detail::hasStart == true)); - CHECK((detail::hasValueType == false)); - } - } - - WHEN("A struct's content has length") { - struct { - struct { - int length; - } content; - } foo; - THEN("Our SFINAE helpers detect this") { - CHECK((detail::hasLength == true)); - CHECK((detail::hasStart == false)); - CHECK((detail::hasValueType == false)); - } - } - - WHEN("A struct's content has start") { - struct { - struct { - const double start = 0; - } content; - } foo; - THEN("Our SFINAE helpers detect this") { - CHECK((detail::hasLength == false)); - CHECK((detail::hasStart == true)); - CHECK((detail::hasValueType == false)); - } - } - - WHEN("A struct's content has valueType") { - struct { - struct { - const std::string &valueType = bar; - } content; - } foo; - THEN("Our SFINAE helpers detect this") { - CHECK((detail::hasLength == false)); - CHECK((detail::hasStart == false)); - CHECK((detail::hasValueType == true)); - } - } - - WHEN("A struct's content has none of length, start, or valueType") { - struct { - struct { - } content; - } foo; - THEN("Our SFINAE helpers detect this") { - CHECK((detail::hasLength == false)); - CHECK((detail::hasStart == false)); - CHECK((detail::hasValueType == false)); - } - } - } // GIVEN - - - // ------------------------ - // element2element - // ------------------------ - - GIVEN("Testing detail::element2element") { - WHEN("We use element2element(from int, to string)") { - const int from = 123; - std::string to; - detail::element2element(from,to); - CHECK(to == "123"); - } - - WHEN("We use element2element(from double, to string)") { - const double from = 4.56; - std::string to; - detail::element2element(from,to); - CHECK(to == "4.56"); - } - - WHEN("We use element2element(from string, to int)") { - const std::string from = "987"; - int to; - detail::element2element(from,to); - CHECK(to == 987); - } - - WHEN("We use element2element(from string, to double)") { - const std::string from = "6.54"; - double to; - detail::element2element(from,to); - CHECK(Approx(to) == 6.54); - } - - WHEN("We use element2element(from int, to double)") { - const int from = 345; - double to; - detail::element2element(from,to); - CHECK(to == double(345)); - } - - WHEN("We use element2element(from double, to int)") { - const double from = 6.78; - int to; - detail::element2element(from,to); - CHECK(to == 6); - } - } - - - // ------------------------ - // getBounds - // ------------------------ - - GIVEN("Testing detail::getBounds") { - - // ------------------------ - // Various vectors - // ------------------------ - - WHEN("We try vectors of varying sizes") { - - THEN("Bounds are correct when size == 0") { - std::vector v = {}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 0); - CHECK(bounds.second == 0); - } - - THEN("Bounds are correct when size == 1, with a 0") { - std::vector v = {0}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 1); - CHECK(bounds.second == 1); - } - - THEN("Bounds are correct when size == 2, all 0") { - std::vector v = {0, 0}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 2); - CHECK(bounds.second == 2); - } - - THEN("Bounds are correct when size == 3, all non-0") { - std::vector v = {2, 3, 5}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 0); - CHECK(bounds.second == 3); - } - - THEN("Bounds are correct when there are trailing 0s") { - std::vector v = {2, 3, 5, 0, 0, 0}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 0); - CHECK(bounds.second == 3); - } - - THEN("Bounds are correct when there are leading 0s") { - std::vector v = {0, 0, 2, 3, 5}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 2); - CHECK(bounds.second == 5); - } - - THEN("Bounds are correct when there are leading and trailing 0s") { - std::vector v = {0, 0, 2, 3, 5, 0, 0, 0}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 2); - CHECK(bounds.second == 5); - } - - } // WHEN - - - // ------------------------ - // Various vectors - // ------------------------ - - WHEN("We try vectors of varying sizes") { - - THEN("Bounds are correct when size == 0") { - std::vector v = {}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 0); - CHECK(bounds.second == 0); - } - - THEN("Bounds are correct when size == 1, with a 0") { - std::vector v = {0}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 1); - CHECK(bounds.second == 1); - } - - THEN("Bounds are correct when size == 3, all 0") { - std::vector v = {0, 0, 0}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 3); - CHECK(bounds.second == 3); - } - - THEN("Bounds are correct when size == 3, all non-0") { - std::vector v = {1.2, 3.4, 5.6}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 0); - CHECK(bounds.second == 3); - } - - THEN("Bounds are correct when there are trailing 0s") { - std::vector v = {1.2, 3.4, 5.6, 0, 0}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 0); - CHECK(bounds.second == 3); - } - - THEN("Bounds are correct when there are leading 0s") { - std::vector v = {0, 0, 0, 1.2, 3.4, 5.6}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 3); - CHECK(bounds.second == 6); - } - - THEN("Bounds are correct when there are leading and trailing 0s") { - std::vector v = {0, 0, 0, 1.2, 3.4, 5.6, 0, 0}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 3); - CHECK(bounds.second == 6); - } - - } - - - // ------------------------ - // Various vectors - // ------------------------ - - WHEN("We try vectors of varying sizes") { - - THEN("Bounds are correct when size == \"\"") { - std::vector v = {}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 0); - CHECK(bounds.second == 0); - } - - THEN("Bounds are correct when size == 1, with a \"\"") { - std::vector v = {""}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 1); - CHECK(bounds.second == 1); - } - - THEN("Bounds are correct when size == 2, all \"\"") { - std::vector v = {"", ""}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 2); - CHECK(bounds.second == 2); - } - - THEN("Bounds are correct when size == 2, all non-\"\"") { - std::vector v = {"abc", "def"}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 0); - CHECK(bounds.second == 2); - } - - THEN("Bounds are correct when there are trailing \"\"s") { - std::vector v = {"abc", "def", "", "", ""}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 0); - CHECK(bounds.second == 2); - } - - THEN("Bounds are correct when there are leading \"\"s") { - std::vector v = {"", "", "abc", "def"}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 2); - CHECK(bounds.second == 4); - } - - THEN("Bounds are correct when there are leading and trailing \"\"s") { - std::vector v = {"", "", "abc", "def", "", "", ""}; - const auto bounds = detail::getBounds(v); - CHECK(bounds.first == 2); - CHECK(bounds.second == 4); - } - - } // WHEN - } // GIVEN - -} // SCENARIO diff --git a/src/GNDStk/BodyText/test/fromNode.test.cpp b/src/GNDStk/BodyText/test/fromNode.test.cpp deleted file mode 100644 index 25e6c5059..000000000 --- a/src/GNDStk/BodyText/test/fromNode.test.cpp +++ /dev/null @@ -1,115 +0,0 @@ - -#include "catch.hpp" -#include "GNDStk.hpp" - -using namespace njoy::GNDStk::core; - - -// ----------------------------------------------------------------------------- -// Scenario for DATA == void -// ----------------------------------------------------------------------------- - -SCENARIO("BodyText fromNode()") { - - GIVEN("A Node with no \"body text\"") { - WHEN("BodyText.fromNode(the node) is called") { - THEN("The BodyText's raw string is \"\", as expected") { - BodyText b; - b.string("This string should be replaced"); - CHECK(b.string() != ""); - - Node node; - node << ""; - b.fromNode(node); - CHECK(b.string() == ""); - } - } - } - - GIVEN("A Node with some \"body text\"") { - WHEN("BodyText.fromNode(the node) is called") { - THEN("The BodyText's raw string equals the text from the Node") { - BodyText b; - b.string("This string should be replaced"); - CHECK(b.string() != ""); - - Node node; - - node << "some plain character data"; - b.fromNode(node); - CHECK(b.string() == "some plain character data"); - - // it shouldn't matter, but leading spaces are preserved - node << " pcdata with leading spaces"; - b.fromNode(node); - CHECK(b.string() == " pcdata with leading spaces"); - - // ditto for trailing spaces - node << "pcdata with trailing spaces "; - b.fromNode(node); - CHECK(b.string() == "pcdata with trailing spaces "); - - // ditto for both together - node << " pcdata "; - b.fromNode(node); - CHECK(b.string() == " pcdata "); - } - } - } - -} // SCENARIO - - -// ----------------------------------------------------------------------------- -// Scenario for DATA != void -// ----------------------------------------------------------------------------- - -SCENARIO("BodyText fromNode()") { - - GIVEN("A Node with no \"body text\"") { - WHEN("BodyText.fromNode(the node) is called") { - THEN("The BodyText's raw string is \"\", as expected") { - BodyText b; - b.string("This string should be replaced"); - CHECK(b.string() != ""); - - Node node; - node << ""; - b.fromNode(node); - CHECK(b.string() == ""); - } - } - } - - GIVEN("A Node with some \"body text\"") { - WHEN("BodyText.fromNode(the node) is called") { - THEN("The BodyText's raw string equals the text from the Node") { - BodyText b; - b.string("This string should be replaced"); - CHECK(b.string() != ""); - - Node node; - - node << "some plain character data"; - b.fromNode(node); - CHECK(b.string() == "some plain character data"); - - // it shouldn't matter, but leading spaces are preserved - node << " pcdata with leading spaces"; - b.fromNode(node); - CHECK(b.string() == " pcdata with leading spaces"); - - // ditto for trailing spaces - node << "pcdata with trailing spaces "; - b.fromNode(node); - CHECK(b.string() == "pcdata with trailing spaces "); - - // ditto for both together - node << " pcdata "; - b.fromNode(node); - CHECK(b.string() == " pcdata "); - } - } - } - -} // SCENARIO diff --git a/src/GNDStk/BodyText/test/get.test.cpp b/src/GNDStk/BodyText/test/get.test.cpp deleted file mode 100644 index 4179ce9af..000000000 --- a/src/GNDStk/BodyText/test/get.test.cpp +++ /dev/null @@ -1,693 +0,0 @@ - -#include "catch.hpp" -#include "GNDStk.hpp" - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// 1. Scenario: get() -// ----------------------------------------------------------------------------- - -// Helper -template -void scenario_get_vector() -{ - // We'll deal with these vector types for the test. They should cover - // sufficient cases (int, double, string, and none of the above) - // that we get good coverage, without this test being excessively long. - using ivec = std::vector; - using fvec = std::vector; - using svec = std::vector; - using uvec = std::vector; - - // We'll leave valueType at its default of "", which is compatible with - // every possible get type T. This simply means we won't get spammed - // with warnings about the asked-for T possibly being incompatible with - // valueType. Either way - with or without a "" for valueType - get - // gives us back a vector. - - // ------------------------ - // vector - // ------------------------ - - // 0 elements in string - { BodyText b; b.start(0).length(0).string(""); - CHECK((b.template get() == ivec{})); } - { BodyText b; b.start(0).length(4).string(""); - CHECK((b.template get() == ivec{{0,0,0,0}})); } - { BodyText b; b.start(1).length(5).string(""); - CHECK((b.template get() == ivec{{0,0,0,0,0}})); } - { BodyText b; b.start(2).length(6).string(""); - CHECK((b.template get() == ivec{{0,0,0,0,0,0}})); } - - // 1 element in string - { BodyText b; b.start(0).length(0).string("-12"); - CHECK((b.template get() == ivec(1,-12))); } - { BodyText b; b.start(0).length(4).string("-12"); - CHECK((b.template get() == ivec{{-12,0,0,0}})); } - { BodyText b; b.start(1).length(5).string("-12"); - CHECK((b.template get() == ivec{{0,-12,0,0,0}})); } - { BodyText b; b.start(2).length(6).string("-12"); - CHECK((b.template get() == ivec{{0,0,-12,0,0,0}})); } - - // 3 elements in string - { BodyText b; b.start(0).length(0).string("-12 34 -56"); - CHECK((b.template get() == ivec{{-12,34,-56}})); } - { BodyText b; b.start(0).length(4).string("-12 34 -56"); - CHECK((b.template get() == ivec{{-12,34,-56,0}})); } - { BodyText b; b.start(1).length(5).string("-12 34 -56"); - CHECK((b.template get() == ivec{{0,-12,34,-56,0}})); } - { BodyText b; b.start(2).length(6).string("-12 34 -56"); - CHECK((b.template get() == ivec{{0,0,-12,34,-56,0}})); } - - // ------------------------ - // vector - // ------------------------ - - // 0 elements in string - { BodyText b; b.start(0).length(0).string(""); - CHECK((b.template get() == fvec{})); } - { BodyText b; b.start(0).length(4).string(""); - CHECK((b.template get() == fvec{{0,0,0,0}})); } - { BodyText b; b.start(1).length(5).string(""); - CHECK((b.template get() == fvec{{0,0,0,0,0}})); } - { BodyText b; b.start(2).length(6).string(""); - CHECK((b.template get() == fvec{{0,0,0,0,0,0}})); } - - // 1 element in string - { BodyText b; b.start(0).length(0).string("1.2"); - CHECK((b.template get() == fvec(1,1.2))); } - { BodyText b; b.start(0).length(4).string("1.2"); - CHECK((b.template get() == fvec{{1.2,0,0,0}})); } - { BodyText b; b.start(1).length(5).string("1.2"); - CHECK((b.template get() == fvec{{0,1.2,0,0,0}})); } - { BodyText b; b.start(2).length(6).string("1.2"); - CHECK((b.template get() == fvec{{0,0,1.2,0,0,0}})); } - - // 3 elements in string - { BodyText b; b.start(0).length(0).string("1.2 3.4 5.6"); - CHECK((b.template get() == fvec{{1.2,3.4,5.6}})); } - { BodyText b; b.start(0).length(4).string("1.2 3.4 5.6"); - CHECK((b.template get() == fvec{{1.2,3.4,5.6,0}})); } - { BodyText b; b.start(1).length(5).string("1.2 3.4 5.6"); - CHECK((b.template get() == fvec{{0,1.2,3.4,5.6,0}})); } - { BodyText b; b.start(2).length(6).string("1.2 3.4 5.6"); - CHECK((b.template get() == fvec{{0,0,1.2,3.4,5.6,0}})); } - - // ------------------------ - // vector - // ------------------------ - - // 0 elements in string - { BodyText b; b.start(0).length(0).string(""); - CHECK((b.template get() == svec{})); } - { BodyText b; b.start(0).length(4).string(""); - CHECK((b.template get() == svec{{"","","",""}})); } - { BodyText b; b.start(1).length(5).string(""); - CHECK((b.template get() == svec{{"","","","",""}})); } - { BodyText b; b.start(2).length(6).string(""); - CHECK((b.template get() == svec{{"","","","","",""}})); } - - // 1 element in string - { BodyText b; b.start(0).length(0).string("ab"); - CHECK((b.template get() == svec(1,"ab"))); } - { BodyText b; b.start(0).length(4).string("ab"); - CHECK((b.template get() == svec{{"ab","","",""}})); } - { BodyText b; b.start(1).length(5).string("ab"); - CHECK((b.template get() == svec{{"","ab","","",""}})); } - { BodyText b; b.start(2).length(6).string("ab"); - CHECK((b.template get() == svec{{"","","ab","","",""}})); } - - // 3 elements in string - { BodyText b; b.start(0).length(0).string("ab cd ef"); - CHECK((b.template get() == svec{{"ab","cd","ef"}})); } - { BodyText b; b.start(0).length(4).string("ab cd ef"); - CHECK((b.template get() == svec{{"ab","cd","ef",""}})); } - { BodyText b; b.start(1).length(5).string("ab cd ef"); - CHECK((b.template get() == svec{{"","ab","cd","ef",""}})); } - { BodyText b; b.start(2).length(6).string("ab cd ef"); - CHECK((b.template get() == svec{{"","","ab","cd","ef",""}})); } - - // ------------------------ - // vector - // ------------------------ - - // 0 elements in string - { BodyText b; b.start(0).length(0).string(""); - CHECK((b.template get() == uvec{})); } - { BodyText b; b.start(0).length(4).string(""); - CHECK((b.template get() == uvec{{0,0,0,0}})); } - { BodyText b; b.start(1).length(5).string(""); - CHECK((b.template get() == uvec{{0,0,0,0,0}})); } - { BodyText b; b.start(2).length(6).string(""); - CHECK((b.template get() == uvec{{0,0,0,0,0,0}})); } - - // 1 element in string - { BodyText b; b.start(0).length(0).string("12"); - CHECK((b.template get() == uvec(1,12))); } - { BodyText b; b.start(0).length(4).string("12"); - CHECK((b.template get() == uvec{{12,0,0,0}})); } - { BodyText b; b.start(1).length(5).string("12"); - CHECK((b.template get() == uvec{{0,12,0,0,0}})); } - { BodyText b; b.start(2).length(6).string("12"); - CHECK((b.template get() == uvec{{0,0,12,0,0,0}})); } - - // 3 elements in string - { BodyText b; b.start(0).length(0).string("12 34 56"); - CHECK((b.template get() == uvec{{12,34,56}})); } - { BodyText b; b.start(0).length(4).string("12 34 56"); - CHECK((b.template get() == uvec{{12,34,56,0}})); } - { BodyText b; b.start(1).length(5).string("12 34 56"); - CHECK((b.template get() == uvec{{0,12,34,56,0}})); } - { BodyText b; b.start(2).length(6).string("12 34 56"); - CHECK((b.template get() == uvec{{0,0,12,34,56,0}})); } -} - -// For BodyText -SCENARIO("BodyText get()") { - GIVEN("A BodyText object") { - scenario_get_vector(); - } -} - -// For BodyText -SCENARIO("BodyText get()") { - GIVEN("A BodyText object") { - scenario_get_vector(); - } -} - - - -// ----------------------------------------------------------------------------- -// 2. Scenario: get(n) -// ----------------------------------------------------------------------------- - -// Helper -template -void scenario_get_template_n() -{ - // ------------------------ - // vector - // ------------------------ - - // 0 elements in string - { BodyText b; b.start(0).length(0).string(""); /* no elements */ } - { BodyText b; b.start(0).length(4).string(""); - CHECK(b.template get(1) == 0); } - { BodyText b; b.start(1).length(5).string(""); - CHECK(b.template get(2) == 0); } - { BodyText b; b.start(2).length(6).string(""); - CHECK(b.template get(3) == 0); } - - // 1 element in string - { BodyText b; b.start(0).length(0).string("-12"); - CHECK(b.template get(0) == -12); } - { BodyText b; b.start(0).length(4).string("-12"); - CHECK(b.template get(1) == 0); } - { BodyText b; b.start(1).length(5).string("-12"); - CHECK(b.template get(2) == 0); } - { BodyText b; b.start(2).length(6).string("-12"); - CHECK(b.template get(3) == 0); } - - // 3 elements in string - { BodyText b; b.start(0).length(0).string("-12 34 -56"); - CHECK(b.template get(0) == -12); } - { BodyText b; b.start(0).length(4).string("-12 34 -56"); - CHECK(b.template get(1) == 34); } - { BodyText b; b.start(1).length(5).string("-12 34 -56"); - CHECK(b.template get(2) == 34); } - { BodyText b; b.start(2).length(6).string("-12 34 -56"); - CHECK(b.template get(3) == 34); } - - // ------------------------ - // vector - // ------------------------ - - // 0 elements in string - { BodyText b; b.start(0).length(0).string(""); /* no elements */ } - { BodyText b; b.start(0).length(4).string(""); - CHECK(b.template get(1) == 0); } - { BodyText b; b.start(1).length(5).string(""); - CHECK(b.template get(2) == 0); } - { BodyText b; b.start(2).length(6).string(""); - CHECK(b.template get(3) == 0); } - - // 1 element in string - { BodyText b; b.start(0).length(0).string("1.2"); - CHECK(b.template get(0) == 1.2); } - { BodyText b; b.start(0).length(4).string("1.2"); - CHECK(b.template get(1) == 0); } - { BodyText b; b.start(1).length(5).string("1.2"); - CHECK(b.template get(2) == 0); } - { BodyText b; b.start(2).length(6).string("1.2"); - CHECK(b.template get(3) == 0); } - - // 3 elements in string - { BodyText b; b.start(0).length(0).string("1.2 3.4 5.6"); - CHECK(b.template get(0) == 1.2); } - { BodyText b; b.start(0).length(4).string("1.2 3.4 5.6"); - CHECK(b.template get(1) == 3.4); } - { BodyText b; b.start(1).length(5).string("1.2 3.4 5.6"); - CHECK(b.template get(2) == 3.4); } - { BodyText b; b.start(2).length(6).string("1.2 3.4 5.6"); - CHECK(b.template get(3) == 3.4); } - - // ------------------------ - // vector - // ------------------------ - - // 0 elements in string - { BodyText b; b.start(0).length(0).string(""); /* no elements */ } - { BodyText b; b.start(0).length(4).string(""); - CHECK(b.template get(1) == ""); } - { BodyText b; b.start(1).length(5).string(""); - CHECK(b.template get(2) == ""); } - { BodyText b; b.start(2).length(6).string(""); - CHECK(b.template get(3) == ""); } - - // 1 element in string - { BodyText b; b.start(0).length(0).string("ab"); - CHECK(b.template get(0) == "ab"); } - { BodyText b; b.start(0).length(4).string("ab"); - CHECK(b.template get(1) == ""); } - { BodyText b; b.start(1).length(5).string("ab"); - CHECK(b.template get(2) == ""); } - { BodyText b; b.start(2).length(6).string("ab"); - CHECK(b.template get(3) == ""); } - - // 3 elements in string - { BodyText b; b.start(0).length(0).string("ab cd ef"); - CHECK(b.template get(0) == "ab"); } - { BodyText b; b.start(0).length(4).string("ab cd ef"); - CHECK(b.template get(1) == "cd"); } - { BodyText b; b.start(1).length(5).string("ab cd ef"); - CHECK(b.template get(2) == "cd"); } - { BodyText b; b.start(2).length(6).string("ab cd ef"); - CHECK(b.template get(3) == "cd"); } - - // ------------------------ - // vector - // ------------------------ - - // 0 elements in string - { BodyText b; b.start(0).length(0).string(""); /* no elements */ } - { BodyText b; b.start(0).length(4).string(""); - CHECK(b.template get(1) == 0); } - { BodyText b; b.start(1).length(5).string(""); - CHECK(b.template get(2) == 0); } - { BodyText b; b.start(2).length(6).string(""); - CHECK(b.template get(3) == 0); } - - // 1 element in string - { BodyText b; b.start(0).length(0).string("12"); - CHECK(b.template get(0) == 12); } - { BodyText b; b.start(0).length(4).string("12"); - CHECK(b.template get(1) == 0); } - { BodyText b; b.start(1).length(5).string("12"); - CHECK(b.template get(2) == 0); } - { BodyText b; b.start(2).length(6).string("12"); - CHECK(b.template get(3) == 0); } - - // 3 elements in string - { BodyText b; b.start(0).length(0).string("12 34 56"); - CHECK(b.template get(0) == 12); } - { BodyText b; b.start(0).length(4).string("12 34 56"); - CHECK(b.template get(1) == 34); } - { BodyText b; b.start(1).length(5).string("12 34 56"); - CHECK(b.template get(2) == 34); } - { BodyText b; b.start(2).length(6).string("12 34 56"); - CHECK(b.template get(3) == 34); } -} - -// For BodyText -SCENARIO("BodyText get(n)") { - GIVEN("A BodyText object") { - scenario_get_template_n(); - } -} - -// For BodyText -SCENARIO("BodyText get(n)") { - GIVEN("A BodyText object") { - scenario_get_template_n(); - } -} - - - -// ----------------------------------------------------------------------------- -// 3. Scenario: get() -// ----------------------------------------------------------------------------- - -// For BodyText -SCENARIO("BodyText get()") { - GIVEN("A BodyText object") { - - using ivec = std::vector; - using fvec = std::vector; - using svec = std::vector; - - BodyText b; - - b.start(2).length(6).string("-12 34 -56"); - b.valueType("Integer32"); - CHECK(( std::holds_alternative(b.get()))); - CHECK((!std::holds_alternative(b.get()))); - CHECK((!std::holds_alternative(b.get()))); - CHECK((std::get(b.get()) == ivec{{0,0,-12,34,-56,0}})); - - b.start(2).length(6).string("1.2 3.4 5.6"); - b.valueType("Float64"); - CHECK((!std::holds_alternative(b.get()))); - CHECK(( std::holds_alternative(b.get()))); - CHECK((!std::holds_alternative(b.get()))); - CHECK((std::get(b.get()) == fvec{{0,0,1.2,3.4,5.6,0}})); - - b.start(2).length(6).string("ab cd ef"); - b.valueType(""); - CHECK((!std::holds_alternative(b.get()))); - CHECK((!std::holds_alternative(b.get()))); - CHECK(( std::holds_alternative(b.get()))); - CHECK((std::get(b.get()) == svec{{"","","ab","cd","ef",""}})); - - } // GIVEN -} // SCENARIO - - -// For BodyText -SCENARIO("BodyText get()") { - GIVEN("A BodyText object") { - - using ivec = std::vector; - using fvec = std::vector; - using svec = std::vector; - - { - BodyText b; - b.start(2).length(6).string("-12 34 -56"); - CHECK((b.get() == ivec{{0,0,-12,34,-56,0}})); - } - - { - BodyText b; - b.start(2).length(6).string("1.2 3.4 5.6"); - CHECK((b.get() == fvec{{0,0,1.2,3.4,5.6,0}})); - } - - { - BodyText b; - b.start(2).length(6).string("ab cd ef"); - CHECK((b.get() == svec{{"","","ab","cd","ef",""}})); - } - - } // GIVEN -} // SCENARIO - - - -// ----------------------------------------------------------------------------- -// 4. Scenario: get(n) -// ----------------------------------------------------------------------------- - -// For BodyText -SCENARIO("BodyText get(n)") { - GIVEN("A BodyText object") { - - BodyText b; - - // ------------------------ - // get(n) form - // ------------------------ - - b.start(2).length(6).string("-12 34 -56"); - b.valueType("Integer32"); - CHECK(( std::holds_alternative(b.get(0)))); - CHECK((!std::holds_alternative(b.get(0)))); - CHECK((!std::holds_alternative(b.get(0)))); - CHECK(( std::get( b.get(0) ) == 0 )); - CHECK(( std::get( b.get(1) ) == 0 )); - CHECK(( std::get( b.get(2) ) == -12 )); - CHECK(( std::get( b.get(3) ) == 34 )); - CHECK(( std::get( b.get(4) ) == -56 )); - CHECK(( std::get( b.get(5) ) == 0 )); - // test type changes (inefficient, but they work)... - CHECK(b.get(2) == -12); - CHECK(b.get(3) == double(34)); - CHECK(b.get(4) == "-56"); - - b.start(2).length(6).string("1.2 3.4 5.6"); - b.valueType("Float64"); - CHECK((!std::holds_alternative(b.get(0)))); - CHECK(( std::holds_alternative(b.get(0)))); - CHECK((!std::holds_alternative(b.get(0)))); - CHECK(( std::get( b.get(0) ) == 0 )); - CHECK(( std::get( b.get(1) ) == 0 )); - CHECK(( std::get( b.get(2) ) == 1.2 )); - CHECK(( std::get( b.get(3) ) == 3.4 )); - CHECK(( std::get( b.get(4) ) == 5.6 )); - CHECK(( std::get( b.get(5) ) == 0 )); - // test type changes... - CHECK(b.get(2) == 1); // truncated from 1.2 - // having converted to vector, the .#s aren't there any longer... - CHECK(b.get(2) == "1"); - CHECK(b.get(3) == 3); - CHECK(b.get(4) == "5"); - - b.start(2).length(8).string("ab cd ef 123 4.5"); - b.valueType(""); - CHECK((!std::holds_alternative(b.get(0)))); - CHECK((!std::holds_alternative(b.get(0)))); - CHECK(( std::holds_alternative(b.get(0)))); - CHECK(( std::get( b.get(0) ) == "" )); - CHECK(( std::get( b.get(1) ) == "" )); - CHECK(( std::get( b.get(2) ) == "ab" )); - CHECK(( std::get( b.get(3) ) == "cd" )); - CHECK(( std::get( b.get(4) ) == "ef" )); - CHECK(( std::get( b.get(5) ) == "123")); - CHECK(( std::get( b.get(6) ) == "4.5")); - CHECK(( std::get( b.get(7) ) == "" )); - - // ------------------------ - // operator[] form - // ------------------------ - - b.start(2).length(6).string("-12 34 -56"); - b.valueType("Integer32"); - CHECK(( std::holds_alternative(b[0]))); - CHECK((!std::holds_alternative(b[0]))); - CHECK((!std::holds_alternative(b[0]))); - CHECK(( std::get( b[0] ) == 0 )); - CHECK(( std::get( b[1] ) == 0 )); - CHECK(( std::get( b[2] ) == -12 )); - CHECK(( std::get( b[3] ) == 34 )); - CHECK(( std::get( b[4] ) == -56 )); - CHECK(( std::get( b[5] ) == 0 )); - - b.start(2).length(6).string("1.2 3.4 5.6"); - b.valueType("Float64"); - CHECK((!std::holds_alternative(b[0]))); - CHECK(( std::holds_alternative(b[0]))); - CHECK((!std::holds_alternative(b[0]))); - CHECK(( std::get( b[0] ) == 0 )); - CHECK(( std::get( b[1] ) == 0 )); - CHECK(( std::get( b[2] ) == 1.2 )); - CHECK(( std::get( b[3] ) == 3.4 )); - CHECK(( std::get( b[4] ) == 5.6 )); - CHECK(( std::get( b[5] ) == 0 )); - - b.start(2).length(6).string("ab cd ef"); - b.valueType(""); - CHECK((!std::holds_alternative(b[0]))); - CHECK((!std::holds_alternative(b[0]))); - CHECK(( std::holds_alternative(b[0]))); - CHECK(( std::get( b[0] ) == "" )); - CHECK(( std::get( b[1] ) == "" )); - CHECK(( std::get( b[2] ) == "ab" )); - CHECK(( std::get( b[3] ) == "cd" )); - CHECK(( std::get( b[4] ) == "ef" )); - CHECK(( std::get( b[5] ) == "" )); - - } // GIVEN -} // SCENARIO - - -// For BodyText -SCENARIO("BodyText get(n)") { - GIVEN("A BodyText object") { - - // ------------------------ - // get(n) form - // ------------------------ - - { - BodyText b; - b.start(2).length(6).string("-12 34 -56"); - CHECK(( b.get(0) == 0 )); - CHECK(( b.get(1) == 0 )); - CHECK(( b.get(2) == -12 )); - CHECK(( b.get(3) == 34 )); - CHECK(( b.get(4) == -56 )); - CHECK(( b.get(5) == 0 )); - } - - { - BodyText b; - b.start(2).length(6).string("1.2 3.4 5.6"); - CHECK(( b.get(0) == 0 )); - CHECK(( b.get(1) == 0 )); - CHECK(( b.get(2) == 1.2 )); - CHECK(( b.get(3) == 3.4 )); - CHECK(( b.get(4) == 5.6 )); - CHECK(( b.get(5) == 0 )); - } - - { - BodyText b; - b.start(2).length(8).string("ab cd ef 123 4.5"); - CHECK(( b.get(0) == "" )); - CHECK(( b.get(1) == "" )); - CHECK(( b.get(2) == "ab" )); - CHECK(( b.get(3) == "cd" )); - CHECK(( b.get(4) == "ef" )); - CHECK(( b.get(5) == "123")); - CHECK(( b.get(6) == "4.5")); - CHECK(( b.get(7) == "" )); - } - - // ------------------------ - // operator[] form - // ------------------------ - - { - BodyText b; - b.start(2).length(6).string("-12 34 -56"); - CHECK(( b[0] == 0 )); - CHECK(( b[1] == 0 )); - CHECK(( b[2] == -12 )); - CHECK(( b[3] == 34 )); - CHECK(( b[4] == -56 )); - CHECK(( b[5] == 0 )); - } - - { - BodyText b; - b.start(2).length(6).string("1.2 3.4 5.6"); - CHECK(( b[0] == 0 )); - CHECK(( b[1] == 0 )); - CHECK(( b[2] == 1.2 )); - CHECK(( b[3] == 3.4 )); - CHECK(( b[4] == 5.6 )); - CHECK(( b[5] == 0 )); - } - - { - BodyText b; - b.start(2).length(6).string("ab cd ef"); - CHECK(( b[0] == "" )); - CHECK(( b[1] == "" )); - CHECK(( b[2] == "ab" )); - CHECK(( b[3] == "cd" )); - CHECK(( b[4] == "ef" )); - CHECK(( b[5] == "" )); - } - - } // GIVEN -} // SCENARIO - - - -// ----------------------------------------------------------------------------- -// 5. Scenario: doubles() etc. -// ----------------------------------------------------------------------------- - -// Helper -template -void scenario_get_named() -{ - { - BodyText b; - - b.start(2).length(6).string("-12 34 -56"); - auto result = b.ints(); - CHECK((std::is_same_v>)); - - CHECK(result[0] == 0 ); - CHECK(result[1] == 0 ); - CHECK(result[2] == -12 ); - CHECK(result[3] == 34 ); - CHECK(result[4] == -56 ); - CHECK(result[5] == 0 ); - - CHECK(result[0] == b.ints(0) ); - CHECK(result[1] == b.ints(1) ); - CHECK(result[2] == b.ints(2) ); - CHECK(result[3] == b.ints(3) ); - CHECK(result[4] == b.ints(4) ); - CHECK(result[5] == b.ints(5) ); - } - - { - BodyText b; - - b.start(2).length(6).string("1.2 3.4 5.6"); - const BodyText &bconst = b; // ensure it works with const - const auto result = bconst.doubles(); - CHECK((std::is_same_v>)); - - CHECK(result[0] == 0 ); - CHECK(result[1] == 0 ); - CHECK(result[2] == 1.2 ); - CHECK(result[3] == 3.4 ); - CHECK(result[4] == 5.6 ); - CHECK(result[5] == 0 ); - - CHECK(result[0] == bconst.doubles(0) ); - CHECK(result[1] == bconst.doubles(1) ); - CHECK(result[2] == bconst.doubles(2) ); - CHECK(result[3] == bconst.doubles(3) ); - CHECK(result[4] == bconst.doubles(4) ); - CHECK(result[5] == bconst.doubles(5) ); - } - - { - BodyText b; - - b.start(2).length(6).string("ab cd ef"); - const auto &result = b.strings(); - CHECK((std::is_same_v &>)); - - CHECK(result[0] == "" ); - CHECK(result[1] == "" ); - CHECK(result[2] == "ab" ); - CHECK(result[3] == "cd" ); - CHECK(result[4] == "ef" ); - CHECK(result[5] == "" ); - - CHECK(result[0] == b.strings(0) ); - CHECK(result[1] == b.strings(1) ); - CHECK(result[2] == b.strings(2) ); - CHECK(result[3] == b.strings(3) ); - CHECK(result[4] == b.strings(4) ); - CHECK(result[5] == b.strings(5) ); - } -} - -// For BodyText -SCENARIO("BodyText type-specific get functions: doubles() etc.") { - GIVEN("A BodyText object") { - scenario_get_named(); - } -} - -// For BodyText -SCENARIO("BodyText type-specific get functions: doubles() etc.") { - GIVEN("A BodyText object") { - scenario_get_named(); - } -} diff --git a/src/GNDStk/BodyText/test/params.test.cpp b/src/GNDStk/BodyText/test/params.test.cpp deleted file mode 100644 index 7e43e3e32..000000000 --- a/src/GNDStk/BodyText/test/params.test.cpp +++ /dev/null @@ -1,133 +0,0 @@ - -#include "catch.hpp" -#include "GNDStk.hpp" - -using namespace njoy::GNDStk::core; - - -// ----------------------------------------------------------------------------- -// Helper -// ----------------------------------------------------------------------------- - -template -void scenario_params() -{ - // Default values of parameters are as expected - WHEN("We examine the default length, start, and valueType") { - THEN("They are as expected") { - BodyText b; - CHECK(b.length() == 0); - CHECK(b.start() == 0); - CHECK(b.valueType() == ""); - } - } - - // length setter/getter works - WHEN("We set length, then get and verify") { - THEN("It works for a plain value") { - BodyText b; - b.length(12); - CHECK(b.length() == 12); - } - THEN("It works for optional-with-value") { - BodyText b; - b.length(std::optional(34)); - CHECK(b.length() == 34); - } - THEN("It works for optional-without-value (remains unchanged)") { - BodyText b; - b.length(56); - b.length(std::optional(std::nullopt)); - CHECK(b.length() == 56); - } - } - - // start setter/getter works - WHEN("We set start, then get and verify") { - THEN("It works for a plain value") { - BodyText b; - b.start(11); - CHECK(b.start() == 11); - } - THEN("It works for optional-with-value") { - BodyText b; - b.start(std::optional(13)); - CHECK(b.start() == 13); - } - THEN("It works for optional-without-value (remains unchanged)") { - BodyText b; - b.start(17); - b.start(std::optional(std::nullopt)); - CHECK(b.start() == 17); - } - } - - // valueType setter/getter works - WHEN("We set valueType, then get and verify") { - THEN("It works for a plain value") { - BodyText b; - b.valueType("unknown"); - CHECK(b.valueType() == "unknown"); - } - THEN("It works for optional-with-value") { - BodyText b; - b.valueType(std::optional("Integer32")); - CHECK(b.valueType() == "Integer32"); - } - THEN("It works for optional-without-value (remains unchanged)") { - BodyText b; - b.valueType("Float64"); - b.valueType(std::optional(std::nullopt)); - CHECK(b.valueType() == "Float64"); - } - } - - // Combo of the above, using builder-pattern nature of the setters - WHEN("We set length/start/valueType together, then get and verify") { - THEN("It works for a plain value") { - BodyText b; - b.length(1) - .start(2) - .valueType("a"); - CHECK(b.length() == 1); - CHECK(b.start() == 2); - CHECK(b.valueType() == "a"); - } - THEN("It works for optional-with-value") { - BodyText b; - b.length(std::optional(3)) - .start(std::optional(4)) - .valueType(std::optional("b")); - CHECK(b.length() == 3); - CHECK(b.start() == 4); - CHECK(b.valueType() == "b"); - } - THEN("It works for optional-without-value (remains unchanged)") { - BodyText b; - b.length(100).start(200).valueType("c"); - b.length(std::optional(std::nullopt)) - .start(std::optional(std::nullopt)) - .valueType(std::optional(std::nullopt)); - CHECK(b.length() == 100); - CHECK(b.start() == 200); - CHECK(b.valueType() == "c"); - } - } -} - - -// ----------------------------------------------------------------------------- -// Scenarios -// ----------------------------------------------------------------------------- - -SCENARIO("BodyText length/start/valueType") { - GIVEN("A default-constructed BodyText object") { - scenario_params(); - } -} - -SCENARIO("BodyText length/start/valueType") { - GIVEN("A default-constructed BodyText object") { - scenario_params(); - } -} diff --git a/src/GNDStk/BodyText/test/sync.test.cpp b/src/GNDStk/BodyText/test/sync.test.cpp deleted file mode 100644 index 24df290c7..000000000 --- a/src/GNDStk/BodyText/test/sync.test.cpp +++ /dev/null @@ -1,295 +0,0 @@ - -#include "catch.hpp" -#include "GNDStk.hpp" - -using namespace njoy::GNDStk::core; - - -// ----------------------------------------------------------------------------- -// Scenario: pull -// content == any of {length,start,valueType} -// ----------------------------------------------------------------------------- - -// Helper -template -void scenario_pull() -{ - WHEN("pullFromDerived() is called") { - // none of length, start, valueType - THEN("Push to content{} works") { - const struct { - struct { - } content; - } derived; - BodyText b; - b.length(100).start(200).valueType("300"); - b.pullFromDerived(derived); // should do nothing here - CHECK(b.length() == 100); - CHECK(b.start() == 200); - CHECK(b.valueType() == "300"); - } - - // length only - THEN("Push to content{length} works") { - const struct { - struct { - int length = 10; - } content; - } derived; - BodyText b; - b.length(11).start(12).valueType("13"); - b.pullFromDerived(derived); - CHECK(b.length() == 10); - CHECK(b.start() == 12); - CHECK(b.valueType() == "13"); - } - - // start only - THEN("Push to content{start} works") { - const struct { - struct { - int start = 14; - } content; - } derived; - BodyText b; - b.length(15).start(16).valueType("17"); - b.pullFromDerived(derived); - CHECK(b.length() == 15); - CHECK(b.start() == 14); - CHECK(b.valueType() == "17"); - } - - // valueType only - THEN("Push to content{valueType} works") { - const struct { - struct { - std::string valueType = "18"; - } content; - } derived; - BodyText b; - b.length(19).start(20).valueType("21"); - b.pullFromDerived(derived); - CHECK(b.length() == 19); - CHECK(b.start() == 20); - CHECK(b.valueType() == "18"); - } - - // all but length - THEN("Push to content{start,valueType} works") { - const struct { - struct { - int start = 22; - std::string valueType = "23"; - } content; - } derived; - BodyText b; - b.length(24).start(25).valueType("26"); - b.pullFromDerived(derived); - CHECK(b.length() == 24); - CHECK(b.start() == 22); - CHECK(b.valueType() == "23"); - } - - // all but start - THEN("Push to content{length,valueType} works") { - const struct { - struct { - int length = 27; - std::string valueType = "28"; - } content; - } derived; - BodyText b; - b.length(29).start(30).valueType("31"); - b.pullFromDerived(derived); - CHECK(b.length() == 27); - CHECK(b.start() == 30); - CHECK(b.valueType() == "28"); - } - - // all but valueType - THEN("Push to content{length,start} works") { - const struct { - struct { - int length = 32; - int start = 33; - } content; - } derived; - BodyText b; - b.length(34).start(35).valueType("36"); - b.pullFromDerived(derived); - CHECK(b.length() == 32); - CHECK(b.start() == 33); - CHECK(b.valueType() == "36"); - } - - // all three - THEN("Push to content{length,start,valueType} works") { - const struct { - struct { - int length = 37; - int start = 38; - std::string valueType = "39"; - } content; - } derived; - BodyText b; - b.length(40).start(41).valueType("42"); - b.pullFromDerived(derived); - CHECK(b.length() == 37); - CHECK(b.start() == 38); - CHECK(b.valueType() == "39"); - } - } -} - - -SCENARIO("BodyText pull from content") { - GIVEN("A BodyText object") { - scenario_pull(); - } -} - -SCENARIO("BodyText pull from content") { - GIVEN("A BodyText object") { - scenario_pull(); - } -} - - -// ----------------------------------------------------------------------------- -// Scenario: push -// content == any of {length,start,valueType} -// ----------------------------------------------------------------------------- - -// Helper -template -void scenario_push() -{ - WHEN("pushToDerived() is called") { - // none of length, start, valueType - THEN("Push to content{} works") { - struct { - struct { - int ignored = 123456; // not length, start, or valueType - } content; - } derived; - BodyText b; - b.length(0).start(0).valueType("0"); - b.pushToDerived(derived); // should do nothing here - CHECK(derived.content.ignored == 123456); - } - - // length only - THEN("Push to content{length} works") { - struct { - struct { - int length = 10; - } content; - } derived; - BodyText b; - b.length(11).start(12).valueType("13"); - b.pushToDerived(derived); - CHECK(derived.content.length == 11); - } - - // start only - THEN("Push to content{start} works") { - struct { - struct { - int start = 14; - } content; - } derived; - BodyText b; - b.length(15).start(16).valueType("17"); - b.pushToDerived(derived); - CHECK(derived.content.start == 16); - } - - // valueType only - THEN("Push to content{valueType} works") { - struct { - struct { - std::string valueType = "18"; - } content; - } derived; - BodyText b; - b.length(19).start(20).valueType("21"); - b.pushToDerived(derived); - CHECK(derived.content.valueType == "21"); - } - - // all but length - THEN("Push to content{start,valueType} works") { - struct { - struct { - int start = 22; - std::string valueType = "23"; - } content; - } derived; - BodyText b; - b.length(24).start(25).valueType("26"); - b.pushToDerived(derived); - CHECK(derived.content.start == 25); - CHECK(derived.content.valueType == "26"); - } - - // all but start - THEN("Push to content{length,valueType} works") { - struct { - struct { - int length = 27; - std::string valueType = "28"; - } content; - } derived; - BodyText b; - b.length(29).start(30).valueType("31"); - b.pushToDerived(derived); - CHECK(derived.content.length == 29); - CHECK(derived.content.valueType == "31"); - } - - // all but valueType - THEN("Push to content{length,start} works") { - struct { - struct { - int length = 32; - int start = 33; - } content; - } derived; - BodyText b; - b.length(34).start(35).valueType("36"); - b.pushToDerived(derived); - CHECK(derived.content.length == 34); - CHECK(derived.content.start == 35); - } - - // all three - THEN("Push to content{length,start,valueType} works") { - struct { - struct { - int length = 37; - int start = 38; - std::string valueType = "39"; - } content; - } derived; - BodyText b; - b.length(40).start(41).valueType("42"); - b.pushToDerived(derived); - CHECK(derived.content.length == 40); - CHECK(derived.content.start == 41); - CHECK(derived.content.valueType == "42"); - } - } -} - - -SCENARIO("BodyText push to content") { - GIVEN("A BodyText object") { - scenario_push(); - } -} - -SCENARIO("BodyText push to content") { - GIVEN("A BodyText object") { - scenario_push(); - } -} diff --git a/src/GNDStk/BodyText/test/toNode.test.cpp b/src/GNDStk/BodyText/test/toNode.test.cpp deleted file mode 100644 index c54fb43ad..000000000 --- a/src/GNDStk/BodyText/test/toNode.test.cpp +++ /dev/null @@ -1,367 +0,0 @@ - -#include "catch.hpp" -#include "GNDStk.hpp" - -using namespace njoy::GNDStk::core; - - -// ----------------------------------------------------------------------------- -// Helper -// ----------------------------------------------------------------------------- - -// Tests use either void for each template parameter, or int, double, -// std::string, and char, in that order. In the former case, we're testing -// toNode() for the generic BodyText<...,void>. In the latter case, we're -// testing toNode() for non-generic BodyText. -template -void scenario_toNode() -{ - // Default-constructed BodyText - GIVEN("A default-constructed BodyText") { - WHEN("toNode() is called") { - THEN("The computed text string is empty") { - const BodyText b; - - std::string text = "abc"; - struct { - struct { - } content; - } derived; - // w/trim == true (shouldn't matter here; applies to vector) - b.trim = true; - b.toNode(text,derived); - CHECK(text == ""); - - // w/trim == false (shouldn't matter here; applies to vector) - b.trim = false; - b.toNode(text,derived); - CHECK(text == ""); - } - } - } - - // BodyText, after being given a particular raw string and parameters - GIVEN("A BodyText, with given raw string and parameters") { - WHEN("toNode() is called") { - THEN("The computed text string is as expected, " - "and the parameters remain as given" - ) { - BodyText b; - b.string("0 12 34 56 0 0") - .start(100).length(200).valueType("hello"); - - std::string text = "abc"; - struct { - struct { - } content; - } derived; - - // Someone who sets the raw string directly (as opposed to using - // a vector) is stating that they want *exactly* that raw string, - // including any 0s or anything else. To have BodyText's trim flag - // be relevant, use a vector. - - // w/trim == true (shouldn't matter here; applies to vector) - b.trim = true; - b.toNode(text,derived); - CHECK(text == "0 12 34 56 0 0"); - CHECK(b.start() == 100); - CHECK(b.length() == 200); - CHECK(b.valueType() == "hello"); - - // w/trim == false (shouldn't matter here; applies to vector) - b.trim = false; - b.toNode(text,derived); - CHECK(text == "0 12 34 56 0 0"); - CHECK(b.start() == 100); - CHECK(b.length() == 200); - CHECK(b.valueType() == "hello"); - } - } - } - - // BodyText, after being given a particular vector - GIVEN("A BodyText, assigned from a particular vector") { - WHEN("toNode() is called") { - THEN("The computed text string is as expected, " - "and the parameters were computed properly" - ) { - BodyText b; - // what's set here should be replaced upon assignment from vector - b.string("a b c").start(10).length(20).valueType("foobar"); - - // assign from vector - b = std::vector{{0, 0, 12, 34, 56, 78, 0, 0, 0, 0, 0}}; - - std::string text = "this should be replaced"; - struct { - struct { - } content; - } derived; - - // w/trim == true - b.trim = true; - b.toNode(text,derived); - CHECK(text == "12 34 56 78"); - CHECK(b.start() == 2); - CHECK(b.length() == 11); - CHECK(b.valueType() == "Integer32"); - - // w/trim == false - b.trim = false; - b.toNode(text,derived); - CHECK(text == "0 0 12 34 56 78 0 0 0 0 0"); - CHECK(b.start() == 0); - CHECK(b.length() == 11); - CHECK(b.valueType() == "Integer32"); - } - } - } - - // BodyText, after being given a particular vector - GIVEN("A BodyText, assigned from a particular vector") { - WHEN("toNode() is called") { - THEN("The computed text string is as expected, " - "and the parameters were computed properly" - ) { - BodyText b; - // what's set here should be replaced upon assignment from vector - b.string("d e f").start(100).length(200).valueType("foobar"); - - // assign from vector - b = std::vector{{0, 0, 0, 1.234, 5.678, 0, 0 }}; - - std::string text = "this should be replaced"; - struct { - struct { - } content; - } derived; - - // w/trim == true - b.trim = true; - b.toNode(text,derived); - CHECK(text == "1.234 5.678"); - CHECK(b.start() == 3); - CHECK(b.length() == 7); - CHECK(b.valueType() == "Float64"); - - // w/trim == false - b.trim = false; - b.toNode(text,derived); - CHECK(text == "0 0 0 1.234 5.678 0 0"); - CHECK(b.start() == 0); - CHECK(b.length() == 7); - CHECK(b.valueType() == "Float64"); - } - } - } - - // BodyText, after being given a particular vector - // A key point here is to ensure that ""s (string "zeros") are properly - // trimmed at the beginning and end. - GIVEN("A BodyText, assigned from a particular vector") { - WHEN("toNode() is called") { - THEN("The computed text string is as expected, " - "and the parameters were computed properly" - ) { - BodyText b; - // what's set here should be replaced upon assignment from vector - b.string("d e f").start(100).length(200).valueType("foobar"); - - // assign from vector - b = std::vector{{"","","","foo","bar","baz","",""}}; - - std::string text = "this should be replaced"; - struct { - struct { - } content; - } derived; - - // w/trim == true - b.trim = true; - b.toNode(text,derived); - CHECK(text == "foo bar baz"); - CHECK(b.start() == 3); - CHECK(b.length() == 8); - CHECK(b.valueType() == "UTF8Text"); - - // w/trim == false - // toNode() should treat this (the std::string) case as if trim - // were true. If it didn't, we'd end up with, well, leading and - // trailing *empty* strings, which, well, amount to leading and - // trailing nothing. - b.trim = false; - b.toNode(text,derived); - CHECK(text == "foo bar baz"); - CHECK(b.start() == 3); - CHECK(b.length() == 8); - CHECK(b.valueType() == "UTF8Text"); - } - } - } - - // BodyText, after being given a particular vector - // For T something other than int, double, and std::string - GIVEN("A BodyText, assigned from a particular vector") { - WHEN("toNode() is called") { - THEN("The computed text string is as expected, " - "and the parameters were computed properly" - ) { - BodyText b; - // what's set here should be replaced upon assignment from vector - b.string("x y z").start(100).length(200).valueType("foobar"); - - // assign from vector - b = std::vector{{0,0,0,0,0,'a','b','c','d',0}}; - - std::string text = "this should be replaced"; - struct { - struct { - } content; - } derived; - - b.toNode(text,derived); - CHECK(text == "a b c d"); - CHECK(b.start() == 5); - CHECK(b.length() == 10); - CHECK(b.valueType() == "char"); - } - } - } - - // Test various configurations of content{} when calling toNode(). Basically, - // these test whether toNode properly updates whichever of length, start, and - // valueType are in .content of toNode()'s second argument. - GIVEN("A BodyText, with vector") { - WHEN("toNode() is called") { - - // none of length, start, valueType - THEN("Push to content{} works") { - struct { - struct { - int ignored = 12345; - } content; - } derived; - BodyText b; std::string text; - b = std::vector{{0,0,10,20,30,0,0,0}}; - b.toNode(text,derived); - // toNode doesn't care about what's *not* length/start/valueType... - CHECK(derived.content.ignored == 12345); // same as before toNode() - } - - // length only - THEN("Push to content{length} works") { - struct { - struct { - int length = 0; - } content; - } derived; - BodyText b; std::string text; - b = std::vector{{0,0,10,20,30,0,0,0}}; - b.toNode(text,derived); - CHECK(derived.content.length == 8); - } - - // start only - THEN("Push to content{start} works") { - struct { - struct { - int start = 0; - } content; - } derived; - BodyText b; std::string text; - b = std::vector{{0,0,10,20,30,0,0,0}}; - b.toNode(text,derived); - CHECK(derived.content.start == 2); - } - - // valueType only - THEN("Push to content{valueType} works") { - struct { - struct { - std::string valueType = ""; - } content; - } derived; - BodyText b; std::string text; - b = std::vector{{0,0,10,20,30,0,0,0}}; - b.toNode(text,derived); - CHECK(derived.content.valueType == "Integer32"); - } - - // all but length - THEN("Push to content{start,valueType} works") { - struct { - struct { - int start = 0; - std::string valueType = ""; - } content; - } derived; - BodyText b; std::string text; - b = std::vector{{0,0,10,20,30,0,0,0}}; - b.toNode(text,derived); - CHECK(derived.content.start == 2); - CHECK(derived.content.valueType == "Integer32"); - } - - // all but start - THEN("Push to content{length,valueType} works") { - struct { - struct { - int length = 0; - std::string valueType = ""; - } content; - } derived; - BodyText b; std::string text; - b = std::vector{{0,0,10,20,30,0,0,0}}; - b.toNode(text,derived); - CHECK(derived.content.length == 8); - CHECK(derived.content.valueType == "Integer32"); - } - - // all but valueType - THEN("Push to content{length,start} works") { - struct { - struct { - int length = 0; - int start = 0; - } content; - } derived; - BodyText b; std::string text; - b = std::vector{{0,0,10,20,30,0,0,0}}; - b.toNode(text,derived); - CHECK(derived.content.length == 8); - CHECK(derived.content.start == 2); - } - - // all three - THEN("Push to content{length,start,valueType} works") { - struct { - struct { - int length = 0; - int start = 0; - std::string valueType = ""; - } content; - } derived; - BodyText b; std::string text; - b = std::vector{{0,0,10,20,30,0,0,0}}; - b.toNode(text,derived); - CHECK(derived.content.length == 8); - CHECK(derived.content.start == 2); - CHECK(derived.content.valueType == "Integer32"); - } - } - } -} - - -// ----------------------------------------------------------------------------- -// Scenario -// ----------------------------------------------------------------------------- - -SCENARIO("BodyText toNode()") { - scenario_toNode(); -} - -SCENARIO("BodyText toNode()") { - scenario_toNode(); -} diff --git a/src/GNDStk/BodyText/test/types.test.cpp b/src/GNDStk/BodyText/test/types.test.cpp deleted file mode 100644 index 57274301f..000000000 --- a/src/GNDStk/BodyText/test/types.test.cpp +++ /dev/null @@ -1,121 +0,0 @@ - -#include "catch.hpp" -#include "GNDStk.hpp" - -using namespace njoy::GNDStk::core; - -// ----------------------------------------------------------------------------- -// Scenario -// ----------------------------------------------------------------------------- - -SCENARIO("BodyText data types") { - GIVEN("std::vector for certain specific Ts") { - - WHEN("Via BodyText, we make variants of vectors and of scalars") { - // vector type - using vv = BodyText::VariantOfVectors; - THEN("The variant-of-vector size should be correct") { - CHECK(std::variant_size_v == 15); - } - vv vectors; - - // scalar type - using vs = BodyText::VariantOfScalars; - THEN("The variant-of-scalar size should be correct") { - CHECK(std::variant_size_v == 15); - } - vs scalars; - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,"a"); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == "a"); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,'b'); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == 'b'); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,-100); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == -100); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,-200); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == -200); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,-300); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == -300); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,-400); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == -400); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,-500); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == -500); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,100); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == 100); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,200); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == 200); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,300); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == 300); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,400); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == 400); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,500); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == 500); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,-1.2f); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == -1.2f); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,3.4); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == 3.4); - } - - THEN("Transformation to vector, and access, work") { - vectors = std::vector(10,-5.6); - scalars = std::get>(vectors)[0]; - CHECK(std::get(scalars) == -5.6); - } - } // WHEN - - } // GIVEN -} // SCENARIO diff --git a/src/GNDStk/BodyText/test/write.test.cpp b/src/GNDStk/BodyText/test/write.test.cpp deleted file mode 100644 index ac0095b27..000000000 --- a/src/GNDStk/BodyText/test/write.test.cpp +++ /dev/null @@ -1,226 +0,0 @@ - -#include "catch.hpp" -#include "GNDStk.hpp" - -using namespace njoy::GNDStk::core; - - -// ----------------------------------------------------------------------------- -// Scenario: raw string -// ----------------------------------------------------------------------------- - -// Helper -template -void scenario_write_string_active() -{ - GIVEN("A BodyText with an empty raw string") { - WHEN("BodyText.write() is called") { - THEN("Nothing is printed") { - BodyText b; - b = std::vector{{'a','b','c'}}; - b.string(""); // should make string (not vector) active - std::ostringstream oss; - b.write(oss,0); - CHECK(oss.str() == ""); - - // same (nothing printed) if indentation is non-0 - b.write(oss,2); - CHECK(oss.str() == ""); - } - } - } - - GIVEN("A BodyText with a non-empty raw string") { - WHEN("BodyText.write() is called") { - THEN("The raw string and a newline are printed") { - BodyText b; - b = std::vector{{'a','b','c'}}; - b.string("foo bar"); // should make string (not vector) active - - std::ostringstream oss; - b.write(oss,0); - CHECK(oss.str() == "foo bar\n"); - - // indentation isn't applied when the raw string is active - oss.str(""); - b.write(oss,2); - CHECK(oss.str() == "foo bar\n"); - } - } - } -} - -// For DATA == void -SCENARIO("BodyText write(), when the raw string is active") { - scenario_write_string_active(); -} - -// For DATA != void -SCENARIO("BodyText write(), when the raw string is active") { - scenario_write_string_active(); -} - - -// ----------------------------------------------------------------------------- -// Scenario: vector -// ----------------------------------------------------------------------------- - -// Helper -template -void scenario_write_vector_active() -{ - GIVEN("A BodyText with an empty vector") { - WHEN("BodyText.write() is called") { - THEN("Nothing is printed") { - BodyText b; - b.string("should be ignored"); // because vector is forthcoming... - b = std::vector{}; - std::ostringstream oss; - b.write(oss,0); - CHECK(oss.str() == ""); - - // same (nothing printed) if indentation is non-0 - b.write(oss,2); - CHECK(oss.str() == ""); - } - } - } - - GIVEN("A BodyText with a non-empty vector") { - WHEN("BodyText.write() is called") { - THEN("The vector and a newline are printed") { - BodyText b; - b.string("should be ignored"); // because vector is forthcoming... - b = std::vector{{2,3,5,7,11,13,17,19,21,23}}; - std::ostringstream oss; - - // Cases: - // indent: 0, 3 (number of spaces per indentation level) - // across: 0, 1, 2, 5, 10, 11 (note that 10 == vector size) - // level: 0, 1, 2 (indentation level) - // Note: across == 0 ==> unlimited. - // Lots of cases, but we want to check that our pretty-printing - // functionality works perfectly, and doesn't do anything that's - // unexpected around "boundaries" like across==10 with 10 values. - - oss.str(""); indent = 0; across = 0; b.write(oss,0); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 0; across = 0; b.write(oss,1); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 0; across = 0; b.write(oss,2); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 0; across = 1; b.write(oss,0); - CHECK(oss.str() == "2\n3\n5\n7\n11\n13\n17\n19\n21\n23\n"); - - oss.str(""); indent = 0; across = 1; b.write(oss,1); - CHECK(oss.str() == "2\n3\n5\n7\n11\n13\n17\n19\n21\n23\n"); - - oss.str(""); indent = 0; across = 1; b.write(oss,2); - CHECK(oss.str() == "2\n3\n5\n7\n11\n13\n17\n19\n21\n23\n"); - - oss.str(""); indent = 0; across = 2; b.write(oss,0); - CHECK(oss.str() == "2 3\n5 7\n11 13\n17 19\n21 23\n"); - - oss.str(""); indent = 0; across = 2; b.write(oss,1); - CHECK(oss.str() == "2 3\n5 7\n11 13\n17 19\n21 23\n"); - - oss.str(""); indent = 0; across = 2; b.write(oss,2); - CHECK(oss.str() == "2 3\n5 7\n11 13\n17 19\n21 23\n"); - - oss.str(""); indent = 0; across = 5; b.write(oss,0); - CHECK(oss.str() == "2 3 5 7 11\n13 17 19 21 23\n"); - - oss.str(""); indent = 0; across = 5; b.write(oss,1); - CHECK(oss.str() == "2 3 5 7 11\n13 17 19 21 23\n"); - - oss.str(""); indent = 0; across = 5; b.write(oss,2); - CHECK(oss.str() == "2 3 5 7 11\n13 17 19 21 23\n"); - - oss.str(""); indent = 0; across = 10; b.write(oss,0); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 0; across = 10; b.write(oss,1); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 0; across = 10; b.write(oss,2); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 0; across = 11; b.write(oss,0); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 0; across = 11; b.write(oss,1); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 0; across = 11; b.write(oss,2); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 0; b.write(oss,0); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 0; b.write(oss,1); - CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 0; b.write(oss,2); - CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 1; b.write(oss,0); - CHECK(oss.str() == "2\n3\n5\n7\n11\n13\n17\n19\n21\n23\n"); - - oss.str(""); indent = 3; across = 1; b.write(oss,1); - CHECK(oss.str() == " 2\n 3\n 5\n 7\n 11\n 13\n 17\n 19\n 21\n 23\n"); - - oss.str(""); indent = 3; across = 1; b.write(oss,2); - CHECK(oss.str() == " 2\n 3\n 5\n 7\n 11\n 13\n 17\n 19\n 21\n 23\n"); - - oss.str(""); indent = 3; across = 2; b.write(oss,0); - CHECK(oss.str() == "2 3\n5 7\n11 13\n17 19\n21 23\n"); - - oss.str(""); indent = 3; across = 2; b.write(oss,1); - CHECK(oss.str() == " 2 3\n 5 7\n 11 13\n 17 19\n 21 23\n"); - - oss.str(""); indent = 3; across = 2; b.write(oss,2); - CHECK(oss.str() == " 2 3\n 5 7\n 11 13\n 17 19\n 21 23\n"); - - oss.str(""); indent = 3; across = 5; b.write(oss,0); - CHECK(oss.str() == "2 3 5 7 11\n13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 5; b.write(oss,1); - CHECK(oss.str() == " 2 3 5 7 11\n 13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 5; b.write(oss,2); - CHECK(oss.str() == " 2 3 5 7 11\n 13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 10; b.write(oss,0); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 10; b.write(oss,1); - CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 10; b.write(oss,2); - CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 11; b.write(oss,0); - CHECK(oss.str() == "2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 11; b.write(oss,1); - CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); - - oss.str(""); indent = 3; across = 11; b.write(oss,2); - CHECK(oss.str() == " 2 3 5 7 11 13 17 19 21 23\n"); - } - } - } -} - -// For DATA == void -SCENARIO("BodyText write(), when a vector is active") { - scenario_write_vector_active(); -} - -// For DATA != void -SCENARIO("BodyText write(), when a vector is active") { - scenario_write_vector_active(); -} diff --git a/src/GNDStk/CInterface.hpp b/src/GNDStk/CInterface.hpp new file mode 100644 index 000000000..83023ac34 --- /dev/null +++ b/src/GNDStk/CInterface.hpp @@ -0,0 +1,3 @@ + +// Miscellaneous helper constructs +#include "GNDStk/CInterface/src/detail.hpp" diff --git a/src/GNDStk/CInterface/src/detail.hpp b/src/GNDStk/CInterface/src/detail.hpp new file mode 100644 index 000000000..4fb5d6e7d --- /dev/null +++ b/src/GNDStk/CInterface/src/detail.hpp @@ -0,0 +1,726 @@ + +namespace detail { + +// ----------------------------------------------------------------------------- +// Helpers +// ----------------------------------------------------------------------------- + +// ------------------------ +// tocpp +// ------------------------ + +// const +template +const CPP &tocpp(const C *const self) +{ + if (self == nullptr) { + log::error( + "detail::tocpp(pointer to const): pointer is null; " + "it cannot be dereferenced" + ); + throw std::exception{}; + } + return reinterpret_cast(*self); +} + +// non-const +template +CPP &tocpp(C *const self) +{ + if (self == nullptr) { + log::error( + "detail::tocpp(pointer): pointer is null; " + "it cannot be dereferenced" + ); + throw std::exception{}; + } + return reinterpret_cast(*self); +} + +// ------------------------ +// getAllHandles +// findHandle +// ------------------------ + +// getAllHandles +// Returns a container +template +auto &getAllHandles() +{ + try { + static std::set> pointers; + return pointers; + } catch (...) { + log::error("Exception thrown in detail::getAllHandles()"); + throw; + } +} + +// findHandle +// Returns an iterator +template +auto findHandle(const C *const want) +{ + try { + auto &pointers = getAllHandles(); + return std::find_if( + pointers.begin(), pointers.end(), + [want](const std::shared_ptr &have) + { + return have.get() == &tocpp(want); + } + ); + } catch (...) { + log::error("Exception thrown in detail::findHandle()"); + throw; + } +} + + +// ----------------------------------------------------------------------------- +// create, assign, delete +// ----------------------------------------------------------------------------- + +// createHandle +template +C *createHandle( + const std::string &classname, + const std::string &funname, + ARGS &&...args +) { + try { + return reinterpret_cast( + &(**getAllHandles().insert( + std::make_shared(std::forward(args)...) + ).first) + ); + } catch (...) { + log::error("Unable to create {} handle", classname); + log::function("{}", funname); + return nullptr; + } +} + +// assignHandle +template +void assignHandle( + const std::string &classname, + const std::string &funname, + C *const lhs, const C *const rhs +) { + static const std::string remark = + "\nIgnoring the assignment and continuing (but you should" + "\nprobably look into this, and fix something)."; + + static const std::string + bothNull = "The \"to\" and \"from\" {} handles are null." + remark, + leftNull = "The \"to\" {} handle is null." + remark, + rightNull = "The \"from\" {} handle is null." + remark, + leftUnk = "Unknown \"to\" {} handle {}." + remark, + rightUnk = "Unknown \"from\" {} handle {}." + remark; + + try { + auto &pointers = getAllHandles(); + bool good = true; + + // nullptr anywhere? + if (lhs == nullptr && rhs == nullptr) { + good = false; + log::error(bothNull, classname); + } else if (lhs == nullptr) { + good = false; + log::error(leftNull, classname); + } else if (rhs == nullptr) { + good = false; + log::error(rightNull,classname); + } + + // check lhs + if (lhs && findHandle(lhs) == pointers.end()) { + good = false; + log::error(leftUnk, classname, reinterpret_cast(lhs)); + } + + // check rhs + if (rhs && findHandle(rhs) == pointers.end()) { + good = false; + log::error(rightUnk, classname, reinterpret_cast(rhs)); + } + + if (!good) + throw std::exception{}; + + tocpp(lhs) = tocpp(rhs); + + } catch (...) { + log::function("{}(to,from)", funname); + } +} + +// deleteHandle +template +void deleteHandle( + const std::string &classname, + const std::string &funname, + const C *const ptr +) { + static const std::string ignore = "Ignoring call to delete {} handle {}."; + + if (ptr == nullptr) { + log::warning( + ignore + "\nHandle is null.", + classname, reinterpret_cast(ptr) + ); + return; + } + + try { + auto &pointers = getAllHandles(); + const auto iter = findHandle(ptr); + + if (iter != pointers.end()) { + pointers.erase(iter); + } else { + log::warning( + ignore + "\nHandle is unknown, or was already deleted.", + classname, reinterpret_cast(ptr) + ); + } + } catch (...) { + log::function("{}({} handle = {})", funname, classname, (void *)ptr); + } +} + + +// ----------------------------------------------------------------------------- +// read, write, print +// ----------------------------------------------------------------------------- + +// readHandle +template +int readHandle( + const std::string &classname, + const std::string &funname, + C *const ptr, const std::string &filename +) { + try { + tocpp(ptr).baseComponent().read(filename); + return 1; // success + } catch (...) { + log::context( + "C function for reading {} from file. " + "File name is \"{}\".", classname, filename + ); + log::function("{}({} handle = {})", funname, classname, (void *)ptr); + return 0; // failure + } +} + +// writeHandle +template +int writeHandle( + const std::string &classname, + const std::string &funname, + const C *const ptr, const std::string &filename +) { + try { + tocpp(ptr).baseComponent().write(filename); + return 1; // success + } catch (...) { + log::context( + "C function for writing {} to file.\n" + "File name is \"{}\".", classname, filename + ); + log::function("{}({} handle = {})", funname, classname, (void *)ptr); + return 0; // failure + } +} + +// printHandle +template +int printHandle( + const std::string &classname, + const std::string &funname, + const C *const ptr, const std::string &format = "" +) { + try { + if (format == "") { + tocpp(ptr).baseComponent().print(); + // Component's print() already prints a newline + } else { + tocpp(ptr).baseComponent().write(std::cout,format); + // Component's write() intentionally doesn't already print a newline. + // For this print(), for our C language interface, print one. + std::cout << std::endl; + } + return 1; // success + } catch (...) { + if (format == "") { + log::context( + "C function for printing {}.", classname); + } else { + log::context( + "C function for printing {} in {} format.", classname, format); + } + log::function("{}({} handle = {})", funname, classname, (void *)ptr); + return 0; // failure + } +} + + +// ----------------------------------------------------------------------------- +// has, get, set +// ----------------------------------------------------------------------------- + +// hasField +template +bool hasField( + const std::string &classname, + const std::string &funname, + const C *const ptr, + const EXTRACT &extract +) { + try { + const auto &field = *extract(tocpp(ptr)); + return field.has_value(); + } catch (...) { + log::function("{}({} handle = {})", funname, classname, (void *)ptr); + return false; + } +} + +// getField +template +auto getField( + const std::string &classname, + const std::string &funname, + const C *const ptr, + const EXTRACT &extract +) { + using T = std::decay_t(ptr))->value())>; + + try { + const auto &field = *extract(tocpp(ptr)); + const T &ret = field.value(); // .value() gets us into any optional + if constexpr (is_void_v) { + // metadatum + if constexpr (std::is_same_v) { + return ret.c_str(); + } else { + return ret; + } + } else { + // child + return (HANDLE)(&ret); + } + } catch (...) { + log::function("{}({} handle = {})", funname, classname, (void *)ptr); + if constexpr (is_void_v) { + // metadatum + if constexpr (std::is_same_v) { + return ""; + } else { + return T{}; + } + } else { + // child + return (HANDLE)nullptr; + } + } +} + +// setField +template +void setField( + const std::string &classname, + const std::string &funname, + C *const ptr, + const EXTRACT &extract, + const T &newvalue +) { + try { + auto &field = *extract(tocpp(ptr)); + if constexpr (is_void_v) { + // metadatum + field = newvalue; + } else { + // child + field = tocpp(newvalue); + } + } catch (...) { + log::function( + "{}({} handle = {}, value)", funname, classname, (void *)ptr); + } +} + + +// ----------------------------------------------------------------------------- +// clear, size +// ----------------------------------------------------------------------------- + +// clearContainer +template +void clearContainer( + const std::string &classname, + const std::string &funname, + C *const ptr, + const EXTRACT &extract +) { + try { + auto &container = (*extract(tocpp(ptr)))(); + if constexpr (isOptional) { + if (container) + container->clear(); + } else + container.clear(); + } catch (...) { + log::error("Exception thrown in detail::clearContainer"); + log::function( + "{}({} handle = {})", funname, classname, (void *)ptr); + } +} + +// sizeOfContainer +template +size_t sizeOfContainer( + const std::string &classname, + const std::string &funname, + C *const ptr, + const EXTRACT &extract +) { + try { + auto &container = (*extract(tocpp(ptr)))(); + if constexpr (isOptional) + return container ? container->size() : 0; + else + return container.size(); + } catch (...) { + log::error("Exception thrown in detail::sizeOfContainer"); + log::function( + "{}({} handle = {})", funname, classname, (void *)ptr); + return 0; + } +} + + +// ----------------------------------------------------------------------------- +// add +// ----------------------------------------------------------------------------- + +// addToContainer +template +void addToContainer( + const std::string &classname, + const std::string &funname, + C *const ptr, + const EXTRACT &extract, + const T &value +) { + try { + auto &field = *extract(tocpp(ptr)); + field.add(tocpp(value)); + } catch (...) { + log::error("Exception thrown in detail::addToContainer"); + log::function( + "{}({} handle = {}, value)", funname, classname, (void *)ptr); + } +} + + +// ----------------------------------------------------------------------------- +// getByIndex +// setByIndex +// ----------------------------------------------------------------------------- + +// getByIndex +template +HANDLE getByIndex( + const std::string &classname, + const std::string &funname, + const C *const ptr, + const EXTRACT &extract, + const size_t index +) { + try { + const auto &field = *extract(tocpp(ptr)); + return (HANDLE)&field[index]; + } catch (...) { + log::function( + "{}({} handle = {}, index = {})", funname, classname, + (void *)ptr, index + ); + return (HANDLE)nullptr; + } +} + +// setByIndex +template +void setByIndex( + const std::string &classname, + const std::string &funname, + C *const ptr, + const EXTRACT &extract, + const size_t index, + const V *const newvalue +) { + try { + auto &field = *extract(tocpp(ptr)); + field[index] = tocpp(newvalue); + } catch (...) { + log::function( + "{}({} handle = {}, value)", funname, classname, (void *)ptr); + } +} + + +// ----------------------------------------------------------------------------- +// hasByMetadatum +// getByMetadatum +// setByMetadatum +// ----------------------------------------------------------------------------- + +// hasByMetadatum +template +bool hasByMetadatum( + const std::string &classname, + const std::string &funname, + const C *const ptr, + const EXTRACT &extract, + const META &meta, + const T &value +) { + try { + const auto &field = *extract(tocpp(ptr)); + return field.has(meta(value)); + } catch (...) { + log::function("{}({} handle = {}, value)", funname, classname, + (void *)ptr); + return false; + } +} + +// getByMetadatum +template +HANDLE getByMetadatum( + const std::string &classname, + const std::string &funname, + const C *const ptr, + const EXTRACT &extract, + const META &meta, + const T &value +) { + try { + const auto &field = *extract(tocpp(ptr)); + return (HANDLE)&field[meta(value)]; + } catch (...) { + log::function( + "{}({} handle = {}, value)", funname, classname, (void *)ptr); + return (HANDLE)nullptr; + } +} + +// setByMetadatum +template< + class CPP, class CLASS, class C, + class EXTRACT, class META, class V, class T +> +void setByMetadatum( + const std::string &classname, + const std::string &funname, + C *const ptr, + const EXTRACT &extract, + const META &meta, + const T &value, + const V *const newvalue +) { + try { + auto &field = *extract(tocpp(ptr)); + field[meta(value)] = tocpp(newvalue); + } catch (...) { + log::function( + "{}({} handle = {}, value)", funname, classname, (void *)ptr); + } +} + + +// ----------------------------------------------------------------------------- +// Re: data vectors +// For when a Component-derived class has BlockData +// ----------------------------------------------------------------------------- + +// ------------------------ +// clear, size +// ------------------------ + +// clear +template +void vectorClear( + const std::string &classname, + const std::string &funname, + C *const ptr +) { + try { + tocpp(ptr).clear(); + } catch (...) { + log::error("Exception thrown in detail::vectorClear"); + log::function("{}({} handle = {})", funname, classname, (void *)ptr); + } +} + +// size +template +size_t vectorSize( + const std::string &classname, + const std::string &funname, + const C *const ptr +) { + try { + return tocpp(ptr).size(); + } catch (...) { + log::error("Exception thrown in detail::vectorSize"); + log::function("{}({} handle = {})", funname, classname, (void *)ptr); + return 0; + } +} + +// ------------------------ +// get, set +// One value +// ------------------------ + +// get +template +T vectorGet( + const std::string &classname, + const std::string &funname, + const C *const ptr, + const size_t index +) { + using VECTOR = std::vector; + bool rangeErr = false; + + try { + const VECTOR *vec; + if constexpr (isDerivedFromVector_v) + vec = static_cast(&tocpp(ptr)); + else + vec = &tocpp(ptr).template get(); + + if (index < vec->size()) + return (*vec)[index]; + else { + rangeErr = true; + log::error( + "Vector index {} not in range 0..size-1 (0..{})", + index, vec->size()-1 + ); + throw std::exception{}; + } + } catch (...) { + if (!rangeErr) // else error was already printed + log::error("Exception thrown in detail::vectorGet"); + log::function( + "{}({} handle = {}, index = {})", + funname, classname, (void *)ptr, index + ); + return T{}; + } +} + +// set +template +void vectorSet( + const std::string &classname, + const std::string &funname, + C *const ptr, + const size_t index, + const T &value +) { + using VECTOR = std::vector; + bool rangeErr = false; + + try { + VECTOR *vec; + if constexpr (isDerivedFromVector_v) + vec = static_cast(&tocpp(ptr)); + else + vec = &tocpp(ptr).template get(); + + if (index < vec->size()) + (*vec)[index] = value; + else { + rangeErr = true; + log::error( + "Vector index {} not in range 0..size-1 (0..{})", + index, vec->size()-1 + ); + throw std::exception{}; + } + } catch (...) { + if (!rangeErr) // else error was already printed + log::error("Exception thrown in detail::vectorSet"); + log::function( + "{}({} handle = {}, index = {}, value)", + funname, classname, (void *)ptr, index + ); + } +} + +// ------------------------ +// get, set +// All values +// ------------------------ + +// get +template +auto *vectorGet( + const std::string &classname, + const std::string &funname, + C *const ptr +) { + using VECTOR = std::vector; + + try { + if constexpr (isDerivedFromVector_v) { + auto &vec = tocpp(ptr).baseObject(); + return vec.size() ? &vec[0] : nullptr; + } else { + auto &vec = tocpp(ptr).template get(); + return vec.size() ? &vec[0] : nullptr; + } + } catch (...) { + log::error("Exception thrown in detail::vectorGet"); + log::function("{}({} handle = {})", funname, classname, (void *)ptr); + if constexpr (isDerivedFromVector_v) + return decltype(&(tocpp(ptr).baseObject())[0])(nullptr); + else + return decltype(&(tocpp(ptr).template get())[0])(nullptr); + } +} + +// set +template +void vectorSet( + const std::string &classname, + const std::string &funname, + C *const ptr, + const size_t size, + const T *const values +) { + using VECTOR = std::vector; + + try { + if constexpr (isDerivedFromVector_v) + static_cast(tocpp(ptr)).assign(values,values+size); + else + tocpp(ptr).template get().assign(values,values+size); + } catch (...) { + log::error("Exception thrown in detail::vectorSet"); + log::function( + "{}({} handle = {}, size = {}, values*)", + funname, classname, (void *)ptr, size + ); + } +} + +} // namespace detail diff --git a/src/GNDStk/Child.hpp b/src/GNDStk/Child.hpp index 4cb0bc77c..f8f1b9ce2 100644 --- a/src/GNDStk/Child.hpp +++ b/src/GNDStk/Child.hpp @@ -10,9 +10,9 @@ TYPE - The type to which GNDStk should convert a Node that's extracted from a Tree - with the Child object. If TYPE is void, then GNDStk uses Node - the child - node, in its original form in the tree. + The type to which GNDStk should convert a Node that's extracted, via our + query system, with the Child object. If TYPE is void, then GNDStk uses + type Node - the child node in its original form. ALLOW @@ -29,13 +29,13 @@ ALLOW In other words: there are (or can be) any number of nodes within an enclosing context (here, ). ALLOW is a template parameter because - it affects the *type* that's pulled from the Tree when the Child object - is used for a query. For example, + it affects the *type* that's extracted when the Child object is used for a + query. For example, tree(...,axes,axis) gives back a container of axis objects, not a single axis object, because - our Child axis keyword has ALLOW == Allow::any. Note that axes, not to be + our Child axis object has ALLOW == Allow::many. Note that axes, not to be confused with axis, has ALLOW == Allow::one because it's expected just once. CONVERTER @@ -49,7 +49,6 @@ FILTER */ - // ----------------------------------------------------------------------------- // default // ----------------------------------------------------------------------------- @@ -57,7 +56,7 @@ FILTER template< class TYPE = void, // default means current Node type Allow ALLOW = Allow::one, // one, or any number allowed? - class CONVERTER = typename detail::default_converter::type, + class CONVERTER = detail::default_converter_t, class FILTER = detail::noFilter > class Child { @@ -67,56 +66,25 @@ class Child { // data // ------------------------ - // name, object, converter, filter + // name, converter, filter std::string name; - const TYPE object; CONVERTER converter; // optional custom converter; needs operator() FILTER filter; // optional custom filter; needs operator() -private: - // allowable as top-level? - // We make this private, with a setter and a getter, so that the setter - // can register the name as "allowable as top-level" if we set to true. - bool canBeTopLevel; -public: // ------------------------ // constructors // ------------------------ // name - // name, type - // name, type, converter - // name, type, converter, filter - // name, type, converter, filter, top + // name, converter + // name, converter, filter explicit Child( const std::string &n, - const TYPE &t = TYPE{}, - const CONVERTER &c = CONVERTER{}, - const FILTER &f = FILTER{}, - const bool canbetop = false + const CONVERTER &c = detail::make_once(), + const FILTER &f = detail::make_once() ) : - name(n), object(t), converter(c), filter(f) - { - top(canbetop); - } - - // ------------------------ - // top(): allowable - // as a top-level node? - // ------------------------ - - // top() - bool top() const - { - return canBeTopLevel; - } - - // top(bool) - void top(const bool t) - { - if (t) detail::AllowedTop.insert(name); - canBeTopLevel = t; - } + name(n), converter(c), filter(f) + { } // ------------------------ // simple functions @@ -127,32 +95,26 @@ class Child { // See remarks for Meta's basic(); similar remarks apply here auto basic() const { - return Child( - name, filter, canBeTopLevel // converter not possible here - ); + // converter isn't possible here + return Child(name, filter); } // one() // Produce an equivalent Child, but formulated as Allow::one auto one() const { - return Child( - name, object, converter, filter, canBeTopLevel - ); + return Child(name, converter, filter); } // many() // Produce an equivalent Child, but formulated as Allow::many auto many() const { - return Child( - name, object, converter, filter, canBeTopLevel - ); + return Child(name, converter, filter); } }; - // ----------------------------------------------------------------------------- // void // ----------------------------------------------------------------------------- @@ -160,7 +122,7 @@ class Child { template class Child { static_assert( - std::is_same_v, + detail::is_void_v, "Can't create Child with non-default CONVERTER" ); @@ -173,10 +135,6 @@ class Child { // name, filter std::string name; FILTER filter; // optional custom filter; needs operator() -private: - // allowable as top-level? - bool canBeTopLevel; -public: // ------------------------ // constructors @@ -184,34 +142,12 @@ class Child { // name // name, filter - // name, filter, top explicit Child( const std::string &n, - const FILTER &f = FILTER{}, - const bool t = false + const FILTER &f = detail::make_once() ) : name(n), filter(f) - { - top(t); - } - - // ------------------------ - // top(): allowable - // as a top-level node? - // ------------------------ - - // top() - bool top() const - { - return canBeTopLevel; - } - - // top(bool) - void top(const bool t) - { - if (t) detail::AllowedTop.insert(name); - canBeTopLevel = t; - } + { } // ------------------------ // simple functions @@ -222,43 +158,40 @@ class Child { // we're already void; this is here for consistency with the general case. auto basic() const { - return Child(name,filter,canBeTopLevel); + return Child(name,filter); } // one() // Produce an equivalent Child, but formulated as Allow::one auto one() const { - return Child(name,filter,canBeTopLevel); + return Child(name,filter); } // many() // Produce an equivalent Child, but formulated as Allow::many auto many() const { - return Child(name,filter,canBeTopLevel); + return Child(name,filter); } }; - // ----------------------------------------------------------------------------- // Macro // ----------------------------------------------------------------------------- -// For Child building. This macro doesn't handle the optional "top-level" -// flag, the converter, or the filter; we don't believe those will be needed -// very often. If you do need to provide one or both, construct a Child -// in some other way than by using this macro. +// For Child building. This macro doesn't handle the converter or the filter; +// we don't believe those will be needed very often. If you do need to provide +// one or both, construct a Child in some other way than by using this macro. -#define GNDSTK_MAKE_CHILD(TYPE,name,ALLOW) \ - inline const Child name(#name) +#define NJOY_GNDSTK_MAKE_CHILD(TYPE,name,ALLOW) \ + inline const njoy::GNDStk::Child name(#name) // Note: we don't #undef this after we use it within GNDStk, as we might // normally do, because users might find it handy. - // ----------------------------------------------------------------------------- // Operators // ----------------------------------------------------------------------------- diff --git a/src/GNDStk/Child/src/operator.hpp b/src/GNDStk/Child/src/operator.hpp index 0bbe2c677..e4acb5913 100644 --- a/src/GNDStk/Child/src/operator.hpp +++ b/src/GNDStk/Child/src/operator.hpp @@ -9,49 +9,12 @@ // operator- template -inline auto operator-(const Child &kwd) +auto operator-(const Child &kwd) { return kwd.basic(); } - -// ----------------------------------------------------------------------------- -// operator~: Allow as top-level -// operator!: Disallow as top-level -// -// We don't expect much use of these, but someone may occasionally find the -// first (more likely) or the second (less likely) to be helpful. The unary -// operators that we chose for these purposes seemed like the best, given a -// limited selection. One could think: (T)ilde for (T)op; Not for Not. -// ----------------------------------------------------------------------------- - -// operator~ -template -inline auto operator~(const Child &kwd) -{ - auto ret = kwd; - ret.top(true); - return ret; -} - -// operator! -// fixme This switches off the canBeTopLevel flag in an individual Child, -// but we actually use the namespace-scope set AllowedTop when we -// determine if a particular name is allowed as a top-level node. So, turning -// of a Child's previously-true top-level designator does not, at the moment, -// have any meaningful effect anywhere. We'll look at this more carefully -// sometime. For now, this just isn't a super important issue. -template -inline auto operator!(const Child &kwd) -{ - auto ret = kwd; - ret.top(false); - return ret; -} - - - // ----------------------------------------------------------------------------- // T/Child // Change type to T @@ -60,37 +23,32 @@ inline auto operator!(const Child &kwd) // T/Child template -inline auto operator/( - const T &object, +auto operator/( + const T &, const Child &kwd ) { return Child( kwd.name, - object, kwd.converter, - kwd.filter, - kwd.top() + kwd.filter ); } // T/Child template -inline auto operator/( - const T &object, +auto operator/( + const T &, const Child &kwd ) { - using CONVERTER = typename detail::default_converter::type; + using CONVERTER = detail::default_converter_t; return Child( kwd.name, - object, CONVERTER{}, // because the input Child didn't have one - kwd.filter, - kwd.top() + kwd.filter ); } - // ----------------------------------------------------------------------------- // Child/string // Child/char* @@ -103,7 +61,7 @@ inline auto operator/( // Child/string template -inline auto operator/( +auto operator/( const Child &kwd, const std::string &name ) { @@ -112,7 +70,7 @@ inline auto operator/( } template -inline auto operator/( +auto operator/( const Child &kwd, const std::string &name ) { @@ -123,7 +81,7 @@ inline auto operator/( // Child/char* // Forwards to Child/string template -inline auto operator/( +auto operator/( const Child &kwd, const char *const name ) { @@ -131,7 +89,7 @@ inline auto operator/( } template -inline auto operator/( +auto operator/( const Child &kwd, const char *const name ) { @@ -139,20 +97,18 @@ inline auto operator/( } - // ----------------------------------------------------------------------------- // * // regex match-anything // ----------------------------------------------------------------------------- template -inline auto operator*(const Child &kwd) +auto operator*(const Child &kwd) { return kwd/".*"; } - // ----------------------------------------------------------------------------- // Child/C // Change converter to C @@ -160,45 +116,38 @@ inline auto operator*(const Child &kwd) // ----------------------------------------------------------------------------- // Child/C -template -inline Child< - typename detail::isNotVoid::type, // for SFINAE - ALLOW, - C, - FILTER -> operator/( +template< + class TYPE, Allow ALLOW, class CONVERTER, class FILTER, class C, + class = std::enable_if_t> +> +Child operator/( const Child &kwd, const C &converter ) { return Child( kwd.name, - kwd.object, converter, // the new one; not kwd.converter! - kwd.filter, - kwd.top() + kwd.filter ); } // Child/C -template -inline Child< - typename detail::is_void::type, // for SFINAE - ALLOW, - void, - FILTER -> operator/( +template< + class TYPE, Allow ALLOW, class FILTER, class C, + class = std::enable_if_t> +> +Child operator/( const Child &kwd, const C & ) { static_assert( - !std::is_same_v, + !detail::is_void_v, "Child/CONVERTER not allowed; the Child must be non-void" ); return kwd; } - // ----------------------------------------------------------------------------- // post-- // Change converter to its default @@ -206,23 +155,21 @@ inline Child< // Child-- template -inline auto operator--( +auto operator--( const Child &kwd, const int ) { - using C = typename detail::default_converter::type; + using C = detail::default_converter_t; return Child( kwd.name, - kwd.object, C{}, - kwd.filter, - kwd.top() + kwd.filter ); } // Child-- template -inline auto operator--( +auto operator--( const Child &kwd, const int ) { @@ -230,7 +177,6 @@ inline auto operator--( } - // ----------------------------------------------------------------------------- // --pre, ++pre // Downgrade/upgrade to Allow::one/many @@ -238,20 +184,19 @@ inline auto operator--( // --Child template -inline auto operator--(const Child &kwd) +auto operator--(const Child &kwd) { return kwd.one(); } // ++Child template -inline auto operator++(const Child &kwd) +auto operator++(const Child &kwd) { return kwd.many(); } - // ----------------------------------------------------------------------------- // Child + F // Change filter to F @@ -259,34 +204,30 @@ inline auto operator++(const Child &kwd) // Child + F template -inline auto operator+( +auto operator+( const Child &kwd, const F &filter ) { return Child( kwd.name, - kwd.object, kwd.converter, - filter, // the new one - kwd.top() + filter // the new one ); } // Child + F template -inline auto operator+( +auto operator+( const Child &kwd, const F &filter ) { return Child( kwd.name, - filter, // the new one - kwd.top() + filter // the new one ); } - // ----------------------------------------------------------------------------- // Child || Child // Create a Child that represents one or the other of two children @@ -297,7 +238,7 @@ inline auto operator+( template< Allow ALLOW, class CONVERTER, class FILTER > -inline auto operator||( +auto operator||( const Child &a, const Child &b ) { @@ -305,9 +246,7 @@ inline auto operator||( // both names, space-separated; this gets special treatment elsewhere a.name + " " + b.name, // need a filter; use the first Child's - a.filter, - // if either is top-level enabled - a.top() || b.top() + a.filter ); } @@ -317,20 +256,19 @@ template< class ATYPE, class BTYPE, Allow ALLOW, class CONVERTER, class FILTER, class = std::enable_if_t< - !detail::isVoid && - !detail::isVoid + !detail::is_void_v && + !detail::is_void_v > > -inline auto operator||( +auto operator||( const Child &a, const Child &b ) { return Child,ALLOW,CONVERTER,FILTER>( // both names, space-separated; this gets special treatment elsewhere a.name + " " + b.name, - // need an object, converter, and filter; use the first Child's - a.object, a.converter, a.filter, - // if either is top-level enabled - a.top() || b.top() + // we need a converter and a filter; use the first Child's + a.converter, + a.filter ); } diff --git a/src/GNDStk/Child/test/CMakeLists.txt b/src/GNDStk/Child/test/CMakeLists.txt index 862eb139a..246e0fecd 100644 --- a/src/GNDStk/Child/test/CMakeLists.txt +++ b/src/GNDStk/Child/test/CMakeLists.txt @@ -1,5 +1,10 @@ -add_executable( GNDStk.Child.test Child.test.cpp operator.test.cpp ) +add_executable( + GNDStk.Child.test + Child.test.cpp + operator.test.cpp +) + target_compile_options( GNDStk.Child.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} @@ -10,5 +15,5 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.Child.test PUBLIC GNDStk ) -add_test( NAME GNDStk.Child COMMAND GNDStk.Child.test ) \ No newline at end of file +target_link_libraries( GNDStk.Child.test PUBLIC GNDStk ) +add_test( NAME GNDStk.Child COMMAND GNDStk.Child.test ) diff --git a/src/GNDStk/Child/test/Child.test.cpp b/src/GNDStk/Child/test/Child.test.cpp index ac43846b9..176d689e5 100644 --- a/src/GNDStk/Child/test/Child.test.cpp +++ b/src/GNDStk/Child/test/Child.test.cpp @@ -24,28 +24,18 @@ SCENARIO("Testing GNDStk Child") { const Child foo("foo"); CHECK(foo.name == "foo"); - CHECK(!foo.top()); } WHEN("Constructed with (name,converter)") { const Child - foo("foo", 0.0, converter{}); + foo("foo", converter{}); CHECK(foo.name == "foo"); - CHECK(!foo.top()); } WHEN("Constructed with (name,converter,filter)") { const Child - foo("foo", 0.0, converter{}, filter); + foo("foo", converter{}, filter); CHECK(foo.name == "foo"); - CHECK(!foo.top()); - } - - WHEN("Constructed with (name,converter,filter,top)") { - const Child - foo("foo", 0.0, converter{}, filter, true); - CHECK(foo.name == "foo"); - CHECK(foo.top()); } } @@ -55,21 +45,18 @@ SCENARIO("Testing GNDStk Child") { const Child foo("foo"); CHECK(foo.name == "foo"); - CHECK(!foo.top()); } WHEN("Constructed with (name,filter)") { const Child foo("foo", filter); CHECK(foo.name == "foo"); - CHECK(!foo.top()); } WHEN("Constructed with (name,filter,top)") { const Child - foo("foo", filter, true); + foo("foo", filter); CHECK(foo.name == "foo"); - CHECK(foo.top()); } } } diff --git a/src/GNDStk/Child/test/operator.test.cpp b/src/GNDStk/Child/test/operator.test.cpp index 1ec2af774..af7646875 100644 --- a/src/GNDStk/Child/test/operator.test.cpp +++ b/src/GNDStk/Child/test/operator.test.cpp @@ -128,45 +128,6 @@ SCENARIO("Testing GNDStk Child operators") { } } - // ------------------------ - // ~Child - // !Child - // top() - // top(bool) - // ------------------------ - - GIVEN("Some Child objects") { - const Child foo("foo"); - const Child bar("bar"); - Child one("one"); - one.top(true); - Child two("two"); - two.top(true); - - CHECK(!foo.top()); - CHECK(!bar.top()); - CHECK(one.top()); - CHECK(two.top()); - - WHEN("We apply ~Child") { - THEN("Top-level is enabled") { - CHECK((~foo).top()); - CHECK((~bar).top()); - CHECK((~one).top()); - CHECK((~two).top()); - } - } - - WHEN("We apply !Child") { - THEN("Top-level is disabled") { - CHECK(!(!foo).top()); - CHECK(!(!bar).top()); - CHECK(!(!one).top()); - CHECK(!(!two).top()); - } - } - } - // ------------------------ // type/Child // ------------------------ diff --git a/src/GNDStk/Component.hpp b/src/GNDStk/Component.hpp index 942acea86..aa85af2fd 100644 --- a/src/GNDStk/Component.hpp +++ b/src/GNDStk/Component.hpp @@ -1,117 +1,169 @@ -// General helper constructs +// A forward declaration of Component is needed by some detail constructs +template +class Component; + +#include "GNDStk/Component/src/detail-sfinae.hpp" +#include "GNDStk/Component/src/detail-getter.hpp" #include "GNDStk/Component/src/detail.hpp" -// Map from some term/subject to its documentation, -// for use by classes that derive from Component, -// and in particular for use in the Python bindings. +// Map from some term/subject to its documentation. For use by classes that +// derive from Component, and in particular for use in Python bindings. using helpMap = std::map; +// ----------------------------------------------------------------------------- +// Noop (class) +// noop (object) +// To represent "no-op[eration]". +// ----------------------------------------------------------------------------- + +// At the moment, this is designed to provide a "do-nothing converter" that +// might be used in Component-based classes. We might eventually extend its +// contents in a way that supports other uses of the "no-op" concept. + +struct Noop { + template + bool operator()(const FROM &, TO &) const + { + // No action. And, in the context of Node's add() functions, a + // return value of false means nothing will be added after all. + return false; + } +}; + +inline const Noop noop; + // ----------------------------------------------------------------------------- // Component // ----------------------------------------------------------------------------- -template -class Component : public BodyText +template +class Component : public BlockData { - // For convenience - using body = BodyText; - using typename body::VariantOfVectors; - using typename body::VariantOfScalars; + template + friend bool detail::added( + const COMPONENT &, const FROM &, const MC &, const bool, const size_t + ); + + template + friend class detail::bracket; // Links to fields in the object of the derived class. I can't find a way - // to do this in a decltype(DERIVED::keys())-aware manner, because DERIVED + // to do this in a decltype(DERIVED::KEYS())-aware manner, because DERIVED // is generally an incomplete type *here* - outside of Component's member // functions. So, we'll do it the old-fashioned way. std::vector links; - // This class cannot have copy or move construction. Its constructor MUST - // know about the fields in the specific instance that's derived from it. - Component(const Component &) = delete; - Component(Component &&) = delete; + // Fallback for documentation() if DERIVED doesn't have help + static inline helpMap help; - // Copy and move *assignments* have the right behavior, however. - Component &operator=(const Component &other) - { - body::operator=(other); - return *this; - } - Component &operator=(Component &&other) + // For convenience + using BLOCKDATA = BlockData; + using typename BLOCKDATA::VariantOfVectors; + using typename BLOCKDATA::VariantOfScalars; + + // Keys() + static const auto &Keys() { - body::operator=(std::move(other)); - return *this; + static const auto value = makeKeyTuple(DERIVED::KEYS()); + return value; } - // Constructor; intentionally *private* + // Constructors and assignment operators. Intentionally private. #include "GNDStk/Component/src/ctor.hpp" + #include "GNDStk/Component/src/assign.hpp" // finish - // See comments in finish.hpp + // Helpers for the constructors #include "GNDStk/Component/src/finish.hpp" - // Intermediaries between derived-class getters, and getter functions - // in detail::. These shorten the code in the derived classes. + // Helpers for derived-class getters and setters. + // These allow us to shorten some other code. #include "GNDStk/Component/src/getter.hpp" - - // Fallback for documentation() if DERIVED doesn't have help - static inline helpMap help; + #include "GNDStk/Component/src/setter.hpp" public: + #include "GNDStk/Component/src/read.hpp" + #include "GNDStk/Component/src/write.hpp" + #include "GNDStk/Component/src/print.hpp" #include "GNDStk/Component/src/fromNode.hpp" #include "GNDStk/Component/src/sort.hpp" - #include "GNDStk/Component/src/toNode.hpp" // conversion to Node - #include "GNDStk/Component/src/write.hpp" - - // You can (but don't need to) override the following in DERIVED - static std::string namespaceName() { return ""; } - - // derived - // Convenient access to the derived class - DERIVED &derived() - { return static_cast(*this); } - const DERIVED &derived() const - { return static_cast(*this); } + #include "GNDStk/Component/src/toNode.hpp" + #include "GNDStk/Component/src/convert.hpp" + #include "GNDStk/Component/src/has.hpp" + #include "GNDStk/Component/src/call.hpp" + #include "GNDStk/Component/src/io-string.hpp" + + // For use in DERIVED + template class FieldPart { /* nothing; see specialization */ }; + #include "GNDStk/Component/src/field.hpp" + #include "GNDStk/Component/src/fieldPart.hpp" + #include "GNDStk/Component/src/wrapper.hpp" + + // Forwards, where viable and unambiguous, to certain capabilities + // in DERIVED's fields + #include "GNDStk/Component/src/forward.hpp" + + // Namespace, Class + static std::string Namespace() { return DERIVED::NAMESPACE(); } + static std::string Class() { return DERIVED::CLASS(); } // documentation static std::string documentation(const std::string &subject = "") { try { return DERIVED::help.at(subject); - } - catch ( ... ) { + } catch (...) { return "No help information is available"; } } - // Component << std::string - // Meaning: read the string's content (currently XML or JSON) into an object - // of the Component's DERIVED class. Uses Node's << std::string capability. - void operator<<(const std::string &str) + // DERIVED's vector base, if applicable + template< + class D = DERIVED, + class = std::enable_if_t> + > + auto &vector() { - try { - Node node; - node << str; - derived() = DERIVED(node); - } catch (...) { - log::function(std::string(DERIVED::className()) + " << string"); - throw; - } + using VECTOR = detail::isDerivedFromVector_t; + return static_cast(derived()); } + // ------------------------ + // Shorthand access... + // ------------------------ + + // To the BlockData base class + BLOCKDATA &baseBlockData() { return *this; } + const BLOCKDATA &baseBlockData() const { return *this; } + + // To the Component base class (of the derived class) + Component &baseComponent() { return *this; } + const Component &baseComponent() const { return *this; } + + // To the derived class + DERIVED &derived() + { return static_cast(*this); } + const DERIVED &derived() const + { return static_cast(*this); } + +private: + + // Helper: fieldAddress + template void *fieldAddress( T &value) { return &value ; } + template void *fieldAddress(Field &field) { return &field(); } + + // Helper: stripField + template struct stripField { using type = T; }; + template struct stripField> { using type = T; }; }; // class Component // ----------------------------------------------------------------------------- -// ostream << Component +// Stream I/O // ----------------------------------------------------------------------------- -template -std::ostream &operator<<( - std::ostream &os, - const Component &obj -) { - return obj.write(os); -} +#include "GNDStk/Component/src/io-stream.hpp" diff --git a/src/GNDStk/Component/src/assign.hpp b/src/GNDStk/Component/src/assign.hpp new file mode 100644 index 000000000..60ab54a14 --- /dev/null +++ b/src/GNDStk/Component/src/assign.hpp @@ -0,0 +1,14 @@ + +// Copy +Component &operator=(const Component &other) +{ + BLOCKDATA::operator=(other); + return *this; +} + +// Move +Component &operator=(Component &&other) +{ + BLOCKDATA::operator=(std::move(other)); + return *this; +} diff --git a/src/GNDStk/Component/src/call.hpp b/src/GNDStk/Component/src/call.hpp new file mode 100644 index 000000000..acd89e353 --- /dev/null +++ b/src/GNDStk/Component/src/call.hpp @@ -0,0 +1,30 @@ + +// These essentially provide an alternative to the has() member functions, +// using operator() combined with the has() free functions: obj(has(...)). + +template< + class EXTRACTOR, class THIS = DERIVED, + class = decltype(std::declval()(THIS{}))> +constexpr bool operator()( + const Lookup & +) const { + return true; +} + +template< + class EXTRACTOR, class TYPE, class CONVERTER, class THIS = DERIVED, + class = decltype(std::declval()(THIS{}))> +bool operator()( + const Lookup &from +) const { + return from.extractor(derived()) == from.value; +} + +template< + class EXTRACTOR, class TYPE, class CONVERTER, LookupMode EXISTS, + class = std::enable_if_t> +constexpr bool operator()( + const Lookup & +) const { + return false; +} diff --git a/src/GNDStk/Component/src/convert.hpp b/src/GNDStk/Component/src/convert.hpp new file mode 100644 index 000000000..64bd4b848 --- /dev/null +++ b/src/GNDStk/Component/src/convert.hpp @@ -0,0 +1,217 @@ + +// ----------------------------------------------------------------------------- +// CommentConverter +// Core Interface "converter" to support comments. +// ----------------------------------------------------------------------------- + +struct CommentConverter { + // query: Node ==> string + void operator()(const Node &node, std::string &str) const + { + bool found = false; + str = node.meta(special::text,found); + + #ifdef NJOY_GNDSTK_INSTRUMENT + // Must do directly here, because we're handling #text directly + for (const auto &m : node.metadata) + if (m.first == special::text) + detail::instrument::mark(m.first); + #endif + + if (!found) { + log::warning( + "Cannot find a \"{}\" metadatum in Node \"{}\".\n" + "The Node appears to be ill-formed.\n" + "Returning an empty string, \"\", for the comment.", + special::text, node.name); + log::context( + "Node-to-string conversion for comments in class {}." + + detail::fullName(Namespace(), Class())); + str = ""; + } + } + + // write: string ==> Node + void operator()(const std::string &str, Node &node) const + { + node.add(special::text, str); + } +}; + + +// ----------------------------------------------------------------------------- +// DataConverter +// Core Interface "converter" to support "cdata" (as in XML) and plain data. +// ----------------------------------------------------------------------------- + +struct DataConverter { + + // ------------------------ + // query vector + // ------------------------ + + // Node ==> DataNode> + template + void operator()( + const Node &self, + DataNode, preferCDATA> &vec + ) const { + vec.clear(); + + // We'll consider it to be fine, in this context, if a "cdata" + // or "pcdata" node isn't actually in the present node. This would + // be the case if, for example, we encountered something like this: + // + // where we might expect something like one of these: + // 1.23 4.56 7.89 + // + // So, we accept the case where the outer node doesn't explicitly + // have the expected vector-like inner node, and simply produce an + // empty vector in this situation. + bool found = false; + const Node &data = self.one(special::anydata,found); + if (!found) + return; // fine; the vector - clear()'d above - is appropriate + + // Remember whether the vector is arriving here in cdata or plain data. + vec.cdata = data.name == special::cdata; + + // We did find a data node (as opposed to encountering the situation + // described earlier), and the Core Interface should always have put + // a text metadatum into it, to store the data node's contents. + found = false; + const std::string &str = data.meta(special::text,found); + + #ifdef NJOY_GNDSTK_INSTRUMENT + // Must do directly here, because we're handling #text directly + for (const auto &m : data.metadata) + if (m.first == special::text) + detail::instrument::mark(m.first); + #endif + + if (found) { + if constexpr (std::is_floating_point_v) + detail::Precision{}.read(str,vec); + else { + // The above read ultimately does the following for non-floating- + // point T, but only after extra logic that we might as well avoid. + std::istringstream iss(str); + T element; + while (iss >> element) + vec.push_back(element); + } + } else { + log::warning( + "Cannot find a \"{}\" metadatum in Node \"{}\".\n" + "The Node appears to be ill-formed.\n" + "Returning an empty vector.", + special::text, data.name); + log::context( + "Node-to-vector conversion for data in class {}.", + detail::fullName(Namespace(), Class())); + } + + // Must do directly here, because we're handling the data child directly + detail::instrument::mark(data); + } + + // ------------------------ + // write vector + // ------------------------ + + // DataNode> ==> Node + template + void operator()( + const DataNode, preferCDATA> &vec, + Node &self + ) const { + // If the data vector is empty, we won't create a data node inside of the + // current node at all. This is essentially the reverse of the "no data + // node" situation described in a comment in the other operator() above. + if (vec.size() == 0) + return; + + // Depending on the status of our cdata flag, give the Node that's being + // created the correct name. + Node &data = self.add(vec.cdata ? special::cdata : special::data); + + std::ostringstream oss; + { + size_t count = 0; + using namespace detail; + for (const T &element : vec) { + oss << (count++ ? " " : ""); + if constexpr (std::is_floating_point_v) + oss << Precision{}.write(element); + else + oss << element; + } + } + data.add(special::text, oss.str()); + } + + // ------------------------ + // query string + // ------------------------ + + // Node ==> DataNode + template + void operator()( + const Node &self, + DataNode &str + ) const { + str = ""; + + // Remark as with the Node ==> DataNode> case earlier. + bool found = false; + const Node &data = self.one(special::anydata,found); + if (!found) + return; // fine; the string - set to "" above - is appropriate + + // Remember whether the string is arriving here in cdata or plain data. + str.cdata = data.name == special::cdata; + + found = false; + str = data.meta(special::text,found); + + #ifdef NJOY_GNDSTK_INSTRUMENT + // Must do directly here, because we're handling #text directly + for (const auto &m : data.metadata) + if (m.first == special::text) + detail::instrument::mark(m.first); + #endif + + if (!found) { + log::warning( + "Cannot find a \"{}\" metadatum in Node \"{}\".\n" + "The Node appears to be ill-formed.\n" + "Returning an empty string, \"\", for the value.", + special::text, data.name); + log::context( + "Node-to-string conversion for data in class {}." + + detail::fullName(Namespace(), Class())); + str = ""; // ensure "" after node.meta() call above + } + + // Must do directly here, because we're handling the data child directly + detail::instrument::mark(data); + } + + // ------------------------ + // write string + // ------------------------ + + // DataNode ==> Node + template + void operator()( + const DataNode &str, + Node &self + ) const { + if (str == "") + return; + + // Remark as in the DataNode case above. + Node &data = self.add(str.cdata ? special::cdata : special::data); + data.add(special::text, str); + } +}; diff --git a/src/GNDStk/Component/src/ctor.hpp b/src/GNDStk/Component/src/ctor.hpp index f289a5058..fc51bf716 100644 --- a/src/GNDStk/Component/src/ctor.hpp +++ b/src/GNDStk/Component/src/ctor.hpp @@ -1,4 +1,9 @@ +// Component can't have copy or move construction. Its constructor MUST +// know about the fields in the specific instance that derives from it. +Component(const Component &) = delete; +Component(Component &&) = delete; + // We give Component a *private* constructor + a friend declaration, so that // a derived class can't accidentally derive from Component. // But, please, don't let y'alls derived classes mess with Component's data @@ -6,41 +11,28 @@ friend DERIVED; -// ctor: fields +// ctor: BlockData<...>, fields template -Component(const body &other, ARGS &...args) : body(other) +Component(const BLOCKDATA &other, ARGS &...args) : BLOCKDATA(other) { - // static_assert needs string literal - #define pairing_error \ - "The number and/or types of the fields sent to Component's " \ - "constructor is inconsistent with the query result implied " \ - "by the derived class' keys()" - // I'd have preferred to achieve the following check by using SFINAE // in the constructor's signature, but couldn't find a way to do that // without again running into the issue of DERIVED being incomplete. - // The parameters that are sent to this constructor must EXACTLY reflect - // what we'd get from a DERIVED::keys() multi-query. - if constexpr (std::is_same_v>) { - // keys is "empty" (std::tuple<>); that's OK, as long as ARGS is too - static_assert( - std::is_same_v, std::tuple<>>, - pairing_error - ); - } else { - // keys are *not* empty, so... - // The following is the *type* that a multi-query with DERIVED::keys() - // will produce. - using multi_t = - detail::decays_t; - static_assert( - std::is_same_v, multi_t>, - pairing_error - ); - // Create links - (links.push_back(&args), ...); - } + // Type that a multi-query with DERIVED::KEYS() will produce. + using multi_t = typename detail::queryResult::type; + + // The types in ARGS should exactly reflect what we'd get from + // a DERIVED::KEYS() multi-query, except that an ARG of Field + // is accepted in place of a T. + static_assert( + std::is_same_v::type...>, multi_t>, + "The number and/or types of the fields sent to Component's " + "constructor is inconsistent with the query result implied " + "by the KEYS() function in the derived class" + ); - #undef pairing_error + // Create links + links.reserve(sizeof...(args)); + (links.push_back(fieldAddress(args)), ...); } diff --git a/src/GNDStk/Component/src/detail-getter.hpp b/src/GNDStk/Component/src/detail-getter.hpp new file mode 100644 index 000000000..d6e90523e --- /dev/null +++ b/src/GNDStk/Component/src/detail-getter.hpp @@ -0,0 +1,340 @@ + +namespace detail { + +// Contents: +// 1. bool compGetter (vector, Lookup exists) +// 2. auto compGetter (vector, Lookup get/unvalued) +// 3. const T &compGetter (vector, Lookup get/valued) +// 4. const T *compGetter(vector, Lookup) +// 5. decltype(auto) compGetter (optional>, Lookup) + +// ----------------------------------------------------------------------------- +// Helpers +// ----------------------------------------------------------------------------- + +// ------------------------ +// quote +// ------------------------ + +// general +template +std::string quote(const T &value) +{ + std::ostringstream oss; + oss << value; + return oss.str(); +} + +// for string +inline std::string quote(const std::string &value) +{ + return '"' + value + '"'; +} + +// for char * +// Else the general T case, not the string case, would be called +inline std::string quote(const char *const value) +{ + return quote(std::string(value)); +} + +// ------------------------ +// firstOrOnly +// ------------------------ + +// general +// the type +template +struct firstOrOnly { + using type = T; +}; + +// for variant +// the variant's first type +template +struct firstOrOnly> { + using type = T; +}; + +// ------------------------ +// has_field +// ------------------------ + +template +struct has_field { + static constexpr bool value = false; +}; + +template +struct has_field< + T, + EXTRACTOR, + decltype( + (void)std::declval()( + std::conditional_t,void,T>{} + ), + 0 + ) +> { + static constexpr bool value = true; +}; + +// for variant: does any alternative have the field? +template +struct has_field,EXTRACTOR> +{ + static constexpr bool value = (has_field::value || ...); +}; + + +// ----------------------------------------------------------------------------- +// 1. +// compGetter(vector, Lookup exists/valued or unvalued, names) +// Returns: bool +// ----------------------------------------------------------------------------- + +template +bool compGetter( + const std::vector &vec, + const Lookup &look, + const std::string &nname, const std::string &cname, const std::string &fn +) { + if constexpr (!has_field::value) + return false; + else if constexpr (std::is_same_v) + return true; + else { + const std::string fname = fn != "" ? fn : ""; + + try { + for (const auto &elem : vec) { + if constexpr (isVariant_v) { + // T == variant + if (std::visit( + [&look](auto &&alternative) + { + return look.extractor(alternative) == look.value; + }, + elem + )) + return true; + } else { + // T != variant + if (look.extractor(elem) == look.value) + return true; + } + } + } catch (...) { + // context + log::member( + "compGetter {}::{}.{}(has({}({}))) on vector", + nname, cname, fname, look.name, quote(look.value)); + throw; + } + + return false; + } +} + + +// ----------------------------------------------------------------------------- +// 2. +// compGetter(vector, Lookup get/unvalued, names) +// Returns: vector +// Meaning: create and return a vector with the extracted fields. Analogy: given +// a vector, return a vector with just, say, the .real parts. +// ----------------------------------------------------------------------------- + +template< + class T, class EXTRACTOR, + class = std::enable_if_t::value> +> +auto compGetter( + const std::vector &vec, + const Lookup &look, + const std::string &nname, const std::string &cname, const std::string &fn +) { + const std::string fname = fn != "" ? fn : ""; + + std::vector::type{})) + >> ret; + + try { + for (const auto &elem : vec) { + if constexpr (isVariant_v) { + // T == variant + std::visit( + [&look,&ret](auto &&alternative) + { + ret.push_back(look.extractor(alternative)); + }, + elem + ); + } else { + // T != variant + ret.push_back(look.extractor(elem)); + } + } // for + } catch (...) { + // context + log::member( + "compGetter {}::{}.{}({}) on vector", + nname, cname, fname, look.name); + throw; + } + + return ret; +} + + +// ----------------------------------------------------------------------------- +// 3. +// compGetter(vector, Lookup get/valued, names) +// Returns: const T & +// Get-mode Lookup, with a value. Meaning: return the element, of the vector, +// where extractor(element) == look.value. (Analogy: taking a vector, +// and returning the (first) element that has .real() == some given value.) +// ----------------------------------------------------------------------------- + +template< + class T, class EXTRACTOR, class TYPE, class CONVERTER, + class = std::enable_if_t::value> +> +const T &compGetter( + const std::vector &vec, + const Lookup &look, + const std::string &nname, const std::string &cname, const std::string &fn +) { + static const std::string context = "compGetter {}::{}.{}({}({})) on vector"; + const std::string fname = fn != "" ? fn : ""; + + try { + const T *object = nullptr; + + for (const auto &elem : vec) { + const T *ptr = nullptr; + + if constexpr (isVariant_v) { + // T == variant + std::visit( + [&elem,&look,&ptr](auto &&alternative) + { + using Class = std::decay_t; + if constexpr (has_field::value) + if (look.extractor(alternative) == look.value) + ptr = &elem; + }, + elem + ); + } else { + // T != variant + if (look.extractor(elem) == look.value) + ptr = &elem; + } + + if (ptr) { + if (object) { + const std::string valuestr = quote(look.value); + log::warning( + "Element with {}({}) was already found in the vector.\n" + "Keeping the first element that was found.", + look.name, valuestr + ); + log::member(context, nname, cname, fname, look.name, valuestr); + } else + object = ptr; + } + } // for + + if (object) + return *object; + + log::error( + "Element with metadatum {} == {} was not found in the vector" + + std::string(vec.size() ? "." : ";\nin fact, the vector is empty."), + look.name, quote(look.value) + ); + throw std::exception{}; + + } catch (...) { + // context + log::member(context, nname, cname, fname, look.name, quote(look.value)); + throw; + } +} + + +// ----------------------------------------------------------------------------- +// 4. +// compGetter(vector, Lookup, names) +// Returns: const T * +// ----------------------------------------------------------------------------- + +template< + class T, class... Ts, + LookupMode MODE, class EXTRACTOR, class TYPE, class CONVERTER, + class = std::enable_if_t> +> +const T *compGetter( + const std::vector> &vecvar, + const Lookup &look, + const std::string &nname, const std::string &cname, const std::string &fn +) { + const std::string fname = fn != "" ? fn : ""; + + try { + return std::get_if(&compGetter(vecvar, look, nname, cname, fname)); + } catch (...) { + // context + log::member( + "compGetter {}::{}.{}({}) on vector", + nname, cname, fname, quote(look.value)); + throw; + } +} + + +// ----------------------------------------------------------------------------- +// 5. +// compGetter(optional>, Lookup, names) +// ----------------------------------------------------------------------------- + +template +decltype(auto) compGetter( + const std::optional> &optvec, + const Lookup &look, + const std::string &nname, const std::string &cname, const std::string &fn +) { + const std::string fname = fn != "" ? fn : ""; + + try { + // optional must have value + if (!optvec.has_value()) { + log::error("optional vector {} does not have a value", fname); + throw std::exception{}; + } + return compGetter(*optvec, look, nname, cname, fname); + } catch (...) { + // context... + // ...nname::cname.fname(field(value)) + if constexpr (MODE == LookupMode::get && !detail::is_void_v) + log::member("compGetter {}::{}.{}({}({})) on optional", + nname, cname, fname, look.name, quote(look.value)); + // ...nname::cname.fname(has(field(value))) + if constexpr (MODE == LookupMode::exists && !detail::is_void_v) + log::member("compGetter {}::{}.{}(has({}({}))) on optional", + nname, cname, fname, look.name, quote(look.value)); + // ...nname::cname.fname(field) + if constexpr (MODE == LookupMode::get && detail::is_void_v) + log::member("compGetter {}::{}.{}({}) on optional", + nname, cname, fname, look.name); + // ...nname::cname.fname(has(field)) + if constexpr (MODE == LookupMode::exists && detail::is_void_v) + log::member("compGetter {}::{}.{}(has({})) on optional", + nname, cname, fname, look.name); + throw; + } +} + +} // namespace detail diff --git a/src/GNDStk/Component/src/detail-sfinae.hpp b/src/GNDStk/Component/src/detail-sfinae.hpp new file mode 100644 index 000000000..c792d723b --- /dev/null +++ b/src/GNDStk/Component/src/detail-sfinae.hpp @@ -0,0 +1,502 @@ + +namespace detail { + +// ----------------------------------------------------------------------------- +// Re: [optional] vector [of variant] +// ----------------------------------------------------------------------------- + +// ------------------------ +// isVector +// ------------------------ + +// general +template +struct isVector + : public std::false_type +{ }; + +// for std::vector +template +struct isVector> + : public std::true_type +{ }; + +// isVector_v +template +inline constexpr bool isVector_v = isVector::value; + +// isVector_t +template +using isVector_t = std::enable_if_t>; + +// ------------------------ +// isOptionalVector +// ------------------------ + +// general +template +struct isOptionalVector + : public std::false_type +{ }; + +// for std::optional +template +struct isOptionalVector>> + : public std::true_type +{ }; + +// isOptionalVector_v +template +inline constexpr bool isOptionalVector_v = isOptionalVector::value; + +// isOptionalVector_t +template +using isOptionalVector_t = std::enable_if_t>; + +// ------------------------ +// isVectorOrOptionalVector +// ------------------------ + +// general +template +struct isVectorOrOptionalVector + : public std::false_type +{ }; + +// for std::vector +template +struct isVectorOrOptionalVector> + : public std::true_type +{ + using element = T; +}; + +// for std::optional +template +struct isVectorOrOptionalVector>> + : public std::true_type +{ + using element = T; +}; + +// isVectorOrOptionalVector_v +template +inline constexpr bool isVectorOrOptionalVector_v = + isVectorOrOptionalVector::value; + +// isVectorOrOptionalVector_t +template +using isVectorOrOptionalVector_t = + std::enable_if_t>; + +// ------------------------ +// isVectorOfVariant +// ------------------------ + +// general +template +struct isVectorOfVariant + : public std::false_type +{ }; + +// for std::vector> +template +struct isVectorOfVariant,Alloc>> + : public std::true_type +{ }; + +// isVectorOfVariant_t +template +using isVectorOfVariant_t = std::enable_if_t::value>; + + +// ----------------------------------------------------------------------------- +// isDefaulted +// ----------------------------------------------------------------------------- + +// general +template +struct isDefaulted + : public std::false_type +{ }; + +// for Defaulted +template +struct isDefaulted> + : public std::true_type +{ }; + +// isDefaulted_t +template +using isDefaulted_t = std::enable_if_t::value>; + + +// ----------------------------------------------------------------------------- +// isDataNode +// ----------------------------------------------------------------------------- + +// general +template +struct isDataNode { + static constexpr bool value = false; +}; + +// for DataNode +template +struct isDataNode> { + static constexpr bool value = true; +}; + + +// ----------------------------------------------------------------------------- +// isLookupRefReturn +// ----------------------------------------------------------------------------- + +// general +template +struct isLookupRefReturn + : public std::false_type +{ }; + +// for Lookup +template +struct isLookupRefReturn> +{ + static inline constexpr bool value = !is_void_v; // == "TYPE != void" +}; + +// isLookupRefReturn_v +template +inline constexpr bool isLookupRefReturn_v = isLookupRefReturn::value; + +// isLookupRefReturn_t +template +using isLookupRefReturn_t = std::enable_if_t::value>; + + +// ----------------------------------------------------------------------------- +// Re: Component's "forwards" +// ----------------------------------------------------------------------------- + +// ------------------------ +// isMatchExact +// ------------------------ + +// general +template +struct isMatchExact { + static constexpr int count = 0; +}; + +// FROM, vector +template +struct isMatchExact> { + static constexpr int count = 1; +}; + +// FROM, std::optional> +template +struct isMatchExact>> { + static constexpr int count = 1; +}; + +// ------------------------ +// MatchesExact +// ------------------------ + +// general +template +struct MatchesExact { + static constexpr size_t count = 0; +}; + +// FROM, tuple<...> +template +struct MatchesExact> { + static constexpr size_t count = ( + isMatchExact< + FROM, + std::decay_t()))> + >::count + + ... + ); +}; + +// ------------------------ +// isMatchViable +// ------------------------ + +// general +template +struct isMatchViable { + static constexpr int count = 0; +}; + +// FROM, vector +template +struct isMatchViable> { + static constexpr int count = std::is_convertible_v; +}; + +// FROM, std::optional> +template +struct isMatchViable>> { + static constexpr int count = std::is_convertible_v; +}; + +// ------------------------ +// MatchesViable +// ------------------------ + +// general +template +struct MatchesViable { + static constexpr size_t count = 0; +}; + +// FROM, tuple<...> +template +struct MatchesViable> { + static constexpr size_t count = ( + isMatchViable< + FROM, + std::decay_t()))> + >::count + + ... + ); +}; + +// ------------------------ +// added +// ------------------------ + +// KEY = Meta or Child +template +bool added( + const COMPONENT &component, + const FROM &elem, const KEY &key, + const bool exact, const size_t n +) { + // Silences unused-parameter warnings if neither "if constexpr" passes + (void)n; + + // Remark. The below conditional code (involving both runtime and constexpr + // ifs) doesn't simplify in what may seem like obvious ways. Note that bool + // exact is runtime, and came from looking over all types in the caller's + // fold expression. For a given type from the fold expression, either or both + // of the following constexpr ifs may fail, and their bodies not make sense + // or not be something we'd necessarily want to call. (Specifically, if exact + // and viable matches both == 1, and the viable match is found before the + // exact one, we want to skip the [return setter] and wait for the exact.) + using T = std::decay_t; + if ( exact) if constexpr (detail::isMatchExact ::count) + return component.setter(*(T *)component.links[n],elem), true; + if (!exact) if constexpr (detail::isMatchViable::count) + return component.setter(*(T *)component.links[n],elem), true; + return false; +} + +// ------------------------ +// bracketHas +// bracketGetType +// ------------------------ + +// Helpers for class bracket, below. I'd scope these inside class bracket, +// but for this issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282 + +// bracketHas: default +template class Field, class T, class LOOK, class = int> +struct bracketHas { + static constexpr bool works = false; + using returns = void; +}; + +// bracketHas: if Field supports [LOOK] +template class Field, class T, class LOOK> +struct bracketHas< + Field, T, LOOK, + decltype((void)std::declval>()[std::declval()],0) +> { + static constexpr bool works = true; + using returns = decltype(std::declval>()[std::declval()]); +}; + +// bracketGetType: default +template class Field, class LOOK, class> +struct bracketGetType { +}; + +// bracketGetType: for tuple<> +template class Field, class LOOK> +struct bracketGetType> { + using type = void; +}; + +// bracketGetType: for tuple +template class Field, class LOOK, class T, class... Ts> +struct bracketGetType> { + // back: what a "Node(T)" query would return + using back = std::decay_t()))>; + using type = std::conditional_t< + bracketHas::works, + typename bracketHas::returns, + typename bracketGetType>::type + >; +}; + +// ------------------------ +// bracket +// ------------------------ + +// default +template +class bracket { +}; + +// tuple<...> +template +class bracket> +{ + // Field + // Shorthand for Field in COMPONENT (i.e. class Component) + template + using Field = typename COMPONENT::template Field; + + // value, returning pointer + template // KEY = Meta or Child + static const void *value( + const COMPONENT &component, const LOOK &look, + const KEY &key, const size_t n + ) { + using back = std::decay_t; + if constexpr (bracketHas::works) + return &component.getter(*(back *)component.links[n],look); + return nullptr; + } + +public: + + // type + using type = typename bracketGetType>::type; + + // count + static constexpr size_t count = ( + bracketHas< + Field, std::decay_t()))>, LOOK + >::works + + ... + ); + + // value + static type value(const COMPONENT &component, const LOOK &look) + { + const void *ptr = nullptr; + std::apply( + [&component,&look,&ptr](const auto &... key) + { + size_t n = 0; + ((ptr || (ptr = value(component,look,key,n++))), ...); + }, + component.Keys().tup + ); + + // Note: our use of the current (detail::) class is such that + // we shouldn't ever have ptr == nullptr here... + return *(std::remove_reference_t *)ptr; + } +}; + + +// ----------------------------------------------------------------------------- +// isDerivedFrom* +// ----------------------------------------------------------------------------- + +// isDerivedFromComponent +// Adapted from an answer here: +// https://stackoverflow.com/questions/34672441 +// The issue is that Component is a class *template*. +template +struct isDerivedFromComponent { +private: + template + static constexpr std::true_type test(Component *); + static constexpr std::false_type test(...); + using type = decltype(test(std::declval())); +public: + static constexpr bool value = type::value; +}; + +template +inline constexpr bool isDerivedFromComponent_v = + isDerivedFromComponent::value; + +// isDerivedFromVector +template +struct isDerivedFromVector { +private: + template + static constexpr std::pair,std::true_type> + test(std::vector *); + static constexpr std::pair + test(...); + using ret = decltype(test(std::declval())); +public: + static constexpr bool value = ret::second_type::value; + using type = std::conditional_t; +}; + +template +inline constexpr bool isDerivedFromVector_v = + isDerivedFromVector::value; + +template +using isDerivedFromVector_t = typename isDerivedFromVector::type; + + +// ----------------------------------------------------------------------------- +// HasPrint* +// ----------------------------------------------------------------------------- + +// These are adapted from an answer here: +// https://stackoverflow.com/questions/87372 + +// HasPrintOneArg +template +class HasPrintOneArg +{ + template< + class U, + std::ostream &(U::*)(std::ostream &) const + > struct SFINAE {}; + + template static char test(SFINAE *); + template static long test(...); + +public: + static constexpr bool has = sizeof(test(0)) == sizeof(char); +}; + +// HasPrintTwoArg +template +class HasPrintTwoArg +{ + template< + class U, + std::ostream &(U::*)(std::ostream &, const int) const + > struct SFINAE {}; + + template static char test(SFINAE *); + template static long test(...); + +public: + static constexpr bool has = sizeof(test(0)) == sizeof(char); +}; + +// Variable templates for the above; prefer these +template +inline constexpr bool hasPrintOneArg = HasPrintOneArg::has; + +template +inline constexpr bool hasPrintTwoArg = HasPrintTwoArg::has; + +} // namespace detail diff --git a/src/GNDStk/Component/src/detail.hpp b/src/GNDStk/Component/src/detail.hpp index 05cf4322d..c290b68b9 100644 --- a/src/GNDStk/Component/src/detail.hpp +++ b/src/GNDStk/Component/src/detail.hpp @@ -1,789 +1,518 @@ -// Forward declaration, needed by some things later -template -class Component; - - namespace detail { -// ----------------------------------------------------------------------------- -// colorize_*(text) -// ----------------------------------------------------------------------------- - -#define gndstkPaste(one,two) one ## two -#define gndstkColorFun(part) \ - inline std::string gndstkPaste(colorize_,part)(const std::string &text) \ - { \ - return GNDStk::color && colors::part != "" \ - ? colors::part + text + colors::reset \ - : text; \ - } - - // colorize_label() etc. - gndstkColorFun(label) - gndstkColorFun(colon) - gndstkColorFun(component) - gndstkColorFun(brace) - gndstkColorFun(bracket) - gndstkColorFun(comment) - -#undef gndstkColorFun -#undef gndstkPaste - - - // ----------------------------------------------------------------------------- // Functions: miscellaneous // ----------------------------------------------------------------------------- -// ------------------------ -// getName -// ------------------------ +// indentString +inline void indentString( + std::ostream &os, const int level, const std::string &str = "" +) { + os << std::string(GNDStk::indent * level, ' ') << str; +} -// Meta +// getName(Meta) template -std::string getName(const Meta &m) +const std::string & +getName(const Meta &m) { return m.name; } -// Child +// getName(Child) template -std::string getName(const Child &c) +const std::string & +getName(const Child &c) { return c.name; } -// pair +// getName(pair) template< class TYPE, Allow ALLOW, class CONVERTER, class FILTER, class T, class = std::enable_if_t::value> > -std::string getName(const std::pair,T> &p) +const std::string & +getName(const std::pair,T> &p) { return getName(p.first); } - -// ------------------------ -// colorize -// ------------------------ - -inline std::string colorize( - const std::string &label, - const std::string &color -) { - // no coloring in the first place? - if (!GNDStk::color) - return label; - - // normal label color? - if (color == "") - return colorize_label(label); - - // override, e.g. for optional - return color + label + colors::reset; -} - - -// ------------------------ // fullName -// ------------------------ - inline std::string fullName( - const std::string &nsname, - const std::string &clname + const std::string &nname, // name of namespace + const std::string &cname // name of class ) { - return (nsname == "" ? "" : nsname + "::") + clname; + return (nname == "" ? "" : nname + "::") + cname; } -// ------------------------ -// indentString -// ------------------------ - -inline void indentString( - std::ostream &os, const int level, const std::string &str = "" -) { - os << std::string(GNDStk::indent * level,' ') << str; -} - - -// ------------------------ -// hasWriteOneArg -// hasWriteTwoArg -// ------------------------ - -// These are adapted from an answer here: -// https://stackoverflow.com/questions/87372 - -// class -template -class HasWriteOneArg -{ - template< - class U, - std::ostream &(U::*)(std::ostream &) const - > struct SFINAE {}; - - template static char test(SFINAE *); - template static long test(...); - -public: - static const bool has = sizeof(test(0)) == sizeof(char); -}; - -// variable - use this -template -inline constexpr bool hasWriteOneArg = HasWriteOneArg::has; - -// class -template -class HasWriteTwoArg -{ - template< - class U, - std::ostream &(U::*)(std::ostream &, const int) const - > struct SFINAE {}; - - template static char test(SFINAE *); - template static long test(...); - -public: - static const bool has = sizeof(test(0)) == sizeof(char); -}; - -// variable - use this -template -inline constexpr bool hasWriteTwoArg = HasWriteTwoArg::has; - - - // ----------------------------------------------------------------------------- -// writeComponentPart +// printComponentPart // ----------------------------------------------------------------------------- // Cases: -// std::string -// T -// std::optional -// Defaulted -// std::vector - -bool writeComponentPart( - std::ostream &os, const int level, const std::string &str, - const std::string &label, const std::size_t maxlen, - const std::string &color = "" -); - -template -bool writeComponentPart( - std::ostream &os, const int level, const T &value, - const std::string &label, const std::size_t maxlen, - const std::string &color = "" -); - -template -bool writeComponentPart( - std::ostream &os, const int level, const std::optional &opt, - const std::string &label, const std::size_t maxlen -); - -template -bool writeComponentPart( - std::ostream &os, const int level, const Defaulted &def, - const std::string &label, const std::size_t maxlen -); - -template -bool writeComponentPart( - std::ostream &os, const int level, const std::vector &vec, - const std::string &label, const std::size_t maxlen, - const std::string &color = "" -); - +// 1. string +// 2. DataNode +// 3. DataNode> +// 4. T +// 5. vector +// 6. std::optional +// 7. Defaulted // ------------------------ -// for string +// 1. string // ------------------------ -inline bool writeComponentPart( - std::ostream &os, const int level, const std::string &str, - const std::string &label, const std::size_t maxlen, - const std::string &color +inline bool printComponentPart( + std::ostream &os, const int level, const size_t maxlen, + const std::string &label, + const std::string &value, + const std::string &labelColor = color::label, + const std::string &valueColor = color::value ) { indentString(os,level); if (label != "") { - os << colorize(label,color); - if (maxlen != 0) - os << std::string(maxlen-label.size(),' '); - os << " " << colorize_colon(":"); - // assuming the string to be printed isn't empty - which we don't really - // anticipate would happen - then print a space after the ":" and before - // the soon-to-be-printed string - if (str != "") + // label + os << colorize(label,labelColor); + + // alignment + if (maxlen != 0) { + assert(maxlen >= label.size()); + os << std::string(maxlen-label.size(), ' '); + } + + // space, :, space + os << ' ' << colorize(":",labelColor); + // Assuming the string to be printed isn't empty - which we don't really + // anticipate it would be - print a space after the ":", i.e. just before + // the soon-to-be-printed string. + if (value != "") os << ' '; } - for (auto &ch : str) { + // Nothing to print. + if (value == "") + return true; + + // Print, indenting after any internal newlines the string might contain. + const bool hascolor = GNDStk::colors && valueColor != ""; + bool start = true; + + for (const char ch : value) { + if (start && hascolor) os << valueColor; + start = ch == '\n'; + if (start && hascolor) os << color::reset; // before os << \n... os << ch; - // indent after any internal newlines the string might happen to have; - // but callers probably shouldn't *end* such strings with newlines - if (ch == '\n') + if (start) { // after \n, indent for additional content + os << std::flush; indentString(os,level); + } } + if (hascolor) os << color::reset; return true; } // ------------------------ -// for T +// 2. DataNode // ------------------------ -// helper -// is_base_of_Component -// Adapted from an answer here: -// https://stackoverflow.com/questions/34672441 -template -class is_base_of_Component { - template - static constexpr std::true_type test(Component *); - static constexpr std::false_type test(...); - using type = decltype(test(std::declval())); -public: - static constexpr bool value = type::value; -}; - -template -bool writeComponentPart( - std::ostream &os, const int level, const T &value, - const std::string &label, const std::size_t maxlen, - const std::string &color +template +bool printComponentPart( + std::ostream &os, const int level, const size_t, + const std::string &, + const DataNode &value, + const std::string & = "", + const std::string &valueColor = color::data::string ) { - if constexpr (is_base_of_Component::value) { - // T is derived from Component, and thus inherits a write() - value.write(os,level); - } else { - // T is any old type, not derived from Component - if constexpr (std::is_floating_point_v) { - writeComponentPart( - os, level, - detail::Precision< - detail::PrecisionContext::metadata, - T - >{}.write(value), - label, maxlen, color - ); - } else { - // The string intermediary allows us to indent properly - // if the printed value has internal newlines. - std::string str; - convert_t{}(value,str); - writeComponentPart(os, level, str, label, maxlen, color); - } - } - return true; + // If empty, don't even print a newline + if (value == "") + return false; + + // Forward to printComponentPart(string). The way we're printing + // a DataNode, maxlen, label, and labelColor aren't used. + return printComponentPart( + os, level, 0, "", + static_cast(value), + "", + valueColor + ); } // ------------------------ -// for optional +// 3. DataNode // ------------------------ -template -bool writeComponentPart( - std::ostream &os, const int level, const std::optional &opt, - const std::string &label, const std::size_t maxlen +template +bool printComponentPart( + std::ostream &os, const int level, const size_t, + const std::string &, + const DataNode,preferCDATA> &vec, + const std::string & = "", + const std::string &valueColor = color::data::vector ) { - if (opt.has_value()) - writeComponentPart( - os, level, opt.value(), - label, maxlen, colors::optional - ); - else if (comments) - writeComponentPart( - os, level, colorize_comment("// optional; has no value"), - label, maxlen, colors::optional + // The way we're printing a DataNode, maxlen, label, + // and labelColor aren't used. + + // If empty, don't even print a newline + const size_t size = vec.size(); + if (size == 0) + return false; + + // Coloring? + const bool hascolor = + (colors && valueColor != "") || + (shades && std::is_arithmetic_v); + + // Indentation (string, with some number of spaces) + const std::string indent(GNDStk::indent * level, ' '); + + // End, given the requested truncation + const size_t end = GNDStk::elements < 0 + ? size + : std::min(size, size_t(GNDStk::elements)); + + // Compute the minimum and maximum values in the data vector, if we'll need + // them. Our use of std::conditional_t allows us to avoid constructing two + // possibly large and complex T values (given that T could be, for example, + // a large Component-based object) if T isn't of arithmetic type. Note that + // vec.size() == 0 was ruled out above, so that vec[0] initialization works. + std::conditional_t,T,int> min, max; + if constexpr (std::is_arithmetic_v) { + min = max = vec[0]; + if (shades) { + for (size_t i = 1; i < size; ++i) { + min = std::min(min,vec[i]); + max = std::max(max,vec[i]); + } + } + } else + min = max = 0; + + // Print, using column formatting + for (size_t i = 0; i < end; ++i) { + // element's whitespace prefix + i == 0 + // at the very beginning + ? os << indent + : GNDStk::columns <= 0 || i % size_t(GNDStk::columns) != 0 + // still on the current line + ? os << ' ' + // starting the next line + : os << (hascolor ? color::reset : "") << std::endl << indent; + + // color, if applicable + if constexpr (std::is_arithmetic_v) + if (shades) + os << color::blue2red(min,vec[i],max); + if (hascolor && !(std::is_arithmetic_v && shades)) + os << valueColor; + + // element + if constexpr (std::is_floating_point_v) + os << Precision{}.write(vec[i]); + else + os << vec[i]; + }; + if (hascolor) os << color::reset; + + // If applicable, print a message saying the data were truncated + if (end < size) { + if (end > 0) + os << std::endl; // we printed *something*; go to the next line, then: + os << indent << colorize_comment( + "truncated; actual #elements == " + std::to_string(size), + valueColor ); - else - return false; // <== caller won't print newline + } + return true; } // ------------------------ -// for Defaulted +// 4. T (general) // ------------------------ template -bool writeComponentPart( - std::ostream &os, const int level, const Defaulted &def, - const std::string &label, const std::size_t maxlen +bool printComponentPart( + std::ostream &os, const int level, const size_t maxlen, + const std::string &label, + const T &value, + const std::string &labelColor = isDerivedFromComponent_v + ? color::field + : color::label, + const std::string &valueColor = color::value ) { - if (def.has_value()) { - writeComponentPart( - os, level, def.value(), - label, maxlen, colors::defaulted + // If value is derived from Component, we'll call its .print() function. + // Otherwise, we'll forward to printComponentPart(string), after creating + // some sort of string representation of the value. + + (void)maxlen; // silence compiler warning if unused (per constexpr if) + + if constexpr (isDerivedFromComponent_v) { + value.baseComponent().print(os,level,label,labelColor); + } else if constexpr (std::is_floating_point_v) { + // T is floating-point. Use our floating-point printing mechanism. + printComponentPart( + os, level, maxlen, label, + Precision{}.write(value), + labelColor, valueColor ); - } else if (comments) { + } else { + // T is not floating-point. + // A string intermediary allows us to indent properly if the printed + // value has internal newlines. std::string str; - convert_t{}(def.get_default(),str); - writeComponentPart( - os, level, - colorize_comment("// defaulted; is its default (" + str + ")"), - label, maxlen, colors::defaulted - ); - } else - return false; // <== caller won't print newline - return true; -} - - -// ------------------------ -// for vector -// ------------------------ + convert_t{}(value,str); -// label [ -// element -// element -// ... -// ] -template -bool writeComponentPart( - std::ostream &os, const int level, const std::vector &vec, - const std::string &label, const std::size_t maxlen, - const std::string &color -) { - (void)maxlen; // doesn't use; formats with [...] - - indentString( - os, level, - colorize( - label, - color != "" ? color : colors::vector - ) - + " " + colorize_bracket("[") + "\n" - ); - - for (auto &value : vec) { - writeComponentPart(os, level+1, value, "", 0); - os << '\n'; // between elements + printComponentPart( + os, level, maxlen, label, + str, + labelColor, valueColor + ); } - indentString( - os, level, - colorize_bracket("]") - ); - return true; } +// ------------------------ +// 5. vector +// ------------------------ -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- -// getter() -// Various cases. -// Intended for use in our auto-generated Standard Interface classes. -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- - -// ----------------------------------------------------------------------------- -// getter(vector, index, ...) -// Index into vector data member of class. -// ----------------------------------------------------------------------------- - -// const template -const T &getter( +bool printComponentPart( + std::ostream &os, const int level, const size_t, + const std::string &label, const std::vector &vec, - const std::size_t index, - const std::string &nsname, // enclosing class' namespace - const std::string &clname, // enclosing class - const std::string &field // enclosing class' field we're accessing + const std::string &labelColor = color::vector, + const std::string & = "" ) { - static const std::string context = "getter {}::{}.{}({}) on vector"; - - try { - // todo Make this more efficient, e.g. by assuming that the vector's - // elements are sorted by index, so that the wanted value is likely - // to be found at [index]. - - const T *selected = nullptr; - - for (auto &v : vec) { - const T *ptr = nullptr; - - if constexpr (isVariant::value) { - // T == variant - std::visit( - [&v,&index,&ptr](auto &&alternative) - { - if constexpr (hasIndex) - if (alternative.index() == index) - ptr = &v; - }, - v - ); - } else { - // T != variant - if constexpr (hasIndex) - if (v.index() == index) - ptr = &v; - } - - if (!ptr) - continue; - - if (selected) { - log::warning( - "Element with index {} was already found in the vector.\n" - "Keeping the first element that was found.", - index - ); - log::member(context, nsname, clname, field, index); - } else - selected = ptr; - } // for - - if (!selected) { - log::error( - "Element with index {} was not found in the vector" + - std::string(vec.size() ? "." : ";\nin fact the vector is empty."), - index + // Forward to some printComponentPart() for each element. Note that here, + // in the vector context, maxlen isn't applicable. As for valueColor (the + // last parameter), the forwarded-to printComponentPart() will use what's + // appropriate for the vector's elements. + + // To avoid user confusion in prettyprinted output, we'll change our special + // name "#comment" (which identifies comment nodes to be transformed into the + // form when writing to XML), to the name "comment" instead. + // Also, because our code generator creates the comment vector field + // automatically, in generated classes, we won't print it here at all if the + // vector is empty. That is, we won't write "comment [(nothing)]"). This way, + // users won't wonder where it came from. (It was created automatically.) + const bool isComment = label == special::comment; + if ((isComment || isDerivedFromComponent_v) && vec.size() == 0) + return false; // <== so that the caller won't print a newline + + const std::string lab = isComment ? "comment" : label; + + if constexpr (isDerivedFromComponent_v) { + size_t index = 0; + + // elements + for (const auto &element : vec) { + if (index) + os << std::endl; // between elements + printComponentPart( + os, level, 0, + lab + '[' + std::to_string(index++) + ']', + element, + color::vector, + "" ); - throw std::exception{}; + } + } else { + // [ + indentString(os, level, colorize(lab + " [", labelColor)); + os << std::endl; + + // elements + for (const auto &element : vec) { + printComponentPart( + os, level+1, 0, + "", + element, + "", + isComment ? color::comment : "" + ); + os << std::endl; // between elements } - return *selected; - - } catch (...) { - // context - // Example: prints "getter containers::Axes.axis(100)" - log::member(context, nsname, clname, field, index); - throw; + // ] + indentString( + os, level, + comments + ? colorize("] " + colorize_comment(lab), labelColor) + : colorize("]", labelColor) + ); } -} -// non-const -template -T &getter( - std::vector &vec, - const std::size_t index, - const std::string &nsname, - const std::string &clname, - const std::string &field -) { - return const_cast( - getter(std::as_const(vec), index, nsname, clname, field) - ); + return true; } +// ------------------------ +// 6. optional +// ------------------------ -// ----------------------------------------------------------------------------- -// getter(vector, label, ...) -// Element of the vector that has .label() == label. -// Assumes that the element type has a .label() getter. -// ----------------------------------------------------------------------------- - -// const -template -const T &getter( - const std::vector &vec, - const std::string &label, - const std::string &nsname, - const std::string &clname, - const std::string &field -) { - static const std::string context = "getter {}::{}.{}(\"{}\") on vector"; - - try { - const T *selected = nullptr; - - for (auto &v : vec) { - const T *ptr = nullptr; - - if constexpr (isVariant::value) { - // T == variant - std::visit( - [&v,&label,&ptr](auto &&alternative) - { - if constexpr (hasLabel) - if (alternative.label() == label) - ptr = &v; - }, - v - ); - } else { - // T != variant - if constexpr (hasLabel) - if (v.label() == label) - ptr = &v; - } - - if (!ptr) - continue; - - if (selected) { - log::warning( - "Element with label \"{}\" was already found in the vector.\n" - "Keeping the first element that was found.", - label - ); - log::member(context, nsname, clname, field, label); - } else - selected = ptr; - } // for - - if (!selected) { - log::error( - "Element with label \"{}\" was not found in the vector" + - std::string(vec.size() ? "." : ";\nin fact the vector is empty."), - label - ); - throw std::exception{}; - } - - return *selected; - - } catch (...) { - // context - log::member(context, nsname, clname, field, label); - throw; - } -} - -// non-const template -T &getter( - std::vector &vec, +bool printComponentPart( + std::ostream &os, const int level, const size_t maxlen, const std::string &label, - const std::string &nsname, - const std::string &clname, - const std::string &field + const std::optional &value, + const std::string &labelColor = "", + const std::string &valueColor = "" ) { - return const_cast( - getter(std::as_const(vec), label, nsname, clname, field) + if (!value.has_value()) + return false; // <== so that the caller won't print a newline + + // label color + const std::string clabel = + labelColor != "" + ? labelColor + : isDerivedFromComponent_v + ? color::optional::field + : isVector_v + ? color::optional::vector + : color::optional::label; + + // value color + const std::string cvalue = + valueColor != "" ? valueColor : color::optional::value; + + // print + printComponentPart( + os, level, maxlen, label, + value.value(), + clabel, cvalue ); -} - - - -// ----------------------------------------------------------------------------- -// getter(optional, index or label, ...) -// As earlier, but for optional data member. -// ----------------------------------------------------------------------------- - -// const -template< - class T, class LOOKUP, - class = std::enable_if_t< - std::is_convertible_v || - std::is_convertible_v - > -> -const T &getter( - const std::optional> &opt, - const LOOKUP &index_or_label, - const std::string &nsname, - const std::string &clname, - const std::string &field -) { - try { - // optional must have value - if (!opt.has_value()) { - log::error("optional vector {} does not have a value", field); - throw std::exception{}; - } - return getter((*opt), index_or_label, nsname, clname, field); - } catch (...) { - // context - log::member( - std::is_convertible_v - ? "getter {}::{}.{}({}) on optional" - : "getter {}::{}.{}(\"{}\") on optional", - nsname, clname, field, index_or_label); - throw; - } -} -// non-const -template< - class T, class LOOKUP, - class = std::enable_if_t< - std::is_convertible_v || - std::is_convertible_v - > -> -T &getter( - std::optional> &opt, - const LOOKUP &index_or_label, - const std::string &nsname, - const std::string &clname, - const std::string &field -) { - return const_cast( - getter(std::as_const(opt), index_or_label, nsname, clname, field) - ); + return true; } - -// ----------------------------------------------------------------------------- -// getter(...) -// With caller-specified type, when variant is involved -// ----------------------------------------------------------------------------- - // ------------------------ -// variant,... +// 7. Defaulted // ------------------------ -template< - class T, - class... Ts, - class = std::enable_if_t>> -> -const T *getter( - const std::variant &var, - const std::string &nsname, - const std::string &clname, - const std::string &field +template +bool printComponentPart( + std::ostream &os, const int level, const size_t maxlen, + const std::string &label, + const Defaulted &value, + const std::string &labelColor = "", + const std::string &valueColor = "" ) { - try { - return std::holds_alternative(var) - ? &std::get(var) - : nullptr; - } catch (...) { - // context - log::member( - "getter {}::{}.{}() on variant", - nsname, clname, field); - throw; - } -} - - -// ------------------------ -// vector, -// index or label, -// ... -// ------------------------ + // label color + const std::string clabel = + labelColor != "" + ? labelColor + : isDerivedFromComponent_v + ? color::optional::field + : isVector_v + ? color::optional::vector + : color::optional::label; + + // value color + const std::string cvalue = + valueColor != "" ? valueColor : color::optional::value; + + // print + printComponentPart( + os, level, maxlen, label, + value.value(), + clabel, cvalue + ); -// The (size_t index) and (string label) cases were similar enough that -// we were able to combine them into one function. + // comment + if (comments) + os << ' ' << colorize_comment("its default",cvalue); -template< - class T, class LOOKUP, - class = std::enable_if_t< - std::is_convertible_v || - std::is_convertible_v - >, - class... Ts -> -const T *getter( - const std::vector> &vec, - const LOOKUP &index_or_label, - const std::string &nsname, - const std::string &clname, - const std::string &field -) { - try { - return getter( - // no , so it calls getter(generic vector); it isn't recursive - getter(vec, index_or_label, nsname, clname, field), // scalar variant - nsname, clname, field - ); - } catch (...) { - // context - log::member( - std::is_convertible_v - ? "getter {}::{}.{}({}) on vector" - : "getter {}::{}.{}(\"{}\") on vector", - nsname, clname, field, index_or_label); - throw; - } + return true; } - // ----------------------------------------------------------------------------- // For sorting derived-class fields based on index and label, if and when one // or the other of those is determined to be present. That determination hinges -// on both a compile-time check that the classes involved even *have* index or -// label fields in their content struct, and if they do, if either of those is -// possibly a std::optional that may or may not contain a value at the moment. +// on both a compile-time check that the classes involved even *have* index +// or label fields, and, if they do, if either of those is possibly an optional +// that may or may not contain a value at the moment. // ----------------------------------------------------------------------------- // ------------------------ // compareRegular // ------------------------ -// See compareVariant() below to understand -// why we have A and B, not T for both +// See compareVariant() below to understand why we have A and B, +// not T for both template bool compareRegular(const A &a, const B &b) { // Intentional: some "if ((x = y))"s below; i.e. =, not == // index? - std::size_t aindex = 0; bool ahasindex = false; - if constexpr (hasIndex) { - if constexpr (isOptional) { - if ((ahasindex = a.content.index.has_value())) - aindex = a.content.index.value(); + size_t aindex = 0; bool a_has_index = false; + if constexpr (has_index_v) { + if constexpr (isOptional) { + if ((a_has_index = a.index().has_value())) + aindex = a.index().value(); } else { - ahasindex = true; - aindex = a.content.index; + a_has_index = true; + aindex = a.index(); } } - std::size_t bindex = 0; bool bhasindex = false; - if constexpr (hasIndex) { - if constexpr (isOptional) { - if ((bhasindex = b.content.index.has_value())) - bindex = b.content.index.value(); + size_t bindex = 0; bool b_has_index = false; + if constexpr (has_index_v) { + if constexpr (isOptional) { + if ((b_has_index = b.index().has_value())) + bindex = b.index().value(); } else { - bhasindex = true; - bindex = b.content.index; + b_has_index = true; + bindex = b.index(); } } // label? - std::string alabel = ""; bool ahaslabel = false; - if constexpr (hasLabel) { - if constexpr (isOptional) { - if ((ahaslabel = a.content.label.has_value())) - alabel = a.content.label.value(); + std::string alabel = ""; bool a_has_label = false; + if constexpr (has_label_v) { + if constexpr (isOptional) { + if ((a_has_label = a.label().has_value())) + alabel = a.label().value(); } else { - ahaslabel = true; - alabel = a.content.label; + a_has_label = true; + alabel = a.label(); } } - std::string blabel = ""; bool bhaslabel = false; - if constexpr (hasLabel) { - if constexpr (isOptional) { - if ((bhaslabel = b.content.label.has_value())) - blabel = b.content.label.value(); + std::string blabel = ""; bool b_has_label = false; + if constexpr (has_label_v) { + if constexpr (isOptional) { + if ((b_has_label = b.label().has_value())) + blabel = b.label().value(); } else { - bhaslabel = true; - blabel = b.content.label; + b_has_label = true; + blabel = b.label(); } } return // index: primary - ahasindex && bhasindex ? aindex < bindex - : ahasindex ? true - : bhasindex ? false + a_has_index && b_has_index ? aindex < bindex + : a_has_index ? true + : b_has_index ? false // label: secondary - : ahaslabel && bhaslabel ? alabel < blabel - : ahaslabel ? true - : bhaslabel ? false - // equal + : a_has_label && b_has_label ? alabel < blabel + : a_has_label ? true + : b_has_label ? false + // equal (so, not <, for strict weak ordering purposes) : false; } @@ -827,7 +556,7 @@ void sort(T &) template void sort(std::vector &vec) { - if constexpr (hasIndex || hasLabel) + if constexpr (has_index_v || has_label_v) std::sort(vec.begin(), vec.end(), compareRegular); } @@ -836,11 +565,11 @@ template void sort(std::vector> &vec) { using T = std::variant; - if constexpr (hasIndex || hasLabel) + if constexpr (has_index_v || has_label_v) std::sort(vec.begin(), vec.end(), compareVariant); } -// optional +// std::optional template void sort(std::optional> &opt) { @@ -848,4 +577,66 @@ void sort(std::optional> &opt) sort(opt.value()); } + +// ----------------------------------------------------------------------------- +// queryResult +// ----------------------------------------------------------------------------- + +// general +template +struct queryResult { + using type = std::decay_t()))>; +}; + +// for Meta +// Needed, because Node{}(std::declval()) in the above "general" case +// doesn't instantiate for Defaulted, which has no default constructor. +template +struct queryResult,CONVERTER>> { + using type = Defaulted; +}; + +// for std::tuple +template +struct queryResult> { + using type = std::tuple::type...>; +}; + + +// ----------------------------------------------------------------------------- +// pprintAlign +// ----------------------------------------------------------------------------- + +// Component::print() - the prettyprinter - uses the following in order to +// include certain constructs in Component-derived classes from its alignment +// computation, and exclude other constructs. We believe that the alignment +// just looks better, and has fewer spurious-looking spaces, when some types +// of constructs are excluded. + +struct pprintAlign { + template + bool operator()(const KEY &, const void *const link) const + { + (void)link; // silence compiler warning if unused (per constexpr if) + using RESULT = typename queryResult::type; + + // [optional] vectors, component-derived classes, and data nodes + // print in their own special manner; so, no key:value alignment. + if constexpr ( + isVector_v || + isOptionalVector_v || + isDerivedFromComponent_v || + isDataNode::value) + return false; + + // if optional (with a non-vector value, or already handled above), + // align iff optional has value, and value isn't component-derived + if constexpr (isOptional) + return ((const RESULT *)link)->has_value() && + !isDerivedFromComponent_v; + + return true; + } +}; + } // namespace detail diff --git a/src/GNDStk/Component/src/field.hpp b/src/GNDStk/Component/src/field.hpp new file mode 100644 index 000000000..a86df4081 --- /dev/null +++ b/src/GNDStk/Component/src/field.hpp @@ -0,0 +1,353 @@ + +// ----------------------------------------------------------------------------- +// Field +// Note that this class is defined inside of class Component. We do this because +// it uses type Component itself (the particular Component<...> that it's in) as +// well as type DERIVED (the class that derives from this Component, via CRTP). +// ----------------------------------------------------------------------------- + +template +class Field { + + // friends + friend DERIVED; + + template + friend class FieldPart; + + // data + DERIVED &parent; + T wrappedValue; + +public: + + // ------------------------ + // Constructors + // ------------------------ + + // Summary + // Field(parent) + // Field(parent, T value) + // Field(parent, Field other) + // Field(parent, default value, optional value) // If T == Defaulted + + // No copy or move construction; parent would be wrong + Field(const Field &) = delete; + Field(Field &&) = delete; + + // The following accept DERIVED*, not DERIVED&, so that we can write "this", + // not "*this", where Field objects are constructed. It's just a bit shorter. + + // parent + // This could be rolled into the (parent, value) constructor below, but, + // if we split it out, the compiler seems to be better able to optimize + // the construction of parent objects. + explicit Field(DERIVED *const parent) : + parent(*parent), + wrappedValue(T{}) // default + { } + + // parent, value + Field(DERIVED *const parent, const T &value) : + parent(*parent), + wrappedValue(value) // from value + { } + + // parent, other Field + Field(DERIVED *const parent, const Field &other) : + parent(*parent), + wrappedValue(other.wrappedValue) // from other + { } + + // If T == Defaulted + // parent, default value, current value (std::optional) + template> + Field( + DERIVED *const parent, + const typename TEE::value_type &def, + const std::optional &value = {} + ) : + parent(*parent), + wrappedValue(def,value) + { } + + // ------------------------ + // Assignment: copy, move + // Some other assignments + // are defined elsewhere + // ------------------------ + + // copy + Field &operator=(const Field &other) + { + wrappedValue = other.wrappedValue; + return *this; + } + + // move + Field &operator=(Field &&other) + { + wrappedValue = std::move(other.wrappedValue); + return *this; + } + + // ------------------------ + // has_value + // ------------------------ + + // Relates to std::optional, not to the question of what metadata or metadata + // values the present Field might contain. (See the has() functions for those + // capabilities.) Returns true iff either T is optional but has a value, or T + // isn't optional (so that it necessarily has a value). + bool has_value() const + { + if constexpr (detail::isOptional) + return wrappedValue.has_value(); + return true; + } + + // ------------------------ + // operator()(has(...)) + // has + // ------------------------ + + template< + class EXTRACTOR, class TYPE, class CONVERTER, + class TEE = T, class = detail::isVectorOrOptionalVector_t + > + bool operator()( + const Lookup &look + ) const { + return parent.getter(wrappedValue,look); + } + + template< + class EXTRACTOR, class TYPE, class CONVERTER, + class TEE = T, class = detail::isVectorOrOptionalVector_t + > + bool has( + const Lookup &look + ) const { + return (*this)(GNDStk::has(look)); // just above + } + + // ------------------------ + // operator() + // ------------------------ + + // () + // Get exactly the Field-wrapped value, whatever it is (including optional) + + // const + const T &operator()() const + { + return wrappedValue; + } + + // non-const + T &operator()() + { + return wrappedValue; + } + + // ------------------------ + // value() + // Drill into any optional + // ------------------------ + + // Note: the parentheses in "return (wrappedValue)" are necessary + // here, so that the decltype(auto) return types produce references! + + // const + decltype(auto) value() const + { + if constexpr (detail::isOptional) + return wrappedValue.value(); + else + return (wrappedValue); + } + + // non-const + decltype(auto) value() + { + if constexpr (detail::isOptional) + return wrappedValue.value(); + else + return (wrappedValue); + } + + // ------------------------ + // size() + // ------------------------ + + // If T == [optional] vector + template> + size_t size() const + { + if constexpr (detail::isOptional) + return wrappedValue.has_value() ? wrappedValue->size() : 0; + else + return wrappedValue.size(); + } + + // ------------------------ + // operator[](size_t) + // ------------------------ + + // If T == [optional] vector + + // const + template> + decltype(auto) operator[](const size_t index) const + { + if constexpr (detail::isOptional) + return wrappedValue.value()[index]; + else + return wrappedValue[index]; + } + + // non-const + template> + decltype(auto) operator[](const size_t index) + { + if constexpr (detail::isOptional) + return wrappedValue.value()[index]; + else + return wrappedValue[index]; + } + + // ------------------------ + // operator[](Lookup) + // ------------------------ + + // If T == [optional] vector + + // const + template< + class EXTRACTOR, class TYPE, class CONVERTER, class TEE = T, + class = std::enable_if_t< + detail::has_field< + typename detail::isVectorOrOptionalVector::element, EXTRACTOR + >::value + > + > + decltype(auto) operator[]( + const Lookup &look + ) const { + return parent.getter(wrappedValue,look); + } + + // non-const + template< + class EXTRACTOR, class TYPE, class CONVERTER, class TEE = T, + class = std::enable_if_t< + detail::has_field< + typename detail::isVectorOrOptionalVector::element, EXTRACTOR + >::value + > + > + decltype(auto) operator[]( + const Lookup &look + ) { + return parent.getter(wrappedValue,look); + } + + // ------------------------ + // Conversions + // ------------------------ + + // zzz working here + + // To T + // Same as () + operator const T &() const { return wrappedValue; } + operator T &() { return wrappedValue; } + + // If T == optional + // To vector + // Note that the return type, TEE::value_type, is the type of the vector + // optionally contained in the optional - NOT the vector's element type. + + // Discussion. We're providing the following functions essentially because + // they may "smooth out" the interface for users. Imagine that we're dealing + // with an optional. If the optional contains a value, which in these + // circumstances means a vector, then these "conversion to vector" functions + // just, well, return the contained vector. End of story. However, what if + // the optional doesn't contain a value? Well, one could reasonably consider + // that "no vector" is equivalent, for many purposes at least, to "have a + // vector but with size 0." Following this line of reasoning, we've designed + // this "conversion to vector" to do the following. If the optional has a + // value, return the value. If not, then place a 0-length vector into the + // optional, then return the value. In short, "return the contained vector, + // having first created an empty vector if need be." There is, however, a + // caveat. As is expected of conversion operators that return references, + // we have a version for const *this, and a version for non-const *this. + // In the former case - the const case - we can return the contained vector + // only if it already exists. We *can't* do the "first create an empty vector + // first, if necessary" business, because, well, the object is const. You'll + // see below, then, that if the object is const and the optional contains + // no value, we throw an error. In all other cases, either there's already + // a vector to return, or (in the non-const case) one can be created first. + + template> + operator const typename TEE::value_type &() const // const + { + if (wrappedValue.has_value()) + return *wrappedValue; + + log::error( + "Cannot give a *const* valueless optional a vector value"); + log::member("Field:: conversion to vector"); + throw std::exception{}; + } + + template> + operator typename TEE::value_type &() // non-const + { + return wrappedValue + ? *(wrappedValue) + : *(wrappedValue = typename TEE::value_type{}); + } + + // ------------------------ + // operator= + // ------------------------ + + // operator=(T) + Field &operator=(const T &value) + { + return wrappedValue = value, *this; + } + + // If T == Defaulted + // operator=(optional) + // As above, except returns *this, as expected for assignment. + template> + Field &operator=(const std::optional &opt) + { + return wrappedValue = opt, *this; + } + + // ------------------------ + // Setters: add to vector + // ------------------------ + + // If T == [optional] vector + // add(element) + // Add (via push_back()) to wrappedValue. + template> + Field &add( + const typename detail::isVectorOrOptionalVector::element &element + ) { + return Component::setter(wrappedValue,element), *this; + } + + // operator+=(element) + // Same as add(element) + template> + Field &operator+=( + const typename detail::isVectorOrOptionalVector::element &element + ) { + return add(element); + } +}; // class Field diff --git a/src/GNDStk/Component/src/fieldPart.hpp b/src/GNDStk/Component/src/fieldPart.hpp new file mode 100644 index 000000000..0569ea3ee --- /dev/null +++ b/src/GNDStk/Component/src/fieldPart.hpp @@ -0,0 +1,331 @@ + +// ----------------------------------------------------------------------------- +// FieldPart +// As with class Field, this is intentionally defined within class Component. +// ----------------------------------------------------------------------------- + +// FieldPart is designed to be used in tandem with either of these: +// Field> +// Field>> +// with one FieldPart object for each alternative in the variant. +template +class FieldPart,PART> { + Field &whole; + + static_assert( + detail::isVariant_v || detail::isVectorOfVariant::value, + "FieldPart,PART>: WHOLE must be variant or vector" + ); + +public: + + // ------------------------ + // Constructors + // ------------------------ + + // Because Field &whole would be wrong + FieldPart(const FieldPart &) = delete; // no copy + FieldPart(FieldPart &&) = delete; // no move + + explicit FieldPart(Field &whole) : + whole(whole) + { } + + // ------------------------ + // ptr() + // Get as PART * + // For Field> + // ------------------------ + + // const + template> + const PART *ptr() const + { + return std::get_if(&whole()); + } + + // non-const + template> + PART *ptr() + { + return std::get_if(&whole()); + } + + // ------------------------ + // ref() + // Get as PART & + // For Field> + // ------------------------ + + // const + template> + const PART &ref() const + { + const PART *const p = ptr(); + if (p) return *p; + log::error( + "Cannot get reference; variant contains a different alternative"); + log::member("FieldPart::ref()"); + throw std::exception{}; + } + + // non-const + template> + PART &ref() + { + return const_cast(std::as_const(*this).template ref()); + } + + // ------------------------ + // opt() + // Get as optional + // For Field> + // ------------------------ + + // Makes a std::optional. So, we must return by value, + // and then only the const version is needed. + template> + std::optional opt() const + { + const PART *const p = ptr(); + return p ? std::optional{*p} : std::optional{}; + } + + // ------------------------ + // operator() + // Get as PART & + // For Field> + // Same as ref() + // ------------------------ + + // const + template> + const PART &operator()() const + { + try { + return ref(); + } catch (...) { + log::member("FieldPart::operator()"); + throw; + } + } + + // non-const + template> + PART &operator()() + { + return const_cast(std::as_const(*this)()); + } + + // ------------------------ + // Conversions + // For Field> + // ------------------------ + + // To PART * + // Like ptr() + template> + operator const PART *() const { return ptr(); } // const + + template> + operator PART *() { return ptr(); } // non-const + + // To PART & + // Like ref() + template> + operator const PART &() const // const + { + try { + return ref(); + } catch (...) { + log::member("FieldPart:: conversion to variant alternative"); + throw; + } + } + + template> + operator PART &() // non-const + { + return const_cast(std::as_const(*this).operator const PART &()); + } + + // To std::optional + // Like opt(), and need const case only + template> + operator std::optional() const { return opt(); } + + // ------------------------ + // operator()(has(...)) + // has + // ------------------------ + + template + auto operator()(const LOOK &look) const -> + std::enable_if_t,bool> + { + return whole(look); + } + + template + auto has(const LOOK &look) const -> + std::enable_if_t,bool> + { + return whole.has(look); + } + + // ------------------------ + // size() + // ------------------------ + + // Works where Field.size() works + template + auto size() const -> decltype(std::declval>().size()) + { + return whole.size(); + } + + // zzz working here + + // ------------------------ + // Getters: + // If WHOLE == vector + // ------------------------ + + // ptr(Lookup) + // Get as PART * + template< + class KEY, class = detail::isLookupRefReturn_t, + class T = WHOLE, class = detail::isVector_t> + const PART *ptr(const KEY &look) const + { + return whole.parent.template getter(whole(),look); + } + + template< + class KEY, class = detail::isLookupRefReturn_t, + class T = WHOLE, class = detail::isVector_t> + PART *ptr(const KEY &look) + { + return whole.parent.template getter(whole(),look); + } + + // ref(Lookup) + // Get as PART & + template< + class KEY, class = detail::isLookupRefReturn_t, + class T = WHOLE, class = detail::isVector_t> + const PART &ref(const KEY &look) const + { + const PART *const p = ptr(look); + if (p) return *p; + log::error( + "Cannot get reference; variant contains a different alternative"); + log::member("FieldPart::ref(Lookup)"); + throw std::exception{}; + } + + template< + class KEY, class = detail::isLookupRefReturn_t, + class T = WHOLE, class = detail::isVector_t> + PART &ref(const KEY &look) + { + return const_cast(std::as_const(*this).template ref(look)); + } + + // opt(Lookup) + template< + class KEY, class = detail::isLookupRefReturn_t, + class T = WHOLE, class = detail::isVector_t> + const std::optional opt(const KEY &look) const + { + const PART *const p = ptr(look); + return p ? std::optional{*p} : std::optional{}; + } + + // ------------------------ + // operator[](Lookup) + // ------------------------ + + // qqq This would apply to: + // qqq Field< T = vector> > + + // const + template< + LookupMode MODE, class EXTRACTOR, class TYPE, class CONVERTER, + class T = WHOLE, class = detail::isVector_t> + decltype(auto) + operator[](const Lookup &look) const + { + if constexpr ( + detail::isLookupRefReturn_v> + ) { + // a reference + try { + return ref(look); + } catch (...) { + log::member("FieldPart::operator[](Lookup)"); + throw; + } + } else { + // bool, or by-value vector + return whole[look]; + } + } + + // non-const + template< + LookupMode MODE, class EXTRACTOR, class TYPE, class CONVERTER, + class T = WHOLE, class = detail::isVector_t> + decltype(auto) + operator[](const Lookup &look) + { + if constexpr ( + detail::isLookupRefReturn_v> + ) { + // a reference + return const_cast(std::as_const(*this)(look)); + } else { + // bool, or by-value vector + return whole[look]; + } + } + + // ------------------------ + // Setters + // Using std::optional + // ------------------------ + + // If WHOLE == variant + // operator=(value) + template, int> = 0> + FieldPart &operator=(const std::optional &opt) + { + if (opt) whole = opt.value(); + return *this; + } + + // If WHOLE == vector + // add(value) + template> + FieldPart &add(const std::optional &opt) + { + if (opt) whole.add(opt.value()); + return *this; + } + + // If WHOLE == vector + // operator+=(value) + template> + DERIVED &operator+=(const std::optional &opt) + { + return add(opt); + } + + // ------------------------ + // Assignment + // ------------------------ + + // Intentional: don't assign [referenced] whole; doing so would be wrong + FieldPart &operator=(const FieldPart &) { return *this; } + FieldPart &operator=(FieldPart &&) { return *this; } +}; // class FieldPart diff --git a/src/GNDStk/Component/src/finish.hpp b/src/GNDStk/Component/src/finish.hpp index 864f5d5bf..1f5c759f9 100644 --- a/src/GNDStk/Component/src/finish.hpp +++ b/src/GNDStk/Component/src/finish.hpp @@ -18,8 +18,8 @@ advised to call a finish() as well, or to achieve the necessary effect in some other manner. 2. These also provide a means by which derived-class constructors that are built -by our autogeneration tool can run additional code that someone's customization -of the autogenerated class might need. +by our autogeneration tool can run additional code that someone's customizations +of their autogenerated classes might need. The second thing is achieved in the following way. Autogenerated constructors each call one of the finish() functions. Each finish() function first does what @@ -32,9 +32,9 @@ thus can, but does not need to, provide a construct(). Arguments are received where (1) the derived-class constructor receives the argument, but (2) the argument is transitory - it's used in the constructor, -but it doesn't go into the autogenerated "content" struct in the derived class. -(If it did go into the content struct then we'd simply extract it from there, -instead of having finish() receive it as a parameter.) +but it doesn't go into a generated field in the derived class. (If it did go +into a generated field, then we'd simply extract it from there, instead of +having finish() receive it as a parameter.) Specifically, the constructors in the auto-generated classes call: @@ -48,11 +48,11 @@ Specifically, the constructors in the auto-generated classes call: Constructor from a Node: Component::finish(the Node) - Constructors involving a vector of "body text" data: + Constructors involving a vector of block data: Component::finish(the vector) Note: In the last case, we're speaking of a vector that's specifically for -body text, not a vector that might be there for a different reason. +block data, not a vector that might be there for a different reason. */ @@ -61,20 +61,13 @@ body text, not a vector that might be there for a different reason. // construct() stubs // Override in a derived-class customization, to have custom code be run. // Cases: (), (DERIVED), (Node), (vector). -// Derived-class customizations should always return void. // ----------------------------------------------------------------------------- void construct() { } -void construct(const DERIVED &) { } -void construct(const Node &) { } - -// The next one returns bool, but customizations in DERIVED should return void, -// just as customizations to the above three construct() function variations -// return void. We use bool, here, for technical reasons, relating to the test -// used in the template finish() function (as opposed to the non-template cases) -// to determine whether or not someone has provided a custom construct(). -template>> -bool construct(const std::vector &) { return true; } +void construct(const DERIVED &) { derived().construct(); } +void construct(const Node &) { derived().construct(); } +template +void construct(const std::vector &) { derived().construct(); } @@ -88,13 +81,13 @@ bool construct(const std::vector &) { return true; } void finish() { - // If hasBodyText == true (else no-op), have Component's BodyText base + // If hasBlockData == true (else no-op), have Component's BlockData base // get length, start, and valueType, as available, from the derived class - if constexpr (hasBodyText) - body::pullFromDerived(derived()); + if constexpr (hasBlockData) + BLOCKDATA::pullFromDerived(derived()); - // Based on the derived class' keys(), locate and sort derived-class fields - // that are vectors, with vector elements that have index and/or label. + // Automatically locate and sort derived-class fields that are vectors + // with elements that have index and/or label. sort(); // construct @@ -109,19 +102,14 @@ void finish() void finish(const DERIVED &other) { // length, start, valueType - if constexpr (hasBodyText) - body::pullFromDerived(derived()); + if constexpr (hasBlockData) + BLOCKDATA::pullFromDerived(derived()); // derived-class vector fields sort(); // construct - void (Component::*stub)(const DERIVED &) = &Component::construct; - void (DERIVED::*custom)(const DERIVED &) = &DERIVED::construct; - if (custom != stub) - derived().construct(other); - else - derived().construct(); + derived().construct(other); } @@ -131,28 +119,7 @@ void finish(const DERIVED &other) void finish(const Node &node) { - // Read fields from the Node into the derived object. This applies the keys() - // multi-query in the derived class, and also runs BodyText::fromNode() if - // the Node has body text, in order to get the Node's string of "body text". - fromNode(node); - - if constexpr (hasBodyText) { - // length, start, valueType - body::pullFromDerived(derived()); - // make vector - body::get(); - } - - // derived-class vector fields - sort(); - - // construct - void (Component::*stub)(const Node &) = &Component::construct; - void (DERIVED::*custom)(const Node &) = &DERIVED::construct; - if (custom != stub) - derived().construct(node); - else - derived().construct(); + read(node); } @@ -160,22 +127,24 @@ void finish(const Node &node) // finish(vector) // ------------------------ -template>> +template< + class T, + class = std::enable_if_t> +> void finish(const std::vector &vector) { - // assign from the vector - body::operator=(vector); + if constexpr (hasBlockData) { + // assign from the vector + BLOCKDATA::operator=(vector); - // length, start, valueType: push back up to derived, - // as they would have been computed above in operator=. - body::pushToDerived(derived()); + // length, start, valueType: push back up to derived, + // as they would have been computed above in operator=. + BLOCKDATA::pushToDerived(derived()); + } // derived-class vector fields sort(); // construct - if constexpr (std::is_same_v) - derived().construct(vector); - else - derived().construct(); + derived().construct(vector); } diff --git a/src/GNDStk/Component/src/forward.hpp b/src/GNDStk/Component/src/forward.hpp new file mode 100644 index 000000000..7598ba310 --- /dev/null +++ b/src/GNDStk/Component/src/forward.hpp @@ -0,0 +1,74 @@ + +// ----------------------------------------------------------------------------- +// add +// += +// ----------------------------------------------------------------------------- + +// add +template< + class FROM, class D = DERIVED, + class = std::enable_if_t< + detail::MatchesExact ::count == 1 || + detail::MatchesViable::count == 1 + > +> +DERIVED &add(const FROM &elem) +{ + // match exact? (else viable, per SFINAE requirement) + using TUP = decltype(Keys().tup); + const bool exact = detail::MatchesExact::count == 1; + + // scan until match + std::apply( + [this,&elem,exact](const auto &... mc) + { + size_t n = 0; bool found = false; + ((found || (found = detail::added(*this,elem,mc,exact,n++))), ...); + }, + Keys().tup + ); + + // done + return derived(); +} + +// += +template +auto operator+=(const FROM &elem) -> decltype(add(elem)) +{ + return add(elem); +} + + +// ----------------------------------------------------------------------------- +// operator[] +// ----------------------------------------------------------------------------- + +// const +template< + class EXTRACTOR, class TYPE, class CONVERTER, + class = std::enable_if_t>, + class D = DERIVED, class TUP = decltype(D::Keys().tup), + class LOOK = Lookup, + class = std::enable_if_t::count == 1> +> +decltype(auto) +operator[](const Lookup &look) const +{ + return detail::bracket::value(*this,look); +} + +// non-const +template< + class EXTRACTOR, class TYPE, class CONVERTER, + class = std::enable_if_t>, + class D = DERIVED, class TUP = decltype(D::Keys().tup), + class LOOK = Lookup, + class = std::enable_if_t::count == 1> +> +decltype(auto) +operator[](const Lookup &look) +{ + using RETURN = typename detail::bracket::type; + return const_cast(std::as_const(*this)[look]); +} diff --git a/src/GNDStk/Component/src/fromNode.hpp b/src/GNDStk/Component/src/fromNode.hpp index f7760b4ca..51bca12ea 100644 --- a/src/GNDStk/Component/src/fromNode.hpp +++ b/src/GNDStk/Component/src/fromNode.hpp @@ -1,8 +1,124 @@ +// ----------------------------------------------------------------------------- +// Helpers +// ----------------------------------------------------------------------------- + +private: + +// ------------------------ +// Transfer Meta +// ------------------------ + +template +void transferMeta( + const Node &node, DEST &to, + const Meta &key +) { + node.meta(to, key); +} + + +// ------------------------ +// Transfer Child +// ------------------------ + +template +void transferChild( + const Node &node, DEST &to, + const Child &key +) { + // Absolutely respect any non-default converter in the Child key, by doing + // a Core Interface child-node query in the usual manner. Note that we can + // still use the more-efficient "node.child(to,key)" rather than the less- + // efficient "to = node(key)", because, in the present context, we do have + // a specific destination for the query result. + if constexpr (!std::is_same_v) { + node.child(to, key); + return; + } + + // In the following conditionals, assume that Foo derives from Component, + // while Bar does not, i.e.: + // Foo: Component + // Bar + // Remarks, below, reflect various situations. + + if constexpr (detail::isDerivedFromComponent_v) { + // *** Foo + // Derives from Component, so we know that it has, via Component, + // a .read(node) function, which should be most efficient to use + // for "conversion" of the Node to a Foo. + node.child(to, key/[](const Node &n, DEST &to) { to.read(n); }); + + } else if constexpr (detail::isOptional) { + using OPT = typename DEST::value_type; // type the optional may contain + + if constexpr (detail::isVector_v) { + using ELEM = typename OPT::value_type; // vector element type + if constexpr (detail::isDerivedFromComponent_v) { + // *** optional> + if (!to.has_value()) + to = OPT{}; + node.child(to, key/[](const Node &n, ELEM &e) { e.read(n); }); + } else { + // *** optional> + node.child(to, key); + } + } else { + if constexpr (detail::isDerivedFromComponent_v) { + // *** optional + node.child(to, key/[](const Node &n, OPT &to) { to.read(n); }); + } else { + // *** optional + node.child(to, key); + } + } + } else if constexpr (detail::isVector_v) { + using ELEM = typename DEST::value_type; // vector element type + if constexpr (detail::isDerivedFromComponent_v) { + // *** vector + node.child(to, key/[](const Node &n, ELEM &e) { e.read(n); }); + } else { + // *** vector + node.child(to, key); + } + } else { + // *** Bar + node.child(to, key); + } +} + + +// ------------------------ +// Transfer +// ------------------------ + +template +void transfer(const size_t n, const Node &node, const KEY &key) +{ + using DEST = typename detail::queryResult::type; + DEST &to = *(DEST *)links[n]; + + if constexpr (detail::IsMeta::value) + transferMeta(node, to, key); + else if constexpr (detail::IsChild::value) + transferChild(node, to, key); + else { + // todo Does this situation involve only the pair case? + // I think that may be true, given the way keys are placed into keytuples; + // see or.hh. In this case, are there some optimizations we can do here, + // as we do in transferChild above? + to = node(key); + } +} + + // ----------------------------------------------------------------------------- // Component::fromNode(Node) // ----------------------------------------------------------------------------- +public: + // Retrieve a Node's data, and, via the links, get it into the fields in the // derived-class object. We'd have preferred to call this in the constructor, // so that users wouldn't need to call it directly in the constructors @@ -21,41 +137,62 @@ void fromNode(const Node &node) { try { // does the node have the name we expect? - if (node.name != DERIVED::GNDSName()) { + if (node.name != DERIVED::NODENAME()) { log::error( - "Name \"{}\" in Node sent to Component::fromNode() is not the " - "expected GNDS name \"{}\"", - node.name, DERIVED::GNDSName() + "Node name \"{}\" is not the expected name \"{}\"", + node.name, DERIVED::NODENAME() ); throw std::exception{}; } - if constexpr (std::is_same_v>) { - // consistency check; then nothing further to do - assert(0 == links.size()); - } else { - // retrieve the node's data by doing a multi-query - const auto tup = node(toKeywordTup(DERIVED::keys())); - - // consistency check - assert(std::tuple_size::value == links.size()); - - // apply links: - // Node ==> derived-class data - // Below, each apply'd "result" is one particular element - one - // retrieved value - from the above multi-query on the node. - std::apply( - [this](const auto &... result) { - std::size_t n = 0; - ((*(std::decay_t *)links[n++] = result), ...); - }, - tup - ); - } + // consistency check + assert(std::tuple_size_v == links.size()); + + // apply links: + // Node ==> derived-class data + std::apply( + [this,&node](const auto &... key) { + size_t n = 0; (this->transfer(n++, node, key), ...); + }, + Keys().tup + ); + + // block data + if constexpr (hasBlockData) + BLOCKDATA::fromNode(node); - // body text, a.k.a. XML "pcdata" (plain character data), if any - if constexpr (hasBodyText) - body::fromNode(node); + // ------------------------ + // If we're putting certain + // instrumentation into the + // Component interface... + // ------------------------ + + #ifdef NJOY_GNDSTK_INSTRUMENT + { + // context + std::vector ancestors; + for (const Node *n = &node; n; n = &n->parent()) + ancestors.push_back(n->name); + + // metadata + for (const auto &m : node.metadata) + if (!beginsin(m.first, "marked-")) { + std::cout << color::custom::green << "missed: metadatum "; + for (size_t i = ancestors.size(); i--; ) + std::cout << ancestors[i] << "."; + std::cout << m.first << color::reset << std::endl; + } + + // children + for (const auto &c : node.children) + if (!c->marked) { + std::cout << color::custom::blue << "missed: child node "; + for (size_t i = ancestors.size(); i--; ) + std::cout << ancestors[i] << "."; + std::cout << c->name << color::reset << std::endl; + } + } + #endif } catch (...) { log::member("Component.fromNode(Node(\"{}\"))", node.name); diff --git a/src/GNDStk/Component/src/getter.hpp b/src/GNDStk/Component/src/getter.hpp index 1f8228830..fcd7c6e66 100644 --- a/src/GNDStk/Component/src/getter.hpp +++ b/src/GNDStk/Component/src/getter.hpp @@ -1,117 +1,81 @@ -// The getter() functions of class Component get some names from the derived -// class (those are used when printing diagnostics, if applicable), and then -// call getter() functions in the detail:: namespace to do most of the work. -// -// The motivation for having the following at all is to simplify the retrieval, -// in the derived-class getters, of certain information in the content{} struct -// of the derived class object. For simple data, e.g. an int or a std::string -// in the derived class' content struct, a derived-class getter will simply -// do a "return content.something", because nothing more complicated is needed. -// So, the below functions involve circumstances where something more involved -// needs to be done. See the various remarks below for more information. +// Component::getter() +// These retrieve names from the derived class (for use in printing diagnostics, +// if applicable), then call detail::compGetter() to do most of the work. // ----------------------------------------------------------------------------- -// (field, key, name) -// FIELD in this context is either a vector or an optional, and KEY -// is either an integral index or a string label. (If FIELD were just a plain -// data type, not an [optional] vector, then there would be no reason to bother -// with a getter() function for it; we'd just return content.field in the -// derived class, instead of calling getter() to do something more complicated. -// And, besides, the fact that we're looking up by index or label suggests that -// we're dealing with a vector, not something simple like an int or a string.) +// getter(vector, key) +// getter(optional, key) +// Remark: while two getter() functions that appear later in this file work +// specifically on a vector, those require that the caller provide +// a template argument. The following two can, in fact, also be called with +// vector. Also, note that depending on which detail::compGetter() +// these forward to, the return type might be a reference to something, or +// might be a bool. Hence the decltype(auto) return type. // ----------------------------------------------------------------------------- // const -template // KEY: for index or label -const auto &getter( - const FIELD &field, - const KEY &key, - const std::string &fieldName +template< + class VEC, class = std::enable_if_t>, + LookupMode MODE, class EXTRACTOR, class TYPE, class CONVERTER +> +decltype(auto) getter( + const VEC &vec, const Lookup &key, + const std::string &fieldName = "" ) const { - return detail::getter( - field, key, - DERIVED::namespaceName(), DERIVED::className(), fieldName - ); + return detail::compGetter(vec, key, Namespace(), Class(), fieldName); } // non-const -template -auto &getter( - FIELD &field, - const KEY &key, - const std::string &fieldName +template< + class VEC, class = std::enable_if_t>, + LookupMode MODE, class EXTRACTOR, class TYPE, class CONVERTER +> +decltype(auto) getter( + VEC &vec, const Lookup &key, + const std::string &fieldName = "" ) { - return detail::getter( - field, key, - DERIVED::namespaceName(), DERIVED::className(), fieldName - ); -} - - -// ----------------------------------------------------------------------------- -// (variant, name) -// These, in contrast to the getter()s above, don't involve a vector or an -// optional vector, or an index or a label. We bother having these only because -// of the (admittedly small, in this case) extra complexity of checking that -// the variant holds the requested alternative, and of producing diagnostics -// if it doesn't. -// ----------------------------------------------------------------------------- - -// const -template -const RETURN *getter( - const std::variant &var, - const std::string &fieldName -) const { - return detail::getter( - var, - DERIVED::namespaceName(), DERIVED::className(), fieldName - ); -} + using RETURN = decltype( + std::as_const(*this).template getter(vec, key, fieldName)); -// non-const -template -RETURN *getter( - std::variant &var, - const std::string &fieldName -) { - return const_cast( - std::as_const(*this).template - getter(std::as_const(var), fieldName) - ); + if constexpr (std::is_reference_v) + return const_cast &>( + std::as_const(*this).template getter(vec, key, fieldName)); + else + return std::as_const(*this).template getter(vec, key, fieldName); } // ----------------------------------------------------------------------------- -// (vector, key, name) -// The motivation for these essentially amounts to the combined motivations -// for the above two sets of getter() functions. +// getter(vector, key) +// The caller must specify T // ----------------------------------------------------------------------------- // const -template -const RETURN *getter( - const std::vector> &var, - const KEY &key, - const std::string &fieldName +template< + class T, class... Ts, class = std::enable_if_t>, + LookupMode MODE, class EXTRACTOR, class TYPE, class CONVERTER +> +const T *getter( + const std::vector> &vecvar, + const Lookup &key, + const std::string &fieldName = "" ) const { - return detail::getter( - var, key, - DERIVED::namespaceName(), DERIVED::className(), fieldName - ); + return detail::compGetter(vecvar, key, Namespace(), Class(), fieldName); } // non-const -template -RETURN *getter( - std::vector> &var, - const KEY &key, - const std::string &fieldName -) const { - return const_cast( - std::as_const(*this).template - getter(std::as_const(var), key, fieldName) +template< + class T, class... Ts, class = std::enable_if_t>, + LookupMode MODE, class EXTRACTOR, class TYPE, class CONVERTER +> +T *getter( + std::vector> &vecvar, + const Lookup &key, + const std::string &fieldName = "" +) { + return const_cast( + std::as_const(*this).template getter(vecvar, key, fieldName) ); } diff --git a/src/GNDStk/Component/src/has.hpp b/src/GNDStk/Component/src/has.hpp new file mode 100644 index 000000000..844d9ce70 --- /dev/null +++ b/src/GNDStk/Component/src/has.hpp @@ -0,0 +1,49 @@ + +// ----------------------------------------------------------------------------- +// Component::has +// Note that some of these are usable in constexpr ifs. +// ----------------------------------------------------------------------------- + +// constexpr, static +// Extractor works; Lookup +// The extractor succeeds. DERIVED has a metadatum of that name. +// No value is given. We're checking for the presence of the metadatum. +template< + class EXTRACTOR, + class THIS = DERIVED, + class = decltype(std::declval()(THIS{}))> +static constexpr bool +has(const Lookup &) +{ + return true; +} + +// non-constexpr, non-static +// Extractor works; Lookup +// The extractor succeeds. DERIVED has a metadatum of that name. +// But does the value match? +template< + class EXTRACTOR, class TYPE, class CONVERTER, + class THIS = DERIVED, + class = decltype(std::declval()(THIS{}))> +bool +has(const Lookup &look) const +{ + return look.extractor(derived()) == look.value; +} + +// constexpr, static +// Extractor fails; Lookup +// The extractor fails. DERIVED does not have a metadatum of that name. +// Any value to check against is meaningless here. If DERIVED doesn't +// even have, say, .foo, then we can't check if its .foo equals the +// one in the given Lookup object. +template< + class EXTRACTOR, class TYPE, class CONVERTER, + LookupMode GET, + class = std::enable_if_t> +static constexpr bool +has(const Lookup &) +{ + return false; +} diff --git a/src/GNDStk/Component/src/io-stream.hpp b/src/GNDStk/Component/src/io-stream.hpp new file mode 100644 index 000000000..0d6f53b9a --- /dev/null +++ b/src/GNDStk/Component/src/io-stream.hpp @@ -0,0 +1,32 @@ + +// ----------------------------------------------------------------------------- +// Stream I/O +// ----------------------------------------------------------------------------- + +// istream >> Component +template +std::istream &operator>>( + std::istream &is, + Component &comp +) { + try { + return comp.read(is); + } catch (...) { + log::function("istream >> {}", comp.Class()); + throw; + } +} + +// ostream << Component +template +std::ostream &operator<<( + std::ostream &os, + const Component &comp +) { + try { + return comp.print(os,0); + } catch (...) { + log::function("ostream << {}", comp.Class()); + throw; + } +} diff --git a/src/GNDStk/Component/src/io-string.hpp b/src/GNDStk/Component/src/io-string.hpp new file mode 100644 index 000000000..ce51618ff --- /dev/null +++ b/src/GNDStk/Component/src/io-string.hpp @@ -0,0 +1,30 @@ + +// ----------------------------------------------------------------------------- +// String (not stream) I/O +// ----------------------------------------------------------------------------- + +// Component >> string +// Like Node >> string, but for Component's derived class. +void operator>>(std::string &str) const +{ + try { + Node(*this) >> str; + } catch (...) { + log::function("{} >> string", Class()); + throw; + } +} + +// Component << string +// Like Node << string, but for Component's derived class. +void operator<<(const std::string &str) +{ + try { + Node node; + node << str; + derived() = DERIVED(node); + } catch (...) { + log::function("{} << string", Class()); + throw; + } +} diff --git a/src/GNDStk/Component/src/print.hpp b/src/GNDStk/Component/src/print.hpp new file mode 100644 index 000000000..e31e6f8b8 --- /dev/null +++ b/src/GNDStk/Component/src/print.hpp @@ -0,0 +1,340 @@ + +// ----------------------------------------------------------------------------- +// REMARK +// Regarding "write" vs. "print", and newlines +// ----------------------------------------------------------------------------- + +/* +Python has print(), and we anticipate having many Python-aware users. First and +foremost, this is why we provide these print() functions. + +Elsewhere, we've given Component a set of write() (not print()) functions that +mirror Node's functions of the same name. These first make use of Component's +ability to convert objects of its derived classes to Node, then they call Node's +write() functions. Node's write() functions can do a number of things, such as +writing to XML, or to GNDStk's debug format. + +Someone who wishes to print the contents of a Component-derived class may prefer +to see our print() function's "prettyprinting" output. Not XML, certainly not +our internal debug format, and not other formats our Node's write()s support. + +The name print(), then, not only aligns with what Python users might expect, but +also reflects a difference from Node's write() functions. In particular, write() +behaves as it does for Node, while print() does something completely different: +it prettyprints to standard output. + +Our print() functions also print a newline at the end - which a user probably +expects to see when prettyprinting. + +The write() functions, being arguably more "low level", don't emit that newline, +and shouldn't. Just as C++ doesn't automatically print something basic (an int, +for example, or a floating-point number) with a newline, neither should a well- +mannered system for writing class objects. Whether a newline is really wanted, +or not wanted, depends on context. + +If you write std::cout << 1.23 << std::endl, you expect one line, with "1.23", +followed by a newline via std::endl, then the cursor ready at the beginning of +the very next line. Write std::cout << obj << std::endl, where obj is of some +user-defined type whose stream output operator already prints its own newline, +and the cursor will end up *two* lines down, after an intervening blank line. +It may seem convenient for "large" objects to print with their own newline, but +doing so creates inconsistent behavior between them and more-basic object types. +Inconsistencies beget unpredictability. + +Moreover, Component-derived classes often contain instances of other Component- +derived classes. An enclosing object should place its own newlines - only where +appropriate, and not where not appropriate - between its constituent parts. If +those parts did their own thing in this respect, they'd stymie the ability of +the enclosing class to do the right thing. +*/ + +// Helper +template +const std::string getName(const KEY &key, const size_t n) const +{ + return detail::getName(key) == special::comment + ? special::comment + : printMode == PrintMode::cpp + ? derived(). FIELDNAMES()[n] + : derived().PYTHONNAMES()[n]; +} + + +// ----------------------------------------------------------------------------- +// print(ostream,level) +// Low-level version, possibly building on other Component-derived objects. +// Doesn't print a trailing newline. +// ----------------------------------------------------------------------------- + +std::ostream &print( + std::ostream &os, const int level, + const std::string &label = "", + const std::string &labelColor = color::field +) const { + // Name of the class is as follows, in case we want to use it for anything... + // const std::string type = detail::fullName(Namespace(), Class()); + + try { + // Consistency check + // todo Eventually remove this, or make it a proper error, + // as it really shouldn't happen at all. + assert(std::tuple_size_v == links.size()); + + // ------------------------ + // Indent, header, newline + // ------------------------ + + detail::indentString( + os, + level, + detail::colorize(label == "" ? "{" : label+" {", labelColor) + ); + os << std::endl; + + // ------------------------ + // For alignment + // ------------------------ + + // Compute maximum length of key names, if aligning. Note that we + // could - but don't - take into account that keys associated with + // optional or Defaulted values *might* not in fact show up in the + // final printed text. In such cases, and if values of those types + // happen to have longer names, then the printing that does appear + // might use more spacing than it really needs to. By choosing not + // to factor this in, on a case-by-case basis, all objects of this + // particular Component<...> type will print with consistent spacing. + // We prefer this behavior, and its code is also slightly simpler. + size_t maxlen = 0; + + if (GNDStk::align) { + std::apply( + [this,&maxlen](const auto &... key) + { + using namespace detail; + size_t n = 0; + (( + n++, + maxlen = std::max( + maxlen, + pprintAlign{}(key,links[n-1]) + ? this->getName(key,n-1).size() + : 0 + ) + ), ... ); + }, + Keys().tup + ); + } + + // ------------------------ + // Apply links + // ------------------------ + + // derived-class fields ==> print + std::apply( + [this,&os,&level,maxlen](const auto &... key) + { + using namespace detail; + size_t n = 0; + ((( + n++, // not in any [n-1] below, lest undefined evaluation order + // indent, value, newline + printComponentPart( + // os + os, + // level + level+1, + // maxlen + pprintAlign{}(key,links[n-1]) + ? maxlen + : 0, + // label + this->getName(key,n-1), + // value + *( + typename queryResult>::type + *)links[n-1] + ) + ) && (os << std::endl) // no if()s in fold expressions :-/ + ), ... ); + }, + Keys().tup + ); + + // ------------------------ + // Customizations, if any + // ------------------------ + + // Custom derived-class print()s. + // To be recognized here, derived-class print() functions must be public, + // and have signatures that are *exactly* as we expect, including their + // constness. + if constexpr (detail::hasPrintTwoArg) { + // Derived class has: + // std::ostream &print(std::ostream &os, const int level) const; + // and handles the indentation level in its own way; we won't here. + std::ostringstream tmp; + derived().print(tmp,level+1); + const std::string &str = tmp.str(); + + size_t size = str.size(); + if (size) { + // expect that customizations may have spurious newlines :-/ + if (str[size-1] == '\n') size--; + for (size_t i = 0; i < size; ++i) + os << str[i]; + os << std::endl; + } + } else if constexpr (detail::hasPrintOneArg) { + // Derived class has: + // std::ostream &print(std::ostream &os) const; + // and we'll detect newlines and handle indentation automatically. + std::ostringstream tmp; + derived().print(tmp); + const std::string &str = tmp.str(); + + size_t size = str.size(); + if (size) { + // remark as above + if (str[size-1] == '\n') size--; + if (size) + os << indentTo(level+1); + for (size_t i = 0; i < size; ++i) + os << str[i] << (str[i] == '\n' ? indentTo(level+1) : ""); + os << std::endl; + } + } + + // ------------------------ + // BlockData, if any + // ------------------------ + + if constexpr (hasBlockData) + BLOCKDATA::print(os,level+1); + + // ------------------------ + // Indent, footer, + // NO trailing newline + // ------------------------ + + using namespace detail; + indentString( + os, level, + comments && label != "" + ? colorize("} " + colorize_comment(label), labelColor) + : colorize("}", labelColor) + ); + + } catch (...) { + log::member("Component.print() for {}", label); + throw; + } + + return os; +} + + +// ----------------------------------------------------------------------------- +// print() +// print(ostream) +// Print trailing newlines. +// ----------------------------------------------------------------------------- + +// We'll give these const and non-const versions (one would normally expect only +// const versions of print functions), and with a "builder pattern" that mirrors +// that of the setters that GNDStk's code generator gives its generated classes. +// This way, someone can prettyprint an object while it's being built, builder +// style. Some users may find this to be useful for visualizing what's happening +// as they create an object. + +// const +const DERIVED &print(std::ostream &os = std::cout) const +{ + print(os,0) << std::endl; + return *static_cast(this); +} + +// non-const +DERIVED &print(std::ostream &os = std::cout) +{ + print(os,0) << std::endl; + return *static_cast(this); +} + + +// ----------------------------------------------------------------------------- +// Component::xml() +// Component::json() +// Component::hdf5() +// Component::debug() +// Print trailing newlines. +// +// Shortcuts: like write(), but (1) in the given format, (2) to std::cout +// by default, and (3) with a trailing newline, print()-style. In view of +// points (2) and (3), these resemble print() more than write(), so I put +// them here, not in the file that defines the write() functions. +// ----------------------------------------------------------------------------- + +// ------------------------ +// ostream, decl +// ------------------------ + +// xml +std::ostream &xml(std::ostream &os = std::cout, const bool decl = false) const +{ + return write(os,"xml",decl) << std::endl, os; +} + +// json +#ifndef NJOY_GNDSTK_DISABLE_JSON +std::ostream &json(std::ostream &os = std::cout, const bool decl = false) const +{ + return write(os,"json",decl) << std::endl, os; +} +#endif + +// hdf5 +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +std::ostream &hdf5(std::ostream &os = std::cout, const bool decl = false) const +{ + return write(os,"hdf5",decl) << std::endl, os; +} +#endif + +// debug +std::ostream &debug(std::ostream &os = std::cout, const bool decl = false) const +{ + return write(os,"debug",decl) << std::endl, os; +} + +// ------------------------ +// decl, ostream +// ------------------------ + +// xml +std::ostream &xml(const bool decl, std::ostream &os = std::cout) const +{ + return xml(os,decl); +} + +// json +#ifndef NJOY_GNDSTK_DISABLE_JSON +std::ostream &json(const bool decl, std::ostream &os = std::cout) const +{ + return json(os,decl); +} +#endif + +// hdf5 +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +std::ostream &hdf5(const bool decl, std::ostream &os = std::cout) const +{ + return hdf5(os,decl); +} +#endif + +// debug +std::ostream &debug(const bool decl, std::ostream &os = std::cout) const +{ + return debug(os,decl); +} diff --git a/src/GNDStk/Component/src/read.hpp b/src/GNDStk/Component/src/read.hpp new file mode 100644 index 000000000..bb9489acc --- /dev/null +++ b/src/GNDStk/Component/src/read.hpp @@ -0,0 +1,92 @@ + +// ----------------------------------------------------------------------------- +// Read this object, in-place, from a Node +// ----------------------------------------------------------------------------- + +void read(const Node &node) +{ + // todo Maybe we don't really need/want a separate fromNode() function...? + + // Read fields from the Node into the derived object. This applies the KEYS() + // multi-query in the derived class, and also runs BlockData::fromNode() - if + // the Node has block data - in order to get the Node's string of block data. + fromNode(node); + + if constexpr (hasBlockData) { + // length, start, valueType + BLOCKDATA::pullFromDerived(derived()); + // make vector + BLOCKDATA::get(); + } + + // derived-class vector fields + sort(); + + // construct + derived().construct(node); +} + + +// ----------------------------------------------------------------------------- +// Component::read() +// Via Node, and using Node's available read() functions. +// So, autogenerated classes can directly use .read(...). +// ----------------------------------------------------------------------------- + +// ------------------------ +// stream, with enum- or +// string-based file type +// ------------------------ + +// read(istream, FileType) +std::istream &read( + std::istream &is, + const FileType format = FileType::guess, + const bool decl = false +) { + Node node; + std::istream &ret = node.read(is, format, decl); + read(node); + return ret; +} + +// read(istream, string) +std::istream &read( + std::istream &is, + const std::string &format, + const bool decl = false +) { + Node node; + std::istream &ret = node.read(is, format, decl); + read(node); + return ret; +} + +// ------------------------ +// filename, with enum- or +// string-based file type +// ------------------------ + +// read(filename, FileType) +bool read( + const std::string &filename, + const FileType format = FileType::guess, + const bool decl = false +) { + Node node; + bool ret = node.read(filename, format, decl); + read(node); + return ret; +} + +// read(filename, string) +bool read( + const std::string &filename, + const std::string &format, + const bool decl = false +) { + Node node; + bool ret = node.read(filename, format, decl); + read(node); + return ret; +} diff --git a/src/GNDStk/Component/src/setter.hpp b/src/GNDStk/Component/src/setter.hpp new file mode 100644 index 000000000..fa37c5695 --- /dev/null +++ b/src/GNDStk/Component/src/setter.hpp @@ -0,0 +1,39 @@ + +// Like getter.hpp, but to help with *setters* in Component-derived classes. + +// ------------------------ +// vector +// ------------------------ + +// push_back into the vector. +template< + class T, class FROM, + class = std::enable_if_t< + std::is_constructible_v || std::is_convertible_v + > +> +static void setter(std::vector &vec, const FROM &value) +{ + vec.push_back(T(value)); +} + + +// ------------------------ +// optional +// ------------------------ + +// Create an empty vector in the optional if it has no value, then +// push_back into the vector. + +template< + class T, class FROM, + class = std::enable_if_t< + std::is_constructible_v || std::is_convertible_v + > +> +static void setter(std::optional> &opt, const FROM &value) +{ + if (!opt.has_value()) + opt = std::vector{}; + opt->push_back(T(value)); +} diff --git a/src/GNDStk/Component/src/sort.hpp b/src/GNDStk/Component/src/sort.hpp index 68dd7b309..35a6accbe 100644 --- a/src/GNDStk/Component/src/sort.hpp +++ b/src/GNDStk/Component/src/sort.hpp @@ -5,31 +5,31 @@ void sort() { + if (!njoy::GNDStk::sort) + return; + try { - if constexpr (std::is_same_v>) { - // Consistency check; then nothing further to do - assert(0 == links.size()); - } else { - // Make tuple (of individual keys) from DERIVED::keys() - const auto tup = toKeywordTup(DERIVED::keys()).tup; + // Consistency check + assert(std::tuple_size_v == links.size()); - // Consistency check - assert(std::tuple_size::value == links.size()); + // Apply links + std::apply( + [this](const auto &... key) { + size_t n = 0; + ( + detail::sort( + *( + typename detail::queryResult< + std::decay_t + >::type + *)links[n++] + ), + ... + ); + }, + Keys().tup + ); - // Apply links - std::apply( - [this](const auto &... key) { - std::size_t n = 0; - ( - detail::sort( - *(std::decay_t *)links[n++] - ), - ... - ); - }, - tup - ); - } } catch (...) { log::member("Component.sort()"); throw; diff --git a/src/GNDStk/Component/src/toNode.hpp b/src/GNDStk/Component/src/toNode.hpp index 52c291d5b..2e67d0470 100644 --- a/src/GNDStk/Component/src/toNode.hpp +++ b/src/GNDStk/Component/src/toNode.hpp @@ -1,43 +1,88 @@ +// ----------------------------------------------------------------------------- +// Helpers +// ----------------------------------------------------------------------------- + +private: + +template +void node_add( + Node &node, const KEY &key, + const size_t n +) const { + using TYPE = typename detail::queryResult::type; + node.add(key, *(TYPE *)links[n]); +} + +// todo See if Child|"string" can be formulated without this std::pair +// business; doing so may simplify some things here and there, and we'll +// no longer need this... +template +void node_add( + Node &node, const std::pair &pair, + const size_t n +) const { + node_add(node,pair.first,n); +} + + // ----------------------------------------------------------------------------- // Component -// conversion to Node +// Conversion to Node. // ----------------------------------------------------------------------------- -// Normally we'd need just a const version of a conversion operator, and, if -// we needed a non-const version at all, it could build on the const version. -// A glitch in the present circumstances is that BodyText::toNode(), which is -// called from within these, splits const and non-const cases, and that needs -// to be preserved here. So, then, why does BodyText::toNode() have a non-const -// version? The issue is that in the non-const case, BodyText::toNode() may -// need to deal with a vector (not just an original "body text" string as may -// have been read into a const BodyText). And, dealing with a vector means -// computing a proper length, start, and valueType while doing toNode() - and -// pushing those up to the class derived from Component, as it's from that -// class that those fields are written to the Node. The need to compute proper -// values for those parameters is why we need the non-const case. (And we can't -// just make length etc. mutable in BodyText, as the length etc. in the derived -// class come into play too.) Maybe we'll work out a different way to handle -// all this, but for now, we have the following. - -// const -operator Node() const +public: + +explicit operator Node() const { + // Initialize a Node, with the necessary name + Node node(DERIVED::NODENAME()); + try { - #include "GNDStk/Component/src/toNodeBody.hpp" + // Handle block data, if applicable + if constexpr (hasBlockData) { + // GNDStk uses a #text metadatum of a #data child node for this + std::string &text = + node.add(special::data).add(special::text,"").second; + BLOCKDATA::toNode(text); + } + + // Write fields... + + // consistency check + assert(std::tuple_size_v == links.size()); + + // apply links: + // derived-class data ==> Node + // Below, each apply'd "key" is one value from DERIVED::KEYS(), and + // is a Meta, Child, or pair. The cast gives the + // underlying raw data type - int, say, or std::string - so that we + // can correctly use our generic void* link to a derived-class field. + std::apply( + [this,&node](const auto &... key) { + size_t n = 0; + (this->node_add(node,key,n++), ...); + }, + Keys().tup + ); } catch (...) { log::member("Component.operator Node() const"); throw; } + + return node; } -// non-const -operator Node() + +// ----------------------------------------------------------------------------- +// Component +// Conversion to Tree. +// Like conversion to Node, but with a proper root Node. +// ----------------------------------------------------------------------------- + +explicit operator Tree() const { - try { - #include "GNDStk/Component/src/toNodeBody.hpp" - } catch (...) { - log::member("Component.operator Node()"); - throw; - } + Tree tree; + tree.add(Node(*this)); + return tree; } diff --git a/src/GNDStk/Component/src/toNodeBody.hpp b/src/GNDStk/Component/src/toNodeBody.hpp deleted file mode 100644 index a5182a737..000000000 --- a/src/GNDStk/Component/src/toNodeBody.hpp +++ /dev/null @@ -1,40 +0,0 @@ - -// 1. Initialize a Node, with the necessary name -Node node(DERIVED::GNDSName()); - -// 2. Body text, if applicable -if constexpr (hasBodyText) { - // GNDStk uses a "text" metadatum of a "pcdata" child node for this - std::string &text = node.add("pcdata").add("text","").second; - // Note: the following call might compute length, start, and valueType; - // so we need all of this before the upcoming writing of fields. - body::toNode(text,derived().content); -} - -// 3. Write fields -if constexpr (std::is_same_v>) { - // consistency check - assert(0 == links.size()); -} else { - // make tuple (of individual keys) from DERIVED::keys() - const auto tup = toKeywordTup(DERIVED::keys()).tup; - - // consistency check - assert(std::tuple_size::value == links.size()); - - // apply links: - // derived-class data ==> Node - // Below, each apply'd "key" is one value from DERIVED::keys(), and - // is a Meta, Child, or pair. The cast gives the - // underlying raw data type - int, say, or std::string - so that we - // can correctly use our generic void* link to a derived-class field. - std::apply( - [this,&node](const auto &... key) { - std::size_t n = 0; - (node.add(key,*(std::decay_t*)links[n++]), ...); - }, - tup - ); -} - -return node; diff --git a/src/GNDStk/Component/src/wrapper.hpp b/src/GNDStk/Component/src/wrapper.hpp new file mode 100644 index 000000000..8cdd08eaf --- /dev/null +++ b/src/GNDStk/Component/src/wrapper.hpp @@ -0,0 +1,59 @@ + +// ----------------------------------------------------------------------------- +// wrapper +// This doesn't really need to be defined within class Component, but it's used +// only in that context, so it might as well be. +// ----------------------------------------------------------------------------- + +// This class is used in the context of parameters in certain constructors +// of Component-derived classes that we create with the GNDStk Code Generator. +// It helps to regularize and simplify the process of providing default values +// to those parameters, and in doing so, it gives the constructors in question +// a more streamlined, less bulky look and feel. We could do without it, but +// we like the improved appearance it facilitates. Note: wrapper is formulated +// in such a way that it shouldn't cause any issues with the py::init<...> and +// py::arg(...) material in our pybind11-based Python binding code. If it ever +// proves to cause any trouble in that respect, we'll reconsider using it. + +template +struct wrapper { + T value; + + // wrapper(from) + template< + class FROM = T, + class = std::enable_if_t< + std::is_constructible_v || std::is_convertible_v + > + > + wrapper(const FROM &v = FROM{}) : + value(T(v)) + { } + + // If T == vector + // wrapper(initializer_list) + template< + class TEE = T, + class = std::enable_if_t::value>> + wrapper(const std::initializer_list &v) : + value(v) + { } + + // If T == optional + // wrapper(optional::value_type) + template>> + wrapper(const typename TEE::value_type &v) : + value(v) + { } + + // If T == optional + // wrapper(nullopt_t) + template>> + wrapper(const std::nullopt_t &v) : + value(v) + { } + + // Conversions + operator const T &() const { return value; } + operator T &() { return value; } +}; // class wrapper diff --git a/src/GNDStk/Component/src/write.hpp b/src/GNDStk/Component/src/write.hpp index a2a8507bb..06e2e98cc 100644 --- a/src/GNDStk/Component/src/write.hpp +++ b/src/GNDStk/Component/src/write.hpp @@ -1,126 +1,52 @@ // ----------------------------------------------------------------------------- // Component::write() +// Via Node, and using Node's write()s. +// So, Component-derived classes can use .write(...) directly. // ----------------------------------------------------------------------------- -std::ostream &write(std::ostream &os = std::cout, const int level = 0) const -{ - try { - // Indent, write header, newline - detail::indentString( - os, level, - detail::colorize_component( - detail::fullName(DERIVED::namespaceName(), DERIVED::className()) - ) + " " + - detail::colorize_brace("{") + - (comments - ? " " + - detail::colorize_comment( - std::string("// GNDS: ") + DERIVED::GNDSName() - ) - : "" - ) + "\n" - ); - - if constexpr (std::is_same_v>) { - // Consistency check - assert(0 == links.size()); - } else { - // Make tuple (of individual keys) from DERIVED::keys() - const auto tup = toKeywordTup(DERIVED::keys()).tup; - - // Consistency check - assert(std::tuple_size::value == links.size()); - - // Compute maximum length of key names, if aligning. Note that we - // could - but don't - take into account that keys associated with - // optional or Defaulted values *might* not in fact show up in the - // final printed text. In such cases, and if values of those types - // happen to have longer names, then the printing that does appear - // might use more spacing than it really needs to. By choosing not - // to factor this in, on a case-by-case basis, all objects of this - // particular Component<...> type will print with consistent spacing. - // We prefer this behavior, and it's also slightly simpler to write. - std::size_t maxlen = 0; - if (GNDStk::align) - std::apply( - [&maxlen](const auto &... key) { - ((maxlen=std::max(maxlen,detail::getName(key).size())), ...); - }, - tup - ); - - // Apply links: - // derived-class data ==> print - std::apply( - [this,&os,&level,maxlen](const auto &... key) { - std::size_t n = 0; - ( - ( - // indent, write internal value, newline - detail::writeComponentPart( - os, - level+1, - *(std::decay_t *)links[n++], - detail::getName(key), - maxlen - ) && (os << '\n') // no if()s in fold expressions :-/ - ), - ... - ); - }, - tup - ); - } - - // Derived class write()s, if any. - // Note that neither, either, or both can be provided. - // To be recognized here, signatures must be exactly what we expect. - if constexpr (detail::hasWriteOneArg) { - // DERIVED::write() doesn't take an indentation level; we handle here - std::ostringstream tmp; - derived().write(tmp); - if (tmp.str().size() != 0) - os << indentTo(level+1); - for (char c : tmp.str()) - os << c << (c == '\n' ? indentTo(level+1) : ""); - if (tmp.str().size()) - os << std::endl; - } - if constexpr (detail::hasWriteTwoArg) { - // DERIVED::write() takes an indentation level - std::ostringstream tmp; - derived().write(tmp,level+1); - os << tmp.str(); - if (tmp.str().size()) - os << std::endl; - } - - // BodyText, if any - if constexpr (hasBodyText) - body::write(os,level+1); +// ------------------------ +// stream, with enum- or +// string-based file type +// ------------------------ + +// write(ostream, FileType) +std::ostream &write( + std::ostream &os = std::cout, + const FileType format = FileType::guess, + const bool decl = false +) const { + return Node(*this).write(os, format, decl); +} - // Indent, write footer, NO newline - detail::indentString( - os, level, - detail::colorize_brace("}") - + (comments - ? " " + - detail::colorize_comment( - std::string("// ") + - detail::fullName( - DERIVED::namespaceName(), - DERIVED::className() - ) - ) - : "" - ) - ); +// write(ostream, string) +std::ostream &write( + std::ostream &os, + const std::string &format, + const bool decl = false +) const { + return Node(*this).write(os, format, decl); +} - return os; +// ------------------------ +// filename, with enum- or +// string-based file type +// ------------------------ + +// write(filename, FileType) +bool write( + const std::string &filename, + const FileType format = FileType::guess, + const bool decl = false +) const { + return Node(*this).write(filename, format, decl); +} - } catch (...) { - log::member("Component.write()"); - throw; - } +// write(filename, string) +bool write( + const std::string &filename, + const std::string &format, + const bool decl = false +) const { + return Node(*this).write(filename, format, decl); } diff --git a/src/GNDStk/Component/test/CMakeLists.txt b/src/GNDStk/Component/test/CMakeLists.txt index a81b982ff..8e604c1ee 100644 --- a/src/GNDStk/Component/test/CMakeLists.txt +++ b/src/GNDStk/Component/test/CMakeLists.txt @@ -1,13 +1,16 @@ -add_executable( GNDStk.Component.test - Component.test.cpp - ctor.test.cpp - detail.test.cpp - finish.test.cpp - fromNode.test.cpp - getter.test.cpp - toNode.test.cpp - write.test.cpp ) +add_executable( + GNDStk.Component.test + Component.test.cpp + ctor.test.cpp + detail.test.cpp + finish.test.cpp + fromNode.test.cpp + getter.test.cpp + toNode.test.cpp + print.test.cpp +) + target_compile_options( GNDStk.Component.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} diff --git a/src/GNDStk/Component/test/Component.test.cpp b/src/GNDStk/Component/test/Component.test.cpp index 5c524cc2c..fc80134d7 100644 --- a/src/GNDStk/Component/test/Component.test.cpp +++ b/src/GNDStk/Component/test/Component.test.cpp @@ -4,7 +4,7 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; @@ -21,11 +21,11 @@ class DerivedT : public Component { "", "class DerivedT" }, { "foo", "Help for foo" } }; - static auto namespaceName() { return "hello"; } - static auto className() { return "DerivedT"; } - static auto GNDSName() { return "none"; } - static auto keys() { return std::tuple<>{}; } - DerivedT() : Component(BodyText{}) { } + static auto NAMESPACE() { return "hello"; } + static auto CLASS() { return "DerivedT"; } + static auto NODENAME() { return "none"; } + static auto KEYS() { return std::tuple<>{}; } + DerivedT() : Component(BlockData{}) { } }; @@ -38,27 +38,27 @@ class DerivedF : public Component { "", "class DerivedF" }, { "bar", "Help for bar" } }; - static auto namespaceName() { return "world"; } - static auto className() { return "DerivedF"; } - static auto GNDSName() { return "none"; } - static auto keys() { return std::tuple<>{}; } - DerivedF() : Component(BodyText{}) { } + static auto NAMESPACE() { return "world"; } + static auto CLASS() { return "DerivedF"; } + static auto NODENAME() { return "none"; } + static auto KEYS() { return std::tuple<>{}; } + DerivedF() : Component(BlockData{}) { } }; // DerivedData // A Component-derived class with some data in it. -// Note that this class doesn't have help or namespaceName(); so we'll also use -// this class to test that Component's functionality that uses those still works -// properly, as it should in that case. +// Note that this class doesn't have help. So, we'll also use this class +// to test that Component's functionality that uses it still works properly, +// as it should in that case. class DerivedData : public Component { public: friend class Component; - static auto className() { return "DerivedData"; } - static auto GNDSName() { return "data"; } - - static auto keys() + static auto NAMESPACE() { return ""; } + static auto CLASS() { return "DerivedData"; } + static auto NODENAME() { return "data"; } + static auto KEYS() { return int {} / Meta<>("foo") | @@ -66,25 +66,48 @@ class DerivedData : public Component ; } + static const auto &FIELDNAMES() + { + static const std::vector names = { + "foo", + "bar" + }; + return names; + } + + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "foo", + "bar" + }; + return names; + } + struct { int foo; double bar; - } content; + } Content; + + const int &foo() const { return Content.foo; } + int &foo() { return Content.foo; } + const double &bar() const { return Content.bar; } + double &bar() { return Content.bar; } DerivedData() : Component( - BodyText{}, - content.foo, - content.bar + BlockData{}, + foo(), + bar() ) { } DerivedData(const Node &node) : Component( - BodyText{}, - content.foo, - content.bar + BlockData{}, + foo(), + bar() ) { Component::finish(node); @@ -140,17 +163,15 @@ SCENARIO("Testing GNDStk Component") { CHECK(der.documentation("bar") == "No help information is available"); } - // namespaceName() - WHEN("We test namespaceName()") { + // NAMESPACE() + WHEN("We test NAMESPACE()") { // For these two we need the std::string() only because the functions // were written (above, in the class definitions) with an auto return - // of a plain character string. Where Component needs namespaceName(), - // it converts to std::string, so it's fine to write it that way. Here, - // though, in this test file, it means we need the std::string(). - CHECK(der1.namespaceName() == std::string("hello")); - CHECK(der2.namespaceName() == std::string("world")); + // of a plain character string. + CHECK(der1.NAMESPACE() == std::string("hello")); + CHECK(der2.NAMESPACE() == std::string("world")); DerivedData der; - CHECK(der.namespaceName() == ""); + CHECK(der.NAMESPACE() == std::string("")); } // Component << string @@ -158,23 +179,23 @@ SCENARIO("Testing GNDStk Component") { // // Don't confuse the above two. Component << string reads from an XML // or JSON snippet into an object of the class that's derived from - // Component. ostream << Component writes (to the ostream) the object. + // Component. ostream << Component prints the object to the ostream. WHEN("We test (Component << string) and (ostream << Component)") { DerivedData der; - color = false; // avoid cluttering the checked output below + colors = false; // avoid cluttering the checked output below const std::string expected = - "DerivedData { // GNDS: data\n" + "{\n" " foo : 12\n" " bar : 34.56\n" - "} // DerivedData" + "}" ; // from XML WHEN("We read a Component-derived object << XML text") { der << ""; - // write & check + // print, check THEN("The result is as expected") { std::ostringstream oss; oss << der; @@ -183,24 +204,26 @@ SCENARIO("Testing GNDStk Component") { } // from JSON +#ifndef NJOY_GNDSTK_DISABLE_JSON WHEN("We read a Component-derived object << JSON text") { der << "{" " \"data\": {" - " \"attributes\": {" + " \"#metadata\": {" " \"foo\": \"12\"," " \"bar\": \"34.56\"" " }" " }" "}"; - // write & check + // print, check THEN("The result is as expected") { std::ostringstream oss; oss << der; CHECK(oss.str() == expected); } } +#endif } } } diff --git a/src/GNDStk/Component/test/ctor.test.cpp b/src/GNDStk/Component/test/ctor.test.cpp index 74e5ed7b0..a0e2f7b22 100644 --- a/src/GNDStk/Component/test/ctor.test.cpp +++ b/src/GNDStk/Component/test/ctor.test.cpp @@ -2,7 +2,7 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; // ----------------------------------------------------------------------------- @@ -17,7 +17,7 @@ using namespace njoy::GNDStk::core; // situations mentioned below: a class with no fields, and a class with fields. // We don't anticipate that people will need Component-derived classes that have // no fields, but still illustrate such a beast, for completeness. Note that the -// keys() function should return a std::tuple<>{} in that situation. +// KEYS() function should return a std::tuple<>{} in that situation. // ----------------------------------------------------------------------------- // DerivedNothing @@ -26,14 +26,16 @@ class DerivedNothing : public Component { friend class Component; - static auto keys() + static auto NAMESPACE() { return ""; } + static auto CLASS() { return "DerivedNothing"; } + static auto KEYS() { return std::tuple<>{}; } public: - DerivedNothing() : Component(BodyText{}) + DerivedNothing() : Component(BlockData{}) { Component::finish(); } @@ -46,7 +48,9 @@ class DerivedSomething : public Component { friend class Component; - static auto keys() + static auto NAMESPACE() { return ""; } + static auto CLASS() { return "DerivedSomething"; } + static auto KEYS() { return int {} / Meta<>("foo") | @@ -56,15 +60,20 @@ class DerivedSomething : public Component struct { int foo; double bar; - } content; + } Content; + + const int &foo() const { return Content.foo; } + int &foo() { return Content.foo; } + const double &bar() const { return Content.bar; } + double &bar() { return Content.bar; } public: DerivedSomething() : Component( - BodyText{}, - content.foo, - content.bar + BlockData{}, + foo(), + bar() ) { Component::finish(); diff --git a/src/GNDStk/Component/test/detail.test.cpp b/src/GNDStk/Component/test/detail.test.cpp index 3011e0182..95e21c0ba 100644 --- a/src/GNDStk/Component/test/detail.test.cpp +++ b/src/GNDStk/Component/test/detail.test.cpp @@ -1,22 +1,24 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "prototype.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; +using detail::compGetter; // ----------------------------------------------------------------------------- -// Classes for testing the hasWrite*() functions +// Classes for testing the hasPrint*() functions // ----------------------------------------------------------------------------- struct Neither { - // has neither of the write()s seen in the upcoming classes + // has neither of the print()s seen in the upcoming classes }; struct One { // (ostream) only - std::ostream &write(std::ostream &os) const + std::ostream &print(std::ostream &os) const { return os; } @@ -24,7 +26,7 @@ struct One { struct Two { // (ostream,int) only - std::ostream &write(std::ostream &os, const int) const + std::ostream &print(std::ostream &os, const int) const { return os; } @@ -32,12 +34,12 @@ struct Two { struct Both { // (ostream) - std::ostream &write(std::ostream &os) const + std::ostream &print(std::ostream &os) const { return os; } // (ostream,int) - std::ostream &write(std::ostream &os, const int) const + std::ostream &print(std::ostream &os, const int) const { return os; } @@ -46,8 +48,8 @@ struct Both { // ----------------------------------------------------------------------------- -// Classes for testing hasIndex and hasLabel, -// and for use in the getter() tests +// Classes for testing has_index_v and has_label_v, +// and for use in the compGetter() tests // ----------------------------------------------------------------------------- #include "indexnlabel.hpp" @@ -57,7 +59,12 @@ struct FooBar { struct { int foo; double bar; - } content; + } Content; + + const int &foo() const { return Content.foo; } + int &foo() { return Content.foo; } + const double &bar() const { return Content.bar; } + double &bar() { return Content.bar; } }; @@ -65,17 +72,18 @@ struct FooBar { // ----------------------------------------------------------------------------- // class Derived // Is derived from Component -// Used in the tests of writeComponentPart() +// Used in the tests of printComponentPart() // ----------------------------------------------------------------------------- class Derived : public Component { public: friend class Component; - static auto className() { return "Derived"; } - static auto GNDSName() { return "none"; } + static auto NAMESPACE() { return ""; } + static auto CLASS() { return "Derived"; } + static auto NODENAME() { return "none"; } - static auto keys() + static auto KEYS() { return // metadata @@ -84,10 +92,28 @@ class Derived : public Component { ; } + static const auto &FIELDNAMES() + { + static const std::vector names = { + "foo", + "bar" + }; + return names; + } + + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "foo", + "bar" + }; + return names; + } + int foo = 56; double bar = 7.8; - Derived() : Component(BodyText{},foo,bar) { } + Derived() : Component(BlockData{},foo,bar) { } }; @@ -103,7 +129,7 @@ class NonDerived { double bar = 3.4; }; -// Needs << in order to participate in writeComponentPart() - which it does, +// Needs << in order to participate in printComponentPart() - which it does, // because we're using it as a test subject there. inline std::ostream &operator<<(std::ostream &s, const NonDerived &obj) @@ -149,34 +175,36 @@ SCENARIO("Testing Component detail:: miscellaneous functions") { // colorize GIVEN("Function: colorize()") { - WHEN("Called with GNDStk::color == true and color == \"\"") { + WHEN("Called with GNDStk::colors == true and color == \"\"") { THEN("It returns the expected result") { - njoy::GNDStk::color = true; - // coloring is on, but we don't give a color + njoy::GNDStk::colors = true; + // coloring is on, but we don't provide a color, + // and the default label color is set to "" + color::label = ""; CHECK(detail::colorize("one","") == "one"); } } - WHEN("Called with GNDStk::color == true and color != \"\"") { + WHEN("Called with GNDStk::colors == true and color != \"\"") { THEN("It returns the expected result") { - njoy::GNDStk::color = true; - // coloring is on, and we give a color + njoy::GNDStk::colors = true; + // coloring is on, and we provide a color CHECK(detail::colorize("two","[color]") == "[color]two\033[0m"); } } - WHEN("Called with GNDStk::color == false and color == \"\"") { + WHEN("Called with GNDStk::colors == false and color == \"\"") { THEN("It returns the expected result") { - njoy::GNDStk::color = false; - // coloring is off, and we don't give a color anyway + njoy::GNDStk::colors = false; + // coloring is off, and we don't provide a color anyway CHECK(detail::colorize("three","") == "three"); } } - WHEN("Called with GNDStk::color == false and color != \"\"") { + WHEN("Called with GNDStk::colors == false and color != \"\"") { THEN("It returns the expected result") { - njoy::GNDStk::color = false; - // coloring is off, and we give a color (but it isn't used, + njoy::GNDStk::colors = false; + // coloring is off, and we provide a color (but it isn't used, // because coloring is off) CHECK(detail::colorize("four","[color]") == "four"); } @@ -228,20 +256,20 @@ SCENARIO("Testing Component detail:: miscellaneous functions") { CHECK(oss.str() == " foo"); } // GIVEN - // hasWrite* + // hasPrint* // Test some SFINAE constructs - GIVEN("Functions: hasWriteOneArg(), hasWriteTwoArg()") { - CHECK(detail::hasWriteOneArg == false); - CHECK(detail::hasWriteTwoArg == false); + GIVEN("Functions: hasPrintOneArg(), hasPrintTwoArg()") { + CHECK(detail::hasPrintOneArg == false); + CHECK(detail::hasPrintTwoArg == false); - CHECK(detail::hasWriteOneArg == true); - CHECK(detail::hasWriteTwoArg == false); + CHECK(detail::hasPrintOneArg == true); + CHECK(detail::hasPrintTwoArg == false); - CHECK(detail::hasWriteOneArg == false); - CHECK(detail::hasWriteTwoArg == true); + CHECK(detail::hasPrintOneArg == false); + CHECK(detail::hasPrintTwoArg == true); - CHECK(detail::hasWriteOneArg == true); - CHECK(detail::hasWriteTwoArg == true); + CHECK(detail::hasPrintOneArg == true); + CHECK(detail::hasPrintTwoArg == true); } // GIVEN } @@ -260,66 +288,66 @@ SCENARIO("Testing Component detail:: miscellaneous functions") { // ostream, level, vector, label, maxlen, color = "" // All return bool. -SCENARIO("Testing Component detail:: writeComponentPart()") { +SCENARIO("Testing Component detail:: printComponentPart()") { // for clarity below int level; - std::size_t maxlen; + size_t maxlen; std::ostringstream oss; indent = 2; - using detail::writeComponentPart; + using detail::printComponentPart; // For string - GIVEN("writeComponentPart() for string") { + GIVEN("printComponentPart() for string") { oss.str(""); - writeComponentPart(oss, level=2, "foo\nbar", "label", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "label", "foo\nbar"); CHECK(oss.str() == " label : foo\n" " bar"); oss.str(""); - writeComponentPart(oss, level=2, "foo\nbar", "label", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "label", "foo\nbar"); CHECK(oss.str() == " label : foo\n" " bar"); oss.str(""); - writeComponentPart(oss, level=2, "foo\nbar", "", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "", "foo\nbar"); CHECK(oss.str() == " foo\n" " bar"); oss.str(""); - writeComponentPart(oss, level=2, "foo\nbar", "", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "", "foo\nbar"); CHECK(oss.str() == " foo\n" " bar"); } // GIVEN // For general types T - GIVEN("writeComponentPart() for T") { + GIVEN("printComponentPart() for T") { // For double WHEN("T is double") { double value = 1.234; oss.str(""); - writeComponentPart(oss, level=2, value, "label", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "label", value); CHECK(oss.str() == " label : 1.234"); oss.str(""); - writeComponentPart(oss, level=2, value, "label", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "label", value); CHECK(oss.str() == " label : 1.234"); oss.str(""); - writeComponentPart(oss, level=2, value, "", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "", value); CHECK(oss.str() == " 1.234"); oss.str(""); - writeComponentPart(oss, level=2, value, "", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "", value); CHECK(oss.str() == " 1.234"); } - // writeComponentPart() for general T has an if-constexpr that + // printComponentPart() for general T has an if-constexpr that // distinguished classes that *are* derived from Component from // those that aren't, so we'll test both cases. (double, above, // in fact falls into the latter category.) ... @@ -330,29 +358,34 @@ SCENARIO("Testing Component detail:: writeComponentPart()") { // label and maxlen don't get used in this case. // The Component-derived nature of the class causes - // value.write(stream,level) to be called instead. + // value.print(stream,level) to be called instead. // So we get the same result from each call. - const std::string expected = - " Derived { // GNDS: none\n" + const std::string expected1 = + " label {\n" " foo : 56\n" " bar : 7.8\n" - " } // Derived"; + " } // label"; + const std::string expected2 = + " {\n" + " foo : 56\n" + " bar : 7.8\n" + " }"; oss.str(""); - writeComponentPart(oss, level=2, value, "label", maxlen=0); - CHECK(oss.str() == expected); + printComponentPart(oss, level=2, maxlen= 0, "label", value); + CHECK(oss.str() == expected1); oss.str(""); - writeComponentPart(oss, level=2, value, "label", maxlen=10); - CHECK(oss.str() == expected); + printComponentPart(oss, level=2, maxlen=10, "label", value); + CHECK(oss.str() == expected1); oss.str(""); - writeComponentPart(oss, level=2, value, "", maxlen=0); - CHECK(oss.str() == expected); + printComponentPart(oss, level=2, maxlen= 0, "", value); + CHECK(oss.str() == expected2); oss.str(""); - writeComponentPart(oss, level=2, value, "", maxlen=10); - CHECK(oss.str() == expected); + printComponentPart(oss, level=2, maxlen=10, "", value); + CHECK(oss.str() == expected2); } // For "NonDerived" @@ -360,42 +393,42 @@ SCENARIO("Testing Component detail:: writeComponentPart()") { NonDerived value; oss.str(""); - writeComponentPart(oss, level=2, value, "label", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "label", value); CHECK(oss.str() == " label : {12,3.4}"); oss.str(""); - writeComponentPart(oss, level=2, value, "label", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "label", value); CHECK(oss.str() == " label : {12,3.4}"); oss.str(""); - writeComponentPart(oss, level=2, value, "", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "", value); CHECK(oss.str() == " {12,3.4}"); oss.str(""); - writeComponentPart(oss, level=2, value, "", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "", value); CHECK(oss.str() == " {12,3.4}"); } } // GIVEN // For optional - GIVEN("writeComponentPart() for optional") { + GIVEN("printComponentPart() for optional") { WHEN("The optional has a value") { std::optional opt = 1.234; oss.str(""); - writeComponentPart(oss, level=2, opt, "label", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "label", opt); CHECK(oss.str() == " label : 1.234"); oss.str(""); - writeComponentPart(oss, level=2, opt, "label", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "label", opt); CHECK(oss.str() == " label : 1.234"); oss.str(""); - writeComponentPart(oss, level=2, opt, "", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "", opt); CHECK(oss.str() == " 1.234"); oss.str(""); - writeComponentPart(oss, level=2, opt, "", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "", opt); CHECK(oss.str() == " 1.234"); } @@ -405,19 +438,19 @@ SCENARIO("Testing Component detail:: writeComponentPart()") { comments = false; oss.str(""); - writeComponentPart(oss, level=2, opt, "label", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "label", opt); CHECK(oss.str() == ""); oss.str(""); - writeComponentPart(oss, level=2, opt, "label", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "label", opt); CHECK(oss.str() == ""); oss.str(""); - writeComponentPart(oss, level=2, opt, "", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "", opt); CHECK(oss.str() == ""); oss.str(""); - writeComponentPart(oss, level=2, opt, "", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "", opt); CHECK(oss.str() == ""); } @@ -427,25 +460,25 @@ SCENARIO("Testing Component detail:: writeComponentPart()") { comments = true; oss.str(""); - writeComponentPart(oss, level=2, opt, "label", maxlen=0); - CHECK(oss.str() == " label : // optional; has no value"); + printComponentPart(oss, level=2, maxlen= 0, "label", opt); + CHECK(oss.str() == ""); oss.str(""); - writeComponentPart(oss, level=2, opt, "label", maxlen=10); - CHECK(oss.str() == " label : // optional; has no value"); + printComponentPart(oss, level=2, maxlen=10, "label", opt); + CHECK(oss.str() == ""); oss.str(""); - writeComponentPart(oss, level=2, opt, "", maxlen=0); - CHECK(oss.str() == " // optional; has no value"); + printComponentPart(oss, level=2, maxlen= 0, "", opt); + CHECK(oss.str() == ""); oss.str(""); - writeComponentPart(oss, level=2, opt, "", maxlen=10); - CHECK(oss.str() == " // optional; has no value"); + printComponentPart(oss, level=2, maxlen=10, "", opt); + CHECK(oss.str() == ""); } } // GIVEN // For Defaulted - GIVEN("writeComponentPart() for Defaulted") { + GIVEN("printComponentPart() for Defaulted") { WHEN("The Defaulted has an explicitly provided value") { // For the following: // 5.6 is the default @@ -453,20 +486,20 @@ SCENARIO("Testing Component detail:: writeComponentPart()") { Defaulted def(5.6,7.8); oss.str(""); - writeComponentPart(oss, level=2, def, "label", maxlen=0); - CHECK(oss.str() == " label : 7.8"); + printComponentPart(oss, level=2, maxlen= 0, "label", def); + CHECK(oss.str() == " label : 7.8 // its default"); oss.str(""); - writeComponentPart(oss, level=2, def, "label", maxlen=10); - CHECK(oss.str() == " label : 7.8"); + printComponentPart(oss, level=2, maxlen=10, "label", def); + CHECK(oss.str() == " label : 7.8 // its default"); oss.str(""); - writeComponentPart(oss, level=2, def, "", maxlen=0); - CHECK(oss.str() == " 7.8"); + printComponentPart(oss, level=2, maxlen= 0, "", def); + CHECK(oss.str() == " 7.8 // its default"); oss.str(""); - writeComponentPart(oss, level=2, def, "", maxlen=10); - CHECK(oss.str() == " 7.8"); + printComponentPart(oss, level=2, maxlen=10, "", def); + CHECK(oss.str() == " 7.8 // its default"); } WHEN("The Defaulted has its default, and comments == false") { @@ -475,20 +508,20 @@ SCENARIO("Testing Component detail:: writeComponentPart()") { comments = false; oss.str(""); - writeComponentPart(oss, level=2, def, "label", maxlen=0); - CHECK(oss.str() == ""); + printComponentPart(oss, level=2, maxlen= 0, "label", def); + CHECK(oss.str() == " label : 3.14"); oss.str(""); - writeComponentPart(oss, level=2, def, "label", maxlen=10); - CHECK(oss.str() == ""); + printComponentPart(oss, level=2, maxlen=10, "label", def); + CHECK(oss.str() == " label : 3.14"); oss.str(""); - writeComponentPart(oss, level=2, def, "", maxlen=0); - CHECK(oss.str() == ""); + printComponentPart(oss, level=2, maxlen= 0, "", def); + CHECK(oss.str() == " 3.14"); oss.str(""); - writeComponentPart(oss, level=2, def, "", maxlen=10); - CHECK(oss.str() == ""); + printComponentPart(oss, level=2, maxlen=10, "", def); + CHECK(oss.str() == " 3.14"); } WHEN("The Defaulted has its default, and comments == true") { @@ -497,49 +530,52 @@ SCENARIO("Testing Component detail:: writeComponentPart()") { comments = true; oss.str(""); - writeComponentPart(oss, level=2, def, "label", maxlen=0); - CHECK(oss.str() == " label : // defaulted; is its default (2.72)"); + printComponentPart(oss, level=2, maxlen= 0, "label", def); + CHECK(oss.str() == + " label : 2.72 // its default"); oss.str(""); - writeComponentPart(oss, level=2, def, "label", maxlen=10); - CHECK(oss.str() == " label : // defaulted; is its default (2.72)"); + printComponentPart(oss, level=2, maxlen=10, "label", def); + CHECK(oss.str() == + " label : 2.72 // its default"); oss.str(""); - writeComponentPart(oss, level=2, def, "", maxlen=0); - CHECK(oss.str() == " // defaulted; is its default (2.72)"); + printComponentPart(oss, level=2, maxlen= 0, "", def); + CHECK(oss.str() == " 2.72 // its default"); oss.str(""); - writeComponentPart(oss, level=2, def, "", maxlen=10); - CHECK(oss.str() == " // defaulted; is its default (2.72)"); + printComponentPart(oss, level=2, maxlen=10, "", def); + CHECK(oss.str() == " 2.72 // its default"); } } // GIVEN // For variant - GIVEN("writeComponentPart() for variant") { + GIVEN("printComponentPart() for variant") { oss.str(""); std::variant var(9.87); oss.str(""); - writeComponentPart(oss, level=2, var, "label", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "label", var); CHECK(oss.str() == " label : 9.87"); oss.str(""); - writeComponentPart(oss, level=2, var, "label", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "label", var); CHECK(oss.str() == " label : 9.87"); oss.str(""); - writeComponentPart(oss, level=2, var, "", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "", var); CHECK(oss.str() == " 9.87"); oss.str(""); - writeComponentPart(oss, level=2, var, "", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "", var); CHECK(oss.str() == " 9.87"); } // GIVEN // For vector - GIVEN("writeComponentPart() for vector") { + GIVEN("printComponentPart() for vector") { oss.str(""); const std::vector vec{{"a","b","c","d","e"}}; + comments = false; const std::string expected = " label [\n" @@ -551,11 +587,11 @@ SCENARIO("Testing Component detail:: writeComponentPart()") { " ]"; oss.str(""); - writeComponentPart(oss, level=2, vec, "label", maxlen=0); + printComponentPart(oss, level=2, maxlen= 0, "label", vec); CHECK(oss.str() == expected); oss.str(""); - writeComponentPart(oss, level=2, vec, "label", maxlen=10); + printComponentPart(oss, level=2, maxlen=10, "label", vec); CHECK(oss.str() == expected); } // GIVEN } @@ -568,71 +604,71 @@ SCENARIO("Testing Component detail:: writeComponentPart()") { SCENARIO("Testing Component detail:: classes for SFINAE") { - // hasIndex - CHECK((detail::hasIndex == false)); - CHECK((detail::hasIndex == false)); - CHECK((detail::hasIndex == true)); - CHECK((detail::hasIndex // One could argue that the second comment here really isn't important. // However, GNDStk is careful to maintain ALL information that's present // in a GNDS file it reads; it does not make decisions about importance. @@ -196,8 +203,9 @@ comments(bool &found = detail::default_bool) const { CONTAINER container; const std::string *text; - for (auto &c : children) - if (c->name == "comment" && (text = &c->meta("text",found),found)) + for (const childPtr &c : children) + if (c->name == special::comment && + (text = &c->meta(special::text,found), found)) container.push_back(*text); return container; } diff --git a/src/GNDStk/Node/src/string.hpp b/src/GNDStk/Node/src/string.hpp new file mode 100644 index 000000000..d5dc0ab86 --- /dev/null +++ b/src/GNDStk/Node/src/string.hpp @@ -0,0 +1,35 @@ + +// ----------------------------------------------------------------------------- +// I/O with respect to a string +// These are conveniences for reading and writing, for instance, XML or JSON +// content from/to a string. +// ----------------------------------------------------------------------------- + +// Node << string +// Remark: we return void, not the Node. This way, users don't incorrectly think +// that the <> string +void operator>>(std::string &str) const +{ + try { + std::ostringstream oss; + write(oss); + str = oss.str(); + } catch (...) { + log::function("Node >> string"); + throw; + } +} diff --git a/src/GNDStk/Node/src/write.hpp b/src/GNDStk/Node/src/write.hpp index d0a585cfe..d57e8479b 100644 --- a/src/GNDStk/Node/src/write.hpp +++ b/src/GNDStk/Node/src/write.hpp @@ -3,26 +3,23 @@ // Node.write() // ----------------------------------------------------------------------------- -// Cases for our FileType::text "plain text" format: -// write(ostream, int level) -// write(file name, int level) -// The "level" parameter keeps track of the indentation level. -// These print exactly what's in the Node, even, say, if the Node's name -// is the empty string. -// -// General cases: -// 1. write(ostream, FileType) -// 2. write(file name, FileType) calls 1 after making ostream from file name -// 3. write(ostream, string ) calls 1 after making FileType from string -// 4. write(file name, string ) calls 2 after making FileType from string - +// Cases: +// 0. Helper for writing in the FileType::debug format +// 1. write(ostream, FileType) +// 2. write(filename, FileType) calls 1 after making ostream from filename +// 3. write(ostream, string ) calls 1 after making FileType from string +// 4. write(filename, string ) calls 2 after making FileType from string // ----------------------------------------------------------------------------- +// 0. Helper // write(ostream, int level) -// For FileType::text +// For FileType::debug, our internal "debug format". // ----------------------------------------------------------------------------- +private: + +// The level parameter keeps track of the indentation level. std::ostream &write(std::ostream &os, const int level) const { // indentation: spaces for current and next levels @@ -64,82 +61,67 @@ std::ostream &write(std::ostream &os, const int level) const } - -// ----------------------------------------------------------------------------- -// write(file name, int level) -// For FileType::text -// ----------------------------------------------------------------------------- - -bool write(const std::string &filename, const int level) const -{ - // open file - std::ofstream ofs(filename); - if (!ofs) { - log::error("Could not open file \"{}\" for output", filename); - log::member("Node.write(\"{}\")", filename); - return false; - } - - // write to ostream - if (!write(ofs,level)) { - log::member("Node.write(\"{}\")", filename); - return false; - } - - // done - return true; -} - - - // ----------------------------------------------------------------------------- // 1. write(ostream, FileType) // ----------------------------------------------------------------------------- +public: + std::ostream &write( std::ostream &os = std::cout, - const FileType format = FileType::null, - const bool decl = false + const FileType format = FileType::guess, + const bool &DECL = detail::default_bool, + // If circumstances are such that we end up writing as HDF5, the following + // may be != "" if the ostream is from an ofstream. In that case, the HDF5 + // writer can produce output directly into the intended file, bypassing the + // need to create a temporary file and transfer its contents to the ostream. + const std::string &filename = "" ) const { // Discussion. // - // This function might have been called through the file name write(). - // Or, it might have been called through the string (in place of FileType) - // format write, through ostream << Node, or perhaps just called directly. + // This function might have been called through the file write(). Or, it + // might have been called through the string (in place of FileType) format + // write, through ostream << Node, or perhaps just called directly. // - // In the former case, a file name was involved, and thus the caller had - // the opportunity to examine the file name and, if appropriate, try to - // make a decision (based on any file name extension) of what output format - // was intended. The decision would have arrived here via FileType format. + // In the former case, a file was involved, and thus the caller had the + // opportunity to examine the file name and, if appropriate, try to make + // a decision (based on any file extension) of what output format was + // intended. The decision would have arrived here via FileType format. // // In the latter cases, only an ostream was/is involved; there's neither - // a file name whose extension can be examined, nor an existing file (that - // we care about, at least - we're doing *output*) whose file magic number + // a file extension that can be examined, nor an existing file (that we + // care about, at least - we're doing *output*) whose file magic number // we can examine in order to guess at the file type. We therefore have - // our else { } catchall, below, write the Node in our plain text format, - // whether FileType::null or FileType::text arrived as the format. + // our else { } catchall, below, write the Node in our debugging format, + // whether FileType::guess or FileType::debug arrived as the format. // // A case could be made that this function should *require* that a format - // be given, considering that we don't, here, have a file or a file name + // be given, considering that we don't, here, have a file or file extension // to examine. On the other hand, we like having format be optional, so // our various Node I/O functions are as consistent with one another as // reasonably possible. Note also that if the user calls operator<<, then - // there's no opportunity to explicitly provide a format. + // there's no opportunity to provide a format explicitly. try { + const bool decl = detail::getDecl(*this,DECL); + if (format == FileType::xml) { - // write via a temporary xml object... + // write via a temporary XML object... XML(*this).write(os,decl); } else if (format == FileType::json) { - // write via a temporary json object... + // write via a temporary JSON object... JSON(*this).write(os,decl); } else if (format == FileType::hdf5) { - // write via a temporary hdf5 object... - log::error("Node.write() for HDF5 is not implemented yet"); - throw std::exception{}; + // write via a temporary HDF5 object... + if (filename == "") + HDF5(*this).write(os,decl); + else { + HDF5 tmp; + convert(*this,tmp,filename); + } } else { - // null or text: use our plain text format + // guess or debug: use our debugging format return write(os,0); } @@ -157,23 +139,23 @@ std::ostream &write( } - // ----------------------------------------------------------------------------- -// 2. write(file name, FileType) +// 2. write(filename, FileType) // ----------------------------------------------------------------------------- bool write( const std::string &filename, - FileType format = FileType::null, - const bool decl = false + const FileType FORMAT = FileType::guess, + const bool &DECL = detail::default_bool ) const { + FileType format = FORMAT; // non-const; may change // ------------------------ - // FileType::null - // Decide from file name + // FileType::guess + // Decide from extension // ------------------------ - if (format == FileType::null) { + if (format == FileType::guess) { if (has_extension(filename) && endsin_xml(filename)) format = FileType::xml; else if (has_extension(filename) && endsin_json(filename)) @@ -181,8 +163,8 @@ bool write( else if (has_extension(filename) && endsin_hdf5(filename)) format = FileType::hdf5; else { - // fallback: our plain text format - format = FileType::text; + // fallback: our debugging format + format = FileType::debug; } } @@ -191,9 +173,9 @@ bool write( // Check: consistent name? // ------------------------ - // The above code block might have changed format via automagick file type - // detection, but wouldn't have changed it in a manner that would cause any - // of the following warnings. + // Remark. The above code block might have changed the [format] variable, + // but not in a manner that would trigger any of the following warnings + // where they wouldn't have otherwise existed. So, print them if warranted. // Caller asked for XML, but there's an extension that isn't XML... if (format == FileType::xml && has_extension(filename) @@ -213,6 +195,23 @@ bool write( // Open and write // ------------------------ + // Say we've decided we're actually writing an HDF5 file. (Independent of + // weird things that may have been reported on above, such as giving a file + // name of foo.xml, but a format of "hdf5", in which case we'll write HDF5 + // but print a warning about the file name's ".xml" bit.) If we're really + // writing an HDF5 file, but the file extension is ".hdf" or ".HDF", then + // we'll note that those aren't officially HDF5 extensions. (The official + // ones always require the "5" in some form.) + if (format == FileType::hdf5 && + (endsin(filename,".hdf") || endsin(filename,".HDF") + )) { + log::info( + "Writing file \"{}\" in HDF5 format, but we'll note that .hdf\n" + "and .HDF aren't official HDF5 file extensions.\n" + "Consider using .hdf5, .he5, or .h5 instead.", filename + ); + } + try { std::ofstream ofs(filename); if (!ofs) { @@ -221,8 +220,26 @@ bool write( } // Call write(ostream) to do the remaining work. - if (!write(ofs, format, decl)) + const bool decl = detail::getDecl(*this,DECL); + if (!write(ofs, format, decl, filename)) throw std::exception{}; + + // If the file is some type of text file (so, here, anything other than + // HDF5, which is binary), we'll also give the file a trailing newline. + // Note that throughout GNDStk, we generally *don't* write such newlines, + // because whether newlines are really wanted, or not wanted, depends on + // context. If, for example, someone is writing an xml representation into + // a string, via an ostringstream, a trailing newline is probably neither + // wanted nor expected. Right here, however, we're dealing specifically + // with the case of a caller having provided a file name. (The file was + // opened, a few lines above, as an ofstream.) We know, then, that we're + // writing to a file, and most people would expect a newline at the end + // of the last line with actual text. So, we'll add the newline after the + // above call to write(ostream,...) - which emits no newline - finishes. + if (format != FileType::hdf5) + ofs << std::endl; + + // Done. return bool(ofs); } catch (...) { log::member("Node.write(\"{}\")", filename); @@ -231,7 +248,6 @@ bool write( } - // ----------------------------------------------------------------------------- // 3. write(ostream, string) // ----------------------------------------------------------------------------- @@ -239,24 +255,24 @@ bool write( std::ostream &write( std::ostream &os, const std::string &format, - const bool decl = false + const bool &DECL = detail::default_bool ) const { try { - if (eq_null(format)) return write(os, FileType::null, decl); - if (eq_text(format)) return write(os, FileType::text, decl); - if (eq_xml (format)) return write(os, FileType::xml, decl); - if (eq_json(format)) return write(os, FileType::json, decl); - if (eq_hdf5(format)) return write(os, FileType::hdf5, decl); + const bool decl = detail::getDecl(*this,DECL); + bool matched; + const FileType type = string2filetype(format,matched); + if (matched) + return write(os, type, decl); // unrecognized file format log::warning( "Unrecognized file format in call to Node.write(ostream,\"{}\").\n" - "We'll use our plain text format", + "We'll use our debugging format", format ); - // fallback: automagick - return write(os, FileType::null, decl); + // fallback: guess, from file extension + return write(os, FileType::guess, decl); } catch (...) { log::member("Node.write(ostream,\"{}\")", format); throw; @@ -264,33 +280,32 @@ std::ostream &write( } - // ----------------------------------------------------------------------------- -// 4. write(file name, string) +// 4. write(filename, string) // ----------------------------------------------------------------------------- bool write( const std::string &filename, const std::string &format, - const bool decl = false + const bool &DECL = detail::default_bool ) const { try { - if (eq_null(format)) return write(filename, FileType::null, decl); - if (eq_text(format)) return write(filename, FileType::text, decl); - if (eq_xml (format)) return write(filename, FileType::xml, decl); - if (eq_json(format)) return write(filename, FileType::json, decl); - if (eq_hdf5(format)) return write(filename, FileType::hdf5, decl); + const bool decl = detail::getDecl(*this,DECL); + bool matched; + const FileType type = string2filetype(format,matched); + if (matched) + return write(filename, type, decl); // unrecognized file format log::warning( "Unrecognized file format in call to Node.write(\"{}\",\"{}\").\n" - "We'll guess from the file extension, or use our plain text\n" + "We'll guess from the file extension, or use our debugging\n" "format if that fails", filename, format ); - // fallback: automagick - return write(filename, FileType::null, decl); + // fallback: guess, from file extension + return write(filename, FileType::guess, decl); } catch (...) { log::member("Node.write(\"{}\",\"{}\")", filename, format); throw; diff --git a/src/GNDStk/Node/test/CMakeLists.txt b/src/GNDStk/Node/test/CMakeLists.txt index 5119da598..d1e7c8659 100644 --- a/src/GNDStk/Node/test/CMakeLists.txt +++ b/src/GNDStk/Node/test/CMakeLists.txt @@ -1,24 +1,27 @@ -add_executable( GNDStk.Node.test - add.test.cpp - clear.test.cpp - child.test.cpp - sort.test.cpp - compare.test.cpp - count.test.cpp - has.test.cpp - shuffle.test.cpp - special.test.cpp - subscript.test.cpp - meta.test.cpp - assign.test.cpp - many.test.cpp - empty.test.cpp - one.test.cpp - call.test.cpp - ctor.test.cpp - Node.test.cpp - write.test.cpp ) +add_executable( + GNDStk.Node.test + add.test.cpp + clear.test.cpp + child.test.cpp + sort.test.cpp + compare.test.cpp + count.test.cpp + has.test.cpp + shuffle.test.cpp + special.test.cpp + subscript.test.cpp + meta.test.cpp + assign.test.cpp + many.test.cpp + empty.test.cpp + one.test.cpp + call.test.cpp + ctor.test.cpp + Node.test.cpp + write.test.cpp +) + target_compile_options( GNDStk.Node.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} @@ -29,9 +32,9 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.Node.test PUBLIC GNDStk ) +target_link_libraries( GNDStk.Node.test PUBLIC GNDStk ) file( GLOB resources "resources/*" ) foreach( resource ${resources}) file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) endforeach() -add_test( NAME GNDStk.Node COMMAND GNDStk.Node.test ) \ No newline at end of file +add_test( NAME GNDStk.Node COMMAND GNDStk.Node.test ) diff --git a/src/GNDStk/Node/test/Node.test.cpp b/src/GNDStk/Node/test/Node.test.cpp index 864aee8d6..3d286d456 100644 --- a/src/GNDStk/Node/test/Node.test.cpp +++ b/src/GNDStk/Node/test/Node.test.cpp @@ -9,7 +9,7 @@ SCENARIO("Testing GNDStk Node") { GIVEN("A Node") { Node n; CHECK(n.empty()); - CHECK(n.name == ""); + CHECK(n.name == emptyNodeName); CHECK(n.metadata.size() == 0); CHECK(n.children.size() == 0); } diff --git a/src/GNDStk/Node/test/add.test.cpp b/src/GNDStk/Node/test/add.test.cpp index 7a4b926b4..84752d81f 100644 --- a/src/GNDStk/Node/test/add.test.cpp +++ b/src/GNDStk/Node/test/add.test.cpp @@ -1,6 +1,7 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "GNDStk/test/keys.hpp" using namespace njoy::GNDStk; @@ -70,10 +71,10 @@ SCENARIO("Testing GNDStk Node add()") { n.add("4",dimensions2d(12,34)); // metadata, Meta key - auto v = keyword.meta("AStringViaVoid"); - auto str = keyword.meta("AString"); - auto dbl = keyword.meta("ADouble"); - auto dim = keyword.meta("Dimensions"); + auto v = Meta("AStringViaVoid"); + auto str = Meta("AString"); + auto dbl = Meta("ADouble"); + auto dim = Meta("Dimensions"); n.add(v); n.add(v,"fred"); n.add(str); @@ -85,8 +86,8 @@ SCENARIO("Testing GNDStk Node add()") { // these need the = TYPE on class T in the metadata Node.add() functions: n.add(dim,{321,987}); CHECK(n.metadata.back().second == "321,987"); - auto optdim = keyword.meta>("OptDim"); - auto defdim = Defaulted({1,2})/keyword.meta<>("DefDim"); + auto optdim = Meta>("OptDim"); + auto defdim = Defaulted({1,2})/Meta<>("DefDim"); n.add(optdim,{321,987}); CHECK(n.metadata.back().second == "321,987"); n.add(defdim,{321,987}); @@ -105,13 +106,13 @@ SCENARIO("Testing GNDStk Node add()") { // ------------------------ // ------------------------ - auto foo = keyword.child("foo"); - auto numbers = keyword.child< + auto foo = Child("foo"); + auto numbers = Child< std::vector, Allow::one - >("pcdata",std::vector{},detail::convert_pcdata_text_t{}); + >(special::data)/detail::convert_data_text_t{}; - auto nrepeat = keyword.child("repeated node"); + auto nrepeat = Child("repeated node"); Node node1; node1.name = "aa11"; Node node2; node2.name = "bb22"; Node node3; node3.name = "cc33"; @@ -125,10 +126,8 @@ SCENARIO("Testing GNDStk Node add()") { n.add(nrepeat,vec); n.add(nrepeat,node5); - // dim2d doesn't happen to have a default constructor, so we'll need - // to give it a value in the following Child. For just the .add()s, - // the value isn't used. - auto drepeat = keyword.child("dimension",dim2d{0,0}); + // dim2d doesn't have a default constructor. That fine in the following. + auto drepeat = Child("dimension"); const dim2d a(1,2), b(3,4), c(5,6), d(7,8), e(9,10); n.add(drepeat,{a,b,c,d}); n.add(drepeat,e); diff --git a/src/GNDStk/Node/test/assign.test.cpp b/src/GNDStk/Node/test/assign.test.cpp index 9279b1baa..e1ced3192 100644 --- a/src/GNDStk/Node/test/assign.test.cpp +++ b/src/GNDStk/Node/test/assign.test.cpp @@ -7,7 +7,7 @@ SCENARIO("Testing GNDStk Node assignment") { GIVEN("A tree read from a GNDS file") { Tree tree("n-008_O_016.xml"); - WHEN("We assign: Node = tree.top") { + WHEN("We assign: Node = tree.top()") { Node node; // put some initial content into the node... diff --git a/src/GNDStk/Node/test/call.test.cpp b/src/GNDStk/Node/test/call.test.cpp index 9e3349b33..18b567e10 100644 --- a/src/GNDStk/Node/test/call.test.cpp +++ b/src/GNDStk/Node/test/call.test.cpp @@ -1,6 +1,7 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "GNDStk/test/keys.hpp" using namespace njoy::GNDStk; @@ -257,20 +258,21 @@ R"***(1e-05 // ----------------------------------------------------------------------------- // Scenario +// Test operator() cases; except multi-queries are in another scenario. // ----------------------------------------------------------------------------- -SCENARIO("Testing GNDStk Node operator()") { +SCENARIO("Testing GNDStk::Node's operator()") { // tree Tree tree("n-008_O_016.xml"); // Child objects with Allow::one - auto temperature = keyword.child("temperature"); - auto styles = keyword.child("styles"); + auto temperature = Child("temperature"); + auto styles = Child("styles"); // Child objects with Allow::many - auto isotope = keyword.child("isotope"); - auto isotope_node = keyword.child("isotope"); + auto isotope = Child("isotope"); + auto isotope_node = Child("isotope"); GIVEN("The top-level node from a tree object") { @@ -598,7 +600,7 @@ SCENARIO("Testing GNDStk Node operator()") { found = false; CHECK((c(reaction,found)[0].ENDF_MT == 2 && found)); found = true; - c(nonsense,found)[0]; + (void)c(nonsense,found)[0]; CHECK(!found); } @@ -875,7 +877,7 @@ SCENARIO("Testing GNDStk Node operator()") { CHECK((c(suite,reactions,reaction,found)[0].ENDF_MT == 2 && found)); found = true; - c(suite,reactions,nonsense,found)[0]; + (void)c(suite,reactions,nonsense,found)[0]; CHECK(!found); } @@ -924,57 +926,362 @@ SCENARIO("Testing GNDStk Node operator()") { // with. There's nothing wrong with gigantic strings, except that I // don't want to hardcode, in this or any test file, a literal string // that's hundreds of pages long! :-) - const int stride = 200; - int count; + const size_t stride = 200; + size_t count; // numeric<> ==> vector count = 0; - for (auto v : n(numeric<>)) + for (const double v : n(numeric<>)) if (count++ % stride == 0) oss << v << std::endl; oss << std::endl; // numeric ==> vector count = 0; - for (auto v : n(numeric)) + for (const double v : n(numeric)) if (count++ % stride == 0) oss << v << std::endl; oss << std::endl; // doubles: same as numeric count = 0; - for (auto v : n(doubles)) + for (const double v : n(doubles)) if (count++ % stride == 0) oss << v << std::endl; oss << std::endl; // numeric ==> vector count = 0; - for (auto v : n(numeric)) + for (const float v : n(numeric)) if (count++ % stride == 0) oss << v << std::endl; oss << std::endl; // floats: same as numeric count = 0; - for (auto v : n(floats)) + for (const float v : n(floats)) if (count++ % stride == 0) oss << v << std::endl; oss << std::endl; // numeric> ==> vector count = 0; - for (auto v : n(numeric>)) + for (const double v : n(numeric>)) if (count++ % stride == 0) oss << v << std::endl; oss << std::endl; // numeric> ==> vector count = 0; - for (auto v : n(numeric>)) + for (const float v : n(numeric>)) if (count++ % stride == 0) oss << v << std::endl; oss << std::endl; // numeric>> ==> vector> count = 0; - for (auto v : n(numeric>>)) + for (const auto &v : n(numeric>>)) if (count++ % stride == 0) oss << v.first << ", " << v.second << std::endl; CHECK(oss.str() == numeric_string); } // GIVEN } + + +// ----------------------------------------------------------------------------- +// Scenario +// Test multi-query operator(). +// ----------------------------------------------------------------------------- + +// test string +static const std::string xmlstring = +R"***( + + + + + + + + +)***"; + +// SCENARIO +SCENARIO("Testing GNDStk::Node's operator() for multi-queries") { + + // A Node + Node node; + node << xmlstring; + std::cout << node << std::endl; + + // Meta objects + const Meta a("a"); + const Meta b("b"); + const Meta label("label"); + const Meta x("x"); + const Meta y("y"); + const Meta z("z"); + const Meta i("i"); + const Meta j("j"); + const Meta k("k"); + const Meta l("l"); + const Meta m("m"); + const Meta n("n"); + + // Child objects + const Child<> bar("bar"); + const Child<> baz("baz"); + const Child<> boo("boo"); + + /* + ------------------------------------+------------------------------------ + Meta/Child | Meta/Child | + a. Meta | Meta | KeyTuple + b. Meta | Child | KeyTuple + c. Child | Meta | KeyTuple + d. Child | Child | KeyTuple + ------------------------------------+------------------------------------ + Child | string/regex | + a. Child | string | KeyTuple> + b. Child | char * | KeyTuple> + c. Child | regex | KeyTuple> + ------------------------------------+------------------------------------ + KeyTuple<...> | Meta/Child | + a. KeyTuple<...> | Meta | KeyTuple<...,Meta> + b. KeyTuple<...> | Child | KeyTuple<...,Child> + ------------------------------------+------------------------------------ + KeyTuple<...,Child> | string/regex | + a. KeyTuple<...,Child> | string | KeyTuple<...,pair> + b. KeyTuple<...,Child> | char * | KeyTuple<...,pair> + c. KeyTuple<...,Child> | regex | KeyTuple<...,pair> + ------------------------------------+------------------------------------ + */ + + // ------------------------ + // or.hpp operator|, case 1 + // ------------------------ + + GIVEN("Meta | Meta") + { + const auto tup = node(a | b); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup) == 123); + CHECK(std::get<1>(tup) == 4.56); + } + + GIVEN("Meta | Child") + { + const auto tup = node(a | bar); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup) == 123); + CHECK(std::get<1>(tup).name == "bar"); + } + + GIVEN("Child | Meta") + { + const auto tup = node(bar | a); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup).name == "bar"); + CHECK(std::get<1>(tup) == 123); + } + + GIVEN("Child | Child") + { + const auto tup = node(bar | baz); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup).name == "bar"); + CHECK(std::get<1>(tup).name == "baz"); + } + + // ------------------------ + // or.hpp operator|, case 2 + // ------------------------ + + GIVEN("Child | string") + { + const auto tup = node(bar | std::string("xyz")); + CHECK(std::tuple_size_v == 1); + CHECK(std::get<0>(tup).name == "bar"); + CHECK(std::get<0>(tup)(label) == "xyz"); + } + + GIVEN("Child | char *") + { + const auto tup = node(baz | "lmn"); + CHECK(std::tuple_size_v == 1); + CHECK(std::get<0>(tup).name == "baz"); + CHECK(std::get<0>(tup)(label) == "lmn"); + } + + GIVEN("Child | regex") + { + const auto tup = node(boo | std::regex("j[au]ne")); + CHECK(std::tuple_size_v == 1); + CHECK(std::get<0>(tup).name == "boo"); + CHECK(std::get<0>(tup)(label) == "jane"); + } + + // ------------------------ + // or.hpp operator|, case 3 + // ------------------------ + + GIVEN("KeyTuple<...> | Meta") + { + const auto tup = node(a | b | a); + CHECK(std::tuple_size_v == 3); + CHECK(std::get<0>(tup) == 123); + CHECK(std::get<1>(tup) == 4.56); + CHECK(std::get<2>(tup) == 123); + } + + GIVEN("KeyTuple<...> | Child") + { + const auto tup = node(a | b | bar); + CHECK(std::tuple_size_v == 3); + CHECK(std::get<0>(tup) == 123); + CHECK(std::get<1>(tup) == 4.56); + CHECK(std::get<2>(tup).name == "bar"); + } + + GIVEN("KeyTuple<...,pair> | Meta") + { + const auto tup = node(baz | std::string("ijk") | a); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup).name == "baz"); + CHECK(std::get<0>(tup)(label) == "ijk"); + CHECK(std::get<1>(tup) == 123); + } + + GIVEN("KeyTuple<...,pair> | Meta") + { + const auto tup = node(baz | "lmn" | a); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup).name == "baz"); + CHECK(std::get<0>(tup)(label) == "lmn"); + CHECK(std::get<0>(tup)(m) == 'm'); + CHECK(std::get<0>(tup)(n) == 'n'); + CHECK(std::get<1>(tup) == 123); + } + + GIVEN("KeyTuple<...,pair> | Meta") + { + const auto tup = node(baz | std::regex("[kji]+") | a); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup).name == "baz"); + CHECK(std::get<0>(tup)(label) == "ijk"); + CHECK(std::get<1>(tup) == 123); + } + + GIVEN("KeyTuple<...,pair> | Child") + { + const auto tup = node(baz | std::string("ijk") | bar); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup).name == "baz"); + CHECK(std::get<0>(tup)(label) == "ijk"); + CHECK(std::get<1>(tup).name == "bar"); + } + + GIVEN("KeyTuple<...,pair> | Child") + { + const auto tup = node(baz | "lmn" | bar); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup).name == "baz"); + CHECK(std::get<0>(tup)(label) == "lmn"); + CHECK(std::get<1>(tup).name == "bar"); + } + + GIVEN("KeyTuple<...,pair> | Child") + { + const auto tup = node(baz | std::regex("[kji]+") | bar); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup).name == "baz"); + CHECK(std::get<0>(tup)(label) == "ijk"); + CHECK(std::get<1>(tup).name == "bar"); + } + + // ------------------------ + // or.hpp operator|, case 4 + // ------------------------ + + GIVEN("KeyTuple<...,Child> | string") + { + const auto tup = node(bar | baz | std::string("ijk")); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup).name == "bar"); + CHECK(std::get<1>(tup).name == "baz"); + CHECK(std::get<1>(tup)(label) == "ijk"); + } + + GIVEN("KeyTuple<...,Child> | char *") + { + const auto tup = node(bar | baz | "lmn"); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup).name == "bar"); + CHECK(std::get<1>(tup).name == "baz"); + CHECK(std::get<1>(tup)(label) == "lmn"); + } + + GIVEN("KeyTuple<...,Child> | regex") + { + const auto tup = node(bar | baz | std::regex("[kji]+")); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup).name == "bar"); + CHECK(std::get<1>(tup).name == "baz"); + CHECK(std::get<1>(tup)(label) == "ijk"); + } + + // ------------------------ + // Miscellaneous fun stuff + // ------------------------ + + GIVEN("Various multi-queries") + { + { + const auto tup = node(a | b | bar | baz | boo); + CHECK(std::tuple_size_v == 5); + CHECK(std::get<0>(tup) == 123); + CHECK(std::get<1>(tup) == 4.56); + CHECK(std::get<2>(tup).name == "bar"); + CHECK(std::get<3>(tup).name == "baz"); + CHECK(std::get<4>(tup).name == "boo"); + } + { + const auto tup = node(bar,"xyz")(label | x | y | z); + CHECK(std::tuple_size_v == 4); + CHECK(std::get<0>(tup) == "xyz"); + CHECK(std::get<1>(tup) == "one"); + CHECK(std::get<2>(tup) == "two"); + CHECK(std::get<3>(tup) == 1); + } + { + const auto tup = node(bar,"zyx")(label | x | y | z); + CHECK(std::tuple_size_v == 4); + CHECK(std::get<0>(tup) == "zyx"); + CHECK(std::get<1>(tup) == "three"); + CHECK(std::get<2>(tup) == "four"); + CHECK(std::get<3>(tup) == 2); + } + { + const auto tup = node(baz,"ijk")(label | i | j | k); + CHECK(std::tuple_size_v == 4); + CHECK(std::get<0>(tup) == "ijk"); + CHECK(std::get<1>(tup) == "eye"); + CHECK(std::get<2>(tup) == "jay"); + CHECK(std::get<3>(tup) == "kay"); + } + { + const auto tup = node(baz,"lmn")(label | l | m | n); + CHECK(std::tuple_size_v == 4); + CHECK(std::get<0>(tup) == "lmn"); + CHECK(std::get<1>(tup) == "ell"); + CHECK(std::get<2>(tup) == 'm'); + CHECK(std::get<3>(tup) == 'n'); + } + { + const auto tup = node(boo,"jane")(label | a); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup) == "jane"); + CHECK(std::get<1>(tup) == 321); + } + { + const auto tup = node(boo,"john")(label | b); + CHECK(std::tuple_size_v == 2); + CHECK(std::get<0>(tup) == "john"); + CHECK(std::get<1>(tup) == 6.54); + } + } +} diff --git a/src/GNDStk/Node/test/child.test.cpp b/src/GNDStk/Node/test/child.test.cpp index 93943d4be..5de29defb 100644 --- a/src/GNDStk/Node/test/child.test.cpp +++ b/src/GNDStk/Node/test/child.test.cpp @@ -1,8 +1,8 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "GNDStk/test/keys.hpp" #include - using namespace njoy::GNDStk; @@ -75,19 +75,19 @@ inline void convert(const Node &n, isotope_t &iso) // Child objects with Allow::one auto temperature = - keyword.child("temperature"); + Child("temperature"); auto styles = - keyword.child("styles"); + Child("styles"); auto documentations = - keyword.child,Allow::one>("documentations"); + Child,Allow::one>("documentations"); // Child objects with Allow::many auto isotope = - keyword.child("isotope"); + Child("isotope"); auto isotope_node = - keyword.child("isotope"); + Child("isotope"); auto nuclide_foo_or_bar_node = - keyword.child,Allow::many>("nuclide"); + Child,Allow::many>("nuclide"); // ----------------------------------------------------------------------------- @@ -195,7 +195,7 @@ SCENARIO("Testing GNDStk Node child()") { basic::child::reactionSuite, basic::child::documentations, basic::child::documentation, - misc::child::cdata + misc::child::CDATA ); CHECK(0 == strncmp(descr.data(), "\n 8-O - 16 LANL", 16)); } @@ -499,7 +499,7 @@ SCENARIO("Testing GNDStk Node child()") { found = false; CHECK((c.child(reaction,found)[0].ENDF_MT == 2 && found)); found = true; - c.child(nonsense,found)[0]; + (void)c.child(nonsense,found)[0]; CHECK(!found); } @@ -554,7 +554,7 @@ SCENARIO("Testing GNDStk Node child()") { found = false; CHECK((c.child(reaction,found)[0].ENDF_MT == 2 && found)); found = true; - c.child(nonsense,found)[0]; + (void)c.child(nonsense,found)[0]; CHECK(!found); } diff --git a/src/GNDStk/Node/test/compare.test.cpp b/src/GNDStk/Node/test/compare.test.cpp index b50d2a78e..79c9d03a8 100644 --- a/src/GNDStk/Node/test/compare.test.cpp +++ b/src/GNDStk/Node/test/compare.test.cpp @@ -1,7 +1,10 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; + +#include "GNDStk/test/keys.hpp" +using namespace basic; SCENARIO("Testing GNDStk Node operator==() and operator!=") { Tree oh("n-008_O_016.xml"); diff --git a/src/GNDStk/Node/test/count.test.cpp b/src/GNDStk/Node/test/count.test.cpp index 87780a262..2d5dedf5e 100644 --- a/src/GNDStk/Node/test/count.test.cpp +++ b/src/GNDStk/Node/test/count.test.cpp @@ -1,7 +1,10 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; + +#include "GNDStk/test/keys.hpp" +using namespace basic; SCENARIO("Testing GNDStk Node count()") { const Tree tree("n-008_O_016.xml"); diff --git a/src/GNDStk/Node/test/ctor.test.cpp b/src/GNDStk/Node/test/ctor.test.cpp index 6c8529f79..027a1249f 100644 --- a/src/GNDStk/Node/test/ctor.test.cpp +++ b/src/GNDStk/Node/test/ctor.test.cpp @@ -1,6 +1,7 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "GNDStk/test/keys.hpp" using namespace njoy::GNDStk; @@ -110,8 +111,8 @@ SCENARIO("Testing GNDStk Node constructors") { // ------------------------ WHEN("A Node is constructed from just a name (no metadata/children)") { - Node n("NodeName"); - CHECK(n.name == "NodeName"); + Node n("MyName"); + CHECK(n.name == "MyName"); CHECK(n.metadata.size() == 0); CHECK(n.children.size() == 0); } @@ -176,8 +177,8 @@ SCENARIO("Testing GNDStk Node constructors") { // ------------------------ GIVEN("Some Child objects") { - const Child ymd("YearMonthDay",yyyymmdd{0,0,0}); - const Child mdy("MonthDayYear",mmddyyyy{0,0,0}); + const Child ymd("YearMonthDay"); + const Child mdy("MonthDayYear"); WHEN("A Node is constructed with (Child,type)") { Node n(ymd,yyyymmdd{1776,7,4}); diff --git a/src/GNDStk/Node/test/has.test.cpp b/src/GNDStk/Node/test/has.test.cpp index a69232d7e..6b1360b9c 100644 --- a/src/GNDStk/Node/test/has.test.cpp +++ b/src/GNDStk/Node/test/has.test.cpp @@ -1,7 +1,10 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; + +#include "GNDStk/test/keys.hpp" +using namespace basic; // I'm arguably overdoing it in this file, testing so many different // permutations of essentially the same underlying capability. We do diff --git a/src/GNDStk/Node/test/many.test.cpp b/src/GNDStk/Node/test/many.test.cpp index 6f656e449..84f042e4e 100644 --- a/src/GNDStk/Node/test/many.test.cpp +++ b/src/GNDStk/Node/test/many.test.cpp @@ -4,6 +4,8 @@ #include using namespace njoy::GNDStk; + +#include "GNDStk/test/keys.hpp" using namespace misc; SCENARIO("Testing GNDStk Node many()") { @@ -82,7 +84,7 @@ SCENARIO("Testing GNDStk Node many()") { } THEN("As above, with filter") { - // filter should be ignored when used with key=="" + // filter should be ignored when used with key == "" auto filter = [](const Node &n) { return false; }; bool found = false; CHECK(Rs.has_many("",filter)); diff --git a/src/GNDStk/Node/test/meta.test.cpp b/src/GNDStk/Node/test/meta.test.cpp index 45a17835b..cdc0aa72e 100644 --- a/src/GNDStk/Node/test/meta.test.cpp +++ b/src/GNDStk/Node/test/meta.test.cpp @@ -28,14 +28,14 @@ SCENARIO("Testing GNDStk Node meta()") { CHECK(consttop.meta("format") == "1.99"); } - auto format = keyword.meta("format"); + auto format = Meta("format"); CHECK(top.has_meta(format)); double f = top.meta(format); CHECK(f == 1.99); WHEN("Node.meta(\"key\",found) is called for a key that isn't there") { // try something that doesn't work - auto foobar = keyword.meta("foobar"); + auto foobar = Meta("foobar"); CHECK(!top.has_meta(foobar)); // doesn't have bool found = true; f = top.meta(foobar,found); // foobar isn't there @@ -47,8 +47,8 @@ SCENARIO("Testing GNDStk Node meta()") { WHEN("Node.meta(Meta) is called") { // string and void Meta ==> string - auto sstring = keyword.meta("evaluation"); - auto vstring = keyword.meta("evaluation"); + auto sstring = Meta("evaluation"); + auto vstring = Meta("evaluation"); std::string sstr = top.meta(sstring); std::string vstr = top.meta(vstring); CHECK(sstr == "ENDF/B-8.0"); @@ -56,7 +56,7 @@ SCENARIO("Testing GNDStk Node meta()") { // meta case should trigger a reference return... (void)&top.meta(vstring); - auto var = keyword.meta>("format"); + auto var = Meta>("format"); auto s = top.meta(var); auto d = top.meta(var); CHECK(s == "1.99"); diff --git a/src/GNDStk/Node/test/one.test.cpp b/src/GNDStk/Node/test/one.test.cpp index 3e93619ae..5f1c3b56a 100644 --- a/src/GNDStk/Node/test/one.test.cpp +++ b/src/GNDStk/Node/test/one.test.cpp @@ -1,8 +1,9 @@ #include "catch.hpp" #include "GNDStk.hpp" - using namespace njoy::GNDStk; + +#include "GNDStk/test/keys.hpp" using namespace misc; SCENARIO("Testing GNDStk Node one()") { diff --git a/src/GNDStk/Node/test/sort.test.cpp b/src/GNDStk/Node/test/sort.test.cpp index f542a5262..2fa572172 100644 --- a/src/GNDStk/Node/test/sort.test.cpp +++ b/src/GNDStk/Node/test/sort.test.cpp @@ -23,8 +23,8 @@ R"***(covarianceSuite: compression: diagonal shape: 78,78 values: - pcdata: - text: 0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012 + #data: + #text: 0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012 parameters: parameterLink: href: $reactions#/reactionSuite/resonances/resolved/BreitWigner[@label='eval']/resonanceParameters/table diff --git a/src/GNDStk/Node/test/special.test.cpp b/src/GNDStk/Node/test/special.test.cpp index 86411c100..4e7abbf05 100644 --- a/src/GNDStk/Node/test/special.test.cpp +++ b/src/GNDStk/Node/test/special.test.cpp @@ -1,7 +1,10 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; + +#include "GNDStk/test/keys.hpp" +using namespace basic; SCENARIO("Testing certain special functions in GNDStk Node") { Tree t("n-008_O_016.xml"); @@ -14,8 +17,8 @@ SCENARIO("Testing certain special functions in GNDStk Node") { reactionSuite, documentations, documentation, - cdata, - text + CDATA, + TEXT ); CHECK(thedocs.size() == 46742); @@ -51,14 +54,14 @@ SCENARIO("Testing certain special functions in GNDStk Node") { CHECK(t(reactionSuite,documentations,documentation).doc() == thedocs); CHECK(c(reactionSuite,documentations,documentation).doc() == thedocs); - // works from the node... - CHECK(t(reactionSuite,documentations,documentation,cdata). + // works from the CDATA node... + CHECK(t(reactionSuite,documentations,documentation,CDATA). documentation() == thedocs); - CHECK(c(reactionSuite,documentations,documentation,cdata). + CHECK(c(reactionSuite,documentations,documentation,CDATA). documentation() == thedocs); - CHECK(t(reactionSuite,documentations,documentation,cdata). + CHECK(t(reactionSuite,documentations,documentation,CDATA). doc() == thedocs); - CHECK(c(reactionSuite,documentations,documentation,cdata). + CHECK(c(reactionSuite,documentations,documentation,CDATA). doc() == thedocs); // doesn't work from some other place... @@ -86,10 +89,10 @@ SCENARIO("Testing certain special functions in GNDStk Node") { } // ------------------------ - // pcdata() + // data() // ------------------------ - WHEN("Testing pcdata()") { + WHEN("Testing data()") { auto &valnode = t( reactionSuite, reactions, @@ -99,11 +102,11 @@ SCENARIO("Testing certain special functions in GNDStk Node") { ).one("values"); const auto &constvalnode = valnode; - const std::string vals = valnode(pcdata,text); + const std::string vals = valnode(DATA,TEXT); CHECK(vals.size() == 70254); - CHECK(valnode.pcdata() == vals); - CHECK(constvalnode.pcdata() == vals); + CHECK(valnode.data() == vals); + CHECK(constvalnode.data() == vals); } // ------------------------ diff --git a/src/GNDStk/Node/test/subscript.test.cpp b/src/GNDStk/Node/test/subscript.test.cpp index 2f968c0e2..ab713438c 100644 --- a/src/GNDStk/Node/test/subscript.test.cpp +++ b/src/GNDStk/Node/test/subscript.test.cpp @@ -1,7 +1,10 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; + +#include "GNDStk/test/keys.hpp" +using namespace basic; // ----------------------------------------------------------------------------- @@ -330,7 +333,7 @@ SCENARIO("Testing GNDStk Node operator[]") { // which of course leads to this sort of thing... CHECK(n.one("REACTIONSUITE").name == "REACTIONSUITE"); n[Child<>("REACTIONSUITE")].name = "reactionSuite"; - // try assigning the whole Node... + // try assigning the Node itself... n[reactionSuite] = c[reactionSuite]; } } diff --git a/src/GNDStk/Node/test/write.test.cpp b/src/GNDStk/Node/test/write.test.cpp index 032196f94..e7a339c3b 100644 --- a/src/GNDStk/Node/test/write.test.cpp +++ b/src/GNDStk/Node/test/write.test.cpp @@ -43,8 +43,8 @@ R"***(covarianceSuite: shape: 78,78 compression: diagonal values: - pcdata: - text: 0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012)***"; + #data: + #text: 0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012)***"; SCENARIO("Testing GNDStk Node write() and operator<<") { GIVEN("A top-level node from a tree object") { diff --git a/src/GNDStk/Support.hpp b/src/GNDStk/Support.hpp index e384b8bc1..bc3246c18 100644 --- a/src/GNDStk/Support.hpp +++ b/src/GNDStk/Support.hpp @@ -14,7 +14,6 @@ using UTF8Text = std::string; using XMLName = std::string; - // ----------------------------------------------------------------------------- // Fraction32 // ----------------------------------------------------------------------------- @@ -73,7 +72,6 @@ inline std::ostream &operator<<(std::ostream &os, const Fraction32 &obj) } - // ----------------------------------------------------------------------------- // IntegerTuple // ----------------------------------------------------------------------------- @@ -86,11 +84,6 @@ class IntegerTuple { // constructors // ------------------------ - // fixme - // The GNDS manual says that "any integer (0-9)" is allowed. If the 0-9 - // part is really correct, then I should probably throw an error, or at - // least print a warning) if a provided value is outside of that range. - IntegerTuple() { } @@ -116,7 +109,7 @@ class IntegerTuple { vec(vec) { } - template + template explicit IntegerTuple(const std::array &arr) : vec(arr.begin(), arr.end()) { } @@ -130,9 +123,9 @@ class IntegerTuple { // operator[] // we'll use at(), under-the-hood, so that out-of-range ==> exception - const int &operator[](const std::size_t i) const + const int &operator[](const size_t i) const { return vec.at(i); } - int &operator[](const std::size_t i) + int &operator[](const size_t i) { return vec.at(i); } // push @@ -179,7 +172,7 @@ inline std::istream &operator>>(std::istream &is, IntegerTuple &obj) // operator<< inline std::ostream &operator<<(std::ostream &os, const IntegerTuple &obj) { - std::size_t n = 0; + size_t n = 0; while (n < obj.size()) os << (n ? "," : "") << obj[n]; return os; diff --git a/src/GNDStk/Support/src/detail.hpp b/src/GNDStk/Support/src/detail.hpp index db43f50c9..5973171c7 100644 --- a/src/GNDStk/Support/src/detail.hpp +++ b/src/GNDStk/Support/src/detail.hpp @@ -1,12 +1,8 @@ -// fixme -// The "MapTypeString" and "MapStringType" terminology could probably be -// improved. For now this is detail material, so we won't worry about it. - namespace detail { // ----------------------------------------------------------------------------- -// MapTypeString +// Type2Names // ----------------------------------------------------------------------------- // ------------------------ @@ -14,12 +10,12 @@ namespace detail { // ------------------------ template -class MapTypeString { +class Type2Names { public: static inline const std::vector value = {""}; static bool find(const std::string &str) { - return std::find(value.begin(),value.end(),str) != value.end(); + return std::find(value.begin(), value.end(), str) != value.end(); } }; @@ -27,92 +23,91 @@ class MapTypeString { // For specific types // ------------------------ -#define makeMapTypeString(T,vec) \ +#define makeType2Names(T,vec) \ template<> \ - class MapTypeString { \ + class Type2Names { \ public: \ static inline const std::vector value = vec; \ static bool find(const std::string &str) \ { \ - return std::find(value.begin(),value.end(),str) != value.end(); \ + return std::find(value.begin(), value.end(), str) != value.end(); \ } \ } -makeMapTypeString(char, {"char"}); -makeMapTypeString(signed char, {"signed char"}); -makeMapTypeString(short, {"short"}); -makeMapTypeString(long, {"long"}); -makeMapTypeString(long long, {"long long"}); -makeMapTypeString(unsigned char, {"unsigned char"}); -makeMapTypeString(unsigned short, {"unsigned short"}); -makeMapTypeString(unsigned long, {"unsigned long"}); -makeMapTypeString(unsigned long long, {"unsigned long long"}); -makeMapTypeString(float, {"float"}); -makeMapTypeString(long double, {"long double"}); +makeType2Names(char, {"char"}); +makeType2Names(signed char, {"signed char"}); +makeType2Names(short, {"short"}); +makeType2Names(long, {"long"}); +makeType2Names(long long, {"long long"}); +makeType2Names(unsigned char, {"unsigned char"}); +makeType2Names(unsigned short, {"unsigned short"}); +makeType2Names(unsigned long, {"unsigned long"}); +makeType2Names(unsigned long long, {"unsigned long long"}); +makeType2Names(float, {"float"}); +makeType2Names(long double, {"long double"}); // COMMA idea: https://stackoverflow.com/questions/13842468 #define COMMA , -makeMapTypeString(std::string, +makeType2Names(std::string, {"UTF8Text" COMMA "string" COMMA "std::string"}); -makeMapTypeString(int, +makeType2Names(int, {"Integer32" COMMA "int"}); -makeMapTypeString(unsigned int, +makeType2Names(unsigned, {"UInteger32" COMMA "unsigned" COMMA "unsigned int"}); -makeMapTypeString(double, +makeType2Names(double, {"Float64" COMMA "double"}); #undef COMMA -#undef makeMapTypeString +#undef makeType2Names // ------------------------ // Based on variant visit // ------------------------ template -std::string visitMapTypeString(const VARIANT &variant) +std::string visitType2Names(const VARIANT &variant) { return std::visit( [](auto &&vec) { - return MapTypeString>::value[0]; + return Type2Names>::value[0]; }, variant ); } - // ----------------------------------------------------------------------------- -// MapStringType +// Names2Type // ----------------------------------------------------------------------------- template -void MapStringType(const std::string &str, const CALLBACK &call) +void Names2Type(const std::string &str, const CALLBACK &call) { // U helps when type T has spaces (e.g. T is long double) -#define makeMapStringType(T) \ - else if (MapTypeString::find(str)) { using U = T; call(U{}); } +#define makeNames2Type(T) \ + else if (Type2Names::find(str)) { using U = T; call(U{}); } if (false) { } // so macro's "else" always works - makeMapStringType(std::string) - makeMapStringType(char) - makeMapStringType(signed char) - makeMapStringType(short) - makeMapStringType(int) - makeMapStringType(long) - makeMapStringType(long long) - makeMapStringType(unsigned char) - makeMapStringType(unsigned short) - makeMapStringType(unsigned int) - makeMapStringType(unsigned long) - makeMapStringType(unsigned long long) - makeMapStringType(float) - makeMapStringType(double) - makeMapStringType(long double) + makeNames2Type(std::string) + makeNames2Type(char) + makeNames2Type(signed char) + makeNames2Type(short) + makeNames2Type(int) + makeNames2Type(long) + makeNames2Type(long long) + makeNames2Type(unsigned char) + makeNames2Type(unsigned short) + makeNames2Type(unsigned) + makeNames2Type(unsigned long) + makeNames2Type(unsigned long long) + makeNames2Type(float) + makeNames2Type(double) + makeNames2Type(long double) else call(std::string{}); -#undef makeMapStringType +#undef makeNames2Type } } // namespace detail diff --git a/src/GNDStk/Tree.hpp b/src/GNDStk/Tree.hpp index d675c8e1b..39b669ddb 100644 --- a/src/GNDStk/Tree.hpp +++ b/src/GNDStk/Tree.hpp @@ -35,23 +35,14 @@ class Tree : public Node { #include "GNDStk/Tree/src/ctor.hpp" #include "GNDStk/Tree/src/assign.hpp" - #include "GNDStk/Tree/src/read.hpp" - #include "GNDStk/Tree/src/write.hpp" - - // No-argument operator() returns the top-level Node. This overrides - // the base Node class' no-argument operator(), which returns itself. - const Node &operator()() const { return top(); } - Node &operator()() { return top(); } - using Node::operator(); // or the above would disappear Node's goodies - // ------------------------ // Comparison // ------------------------ // We pull out top() first, rather than deferring immediately to Node's // operator==, because Tree can contain a "declaration node" that might - // indicate properties such as whether the data came from an XML file or - // a JSON file. Those properties can be put to good use for other things, + // indicate properties such as whether the data came from an XML, JSON, + // or HDF5 file. Those properties can be put to good use for other things, // but won't play a role in a Tree comparison. // operator== @@ -77,45 +68,3 @@ class Tree : public Node { } }; // class Tree - - - -// ----------------------------------------------------------------------------- -// I/O -// ----------------------------------------------------------------------------- - -// operator>> -inline std::istream &operator>>(std::istream &is, Tree &tree) -{ - try { - return tree.read(is); - } catch (...) { - log::function("istream >> Tree"); - throw; - } -} - -// Tree << std::string -// Note that this is an INPUT operator to Tree! -// Other comments as for Node << std::string -inline void operator<<(Tree &tree, const std::string &str) -{ - try { - std::istringstream iss(str); - iss >> tree; - } catch (...) { - log::function("Tree << string"); - throw; - } -} - -// operator<< -inline std::ostream &operator<<(std::ostream &os, const Tree &tree) -{ - try { - return tree.write(os); - } catch (...) { - log::function("ostream << Tree"); - throw; - } -} diff --git a/src/GNDStk/Tree/src/ctor.hpp b/src/GNDStk/Tree/src/ctor.hpp index 2bbdfcfb2..78b5284a4 100644 --- a/src/GNDStk/Tree/src/ctor.hpp +++ b/src/GNDStk/Tree/src/ctor.hpp @@ -4,13 +4,15 @@ // ----------------------------------------------------------------------------- // default -Tree() = default; +Tree() : Node("/") +{ +} // move Tree(Tree &&) = default; // copy -Tree(const Tree &other) : Node{} +Tree(const Tree &other) : Node("/") { try { if (!convert(other,*this)) @@ -24,11 +26,11 @@ Tree(const Tree &other) : Node{} // ----------------------------------------------------------------------------- -// From XML and JSON objects +// From XML, JSON, and HDF5 objects // ----------------------------------------------------------------------------- -// XML -explicit Tree(const XML &x) +// From XML +explicit Tree(const XML &x) : Node("/") { try { if (!convert(x,*this)) @@ -39,8 +41,9 @@ explicit Tree(const XML &x) } } -// JSON -explicit Tree(const JSON &j) +// From JSON +#ifndef NJOY_GNDSTK_DISABLE_JSON +explicit Tree(const JSON &j) : Node("/") { try { if (!convert(j,*this)) @@ -50,6 +53,21 @@ explicit Tree(const JSON &j) throw; } } +#endif + +// From HDF5 +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +explicit Tree(const HDF5 &h) : Node("/") +{ + try { + if (!convert(h,*this)) + throw std::exception{}; + } catch (...) { + log::ctor("Tree(HDF5)"); + throw; + } +} +#endif @@ -58,32 +76,36 @@ explicit Tree(const JSON &j) // Compare with our Tree read() functions // ----------------------------------------------------------------------------- -// file name, FileType +// file, FileType // Example: // Tree t("n-008_O_016.xml", FileType::xml); explicit Tree( const std::string &filename, - const FileType format = FileType::null -) { + const FileType format = FileType::guess +) + : Node("/") +{ try { if (!read(filename,format)) throw std::exception{}; } catch (...) { - log::ctor("Tree(\"{}\")", filename); + log::ctor("Tree(\"{}\",format=\"{}\")", + filename, detail::printFormat(format)); throw; } } -// file name, string +// file, string // Example: // Tree t("n-008_O_016.xml", "xml"); Tree(const std::string &filename, const std::string &format) + : Node("/") { try { if (!read(filename,format)) throw std::exception{}; } catch (...) { - log::ctor("Tree(\"{}\",type=\"{}\")", filename, format); + log::ctor("Tree(\"{}\",format=\"{}\")", filename, format); throw; } } @@ -92,13 +114,14 @@ Tree(const std::string &filename, const std::string &format) // Example: // std::ifstream ifs("n-008_O_016.xml"); // Tree t(ifs, FileType::xml); -explicit Tree(std::istream &is, const FileType format = FileType::null) +explicit Tree(std::istream &is, const FileType format = FileType::guess) + : Node("/") { try { if (!read(is,format)) throw std::exception{}; } catch (...) { - log::ctor("Tree(istream,string)"); + log::ctor("Tree(istream,format=\"{}\")", detail::printFormat(format)); throw; } } @@ -108,12 +131,13 @@ explicit Tree(std::istream &is, const FileType format = FileType::null) // std::ifstream ifs("n-008_O_016.xml"); // Tree t(ifs, "xml"); Tree(std::istream &is, const std::string &format) + : Node("/") { try { if (!read(is,format)) throw std::exception{}; } catch (...) { - log::ctor("Tree(istream,format)", format); + log::ctor("Tree(istream,format=\"{}\")", format); throw; } } @@ -132,7 +156,7 @@ Tree(std::istream &is, const std::string &format) // or // Tree newtree(reactionSuite, "xml", "1.0", "UTF-8"); // -// Note that the first argument is NOT quoted (""). It isn't the name of the +// Note that the first argument is NOT in quotes. It isn't the name of the // top-level node that we want; rather, it's one of our Child "query objects." // These encode lots of information in them, including the quoted name that // we'd otherwise have expected above, and, importantly, a boolean value that @@ -152,7 +176,9 @@ Tree( // the names "version" and "encoding" make sense for XML at least... const std::string &version = detail::default_string, const std::string &encoding = detail::default_string -) { +) + : Node("/") +{ try { reset(kwd, format, version, encoding); } catch (...) { @@ -168,7 +194,9 @@ Tree( const std::string &format, const std::string &version = detail::default_string, const std::string &encoding = detail::default_string -) { +) + : Node("/") +{ try { reset(kwd, format, version, encoding); } catch (...) { diff --git a/src/GNDStk/Tree/src/decl.hpp b/src/GNDStk/Tree/src/decl.hpp index 793fab563..c1ac60083 100644 --- a/src/GNDStk/Tree/src/decl.hpp +++ b/src/GNDStk/Tree/src/decl.hpp @@ -11,8 +11,10 @@ const Node &decl() const log::error("Tree has no declaration node"); throw std::exception{}; } - for (auto &c : this->children) - if (c->name == "xml" || c->name == "json" || c->name == "hdf5") + for (const childPtr &c : children) + if (c->name == special::xml || + c->name == special::json || + c->name == special::hdf5) return *c; log::error("Tree's declaration node not found"); throw std::exception{}; diff --git a/src/GNDStk/Tree/src/has_decl.hpp b/src/GNDStk/Tree/src/has_decl.hpp index 2bd6aa6d8..73ea3dd76 100644 --- a/src/GNDStk/Tree/src/has_decl.hpp +++ b/src/GNDStk/Tree/src/has_decl.hpp @@ -3,9 +3,11 @@ bool has_decl() const { // Does the tree have something that looks like a declaration node? - int count = 0; - for (auto &c : this->children) - if (c->name == "xml" || c->name == "json" || c->name == "hdf5") + size_t count = 0; + for (const childPtr &c : children) + if (c->name == special::xml || + c->name == special::json || + c->name == special::hdf5) count++; // Ill-formed if there's more than one such node @@ -19,11 +21,11 @@ bool has_decl() const } // Ill-formed if there's more than one of something else - if (this->children.size()-count > 1) { + if (children.size()-count > 1) { log::error( "Tree does not appear to be well-formed. It has {} (more than one)\n" "node that looks like a GNDS top-level node", - this->children.size()-count + children.size()-count ); throw std::exception{}; } diff --git a/src/GNDStk/Tree/src/has_top.hpp b/src/GNDStk/Tree/src/has_top.hpp index 80c82d6eb..c86f92c1d 100644 --- a/src/GNDStk/Tree/src/has_top.hpp +++ b/src/GNDStk/Tree/src/has_top.hpp @@ -8,9 +8,11 @@ bool has_top() const // Does the tree have something that looks like a top-level GNDS node, // defined as something that *doesn't* look like a declaration node? - int count = 0; - for (auto &c : this->children) - if (c->name != "xml" && c->name != "json" && c->name != "hdf5") + size_t count = 0; + for (const childPtr &c : children) + if (c->name != special::xml && + c->name != special::json && + c->name != special::hdf5) count++; // Ill-formed if there's more than one such node @@ -24,11 +26,11 @@ bool has_top() const } // Ill-formed if there's more than one of something else - if (this->children.size()-count > 1) { + if (children.size()-count > 1) { log::error( "Tree does not appear to be well-formed. It has {} (more than one)\n" "node that looks like a declaration node", - this->children.size()-count + children.size()-count ); throw std::exception{}; } diff --git a/src/GNDStk/Tree/src/read.hpp b/src/GNDStk/Tree/src/read.hpp deleted file mode 100644 index 737249f8a..000000000 --- a/src/GNDStk/Tree/src/read.hpp +++ /dev/null @@ -1,58 +0,0 @@ - -// ----------------------------------------------------------------------------- -// Tree.read() -// Cases are as for Node.read(), to which these defer with decl == true, -// meaning that, for Tree, we preserve any declaration node. -// ----------------------------------------------------------------------------- - -// 1. read(istream, FileType) -std::istream &read( - std::istream &is, - const FileType format = FileType::null -) { - try { - return this->Node::read(is, format, true); - } catch (...) { - log::member("Tree.read(istream)"); - throw; - } -} - -// 2. read(file name, FileType) -bool read( - const std::string &filename, - const FileType format = FileType::null -) { - try { - return this->Node::read(filename, format, true); - } catch (...) { - log::member("Tree.read(\"{}\")", filename); - throw; - } -} - -// 3. read(istream, string) -std::istream &read( - std::istream &is, - const std::string &format -) { - try { - return this->Node::read(is, format, true); - } catch (...) { - log::member("Tree.read(istream,\"{}\")", format); - throw; - } -} - -// 4. read(file name, string) -bool read( - const std::string &filename, - const std::string &format -) { - try { - return this->Node::read(filename, format, true); - } catch (...) { - log::member("Tree.read(\"{}\",\"{}\")", filename, format); - throw; - } -} diff --git a/src/GNDStk/Tree/src/reset.hpp b/src/GNDStk/Tree/src/reset.hpp index a5f56f3ea..595deb628 100644 --- a/src/GNDStk/Tree/src/reset.hpp +++ b/src/GNDStk/Tree/src/reset.hpp @@ -32,43 +32,30 @@ Tree &reset( // Begin a new tree clear(); - // Warn if the given Child doesn't look valid for a top-level GNDS node - if (!kwd.top()) { - log::warning( - "Tree.reset(" + detail::keyname(kwd) + ") called, " - "but the Node as given by the\n" - "Child object is not encoded as being suitable for a top-level\n" - "GNDS node (bool Child.top() is false)" - ); - } - try { - // Declaration node: "xml", etc. + // Declaration node: special::xml, etc. // This can specify an eventual intended file format // for the GNDS hierarchy. - if (format == FileType::xml - || format == FileType::null - || format == FileType::text + if (format == FileType::xml || + format == FileType::guess || + format == FileType::debug ) { - // xml, null, tree - add("xml"); + // xml, guess, tree + add(special::xml); decl().add("version", detail::sent(version ) ? version : "1.0" ); decl().add("encoding", detail::sent(encoding) ? encoding : "UTF-8"); } else if (format == FileType::json) { // json - add("json"); - // any use for version and encoding? + add(special::json); } else if (format == FileType::hdf5) { // hdf5 - add("hdf5"); - // any use for version and encoding? + add(special::hdf5); } else { log::error( - "Internal error in Tree.reset(" + detail::keyname(kwd) - + ",format,...):\n" - "Unrecognized file format; apparently, we missed something. " - "Please report this to us" - ); + "Internal error in Tree.reset(" + detail::keyname(kwd) + + ", format, ...):\n" + "Unrecognized file format; apparently, we missed something.\n" + "Please report this to us."); throw std::exception{}; } @@ -96,12 +83,10 @@ Tree &reset( const std::string &encoding = detail::default_string ) { try { - // recognized file formats - if (eq_null(format)) return reset(kwd, FileType::null, version, encoding); - if (eq_text(format)) return reset(kwd, FileType::text, version, encoding); - if (eq_xml (format)) return reset(kwd, FileType::xml, version, encoding); - if (eq_json(format)) return reset(kwd, FileType::json, version, encoding); - if (eq_hdf5(format)) return reset(kwd, FileType::hdf5, version, encoding); + bool matched; + const FileType type = string2filetype(format,matched); + if (matched) + return reset(kwd, type, version, encoding); // fallback: use XML // Note: we should consider making this an error diff --git a/src/GNDStk/Tree/src/top.hpp b/src/GNDStk/Tree/src/top.hpp index a6ad51904..4209887ce 100644 --- a/src/GNDStk/Tree/src/top.hpp +++ b/src/GNDStk/Tree/src/top.hpp @@ -11,8 +11,10 @@ const Node &top() const log::error("Tree has no top-level GNDS node"); throw std::exception{}; } - for (auto &c : this->children) - if (c->name != "xml" && c->name != "json" && c->name != "hdf5") + for (const childPtr &c : children) + if (c->name != special::xml && + c->name != special::json && + c->name != special::hdf5) return *c; log::error("Tree's top-level GNDS node not found"); throw std::exception{}; diff --git a/src/GNDStk/Tree/src/write.hpp b/src/GNDStk/Tree/src/write.hpp deleted file mode 100644 index a75f407a3..000000000 --- a/src/GNDStk/Tree/src/write.hpp +++ /dev/null @@ -1,61 +0,0 @@ - -// ----------------------------------------------------------------------------- -// Tree.write() -// Forward to Node.write(), with decl == true. -// ----------------------------------------------------------------------------- - -// 1. write(ostream, FileType) -std::ostream &write( - std::ostream &os = std::cout, - const FileType format = FileType::null, - const bool decl = true -) const { - try { - return this->Node::write(os, format, decl); - } catch (...) { - log::member("Tree.write(ostream)"); - throw; - } -} - -// 2. write(file name, FileType) -bool write( - const std::string &filename, - const FileType format = FileType::null, - const bool decl = true -) const { - try { - return this->Node::write(filename, format, decl); - } catch (...) { - log::member("Tree.write(\"{}\")", filename); - throw; - } -} - -// 3. write(ostream, string) -std::ostream &write( - std::ostream &os, - const std::string &format, - const bool decl = true -) const { - try { - return this->Node::write(os, format, decl); - } catch (...) { - log::member("Tree.write(ostream,\"{}\")", format); - throw; - } -} - -// 4. write(file name, string) -bool write( - const std::string &filename, - const std::string &format, - const bool decl = true -) const { - try { - return this->Node::write(filename, format, decl); - } catch (...) { - log::member("Tree.write(\"{}\",\"{}\")", filename, format); - throw; - } -} diff --git a/src/GNDStk/Tree/test/CMakeLists.txt b/src/GNDStk/Tree/test/CMakeLists.txt index c8e6a7751..302b7dd4c 100644 --- a/src/GNDStk/Tree/test/CMakeLists.txt +++ b/src/GNDStk/Tree/test/CMakeLists.txt @@ -1,21 +1,24 @@ -add_executable( GNDStk.Tree.test - special.test.cpp - clear.test.cpp - child.test.cpp - decl.test.cpp - meta.test.cpp - assign.test.cpp - read.test.cpp - many.test.cpp - empty.test.cpp - reset.test.cpp - top.test.cpp - Tree.test.cpp - one.test.cpp - call.test.cpp - ctor.test.cpp - write.test.cpp ) +add_executable( + GNDStk.Tree.test + special.test.cpp + clear.test.cpp + child.test.cpp + decl.test.cpp + meta.test.cpp + assign.test.cpp + read.test.cpp + many.test.cpp + empty.test.cpp + reset.test.cpp + top.test.cpp + Tree.test.cpp + one.test.cpp + call.test.cpp + ctor.test.cpp + write.test.cpp +) + target_compile_options( GNDStk.Tree.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} @@ -26,9 +29,9 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.Tree.test PUBLIC GNDStk ) +target_link_libraries( GNDStk.Tree.test PUBLIC GNDStk ) file( GLOB resources "resources/*" ) foreach( resource ${resources}) file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) endforeach() -add_test( NAME GNDStk.Tree COMMAND GNDStk.Tree.test ) \ No newline at end of file +add_test( NAME GNDStk.Tree COMMAND GNDStk.Tree.test ) diff --git a/src/GNDStk/Tree/test/call.test.cpp b/src/GNDStk/Tree/test/call.test.cpp index 3a20df864..160713b40 100644 --- a/src/GNDStk/Tree/test/call.test.cpp +++ b/src/GNDStk/Tree/test/call.test.cpp @@ -1,8 +1,9 @@ #include "catch.hpp" #include "GNDStk.hpp" - using namespace njoy::GNDStk; + +#include "GNDStk/test/keys.hpp" using namespace misc; @@ -14,28 +15,26 @@ using namespace misc; // xml_t // ------------------------ -class xml_t { -public: +struct xml_t { double version; std::string encoding; }; template -inline void convert(const NODE &node, xml_t &out) +void convert(const NODE &node, xml_t &out) { out.version = std::stod(node.meta(version)); out.encoding = node.meta(encoding); } -inline const Child xml("xml"); +inline const Child xml(special::xml); // ------------------------ // reactionSuite_t // ------------------------ -class reactionSuite_t { -public: +struct reactionSuite_t { std::string projectile; std::string target; std::string evaluation; @@ -44,7 +43,7 @@ class reactionSuite_t { }; template -inline void convert(const NODE &node, reactionSuite_t &out) +void convert(const NODE &node, reactionSuite_t &out) { out.projectile = node.meta(projectile); out.target = node.meta(target); diff --git a/src/GNDStk/Tree/test/child.test.cpp b/src/GNDStk/Tree/test/child.test.cpp index 2dbefb630..9de8a4773 100644 --- a/src/GNDStk/Tree/test/child.test.cpp +++ b/src/GNDStk/Tree/test/child.test.cpp @@ -1,8 +1,9 @@ #include "catch.hpp" #include "GNDStk.hpp" - using namespace njoy::GNDStk; + +#include "GNDStk/test/keys.hpp" using namespace misc; @@ -18,8 +19,7 @@ using namespace misc; // type: xml_t // Basically, users can write custom types like this. -class xml_t { -public: +struct xml_t { double version; std::string encoding; }; @@ -28,7 +28,7 @@ class xml_t { // Given that Node is templated, it's easiest to write functions // like this by using template as I do here... template -inline void convert(const NODE &node, xml_t &out) +void convert(const NODE &node, xml_t &out) { out.version = std::stod(node.meta(version)); out.encoding = node.meta(encoding); @@ -36,9 +36,9 @@ inline void convert(const NODE &node, xml_t &out) // keyword: my_xml_keyword // Users can write custom Child objects like this, and then use them in -// child() functions. Here, "xml" is what the keyword uses to look up nodes -// that can be converted to xml_t objects via the above convert(). -inline const Child my_xml_keyword("xml"); +// child() functions. Here, special::xml is what the keyword uses to look +// up nodes that can be converted to xml_t objects via the above convert(). +inline const Child my_xml_keyword(special::xml); @@ -51,8 +51,7 @@ inline const Child my_xml_keyword("xml"); // Basically made-up here, just for the sake of creating an example. In real // life, this sort of type might be designed to hold whatever data (perhaps // absolutely everything) from an entire covarianceSuite node. -class covarianceSuite_type_1 { -public: +struct covarianceSuite_type_1 { // just to illustrate that we can write whatever we want into these types int foo; int bar; @@ -60,8 +59,7 @@ class covarianceSuite_type_1 { // type: covarianceSuite_type_2 // A bit more meaningful that the above goofy covarianceSuite type -class covarianceSuite_type_2 { -public: +struct covarianceSuite_type_2 { // more realistic, though we'd also probably want to extract more than // just the covarianceSuite node's *metadata* std::string projectile; @@ -72,7 +70,7 @@ class covarianceSuite_type_2 { // From a Node, build a covarianceSuite_type_1 template -inline void convert(const NODE &, covarianceSuite_type_1 &out) +void convert(const NODE &, covarianceSuite_type_1 &out) { // some random nonsense, just for illustration out.foo = 123; @@ -81,7 +79,7 @@ inline void convert(const NODE &, covarianceSuite_type_1 &out) // From a Node, build a covarianceSuite_type_2 template -inline void convert(const NODE &node, covarianceSuite_type_2 &out) +void convert(const NODE &node, covarianceSuite_type_2 &out) { // Here, let's take advantage of GNDStk's projectile, target, evaluation, // and format Meta objects - which return, respectively, string, string, diff --git a/src/GNDStk/Tree/test/ctor.test.cpp b/src/GNDStk/Tree/test/ctor.test.cpp index d045c84d3..74a578976 100644 --- a/src/GNDStk/Tree/test/ctor.test.cpp +++ b/src/GNDStk/Tree/test/ctor.test.cpp @@ -1,6 +1,7 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "GNDStk/test/keys.hpp" using namespace njoy::GNDStk; /* @@ -64,6 +65,7 @@ SCENARIO("Testing GNDStk tree constructors") { } // 4. Tree(JSON) +#ifndef NJOY_GNDSTK_DISABLE_JSON GIVEN("A JSON object, read from a JSON file") { const JSON j("n-069_Tm_170-covar.json"); @@ -75,6 +77,7 @@ SCENARIO("Testing GNDStk tree constructors") { CHECK(oss1.str() == oss2.str()); } } +#endif // 5. Tree(string) // 6. Tree(istream) @@ -125,7 +128,7 @@ SCENARIO("Testing GNDStk tree constructors") { WHEN("We call: Tree(top-level node)") { Tree t(reactionSuite); THEN("We can make various decl() and top() queries") { - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "1.0"); CHECK(t.decl().meta("encoding") == "UTF-8"); @@ -139,7 +142,7 @@ SCENARIO("Testing GNDStk tree constructors") { WHEN("We call: Tree(top-level node, file format)") { Tree t(reactionSuite, FileType::json); THEN("We can make various decl() and top() queries") { - CHECK(t.decl().name == "json"); + CHECK(t.decl().name == special::json); CHECK(t.decl().metadata.size() == 0); CHECK(t.decl().children.size() == 0); CHECK(t.top().name == "reactionSuite"); @@ -149,9 +152,9 @@ SCENARIO("Testing GNDStk tree constructors") { } WHEN("We call: Tree(top-level node, file format, version)") { - Tree t(covarianceSuite, FileType::null, "2.0"); + Tree t(covarianceSuite, FileType::guess, "2.0"); THEN("We can make various decl() and top() queries") { - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "2.0"); CHECK(t.decl().meta("encoding") == "UTF-8"); @@ -165,7 +168,7 @@ SCENARIO("Testing GNDStk tree constructors") { WHEN("We call: Tree(top-level node, file format, version, encoding)") { Tree t(covarianceSuite, FileType::xml, "3.0", "UTF-9"); THEN("We can make various decl() and top() queries") { - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "3.0"); CHECK(t.decl().meta("encoding") == "UTF-9"); @@ -179,7 +182,7 @@ SCENARIO("Testing GNDStk tree constructors") { WHEN("We call: Tree(top-level node, string)") { Tree t(PoPs, "hdf5"); THEN("We can make various decl() and top() queries") { - CHECK(t.decl().name == "hdf5"); + CHECK(t.decl().name == special::hdf5); CHECK(t.decl().metadata.size() == 0); CHECK(t.decl().children.size() == 0); CHECK(t.top().name == "PoPs"); @@ -189,9 +192,9 @@ SCENARIO("Testing GNDStk tree constructors") { } WHEN("We call: Tree(top-level node, string, version)") { - Tree t(PoPs, "text", "4.0"); + Tree t(PoPs, "debug", "4.0"); THEN("We can make various decl() and top() queries") { - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "4.0"); CHECK(t.decl().meta("encoding") == "UTF-8"); @@ -205,7 +208,7 @@ SCENARIO("Testing GNDStk tree constructors") { WHEN("We call: Tree(top-level node, string, version, encoding)") { Tree t(thermalScattering, "xml", "5.0", "UTF-10"); THEN("We can make various decl() and top() queries") { - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "5.0"); CHECK(t.decl().meta("encoding") == "UTF-10"); diff --git a/src/GNDStk/Tree/test/decl.test.cpp b/src/GNDStk/Tree/test/decl.test.cpp index eabd61fdf..9a58ef580 100644 --- a/src/GNDStk/Tree/test/decl.test.cpp +++ b/src/GNDStk/Tree/test/decl.test.cpp @@ -1,6 +1,7 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "GNDStk/test/keys.hpp" SCENARIO("Testing GNDStk tree decl()") { using namespace njoy::GNDStk; @@ -9,7 +10,7 @@ SCENARIO("Testing GNDStk tree decl()") { GIVEN("A tree read from an XML file") { Tree t("n-069_Tm_170-covar.xml"); - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "1.0"); CHECK(t.decl().meta("encoding") == "UTF-8"); @@ -21,7 +22,7 @@ SCENARIO("Testing GNDStk tree decl()") { WHEN("We call reset(reactionSuite)") { Tree t; t.reset(reactionSuite); - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "1.0"); CHECK(t.decl().meta("encoding") == "UTF-8"); @@ -31,25 +32,26 @@ SCENARIO("Testing GNDStk tree decl()") { WHEN("We call reset(reactionSuite, FileType::json)") { Tree t; t.reset(reactionSuite, FileType::json); - CHECK(t.decl().name == "json"); + CHECK(t.decl().name == special::json); CHECK(t.decl().metadata.size() == 0); CHECK(t.decl().children.size() == 0); } - WHEN("We call reset(covarianceSuite, FileType::null, \"2.0\")") { + WHEN("We call reset(covarianceSuite, FileType::guess, \"2.0\")") { Tree t; - t.reset(covarianceSuite, FileType::null, "2.0"); - CHECK(t.decl().name == "xml"); + t.reset(covarianceSuite, FileType::guess, "2.0"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "2.0"); CHECK(t.decl().meta("encoding") == "UTF-8"); CHECK(t.decl().children.size() == 0); } - WHEN("We call reset(covarianceSuite, FileType::xml, \"3.0\", \"UTF-9\")") { + WHEN("We call reset(covarianceSuite, FileType::xml, " + "\"3.0\", \"UTF-9\")") { Tree t; t.reset(covarianceSuite, FileType::xml, "3.0", "UTF-9"); - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "3.0"); CHECK(t.decl().meta("encoding") == "UTF-9"); @@ -59,16 +61,16 @@ SCENARIO("Testing GNDStk tree decl()") { WHEN("We call reset(PoPs, \"hdf5\")") { Tree t; t.reset(PoPs, "hdf5"); - CHECK(t.decl().name == "hdf5"); + CHECK(t.decl().name == special::hdf5); CHECK(t.decl().metadata.size() == 0); CHECK(t.decl().children.size() == 0); } - WHEN("We call reset(PoPs, \"tree\", \"4.0\")") { + WHEN("We call reset(PoPs, \"debug\", \"4.0\")") { Tree t; - t.reset(PoPs, "text", "4.0"); - CHECK(t.decl().name == "xml"); + t.reset(PoPs, "debug", "4.0"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "4.0"); CHECK(t.decl().meta("encoding") == "UTF-8"); @@ -78,7 +80,7 @@ SCENARIO("Testing GNDStk tree decl()") { WHEN("We call reset(thermalScattering, \"xml\", \"5.0\", \"UTF-10\")") { Tree t; t.reset(thermalScattering, "xml", "5.0", "UTF-10"); - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "5.0"); CHECK(t.decl().meta("encoding") == "UTF-10"); diff --git a/src/GNDStk/Tree/test/many.test.cpp b/src/GNDStk/Tree/test/many.test.cpp index 6bf0f81a9..03003298b 100644 --- a/src/GNDStk/Tree/test/many.test.cpp +++ b/src/GNDStk/Tree/test/many.test.cpp @@ -18,23 +18,23 @@ SCENARIO("Testing GNDStk Tree many()") { // the top-level GNDS node (or both if they have the same name, which // really wouldn't be a correct state of affairs). - WHEN("We look for all \"xml\" nodes") { + WHEN("We look for all \"#xml\" nodes") { // Declaration node... // const found = false; - auto cnode = c.many("xml",found); + auto cnode = c.many(special::xml,found); CHECK(found); CHECK(cnode.size() == 1); - CHECK(cnode[0].name == "xml"); + CHECK(cnode[0].name == special::xml); CHECK(cnode[0].meta("version") == "1.0"); // non-const found = false; - auto tnode = t.many("xml",found); + auto tnode = t.many(special::xml,found); CHECK(found); CHECK(tnode.size() == 1); - CHECK(tnode[0].name == "xml"); + CHECK(tnode[0].name == special::xml); CHECK(tnode[0].meta("encoding") == "UTF-8"); } diff --git a/src/GNDStk/Tree/test/meta.test.cpp b/src/GNDStk/Tree/test/meta.test.cpp index 2cae9ebec..43f330ffe 100644 --- a/src/GNDStk/Tree/test/meta.test.cpp +++ b/src/GNDStk/Tree/test/meta.test.cpp @@ -1,8 +1,9 @@ #include "catch.hpp" #include "GNDStk.hpp" - using namespace njoy::GNDStk; + +#include "GNDStk/test/keys.hpp" using namespace misc; SCENARIO("Testing GNDStk Tree meta()") { @@ -186,8 +187,8 @@ SCENARIO("Testing GNDStk Tree meta()") { CHECK(t.top() .meta("projectile") == "abc"); // verify that it changed WHEN("We try assignment: Tree.meta(keyword) = ...") { - // assignments "work" (don't cause a crash) for nonexistent metadata - // keys, but give back found == false + // assignments "work" (don't cause a crash) for nonexistent metadata, + // but give back found == false CHECK((found = true, t.meta("foo key",found) = "foo value", !found)); CHECK((found = true, t.meta("bar key",found) = "bar value", !found)); } diff --git a/src/GNDStk/Tree/test/one.test.cpp b/src/GNDStk/Tree/test/one.test.cpp index 1442ae639..9916c5792 100644 --- a/src/GNDStk/Tree/test/one.test.cpp +++ b/src/GNDStk/Tree/test/one.test.cpp @@ -18,21 +18,21 @@ SCENARIO("Testing GNDStk Tree one()") { // node, or the top-level GNDS node; we consider both of those to be // a Tree's children. - WHEN("We look for an \"xml\" node") { + WHEN("We look for an \"#xml\" node") { // Declaration node... // const found = false; - auto &cnode = c.one("xml",found); + auto &cnode = c.one(special::xml,found); CHECK(found); - CHECK(cnode.name == "xml"); + CHECK(cnode.name == special::xml); CHECK(cnode.meta("version") == "1.0"); // non-const found = false; - auto &tnode = t.one("xml",found); + auto &tnode = t.one(special::xml,found); CHECK(found); - CHECK(tnode.name == "xml"); + CHECK(tnode.name == special::xml); CHECK(tnode.meta("encoding") == "UTF-8"); } @@ -70,12 +70,12 @@ SCENARIO("Testing GNDStk Tree one()") { // Illustrate that Tree's one(string) functions return references, // even when the child isn't found... - (void)&c.one("xml"); + (void)&c.one(special::xml); (void)&c.one("covarianceSuite"); (void)&c.one("foo",found); CHECK(!found); - (void)&t.one("xml"); + (void)&t.one(special::xml); (void)&t.one("covarianceSuite"); (void)&t.one("bar",found); CHECK(!found); diff --git a/src/GNDStk/Tree/test/read.test.cpp b/src/GNDStk/Tree/test/read.test.cpp index 876bf38be..38f11253b 100644 --- a/src/GNDStk/Tree/test/read.test.cpp +++ b/src/GNDStk/Tree/test/read.test.cpp @@ -1,6 +1,7 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "GNDStk/test/keys.hpp" using namespace njoy::GNDStk; @@ -9,7 +10,7 @@ using namespace njoy::GNDStk; // ----------------------------------------------------------------------------- static const std::string correct_tree = -R"***(: +R"***( covarianceSuite: evaluation: ENDF/B-8.0 format: 1.9 @@ -29,8 +30,8 @@ R"***(: compression: diagonal shape: 78,78 values: - pcdata: - text: 0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012 + #data: + #text: 0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012 parameters: parameterLink: href: $reactions#/reactionSuite/resonances/resolved/BreitWigner[@label='eval']/resonanceParameters/table @@ -53,14 +54,14 @@ R"***(: value: 0.0)***"; static const std::string decl_xml = -R"***( - xml: +R"***(/: + #xml: encoding: UTF-8 version: 1.0)***"; static const std::string decl_json = -R"***( - json:)***"; +R"***(/: + #json:)***"; void compare(Tree &t, const std::string &correct) { @@ -86,13 +87,13 @@ SCENARIO("Testing GNDStk tree read() and operator>>") { WHEN("We read() one from an xml file") { const std::string filename = "n-069_Tm_170-covar.xml"; t1.read(filename); - compare(t1,correct_tree+decl_xml); + compare(t1, decl_xml + correct_tree); } WHEN("We read() one from an xml istream, specifically an ifstream") { std::ifstream ifs("n-069_Tm_170-covar.xml"); t2.read(ifs); - compare(t2,correct_tree+decl_xml); + compare(t2, decl_xml + correct_tree); } WHEN("We read() one from an xml istream, specifically a stringstream") { @@ -100,29 +101,30 @@ SCENARIO("Testing GNDStk tree read() and operator>>") { std::stringstream sstr; sstr << ifs.rdbuf(); t3.read(sstr); - compare(t3,correct_tree+decl_xml); + compare(t3, decl_xml + correct_tree); } WHEN("We stream-input one, specifically from an xml ifstream") { std::ifstream ifs("n-069_Tm_170-covar.xml"); ifs >> t4; - compare(t4,correct_tree+decl_xml); + compare(t4, decl_xml + correct_tree); } // ------------------------ // JSON // ------------------------ +#ifndef NJOY_GNDSTK_DISABLE_JSON WHEN("We read() one from a json file") { const std::string filename = "n-069_Tm_170-covar.json"; t1.read(filename); - compare(t1,correct_tree+decl_json); + compare(t1, decl_json + correct_tree); } WHEN("We read() one from a json istream, specifically an ifstream") { std::ifstream ifs("n-069_Tm_170-covar.json"); t2.read(ifs); - compare(t2,correct_tree+decl_json); + compare(t2, decl_json + correct_tree); } WHEN("We read() one from a json istream, specifically a stringstream") { @@ -130,21 +132,22 @@ SCENARIO("Testing GNDStk tree read() and operator>>") { std::stringstream sstr; sstr << ifs.rdbuf(); t3.read(sstr); - compare(t3,correct_tree+decl_json); + compare(t3, decl_json + correct_tree); } WHEN("We stream-input one, specifically from a json ifstream") { std::ifstream ifs("n-069_Tm_170-covar.json"); ifs >> t4; - compare(t4,correct_tree+decl_json); + compare(t4, decl_json + correct_tree); } +#endif } // Why not... GIVEN("Several trees, read differently, but ultimately from the same file") { - // While the present test file is about tree's read(), not about its - // write(), let's nevertheless do a simple write(), to tree's basic - // text-output file format, from each of the trees read in different ways + // While the present test file is about tree's read(), not its write(), + // let's nevertheless do a simple write(), in our debug output-file + // format, from each of the trees that were read in different ways // above, and be sure there are absolutely no differences between them. // In effect, this helps test the read(), because it gives confidence // that our various ways of reading the same files give the same results. @@ -169,76 +172,84 @@ SCENARIO("Testing GNDStk tree read() and operator>>") { WHEN("We test read(filename, file format") { // xml - tree.read(xfilename,FileType::null); - compare(tree,correct_tree+decl_xml); - tree.read(xfilename,FileType::xml ); - compare(tree,correct_tree+decl_xml); + tree.read(xfilename,FileType::guess); + compare(tree, decl_xml + correct_tree); + tree.read(xfilename,FileType::xml); + compare(tree, decl_xml + correct_tree); // json - tree.read(jfilename,FileType::null); - compare(tree,correct_tree+decl_json); +#ifndef NJOY_GNDSTK_DISABLE_JSON + tree.read(jfilename,FileType::guess); + compare(tree, decl_json + correct_tree); tree.read(jfilename,FileType::json); - compare(tree,correct_tree+decl_json); + compare(tree, decl_json + correct_tree); +#endif } WHEN("We test read(filename, string") { // xml - tree.read(xfilename,"" ); - compare(tree,correct_tree+decl_xml); - tree.read(xfilename,"null"); - compare(tree,correct_tree+decl_xml); - tree.read(xfilename,"xml" ); - compare(tree,correct_tree+decl_xml); + tree.read(xfilename,""); + compare(tree, decl_xml + correct_tree); + tree.read(xfilename,"guess"); + compare(tree, decl_xml + correct_tree); + tree.read(xfilename,"xml"); + compare(tree, decl_xml + correct_tree); // json - tree.read(jfilename,"" ); - compare(tree,correct_tree+decl_json); - tree.read(jfilename,"null"); - compare(tree,correct_tree+decl_json); +#ifndef NJOY_GNDSTK_DISABLE_JSON + tree.read(jfilename,""); + compare(tree, decl_json + correct_tree); + tree.read(jfilename,"guess"); + compare(tree, decl_json + correct_tree); tree.read(jfilename,"json"); - compare(tree,correct_tree+decl_json); + compare(tree, decl_json + correct_tree); +#endif } WHEN("We test read(istream, file format") { // xml xifs.seekg (0,std::ios::beg); - tree.read(xifs,FileType::null); - compare(tree,correct_tree+decl_xml); + tree.read(xifs,FileType::guess); + compare(tree, decl_xml + correct_tree); xifs.seekg (0,std::ios::beg); - tree.read(xifs,FileType::xml ); - compare(tree,correct_tree+decl_xml); + tree.read(xifs,FileType::xml); + compare(tree, decl_xml + correct_tree); // json +#ifndef NJOY_GNDSTK_DISABLE_JSON jifs.seekg (0,std::ios::beg); - tree.read(jifs,FileType::null); - compare(tree,correct_tree+decl_json); + tree.read(jifs,FileType::guess); + compare(tree, decl_json + correct_tree); jifs.seekg (0,std::ios::beg); tree.read(jifs,FileType::json); - compare(tree,correct_tree+decl_json); + compare(tree, decl_json + correct_tree); +#endif } WHEN("We test read(istream, string") { // xml xifs.seekg (0,std::ios::beg); - tree.read(xifs,"" ); - compare(tree,correct_tree+decl_xml); + tree.read(xifs,""); + compare(tree, decl_xml + correct_tree); xifs.seekg (0,std::ios::beg); - tree.read(xifs,"null"); - compare(tree,correct_tree+decl_xml); + tree.read(xifs,"guess"); + compare(tree, decl_xml + correct_tree); xifs.seekg (0,std::ios::beg); - tree.read(xifs,"xml" ); - compare(tree,correct_tree+decl_xml); + tree.read(xifs,"xml"); + compare(tree, decl_xml + correct_tree); // json +#ifndef NJOY_GNDSTK_DISABLE_JSON jifs.seekg (0,std::ios::beg); - tree.read(jifs,"" ); - compare(tree,correct_tree+decl_json); + tree.read(jifs,""); + compare(tree, decl_json + correct_tree); jifs.seekg (0,std::ios::beg); - tree.read(jifs,"null"); - compare(tree,correct_tree+decl_json); + tree.read(jifs,"guess"); + compare(tree, decl_json + correct_tree); jifs.seekg (0,std::ios::beg); tree.read(jifs,"json"); - compare(tree,correct_tree+decl_json); + compare(tree, decl_json + correct_tree); +#endif } } } diff --git a/src/GNDStk/Tree/test/reset.test.cpp b/src/GNDStk/Tree/test/reset.test.cpp index 41d3c0f91..b2ca7a4b6 100644 --- a/src/GNDStk/Tree/test/reset.test.cpp +++ b/src/GNDStk/Tree/test/reset.test.cpp @@ -1,6 +1,7 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "GNDStk/test/keys.hpp" SCENARIO("Testing GNDStk tree reset()") { using namespace njoy::GNDStk; @@ -24,7 +25,7 @@ SCENARIO("Testing GNDStk tree reset()") { t.reset(reactionSuite); THEN("Declaration- and top-level-node queries can be made") { - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "1.0"); CHECK(t.decl().meta("encoding") == "UTF-8"); @@ -41,7 +42,7 @@ SCENARIO("Testing GNDStk tree reset()") { t.reset(reactionSuite, FileType::json); THEN("Declaration- and top-level-node queries can be made") { - CHECK(t.decl().name == "json"); + CHECK(t.decl().name == special::json); CHECK(t.decl().metadata.size() == 0); CHECK(t.decl().children.size() == 0); CHECK(t.top().name == "reactionSuite"); @@ -51,12 +52,12 @@ SCENARIO("Testing GNDStk tree reset()") { } WHEN("We call " - "Tree.reset(covarianceSuite, FileType::null, \"2.0\")") { + "Tree.reset(covarianceSuite, FileType::guess, \"2.0\")") { Tree t; - t.reset(covarianceSuite, FileType::null, "2.0"); + t.reset(covarianceSuite, FileType::guess, "2.0"); THEN("Declaration- and top-level-node queries can be made") { - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "2.0"); CHECK(t.decl().meta("encoding") == "UTF-8"); @@ -73,7 +74,7 @@ SCENARIO("Testing GNDStk tree reset()") { t.reset(covarianceSuite, FileType::xml, "3.0", "UTF-9"); THEN("Declaration- and top-level-node queries can be made") { - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "3.0"); CHECK(t.decl().meta("encoding") == "UTF-9"); @@ -90,7 +91,7 @@ SCENARIO("Testing GNDStk tree reset()") { t.reset(PoPs, "hdf5"); THEN("Declaration- and top-level-node queries can be made") { - CHECK(t.decl().name == "hdf5"); + CHECK(t.decl().name == special::hdf5); CHECK(t.decl().metadata.size() == 0); CHECK(t.decl().children.size() == 0); CHECK(t.top().name == "PoPs"); @@ -101,12 +102,12 @@ SCENARIO("Testing GNDStk tree reset()") { } WHEN("We call " - "Tree.reset(PoPs, \"tree\", \"4.0\")") { + "Tree.reset(PoPs, \"debug\", \"4.0\")") { Tree t; - t.reset(PoPs, "text", "4.0"); + t.reset(PoPs, "debug", "4.0"); THEN("Declaration- and top-level-node queries can be made") { - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "4.0"); CHECK(t.decl().meta("encoding") == "UTF-8"); @@ -123,7 +124,7 @@ SCENARIO("Testing GNDStk tree reset()") { t.reset(thermalScattering, "xml", "5.0", "UTF-10"); THEN("Declaration- and top-level-node queries can be made") { - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 2); CHECK(t.decl().meta("version") == "5.0"); CHECK(t.decl().meta("encoding") == "UTF-10"); diff --git a/src/GNDStk/Tree/test/resources/n-069_Tm_170-covar.json b/src/GNDStk/Tree/test/resources/n-069_Tm_170-covar.json index d23640cb5..91cb7e1a0 100644 --- a/src/GNDStk/Tree/test/resources/n-069_Tm_170-covar.json +++ b/src/GNDStk/Tree/test/resources/n-069_Tm_170-covar.json @@ -1,6 +1,6 @@ { "covarianceSuite": { - "attributes": { + "#metadata": { "evaluation": "ENDF/B-8.0", "format": "1.9", "projectile": "n", @@ -8,7 +8,7 @@ }, "externalFiles": { "externalFile": { - "attributes": { + "#metadata": { "label": "reactions", "path": "n-069_Tm_170.xml" } @@ -16,30 +16,30 @@ }, "parameterCovariances": { "parameterCovariance": { - "attributes": { + "#metadata": { "label": "resolved resonances" }, "parameterCovarianceMatrix": { "array": { - "attributes": { + "#metadata": { "compression": "diagonal", "shape": "78,78" }, "values": { - "pcdata": { - "attributes": { - "text": "0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012" + "#data": { + "#metadata": { + "#text": "0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012" } } } }, - "attributes": { + "#metadata": { "label": "eval", "type": "absolute" }, "parameters": { "parameterLink": { - "attributes": { + "#metadata": { "href": "$reactions#/reactionSuite/resonances/resolved/BreitWigner[@label='eval']/resonanceParameters/table", "label": "resonanceParameters", "nParameters": "78" @@ -48,7 +48,7 @@ } }, "rowData": { - "attributes": { + "#metadata": { "href": "$reactions#/reactionSuite/resonances/resolved/BreitWigner[@label='eval']" } } @@ -56,21 +56,21 @@ }, "styles": { "evaluated": { - "attributes": { + "#metadata": { "date": "2011-10-01", "label": "eval", "library": "ENDF/B", "version": "8.0.1" }, "projectileEnergyDomain": { - "attributes": { + "#metadata": { "max": "30000000.0", "min": "1e-05", "unit": "eV" } }, "temperature": { - "attributes": { + "#metadata": { "unit": "K", "value": "0.0" } diff --git a/src/GNDStk/Tree/test/special.test.cpp b/src/GNDStk/Tree/test/special.test.cpp index f5dbc5568..52e93f7be 100644 --- a/src/GNDStk/Tree/test/special.test.cpp +++ b/src/GNDStk/Tree/test/special.test.cpp @@ -1,7 +1,10 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; + +#include "GNDStk/test/keys.hpp" +using namespace basic; SCENARIO("Testing comment() and comments() in GNDStk Tree") { // Tree @@ -34,11 +37,11 @@ SCENARIO("Testing comment() and comments() in GNDStk Tree") { WHEN("Testing comment()") { // non-const - CHECK(n.comment( ) == title); + CHECK(n.comment() == title); CHECK(n.comment(0) == title); CHECK(n.comment(1) == width); // const - CHECK(c.comment( ) == title); + CHECK(c.comment() == title); CHECK(c.comment(0) == title); CHECK(c.comment(1) == width); } diff --git a/src/GNDStk/Tree/test/top.test.cpp b/src/GNDStk/Tree/test/top.test.cpp index b7853b164..2fc743e15 100644 --- a/src/GNDStk/Tree/test/top.test.cpp +++ b/src/GNDStk/Tree/test/top.test.cpp @@ -1,6 +1,7 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "GNDStk/test/keys.hpp" SCENARIO("Testing GNDStk Tree top()") { using namespace njoy::GNDStk; @@ -40,9 +41,9 @@ SCENARIO("Testing GNDStk Tree top()") { } } - WHEN("We call reset(covarianceSuite, FileType::null, \"2.0\")") { + WHEN("We call reset(covarianceSuite, FileType::guess, \"2.0\")") { Tree t; - t.reset(covarianceSuite, FileType::null, "2.0"); + t.reset(covarianceSuite, FileType::guess, "2.0"); THEN("We can make various top() (top-level node) queries") { CHECK(t.top().name == "covarianceSuite"); CHECK(t.top().metadata.size() == 0); @@ -50,7 +51,8 @@ SCENARIO("Testing GNDStk Tree top()") { } } - WHEN("We call reset(covarianceSuite, FileType::xml, \"3.0\", \"UTF-9\")") { + WHEN("We call reset(covarianceSuite, FileType::xml, " + "\"3.0\", \"UTF-9\")") { Tree t; t.reset(covarianceSuite, FileType::xml, "3.0", "UTF-9"); THEN("We can make various top() (top-level node) queries") { @@ -70,9 +72,9 @@ SCENARIO("Testing GNDStk Tree top()") { } } - WHEN("We call reset(PoPs, \"tree\", \"4.0\")") { + WHEN("We call reset(PoPs, \"debug\", \"4.0\")") { Tree t; - t.reset(PoPs, "text", "4.0"); + t.reset(PoPs, "debug", "4.0"); THEN("We can make various top() (top-level node) queries") { CHECK(t.top().name == "PoPs"); CHECK(t.top().metadata.size() == 0); diff --git a/src/GNDStk/Tree/test/write.test.cpp b/src/GNDStk/Tree/test/write.test.cpp index 8df9f359d..3952588b2 100644 --- a/src/GNDStk/Tree/test/write.test.cpp +++ b/src/GNDStk/Tree/test/write.test.cpp @@ -6,26 +6,26 @@ using namespace njoy::GNDStk; // ----------------------------------------------------------------------------- -// Strings: proper empty FileType::text/xml/json +// Strings: proper empty FileType::debug/xml/json // ----------------------------------------------------------------------------- // tree static const std::string string_empty_tree = -R"***(:)***"; +R"***(/:)***"; // xml static const std::string string_empty_xml = -R"***( -)***"; +R"***()***"; // json static const std::string string_empty_json = -R"***(null)***"; +R"***({ +})***"; // ----------------------------------------------------------------------------- -// Strings: gold-standard FileType::text/xml/json write()s for a particular +// Strings: gold-standard FileType::debug/xml/json write()s for a particular // file we'll read in. // ----------------------------------------------------------------------------- @@ -34,8 +34,8 @@ R"***(null)***"; // ------------------------ static const std::string string_real_tree = -R"***(: - xml: +R"***(/: + #xml: version: 1.0 encoding: UTF-8 covarianceSuite: @@ -77,8 +77,8 @@ R"***(: shape: 78,78 compression: diagonal values: - pcdata: - text: 0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012)***"; + #data: + #text: 0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012)***"; @@ -111,8 +111,7 @@ R"***( - -)***"; +)***"; @@ -120,18 +119,19 @@ R"***( // json // ------------------------ +#ifndef NJOY_GNDSTK_DISABLE_JSON static const std::string string_real_json = R"***({ "covarianceSuite": { - "attributes": { - "evaluation": "ENDF/B-8.0", + "#metadata": { + "evaluation": "ENDF\/B-8.0", "format": "1.9", "projectile": "n", "target": "Tm170" }, "externalFiles": { "externalFile": { - "attributes": { + "#metadata": { "label": "reactions", "path": "n-069_Tm_170.xml" } @@ -139,31 +139,31 @@ R"***({ }, "parameterCovariances": { "parameterCovariance": { - "attributes": { + "#metadata": { "label": "resolved resonances" }, "parameterCovarianceMatrix": { + "#metadata": { + "label": "eval", + "type": "absolute" + }, "array": { - "attributes": { + "#metadata": { "compression": "diagonal", "shape": "78,78" }, "values": { - "pcdata": { - "attributes": { - "text": "0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012" + "#data": { + "#metadata": { + "#text": "0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012" } } } }, - "attributes": { - "label": "eval", - "type": "absolute" - }, "parameters": { "parameterLink": { - "attributes": { - "href": "$reactions#/reactionSuite/resonances/resolved/BreitWigner[@label='eval']/resonanceParameters/table", + "#metadata": { + "href": "$reactions#\/reactionSuite\/resonances\/resolved\/BreitWigner[@label='eval']\/resonanceParameters\/table", "label": "resonanceParameters", "nParameters": "78" } @@ -171,29 +171,29 @@ R"***({ } }, "rowData": { - "attributes": { - "href": "$reactions#/reactionSuite/resonances/resolved/BreitWigner[@label='eval']" + "#metadata": { + "href": "$reactions#\/reactionSuite\/resonances\/resolved\/BreitWigner[@label='eval']" } } } }, "styles": { "evaluated": { - "attributes": { + "#metadata": { "date": "2011-10-01", "label": "eval", - "library": "ENDF/B", + "library": "ENDF\/B", "version": "8.0.1" }, "projectileEnergyDomain": { - "attributes": { + "#metadata": { "max": "30000000.0", "min": "1e-05", "unit": "eV" } }, "temperature": { - "attributes": { + "#metadata": { "unit": "K", "value": "0.0" } @@ -202,6 +202,7 @@ R"***({ } } })***"; +#endif @@ -221,31 +222,31 @@ SCENARIO("Testing GNDStk tree write() and operator<<") { // testing system is supposed to work when our intention is to actually // write *files*. - // FileType::text - WHEN("We write() the empty tree using FileType::text") { + // FileType::debug + WHEN("We write() the empty tree using FileType::debug") { // write() - THEN("We get an empty string (case: FileType::text)") { + THEN("We get an empty string (case: FileType::debug)") { std::ostringstream oss; - tree.write(oss, FileType::text); + tree.write(oss, FileType::debug); CHECK(oss.str() == string_empty_tree); } - THEN("We get an empty string (case: \"tree\")") { + THEN("We get an empty string (case: \"debug\")") { std::ostringstream oss; - tree.write(oss, "text"); + tree.write(oss, "debug"); CHECK(oss.str() == string_empty_tree); } } - WHEN("We write() the empty tree using FileType::null") { - // write(), using FileType::null (which defaults to tree) - THEN("We get an empty string (case: FileType::null)") { + WHEN("We write() the empty tree using FileType::guess") { + // write(), using FileType::guess + THEN("We get an empty string (case: FileType::guess)") { std::ostringstream oss; - tree.write(oss, FileType::null); + tree.write(oss, FileType::guess); CHECK(oss.str() == string_empty_tree); } - THEN("We get an empty string (case: \"null\")") { + THEN("We get an empty string (case: \"guess\")") { std::ostringstream oss; - tree.write(oss, "null"); + tree.write(oss, "guess"); CHECK(oss.str() == string_empty_tree); } THEN("We get an empty string (case: \"\")") { @@ -279,18 +280,20 @@ SCENARIO("Testing GNDStk tree write() and operator<<") { } // FileType::json +#ifndef NJOY_GNDSTK_DISABLE_JSON WHEN("We write() the empty tree using FileType::json") { - THEN("We get JSON \"(null)\" only (case: FileType::json)") { + THEN("We get JSON {} only (case: FileType::json)") { std::ostringstream oss; tree.write(oss, FileType::json); CHECK(oss.str() == string_empty_json); } - THEN("We get JSON \"(null)\" only (case: \"json\")") { + THEN("We get JSON {} only (case: \"json\")") { std::ostringstream oss; tree.write(oss, "json"); CHECK(oss.str() == string_empty_json); } } +#endif } // ------------------------ @@ -302,44 +305,44 @@ SCENARIO("Testing GNDStk tree write() and operator<<") { tree.read("n-069_Tm_170-covar.xml"); CHECK(!tree.empty()); - // FileType::text - WHEN("We write() the tree using FileType::text") { + // FileType::debug + WHEN("We write() the tree using FileType::debug") { // write() - THEN("We get the correct tree-format content") { + THEN("We get the correct debug-format content") { std::ostringstream oss; tree.write(oss); CHECK(oss.str() == string_real_tree); } - THEN("We get the correct tree-format content (case: FileType::text)") { + THEN("We get the correct debug-format content (case: FileType::debug)") { std::ostringstream oss; - tree.write(oss, FileType::text); + tree.write(oss, FileType::debug); CHECK(oss.str() == string_real_tree); } - THEN("We get the correct tree-format content (case: \"tree\")") { + THEN("We get the correct debug-format content (case: \"debug\")") { std::ostringstream oss; - tree.write(oss, "text"); + tree.write(oss, "debug"); CHECK(oss.str() == string_real_tree); } } - WHEN("We write() the tree using FileType::null") { - // write(), using FileType::null (which defaults to tree) - THEN("We get the correct tree-format content") { + WHEN("We write() the tree using FileType::guess") { + // write(), using FileType::guess + THEN("We get the correct debug-format content") { std::ostringstream oss; tree.write(oss); CHECK(oss.str() == string_real_tree); } - THEN("We get the correct tree-format content (case: FileType::null)") { + THEN("We get the correct debug-format content (case: FileType::guess)") { std::ostringstream oss; - tree.write(oss, FileType::null); + tree.write(oss, FileType::guess); CHECK(oss.str() == string_real_tree); } - THEN("We get the correct tree-format content (case: \"null\")") { + THEN("We get the correct debug-format content (case: \"guess\")") { std::ostringstream oss; - tree.write(oss, "null"); + tree.write(oss, "guess"); CHECK(oss.str() == string_real_tree); } - THEN("We get the correct tree-format content (case: \"\")") { + THEN("We get the correct debug-format content (case: \"\")") { std::ostringstream oss; tree.write(oss, ""); CHECK(oss.str() == string_real_tree); @@ -349,7 +352,7 @@ SCENARIO("Testing GNDStk tree write() and operator<<") { WHEN("We stream-output the tree") { // << std::ostringstream oss; - THEN("We get the correct tree-format content") { + THEN("We get the correct debug-format content") { oss << tree; CHECK(oss.str() == string_real_tree); } @@ -370,17 +373,23 @@ SCENARIO("Testing GNDStk tree write() and operator<<") { } // FileType::json +#ifndef NJOY_GNDSTK_DISABLE_JSON WHEN("We write() the tree using FileType::json") { THEN("We get the correct JSON content (case: FileType::json)") { std::ostringstream oss; - tree.write(oss, FileType::json); + JSON::reduced = false; + JSON::typed = false; + tree.sort().write(oss, FileType::json); CHECK(oss.str() == string_real_json); } THEN("We get the correct JSON content (case: \"json\")") { std::ostringstream oss; - tree.write(oss, "json"); + JSON::reduced = false; + JSON::typed = false; + tree.sort().write(oss, "json"); CHECK(oss.str() == string_real_json); } } +#endif } } diff --git a/src/GNDStk/XML.hpp b/src/GNDStk/XML.hpp index 65c4faeed..f2e6ccdb5 100644 --- a/src/GNDStk/XML.hpp +++ b/src/GNDStk/XML.hpp @@ -7,7 +7,6 @@ class XML { public: - // external XML-library document pugi::xml_document doc; // clear @@ -40,10 +39,10 @@ class XML { // ----------------------------------------------------------------------------- // operator>> -inline std::istream &operator>>(std::istream &is, XML &obj) +inline std::istream &operator>>(std::istream &is, XML &xml) { try { - return obj.read(is); + return xml.read(is); } catch (...) { log::function("istream >> XML"); throw; @@ -51,10 +50,10 @@ inline std::istream &operator>>(std::istream &is, XML &obj) } // operator<< -inline std::ostream &operator<<(std::ostream &os, const XML &obj) +inline std::ostream &operator<<(std::ostream &os, const XML &xml) { try { - return obj.write(os); + return xml.write(os); } catch (...) { log::function("ostream << XML"); throw; diff --git a/src/GNDStk/XML/src/assign.hpp b/src/GNDStk/XML/src/assign.hpp index 7389b8a42..5c01ee516 100644 --- a/src/GNDStk/XML/src/assign.hpp +++ b/src/GNDStk/XML/src/assign.hpp @@ -7,11 +7,12 @@ XML &operator=(XML &&) = default; // copy -// Note: pugi::xml_document's is inaccessible -XML &operator=(const XML &x) +// Note: pugi::xml_document's copy assignment is inaccessible; +// otherwise, we'd use it here. +XML &operator=(const XML &other) { try { - if (!convert(x,*this)) + if (!convert(other,*this)) throw std::exception{}; } catch (...) { log::assign("XML = XML"); diff --git a/src/GNDStk/XML/src/ctor.hpp b/src/GNDStk/XML/src/ctor.hpp index e2e035285..ac8a96dd4 100644 --- a/src/GNDStk/XML/src/ctor.hpp +++ b/src/GNDStk/XML/src/ctor.hpp @@ -3,6 +3,10 @@ // XML Constructors // ----------------------------------------------------------------------------- +// ------------------------ +// Basics +// ------------------------ + // default XML() = default; @@ -10,11 +14,12 @@ XML() = default; XML(XML &&) = default; // copy -// Note: pugi::xml_document's is inaccessible -XML(const XML &x) +// Note: pugi::xml_document's copy constructor is inaccessible; +// otherwise, we'd use it here. +XML(const XML &other) { try { - if (!convert(x,*this)) + if (!convert(other,*this)) throw std::exception{}; } catch (...) { log::ctor("XML(XML)"); @@ -22,7 +27,13 @@ XML(const XML &x) } } -// JSON + +// ------------------------ +// From other classes +// ------------------------ + +// From JSON +#ifndef NJOY_GNDSTK_DISABLE_JSON explicit XML(const JSON &j) { try { @@ -33,51 +44,59 @@ explicit XML(const JSON &j) throw; } } +#endif -// Node -explicit XML(const Node &n) +// From HDF5 +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +explicit XML(const HDF5 &h) { try { - if (!convert(n,*this)) + if (!convert(h,*this)) throw std::exception{}; } catch (...) { - log::ctor("XML(Node)"); + log::ctor("XML(HDF5)"); throw; } } +#endif -// Tree -explicit XML(const Tree &t) +// From Node +explicit XML(const Node &n) { try { - if (!convert(t,*this)) + if (!convert(n,*this)) throw std::exception{}; } catch (...) { - log::ctor("XML(Tree)"); + log::ctor("XML(Node)"); throw; } } -// file name -explicit XML(const std::string &filename) + +// ------------------------ +// From istream and file +// ------------------------ + +// From istream +explicit XML(std::istream &is) { try { - if (!read(filename)) + if (!read(is)) throw std::exception{}; } catch (...) { - log::ctor("XML(\"{}\")", filename); + log::ctor("XML(istream)"); throw; } } -// istream -explicit XML(std::istream &is) +// From file +explicit XML(const std::string &filename) { try { - if (!read(is)) + if (!read(filename)) throw std::exception{}; } catch (...) { - log::ctor("XML(istream)"); + log::ctor("XML(\"{}\")", filename); throw; } } diff --git a/src/GNDStk/XML/src/read.hpp b/src/GNDStk/XML/src/read.hpp index a0dc154ec..e233ca919 100644 --- a/src/GNDStk/XML/src/read.hpp +++ b/src/GNDStk/XML/src/read.hpp @@ -17,11 +17,11 @@ std::istream &read(std::istream &is) is, pugi::parse_default | pugi::parse_declaration // preserve material - | pugi::parse_comments // preserve material + | pugi::parse_comments // preserve material ); // check for errors - // note: we've noticed that pugi doesn't (or, at least, doesn't + // note: we've noticed that pugixml doesn't (or, at least, doesn't // always) arrange for !is when pugi::xml_document.load() fails const bool pugierr = load.description() != std::string("No error"); if (pugierr || !is) { @@ -37,7 +37,7 @@ std::istream &read(std::istream &is) ); } else { // !is - // given the earlier comment about pugi and !is, it may + // given the earlier remark about pugixml and !is, it may // not be possible to get here, but we'll cover it... log::error( "pugi::xml_document.load(istream,...) returned with !istream" @@ -67,7 +67,7 @@ std::istream &read(std::istream &is) // ------------------------ -// read(file name) +// read(file) // ------------------------ bool read(const std::string &filename) diff --git a/src/GNDStk/XML/src/write.hpp b/src/GNDStk/XML/src/write.hpp index a9e76910b..9bfb69f4b 100644 --- a/src/GNDStk/XML/src/write.hpp +++ b/src/GNDStk/XML/src/write.hpp @@ -7,38 +7,54 @@ // write(ostream) // ------------------------ -std::ostream &write(std::ostream &os, const bool decl = true) const +std::ostream &write(std::ostream &os = std::cout, const bool decl = true) const { - // ...fixme Can we prevent pugixml from emitting a newline at the end? - // ...Concept: output functions shouldn't *assume* that someone who prints - // ...something wants a newline at the end. A user should explicitly provide - // ...the \n, std::endl, whatever, if they want that. One might think we'd - // ...always want the newline for a "large" or "compound" object (the - // ...printing of which might, in fact, even have internal newlines). - // ...However, automatically printing a newline makes the behavior - // ...different from what we expect with "simple" types - int, double, etc. - // ...Different makes it less predictable, and inconsistent. Print a vector - // ...of ints, for example, with an explicit newline after each, and we'll - // ...get one int per line. Print a vector of these XML objects in the same - // ...way, and we'll get blank lines, in between, if the XML printing takes - // ...it upon itself to print its own newline. The best behavior, in my - // ...opinion, is consistent behavior - it's easy to remember. So, then, - // ...no fluff, either before or after any object being written. + // Here, pugi::xml_document's save() capability does most of the work. - // call pugi::xml_document's write capability try { - // save + // Unfortunately, pugixml emits a newline at the end of its save(). + // In fact, a general output function shouldn't *assume* that someone + // who uses it actually wants the newline; it should let a user provide + // one if they want it. One might think we'd always want a newline for + // a "large" or "compound" object (the printing of which might, in fact, + // even have internal newlines). However, automatically printing a + // terminating newline makes the behavior different from what we expect + // with "simple" types - int, double, etc. "Different" makes behavior + // less predictable. Print a vector of ints, with a << std::endl after + // each int (the usual pattern), and we'll get one int per line. Print + // a vector of XML objects in the same manner, and we'll get blank lines + // between values if the XML printing already prints its own newline. + // Imagine a generic print(vector), where T could be int or XML or + // whatever else, and you can see the issue. So, we're actually going + // to circumvent pugixml's presumptuous \n by save()ing to a buffer, + // then shipping the buffer to the std::ostream, without the \n. This + // may seem goofy, and it may make the code less efficient (although + // I'm not seeing that in tests). The upside is, it makes XML objects + // behave predictably. Write one, and, as with int, double, or other + // well-mannered objects, you'll get a \n if AND ONLY IF you give it. + + // save to buffer + std::ostringstream buffer; doc.save( - os, + buffer, std::string(indent,' ').data(), decl ? pugi::format_default : pugi::format_default | pugi::format_no_declaration ); + // transfer buffer, chucking last character iff it's a newline + if (buffer) { + const size_t size = buffer.str().size(); + if (size) + os.write(buffer.str().data(), size-(buffer.str()[size-1] == '\n')); + } + // check for errors - if (!os) { - log::error("pugi::xml_document.save(ostream) returned with !ostream"); + if (!buffer || !os) { + log::error(!buffer + ? "pugi::xml_document.save(buffer) returned with !buffer" + : "ostream.write() returned with !ostream"); log::member("XML.write(ostream)"); } } catch (...) { @@ -53,7 +69,7 @@ std::ostream &write(std::ostream &os, const bool decl = true) const // ------------------------ -// write(file name) +// write(file) // ------------------------ bool write(const std::string &filename, const bool decl = true) const @@ -66,12 +82,10 @@ bool write(const std::string &filename, const bool decl = true) const return false; } - // write to ostream - if (!write(ofs,decl)) { - log::member("XML.write(\"{}\")", filename); - return false; - } + // write to the ofstream + if (write(ofs,decl) << std::endl) + return true; - // done - return true; + log::member("XML.write(\"{}\")", filename); + return false; } diff --git a/src/GNDStk/XML/test/CMakeLists.txt b/src/GNDStk/XML/test/CMakeLists.txt index 39b36bbcb..2c0b4b039 100644 --- a/src/GNDStk/XML/test/CMakeLists.txt +++ b/src/GNDStk/XML/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.XML.test XML.test.cpp ) +add_executable( + GNDStk.XML.test + XML.test.cpp +) + target_compile_options( GNDStk.XML.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} @@ -10,9 +14,9 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.XML.test PUBLIC GNDStk ) +target_link_libraries( GNDStk.XML.test PUBLIC GNDStk ) file( GLOB resources "resources/*" ) foreach( resource ${resources}) file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) endforeach() -add_test( NAME GNDStk.XML COMMAND GNDStk.XML.test ) \ No newline at end of file +add_test( NAME GNDStk.XML COMMAND GNDStk.XML.test ) diff --git a/src/GNDStk/XML/test/XML.test.cpp b/src/GNDStk/XML/test/XML.test.cpp index a55cba0be..58f04a06e 100644 --- a/src/GNDStk/XML/test/XML.test.cpp +++ b/src/GNDStk/XML/test/XML.test.cpp @@ -36,8 +36,7 @@ R"***( - -)***"; +)***"; // ----------------------------------------------------------------------------- @@ -65,7 +64,7 @@ SCENARIO("Testing GNDStk XML") { THEN("The Tree should have only an empty declaration node") { CHECK(t.children.size() == 1); CHECK(t.has_decl()); - CHECK(t.decl().name == "xml"); + CHECK(t.decl().name == special::xml); CHECK(t.decl().metadata.size() == 0); CHECK(t.decl().children.size() == 0); } @@ -113,6 +112,7 @@ SCENARIO("Testing GNDStk XML") { CHECK(oss1.str() == oss2.str()); } +#ifndef NJOY_GNDSTK_DISABLE_JSON // from JSON WHEN("We construct an XML from a JSON") { const JSON j("n-069_Tm_170-covar.json"); @@ -132,8 +132,9 @@ SCENARIO("Testing GNDStk XML") { CHECK(t == Tree(x)); // == ignores declaration node } } +#endif - // from file name + // from file // Note: Things like this are of course tested indirectly // all over the place. WHEN("We construct an XML from a file") { diff --git a/src/GNDStk/XML/test/resources/n-069_Tm_170-covar.json b/src/GNDStk/XML/test/resources/n-069_Tm_170-covar.json index d23640cb5..91cb7e1a0 100644 --- a/src/GNDStk/XML/test/resources/n-069_Tm_170-covar.json +++ b/src/GNDStk/XML/test/resources/n-069_Tm_170-covar.json @@ -1,6 +1,6 @@ { "covarianceSuite": { - "attributes": { + "#metadata": { "evaluation": "ENDF/B-8.0", "format": "1.9", "projectile": "n", @@ -8,7 +8,7 @@ }, "externalFiles": { "externalFile": { - "attributes": { + "#metadata": { "label": "reactions", "path": "n-069_Tm_170.xml" } @@ -16,30 +16,30 @@ }, "parameterCovariances": { "parameterCovariance": { - "attributes": { + "#metadata": { "label": "resolved resonances" }, "parameterCovarianceMatrix": { "array": { - "attributes": { + "#metadata": { "compression": "diagonal", "shape": "78,78" }, "values": { - "pcdata": { - "attributes": { - "text": "0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012" + "#data": { + "#metadata": { + "#text": "0.015 0 0 0 4.5e-5 0.015 3e-2 0 0 0 1.35e-4 0.015 2e-2 0 0 0 1.5e-3 0.012 5e-2 0 0 0 1.875e-3 6e-2 5e-2 0 0 0 1.05e-4 0.015 0.1 0 0 0 6e-4 0.012 0.1 0 0 0 2.25e-4 0.012 0.2 0 0 0 5.25e-3 0.012 0.2 0 0 0 3.45e-3 0.012 0.3 0 0 0 4.5e-4 0.012 0.3 0 0 0 3e-3 0.012 0.4 0 0 0 9e-3 0.012 0.4 0 0 0 1.425e-3 0.012" } } } }, - "attributes": { + "#metadata": { "label": "eval", "type": "absolute" }, "parameters": { "parameterLink": { - "attributes": { + "#metadata": { "href": "$reactions#/reactionSuite/resonances/resolved/BreitWigner[@label='eval']/resonanceParameters/table", "label": "resonanceParameters", "nParameters": "78" @@ -48,7 +48,7 @@ } }, "rowData": { - "attributes": { + "#metadata": { "href": "$reactions#/reactionSuite/resonances/resolved/BreitWigner[@label='eval']" } } @@ -56,21 +56,21 @@ }, "styles": { "evaluated": { - "attributes": { + "#metadata": { "date": "2011-10-01", "label": "eval", "library": "ENDF/B", "version": "8.0.1" }, "projectileEnergyDomain": { - "attributes": { + "#metadata": { "max": "30000000.0", "min": "1e-05", "unit": "eV" } }, "temperature": { - "attributes": { + "#metadata": { "unit": "K", "value": "0.0" } diff --git a/src/GNDStk/basic.hpp b/src/GNDStk/basic.hpp deleted file mode 100644 index bdd29f9e5..000000000 --- a/src/GNDStk/basic.hpp +++ /dev/null @@ -1,16 +0,0 @@ - -// ----------------------------------------------------------------------------- -// Set of Meta and Child objects all of which use , meaning they'll -// retrieve metadata and child nodes in their original form in the GNDS tree. -// ----------------------------------------------------------------------------- - -namespace basic { - -#include "GNDStk/basic/src/meta.hpp" -#include "GNDStk/basic/src/child.hpp" - -using namespace meta; -using namespace child; -// using namespace common; - -} // namespace basic diff --git a/src/GNDStk/basic/src/child.hpp b/src/GNDStk/basic/src/child.hpp deleted file mode 100644 index 7241c6a2c..000000000 --- a/src/GNDStk/basic/src/child.hpp +++ /dev/null @@ -1,286 +0,0 @@ - -namespace child { - -// ----------------------------------------------------------------------------- -// Child -// -// The list below was auto-generated by a code we wrote that looked for all -// elements in every existing XML-format GNDS file that we had, and guessed, -// based on what it saw, if the element should be formulated as an Allow::one -// or an Allow::many. We then tweaked the auto-generated list just a bit; for -// example, to change "double" to "Double". At some point we'll probably want -// to tweak it more, based on a careful study of the GNDS specs. -// ----------------------------------------------------------------------------- - -// Note: a Child will retrieve an element in its original form -// in the GNDS tree: as (a const or non-const reference to) a Node. - - -// ----------------------------------------------------------------------------- -// Allowable top-level nodes, per LLNL-TR-774621-DRAFT -// ----------------------------------------------------------------------------- - -// Note: the ~ (tilde) makes them allowed as top-level nodes -inline const auto - PoPs = ~Child("PoPs"); -inline const auto - reactionSuite = ~Child("reactionSuite"); -inline const auto - covarianceSuite = ~Child("covarianceSuite"); -inline const auto - thermalScattering = ~Child("thermalScattering"); -inline const auto - fissionFragmentData = ~Child("fissionFragmentData"); - - - -// ----------------------------------------------------------------------------- -// General elements -// ----------------------------------------------------------------------------- - -// ------------------------ -// With Allow::one -// ------------------------ - -inline const Child - BreitWigner ("BreitWigner" ), - CoulombPlusNuclearElastic ("CoulombPlusNuclearElastic" ), - DebyeWaller ("DebyeWaller" ), - EFH ("EFH" ), - EFL ("EFL" ), - ENDFconversionFlags ("ENDFconversionFlags" ), - Js ("Js" ), - KalbachMann ("KalbachMann" ), - Ls ("Ls" ), - MadlandNix ("MadlandNix" ), - NBodyPhaseSpace ("NBodyPhaseSpace" ), - Q ("Q" ), - RMatrix ("RMatrix" ), - RutherfordScattering ("RutherfordScattering" ), - S_alpha_beta ("S_alpha_beta" ), - S_table ("S_table" ), - T_M ("T_M" ), - T_effective ("T_effective" ), - U ("U" ), - aliases ("aliases" ), - angular ("angular" ), - angularEnergy ("angularEnergy" ), - angularTwoBody ("angularTwoBody" ), - applicationData ("applicationData" ), - array ("array" ), - atomic ("atomic" ), - averageEnergies ("averageEnergies" ), - averageProductEnergy ("averageProductEnergy" ), - axes ("axes" ), - background ("background" ), - baryons ("baryons" ), - bindingEnergy ("bindingEnergy" ), - branching1d ("branching1d" ), - branching3d ("branching3d" ), - cdata ("cdata" ), - channels ("channels" ), - characteristicCrossSection ("characteristicCrossSection" ), - charge ("charge" ), - chemicalElements ("chemicalElements" ), - coherentElastic ("coherentElastic" ), - coherentPhotonScattering ("coherentPhotonScattering" ), - columnData ("columnData" ), - columnHeaders ("columnHeaders" ), - configurations ("configurations" ), - constant1d ("constant1d" ), - continuum ("continuum" ), - covarianceSections ("covarianceSections" ), - crossSection ("crossSection" ), - crossSections ("crossSections" ), - cutoffEnergy ("cutoffEnergy" ), - data ("data" ), - decayData ("decayData" ), - decayModes ("decayModes" ), - decayPath ("decayPath" ), - delayedBetaEnergy ("delayedBetaEnergy" ), - delayedGammaEnergy ("delayedGammaEnergy" ), - delayedNeutronKE ("delayedNeutronKE" ), - discreteGamma ("discreteGamma" ), - distribution ("distribution" ), - documentation ("documentation" ), - documentations ("documentations" ), - Double ("double" ), - doubleDifferentialCrossSection ("doubleDifferentialCrossSection" ), - durations ("durations" ), - e_critical ("e_critical" ), - e_max ("e_max" ), - energy ("energy" ), - energyAngular ("energyAngular" ), - evaporation ("evaporation" ), - externalFiles ("externalFiles" ), - f ("f" ), - fastRegion ("fastRegion" ), - fissionComponents ("fissionComponents" ), - fissionEnergyReleased ("fissionEnergyReleased" ), - freeAtomCrossSection ("freeAtomCrossSection" ), - g ("g" ), - gaugeBosons ("gaugeBosons" ), - generalEvaporation ("generalEvaporation" ), - gridded2d ("gridded2d" ), - gridded3d ("gridded3d" ), - halflife ("halflife" ), - hardSphereRadius ("hardSphereRadius" ), - imaginaryAnomalousFactor ("imaginaryAnomalousFactor" ), - imaginaryInterferenceTerm ("imaginaryInterferenceTerm" ), - incoherentElastic ("incoherentElastic" ), - incoherentInelastic ("incoherentInelastic" ), - incoherentPhotonScattering ("incoherentPhotonScattering" ), - incompleteReactions ("incompleteReactions" ), - institution ("institution" ), - intensity ("intensity" ), - internalConversionCoefficients ("internalConversionCoefficients" ), - internalPairFormationCoefficient("internalPairFormationCoefficient"), - isotopes ("isotopes" ), - isotropic2d ("isotropic2d" ), - leptons ("leptons" ), - levelSpacing ("levelSpacing" ), - link ("link" ), - listOfCovariances ("listOfCovariances" ), - mass ("mass" ), - mixed ("mixed" ), - multiplicities ("multiplicities" ), - multiplicity ("multiplicity" ), - neutrinoEnergy ("neutrinoEnergy" ), - nonNeutrinoEnergy ("nonNeutrinoEnergy" ), - nuclearAmplitudeExpansion ("nuclearAmplitudeExpansion" ), - nuclearPlusInterference ("nuclearPlusInterference" ), - nuclearTerm ("nuclearTerm" ), - nucleus ("nucleus" ), - nuclides ("nuclides" ), - orphanProducts ("orphanProducts" ), - outputChannel ("outputChannel" ), - parameterCovariances ("parameterCovariances" ), - parameters ("parameters" ), - parity ("parity" ), - pcdata ("pcdata" ), - photonEmissionProbabilities ("photonEmissionProbabilities" ), - pids ("pids" ), - polynomial1d ("polynomial1d" ), - positronEmissionIntensity ("positronEmissionIntensity" ), - primaryGamma ("primaryGamma" ), - probability ("probability" ), - productYields ("productYields" ), - productions ("productions" ), - products ("products" ), - projectileEnergyDomain ("projectileEnergyDomain" ), - promptGammaEnergy ("promptGammaEnergy" ), - promptNeutronKE ("promptNeutronKE" ), - promptProductKE ("promptProductKE" ), - r ("r" ), - reactions ("reactions" ), - realAnomalousFactor ("realAnomalousFactor" ), - realInterferenceTerm ("realInterferenceTerm" ), - recoil ("recoil" ), - reference ("reference" ), - regions2d ("regions2d" ), - resolved ("resolved" ), - resolvedRegion ("resolvedRegion" ), - resonanceParameters ("resonanceParameters" ), - resonanceReactions ("resonanceReactions" ), - resonances ("resonances" ), - resonancesWithBackground ("resonancesWithBackground" ), - rowData ("rowData" ), - scatteringAtoms ("scatteringAtoms" ), - scatteringFactor ("scatteringFactor" ), - scatteringRadius ("scatteringRadius" ), - simpleMaxwellianFission ("simpleMaxwellianFission" ), - spectra ("spectra" ), - spin ("spin" ), - spinGroups ("spinGroups" ), - standard ("standard" ), - string ("string" ), - styles ("styles" ), - summands ("summands" ), - sums ("sums" ), - table ("table" ), - tabulatedWidths ("tabulatedWidths" ), - temperature ("temperature" ), - theta ("theta" ), - time ("time" ), - totalEnergy ("totalEnergy" ), - uncertainty ("uncertainty" ), - uncorrelated ("uncorrelated" ), - unresolved ("unresolved" ), - unresolvedRegion ("unresolvedRegion" ), - unspecified ("unspecified" ), - weightedFunctionals ("weightedFunctionals" ), - widths ("widths" ), - xml ("xml" ), - yields ("yields" ); - -// ------------------------ -// With Allow::many -// ------------------------ - -inline const Child - J ("J" ), - L ("L" ), - Legendre ("Legendre" ), - XYs1d ("XYs1d" ), - XYs2d ("XYs2d" ), - XYs3d ("XYs3d" ), - add ("add" ), - averageEnergy ("averageEnergy" ), - averageParameterCovariance ("averageParameterCovariance" ), - axis ("axis" ), - baryon ("baryon" ), - channel ("channel" ), - chemicalElement ("chemicalElement" ), - column ("column" ), - comment ("comment" ), - configuration ("configuration" ), - conversion ("conversion" ), - covariance ("covariance" ), - covarianceMatrix ("covarianceMatrix" ), - crossSectionReconstructed ("crossSectionReconstructed" ), - crossSectionSum ("crossSectionSum" ), - decay ("decay" ), - decayMode ("decayMode" ), - discrete ("discrete" ), - duration ("duration" ), - evaluated ("evaluated" ), - externalFile ("externalFile" ), - fissionComponent ("fissionComponent" ), - fraction ("fraction" ), - gaugeBoson ("gaugeBoson" ), - grid ("grid" ), - integer ("integer" ), - isotope ("isotope" ), - lepton ("lepton" ), - metaStable ("metaStable" ), - multiplicitySum ("multiplicitySum" ), - nuclide ("nuclide" ), - parameterCovariance ("parameterCovariance" ), - parameterCovarianceMatrix ("parameterCovarianceMatrix" ), - parameterLink ("parameterLink" ), - product ("product" ), - production ("production" ), - productYield ("productYield" ), - reaction ("reaction" ), - regions1d ("regions1d" ), - resonanceReaction ("resonanceReaction" ), - scatteringAtom ("scatteringAtom" ), - section ("section" ), - shell ("shell" ), - shortRangeSelfScalingVariance ("shortRangeSelfScalingVariance" ), - spectrum ("spectrum" ), - spinGroup ("spinGroup" ), - sum ("sum" ), - summand ("summand" ), - values ("values" ), - weighted ("weighted" ), - width ("width" ); - -// fixme Probably redo this entire file based on Standard Interface experience -// fixme Same with misc:: namespace entries, assuming we keep misc:: -// Additional ones I've encountered while writing the Standard Interface -inline const Child interval("interval"); -inline const Child confidenceIntervals("confidenceIntervals"); -inline const Child logNormal("logNormal"); - -} // namespace child diff --git a/src/GNDStk/basic/src/meta.hpp b/src/GNDStk/basic/src/meta.hpp deleted file mode 100644 index 42e252f60..000000000 --- a/src/GNDStk/basic/src/meta.hpp +++ /dev/null @@ -1,118 +0,0 @@ - -// ----------------------------------------------------------------------------- -// Meta -// For all metadata that we see in every existing XML-format GNDS file that -// we have. The list below was auto-generated by a code we wrote to look for -// all such metadata. -// ----------------------------------------------------------------------------- - -// A Meta will retrieve a metadatum in its original form in the GNDS -// tree: as (a const or non-const reference to) a std::string. - -namespace meta { - -inline const Meta - A ("A" ), - ENDF_MFMT ("ENDF_MFMT" ), - ENDF_MT ("ENDF_MT" ), - L ("L" ), - MAT ("MAT" ), - Z ("Z" ), - approximation ("approximation" ), - asymmetric ("asymmetric" ), - boundaryCondition ("boundaryCondition" ), - calculateChannelRadius ("calculateChannelRadius" ), - calculatePenetrability ("calculatePenetrability" ), - calculatedAtThermal ("calculatedAtThermal" ), - channelSpin ("channelSpin" ), - coefficient ("coefficient" ), - columnIndex ("columnIndex" ), - columns ("columns" ), - complete ("complete" ), - compression ("compression" ), - constant ("constant" ), - crossTerm ("crossTerm" ), - date ("date" ), - decayRate ("decayRate" ), - degreesOfFreedom ("degreesOfFreedom" ), - dependenceOnProcessedGroupWidth("dependenceOnProcessedGroupWidth"), - derivedFrom ("derivedFrom" ), - domainMax ("domainMax" ), - domainMin ("domainMin" ), - domainUnit ("domainUnit" ), - ejectile ("ejectile" ), - electronNumber ("electronNumber" ), - eliminated ("eliminated" ), - emissionMode ("emissionMode" ), - encoding ("encoding" ), - evaluation ("evaluation" ), - final ("final" ), - fissionGenre ("fissionGenre" ), - flags ("flags" ), - format ("format" ), - functionalForm ("functionalForm" ), - generation ("generation" ), - genre ("genre" ), - href ("href" ), - id ("id" ), - identicalParticles ("identicalParticles" ), - index ("index" ), - initial ("initial" ), - interpolation ("interpolation" ), - interpolationQualifier ("interpolationQualifier" ), - label ("label" ), - length ("length" ), - library ("library" ), - lowerIndex ("lowerIndex" ), - material ("material" ), - matrixStartIndex ("matrixStartIndex" ), - max ("max" ), - metaStableIndex ("metaStableIndex" ), - min ("min" ), - mode ("mode" ), - muCutoff ("muCutoff" ), - nParameters ("nParameters" ), - name ("name" ), - numberOfProducts ("numberOfProducts" ), - numberPerMolecule ("numberPerMolecule" ), - parity ("parity" ), - path ("path" ), - pid ("pid" ), - process ("process" ), - productFrame ("productFrame" ), - projectile ("projectile" ), - projectileFrame ("projectileFrame" ), - resonanceReaction ("resonanceReaction" ), - rows ("rows" ), - shape ("shape" ), - spin ("spin" ), - start ("start" ), - style ("style" ), - subshell ("subshell" ), - supportsAngularReconstruction ("supportsAngularReconstruction" ), - symbol ("symbol" ), - symmetry ("symmetry" ), - target ("target" ), - text ("text" ), - type ("type" ), - types ("types" ), - unit ("unit" ), - useForSelfShieldingOnly ("useForSelfShieldingOnly" ), - value ("value" ), - valueType ("valueType" ), - version ("version" ); - -// fixme Probably redo this entire file based on Standard Interface experience -// fixme Same with misc:: namespace entries, assuming we keep misc:: -// Additional ones I've encountered while writing the Standard Interface -inline const Meta - confidence ("confidence" ), - lower ("lower" ), - upper ("upper" ), - offset ("offset" ), - permutation ("permutation" ), - storageOrder("storageOrder"), - sep ("sep" ), - outerDomainValue("outerDomainValue"); - -} // namespace meta diff --git a/src/GNDStk/common.hpp b/src/GNDStk/common.hpp deleted file mode 100644 index e21dd49ec..000000000 --- a/src/GNDStk/common.hpp +++ /dev/null @@ -1,30 +0,0 @@ - -// ----------------------------------------------------------------------------- -// Set of Meta and Child objects that are useful enough as-is that we wish -// to include them in other sets of such objects, in other namespaces. -// ----------------------------------------------------------------------------- - -#include "GNDStk/common/src/detail.hpp" - -namespace common { - -// numeric -template -inline const Child< - // for general T, the following produces a vector; - // for T already a vector, it remains as-is - typename detail::numeric_type::type, - Allow::one, - detail::convert_pcdata_text_t -> numeric("pcdata"); - -// shortcuts for numeric; each gives a vector -inline const auto ints = numeric/"pcdata"; -inline const auto floats = numeric/"pcdata"; -inline const auto doubles = numeric/"pcdata"; -// fixme I'm not sure why the "pcdata" name doesn't come over automatically -// from numeric; it probably relates to order-of-initialization rules (or -// lack of rules?) for variable templates. We'll figure that out sometime. -// For now, the shortcuts are given the name directly, so it doesn't matter. - -} // namespace common diff --git a/src/GNDStk/common/src/detail.hpp b/src/GNDStk/common/src/detail.hpp deleted file mode 100644 index 2fbd6b089..000000000 --- a/src/GNDStk/common/src/detail.hpp +++ /dev/null @@ -1,90 +0,0 @@ - -namespace detail { - -// ----------------------------------------------------------------------------- -// convert_pcdata_text_t -// ----------------------------------------------------------------------------- - -class convert_pcdata_text_t { -public: - - // Node to container - template - void operator()(const Node &node, CONTAINER &container) const - { - try { - // Context: - // We're inside of a node that's inside of a node - // that looked something like this (in XML): - // 0.0 1.0 2.0 3.0 4.0 - // In GNDStk, the node has a metadatum with the key "text". - // The metadatum's string value is the content: "0.0 1.0 ..." in - // our example. Goal here: extract that content into the container. - container.clear(); - for (auto &m : node.metadata) - if (m.first == "text") { - convert(m.second, container); - return; - } - log::error( - "Unable to find metadatum key \"text\" in the current Node (\"{}\")", - node.name - ); - throw std::exception{}; - } catch (...) { - log::function("convert_pcdata_text_t(Node,container)"); - throw; - } - } - - // container to Node - template - void operator()(const CONTAINER &container, Node &node) const - { - try { - node.clear(); - node.name = "pcdata"; - std::string &destination = node.add("text","").second; - convert(container, destination); - } catch (...) { - log::function("convert_pcdata_text_t(container,Node)"); - throw; - } - } -}; - - -// ----------------------------------------------------------------------------- -// numeric_type -// ----------------------------------------------------------------------------- - -// default -// create vector -template -class numeric_type { -public: - using type = std::vector; -}; - -// keep deque -template -class numeric_type> { -public: - using type = std::deque; -}; - -// keep list -template -class numeric_type> { -public: - using type = std::list; -}; - -// keep vector -template -class numeric_type> { -public: - using type = std::vector; -}; - -} // namespace detail diff --git a/src/GNDStk/convert.hpp b/src/GNDStk/convert.hpp index 6ba39a5f4..3843061a1 100644 --- a/src/GNDStk/convert.hpp +++ b/src/GNDStk/convert.hpp @@ -2,6 +2,7 @@ #include "GNDStk/convert/src/detail.hpp" // convert to: -#include "GNDStk/convert/src/tree.hpp" +#include "GNDStk/convert/src/Node.hpp" #include "GNDStk/convert/src/XML.hpp" #include "GNDStk/convert/src/JSON.hpp" +#include "GNDStk/convert/src/HDF5.hpp" diff --git a/src/GNDStk/convert/src/HDF5.hpp b/src/GNDStk/convert/src/HDF5.hpp new file mode 100644 index 000000000..1a531058c --- /dev/null +++ b/src/GNDStk/convert/src/HDF5.hpp @@ -0,0 +1,160 @@ + +// ----------------------------------------------------------------------------- +// Node ==> HDF5 +// ----------------------------------------------------------------------------- + +inline bool convert(const Node &node, HDF5 &h, const std::string &name) +{ + static const std::string context = "convert(Node,HDF5)"; + +#ifdef NJOY_GNDSTK_DISABLE_HDF5 + + (void)node; (void)h; (void)name; + log::error( + "We can't make the conversion " + context + ", because the code\n" + "has been compiled with HDF5 disabled (macro NJOY_GNDSTK_DISABLE_HDF5)."); + log::function(context); + throw std::exception{}; + +#else + + // clear the receiving HDF5 + h.clear(); + + try { + // bookkeeping, re: HighFive employing basically a file descriptor + const std::string tmpfile = + name != "" ? name : h.temporaryName(h.fileDesc); + h.filePtr = new HighFive::File(tmpfile, HDF5::modeWrite); + + // ------------------------ + // Node + // ------------------------ + + if (node.name != "/") { + const bool ret = detail::node2hdf5(node,*h.filePtr); + h.filePtr->flush(); + return ret; + } + + // ------------------------ + // Tree + // ------------------------ + + detail::warn_node_top_metadata(node,context); + bool found_dec = false; + + for (const auto &cptr : node.children) { + if (cptr->name == special::xml ) continue; + if (cptr->name == special::json) continue; + + if (cptr->name == special::hdf5 || cptr->name == special::decl) { + // looks like a declaration node + if (found_dec) // already seen + detail::info_node_multiple_dec(context); + // fixme Implement top-level metadata/attributes in HDF5 + found_dec = true; + } else { + // looks like a regular node + const bool ret = detail::node2hdf5(*cptr,*h.filePtr); + h.filePtr->flush(); + if (!ret) + return false; + } + } + + } catch (...) { + log::function(context); + throw; + } + +#endif + + // done + return true; +} + + +// ----------------------------------------------------------------------------- +// HDF5 ==> HDF5 +// For completeness +// ----------------------------------------------------------------------------- + +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +inline bool convert(const HDF5 &from, HDF5 &to) +{ + // same object? + if (&to == &from) + return true; + + // clear the receiving HDF5 + to.clear(); + + // empty? + if (from.empty()) + return true; + + // from ==> to + try { + std::ifstream ifs(from.filePtr->getName(), std::ios::binary); + if (!ifs) { + log::error("Could not open file \"{}\"", from.filePtr->getName()); + // The HDF5 class is different from the XML and JSON classes in that + // it essentially employs a "file descriptor" of sorts, through the + // underlying class HighFive::File. So, unlike convert(XML,XML) and + // convert(JSON,JSON), this function - convert(HDF5,HDF5) - needs + // to create a *file* for the destination object. It cannot simply + // duplicate an internal data structure, as the analogous XML and + // JSON convert() functions do. The above error message might thus + // surprise a user, who wouldn't necessarily realize that a file is + // being created as a result of this convert(). To help clarify the + // situation, we'll write an informational note. + log::info( + "We're attempting to open this in this context because it's\n" + "behind the source HDF5 object."); + throw std::exception{}; + } + if (!to.read(ifs)) + throw std::exception{}; + } catch (...) { + log::function("convert(HDF5,HDF5)"); + throw; + } + + // done + return true; +} +#endif + + +// ----------------------------------------------------------------------------- +// XML ==> HDF5 +// JSON ==> HDF5 +// As with our convert()s to XML, these go through temporaries. +// ----------------------------------------------------------------------------- + +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +inline bool convert(const XML &x, HDF5 &h) +{ + try { + Tree tmp; + return convert(x,tmp) && convert(tmp,h); + } catch (...) { + log::function("convert(XML,HDF5)"); + throw; + } +} + +#ifndef NJOY_GNDSTK_DISABLE_JSON +inline bool convert(const JSON &j, HDF5 &h) +{ + try { + Tree tmp; + return convert(j,tmp) && convert(tmp,h); + } catch (...) { + log::function("convert(JSON,HDF5)"); + throw; + } +} +#endif +#endif diff --git a/src/GNDStk/convert/src/JSON.hpp b/src/GNDStk/convert/src/JSON.hpp index 20257eb03..aa0317ab0 100644 --- a/src/GNDStk/convert/src/JSON.hpp +++ b/src/GNDStk/convert/src/JSON.hpp @@ -1,148 +1,131 @@ -// ----------------------------------------------------------------------------- -// convert(*,JSON) -// That is, convert to JSON objects -// ----------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- // Node ==> JSON // ----------------------------------------------------------------------------- inline bool convert(const Node &node, JSON &j) { - // clear - j.clear(); + static const std::string context = "convert(Node,JSON)"; - // See comments for convert(Node,XML); smiilar ones apply here, except - // that JSON files don't have declaration nodes. +#ifdef NJOY_GNDSTK_DISABLE_JSON + + (void)node; (void)j; + log::error( + "We can't make the conversion " + context + ", because the code\n" + "has been compiled with JSON disabled (macro NJOY_GNDSTK_DISABLE_JSON)."); + log::function(context); + throw std::exception{}; + +#else + + // clear the receiving JSON + j.clear(); - static const std::string context = "convert(Node,JSON)"; try { + // ------------------------ + // Node + // ------------------------ - // Probably a regular Node - if (node.name != "") - return detail::node2json(node, j.doc); + if (node.name != "/") + return detail::node2json(node,j.doc); - // Probably a Tree... + // ------------------------ + // Tree + // ------------------------ - if (node.metadata.size() != 0) { - log::warning( - "Encountered Node with empty name \"\",\n" - "but the Node also contains metadata.\n" - "Not expected in this context. We'll ignore the metadata." - ); - log::function(context); - } + detail::warn_node_top_metadata(node,context); + bool found_dec = false; - bool found_decl = false; - bool found_top = false; + for (const auto &cptr : node.children) { + if (cptr->name == special::xml ) continue; + if (cptr->name == special::hdf5) continue; - for (auto &c : node.children) { - if (c->name == "xml" || c->name == "json" || c->name == "hdf5") { + if (cptr->name == special::json || cptr->name == special::decl) { // looks like a declaration node - if (found_decl) { - // already seen - log::warning( - "Encountered Node with empty name \"\",\n" - "and > 1 child nodes that look like " - "declaration nodes.\n" - "Not expected in this context. " - "For JSON, we're ignoring declaration nodes anyway." - ); - log::function(context); - } - found_decl = true; + if (found_dec) // already seen + detail::info_node_multiple_dec(context); + // fixme Implement top-level metadata/attributes in JSON + found_dec = true; } else { // looks like a regular node - if (found_top) { - // already seen - log::warning( - "Encountered Node with empty name \"\",\n" - "and > 1 child nodes that look like " - "regular (non-declaration) nodes.\n" - "Not expected in this context. " - "We'll convert all the child nodes." - ); - log::function(context); - } - if (!detail::node2json(*c, j.doc)) + if (!detail::node2json(*cptr,j.doc)) return false; - found_top = true; } } } catch (...) { - log::function("convert(Tree,JSON)"); + log::function(context); throw; } +#endif + // done return true; } - // ----------------------------------------------------------------------------- -// Tree ==> JSON +// JSON ==> JSON +// For completeness // ----------------------------------------------------------------------------- -inline bool convert(const Tree &tree, JSON &j) +#ifndef NJOY_GNDSTK_DISABLE_JSON +inline bool convert(const JSON &from, JSON &to) { + // same object? + if (&to == &from) + return true; + + // clear the receiving JSON + to.clear(); + + // empty? + if (from.empty()) + return true; + + // from ==> to try { - if (tree.has_top()) - detail::check_top(tree.top().name, "Tree", "convert(Tree,JSON)"); - return convert(*(const Node *)&tree, j); + to.doc = from.doc; // orderedJSON's assignment } catch (...) { - log::function("convert(Tree,JSON)"); + log::function("convert(JSON,JSON)"); throw; } -} + // done + return true; +} +#endif // ----------------------------------------------------------------------------- -// XML ==> JSON +// XML ==> JSON +// HDF5 ==> JSON +// As with our convert()s to XML, these go through temporaries. // ----------------------------------------------------------------------------- -// Goes through a tree. Could be made more efficient if written directly. -// We'll revisit this if it becomes more of an issue. +#ifndef NJOY_GNDSTK_DISABLE_JSON inline bool convert(const XML &x, JSON &j) { - // temporary - Tree t; - - // convert try { - return convert(x,t) && convert(t,j); + Tree tmp; + return convert(x,tmp) && convert(tmp,j); } catch (...) { log::function("convert(XML,JSON)"); throw; } } - - -// ----------------------------------------------------------------------------- -// JSON ==> JSON -// For completeness -// ----------------------------------------------------------------------------- - -inline bool convert(const JSON &from, JSON &to) +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +inline bool convert(const HDF5 &h, JSON &j) { - if (&to == &from) - return true; - - // clear - to.clear(); - - // convert try { - to.doc = from.doc; // nlohmann::json's assignment + Tree tmp; + return convert(h,tmp) && convert(tmp,j); } catch (...) { - log::function("convert(JSON,JSON)"); + log::function("convert(HDF5,JSON)"); throw; } - - // done - return true; } +#endif +#endif diff --git a/src/GNDStk/convert/src/Node.hpp b/src/GNDStk/convert/src/Node.hpp new file mode 100644 index 000000000..ff2689b5b --- /dev/null +++ b/src/GNDStk/convert/src/Node.hpp @@ -0,0 +1,231 @@ + +// ----------------------------------------------------------------------------- +// XML ==> Node +// ----------------------------------------------------------------------------- + +inline bool convert(const XML &x, Node &node, const bool &DECL) +{ + const bool decl = detail::getDecl(node,DECL); + + // ------------------------ + // bookkeeping + // ------------------------ + + // clear the receiving node + node.clear(); + + // optionally, make a boilerplate declaration node + if (decl) { + node.name = "/"; + node.add(special::xml); // "we built the object from an XML" + } + + // empty xml document? + if (x.empty()) + return true; + + try { + + // ------------------------ + // validate + // ------------------------ + + // Validation, itself, is independent of whether decl is true or false + + size_t size = 0; + std::string one, two; + for (const pugi::xml_node &xnode : x.doc) { + size++; + if (size == 1) + one = xnode.name(); + else if (size == 2) + two = xnode.name(); + else { + log::error( + "More than two main nodes in the XML\n", + "You can have up to " + "one declaration node and " + "one document node" + ); + throw std::exception{}; + } + } + + // possibly redundant with the earlier empty() test, but harmless + if (size == 0) + return true; + + // if two main nodes, they can't be of the same type + if (size == 2) { + if (one == "xml" && two == "xml") { + log::error("Two declaration nodes in the XML"); + throw std::exception{}; + } + if (one != "xml" && two != "xml") { + log::error("Two document nodes in the XML"); + throw std::exception{}; + } + } + + // ------------------------ + // convert the nodes + // ------------------------ + + for (const pugi::xml_node &xnode : x.doc) { + const std::string name = xnode.name(); + + if (name == "xml") { + // Declaration node + // Retrieve any XML attributes, e.g. version and encoding + if (decl) + for (const pugi::xml_attribute &xattr : xnode.attributes()) + node.one(special::xml).add(xattr.name(), xattr.value()); + } else { + // Document node + // Visit the node, and its children recursively + if (!detail::xml2node(xnode, decl ? node.add() : node)) + return false; + } + } + } catch (...) { + log::function("convert(XML,Node)"); + throw; + } + + // done + return true; +} + + + +// ----------------------------------------------------------------------------- +// JSON ==> Node +// ----------------------------------------------------------------------------- + +inline bool convert(const JSON &j, Node &node, const bool &DECL) +{ + static const std::string context = "convert(JSON,Node)"; + +#ifdef NJOY_GNDSTK_DISABLE_JSON + + (void)j; (void)node; (void)DECL; + log::error( + "We can't make the conversion " + context + ", because the code\n" + "has been compiled with JSON disabled (macro NJOY_GNDSTK_DISABLE_JSON)."); + log::function(context); + throw std::exception{}; + +#else + + const bool decl = detail::getDecl(node,DECL); + + // clear the receiving node + node.clear(); + + // optionally, make a boilerplate declaration node + if (decl) { + node.name = "/"; + node.add(special::json); // "we built the object from a JSON" + } + + // empty json document? + if (j.empty()) + return true; + + try { + // j.doc gives a JSON "object": {...}, i.e. a JSON brace construct, + // as opposed to a JSON key/value pair or specific JSON entity such + // as integer or boolean. Elsewhere, in recursive calls to the below + // function, we'd have already determined a node's name from a key. + // In this context, however, we don't have a key. The trailing "true" + // tells json2node to infer node.name from the contents of the {...}. + detail::json2node(j.doc, decl ? node.add() : node, true); + return true; + } catch (...) { + log::function(context); + throw; + } + +#endif +} + + + +// ----------------------------------------------------------------------------- +// HDF5 ==> Node +// ----------------------------------------------------------------------------- + +/* +Remark + +HighFive::File references an entire HDF5 file. By extension, this applies to +GNDStk::HDF5 - our simple wrapper around HighFive::File that helps us to provide +uniform behavior between XML, JSON, and HDF5. Unlike XML and JSON, it apparently +can't reference just part of such a file, i.e. part of an HDF5 hierarchy. So, +convert(HDF5,Tree) may be more meaningful than convert(HDF5,Node), as Tree is +specifically for a full GNDS hierarchy, Node for possibly a partial hierarchy. +Consistent with how we handle conversions from XML and JSON, however, we define +the conversion in terms of Node (from which Tree is, of course, derived), and +then guess, based on the Node's name, whether it's a Tree, or a Node proper. We +may consider, at some point, having a convert(HighFive::Group,Node), i.e. with a +HighFive::Group rather than a HighFive::File, but such a function might or might +not prove to be useful. A HighFive::Group would come from a HighFive::File; it +wouldn't be a string on its own, like a "snippet" of XML or JSON. +*/ + +inline bool convert(const HDF5 &h, Node &node, const bool &DECL) +{ + static const std::string context = "convert(HDF5,Node)"; + +#ifdef NJOY_GNDSTK_DISABLE_HDF5 + + (void)h; (void)node; (void)DECL; + log::error( + "We can't make the conversion " + context + ", because the code\n" + "has been compiled with HDF5 disabled (macro NJOY_GNDSTK_DISABLE_HDF5)."); + log::function(context); + throw std::exception{}; + +#else + + const bool decl = detail::getDecl(node,DECL); + + // clear the receiving node + node.clear(); + + // optionally, make a boilerplate declaration node + Node *declnode = nullptr; + if (decl) { + node.name = "/"; + declnode = &node.add(special::hdf5); // "we built the object from an HDF5" + } + + // empty HDF5 document? + if (h.empty()) + return true; + + // not empty in the earlier (h.filePtr == nullptr) sense, + // but with no real content in the HDF5 document? + const HighFive::Group &rootGroup = h.filePtr->getGroup("/"); + if (rootGroup.getNumberAttributes() == 0 && + rootGroup.getNumberObjects() == 0) + return true; + + try { + // if decl, then place any top-level attributes that exist, in the HDF5, + // into the Node's special::hdf5 child that would have been created above + + if (decl) + for (const auto &attrName : rootGroup.listAttributeNames()) + if (!detail::attr2node(rootGroup.getAttribute(attrName),*declnode)) + return false; + + // visit the rest of the root HDF5 group + return detail::hdf52node(rootGroup, "/", node, decl); + } catch (...) { + log::function(context); + throw; + } + +#endif +} diff --git a/src/GNDStk/convert/src/XML.hpp b/src/GNDStk/convert/src/XML.hpp index cb3e90592..5ffed9e39 100644 --- a/src/GNDStk/convert/src/XML.hpp +++ b/src/GNDStk/convert/src/XML.hpp @@ -1,100 +1,77 @@ -// ----------------------------------------------------------------------------- -// convert(*,XML) -// That is, convert to XML objects -// ----------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- // Node ==> XML // ----------------------------------------------------------------------------- inline bool convert(const Node &node, XML &x) { - // clear + static const std::string context = "convert(Node,XML)"; + + // clear the receiving XML x.clear(); - // We recognize here that the Node could in fact be the base of a Tree, + // We recognize below that the Node could in fact be the base of a Tree, // which might have a declaration node. If it does, then we'll preserve // the declaration node's information in the output XML object. // // The way we're storing things in Tree, a declaration node might contain, // for example, the following, if the Tree was built from an XML: // - // name: "xml" + // name: #xml // metadata: // "version", "1.0" // "encoding", "UTF-8" // children: - // N/A + // (none) // - // or this if the Tree was built from a JSON: - // - // name: "json" - // metadata: - // (nothing; empty vector) - // children: - // N/A - // - // or something else if the Tree was built in another manner. In an XML - // file, the declaration node is the thing like: . + // In an XML file, the declaration node is the construct that optionally + // can appear at the beginning, and looks like: . - static const std::string context = "convert(Node,XML)"; try { - - if (node.name != "") { - // A Tree should have name == "" at the root level, so we don't - // consider this to be a Tree. Just do a straight Node conversion. - return detail::node2xml(node, x.doc); + // ------------------------ + // Node + // ------------------------ + + if (node.name != "/") { + // A Tree should have name "/" at the root level, so this looks + // like it's garden-variety Node. Do a straight Node conversion. + return detail::node2xml(node,x.doc); } - // Henceforth it's presumably a Tree, unless someone gave the name "" - // to a regular node, which they really shouldn't have done... + // Henceforth it's presumably a Tree, unless someone gave the root Tree- + // node name to a regular node, which they really shouldn't have done. - if (node.metadata.size() != 0) { - log::warning( - "Encountered Node with empty name \"\",\n" - "but the Node also contains metadata.\n" - "Not expected in this context. We'll ignore the metadata." - ); - log::function(context); - } + // ------------------------ + // Tree + // ------------------------ + + detail::warn_node_top_metadata(node,context); + bool found_dec = false; + bool found_top = false; - pugi::xml_node xdecl; - bool found_decl = false; - bool found_top = false; + for (const auto &cptr : node.children) { + if (cptr->name == special::json) continue; + if (cptr->name == special::hdf5) continue; - for (auto &c : node.children) { - if (c->name == "xml" || c->name == "json" || c->name == "hdf5") { + if (cptr->name == special::xml || cptr->name == special::decl) { // looks like a declaration node - if (found_decl) { - // already seen - log::warning( - "Encountered Node with empty name \"\",\n" - "and > 1 child nodes that look like " - "declaration nodes.\n" - "Not expected in this context. " - "We'll combine the metadata." - ); - log::function(context); - } else + pugi::xml_node xdecl; + if (found_dec) // already seen + detail::info_node_multiple_dec(context); + else xdecl = x.doc.append_child(pugi::node_declaration); - for (auto &meta : c->metadata) + for (const auto &meta : cptr->metadata) xdecl.append_attribute(meta.first.data()) = meta.second.data(); - found_decl = true; + found_dec = true; } else { // looks like a regular node - if (found_top) { - // already seen - log::warning( - "Encountered Node with empty name \"\",\n" - "and > 1 child nodes that look like " - "regular (non-declaration) nodes.\n" - "Not expected in this context. " - "We'll convert all the child nodes." - ); + if (found_top) { // already seen + log::info( + "Node has name \"/\" and multiple \"document nodes\".\n" + "This is nonstandard in XML, but we'll write them all."); log::function(context); } - if (!detail::node2xml(*c, x.doc)) + if (!detail::node2xml(*cptr,x.doc)) return false; found_top = true; } @@ -110,25 +87,6 @@ inline bool convert(const Node &node, XML &x) } - -// ----------------------------------------------------------------------------- -// Tree ==> XML -// ----------------------------------------------------------------------------- - -inline bool convert(const Tree &tree, XML &x) -{ - try { - if (tree.has_top()) - detail::check_top(tree.top().name, "Tree", "convert(Tree,XML)"); - return convert(*(const Node *)&tree, x); - } catch (...) { - log::function("convert(Tree,XML)"); - throw; - } -} - - - // ----------------------------------------------------------------------------- // XML ==> XML // For completeness @@ -136,63 +94,76 @@ inline bool convert(const Tree &tree, XML &x) inline bool convert(const XML &from, XML &to) { + // same object? if (&to == &from) return true; - // clear + // clear the receiving XML to.clear(); - // Unfortunately, we can't use pugi::xml_document's assignment, or for - // that matter its copy constructor, because, for whatever reason, the - // pugi library makes those private. (And, perhaps, those have shallow- - // copy semantics, too. I haven't checked into that, because we can't - // use those anyway.) + // empty? + if (from.empty()) + return true; - // For now, I'll write something simple that works, although not very - // efficiently: write "from" to a stringstream, then read "to" out of - // the stringstream. The GNDS files that I've seen so far aren't large - // enough to make this untenable. We can revisit this issue if and when - // it becomes necessary to be more efficient. + // It seems that pugi::xml_document's assignment operator, and for that + // matter its copy constructor, are private. So, we can't use either of + // those here. For now, then, we'll do something simple that works, but + // not very efficiently: write "from" to a stringstream, then read "to" + // from the stringstream. (Note that it's XML that's written and read.) + // The GNDS files that I've seen so far aren't large enough to make this + // problematic. We'll revisit this if and when more efficiency is needed. - // back up indentation + // back up indentation; is restored later const int indent = GNDStk::indent; - GNDStk::indent = 0; // saves memory in the stringstream + GNDStk::indent = 0; // to save memory in the intermediary stringstream - // from ==> stringstream ==> to + // from ==> temporary stringstream ==> to try { - std::stringstream ss; - from.write(ss); - to.read(ss); + std::stringstream tmp; + from.write(tmp,true); // true: include declaration node + if (!to.read(tmp)) + throw std::exception{}; } catch (...) { + GNDStk::indent = indent; log::function("convert(XML,XML)"); throw; } - // restore indentation - GNDStk::indent = indent; - // done + GNDStk::indent = indent; return true; } - // ----------------------------------------------------------------------------- // JSON ==> XML +// HDF5 ==> XML +// These go through temporaries, for compactness. They could likely be made +// more efficient if written directly. We'll revisit this issue if necessary. // ----------------------------------------------------------------------------- -// Goes through a tree. Could be made more efficient if written directly. -// We'll revisit this if it becomes more of an issue. +#ifndef NJOY_GNDSTK_DISABLE_JSON inline bool convert(const JSON &j, XML &x) { - // temporary - Tree t; - - // convert try { - return convert(j,t) && convert(t,x); + Tree tmp; + return convert(j,tmp) && convert(tmp,x); } catch (...) { log::function("convert(JSON,XML)"); throw; } } +#endif + +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +inline bool convert(const HDF5 &h, XML &x) +{ + try { + Tree tmp; + return convert(h,tmp) && convert(tmp,x); + } catch (...) { + log::function("convert(HDF5,XML)"); + throw; + } +} +#endif diff --git a/src/GNDStk/convert/src/detail-hdf52node.hpp b/src/GNDStk/convert/src/detail-hdf52node.hpp new file mode 100644 index 000000000..14751e48a --- /dev/null +++ b/src/GNDStk/convert/src/detail-hdf52node.hpp @@ -0,0 +1,350 @@ + +#ifndef NJOY_GNDSTK_DISABLE_HDF5 + +// Helper: hdf52node_error +inline void hdf52node_error(const std::string &message) +{ + log::error( + "Internal error in hdf52node():\n" + "Message: \"{}\".", message); + throw std::exception{}; +} + + +// ----------------------------------------------------------------------------- +// attr2node +// For HighFive::Attribute +// ----------------------------------------------------------------------------- + +// helper +template +bool attr2node(const HighFive::Attribute &attr, NODE &node) +{ + if (attr.getDataType() == HighFive::AtomicType{}) { + const std::string attrName = attr.getName(); + const size_t attrSize = attr.getSpace().getElementCount(); + + // Scalar case. Includes bool. + // fixme. ...or doesn't include bool. 2022-06-16, the current HighFive + // master appears to have broken HighFive's bool support, so I've + // if-constexpr'd it out here. We're not dealing with bool in the test + // suite at this time, so this is fine, at least for now. + if constexpr (!std::is_same_v) { + if (attrSize == 1) { + T scalar; + attr.read(scalar); + node.add(attrName,scalar); + return true; + } + } + + // Vector case. EXcludes bool, as HighFive (perhaps HDF5 in general?) + // doesn't appear to support it in this case. Indeed, the body of the + // if-constexpr doesn't *compile* with bool. (Hence our if-constexpr.) + if constexpr (!std::is_same_v) { + std::vector vector; + vector.reserve(attrSize); + attr.read(vector); + node.add(attrName,vector); + return true; + } + } + + return false; +} + +// attr2node +template +bool attr2node(const HighFive::Attribute &attr, NODE &node) +{ + // HighFive's documentation leaves much to be desired. I used what I found + // in HighFive/include/highfive/bits/H5DataType_misc.hpp to get an idea of + // what attribute *types* are allowed. That file also had some handling of + // C-style fixed-length strings, as with char[length], and std::complex as + // well. It didn't have long double, which I'd have liked, but that's fine. + // I won't bother with fixed-length strings or with std::complex right now, + // but will support the rest. + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + if (attr2node(attr,node)) return true; + + log::error( + "HDF5 Attribute \"{}\"'s DataType \"{}\" is not supported at this time.", + attr.getName(), attr.getDataType().string()); + log::function("attr2node()"); + + return false; +} + + +// ----------------------------------------------------------------------------- +// dset2node +// For HighFive::DataSet +// ----------------------------------------------------------------------------- + +// helper +template +bool dset2node(const HighFive::DataSet &dset, NODE &node) +{ + if (dset.getDataType() == HighFive::AtomicType{}) { + // Remarks as in the similar helper function attr2node() + const size_t dataSize = dset.getElementCount(); + + // See earlier fixme. bool support is removed for now, because it appears + // to be broken in the latest HighFive. + if constexpr (!std::is_same_v) { + if (dataSize == 1) { + T scalar; + dset.read(scalar); + node.name == special::data + ? node.add(special::text,scalar) + : node.add(special::data).add(special::text,scalar); + return true; + } + } + + if constexpr (!std::is_same_v) { + std::vector vector; + vector.reserve(dataSize); + dset.read(vector); + node.name == special::data + ? node.add(special::text,vector) + : node.add(special::data).add(special::text,vector); + return true; + } + } + + return false; +} + +// dset2node +template +bool dset2node( + const HighFive::DataSet &dset, const std::string &dsetName, + NODE &parent +) { + Node &node = parent.add( + beginsin(dsetName,special::data) ? special::data : dsetName); + + // the DataSet's attributes + for (const std::string &attrName : dset.listAttributeNames()) + if (attrName == special::nodename) + dset.getAttribute(attrName).read(node.name); + else if (!attr2node(dset.getAttribute(attrName), node)) + return false; + + // the DataSet's data + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + if (dset2node(dset,node)) return true; + + log::error( + "HDF5 DataSet \"{}\"'s DataType \"{}\" is not supported at this time.", + dsetName, dset.getDataType().string()); + log::function("dset2node()"); + + return false; +} + + +// ----------------------------------------------------------------------------- +// hdf52node +// ----------------------------------------------------------------------------- + +template +bool hdf52node( + const HighFive::Group &group, const std::string &groupName, + NODE &node, const bool decl +) { + const bool atRoot = groupName == "/"; + + // node name: from HDF5 group name + if (!decl) { + if (!atRoot) + node.name = groupName; + // strip digits from node name, if appropriate + if (node.name != "" && node.name[0] == special::prefix) + while (isdigit(node.name.back())) + node.name.pop_back(); + } + + // ------------------------ + // Group's attributes + // ==> metadata + // ------------------------ + + // Only if we're *not* at the root HDF5 group. If we are, then attributes + // would have already been handled, in a special way, by the caller. + if (!atRoot) { + for (const std::string &attrName : group.listAttributeNames()) { + if (attrName == special::nodename) { + // #nodename + // Handled not as a regular attribute, but as the present node's + // true name. The following line is basically a compressed version + // of attr2node (see early in this file). It assumes, + // in short, that this #nodename attribute is one (not a vector of) + // T == std::string. And that's precisely what it should be, given + // how GNDStk creates #nodename attributes in the first place. + group.getAttribute(attrName).read(node.name); + } else if (beginsin(attrName,special::cdata)) { + // #cdata, possibly with a numeric suffix + // Expand into a child node #cdata with a #text attribute. + std::string value; + group.getAttribute(attrName).read(value); + node.add(special::cdata).add(special::text,value); + } else if (beginsin(attrName,special::comment)) { + // #comment, possibly with a numeric suffix + // Expand into a child node #comment with a #text attribute. + std::string value; + group.getAttribute(attrName).read(value); + node.add(special::comment).add(special::text,value); + } else { + // Regular attribute + // Create a metadatum. Note that this gives the correct result + // for attributes with regular names, and also for attrName == + // special::text. + if (!attr2node(group.getAttribute(attrName), node)) + return false; + } // else if + } // for + } // if + + // ------------------------ + // Group's objects + // ==> children + // ------------------------ + + size_t count = 0; + for (const std::string &elemName : group.listObjectNames()) { + + const HighFive::ObjectType type = group.getObjectType(elemName); + if (type == HighFive::ObjectType::Group || + type == HighFive::ObjectType::Dataset + ) { + count++; + if (count > 1 && atRoot && !decl) { + log::error("More than one group and/or dataset at top HDF5 level"); + throw std::exception{}; + } + } + + switch (type) { + + // ------------------------ + // Group and DataSet are + // allowable and handled + // ------------------------ + + // Group + // ACTION: Call the present function recursively + case HighFive::ObjectType::Group : + try { + if (!hdf52node( + group.getGroup(elemName), elemName, + node.name == "" ? node : node.add(), + false + )) { + return false; + } + } catch (...) { + log::function("hdf52node()"); + throw; + } + break; + + // DataSet + // ACTION: Handle the DataSet's data + // Note: HighFive actually calls the following Dataset (lower-case s), + // not DataSet (upper-case S), but uses "DataSet" elsewhere. :-/ + case HighFive::ObjectType::Dataset : + try { + if (!dset2node( + group.getDataSet(elemName), elemName, + node + )) { + return false; + } + } catch (...) { + log::function("hdf52node()"); + throw; + } + break; + + // ------------------------ + // All other types are + // unexpected or unhandled + // ------------------------ + + // File + // NOT EXPECTED IN THIS CONTEXT + case HighFive::ObjectType::File : + hdf52node_error("ObjectType \"File\" is not expected here"); + break; + + // DataSpace (not to be confused with DataSet) + // NOT EXPECTED IN THIS CONTEXT + case HighFive::ObjectType::DataSpace : + hdf52node_error("ObjectType \"DataSpace\" is not expected here"); + break; + + // Attribute + // NOT EXPECTED IN THIS CONTEXT + case HighFive::ObjectType::Attribute : + // group.listObjectNames() (used in the for-loop we're in right + // now) apparently doesn't include attribute names - which is fine, + // because we already handled attributes earlier. So, here, we just + // produce an error if ObjectType::Attribute inexplicably made an + // appearance here, where we don't expect it. + hdf52node_error("ObjectType \"Attribute\" is not expected here"); + break; + + // UserDataType + // NOT HANDLED; These may or may not ever be needed + case HighFive::ObjectType::UserDataType : + hdf52node_error("ObjectType \"UserDataType\" is not supported"); + break; + + // Other + // NOT HANDLED; We're not sure when this would arise + case HighFive::ObjectType::Other : + hdf52node_error("ObjectType \"Other\" is not supported"); + break; + + // default + // NOT HANDLED; our switch() should have covered all bases + default: + hdf52node_error("ObjectType [unknown] is not supported"); + break; + + } // switch + } // for + + // done + return true; +} + +#endif diff --git a/src/GNDStk/convert/src/detail-json2node.hpp b/src/GNDStk/convert/src/detail-json2node.hpp new file mode 100644 index 000000000..9f6f882e7 --- /dev/null +++ b/src/GNDStk/convert/src/detail-json2node.hpp @@ -0,0 +1,176 @@ + +#ifndef NJOY_GNDSTK_DISABLE_JSON + +// Helper: json2node_error +inline void json2node_error(const std::string &message) +{ + log::error( + "Internal error in json2node():\n" + "Message: \"{}\".", message); + throw std::exception{}; +} + +// Forward declaration +template +void json2node(const json::object &, NODE &, const bool inferNodeName = false); + + +// ----------------------------------------------------------------------------- +// json_array +// ----------------------------------------------------------------------------- + +inline std::string json_array(const json::array &array) +{ + std::ostringstream oss; + size_t count = 0; + + for (const json::value &element : array) { + // separator + oss << (count++ ? " " : ""); + // array element types we use + // Remark. std::string(...) is indeed needed in the following line, + // because json::string has its own operator<< that prints the string + // in the JSON manner - with delimiting quotes. For our purposes here, + // we need the string printed as std::string does - without quotes. + element.holds() ? (oss << element.get()) + : element.holds() ? (oss << std::string(element.get())) + : // unexpected element type + (json2node_error("JSON array element is of unexpected type"), oss); + } + + return oss.str(); +} + + +// ----------------------------------------------------------------------------- +// json_pair +// ----------------------------------------------------------------------------- + +template +void json_pair( + const std::string &key, const json::value &val, + const json::object &peers, NODE &node +) { + if (val.holds()) { + // null; nothing to do + } else if (val.holds()) { + // boolean + node.add(key, val.get() ? "true" : "false"); + } else if (val.holds()) { + // number + std::visit( + [&node,&key](auto &&alt) + { + node.add(key,alt); + }, + json::number::variant(val.get()) + ); + } else if (val.holds()) { + // string + node.add(key, val.get()); + } else if (val.holds()) { + // array + if (peers.size() == 0) { + // context is such that it's metadata + node.add(key, json_array(val.get())); + } else { + node.add(special::data) + .add(special::text, json_array(val.get())); + for (const auto &peer : peers) { + if (peer.first == key + special::nodename) + node.name = peer.second.get(); + if (peer.first == key + special::metadata) { + for (const auto &m : peer.second.pairs()) + json_pair(m.first, m.second, json::object{}, node); + } + } + } + } else if (val.holds()) { + // object + try { + json2node(val.get(),node); + } catch (...) { + log::function("json2node()"); + throw; + } + } else { + // unexpected + json2node_error("JSON key/value pair's value is of unexpected type"); + } +} + + +// ----------------------------------------------------------------------------- +// json2node +// ----------------------------------------------------------------------------- + +// NODE is GNDStk::Node, an incomplete type to the compiler here. +// Note: the object parameter is a JSON "object", i.e. {...}. +template +void json2node(const json::object &object, NODE &node, bool inferNodeName) +{ + // The node sent here shouldn't already have metadata or children + if (node.metadata.size() != 0 || node.children.size() != 0) + json2node_error("Node should be empty, but has metadata and/or children"); + + // Special node names (special::prefix...) need trailing digits removed + if (node.name != "" && node.name[0] == special::prefix) + while (isdigit(node.name.back())) + node.name.pop_back(); + + // For each key/value pair + for (const auto &pair : object) { + const std::string &key = pair.first; + const json::value &val = pair.second; + + if (inferNodeName && key.find(special::prefix) == std::string::npos) { + // Infer the node name from this (non-special) key + node.name = key; + inferNodeName = false; + json_pair(key, val, object, node); + } else if (key == special::nodename) { + // Special key: nodename + node.name = val.get(); + inferNodeName = false; + } else if (key == special::metadata) { + // Special key: metadata + for (const auto &m : val.pairs()) + json_pair(m.first, m.second, json::object{}, node); + } else if ( + beginsin(key,special::cdata) || + beginsin(key,special::comment) || + beginsin(key,special::data) + ) { + // Special key: cdata, comment, or data, with optional suffix + if (val.holds()) { + try { + json2node(val.get(), node.add(key)); + } catch (...) { + log::function("json2node()"); + throw; + } + } else { + beginsin(key,special::data) + ? node.add(special::data ) + .add(special::text, json_array(val.get())) + : beginsin(key,special::cdata) + ? node.add(special::cdata ) + .add(special::text, val.get()) + : node.add(special::comment) + .add(special::text, val.get()); + } + } else if (endsin(key,special::nodename) || + endsin(key,special::metadata)) { + // Special key: with nodename or metadata *suffix* + // Ignore, in this context. Note that key *equal* to either of those + // was handled earlier. The cases here are dealt with in json_pair(), + // called below. There, we process e.g. "foo", and scan object to + // process "foo*" where * is either of the relevant suffixes. + } else { + // Normal key + json_pair(key, val, object, node.add(key)); + } + } // key/value pairs +} + +#endif diff --git a/src/GNDStk/convert/src/detail-node2hdf5.hpp b/src/GNDStk/convert/src/detail-node2hdf5.hpp new file mode 100644 index 000000000..4c24cabe0 --- /dev/null +++ b/src/GNDStk/convert/src/detail-node2hdf5.hpp @@ -0,0 +1,373 @@ + +#ifndef NJOY_GNDSTK_DISABLE_HDF5 + +// ----------------------------------------------------------------------------- +// Helpers +// ----------------------------------------------------------------------------- + +// ------------------------ +// scalar2Attr +// vector2Attr +// ------------------------ + +// scalar2Attr +template +void scalar2Attr( + const std::string &key, const std::string &value, + OBJECT &hdf5 +) { + T scalar; + convert(value,scalar); + hdf5.createAttribute(key,scalar); +} + +// vector2Attr +template +void vector2Attr( + const std::string &key, const std::string &value, + OBJECT &hdf5 +) { + std::vector vector; + convert(value,vector); + hdf5.createAttribute(key,vector); +} + + +// ------------------------ +// data2DataSet +// ------------------------ + +// helper +template +HighFive::DataSet data2DataSet( + const std::string &key, const std::string &value, + OBJECT &hdf5 +) { + // Similar to vector2Attr() above, but creates a DataSet, not an Attribute. + // Note that in the JSON-format analogs of the various helper functions in + // this section of code, an analog of *this* function doesn't exist. JSON + // doesn't have HDF5's distinction between "attributes" and "data sets". + // Therefore, writing a vector (as we do above, via createAttribute(), and + // here, via createDataSet()) is done, in JSON, in just one way: by creating + // a JSON key:value pair with the vector as the value. So, in the JSON code, + // we have an analog of the above vector2Attr() function, and that function + // is also used where this present function would otherwise have been used. + std::vector vector; + convert(value,vector); + return hdf5.createDataSet(key,vector); +} + +// w/ type string +template +HighFive::DataSet data2DataSet( + const std::string &key, const std::string &value, + OBJECT &hdf5 +) { + if (HDF5::typed) { + const std::string type = guessType(value); + + if (type == "int" || type == "ints" ) + return data2DataSet(key,value,hdf5); + if (type == "uint" || type == "uints" ) + return data2DataSet(key,value,hdf5); + if (type == "long" || type == "longs" ) + return data2DataSet(key,value,hdf5); + if (type == "ulong" || type == "ulongs" ) + return data2DataSet(key,value,hdf5); + if (type == "double" || type == "doubles") + return data2DataSet(key,value,hdf5); + } + return data2DataSet(key,value,hdf5); +} + + +// ----------------------------------------------------------------------------- +// meta2hdf5* +// See remarks in the JSON analogs of these functions. +// ----------------------------------------------------------------------------- + +// ------------------------ +// meta2hdf5_typed +// ------------------------ + +template +void meta2hdf5_typed(const NODE &node, OBJECT &hdf5) +{ + const std::string &parent = node.name; + + for (const auto &meta : node.metadata) { + const std::string &key = meta.first; + const std::string &value = meta.second; + + // ------------------------ + // Special cases + // ------------------------ + + // *** #cdata/#text + // *** #comment/#text + if ((parent == special::cdata || + parent == special::comment) && key == special::text) { + hdf5.createAttribute(key,value); // just a simple string attribute + continue; + } + + // *** #data/#text + if (parent == special::data && key == special::text) { + const std::string type = guessType(value); + if (type == "int" || type == "ints") + vector2Attr(key,value,hdf5); + else if (type == "uint" || type == "uints") + vector2Attr(key,value,hdf5); + else if (type == "long" || type == "longs") + vector2Attr(key,value,hdf5); + else if (type == "ulong" || type == "ulongs") + vector2Attr(key,value,hdf5); + else if (type == "double" || type == "doubles") + vector2Attr(key,value,hdf5); + else + vector2Attr(key,value,hdf5); + continue; + } + + // *** key/#text not expected, except as already handled + if (key == special::text) { + log::warning("Metadatum \"{}\" not expected here; writing anyway", + special::text); + log::function("detail::meta2hdf5(Node named \"{}\", ...)", parent); + } + + // ------------------------ + // General case + // ------------------------ + + // *** key/value + const std::string type = guessType(value); + if (type == "int" ) scalar2Attr(key,value,hdf5); else + if (type == "ints" ) vector2Attr(key,value,hdf5); else + if (type == "uint" ) scalar2Attr(key,value,hdf5); else + if (type == "uints" ) vector2Attr(key,value,hdf5); else + if (type == "long" ) scalar2Attr(key,value,hdf5); else + if (type == "longs" ) vector2Attr(key,value,hdf5); else + if (type == "ulong" ) scalar2Attr(key,value,hdf5); else + if (type == "ulongs" ) vector2Attr(key,value,hdf5); else + if (type == "double" ) scalar2Attr(key,value,hdf5); else + if (type == "doubles") vector2Attr(key,value,hdf5); else + /* string OR strings*/ scalar2Attr(key,value,hdf5); + } +} // meta2hdf5_typed + + +// ------------------------ +// meta2hdf5_plain +// ------------------------ + +// Here, OBJECT hdf5 is either a HighFive::Group or a HighFive::DataSet +template +void meta2hdf5_plain(const NODE &node, OBJECT &hdf5) +{ + for (const auto &meta : node.metadata) + hdf5.createAttribute(meta.first, meta.second); +} + + +// ------------------------ +// meta2hdf5 +// ------------------------ + +template +void meta2hdf5( + const NODE &node, OBJECT &hdf5, + const std::string &base, + const std::string &digits +) { + // Create #nodename iff necessary. See remarks in the analogous JSON code. + if (digits != "" && + !beginsin(base,std::string(1,special::prefix))) + hdf5.createAttribute(special::nodename, node.name); + + // Existing metadata + HDF5::typed + ? meta2hdf5_typed(node,hdf5) + : meta2hdf5_plain(node,hdf5); +} + + +// ----------------------------------------------------------------------------- +// hdf5_reduce_* +// ----------------------------------------------------------------------------- + +// ------------------------ +// hdf5_reduce_cdata_comment +// ------------------------ + +// Simplify certain #cdata and #comment cases. +template +bool hdf5_reduce_cdata_comment( + const NODE &node, OBJECT &hdf5, const std::string &suffix +) { + const std::string nameOriginal = node.name; + const std::string nameSuffixed = node.name + suffix; + + // #cdata or #comment + // #text the only metadatum + // no children + // Reduce to: string attribute, w/name == (#cdata or #comment) + suffix + // Sketch: + // +-----------------+ +-----------+ + // | #cdata/#comment | ==> | Attribute | name: #cdata/#comment + suffix + // | #text | | value | + // +-----------------+ +-----------+ + + if ( + (nameOriginal == special::cdata || nameOriginal == special::comment) && + node.children.size() == 0 && + node.metadata.size() == 1 && + node.metadata[0].first == special::text + ) { + // string attribute + hdf5.createAttribute(nameSuffixed,node.metadata[0].second); + return true; + } + + return false; +} + + +// ------------------------ +// hdf5_reduce_data +// ------------------------ + +// Simplify #data case. +template +bool hdf5_reduce_data( + const NODE &node, OBJECT &hdf5, const std::string &suffix +) { + const std::string nameOriginal = node.name; + const std::string nameSuffixed = node.name + suffix; + + // #data + // #text the only metadatum + // no children + // Reduce to: data set, w/name == #data + suffix + // Sketch: + // +----------+ +---------+ + // | #data | ==> | DataSet | name: #data + suffix + // | #text | | data | + // +----------+ +---------+ + + if (nameOriginal == special::data && + node.children.size() == 0 && + node.metadata.size() == 1 && + node.metadata[0].first == special::text + ) { + // See the remark in the analogous JSON function regarding the difference + // between this function and the one immediately below. + + // HDF5 data set + data2DataSet(nameSuffixed, node.metadata[0].second, hdf5); + return true; + } + + return false; +} + + +// ------------------------ +// hdf5_reduce_data_metadata +// ------------------------ + +// Simplify case of node with #data AND metadata +template +bool hdf5_reduce_data_metadata( + const NODE &node, OBJECT &hdf5, const std::string &suffix +) { + // name (think e.g. "values", as in XML ) + // any number of metadata (possibly 0) + // #data the only child + // #text the only metadatum + // no children + // Reduce to: data set, w/name == name + suffix + // Sketch: + // +---------------+ +----------------+ + // | name | ==> | DataSet | name: name + suffix + // | [metadata] | | [Attributes] | + // | #data | | data | + // | #text | +----------------+ + // | - | + // +---------------+ + + if (node.children.size() == 1 && + node.children[0]->name == special::data && + node.children[0]->metadata.size() == 1 && + node.children[0]->metadata[0].first == special::text && + node.children[0]->children.size() == 0 + ) { + // HDF5 data set + const std::string text = node.children[0]->metadata[0].second; + HighFive::DataSet dataset = data2DataSet(node.name+suffix, text, hdf5); + + // metadata + meta2hdf5(node, dataset, node.name, suffix); + return true; + } + + return false; +} + + +// ----------------------------------------------------------------------------- +// node2hdf5 +// ----------------------------------------------------------------------------- + +// NODE is just GNDStk::Node. The latter isn't used directly, because +// it's an "incomplete type", to the compiler, at this point. +// OBJECT is either HighFive::File or HighFive::Group. +template +bool node2hdf5(const NODE &node, OBJECT &h, const std::string &suffix = "") +{ + const std::string nameSuffixed = node.name + suffix; + + // ------------------------ + // Special cases + // ------------------------ + + if (HDF5::reduced && ( + hdf5_reduce_cdata_comment(node,h,suffix) || + hdf5_reduce_data (node,h,suffix) || + hdf5_reduce_data_metadata(node,h,suffix) + )) + return true; + + // ------------------------ + // General case + // ------------------------ + + // Create a new Group, in parameter h, for metadata and children + HighFive::Group group = h.createGroup(nameSuffixed); + + // metadata + meta2hdf5(node, group, node.name, suffix); + + // children - preprocess + // To understand this, see the remark in the JSON analog. + std::map childNames; + for (const auto &c : node.children) { + auto iter = childNames.find(c->name); + if (iter == childNames.end()) + childNames.insert({c->name,0}); + else + iter->second = 1; + } + + // children + for (const auto &c : node.children) { + const size_t counter = childNames.find(c->name)->second++; + if (!node2hdf5(*c, group, counter ? std::to_string(counter-1) : "")) + return false; + } + + // done + return true; +} + +#endif diff --git a/src/GNDStk/convert/src/detail-node2json.hpp b/src/GNDStk/convert/src/detail-node2json.hpp new file mode 100644 index 000000000..a4e458bdc --- /dev/null +++ b/src/GNDStk/convert/src/detail-node2json.hpp @@ -0,0 +1,471 @@ + +#ifndef NJOY_GNDSTK_DISABLE_JSON + +// ----------------------------------------------------------------------------- +// Helpers +// ----------------------------------------------------------------------------- + +// ------------------------ +// scalar2Value +// vector2Value +// ------------------------ + +// scalar2Value +template +void scalar2Value( + const std::string &key, const std::string &value, + json::object &json +) { + // Parameter "value" is a string - for example "1", "2.34", or "foo". The + // caller will have guessed T == int, T == double, or T == std::string in + // those cases. In the present function, we wish to write std::string value + // AS-IS into the value part of a JSON key/value pair. However, when T is + // a number, like int or double, we wish to write it as a JSON number - so, + // without quotes. In constrast, only when T == std::string will we write + // it as a JSON string. Note that even when it's really a number, the value + // parameter arrives here as a std::string, because our (very customizable) + // handling of formatting and significant digits requires this. Here, right + // now, we can assume that a "number" inside std::string reflects the exact + // way that we want the number to be printed. + + if constexpr (std::is_same_v) { + // Write JSON string. + json[key] = value; + } else { + // Write JSON number (so unquoted, unlike in the string case above), + // but write the "number" exactly as it appears in parameter "value", + // which the caller guessed contains a number: "1", "2.34", etc. + // + // todo Now that we've switched to our own JSON library, not the one + // mentioned just below, we should be able to handle formatting. + // fixme Unfortunately, the nlohmann/json library does not, at the + // present time, allow us to write our string as a number - without + // quotes. It'll format the number as it wants to. Given that GNDStk + // allows fine control over the formatting of floating-point numbers, + // we'll need to deal with this at some point, to have our formatting + // be respected in JSON output. + T scalar; + convert(value,scalar); + json[key] = scalar; // For now. Later, write the value literally + } +} + +// vector2Value +template +void vector2Value( + const std::string &key, const std::string &value, + json::object &json +) { + // Like the scalar case, but value is, for example, "1 2", "3.4 5.6 7.8", + // or "foo bar baz" - a vector of T == int, T = double, or T == std::string. + if constexpr (std::is_same_v) { + // Write JSON array of strings. + std::vector vector; + convert(value,vector); // single string ==> vector + json[key] = vector; + } else { + // Write JSON array of numbers. + // fixme Basically, the same fixme as above. For now, the "else" code + // here is the same as the "if" code, but that'll change. + std::vector vector; // For now. Later, std::vector... + convert(value,vector); + json[key] = vector; // For now. Later, write each string literally + } +} + + +// ------------------------ +// data2Value +// ------------------------ + +inline void data2Value( + const std::string &key, const std::string &value, + json::object &json +) { + if (JSON::typed) { + const std::string type = guessType(value); + + if (type == "int" || type == "ints" ) + { vector2Value(key,value,json); return; } + if (type == "uint" || type == "uints" ) + { vector2Value(key,value,json); return; } + if (type == "long" || type == "longs" ) + { vector2Value(key,value,json); return; } + if (type == "ulong" || type == "ulongs" ) + { vector2Value(key,value,json); return; } + if (type == "double" || type == "doubles") + { vector2Value(key,value,json); return; } + } + vector2Value(key,value,json); +} + + +// ----------------------------------------------------------------------------- +// meta2json* +// ----------------------------------------------------------------------------- + +// ------------------------ +// meta2json_typed +// ------------------------ + +// Use our "guess what's in the string" code to try to infer what each +// metadatum's string value actually contains (a single int, say, or +// a vector of doubles). Use the inferred types in the JSON file. +template +void meta2json_typed(const NODE &node, json::object &json) +{ + // Current node is the parent of its metadata + const std::string &parent = node.name; + + for (const auto &meta : node.metadata) { + const std::string &key = meta.first; + const std::string &value = meta.second; + + // ------------------------ + // Special cases + // ------------------------ + + // *** #cdata/#text + // *** #comment/#text + // ACTION: Write these as-is. That is, do NOT apply our type-guessing code + // to a comment, or to the contents of a block like those + // that we see in existing XML-format GNDS files. The type guesser would + // see words, and think "vector of [whitespace-separated] strings," which + // would be wrong for what are clearly intended to be free-form strings. + if ((parent == special::cdata || + parent == special::comment) && key == special::text) { + json[key] = value; // just a simple string value + continue; + } + + // *** #data/#text + // ACTION: Apply our type-guessing code, but write *vectors* only, never + // scalars. So, 10 produces a vector with one element, + // NOT a scalar; while 10 20 30 produces a vector with + // three elements. What may look like scalars are made into vectors + // because we think this reflects what these data nodes are intended + // to represent. (If something was really just a scalar, then surely it + // would be placed into standard metadata (in <...>), not into data. + if (parent == special::data && key == special::text) { + const std::string type = guessType(value); + if (type == "int" || type == "ints") + vector2Value(key,value,json); + else if (type == "uint" || type == "uints") + vector2Value(key,value,json); + else if (type == "long" || type == "longs") + vector2Value(key,value,json); + else if (type == "ulong" || type == "ulongs") + vector2Value(key,value,json); + else if (type == "double" || type == "doubles") + vector2Value(key,value,json); + else + vector2Value(key,value,json); + continue; + } + + // *** key/#text not expected, except as already handled + if (key == special::text) { + log::warning("Metadatum \"{}\" not expected here; writing anyway", + special::text); + log::function("detail::meta2json(Node named \"{}\", ...)", parent); + } + + // ------------------------ + // General case + // ------------------------ + + // *** key/value + // ACTION: Apply our type-guessing code. + // Here we have normal metadata, as in . + // For numeric types we might produce vectors, if there appear to be + // multiple values. But for string types, we'll assume that the value + // is probably intended to be a free-form, human-readable descriptive + // string, which shouldn't be split into tokens and made into a vector. + const std::string type = guessType(value); + if (type == "int" ) scalar2Value(key,value,json); else + if (type == "ints" ) vector2Value(key,value,json); else + if (type == "uint" ) scalar2Value(key,value,json); else + if (type == "uints" ) vector2Value(key,value,json); else + if (type == "long" ) scalar2Value(key,value,json); else + if (type == "longs" ) vector2Value(key,value,json); else + if (type == "ulong" ) scalar2Value(key,value,json); else + if (type == "ulongs" ) vector2Value(key,value,json); else + if (type == "double" ) scalar2Value(key,value,json); else + if (type == "doubles") vector2Value(key,value,json); else + /* string OR strings*/ scalar2Value(key,value,json); + } +} // meta2json_typed + + +// ------------------------ +// meta2json_plain +// ------------------------ + +// Write simple JSON in which all metadata, as well as the contents +// of #cdata and #data nodes) end up being strings. Not even vectors +// of strings, as from H He Li ..., but single strings. +template +void meta2json_plain(const NODE &node, json::object &json) +{ + for (const auto &meta : node.metadata) + json[meta.first] = meta.second; +} + + +// ------------------------ +// meta2json +// ------------------------ + +template +void meta2json( + const NODE &node, json::object &json, + const std::string &base, + const std::string &digits, + const std::string &prefix +) { + // Create #nodename iff necessary, to allow recovery of the node's original + // name. Note that #nodename isn't necessary for special nodes, in particular + // #cdata, #data, and #comment. For those, we can reliably reconstruct the + // original name by removing trailing digits. A regular node, in contrast, + // *might* have an actual name that has trailing digits (one user called a + // node "sigma0", for example); or, trailing digits might have been added - + // by us - solely for the purpose of disambiguating same-named child nodes + // (for example, "sigma") that appeared multiple times under the same XML + // parent (which is allowed), but which can't appear that way in JSON. (JSON + // doesn't allow duplicate keys in the same object). + if (digits != "" && // will have suffixed digits + !beginsin(base,std::string(1,special::prefix))) // isn't special + json[prefix + special::nodename] = node.name; + + // Existing metadata + // Remark: we could do without the "if (node.metadata.size())" conditional, + // except that the "json[...]" expressions have the side effect of creating + // JSON values (nulls to start with, until/unless something is added later). + // We don't want those to be created at all here if they won't end up having + // anything, in this case metadata, added to them. + if (node.metadata.size()) + JSON::typed + ? meta2json_typed(node, json[prefix + special::metadata].get()) + : meta2json_plain(node, json[prefix + special::metadata].get()); +} + + +// ----------------------------------------------------------------------------- +// json_reduce_* +// ----------------------------------------------------------------------------- + +// ------------------------ +// json_reduce_cdata_comment +// ------------------------ + +// Simplify certain #cdata and #comment cases. +template +bool json_reduce_cdata_comment( + const NODE &node, json::object &json, const std::string &digits +) { + // Original node name, and suffixed name. The latter is for handling child + // nodes of the same name under the same parent node, and includes a numeric + // suffix (so, name0, name1, etc.) in that scenario. This is needed for JSON + // because JSON doesn't support same-named child nodes. In cases where the + // name was unique to begin with, nameOriginal == nameSuffixed. + const std::string nameOriginal = node.name; + const std::string nameSuffixed = node.name + digits; + + // #cdata or #comment + // #text the only metadatum + // no children + // Reduce to: string value, w/name == (#cdata or #comment) + digits + // Sketch: + // +-----------------+ +------------+ + // | #cdata/#comment | ==> | "name" : | name: #cdata/#comment + digits + // | #text | | "value" | + // +-----------------+ +------------+ + + if ( + (nameOriginal == special::cdata || nameOriginal == special::comment) && + node.children.size() == 0 && + node.metadata.size() == 1 && + node.metadata[0].first == special::text + ) { + // string value + json[nameSuffixed] = node.metadata[0].second; + return true; + } + + return false; +} + + +// ------------------------ +// json_reduce_data +// ------------------------ + +// Simplify #data case. +template +bool json_reduce_data( + const NODE &node, json::object &json, const std::string &digits +) { + const std::string nameOriginal = node.name; + const std::string nameSuffixed = node.name + digits; + + // #data + // #text the only metadatum + // no children + // Reduce to: array, w/name == #data + digits + // Sketch: + // +----------+ +----------+ + // | #data | ==> | "name" : | name: #data + digits + // | #text | | [...] | + // +----------+ +----------+ + + if (nameOriginal == special::data && + node.children.size() == 0 && + node.metadata.size() == 1 && + node.metadata[0].first == special::text + ) { + // Remark. This case (basically, #data/#text) may look superficially + // like it would have been handled, in the case immediately below here, + // in the previous (next-up) recurse of the node2json() function. Often + // it would have, but not always. Later, name/#data/#text (three + // levels, so to speak) reduces to one level (name : [...]), but + // only if name has ONE child - the #data. That's true when we + // have (in XML) something like 1 2 3, as the data, + // i.e. the 1 2 3 part, is ' only child node. However, it's + // actually possible (though I don't see it in current GNDS files) to + // have something like: 1 2 3. There, the + // outer "name" node () has child foo and child #data, and + // thus can't be reduced in the manner that's done if only #data is + // there. In short, then, the present situation comes to pass if and + // when #data has sibling nodes. + + // JSON array + data2Value(nameSuffixed, node.metadata[0].second, json); + return true; + } + + return false; +} + + +// ------------------------ +// json_reduce_data_metadata +// ------------------------ + +// Simplify case of node with data AND metadata +template +bool json_reduce_data_metadata( + const NODE &node, json::object &json, const std::string &digits +) { + const std::string nameSuffixed = node.name + digits; + + // name (think e.g. "values", as in XML ) + // any number of metadata (possibly 0) + // #data the only child + // #text the only metadatum + // no children + // Reduce to: array, w/name == name + digits; separately encoded metadata + // Sketch: + // +---------------+ +---------------------+ + // | name | ==> | "name" : | name: name + digits + // | [metadata] | | [...] | + // | #data | | "name#metadata" : { | + // | #text | | key/value pairs | + // | - | | } | + // +---------------+ +---------------------+ + // Remark. We're not super psyched about the "name#metadata" construction. + // It effectively splits the original node into two siblings in the JSON + // file; and, it differs from the present scenario's HDF5 handling, which + // places those metadata into HDF5 "attributes" within an HDF5 "data set". + // Here, the analog would be to place the metadata into the [...] part. + // That's doable, because JSON arrays are polymorphic, but we believe it + // would clutter the [...] with elements that would need to be interpreted, + // by whatever tool someone might use to process the JSON file, separately + // from how the rest of the [...] is interpreted. With HDF5, that probably + // isn't an issue, because a data set's *attributes*, while residing in the + // data set, would presumably be seen by HDF5 tools as logically distinct + // from its *data* proper. With JSON, we don't see how that would happen. + // Hence, our choice above. An important thing is that the above system + // is reversible - a file, thus written, can be read back in, recovering + // our original internal data structure unambiguously. Also, the two JSON + // constructs, "name" and "name#metadata", will appear next to each other, + // allowing someone who looks at the file to see what's going on. + + if (node.children.size() == 1 && + node.children[0]->name == special::data && + node.children[0]->metadata.size() == 1 && + node.children[0]->metadata[0].first == special::text && + node.children[0]->children.size() == 0 + ) { + // JSON array + const std::string text = node.children[0]->metadata[0].second; + data2Value(nameSuffixed, text, json); + + // metadata + meta2json(node, json, node.name, digits, nameSuffixed); + return true; + } + + return false; +} + + +// ----------------------------------------------------------------------------- +// node2json +// ----------------------------------------------------------------------------- + +// NODE is just GNDStk::Node. The latter isn't used directly, because +// it's an "incomplete type", to the compiler, at this point. +template +bool node2json(const NODE &node, json::object &j, const std::string &digits = "") +{ + const std::string nameSuffixed = node.name + digits; + + // ------------------------ + // Special cases + // ------------------------ + + if (JSON::reduced && ( + json_reduce_cdata_comment(node,j,digits) || + json_reduce_data (node,j,digits) || + json_reduce_data_metadata(node,j,digits) + )) + return true; + + // ------------------------ + // General case + // ------------------------ + + // Create a new json::object, in parameter j, for metadata and children + json::object &json = j[nameSuffixed].get(); + + // metadata + meta2json(node, json, node.name, digits, ""); + + // children - preprocess + // First, account for what children appear in the current node. If any child + // name appears multiple times, we must deal with that. For each represented + // child name, the map gets 0 if the name appears once, 1 if it appears more + // than once. Later, this 0/1 is used initially to make a boolean choice; + // then it serves as a counter to generate a 0-indexed numeric suffix that + // makes the child names unique: name0, name1, etc. + std::map childNames; + for (const auto &c : node.children) { + auto iter = childNames.find(c->name); + if (iter == childNames.end()) + childNames.insert({c->name,0}); // once (so far) + else + iter->second = 1; // more than once + } + + // children + for (const auto &c : node.children) { + const size_t counter = childNames.find(c->name)->second++; + if (!node2json(*c, json, counter ? std::to_string(counter-1) : "")) + return false; + } + + // done + return true; +} + +#endif diff --git a/src/GNDStk/convert/src/detail-node2xml.hpp b/src/GNDStk/convert/src/detail-node2xml.hpp new file mode 100644 index 000000000..1165664a0 --- /dev/null +++ b/src/GNDStk/convert/src/detail-node2xml.hpp @@ -0,0 +1,115 @@ + +// ----------------------------------------------------------------------------- +// Helpers +// ----------------------------------------------------------------------------- + +// check_special +template +bool check_special(const NODE &node, const std::string &label) +{ + if (node.children.size() != 0) { + log::error( + "Internal error in node2xml(Node, pugi::xml_node):\n" + "Ill-formed <" + label + "> node; " + "should have 0 children, but has {}.", + node.children.size() + ); + throw std::exception{}; + } + + if (node.metadata.size() != 1) { + log::error( + "Internal error in node2xml(Node, pugi::xml_node):\n" + "Ill-formed <" + label + "> node; " + "should have 1 metadatum, but has {}.", + node.metadata.size() + ); + throw std::exception{}; + } + + if (node.metadata.begin()->first != special::text) { + log::error( + "Internal error in node2xml(Node, pugi::xml_node):\n" + "Ill-formed <" + label + "> node; " + "should have metadatum key \"#text\", but has key \"{}\".", + node.metadata.begin()->first + ); + throw std::exception{}; + } + + return true; +} + +// write_cdata +template +bool write_cdata(const NODE &node, pugi::xml_node &xnode) +{ + if (!check_special(node,special::cdata)) + return false; + xnode.append_child(pugi::node_cdata) + .set_value(node.meta(special::text).data()); + return true; +} + +// write_data +template +bool write_data(const NODE &node, pugi::xml_node &xnode) +{ + if (!check_special(node,special::data)) + return false; + xnode.append_child(pugi::node_pcdata) + .set_value(node.meta(special::text).data()); + return true; +} + +// write_comment +template +bool write_comment(const NODE &node, pugi::xml_node &xnode) +{ + if (!check_special(node,special::comment)) + return false; + xnode.append_child(pugi::node_comment) + .set_value(node.meta(special::text).data()); + return true; +} + + +// ----------------------------------------------------------------------------- +// node2xml +// ----------------------------------------------------------------------------- + +template +bool node2xml(const NODE &node, pugi::xml_node &x) +{ + static const std::string context = "node2xml(Node, pugi::xml_node)"; + + // name + pugi::xml_node xnode = x.append_child(node.name.data()); + + // metadata + for (const auto &meta : node.metadata) + xnode.append_attribute(meta.first.data()) = meta.second.data(); + + // children + for (const auto &child : node.children) { + try { + // special element + if (child->name == special::cdata) + { if (write_cdata (*child,xnode)) continue; else return false; } + if (child->name == special::data) + { if (write_data (*child,xnode)) continue; else return false; } + if (child->name == special::comment) + { if (write_comment(*child,xnode)) continue; else return false; } + + // typical element + if (!node2xml(*child,xnode)) + return false; + } catch (...) { + log::function(context); + throw; + } + } + + // done + return true; +} diff --git a/src/GNDStk/convert/src/detail-xml2node.hpp b/src/GNDStk/convert/src/detail-xml2node.hpp new file mode 100644 index 000000000..a65e8f2f9 --- /dev/null +++ b/src/GNDStk/convert/src/detail-xml2node.hpp @@ -0,0 +1,137 @@ + +// ----------------------------------------------------------------------------- +// Helpers +// ----------------------------------------------------------------------------- + +// xml2node_error +inline void xml2node_error(const std::string &type) +{ + log::error( + "Internal error in xml2node():\n" + "Type pugi::{} found, but not handled, as sub-element.", type); + throw std::exception{}; +} + + +// ----------------------------------------------------------------------------- +// xml2node +// ----------------------------------------------------------------------------- + +/* +FYI, here's the pugixml code for pugi::xml_node_type: + +namespace pugi +{ + enum xml_node_type + { + node_null, // Empty (null) node handle + node_document, // A document tree's absolute root + node_element, // Element tag, i.e. '' + node_pcdata, // Plain character data, i.e. 'foo' + node_cdata, // Character data, i.e. '' + node_comment, // Comment tag, i.e. '' + node_pi, // Processing instruction, i.e. '' + node_declaration, // Document declaration, i.e. '' + node_doctype // Document type declaration, i.e. '' + }; +} +*/ + +// pugi::xml_node ==> Node +template +bool xml2node(const pugi::xml_node &xnode, NODE &node) +{ + // check destination node + if (!node.empty()) { + log::error( + "Internal error in xml2node():\n" + "Destination Node is supposed to arrive here empty, but didn't." + ); + throw std::exception{}; + } + + // name + node.name = xnode.name(); + + // metadata + for (const pugi::xml_attribute &xattr : xnode.attributes()) + node.add(xattr.name(), xattr.value()); + + // children (sub-nodes) + for (const pugi::xml_node &xsub : xnode) { + + // ------------------------ + // not handled right now + // ------------------------ + + // I don't think that the following should ever appear in this context + if (xsub.type() == pugi::node_document) + xml2node_error("node_document"); + if (xsub.type() == pugi::node_declaration) + xml2node_error("node_declaration"); + + // For now I won't handle these; let's ensure that we don't see them + if (xsub.type() == pugi::node_null) + xml2node_error("node_null"); + if (xsub.type() == pugi::node_pi) + xml2node_error("node_pi"); + if (xsub.type() == pugi::node_doctype) + xml2node_error("node_doctype"); + + // ------------------------ + // element (typical case) + // ------------------------ + + if (xsub.type() == pugi::node_element) { + try { + if (!xml2node(xsub,node.add())) + return false; + } catch (...) { + log::function("xml2node()"); + throw; + } + continue; + } + + // ------------------------ + // cdata, data, comment + // ------------------------ + + // We'll store these in a special manner as children of the current node, + // reflecting how they arrived through pugixml. Our manner of storing + // them will allow us to maintain their original ordering if, say, someone + // reads an XML, makes modest modifications or additions to data here and + // there, and then writes an XML back out. GNDS has no ordering, so doing + // this isn't necessary. It is, however, easy to handle, and users may + // appreciate that GNDStk doesn't remove comments, or change the ordering + // of cdata, data, or comment nodes, either individually or together. + + if (xsub.type() == pugi::node_cdata) { + node.add(special::cdata).add(special::text, xsub.value()); + continue; + } + + if (xsub.type() == pugi::node_pcdata) { + node.add(special::data).add(special::text, xsub.value()); + continue; + } + + if (xsub.type() == pugi::node_comment) { + node.add(special::comment).add(special::text, xsub.value()); + continue; + } + + // ------------------------ + // well we missed something + // ------------------------ + + log::error( + "Internal error in xml2node():\n" + "Encountered a pugi:: node type that we don't know about." + ); + throw std::exception{}; + } + + // done + return true; +} diff --git a/src/GNDStk/convert/src/detail.hpp b/src/GNDStk/convert/src/detail.hpp index 960b823f0..f109f375c 100644 --- a/src/GNDStk/convert/src/detail.hpp +++ b/src/GNDStk/convert/src/detail.hpp @@ -1,444 +1,36 @@ namespace detail { -// ----------------------------------------------------------------------------- -// Helpers for convert(*,JSON) -// ----------------------------------------------------------------------------- +// Node <==> XML +#include "detail-node2xml.hpp" +#include "detail-xml2node.hpp" -// node2json -template -bool node2json( - const NODE &node, nlohmann::json &j, - const std::string &suffix = "" -) { - // Original node name, and suffixed name. The latter is for handling child - // nodes of the same name under the same parent node, and includes a numeric - // suffix (so, name0, name1, etc.) in that scenario. This is needed for JSON - // because JSON doesn't support same-named child nodes. In cases where the - // name was unique to begin with, nameOriginal == nameSuffixed. - const std::string nameOriginal = node.name; - const std::string nameSuffixed = node.name + suffix; +// Node <==> JSON +#include "detail-node2json.hpp" +#include "detail-json2node.hpp" - // This also triggers node creation, in the event that the node exists but - // is null (so that nothing is entered later), e.g. in XML's . - auto &json = j[nameSuffixed]; - - // ------------------------ - // metadata ==> json - // ------------------------ - - if (suffix != "") - json["nodeName"] = nameOriginal; - - for (auto &meta : node.metadata) - json["attributes"][meta.first] = meta.second; - - // ------------------------ - // children ==> json - // ------------------------ - - // First, account for what children appear in the current node. If any child - // name appears multiple times, we must deal with that. For each represented - // child name, the map gets 0 if the name appears once, 1 if it appears more - // than once. Later, this 0/1 is used initially to make a boolean choice; - // then it serves as a counter to generate a 0-indexed numeric suffix that - // makes the child names unique: name0, name1, etc. - std::map childNames; - for (auto &c : node.children) { - auto iter = childNames.find(c->name); - if (iter == childNames.end()) - childNames.insert({c->name,0}); // once (so far) - else - iter->second = 1; // more than once - } - - // now revisit and process the child nodes - for (auto &c : node.children) { - const std::size_t counter = childNames.find(c->name)->second++; - if (!node2json(*c, json, counter ? std::to_string(counter-1) : "")) - return false; - } - - // done - return true; -} - - - -// ----------------------------------------------------------------------------- -// Helpers for convert(*,tree) -// ----------------------------------------------------------------------------- - -/* -FYI, here's the pugixml code for pugi::xml_node_type: - -namespace pugi -{ - // Tree node types - enum xml_node_type - { - node_null, // Empty (null) node handle - node_document, // A document tree's absolute root - node_element, // Element tag, i.e. '' - node_pcdata, // Plain character data, i.e. 'foo' - node_cdata, // Character data, i.e. '' - node_comment, // Comment tag, i.e. '' - node_pi, // Processing instruction, i.e. '' - node_declaration, // Document declaration, i.e. '' - node_doctype // Document type declaration, i.e. '' - }; -} -*/ - -// internal_error_xml2node -inline bool internal_error_xml2node(const std::string &str) -{ - log::error( - "Internal error in detail::xml2node(pugi::xml_node,Node):\n" - "type pugi::{} found, but not handled, as sub-element", - str - ); - throw std::exception{}; - return false; // in case we allow exceptions to be turned off -} - -// pugi::xml_node ==> Node -template -bool xml2node(const pugi::xml_node &xnode, NODE &node) -{ - // check destination node - if (!node.empty()) { - log::error( - "Internal error in detail::xml2node(pugi::xml_node,Node):\n" - "destination Node is supposed to arrive here empty, but didn't" - ); - throw std::exception{}; - return false; - } - - // name - node.name = xnode.name(); - - // metadata - for (const pugi::xml_attribute &xattr : xnode.attributes()) - node.add(xattr.name(), xattr.value()); - - // children (sub-nodes) - for (const pugi::xml_node &xsub : xnode) { - - // ------------------------ - // not handled right now - // ------------------------ - - // I don't think that the following should ever appear in this context - if (xsub.type() == pugi::node_document) - return internal_error_xml2node("node_document"); - if (xsub.type() == pugi::node_declaration) - return internal_error_xml2node("node_declaration"); - - // For now I won't handle these; let's ensure that we don't see them - if (xsub.type() == pugi::node_null) - return internal_error_xml2node("node_null"); - if (xsub.type() == pugi::node_pi) - return internal_error_xml2node("node_pi"); - if (xsub.type() == pugi::node_doctype) - return internal_error_xml2node("node_doctype"); - - // ------------------------ - // element (typical case) - // ------------------------ - - if (xsub.type() == pugi::node_element) { - try { - if (!xml2node(xsub,node.add())) - return false; - } catch (...) { - // recursive; no point printing error context, so just throw - throw; - } - continue; - } - - // ------------------------ - // cdata, pcdata, comment - // ------------------------ - - // We'll store these in a special manner as children of the current node, - // reflecting how they arrived through pugi xml. Our manner of storing - // them will allow us to maintain their original ordering if, say, someone - // reads an XML, makes modest modifications or additions to data here and - // there, and then writes an XML back out. GNDS has no ordering, so doing - // this isn't necessary. It is, however, easy to handle, and users may - // appreciate that GNDStk doesn't toss comments, or mess with the ordering - // of cdata, pcdata, or comment nodes, either individually or together. - // Of note, all bets are off if someone converts to JSON and back, because - // the nlohmann JSON library reorders everything lexicographically. - - if (xsub.type() == pugi::node_cdata) { - node.add("cdata").add("text", xsub.value()); - continue; - } - - if (xsub.type() == pugi::node_pcdata) { - node.add("pcdata").add("text", xsub.value()); - continue; - } - - if (xsub.type() == pugi::node_comment) { - node.add("comment").add("text", xsub.value()); - continue; - } - - // ------------------------ - // well we missed something - // ------------------------ - - log::error( - "Internal error in detail::xml2node(pugi::xml_node,Node):\n" - "we've encountered a pugi:: node type that we don't know about" - ); - throw std::exception{}; - return false; - } - - // done - return true; -} - - - -// nlohmann::json::const_iterator ==> Node -// Why the iterator rather than the json object? I found that there were some -// seemingly funny semantics in the json library. As we can see below, we have -// for example iter->is_object() (so, the -> operator, typical for iterators), -// but also iter.value() (the . operator - on an iterator). Similarly, also -// seen below, with the sub-elements. This is why we are, for now, writing -// our for-loops, here as well as in the functions that call this, in the older -// iterator form rather than the range-based-for form. Perhaps there's a way -// to reformulate all this in a shorter way, but this is what we have for now. +// Node <==> HDF5 +#include "detail-node2hdf5.hpp" +#include "detail-hdf52node.hpp" // Helper -inline bool internal_error_json2node(const std::string &str) -{ - log::error( - "Internal error in detail::json2node(nlohmann::json,Node):\n" - "message is \"{}\"; please let us know about this", - str - ); - throw std::exception{}; - return false; // in case we allow exceptions turned off -} - - -template -bool json2node(const nlohmann::json::const_iterator &iter, NODE &node) -{ - // the node sent here should be fresh, ready to receive entries... - if (!node.empty()) - return internal_error_json2node("!node.empty()"); - - // non-object cases were handled before a caller calls this function... - if (!iter->is_object()) - return internal_error_json2node("!iter->is_object()"); - - // any "attributes" key should have been handled in the caller... - if (iter.key() == "attributes") - return internal_error_json2node("iter.key() == \"attributes\""); - - // key,value ==> node name, json value to bring in - node.name = iter.key(); - const nlohmann::json &json = iter.value(); - - // elements - for (auto elem = json.begin(); elem != json.end(); ++elem) { - if (elem.key() == "nodeName") { - // nodeName? ...extract as current node's true name - node.name = elem->get(); - } else if (elem.key() == "attributes") { - // attributes? ...extract as current node's metadata - const auto &jsub = elem.value(); - for (auto attr = jsub.begin(); attr != jsub.end(); ++attr) - node.add(attr.key(), attr->get()); - } else if (elem->is_string()) { - // string? ...extract as metadata key/value pair - node.add(elem.key(), elem->get()); - } else if (elem->is_object()) { - // {} object? ...extract as normal child node - try { - if (!json2node(elem,node.add())) - return false; - } catch (...) { - // recursive; no point printing error context; just throw - throw; - } - } else if (elem->is_null()) { - // null node? ...extract as normal (albeit empty) child node - // In GNDS, e.g. XML's or - node.add().name = elem.key(); - } else { - // no other cases are handled right now - return internal_error_json2node("unhandled JSON value type"); - } - } - - // done - return true; -} - - - -// Node ==> Node -template -inline void node2Node(const NODE &from, NODE &to) +inline void warn_node_top_metadata(const Node &node, const std::string &context) { - // clear - to.clear(); - - // name - to.name = from.name; - - // metadata - for (auto &m : from.metadata) - to.add(m.first,m.second); - - // children - for (auto &c : from.children) - node2Node(*c, to.add()); -} - - - -// ----------------------------------------------------------------------------- -// Helpers for convert(*,XML) -// ----------------------------------------------------------------------------- - -// check_special -template -bool check_special(const NODE &node, const std::string &label) -{ - if (node.children.size() != 0) { - log::error( - "Internal error in detail::node2xml(Node,pugi::xml_node):\n" - "ill-formed <" + label + "> node; " - "should have 0 children, but has {}", - node.children.size() - ); - throw std::exception{}; - return false; - } - - if (node.metadata.size() != 1) { - log::error( - "Internal error in detail::node2xml(Node,pugi::xml_node):\n" - "ill-formed <" + label + "> node; " - "should have 1 metadatum, but has {}", - node.metadata.size() - ); - throw std::exception{}; - return false; - } - - if (node.metadata.begin()->first != "text") { - log::error( - "Internal error in detail::node2xml(Node,pugi::xml_node):\n" - "ill-formed <" + label + "> node; " - "should have metadatum key \"text\", but has key \"{}\"", - node.metadata.begin()->first - ); - throw std::exception{}; - return false; + if (node.metadata.size() != 0) { + log::warning( + "Node has name \"/\" but also contains metadata. This is\n" + "not expected in this context. We'll ignore the metadata."); + log::function(context); } - - return true; -} - - - -// write_cdata -template -bool write_cdata(const NODE &node, pugi::xml_node &xnode) -{ - if (!check_special(node,"cdata")) return false; - xnode.append_child(pugi::node_cdata).set_value(node.meta("text").data()); - return true; -} - -// write_pcdata -template -bool write_pcdata(const NODE &node, pugi::xml_node &xnode) -{ - if (!check_special(node,"pcdata")) return false; - xnode.append_child(pugi::node_pcdata).set_value(node.meta("text").data()); - return true; } -// write_comment -template -bool write_comment(const NODE &node, pugi::xml_node &xnode) -{ - if (!check_special(node,"comment")) return false; - xnode.append_child(pugi::node_comment).set_value(node.meta("text").data()); - return true; -} - - - -// node2xml -template -bool node2xml(const NODE &node, pugi::xml_node &x) +// Helper +inline void info_node_multiple_dec(const std::string &context) { - // name - pugi::xml_node xnode = x.append_child(node.name.data()); - - // metadata - for (auto &meta : node.metadata) - xnode.append_attribute(meta.first.data()) = meta.second.data(); - - // children - for (auto &child : node.children) { - try { - // special element - if (child->name == "cdata") - { if (write_cdata (*child,xnode)) continue; else return false; } - if (child->name == "pcdata") - { if (write_pcdata (*child,xnode)) continue; else return false; } - if (child->name == "comment") - { if (write_comment(*child,xnode)) continue; else return false; } - - // typical element - if (!node2xml(*child,xnode)) - return false; - } catch (...) { - // recursive; no point in printing error context; just throw - throw; - } - } - - // done - return true; -} - - - -// ----------------------------------------------------------------------------- -// check_top -// ----------------------------------------------------------------------------- - -inline void check_top( - const std::string &name, - const std::string &classname, - const std::string &context -) { - if (GNDStk::top && AllowedTop.find(name) == AllowedTop.end()) { - std::string message = - "Name \"{}\" in {} object's top-level node is not recognized\n" - "in our list of allowable names for top-level GNDS nodes:\n"; - for (const std::string &n : detail::AllowedTop) - message += " \"" + n + "\"\n"; - message += "Creating node \"{}\" anyway..."; - log::warning(message, name, classname, name); - log::function(context); - } + log::info( + "Node has name \"/\" but multiple \"declaration nodes\".\n" + "We'll combine the metadata from all such nodes."); + log::function(context); } } // namespace detail diff --git a/src/GNDStk/convert/src/tree.hpp b/src/GNDStk/convert/src/tree.hpp deleted file mode 100644 index c83be7d40..000000000 --- a/src/GNDStk/convert/src/tree.hpp +++ /dev/null @@ -1,234 +0,0 @@ - -// ----------------------------------------------------------------------------- -// convert(*,Tree) -// That is, convert to Tree objects -// -// Also: -// convert(*,Node) for * = XML/JSON -// ----------------------------------------------------------------------------- - -// ----------------------------------------------------------------------------- -// Tree ==> Tree -// ----------------------------------------------------------------------------- - -inline bool convert(const Tree &from, Tree &to) -{ - // same Tree? - if (&to == &from) - return true; - - // clear - to.clear(); - - // convert - try { - if (from.has_decl()) to.add() = from.decl(); - if (from.has_top ()) to.add() = from.top (); - } catch (...) { - log::function("convert(Tree,Tree)"); - throw; - } - - // done - return true; -} - - - -// ----------------------------------------------------------------------------- -// XML ==> Node -// XML ==> Tree -// ----------------------------------------------------------------------------- - -// XML ==> Node -inline bool convert(const XML &x, Node &node, const bool decl) -{ - // ------------------------ - // bookkeeping - // ------------------------ - - // clear the receiving object - node.clear(); - - // optionally, give it a boilerplate declaration node - if (decl) - node.add("xml"); // <== indicates that we built the object from an XML - - // empty xml document? - if (x.empty()) - return true; - - try { - - // ------------------------ - // validate - // ------------------------ - - // Validation, itself, is independent of whether decl is true or false - - std::size_t size = 0; - std::string one, two; - for (const pugi::xml_node &xnode : x.doc) { - size++; - if (size == 1) - one = xnode.name(); - else if (size == 2) - two = xnode.name(); - else { - log::error( - "More than two main nodes in the XML\n", - "You can have up to " - "one declaration node and " - "one document node" - ); - throw std::exception{}; - } - } - - // possibly redundant with the earlier empty() test, but harmless - if (size == 0) - return true; - - // if two main nodes, they can't be of the same type - if (size == 2) { - if (one == "xml" && two == "xml") { - log::error("Two declaration nodes in the XML"); - throw std::exception{}; - } - if (one != "xml" && two != "xml") { - log::error("Two document nodes in the XML"); - throw std::exception{}; - } - } - - // ------------------------ - // convert the nodes - // ------------------------ - - for (const pugi::xml_node &xnode : x.doc) { - const std::string name = xnode.name(); - - if (name == "xml") { - // Declaration node - // Retrieve any XML attributes, e.g. version and encoding - if (decl) - for (const pugi::xml_attribute &xattr : xnode.attributes()) - node.one("xml").add(xattr.name(), xattr.value()); - } else { - // Document node - // We'll assume that a check for this being a valid top-level - // GNDS node aligns with whether or not we're interested in any - // declaration node that might exist, as both of those concerns - // are associated with being at the top level of a GNDS tree - if (decl) - detail::check_top(name, "XML", "convert(XML,Node)"); - - // Visit the node, and its children recursively - if (!detail::xml2node(xnode, decl ? node.add() : node)) - return false; - } - } - } catch (...) { - log::function("convert(XML,Node)"); - throw; - } - - // done - return true; -} - - -// XML ==> Tree -inline bool convert(const XML &x, Tree &tree) -{ - try { - return convert(x, *(Node*)&tree, true); - } catch (...) { - log::function("convert(XML,Tree)"); - throw; - } -} - - - -// ----------------------------------------------------------------------------- -// JSON ==> Node -// JSON ==> Tree -// ----------------------------------------------------------------------------- - -// JSON ==> Node -inline bool convert(const JSON &j, Node &node, const bool decl) -{ - // ------------------------ - // bookkeeping - // ------------------------ - - // clear the receiving object - node.clear(); - - // optionally, give it a boilerplate declaration node - if (decl) - node.add("json"); // <== indicates that we built the object from a JSON - - // empty json document? - if (j.empty()) - return true; - - try { - - // ------------------------ - // validate - // ------------------------ - - const std::size_t size = j.doc.size(); - - // possibly redundant with the earlier empty() test, but harmless - if (size == 0) - return true; - - // a json document should have one main node - if (size != 1) { - // fixme Consider relaxing this, if doing so might ever make sense - log::error("More than one main node in the JSON"); - throw std::exception{}; - } - - // ------------------------ - // convert the nodes - // ------------------------ - - const std::string name = j.doc.begin().key(); - - // See comment above check_top() call in convert(XML,Node) above. - // JSON documents don't have "declaration nodes," as XML documents - // do, but here we interpret the bool decl parameter as essentially - // indicating whether we're reading a Node (decl == false) or full - // Tree (decl == true); and, the latter case suggests we're at the - // top level, and should thus validate it as a top-level GNDS node. - if (decl) - detail::check_top(name, "JSON", "convert(JSON,Node)"); - - // visit the node, and its children recursively - if (!detail::json2node(j.doc.begin(), decl ? node.add() : node)) - return false; - - } catch (...) { - log::function("convert(JSON,Node)"); - throw; - } - - // done - return true; -} - - -// JSON ==> Tree -inline bool convert(const JSON &j, Tree &tree) -{ - try { - return convert(j, *(Node*)&tree, true); - } catch (...) { - log::function("convert(JSON,Tree)"); - throw; - } -} diff --git a/src/GNDStk/convert/test/CMakeLists.txt b/src/GNDStk/convert/test/CMakeLists.txt index 713f19b72..2cff3c902 100644 --- a/src/GNDStk/convert/test/CMakeLists.txt +++ b/src/GNDStk/convert/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.convert.test convert.test.cpp ) +add_executable( + GNDStk.convert.test + convert.test.cpp +) + target_compile_options( GNDStk.convert.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} @@ -10,5 +14,5 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.convert.test PUBLIC GNDStk ) -add_test( NAME GNDStk.convert COMMAND GNDStk.convert.test ) \ No newline at end of file +target_link_libraries( GNDStk.convert.test PUBLIC GNDStk ) +add_test( NAME GNDStk.convert COMMAND GNDStk.convert.test ) diff --git a/src/GNDStk/convert_t.hpp b/src/GNDStk/convert_t.hpp deleted file mode 100644 index 34b24ec67..000000000 --- a/src/GNDStk/convert_t.hpp +++ /dev/null @@ -1,50 +0,0 @@ - -namespace detail { - -// ----------------------------------------------------------------------------- -// convert_t -// Serves as a default "function object" in places where a function object -// can be (optionally) user-provided for converting *from* something, *to* -// something else. -// ----------------------------------------------------------------------------- - -class convert_t { -public: - template - void operator()(const FROM &from, TO &to) const - { - if constexpr ( - std::is_constructible_v || - std::is_convertible_v - ) { - to = TO(from); - } else if constexpr (isVariant::value) { - std::visit([&to](auto &&alt) { convert_t{}(alt,to); }, from); - } else { - convert(from,to); - } - } -}; - - -// ----------------------------------------------------------------------------- -// default_converter -// Used for selecting the CONVERTER template argument of the Meta and Child -// classes. Usually gives convert_t, but gives void (which in turn won't, and -// shouldn't, be used) for Meta and Child, for which the concept -// of a converter is not applicable. -// ----------------------------------------------------------------------------- - -template -class default_converter { -public: - using type = convert_t; -}; - -template<> -class default_converter { -public: - using type = void; -}; - -} // namespace detail diff --git a/src/GNDStk/enumeration.hpp b/src/GNDStk/enumeration.hpp new file mode 100644 index 000000000..30a123c93 --- /dev/null +++ b/src/GNDStk/enumeration.hpp @@ -0,0 +1,160 @@ + +namespace enums { + +// ----------------------------------------------------------------------------- +// Re: maps +// ----------------------------------------------------------------------------- + +// map2string +template +using map2string = std::map; + +// reverseMap +template +std::map reverseMap(const std::map &in) +{ + std::map out; + for (const auto &pair : in) + out.insert(std::make_pair(pair.second,pair.first)); + return out; +} + +/** + * @brief Forward declaration of the templated enumeration map + * used to convert enumeration values to/from strings + */ +template +struct EnumMap { }; + + +// ----------------------------------------------------------------------------- +// getEnum* +// ----------------------------------------------------------------------------- + +// getEnumClass +template +struct getEnumClass; + +template class C, class T> +struct getEnumClass> +{ + using type = T; +}; + +// getEnum +template +using getEnum = typename getEnumClass::type; + + +// ----------------------------------------------------------------------------- +// isSymbolForEnum +// enum2string +// string2enum +// ----------------------------------------------------------------------------- + +/** + * @brief Return whether or not a string is a symbol for an enumeration + * + * @param[in] value The enumeration value + * + * @return true/false + */ +template>> +bool isSymbolForEnum(const std::string &symbol) +{ + return EnumMap::symbols.find(symbol) != EnumMap::symbols.end(); +} + +/** + * @brief Return a string symbol of the enumeration value + * + * @param[in] value The enumeration value + * + * @return A string symbol representing the enumeration value + */ +template>> +const std::string &enum2string(const ENUM &value) +{ + const auto found = EnumMap::values.find(value); + if (found != EnumMap::values.end()) + return found->second; + log::error("An enumeration value for {} has no registered symbol", + typeid(ENUM).name()); + throw std::exception(); +} + +/** + * @brief Return an enumeration value based on a string symbol + * + * @param[in] symbol The enumeration symbol + * + * @return An enumeration value derived from the string symbol + */ +template>> +const ENUM &string2enum(const std::string &symbol) +{ + const auto found = EnumMap::symbols.find(symbol); + if (found != EnumMap::symbols.end()) + return found->second; + log::error("An enumeration symbol for {} has no registered value: \"{}\"", + typeid(ENUM).name(), symbol); + throw std::exception(); +} + + +// ----------------------------------------------------------------------------- +// operator>> +// operator<< +// ----------------------------------------------------------------------------- + +/** + * @brief operator>> for enumerations + * + * @param[in] is The input stream + * @param[in] value The enumeration value + * + * @return the input stream (position is unchanged and failbit is set if no + * enumeration value could be read) + */ +// Uses string2enum +template>> +std::istream &operator>>(std::istream &is, ENUM &value) +{ + const auto position = is.tellg(); + std::string symbol; + + is >> symbol; + if (is.fail()) { + is.clear(); + is.seekg(position); + is.setstate(std::ios::failbit); + } else { + try { + value = string2enum(symbol); + } catch (...) { + is.seekg(position); + is.setstate(std::ios::failbit); + } + } + return is; +} + +/** + * @brief operator<< for enumerations + * + * @param[in] os The output stream + * @param[in] value The enumeration value + * + * @return the output stream + */ +// Uses enum2string +template>> +std::ostream &operator<<(std::ostream &os, const ENUM &value) +{ + return os << enum2string(value); +} + +} // namespace enums + +using enums::operator>>; +using enums::operator<<; diff --git a/src/GNDStk/enums.hpp b/src/GNDStk/enums.hpp deleted file mode 100644 index 57e9f4071..000000000 --- a/src/GNDStk/enums.hpp +++ /dev/null @@ -1,14 +0,0 @@ - -#include "GNDStk/enums/enumeration.hpp" - -// general -#include "GNDStk/enums/Encoding.hpp" -#include "GNDStk/enums/Frame.hpp" -#include "GNDStk/enums/GridStyle.hpp" -#include "GNDStk/enums/Interaction.hpp" -#include "GNDStk/enums/Interpolation.hpp" -#include "GNDStk/enums/StorageOrder.hpp" - -// units-specific -#include "GNDStk/enums/units/Energy.hpp" -#include "GNDStk/enums/units/Length.hpp" diff --git a/src/GNDStk/enums/Encoding.hpp b/src/GNDStk/enums/Encoding.hpp deleted file mode 100644 index b13bcdf3f..000000000 --- a/src/GNDStk/enums/Encoding.hpp +++ /dev/null @@ -1,55 +0,0 @@ - -#ifndef NJOY_GNDSTK_ENCODING -#define NJOY_GNDSTK_ENCODING - -namespace enums { - - /** - * @class - * @brief Enumeration class giving acceptable encoding values - * - * See GNDS v1.9 specifications section 3.5.3 - */ - enum class Encoding { - - ascii = 1, - utf8 = 2 - }; - - /** - * @brief Return whether or not a string is a valid encoding - * - * @param[in] string the string to be verified - * - * @return true/false - */ - inline bool isEncoding( const std::string& string ) { - - return isSymbol< Encoding >( string ); - } - - /** - * @brief Template specialisation to convert Encoding to/from strings - */ - template <> - class Map< GNDStk::enums::Encoding > { - public: - - static inline const std::map< GNDStk::enums::Encoding, - const std::string > values{ - - { GNDStk::enums::Encoding::ascii, "ascii" }, - { GNDStk::enums::Encoding::utf8, "utf8" } - }; - - static inline const std::map< const std::string, - GNDStk::enums::Encoding > symbols{ - - { "ascii", GNDStk::enums::Encoding::ascii }, - { "utf8", GNDStk::enums::Encoding::utf8 } - }; - }; - -} // namespace enums - -#endif diff --git a/src/GNDStk/enums/Encoding/test/CMakeLists.txt b/src/GNDStk/enums/Encoding/test/CMakeLists.txt deleted file mode 100644 index ae3903471..000000000 --- a/src/GNDStk/enums/Encoding/test/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ - -add_executable( GNDStk.enums.Encoding.test Encoding.test.cpp ) -target_compile_options( GNDStk.enums.Encoding.test PRIVATE ${${PREFIX}_common_flags} -$<$:${${PREFIX}_strict_flags}>$<$: -${${PREFIX}_DEBUG_flags} -$<$:${${PREFIX}_coverage_flags}>> -$<$: -${${PREFIX}_RELEASE_flags} -$<$:${${PREFIX}_link_time_optimization_flags}> -$<$:${${PREFIX}_nonportable_optimization_flags}>> - -${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.enums.Encoding.test PUBLIC GNDStk ) -file( GLOB resources "resources/*" ) -foreach( resource ${resources}) - file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) -endforeach() -add_test( NAME GNDStk.enums.Encoding COMMAND GNDStk.enums.Encoding.test ) diff --git a/src/GNDStk/enums/Encoding/test/Encoding.test.cpp b/src/GNDStk/enums/Encoding/test/Encoding.test.cpp deleted file mode 100644 index 3230b1b38..000000000 --- a/src/GNDStk/enums/Encoding/test/Encoding.test.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk.hpp" - -// other includes - -// convenience typedefs -using namespace njoy::GNDStk; -using Encoding = enums::Encoding; - -SCENARIO( "Encoding" ) { - - GIVEN( "valid encoding values and symbols" ) { - - WHEN( "toString is used" ) { - - THEN( "no exception is thrown and the correct string is returned" ) { - - CHECK( "ascii" == enums::toString( Encoding::ascii ) ); - CHECK( "utf8" == enums::toString( Encoding::utf8 ) ); - } // THEN - } // WHEN - - WHEN( "fromString is used" ) { - - THEN( "no exception is thrown when the symbol is registered" ) { - - CHECK( Encoding::ascii == enums::fromString< Encoding >( "ascii" ) ); - CHECK( Encoding::utf8 == enums::fromString< Encoding >( "utf8" ) ); - } // THEN - - THEN( "an exception is thrown when the symbol is not registered" ) { - - CHECK_THROWS( enums::fromString< Encoding >( "unregistered" ) ); - } // THEN - } // WHEN - - WHEN( "operator<< is used" ) { - - THEN( "no exception is thrown and the symbol is written to the stream" ) { - - std::ostringstream out; - out << Encoding::ascii << ' ' << Encoding::utf8; - - CHECK( "ascii utf8" == out.str() ); - } // THEN - } // WHEN - - WHEN( "operator>> is used" ) { - - THEN( "the stream is not in fail() when the symbol is registered" ) { - - Encoding value; - std::istringstream in( "ascii utf8" ); - - in >> value; - CHECK( Encoding::ascii == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Encoding::utf8 == value ); - CHECK( false == in.fail() ); - CHECK( true == in.eof() ); - } // THEN - - THEN( "the stream is in fail() and the position has not changed when " - "the symbol is not registered" ) { - - Encoding value = Encoding::utf8; - std::istringstream in( "unregistered" ); - in >> value; - - CHECK( Encoding::utf8 == value ); - CHECK( true == in.fail() ); - } // THEN - } // WHEN - - WHEN( "isEncoding is used" ) { - - THEN( "registered encoding values return true, unregistered encoding values return false" ) { - - CHECK( true == enums::isEncoding( "ascii" ) ); - CHECK( true == enums::isEncoding( "utf8" ) ); - CHECK( false == enums::isEncoding( "unregistered" ) ); - } // THEN - } // WHEN - } // GIVEN -} // SCENARIO diff --git a/src/GNDStk/enums/Frame.hpp b/src/GNDStk/enums/Frame.hpp deleted file mode 100644 index 5b598e67f..000000000 --- a/src/GNDStk/enums/Frame.hpp +++ /dev/null @@ -1,55 +0,0 @@ - -#ifndef NJOY_GNDSTK_FRAME -#define NJOY_GNDSTK_FRAME - -namespace enums { - - /** - * @class - * @brief Enumeration class giving acceptable frame values - * - * See GNDS v1.9 specifications section 3.5.3 - */ - enum class Frame { - - lab = 1, - centerOfMass = 2 - }; - - /** - * @brief Return whether or not a string is a valid frame - * - * @param[in] string the string to be verified - * - * @return true/false - */ - inline bool isFrame( const std::string& string ) { - - return isSymbol< Frame >( string ); - } - - /** - * @brief Template specialisation to convert Frame to/from strings - */ - template <> - class Map< GNDStk::enums::Frame > { - public: - - static inline const std::map< GNDStk::enums::Frame, - const std::string > values{ - - { GNDStk::enums::Frame::lab, "lab" }, - { GNDStk::enums::Frame::centerOfMass, "centerOfMass" } - }; - - static inline const std::map< const std::string, - GNDStk::enums::Frame > symbols{ - - { "lab", GNDStk::enums::Frame::lab }, - { "centerOfMass", GNDStk::enums::Frame::centerOfMass } - }; - }; - -} // namespace enums - -#endif diff --git a/src/GNDStk/enums/Frame/test/CMakeLists.txt b/src/GNDStk/enums/Frame/test/CMakeLists.txt deleted file mode 100644 index d0a39c8c2..000000000 --- a/src/GNDStk/enums/Frame/test/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ - -add_executable( GNDStk.enums.Frame.test Frame.test.cpp ) -target_compile_options( GNDStk.enums.Frame.test PRIVATE ${${PREFIX}_common_flags} -$<$:${${PREFIX}_strict_flags}>$<$: -${${PREFIX}_DEBUG_flags} -$<$:${${PREFIX}_coverage_flags}>> -$<$: -${${PREFIX}_RELEASE_flags} -$<$:${${PREFIX}_link_time_optimization_flags}> -$<$:${${PREFIX}_nonportable_optimization_flags}>> - -${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.enums.Frame.test PUBLIC GNDStk ) -file( GLOB resources "resources/*" ) -foreach( resource ${resources}) - file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) -endforeach() -add_test( NAME GNDStk.enums.Frame COMMAND GNDStk.enums.Frame.test ) diff --git a/src/GNDStk/enums/Frame/test/Frame.test.cpp b/src/GNDStk/enums/Frame/test/Frame.test.cpp deleted file mode 100644 index 2448994ff..000000000 --- a/src/GNDStk/enums/Frame/test/Frame.test.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk.hpp" - -// other includes - -// convenience typedefs -using namespace njoy::GNDStk; -using Frame = enums::Frame; - -SCENARIO( "Frame" ) { - - GIVEN( "valid frame values and symbols" ) { - - WHEN( "toString is used" ) { - - THEN( "no exception is thrown and the correct string is returned" ) { - - CHECK( "lab" == enums::toString( Frame::lab ) ); - CHECK( "centerOfMass" == enums::toString( Frame::centerOfMass ) ); - } // THEN - } // WHEN - - WHEN( "fromString is used" ) { - - THEN( "no exception is thrown when the symbol is registered" ) { - - CHECK( Frame::lab == enums::fromString< Frame >( "lab" ) ); - CHECK( Frame::centerOfMass == enums::fromString< Frame >( "centerOfMass" ) ); - } // THEN - - THEN( "an exception is thrown when the symbol is not registered" ) { - - CHECK_THROWS( enums::fromString< Frame >( "unregistered" ) ); - } // THEN - } // WHEN - - WHEN( "operator<< is used" ) { - - THEN( "no exception is thrown and the symbol is written to the stream" ) { - - std::ostringstream out; - out << Frame::lab << ' ' << Frame::centerOfMass; - - CHECK( "lab centerOfMass" == out.str() ); - } // THEN - } // WHEN - - WHEN( "operator>> is used" ) { - - THEN( "the stream is not in fail() when the symbol is registered" ) { - - Frame value; - std::istringstream in( "lab centerOfMass" ); - - in >> value; - CHECK( Frame::lab == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Frame::centerOfMass == value ); - CHECK( false == in.fail() ); - CHECK( true == in.eof() ); - } // THEN - - THEN( "the stream is in fail() and the position has not changed when " - "the symbol is not registered" ) { - - Frame value = Frame::centerOfMass; - std::istringstream in( "unregistered" ); - in >> value; - - CHECK( Frame::centerOfMass == value ); - CHECK( true == in.fail() ); - } // THEN - } // WHEN - - WHEN( "isFrame is used" ) { - - THEN( "registered frame values return true, unregistered frame values return false" ) { - - CHECK( true == enums::isFrame( "lab" ) ); - CHECK( true == enums::isFrame( "centerOfMass" ) ); - CHECK( false == enums::isFrame( "unregistered" ) ); - } // THEN - } // WHEN - } // GIVEN -} // SCENARIO diff --git a/src/GNDStk/enums/GridStyle.hpp b/src/GNDStk/enums/GridStyle.hpp deleted file mode 100644 index 06759c324..000000000 --- a/src/GNDStk/enums/GridStyle.hpp +++ /dev/null @@ -1,64 +0,0 @@ - -#ifndef NJOY_GNDSTK_GRIDSTYLE -#define NJOY_GNDSTK_GRIDSTYLE - -namespace enums { - - /** - * @class - * @brief Enumeration class giving acceptable grid style values - * - * See GNDS v1.9 specifications section 5.1.3 - */ - enum class GridStyle { - - none, - link, - points, - boundaries, - parameters - }; - - /** - * @brief Return whether or not a string is a valid grid style - * - * @param[in] string the string to be verified - * - * @return true/false - */ - inline bool isGridStyle( const std::string& string ) { - - return isSymbol< GridStyle >( string ); - } - - /** - * @brief Template specialisation to convert GridStyle to/from strings - */ - template <> - class Map< GNDStk::enums::GridStyle > { - public: - - static inline const std::map< GNDStk::enums::GridStyle, - const std::string > values{ - - { GNDStk::enums::GridStyle::none, "none" }, - { GNDStk::enums::GridStyle::link, "link" }, - { GNDStk::enums::GridStyle::points, "points" }, - { GNDStk::enums::GridStyle::boundaries, "boundaries" }, - { GNDStk::enums::GridStyle::parameters, "parameters" } - }; - - static inline const std::map< const std::string, - GNDStk::enums::GridStyle > symbols{ - - { "none", GNDStk::enums::GridStyle::none }, - { "link", GNDStk::enums::GridStyle::link }, - { "points", GNDStk::enums::GridStyle::points }, - { "boundaries", GNDStk::enums::GridStyle::boundaries }, - { "parameters", GNDStk::enums::GridStyle::parameters } - }; - }; - -} // namespace enums - -#endif diff --git a/src/GNDStk/enums/GridStyle/test/CMakeLists.txt b/src/GNDStk/enums/GridStyle/test/CMakeLists.txt deleted file mode 100644 index 06092bc91..000000000 --- a/src/GNDStk/enums/GridStyle/test/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ - -add_executable( GNDStk.enums.GridStyle.test GridStyle.test.cpp ) -target_compile_options( GNDStk.enums.GridStyle.test PRIVATE ${${PREFIX}_common_flags} -$<$:${${PREFIX}_strict_flags}>$<$: -${${PREFIX}_DEBUG_flags} -$<$:${${PREFIX}_coverage_flags}>> -$<$: -${${PREFIX}_RELEASE_flags} -$<$:${${PREFIX}_link_time_optimization_flags}> -$<$:${${PREFIX}_nonportable_optimization_flags}>> - -${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.enums.GridStyle.test PUBLIC GNDStk ) -file( GLOB resources "resources/*" ) -foreach( resource ${resources}) - file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) -endforeach() -add_test( NAME GNDStk.enums.GridStyle COMMAND GNDStk.enums.GridStyle.test ) diff --git a/src/GNDStk/enums/GridStyle/test/GridStyle.test.cpp b/src/GNDStk/enums/GridStyle/test/GridStyle.test.cpp deleted file mode 100644 index d6aa8797d..000000000 --- a/src/GNDStk/enums/GridStyle/test/GridStyle.test.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk.hpp" - -// other includes - -// convenience typedefs -using namespace njoy::GNDStk; -using GridStyle = enums::GridStyle; - -SCENARIO( "GridStyle" ) { - - GIVEN( "valid unit values and symbols" ) { - - WHEN( "toString is used" ) { - - THEN( "no exception is thrown and the correct string is returned" ) { - - CHECK( "none" == enums::toString( GridStyle::none ) ); - CHECK( "link" == enums::toString( GridStyle::link ) ); - CHECK( "points" == enums::toString( GridStyle::points ) ); - CHECK( "boundaries" == enums::toString( GridStyle::boundaries ) ); - CHECK( "parameters" == enums::toString( GridStyle::parameters ) ); - } // THEN - } // WHEN - - WHEN( "fromString is used" ) { - - THEN( "no exception is thrown when the symbol is registered" ) { - - CHECK( GridStyle::none == enums::fromString< GridStyle >( "none" ) ); - CHECK( GridStyle::link == enums::fromString< GridStyle >( "link" ) ); - CHECK( GridStyle::points == enums::fromString< GridStyle >( "points" ) ); - CHECK( GridStyle::boundaries == enums::fromString< GridStyle >( "boundaries" ) ); - CHECK( GridStyle::parameters == enums::fromString< GridStyle >( "parameters" ) ); - } // THEN - - THEN( "an exception is thrown when the symbol is not registered" ) { - - CHECK_THROWS( enums::fromString< GridStyle >( "unregistered" ) ); - } // THEN - } // WHEN - - WHEN( "operator<< is used" ) { - - THEN( "no exception is thrown and the symbol is written to the stream" ) { - - std::ostringstream out; - out << GridStyle::none << ' ' << GridStyle::link << ' ' - << GridStyle::points << ' ' << GridStyle::boundaries << ' ' - << GridStyle::parameters; - - CHECK( "none link points boundaries parameters" == out.str() ); - } // THEN - } // WHEN - - WHEN( "operator>> is used" ) { - - THEN( "the stream is not in fail() when the symbol is registered" ) { - - GridStyle value; - std::istringstream in( "none link points boundaries parameters" ); - - in >> value; - CHECK( GridStyle::none == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( GridStyle::link == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( GridStyle::points == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( GridStyle::boundaries == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( GridStyle::parameters == value ); - CHECK( false == in.fail() ); - CHECK( true == in.eof() ); - } // THEN - - THEN( "the stream is in fail() and the position has not changed when " - "the symbol is not registered" ) { - - GridStyle value = GridStyle::points; - std::istringstream in( "unregistered" ); - in >> value; - - CHECK( GridStyle::points == value ); - CHECK( true == in.fail() ); - } // THEN - } // WHEN - - WHEN( "isGridStyle is used" ) { - - THEN( "registered units return true, unregistered units return false" ) { - - CHECK( true == enums::isGridStyle( "none" ) ); - CHECK( true == enums::isGridStyle( "link" ) ); - CHECK( true == enums::isGridStyle( "points" ) ); - CHECK( true == enums::isGridStyle( "boundaries" ) ); - CHECK( true == enums::isGridStyle( "parameters" ) ); - CHECK( false == enums::isGridStyle( "unregistered" ) ); - } // THEN - } // WHEN - } // GIVEN -} // SCENARIO diff --git a/src/GNDStk/enums/Interaction.hpp b/src/GNDStk/enums/Interaction.hpp deleted file mode 100644 index 2aa344368..000000000 --- a/src/GNDStk/enums/Interaction.hpp +++ /dev/null @@ -1,58 +0,0 @@ - -#ifndef NJOY_GNDSTK_INTERACTION -#define NJOY_GNDSTK_INTERACTION - -namespace enums { - - /** - * @class - * @brief Enumeration class giving acceptable interaction values - * - * See GNDS v1.9 specifications section 3.5.3 - */ - enum class Interaction { - - nuclear = 1, - atomic = 2, - thermalNeutronScatteringLaw = 3 - }; - - /** - * @brief Return whether or not a string is a valid interaction - * - * @param[in] string the string to be verified - * - * @return true/false - */ - inline bool isInteraction( const std::string& string ) { - - return isSymbol< Interaction >( string ); - } - - /** - * @brief Template specialisation to convert Interaction to/from strings - */ - template <> - class Map< GNDStk::enums::Interaction > { - public: - - static inline const std::map< GNDStk::enums::Interaction, - const std::string > values{ - - { GNDStk::enums::Interaction::nuclear, "nuclear" }, - { GNDStk::enums::Interaction::atomic, "atomic" }, - { GNDStk::enums::Interaction::thermalNeutronScatteringLaw, "thermalNeutronScatteringLaw" } - }; - - static inline const std::map< const std::string, - GNDStk::enums::Interaction > symbols{ - - { "nuclear", GNDStk::enums::Interaction::nuclear }, - { "atomic", GNDStk::enums::Interaction::atomic }, - { "thermalNeutronScatteringLaw", GNDStk::enums::Interaction::thermalNeutronScatteringLaw } - }; - }; - -} // namespace enums - -#endif diff --git a/src/GNDStk/enums/Interaction/test/CMakeLists.txt b/src/GNDStk/enums/Interaction/test/CMakeLists.txt deleted file mode 100644 index b6621fc34..000000000 --- a/src/GNDStk/enums/Interaction/test/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ - -add_executable( GNDStk.enums.Interaction.test Interaction.test.cpp ) -target_compile_options( GNDStk.enums.Interaction.test PRIVATE ${${PREFIX}_common_flags} -$<$:${${PREFIX}_strict_flags}>$<$: -${${PREFIX}_DEBUG_flags} -$<$:${${PREFIX}_coverage_flags}>> -$<$: -${${PREFIX}_RELEASE_flags} -$<$:${${PREFIX}_link_time_optimization_flags}> -$<$:${${PREFIX}_nonportable_optimization_flags}>> - -${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.enums.Interaction.test PUBLIC GNDStk ) -file( GLOB resources "resources/*" ) -foreach( resource ${resources}) - file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) -endforeach() -add_test( NAME GNDStk.enums.Interaction COMMAND GNDStk.enums.Interaction.test ) diff --git a/src/GNDStk/enums/Interaction/test/Interaction.test.cpp b/src/GNDStk/enums/Interaction/test/Interaction.test.cpp deleted file mode 100644 index 669926ee6..000000000 --- a/src/GNDStk/enums/Interaction/test/Interaction.test.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk.hpp" - -// other includes - -// convenience typedefs -using namespace njoy::GNDStk; -using Interaction = enums::Interaction; - -SCENARIO( "Interaction" ) { - - GIVEN( "valid interaction values and symbols" ) { - - WHEN( "toString is used" ) { - - THEN( "no exception is thrown and the correct string is returned" ) { - - CHECK( "nuclear" == enums::toString( Interaction::nuclear ) ); - CHECK( "atomic" == enums::toString( Interaction::atomic ) ); - CHECK( "thermalNeutronScatteringLaw" == enums::toString( Interaction::thermalNeutronScatteringLaw ) ); - } // THEN - } // WHEN - - WHEN( "fromString is used" ) { - - THEN( "no exception is thrown when the symbol is registered" ) { - - CHECK( Interaction::nuclear == enums::fromString< Interaction >( "nuclear" ) ); - CHECK( Interaction::atomic == enums::fromString< Interaction >( "atomic" ) ); - CHECK( Interaction::thermalNeutronScatteringLaw == enums::fromString< Interaction >( "thermalNeutronScatteringLaw" ) ); - } // THEN - - THEN( "an exception is thrown when the symbol is not registered" ) { - - CHECK_THROWS( enums::fromString< Interaction >( "unregistered" ) ); - } // THEN - } // WHEN - - WHEN( "operator<< is used" ) { - - THEN( "no exception is thrown and the symbol is written to the stream" ) { - - std::ostringstream out; - out << Interaction::nuclear << ' ' << Interaction::atomic << ' ' - << Interaction::thermalNeutronScatteringLaw; - - CHECK( "nuclear atomic thermalNeutronScatteringLaw" == out.str() ); - } // THEN - } // WHEN - - WHEN( "operator>> is used" ) { - - THEN( "the stream is not in fail() when the symbol is registered" ) { - - Interaction value; - std::istringstream in( "nuclear atomic thermalNeutronScatteringLaw" ); - - in >> value; - CHECK( Interaction::nuclear == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Interaction::atomic == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Interaction::thermalNeutronScatteringLaw == value ); - CHECK( false == in.fail() ); - CHECK( true == in.eof() ); - } // THEN - - THEN( "the stream is in fail() and the position has not changed when " - "the symbol is not registered" ) { - - Interaction value = Interaction::atomic; - std::istringstream in( "unregistered" ); - in >> value; - - CHECK( Interaction::atomic == value ); - CHECK( true == in.fail() ); - } // THEN - } // WHEN - - WHEN( "isInteraction is used" ) { - - THEN( "registered interaction values return true, unregistered interaction values return false" ) { - - CHECK( true == enums::isInteraction( "nuclear" ) ); - CHECK( true == enums::isInteraction( "atomic" ) ); - CHECK( true == enums::isInteraction( "thermalNeutronScatteringLaw" ) ); - CHECK( false == enums::isInteraction( "unregistered" ) ); - } // THEN - } // WHEN - } // GIVEN -} // SCENARIO diff --git a/src/GNDStk/enums/Interpolation.hpp b/src/GNDStk/enums/Interpolation.hpp deleted file mode 100644 index 94281587e..000000000 --- a/src/GNDStk/enums/Interpolation.hpp +++ /dev/null @@ -1,67 +0,0 @@ - -#ifndef NJOY_GNDSTK_INTERPOLATION -#define NJOY_GNDSTK_INTERPOLATION - -namespace enums { - - /** - * @class - * @brief Enumeration class giving acceptable interpolation values - * - * See GNDS v1.9 specifications section 3.5.3 - */ - enum class Interpolation { - - flat = 1, - linlin = 2, - linlog = 3, - loglin = 4, - loglog = 5, - chargedparticle = 6 - }; - - /** - * @brief Return whether or not a string is a valid interpolation - * - * @param[in] string the string to be verified - * - * @return true/false - */ - inline bool isInterpolation( const std::string& string ) { - - return isSymbol< Interpolation >( string ); - } - - /** - * @brief Template specialisation to convert Interpolation to/from strings - */ - template <> - class Map< GNDStk::enums::Interpolation > { - public: - - static inline const std::map< GNDStk::enums::Interpolation, - const std::string > values{ - - { GNDStk::enums::Interpolation::flat, "flat" }, - { GNDStk::enums::Interpolation::linlin, "lin-lin" }, - { GNDStk::enums::Interpolation::linlog, "lin-log" }, - { GNDStk::enums::Interpolation::loglin, "log-lin" }, - { GNDStk::enums::Interpolation::loglog, "log-log" }, - { GNDStk::enums::Interpolation::chargedparticle, "charged-particle" } - }; - - static inline const std::map< const std::string, - GNDStk::enums::Interpolation > symbols{ - - { "flat", GNDStk::enums::Interpolation::flat }, - { "lin-lin", GNDStk::enums::Interpolation::linlin }, - { "lin-log", GNDStk::enums::Interpolation::linlog }, - { "log-lin", GNDStk::enums::Interpolation::loglin }, - { "log-log", GNDStk::enums::Interpolation::loglog }, - { "charged-particle", GNDStk::enums::Interpolation::chargedparticle } - }; - }; - -} // namespace enums - -#endif diff --git a/src/GNDStk/enums/Interpolation/test/CMakeLists.txt b/src/GNDStk/enums/Interpolation/test/CMakeLists.txt deleted file mode 100644 index 6ed8210cf..000000000 --- a/src/GNDStk/enums/Interpolation/test/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ - -add_executable( GNDStk.enums.Interpolation.test Interpolation.test.cpp ) -target_compile_options( GNDStk.enums.Interpolation.test PRIVATE ${${PREFIX}_common_flags} -$<$:${${PREFIX}_strict_flags}>$<$: -${${PREFIX}_DEBUG_flags} -$<$:${${PREFIX}_coverage_flags}>> -$<$: -${${PREFIX}_RELEASE_flags} -$<$:${${PREFIX}_link_time_optimization_flags}> -$<$:${${PREFIX}_nonportable_optimization_flags}>> - -${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.enums.Interpolation.test PUBLIC GNDStk ) -file( GLOB resources "resources/*" ) -foreach( resource ${resources}) - file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) -endforeach() -add_test( NAME GNDStk.enums.Interpolation COMMAND GNDStk.enums.Interpolation.test ) diff --git a/src/GNDStk/enums/Interpolation/test/Interpolation.test.cpp b/src/GNDStk/enums/Interpolation/test/Interpolation.test.cpp deleted file mode 100644 index 64a19e6ee..000000000 --- a/src/GNDStk/enums/Interpolation/test/Interpolation.test.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk.hpp" - -// other includes - -// convenience typedefs -using namespace njoy::GNDStk; -using Interpolation = enums::Interpolation; - -SCENARIO( "Interpolation" ) { - - GIVEN( "valid interpolation values and symbols" ) { - - WHEN( "toString is used" ) { - - THEN( "no exception is thrown and the correct string is returned" ) { - - CHECK( "flat" == enums::toString( Interpolation::flat ) ); - CHECK( "lin-lin" == enums::toString( Interpolation::linlin ) ); - CHECK( "lin-log" == enums::toString( Interpolation::linlog ) ); - CHECK( "log-lin" == enums::toString( Interpolation::loglin ) ); - CHECK( "log-log" == enums::toString( Interpolation::loglog ) ); - CHECK( "charged-particle" == enums::toString( Interpolation::chargedparticle ) ); - } // THEN - } // WHEN - - WHEN( "fromString is used" ) { - - THEN( "no exception is thrown when the symbol is registered" ) { - - CHECK( Interpolation::flat == enums::fromString< Interpolation >( "flat" ) ); - CHECK( Interpolation::linlin == enums::fromString< Interpolation >( "lin-lin" ) ); - CHECK( Interpolation::linlog == enums::fromString< Interpolation >( "lin-log" ) ); - CHECK( Interpolation::loglin == enums::fromString< Interpolation >( "log-lin" ) ); - CHECK( Interpolation::loglog == enums::fromString< Interpolation >( "log-log" ) ); - CHECK( Interpolation::chargedparticle == enums::fromString< Interpolation >( "charged-particle" ) ); - } // THEN - - THEN( "an exception is thrown when the symbol is not registered" ) { - - CHECK_THROWS( enums::fromString< Interpolation >( "unregistered" ) ); - } // THEN - } // WHEN - - WHEN( "operator<< is used" ) { - - THEN( "no exception is thrown and the symbol is written to the stream" ) { - - std::ostringstream out; - out << Interpolation::flat << ' ' << Interpolation::linlin << ' ' - << Interpolation::linlog << ' ' << Interpolation::loglin << ' ' - << Interpolation::loglog << ' ' << Interpolation::chargedparticle; - - CHECK( "flat lin-lin lin-log log-lin log-log charged-particle" == out.str() ); - } // THEN - } // WHEN - - WHEN( "operator>> is used" ) { - - THEN( "the stream is not in fail() when the symbol is registered" ) { - - Interpolation value; - std::istringstream in( "flat lin-lin lin-log log-lin " - "log-log charged-particle" ); - - in >> value; - CHECK( Interpolation::flat == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Interpolation::linlin == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Interpolation::linlog == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Interpolation::loglin == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Interpolation::loglog == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Interpolation::chargedparticle == value ); - CHECK( false == in.fail() ); - CHECK( true == in.eof() ); - } // THEN - - THEN( "the stream is in fail() and the position has not changed when " - "the symbol is not registered" ) { - - Interpolation value = Interpolation::linlin; - std::istringstream in( "unregistered" ); - in >> value; - - CHECK( Interpolation::linlin == value ); - CHECK( true == in.fail() ); - } // THEN - } // WHEN - - WHEN( "isInterpolation is used" ) { - - THEN( "registered interpolation values return true, unregistered interpolation values return false" ) { - - CHECK( true == enums::isInterpolation( "flat" ) ); - CHECK( true == enums::isInterpolation( "lin-lin" ) ); - CHECK( true == enums::isInterpolation( "lin-log" ) ); - CHECK( true == enums::isInterpolation( "log-lin" ) ); - CHECK( true == enums::isInterpolation( "log-log" ) ); - CHECK( true == enums::isInterpolation( "charged-particle" ) ); - CHECK( false == enums::isInterpolation( "unregistered" ) ); - } // THEN - } // WHEN - } // GIVEN -} // SCENARIO diff --git a/src/GNDStk/enums/StorageOrder.hpp b/src/GNDStk/enums/StorageOrder.hpp deleted file mode 100644 index 35637a0c7..000000000 --- a/src/GNDStk/enums/StorageOrder.hpp +++ /dev/null @@ -1,55 +0,0 @@ - -#ifndef NJOY_GNDSTK_STORAGEORDER -#define NJOY_GNDSTK_STORAGEORDER - -namespace enums { - - /** - * @class - * @brief Enumeration class giving acceptable storage order values - * - * See GNDS v1.9 specifications section 3.5.3 - */ - enum class StorageOrder { - - rowMajor = 1, - columnMajor = 2 - }; - - /** - * @brief Return whether or not a string is a valid storage order - * - * @param[in] string the string to be verified - * - * @return true/false - */ - inline bool isStorageOrder( const std::string& string ) { - - return isSymbol< StorageOrder >( string ); - } - - /** - * @brief Template specialisation to convert StorageOrder to/from strings - */ - template <> - class Map< GNDStk::enums::StorageOrder > { - public: - - static inline const std::map< GNDStk::enums::StorageOrder, - const std::string > values{ - - { GNDStk::enums::StorageOrder::rowMajor, "rowMajor" }, - { GNDStk::enums::StorageOrder::columnMajor, "columnMajor" } - }; - - static inline const std::map< const std::string, - GNDStk::enums::StorageOrder > symbols{ - - { "rowMajor", GNDStk::enums::StorageOrder::rowMajor }, - { "columnMajor", GNDStk::enums::StorageOrder::columnMajor } - }; - }; - -} // namespace enums - -#endif diff --git a/src/GNDStk/enums/StorageOrder/test/CMakeLists.txt b/src/GNDStk/enums/StorageOrder/test/CMakeLists.txt deleted file mode 100644 index 11a4ec4d4..000000000 --- a/src/GNDStk/enums/StorageOrder/test/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ - -add_executable( GNDStk.enums.StorageOrder.test StorageOrder.test.cpp ) -target_compile_options( GNDStk.enums.StorageOrder.test PRIVATE ${${PREFIX}_common_flags} -$<$:${${PREFIX}_strict_flags}>$<$: -${${PREFIX}_DEBUG_flags} -$<$:${${PREFIX}_coverage_flags}>> -$<$: -${${PREFIX}_RELEASE_flags} -$<$:${${PREFIX}_link_time_optimization_flags}> -$<$:${${PREFIX}_nonportable_optimization_flags}>> - -${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.enums.StorageOrder.test PUBLIC GNDStk ) -file( GLOB resources "resources/*" ) -foreach( resource ${resources}) - file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) -endforeach() -add_test( NAME GNDStk.enums.StorageOrder COMMAND GNDStk.enums.StorageOrder.test ) diff --git a/src/GNDStk/enums/StorageOrder/test/StorageOrder.test.cpp b/src/GNDStk/enums/StorageOrder/test/StorageOrder.test.cpp deleted file mode 100644 index cea39c96e..000000000 --- a/src/GNDStk/enums/StorageOrder/test/StorageOrder.test.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk.hpp" - -// other includes - -// convenience typedefs -using namespace njoy::GNDStk; -using StorageOrder = enums::StorageOrder; - -SCENARIO( "StorageOrder" ) { - - GIVEN( "valid storage order values and symbols" ) { - - WHEN( "toString is used" ) { - - THEN( "no exception is thrown and the correct string is returned" ) { - - CHECK( "rowMajor" == enums::toString( StorageOrder::rowMajor ) ); - CHECK( "columnMajor" == enums::toString( StorageOrder::columnMajor ) ); - } // THEN - } // WHEN - - WHEN( "fromString is used" ) { - - THEN( "no exception is thrown when the symbol is registered" ) { - - CHECK( StorageOrder::rowMajor == enums::fromString< StorageOrder >( "rowMajor" ) ); - CHECK( StorageOrder::columnMajor == enums::fromString< StorageOrder >( "columnMajor" ) ); - } // THEN - - THEN( "an exception is thrown when the symbol is not registered" ) { - - CHECK_THROWS( enums::fromString< StorageOrder >( "unregistered" ) ); - } // THEN - } // WHEN - - WHEN( "operator<< is used" ) { - - THEN( "no exception is thrown and the symbol is written to the stream" ) { - - std::ostringstream out; - out << StorageOrder::rowMajor << ' ' << StorageOrder::columnMajor; - - CHECK( "rowMajor columnMajor" == out.str() ); - } // THEN - } // WHEN - - WHEN( "operator>> is used" ) { - - THEN( "the stream is not in fail() when the symbol is registered" ) { - - StorageOrder value; - std::istringstream in( "rowMajor columnMajor" ); - - in >> value; - CHECK( StorageOrder::rowMajor == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( StorageOrder::columnMajor == value ); - CHECK( false == in.fail() ); - CHECK( true == in.eof() ); - } // THEN - - THEN( "the stream is in fail() and the position has not changed when " - "the symbol is not registered" ) { - - StorageOrder value = StorageOrder::columnMajor; - std::istringstream in( "unregistered" ); - in >> value; - - CHECK( StorageOrder::columnMajor == value ); - CHECK( true == in.fail() ); - } // THEN - } // WHEN - - WHEN( "isStorageOrder is used" ) { - - THEN( "registered storage order values return true, unregistered storage order values return false" ) { - - CHECK( true == enums::isStorageOrder( "rowMajor" ) ); - CHECK( true == enums::isStorageOrder( "columnMajor" ) ); - CHECK( false == enums::isStorageOrder( "unregistered" ) ); - } // THEN - } // WHEN - } // GIVEN -} // SCENARIO diff --git a/src/GNDStk/enums/enumeration.hpp b/src/GNDStk/enums/enumeration.hpp deleted file mode 100644 index 9e3a5afd8..000000000 --- a/src/GNDStk/enums/enumeration.hpp +++ /dev/null @@ -1,125 +0,0 @@ - -#ifndef NJOY_GNDSTK_ENUMS_ENUMERATION -#define NJOY_GNDSTK_ENUMS_ENUMERATION - -namespace enums { - -/** - * @brief Forward declaration of the templated enumeration Map used to convert - * enumeration values to/from string - */ -template < typename Enumeration > -class Map {}; - -/** - * @brief Return whether or not a string is a symbol for an enumeration - * - * @param[in] value the enumeration value - * - * @return true/false - */ -template < typename Enumeration, - typename = std::enable_if_t< std::is_enum_v< Enumeration > > > -bool isSymbol( const std::string& symbol ) { - - return Map< Enumeration >::symbols.find( symbol ) - != Map< Enumeration >::symbols.end(); -} - -/** - * @brief Return a string symbol of the enumeration value - * - * @param[in] value the enumeration value - * - * @return A string symbol representing the enumeration value - */ -template < typename Enumeration, - typename = std::enable_if_t< std::is_enum_v< Enumeration > > > -const std::string& toString( const Enumeration& value ) { - - auto found = Map< Enumeration >::values.find( value ); - if ( found == Map< Enumeration >::values.end() ) { - - log::error( "An enumeration value for {} has no registered symbol", - typeid( Enumeration ).name() ); - throw std::exception(); - } - return found->second; -} - -/** - * @brief Return an enumeration value based on a string symbol - * - * @param[in] symbol the enumeration symbol - * - * @return An enumeration value derived from the string symbol - */ -template < typename Enumeration, - typename = std::enable_if_t< std::is_enum_v< Enumeration > > > -const Enumeration& fromString( const std::string& symbol ) { - - auto found = Map< Enumeration >::symbols.find( symbol ); - if ( found == Map< Enumeration >::symbols.end() ) { - - log::error( "An enumeration symbol for {} has no registered value: \"{}\"", - typeid( Enumeration ).name(), symbol ); - throw std::exception(); - } - return found->second; -} - -/** - * @brief operator>> for enumerations - * - * @param[in] in the input stream - * @param[in] value the enumeration value - * - * @return the input stream (position is unchanged and failbit is set if no - * enumeration value could be read) - */ -template < typename Enumeration, - typename = std::enable_if_t< std::is_enum_v< Enumeration > > > -std::istream &operator>>( std::istream& in, Enumeration& value ) { - - auto position = in.tellg(); - std::string symbol; - in >> symbol; - if ( in.fail() ) { - - in.clear(); - in.seekg( position ); - in.setstate( std::ios::failbit ); - } - else { - - try { - - value = fromString< Enumeration >( symbol ); - } - catch ( std::exception& ) { - - in.seekg( position ); - in.setstate( std::ios::failbit ); - } - } - return in; -} - -/** - * @brief operator<< for enumerations - * - * @param[in] in the input stream - * @param[in] value the enumeration value - * - * @return the output stream - */ -template < typename Enumeration, - typename = std::enable_if_t< std::is_enum_v< Enumeration > > > -std::ostream& operator<<( std::ostream& out, const Enumeration& value ) { - - return out << toString( value ); -} - -} // namespace enums - -#endif diff --git a/src/GNDStk/enums/units/Energy.hpp b/src/GNDStk/enums/units/Energy.hpp deleted file mode 100644 index 8f4402d4e..000000000 --- a/src/GNDStk/enums/units/Energy.hpp +++ /dev/null @@ -1,63 +0,0 @@ - -#ifndef NJOY_GNDSTK_ENUMS_UNITS_ENERGY -#define NJOY_GNDSTK_ENUMS_UNITS_ENERGY - -namespace enums { -namespace units { - - /** - * @class - * @brief Enumeration class giving acceptable units for energy - * - * See GNDS v1.9 specifications section 5.1.1 - */ - enum class Energy { - - eV, - MeV - }; - - using enums::fromString; - using enums::toString; - using enums::operator>>; - using enums::operator<<; - - /** - * @brief Return whether or not a string is a valid energy unit - * - * @param[in] string the string to be verified - * - * @return true/false - */ - inline bool isEnergyUnit( const std::string& string ) { - - return GNDStk::enums::isSymbol< GNDStk::enums::units::Energy >( string ); - } - -} // namespace units - - /** - * @brief Template specialisation to convert Energy to/from strings - */ - template <> - class Map< GNDStk::enums::units::Energy > { - public: - - static inline const std::map< GNDStk::enums::units::Energy, - const std::string > values{ - - { GNDStk::enums::units::Energy::eV, "eV" }, - { GNDStk::enums::units::Energy::MeV, "MeV" } - }; - - static inline const std::map< const std::string, - GNDStk::enums::units::Energy > symbols{ - - { "eV", GNDStk::enums::units::Energy::eV }, - { "MeV", GNDStk::enums::units::Energy::MeV } - }; - }; - -} // namespace enums - -#endif diff --git a/src/GNDStk/enums/units/Energy/test/CMakeLists.txt b/src/GNDStk/enums/units/Energy/test/CMakeLists.txt deleted file mode 100644 index e7c60b6a1..000000000 --- a/src/GNDStk/enums/units/Energy/test/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ - -add_executable( GNDStk.enums.units.Energy.test Energy.test.cpp ) -target_compile_options( GNDStk.enums.units.Energy.test PRIVATE ${${PREFIX}_common_flags} -$<$:${${PREFIX}_strict_flags}>$<$: -${${PREFIX}_DEBUG_flags} -$<$:${${PREFIX}_coverage_flags}>> -$<$: -${${PREFIX}_RELEASE_flags} -$<$:${${PREFIX}_link_time_optimization_flags}> -$<$:${${PREFIX}_nonportable_optimization_flags}>> - -${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.enums.units.Energy.test PUBLIC GNDStk ) -file( GLOB resources "resources/*" ) -foreach( resource ${resources}) - file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) -endforeach() -add_test( NAME GNDStk.enums.units.Energy COMMAND GNDStk.enums.units.Energy.test ) diff --git a/src/GNDStk/enums/units/Energy/test/Energy.test.cpp b/src/GNDStk/enums/units/Energy/test/Energy.test.cpp deleted file mode 100644 index 394427eaf..000000000 --- a/src/GNDStk/enums/units/Energy/test/Energy.test.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk.hpp" - -// other includes - -// convenience typedefs -using namespace njoy::GNDStk; -using Energy = enums::units::Energy; - -SCENARIO( "Energy" ) { - - GIVEN( "valid unit values and symbols" ) { - - WHEN( "toString is used" ) { - - THEN( "no exception is thrown and the correct string is returned" ) { - - CHECK( "eV" == enums::units::toString( Energy::eV ) ); - CHECK( "MeV" == enums::units::toString( Energy::MeV ) ); - } // THEN - } // WHEN - - WHEN( "fromString is used" ) { - - THEN( "no exception is thrown when the symbol is registered" ) { - - CHECK( Energy::eV == enums::units::fromString< Energy >( "eV" ) ); - CHECK( Energy::MeV == enums::units::fromString< Energy >( "MeV" ) ); - } // THEN - - THEN( "an exception is thrown when the symbol is not registered" ) { - - CHECK_THROWS( enums::units::fromString< Energy >( "unregistered" ) ); - } // THEN - } // WHEN - - WHEN( "operator<< is used" ) { - - THEN( "no exception is thrown and the symbol is written to the stream" ) { - - std::ostringstream out; - out << Energy::eV << ' ' << Energy::MeV; - - CHECK( "eV MeV" == out.str() ); - } // THEN - } // WHEN - - WHEN( "operator>> is used" ) { - - THEN( "the stream is not in fail() when the symbol is registered" ) { - - Energy value; - std::istringstream in( "eV MeV" ); - - in >> value; - CHECK( Energy::eV == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Energy::MeV == value ); - CHECK( false == in.fail() ); - CHECK( true == in.eof() ); - } // THEN - - THEN( "the stream is in fail() and the position has not changed when " - "the symbol is not registered" ) { - - Energy value = Energy::eV; - std::istringstream in( "unregistered" ); - in >> value; - - CHECK( Energy::eV == value ); - CHECK( true == in.fail() ); - } // THEN - } // WHEN - - WHEN( "isEnergyUnit is used" ) { - - THEN( "registered units return true, unregistered units return false" ) { - - CHECK( true == enums::units::isEnergyUnit( "eV" ) ); - CHECK( true == enums::units::isEnergyUnit( "MeV" ) ); - CHECK( false == enums::units::isEnergyUnit( "unregistered" ) ); - } // THEN - } // WHEN - } // GIVEN -} // SCENARIO diff --git a/src/GNDStk/enums/units/Length.hpp b/src/GNDStk/enums/units/Length.hpp deleted file mode 100644 index 8e48c2ba1..000000000 --- a/src/GNDStk/enums/units/Length.hpp +++ /dev/null @@ -1,66 +0,0 @@ - -#ifndef NJOY_GNDSTK_ENUMS_UNITS_LENGTH -#define NJOY_GNDSTK_ENUMS_UNITS_LENGTH - -namespace enums { -namespace units { - - /** - * @class - * @brief Enumeration class giving acceptable units for length - * - * See GNDS v1.9 specifications section 5.1.1 - */ - enum class Length { - - m, - cm, - fm - }; - - using enums::fromString; - using enums::toString; - using enums::operator>>; - using enums::operator<<; - - /** - * @brief Return whether or not a string is a valid energy unit - * - * @param[in] string the string to be verified - * - * @return true/false - */ - inline bool isLengthUnit( const std::string& string ) { - - return GNDStk::enums::isSymbol< GNDStk::enums::units::Length >( string ); - } - -} // namespace units - - /** - * @brief Template specialisation to convert Length to/from strings - */ - template <> - class Map< GNDStk::enums::units::Length > { - public: - - static inline const std::map< GNDStk::enums::units::Length, - const std::string > values{ - - { GNDStk::enums::units::Length::m, "m" }, - { GNDStk::enums::units::Length::cm, "cm" }, - { GNDStk::enums::units::Length::fm, "fm" } - }; - - static inline const std::map< const std::string, - GNDStk::enums::units::Length > symbols{ - - { "m", GNDStk::enums::units::Length::m }, - { "cm", GNDStk::enums::units::Length::cm }, - { "fm", GNDStk::enums::units::Length::fm } - }; - }; - -} // namespace enums - -#endif diff --git a/src/GNDStk/enums/units/Length/test/CMakeLists.txt b/src/GNDStk/enums/units/Length/test/CMakeLists.txt deleted file mode 100644 index d2f2a7ef7..000000000 --- a/src/GNDStk/enums/units/Length/test/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ - -add_executable( GNDStk.enums.units.Length.test Length.test.cpp ) -target_compile_options( GNDStk.enums.units.Length.test PRIVATE ${${PREFIX}_common_flags} -$<$:${${PREFIX}_strict_flags}>$<$: -${${PREFIX}_DEBUG_flags} -$<$:${${PREFIX}_coverage_flags}>> -$<$: -${${PREFIX}_RELEASE_flags} -$<$:${${PREFIX}_link_time_optimization_flags}> -$<$:${${PREFIX}_nonportable_optimization_flags}>> - -${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.enums.units.Length.test PUBLIC GNDStk ) -file( GLOB resources "resources/*" ) -foreach( resource ${resources}) - file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) -endforeach() -add_test( NAME GNDStk.enums.units.Length COMMAND GNDStk.enums.units.Length.test ) diff --git a/src/GNDStk/enums/units/Length/test/Length.test.cpp b/src/GNDStk/enums/units/Length/test/Length.test.cpp deleted file mode 100644 index 9e2e528a0..000000000 --- a/src/GNDStk/enums/units/Length/test/Length.test.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk.hpp" - -// other includes - -// convenience typedefs -using namespace njoy::GNDStk; -using Length = enums::units::Length; - -SCENARIO( "Length" ) { - - GIVEN( "valid unit values and symbols" ) { - - WHEN( "toString is used" ) { - - THEN( "no exception is thrown and the correct string is returned" ) { - - CHECK( "m" == enums::units::toString( Length::m ) ); - CHECK( "cm" == enums::units::toString( Length::cm ) ); - CHECK( "fm" == enums::units::toString( Length::fm ) ); - } // THEN - } // WHEN - - WHEN( "fromString is used" ) { - - THEN( "no exception is thrown when the symbol is registered" ) { - - CHECK( Length::m == enums::units::fromString< Length >( "m" ) ); - CHECK( Length::cm == enums::units::fromString< Length >( "cm" ) ); - CHECK( Length::fm == enums::units::fromString< Length >( "fm" ) ); - } // THEN - - THEN( "an exception is thrown when the symbol is not registered" ) { - - CHECK_THROWS( enums::units::fromString< Length >( "unregistered" ) ); - } // THEN - } // WHEN - - WHEN( "operator<< is used" ) { - - THEN( "no exception is thrown and the symbol is written to the stream" ) { - - std::ostringstream out; - out << Length::m << ' ' << Length::cm << ' ' << Length::fm; - - CHECK( "m cm fm" == out.str() ); - } // THEN - } // WHEN - - WHEN( "operator>> is used" ) { - - THEN( "the stream is not in fail() when the symbol is registered" ) { - - Length value; - std::istringstream in( "m cm fm" ); - - in >> value; - CHECK( Length::m == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Length::cm == value ); - CHECK( false == in.fail() ); - CHECK( false == in.eof() ); - - in >> value; - CHECK( Length::fm == value ); - CHECK( false == in.fail() ); - CHECK( true == in.eof() ); - } // THEN - - THEN( "the stream is in fail() and the position has not changed when " - "the symbol is not registered" ) { - - Length value = Length::m; - std::istringstream in( "unregistered" ); - in >> value; - - CHECK( Length::m == value ); - CHECK( true == in.fail() ); - } // THEN - } // WHEN - - WHEN( "isLengthUnit is used" ) { - - THEN( "registered units return true, unregistered units return false" ) { - - CHECK( true == enums::units::isLengthUnit( "m" ) ); - CHECK( true == enums::units::isLengthUnit( "cm" ) ); - CHECK( true == enums::units::isLengthUnit( "fm" ) ); - CHECK( false == enums::units::isLengthUnit( "unregistered" ) ); - } // THEN - } // WHEN - } // GIVEN -} // SCENARIO diff --git a/src/GNDStk/keyword.hpp b/src/GNDStk/keyword.hpp deleted file mode 100644 index b6f929996..000000000 --- a/src/GNDStk/keyword.hpp +++ /dev/null @@ -1,17 +0,0 @@ - -// ----------------------------------------------------------------------------- -// This file defines constructs that are intended to help us, and users, -// create Meta and Child objects. -// ----------------------------------------------------------------------------- - -// keyword_t -class keyword_t { -public: - #include "GNDStk/keyword/src/meta.hpp" - #include "GNDStk/keyword/src/child.hpp" -}; - -// keyword -// An object of the keyword_t type. -// Useful for creating Meta and Child objects. -inline const keyword_t keyword; diff --git a/src/GNDStk/keyword/src/child.hpp b/src/GNDStk/keyword/src/child.hpp deleted file mode 100644 index 5b37e5b68..000000000 --- a/src/GNDStk/keyword/src/child.hpp +++ /dev/null @@ -1,48 +0,0 @@ - -// ----------------------------------------------------------------------------- -// keyword_t.child() -// ----------------------------------------------------------------------------- - -// child(name,converter,filter,top) -// To make a Child -template< - class TYPE, - Allow ALLOW = Allow::one, - class CONVERTER = typename detail::default_converter::type, - class FILTER = detail::noFilter -> -static Child< - typename detail::isNotVoid::type, // ensure TYPE != void - ALLOW, - CONVERTER, - FILTER -> child( - const std::string &name, - const TYPE &object = TYPE{}, - const CONVERTER &converter = CONVERTER{}, - const FILTER &filter = FILTER{}, - const bool top = false -) { - return Child(name,object,converter,filter,top); -} - - -// child(name,filter,top) -// To make a Child -template< - class TYPE = void, - Allow ALLOW = Allow::one, - class FILTER = detail::noFilter -> -static Child< - typename detail::is_void::type, // ensure TYPE == void - ALLOW, - void, - FILTER -> child( - const std::string &name, - const FILTER &filter = FILTER{}, - const bool top = false -) { - return Child(name,filter,top); -} diff --git a/src/GNDStk/keyword/src/meta.hpp b/src/GNDStk/keyword/src/meta.hpp deleted file mode 100644 index d0ebaa934..000000000 --- a/src/GNDStk/keyword/src/meta.hpp +++ /dev/null @@ -1,35 +0,0 @@ - -// ----------------------------------------------------------------------------- -// keyword_t.meta() -// ----------------------------------------------------------------------------- - -// meta(name,converter) -// To make a Meta -template< - class TYPE, - class CONVERTER = typename detail::default_converter::type -> -static Meta< - typename detail::isNotVoid::type, // ensure TYPE != void - CONVERTER -> meta( - const std::string &name, - const TYPE &object = TYPE{}, - const CONVERTER &converter = CONVERTER{} -) { - return Meta{name,object,converter}; -} - - -// meta(name) -// To make a Meta -template< - class TYPE = void -> -static Meta< - typename detail::is_void::type // ensure TYPE == void -> meta( - const std::string &name -) { - return Meta(name); -} diff --git a/src/GNDStk/keyword/test/CMakeLists.txt b/src/GNDStk/keyword/test/CMakeLists.txt deleted file mode 100644 index a39ef1a71..000000000 --- a/src/GNDStk/keyword/test/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ - -add_executable( GNDStk.keyword.test keyword.test.cpp ) -target_compile_options( GNDStk.keyword.test PRIVATE ${${PREFIX}_common_flags} -$<$:${${PREFIX}_strict_flags}>$<$: -${${PREFIX}_DEBUG_flags} -$<$:${${PREFIX}_coverage_flags}>> -$<$: -${${PREFIX}_RELEASE_flags} -$<$:${${PREFIX}_link_time_optimization_flags}> -$<$:${${PREFIX}_nonportable_optimization_flags}>> - -${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.keyword.test PUBLIC GNDStk ) -file( GLOB resources "resources/*" ) -foreach( resource ${resources}) - file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) -endforeach() -add_test( NAME GNDStk.keyword COMMAND GNDStk.keyword.test ) \ No newline at end of file diff --git a/src/GNDStk/keyword/test/keyword.test.cpp b/src/GNDStk/keyword/test/keyword.test.cpp deleted file mode 100644 index 72ec2fb06..000000000 --- a/src/GNDStk/keyword/test/keyword.test.cpp +++ /dev/null @@ -1,404 +0,0 @@ - -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk.hpp" - -using namespace njoy::GNDStk; -using std::string; - - - -// ----------------------------------------------------------------------------- -// Custom types -// ----------------------------------------------------------------------------- - -// ------------------------ -// version_t -// ------------------------ - -// class -struct version_t { - int major = -1; - int minor = -1; - int patch = -1; -}; - -// operator>> -std::istream &operator>>(std::istream &s, version_t &obj) -{ - char ch; // '.' - return s >> obj.major >> ch >> obj.minor >> ch >> obj.patch; -} - -// ------------------------ -// date_t -// ------------------------ - -// class -struct date_t { - int year = -1; - int month = -1; - int day = -1; -}; - -// operator>> -std::istream &operator>>(std::istream &s, date_t &obj) -{ - char ch; // '-' - return s >> obj.year >> ch >> obj.month >> ch >> obj.day; -} - -// ------------------------ -// shape_t -// ------------------------ - -// class -struct shape_t { - // or maybe it should cols, rows; not important for this example - int rows = -1; - int cols = -1; -}; - -// operator>> -std::istream &operator>>(std::istream &s, shape_t &obj) -{ - char ch; // ',' - return s >> obj.rows >> ch >> obj.cols; -} - -// ------------------------ -// values_t -// ------------------------ - -// class -using values_t = std::vector; - -// ------------------------ -// manifest_t -// ------------------------ - -// class -struct manifest_t { - string information; -}; - -// convert -template -void convert(const NODE &node, manifest_t &man) -{ - std::ostringstream oss; - - // name - oss << "node: \"" << node.name << '"' << std::endl; - - // metadata - oss << " metadata:" << std::endl; - for (auto &m : node.metadata) - oss << " \"" << m.first << '"' << std::endl; - - // children - oss << " children:" << std::endl; - for (auto &c : node.children) - oss << " \"" << c->name << '"' << std::endl; - - man.information = oss.str(); -} - - - -// ----------------------------------------------------------------------------- -// Some literal strings representing correct values -// ----------------------------------------------------------------------------- - -static const std::string manifest_tree = -R"***(node: "" - metadata: - children: - "xml" - "covarianceSuite" -)***"; - -static const std::string manifest_covarianceSuite = -R"***(node: "covarianceSuite" - metadata: - "projectile" - "target" - "evaluation" - "format" - children: - "styles" - "externalFiles" - "parameterCovariances" -)***"; - -static const std::string manifest_parameterCovariances = -R"***(node: "parameterCovariance" - metadata: - "label" - children: - "rowData" - "parameterCovarianceMatrix" -)***"; - - - -// ----------------------------------------------------------------------------- -// Scenario -// ----------------------------------------------------------------------------- - -SCENARIO("Testing GNDStk keyword") { - - using namespace misc; - - // tree - const njoy::GNDStk::Tree tree("n-069_Tm_170-covar.xml"); - - // ------------------------ - // exercise some built-ins - // ------------------------ - - WHEN("We access a tree using some built-in Child and Meta objects") { - CHECK(tree(xml).metadata.size() == 2); - CHECK(tree(xml).children.size() == 0); - CHECK(tree(xml,version) == "1.0"); - CHECK(tree(xml,encoding) == "UTF-8"); - CHECK(tree(covarianceSuite).metadata.size() == 4); - CHECK(tree(covarianceSuite).children.size() == 3); - CHECK(tree(covarianceSuite,projectile) == "n"); - CHECK(tree(covarianceSuite,target) == "Tm170"); - CHECK(tree(covarianceSuite,evaluation) == "ENDF/B-8.0"); - CHECK(tree(covarianceSuite,format) == 1.9); - CHECK(tree(covarianceSuite,styles).metadata.size() == 0); - CHECK(tree(covarianceSuite,styles).children.size() == 1); - CHECK(tree(covarianceSuite,styles,--evaluated).metadata.size() == 4); - CHECK(tree(covarianceSuite,styles,--evaluated).children.size() == 2); - CHECK(tree(covarianceSuite,styles,--evaluated,misc::meta::label) == "eval"); - } // WHEN - - - // ------------------------ - // make our own - // ------------------------ - - // for metadata - auto myversion = keyword.meta("version"); - auto mydate = keyword.meta("date"); - auto myshape = keyword.meta("shape",shape_t{},detail::convert_t{}); - - // for children - // The following is just like GNDStk::common::numeric, - // or equivalently, GNDStk::[basic or core]::numeric. - auto mynumbers = keyword.child - ("pcdata",values_t{},detail::convert_pcdata_text_t{}); - - // In the following, a name of "" means to stay at the current node - auto mymanifest = keyword.child(""); - - auto vers = tree(xml,myversion); - - - // ------------------------ - // use them - // ------------------------ - - WHEN("We build our own Child and Meta objects, using keyword_t") { - - THEN("Try extracting xml version") { - // Extract version into *our* version type - // Specifically: myversion keyword ==> version_t - CHECK(vers.major == 1); - CHECK(vers.minor == 0); - } - - THEN("Try extracting covarianceSuite/styles/evaluated/version") { - // Now extract version - vers = tree(covarianceSuite,styles,--evaluated,myversion); - CHECK(vers.major == 8); - CHECK(vers.minor == 0); - CHECK(vers.patch == 1); - } - - // For brevity, let's make a shortcut to - auto &eval = tree(covarianceSuite,styles,--evaluated); - - THEN("Try extracting covarianceSuite/styles/evaluated/date") { - // Extract date in , via the shortcut - // Specifically: mydate keyword ==> date_t - auto date = eval(mydate); - CHECK(date.year == 2011); - CHECK(date.month == 10); - CHECK(date.day == 1); - } - - // Pull out , to make some upcoming queries shorter - auto &arr = tree( - covarianceSuite, parameterCovariances, --parameterCovariance, - --parameterCovarianceMatrix, array); - - THEN("Try extracting .../array/shape") { - // Extract shape into our shape type - // Specifically: myshape keyword ==> shape_t - auto shape = arr(myshape); - CHECK(shape.rows == 78); - CHECK(shape.cols == 78); - } - - THEN("Try extracting .../array/values") { - // Extract values into our values_t type, - // which is vector. - // Specifically: myshape keyword ==> shape_t - auto val = arr(--child::values,mynumbers); - CHECK(val[0] == 0.015); - CHECK(val[1] == 0); - CHECK(val[2] == 0); - CHECK(val[3] == 0); - CHECK(val[4] == 4.5e-5); - } - - } // WHEN - - - // ------------------------ - // Special keyword - // with lookup "" - // ------------------------ - - // Special keyword: mymanifest, a child keyword with lookup key "". - // Meaning: for the currently active Node, print its name, the names - // of its metadata, and the names of its children. This demonstrates - // how we could build various "x-ray" or "dictionary" type tools. - // See how manifest_t is set up, earlier in this file. - - // Examine the tree itself - WHEN("We use a special \"\"-named keyword to examine tree") { - auto man = tree(mymanifest); - CHECK(man.information == manifest_tree); - } - - // Let's look at what's in the top-level GNDS node. Note that top() - // gets us the top-level node here, from which we call (manifest); - // we do *not* write tree.top(manifest), which wouldn't make sense. - WHEN("We use a special \"\"-named keyword to examine tree.top()") { - auto man = tree.top()(mymanifest); - CHECK(man.information == manifest_covarianceSuite); - } - - // Of course we can do this as well, knowing that covarianceSuite - // is the top-level node - WHEN("We use a special \"\"-named keyword to examine ") { - auto man = tree(covarianceSuite, mymanifest); - CHECK(man.information == manifest_covarianceSuite); - } - - // And let's dig further: - WHEN("We use a special \"\"-named keyword to examine " - ".../") { - auto man = tree( - covarianceSuite, parameterCovariances, - --parameterCovariance, mymanifest - ); - CHECK(man.information == manifest_parameterCovariances); - } - - - // ------------------------ - // Exercise keyword - // builder... - // ------------------------ - - // To properly test this, we should really have something like the Boost - // demangle library, to print a representation of the *type* that's being - // created. For now, let's just make sure that the expressions are valid. - - // ------------------------ - // ...metadata, type - // ------------------------ - - { - { auto m = keyword.meta ("m" ); } - { auto m = keyword.meta ("m", 0 ); } - { auto m = keyword.meta ("m", 0, detail::convert_t{}); } - { auto m = keyword.meta< > ("m" ); } - { auto m = keyword.meta< > ("m", 0 ); } - { auto m = keyword.meta< > ("m", 0, detail::convert_t{}); } - { auto m = keyword.meta ("m" ); } - { auto m = keyword.meta ("m", 0 ); } - { auto m = keyword.meta ("m", 0, detail::convert_t{}); } - { auto m = keyword.meta ("m" ); } - { auto m = keyword.meta ("m", 0 ); } - { auto m = keyword.meta ("m", 0, detail::convert_t{}); } - } - - // ------------------------ - // ...metadata, void - // ------------------------ - - { - { auto m = keyword.meta ("m"); } - { auto m = keyword.meta< > ("m"); } - { auto m = keyword.meta ("m"); } - } - - // ------------------------ - // ...children, type - // ------------------------ - - // The commented-out cases are ambiguous: - // TYPE for , or FILTER for ? - { - { auto c = keyword.child ("c" ); } - // { auto c = keyword.child ("c", 0 ); } - { auto c = keyword.child ("c", 0, detail::convert_t{} ); } - { auto c = keyword.child ("c", 0, detail::convert_t{}, detail::noFilter{} ); } - { auto c = keyword.child ("c", 0, detail::convert_t{}, detail::noFilter{}, false); } - { auto c = keyword.child< > ("c" ); } - // { auto c = keyword.child< > ("c", 0 ); } - { auto c = keyword.child< > ("c", 0, detail::convert_t{} ); } - { auto c = keyword.child< > ("c", 0, detail::convert_t{}, detail::noFilter{} ); } - { auto c = keyword.child< > ("c", 0, detail::convert_t{}, detail::noFilter{}, false); } - { auto c = keyword.child ("c" ); } - { auto c = keyword.child ("c", 0 ); } - { auto c = keyword.child ("c", 0, detail::convert_t{} ); } - { auto c = keyword.child ("c", 0, detail::convert_t{}, detail::noFilter{} ); } - { auto c = keyword.child ("c", 0, detail::convert_t{}, detail::noFilter{}, false); } - { auto c = keyword.child ("c" ); } - { auto c = keyword.child ("c", 0 ); } - { auto c = keyword.child ("c", 0, detail::convert_t{} ); } - { auto c = keyword.child ("c", 0, detail::convert_t{}, detail::noFilter{} ); } - { auto c = keyword.child ("c", 0, detail::convert_t{}, detail::noFilter{}, false); } - { auto c = keyword.child ("c" ); } - { auto c = keyword.child ("c", 0 ); } - { auto c = keyword.child ("c", 0, detail::convert_t{} ); } - { auto c = keyword.child ("c", 0, detail::convert_t{}, detail::noFilter{} ); } - { auto c = keyword.child ("c", 0, detail::convert_t{}, detail::noFilter{}, false); } - { auto c = keyword.child ("c" ); } - { auto c = keyword.child ("c", 0 ); } - { auto c = keyword.child ("c", 0, detail::convert_t{} ); } - { auto c = keyword.child ("c", 0, detail::convert_t{}, detail::noFilter{} ); } - { auto c = keyword.child ("c", 0, detail::convert_t{}, detail::noFilter{}, false); } - } - - // ------------------------ - // ...children, void - // ------------------------ - - // The commented-out cases are ambiguous, as above. - { - { auto c = keyword.child ("c" ); } - // { auto c = keyword.child ("c", detail::noFilter{} ); } - { auto c = keyword.child ("c", detail::noFilter{}, false); } - { auto c = keyword.child< > ("c" ); } - // { auto c = keyword.child< > ("c", detail::noFilter{} ); } - { auto c = keyword.child< > ("c", detail::noFilter{}, false); } - { auto c = keyword.child ("c" ); } - { auto c = keyword.child ("c", detail::noFilter{} ); } - { auto c = keyword.child ("c", detail::noFilter{}, false); } - { auto c = keyword.child ("c" ); } - { auto c = keyword.child ("c", detail::noFilter{} ); } - { auto c = keyword.child ("c", detail::noFilter{}, false); } - { auto c = keyword.child ("c" ); } - { auto c = keyword.child ("c", detail::noFilter{} ); } - { auto c = keyword.child ("c", detail::noFilter{}, false); } - } -} diff --git a/src/GNDStk/misc.hpp b/src/GNDStk/misc.hpp deleted file mode 100644 index 68204de95..000000000 --- a/src/GNDStk/misc.hpp +++ /dev/null @@ -1,22 +0,0 @@ - -// ----------------------------------------------------------------------------- -// Set of miscellaneous Meta and Child objects. These are "miscellaneous" -// in the sense that some use , meaning they'll retrieve metadata and -// child nodes in their original form in the GNDS tree, while others stipulate -// specific types. We've split these out from other sets of Meta and Child -// objects because we may phase them out over time, to be replaced with ones -// that use various custom types, as GNDStk continues to develop. -// ----------------------------------------------------------------------------- - -#include "GNDStk/misc/src/detail.hpp" - -namespace misc { - -#include "GNDStk/misc/src/meta.hpp" -#include "GNDStk/misc/src/child.hpp" - -using namespace meta; -using namespace child; -// using namespace common; - -} // namespace misc diff --git a/src/GNDStk/misc/src/child.hpp b/src/GNDStk/misc/src/child.hpp deleted file mode 100644 index 60b31ea1c..000000000 --- a/src/GNDStk/misc/src/child.hpp +++ /dev/null @@ -1,338 +0,0 @@ - -namespace child { - -// ----------------------------------------------------------------------------- -// Allowable top-level nodes, per LLNL-TR-774621-DRAFT -// ----------------------------------------------------------------------------- - -// Note: the ~ (tilde) makes them allowed as top-level nodes -inline const auto - PoPs = ~Child("PoPs"); -inline const auto - reactionSuite = ~Child("reactionSuite"); -inline const auto - covarianceSuite = ~Child("covarianceSuite"); -inline const auto - thermalScattering = ~Child("thermalScattering"); -inline const auto - fissionFragmentData = ~Child("fissionFragmentData"); - - - -// ----------------------------------------------------------------------------- -// Child Objects -// ----------------------------------------------------------------------------- - -// ------------------------ -// one + many pair -// constructs -// ------------------------ - -GNDSTK_MAKE_CHILD(void, averageEnergies, one); -GNDSTK_MAKE_CHILD(void, averageEnergy, many); - -GNDSTK_MAKE_CHILD(void, axes, one); -GNDSTK_MAKE_CHILD(void, axis, many); - -GNDSTK_MAKE_CHILD(void, baryons, one); -GNDSTK_MAKE_CHILD(void, baryon, many); - -GNDSTK_MAKE_CHILD(void, channels, one); -GNDSTK_MAKE_CHILD(void, channel, many); - -GNDSTK_MAKE_CHILD(void, chemicalElements, one); -GNDSTK_MAKE_CHILD(void, chemicalElement, many); - -GNDSTK_MAKE_CHILD(void, configurations, one); -GNDSTK_MAKE_CHILD(void, configuration, many); - -GNDSTK_MAKE_CHILD(void, decayModes, one); -GNDSTK_MAKE_CHILD(void, decayMode, many); - -GNDSTK_MAKE_CHILD(void, durations, one); -GNDSTK_MAKE_CHILD(void, duration, many); - -GNDSTK_MAKE_CHILD(void, externalFiles, one); -GNDSTK_MAKE_CHILD(void, externalFile, many); - -GNDSTK_MAKE_CHILD(void, fissionComponents, one); -GNDSTK_MAKE_CHILD(void, fissionComponent, many); - -GNDSTK_MAKE_CHILD(void, gaugeBosons, one); -GNDSTK_MAKE_CHILD(void, gaugeBoson, many); - -GNDSTK_MAKE_CHILD(void, isotopes, one); -GNDSTK_MAKE_CHILD(void, isotope, many); - -GNDSTK_MAKE_CHILD(void, Js, one); -GNDSTK_MAKE_CHILD(void, J, many); - -GNDSTK_MAKE_CHILD(void, leptons, one); -GNDSTK_MAKE_CHILD(void, lepton, many); - -GNDSTK_MAKE_CHILD(void, nuclides, one); -GNDSTK_MAKE_CHILD(void, nuclide, many); - -GNDSTK_MAKE_CHILD(void, productions, one); -// The GNDS manual says: -// production: [optional, must appear one time] -// but we think that that's wrong. It actually does appear more than once -// in some parent nodes in some GNDS files. We think the manual makes the -// same mistake at least two more times - with and . -// Both sometimes appear multiple times under a single parent in some GNDS -// files, but the manual says "must appear one time" for both. (The manual -// says "must appear at least one time" elsewhere, for things that can -// appear multiple times under a single parent.) -GNDSTK_MAKE_CHILD(void, production, many); - -GNDSTK_MAKE_CHILD(void, products, one); -GNDSTK_MAKE_CHILD(void, product, many); - -GNDSTK_MAKE_CHILD(void, productYields, one); -GNDSTK_MAKE_CHILD(void, productYield, many); - -GNDSTK_MAKE_CHILD(void, reactions, one); -GNDSTK_MAKE_CHILD(void, reaction, many); - -GNDSTK_MAKE_CHILD(void, resonanceReactions, one); -GNDSTK_MAKE_CHILD(void, resonanceReaction, many); - -GNDSTK_MAKE_CHILD(void, scatteringAtoms, one); -GNDSTK_MAKE_CHILD(void, scatteringAtom, many); - -GNDSTK_MAKE_CHILD(void, spectra, one); -GNDSTK_MAKE_CHILD(void, spectrum, many); - -GNDSTK_MAKE_CHILD(void, spinGroups, one); -GNDSTK_MAKE_CHILD(void, spinGroup, many); - -GNDSTK_MAKE_CHILD(void, widths, one); -GNDSTK_MAKE_CHILD(void, width, many); - -GNDSTK_MAKE_CHILD(void, sums, one); -GNDSTK_MAKE_CHILD(void, sum, many); - -GNDSTK_MAKE_CHILD(void, Ls, one); -GNDSTK_MAKE_CHILD(void, L, many); - -GNDSTK_MAKE_CHILD(void, summands, one); -GNDSTK_MAKE_CHILD(void, summand, many); - - -// ------------------------ -// Others, not paired -// as above -// ------------------------ - -// fixme -// Do more sorting/categorization -// Some may actually be singular/plural pairs - -// Allow::one cases -GNDSTK_MAKE_CHILD(void, aliases, one); -GNDSTK_MAKE_CHILD(void, angular, one); -GNDSTK_MAKE_CHILD(void, angularEnergy, one); -GNDSTK_MAKE_CHILD(void, angularTwoBody, one); -GNDSTK_MAKE_CHILD(void, applicationData, one); -GNDSTK_MAKE_CHILD(void, array, one); -GNDSTK_MAKE_CHILD(void, atomic, one); -GNDSTK_MAKE_CHILD(void, averageProductEnergy, one); -GNDSTK_MAKE_CHILD(void, background, one); -GNDSTK_MAKE_CHILD(void, bindingEnergy, one); -GNDSTK_MAKE_CHILD(void, branching1d, one); -GNDSTK_MAKE_CHILD(void, branching3d, one); -GNDSTK_MAKE_CHILD(void, BreitWigner, one); -GNDSTK_MAKE_CHILD(void, characteristicCrossSection, one); -GNDSTK_MAKE_CHILD(void, charge, one); -GNDSTK_MAKE_CHILD(void, coherentElastic, one); -GNDSTK_MAKE_CHILD(void, coherentPhotonScattering, one); -GNDSTK_MAKE_CHILD(void, columnData, one); -GNDSTK_MAKE_CHILD(void, columnHeaders, one); -GNDSTK_MAKE_CHILD(void, constant1d, one); -GNDSTK_MAKE_CHILD(void, continuum, one); -GNDSTK_MAKE_CHILD(void, CoulombPlusNuclearElastic, one); -GNDSTK_MAKE_CHILD(void, covarianceSections, one); -GNDSTK_MAKE_CHILD(void, crossSection, one); -GNDSTK_MAKE_CHILD(void, crossSections, one); -GNDSTK_MAKE_CHILD(void, cutoffEnergy, one); -GNDSTK_MAKE_CHILD(void, data, one); -GNDSTK_MAKE_CHILD(void, DebyeWaller, one); -GNDSTK_MAKE_CHILD(void, decayData, one); -GNDSTK_MAKE_CHILD(void, decayPath, one); -GNDSTK_MAKE_CHILD(void, delayedBetaEnergy, one); -GNDSTK_MAKE_CHILD(void, delayedGammaEnergy, one); -GNDSTK_MAKE_CHILD(void, delayedNeutronKE, one); -GNDSTK_MAKE_CHILD(void, discreteGamma, one); -GNDSTK_MAKE_CHILD(void, distribution, one); -GNDSTK_MAKE_CHILD(void, documentation, one); -GNDSTK_MAKE_CHILD(void, documentations, one); -GNDSTK_MAKE_CHILD(void, doubleDifferentialCrossSection, one); -GNDSTK_MAKE_CHILD(void, e_critical, one); -GNDSTK_MAKE_CHILD(void, EFH, one); -GNDSTK_MAKE_CHILD(void, EFL, one); -GNDSTK_MAKE_CHILD(void, e_max, one); -GNDSTK_MAKE_CHILD(void, ENDFconversionFlags, one); -GNDSTK_MAKE_CHILD(void, energy, one); -GNDSTK_MAKE_CHILD(void, energyAngular, one); -GNDSTK_MAKE_CHILD(void, evaporation, one); -GNDSTK_MAKE_CHILD(void, f, one); -GNDSTK_MAKE_CHILD(void, fastRegion, one); -GNDSTK_MAKE_CHILD(void, fissionEnergyReleased, one); -GNDSTK_MAKE_CHILD(void, freeAtomCrossSection, one); -GNDSTK_MAKE_CHILD(void, g, one); -GNDSTK_MAKE_CHILD(void, generalEvaporation, one); -GNDSTK_MAKE_CHILD(void, gridded2d, one); -GNDSTK_MAKE_CHILD(void, gridded3d, one); -GNDSTK_MAKE_CHILD(void, halflife, one); -GNDSTK_MAKE_CHILD(void, hardSphereRadius, one); -GNDSTK_MAKE_CHILD(void, imaginaryAnomalousFactor, one); -GNDSTK_MAKE_CHILD(void, imaginaryInterferenceTerm, one); -GNDSTK_MAKE_CHILD(void, incoherentElastic, one); -GNDSTK_MAKE_CHILD(void, incoherentInelastic, one); -GNDSTK_MAKE_CHILD(void, incoherentPhotonScattering, one); -GNDSTK_MAKE_CHILD(void, incompleteReactions, one); -GNDSTK_MAKE_CHILD(void, institution, one); -GNDSTK_MAKE_CHILD(void, intensity, one); -GNDSTK_MAKE_CHILD(void, internalConversionCoefficients, one); -GNDSTK_MAKE_CHILD(void, internalPairFormationCoefficient, one); -GNDSTK_MAKE_CHILD(void, isotropic2d, one); -GNDSTK_MAKE_CHILD(void, KalbachMann, one); -GNDSTK_MAKE_CHILD(void, levelSpacing, one); -GNDSTK_MAKE_CHILD(void, link, one); -GNDSTK_MAKE_CHILD(void, listOfCovariances, one); -GNDSTK_MAKE_CHILD(void, MadlandNix, one); -GNDSTK_MAKE_CHILD(void, mass, one); -GNDSTK_MAKE_CHILD(void, mixed, one); -GNDSTK_MAKE_CHILD(void, multiplicities, one); -GNDSTK_MAKE_CHILD(void, multiplicity, one); -GNDSTK_MAKE_CHILD(void, NBodyPhaseSpace, one); -GNDSTK_MAKE_CHILD(void, neutrinoEnergy, one); -GNDSTK_MAKE_CHILD(void, nonNeutrinoEnergy, one); -GNDSTK_MAKE_CHILD(void, nuclearAmplitudeExpansion, one); -GNDSTK_MAKE_CHILD(void, nuclearPlusInterference, one); -GNDSTK_MAKE_CHILD(void, nuclearTerm, one); -GNDSTK_MAKE_CHILD(void, nucleus, one); -GNDSTK_MAKE_CHILD(void, orphanProducts, one); -GNDSTK_MAKE_CHILD(void, outputChannel, one); -GNDSTK_MAKE_CHILD(void, parameterCovariances, one); -GNDSTK_MAKE_CHILD(void, parameters, one); -GNDSTK_MAKE_CHILD(void, parity, one); -GNDSTK_MAKE_CHILD(void, photonEmissionProbabilities, one); -GNDSTK_MAKE_CHILD(void, pids, one); -GNDSTK_MAKE_CHILD(void, polynomial1d, one); -GNDSTK_MAKE_CHILD(void, positronEmissionIntensity, one); -GNDSTK_MAKE_CHILD(void, primaryGamma, one); -GNDSTK_MAKE_CHILD(void, probability, one); -GNDSTK_MAKE_CHILD(void, projectileEnergyDomain, one); -GNDSTK_MAKE_CHILD(void, promptGammaEnergy, one); -GNDSTK_MAKE_CHILD(void, promptNeutronKE, one); -GNDSTK_MAKE_CHILD(void, promptProductKE, one); -GNDSTK_MAKE_CHILD(void, Q, one); -GNDSTK_MAKE_CHILD(void, r, one); -GNDSTK_MAKE_CHILD(void, realAnomalousFactor, one); -GNDSTK_MAKE_CHILD(void, realInterferenceTerm, one); -GNDSTK_MAKE_CHILD(void, recoil, one); -GNDSTK_MAKE_CHILD(void, reference, one); -GNDSTK_MAKE_CHILD(void, regions2d, one); -GNDSTK_MAKE_CHILD(void, resolved, one); -GNDSTK_MAKE_CHILD(void, resolvedRegion, one); -GNDSTK_MAKE_CHILD(void, resonanceParameters, one); -GNDSTK_MAKE_CHILD(void, resonances, one); -GNDSTK_MAKE_CHILD(void, resonancesWithBackground, one); -GNDSTK_MAKE_CHILD(void, RMatrix, one); -GNDSTK_MAKE_CHILD(void, rowData, one); -GNDSTK_MAKE_CHILD(void, RutherfordScattering, one); -GNDSTK_MAKE_CHILD(void, S_alpha_beta, one); -GNDSTK_MAKE_CHILD(void, scatteringFactor, one); -GNDSTK_MAKE_CHILD(void, scatteringRadius, one); -GNDSTK_MAKE_CHILD(void, simpleMaxwellianFission, one); -GNDSTK_MAKE_CHILD(void, spin, one); -GNDSTK_MAKE_CHILD(void, S_table, one); -GNDSTK_MAKE_CHILD(void, standard, one); -GNDSTK_MAKE_CHILD(void, string, one); -GNDSTK_MAKE_CHILD(void, styles, one); -GNDSTK_MAKE_CHILD(void, table, one); -GNDSTK_MAKE_CHILD(void, tabulatedWidths, one); -GNDSTK_MAKE_CHILD(void, T_effective, one); -GNDSTK_MAKE_CHILD(void, temperature, one); -GNDSTK_MAKE_CHILD(void, theta, one); -GNDSTK_MAKE_CHILD(void, time, one); -GNDSTK_MAKE_CHILD(void, T_M, one); -GNDSTK_MAKE_CHILD(void, totalEnergy, one); -GNDSTK_MAKE_CHILD(void, U, one); -GNDSTK_MAKE_CHILD(void, uncertainty, one); -GNDSTK_MAKE_CHILD(void, uncorrelated, one); -GNDSTK_MAKE_CHILD(void, unresolved, one); -GNDSTK_MAKE_CHILD(void, unresolvedRegion, one); -GNDSTK_MAKE_CHILD(void, unspecified, one); -GNDSTK_MAKE_CHILD(void, weightedFunctionals, one); -GNDSTK_MAKE_CHILD(void, xml, one); -GNDSTK_MAKE_CHILD(void, yields, one); - -// Allow::many cases -GNDSTK_MAKE_CHILD(void, add, many); -GNDSTK_MAKE_CHILD(void, averageParameterCovariance, many); -GNDSTK_MAKE_CHILD(void, column, many); -GNDSTK_MAKE_CHILD(void, conversion, many); -GNDSTK_MAKE_CHILD(void, covariance, many); -GNDSTK_MAKE_CHILD(void, covarianceMatrix, many); -GNDSTK_MAKE_CHILD(void, crossSectionReconstructed, many); -GNDSTK_MAKE_CHILD(void, crossSectionSum, many); -GNDSTK_MAKE_CHILD(void, decay, many); -GNDSTK_MAKE_CHILD(void, discrete, many); -GNDSTK_MAKE_CHILD(void, evaluated, many); -GNDSTK_MAKE_CHILD(void, fraction, many); -GNDSTK_MAKE_CHILD(void, grid, many); -GNDSTK_MAKE_CHILD(void, integer, many); -GNDSTK_MAKE_CHILD(void, Legendre, many); -GNDSTK_MAKE_CHILD(void, metaStable, many); -GNDSTK_MAKE_CHILD(void, multiplicitySum, many); -GNDSTK_MAKE_CHILD(void, parameterCovariance, many); -GNDSTK_MAKE_CHILD(void, parameterCovarianceMatrix, many); -GNDSTK_MAKE_CHILD(void, parameterLink, many); -GNDSTK_MAKE_CHILD(void, regions1d, many); -GNDSTK_MAKE_CHILD(void, section, many); -GNDSTK_MAKE_CHILD(void, shell, many); -GNDSTK_MAKE_CHILD(void, shortRangeSelfScalingVariance, many); -GNDSTK_MAKE_CHILD(void, values, many); -GNDSTK_MAKE_CHILD(void, weighted, many); -GNDSTK_MAKE_CHILD(void, XYs1d, many); -GNDSTK_MAKE_CHILD(void, XYs2d, many); -GNDSTK_MAKE_CHILD(void, XYs3d, many); - - - -// ----------------------------------------------------------------------------- -// Some special cases -// ----------------------------------------------------------------------------- - -// Double -// Not called double, for obvious reasons. -inline const Child Double("double"); - -// cdata, comment -// These are where XML or (comment) material -// resides. It's reasonable to extract such content into std::strings. We -// then store these as nodes of those respective names, each with one metadatum -// having a key of "text" and a value containing the original content. -inline const Child - cdata("cdata"); -inline const Child - comment("comment"); - -// pcdata -// These are where data appearing in constructs like this: -// 1.2 3.4 5.6 7.8 9.0 -// reside. In that case, our internal tree structure would have a node named -// "values", which would have a child node named "pcdata", which would have a -// metadatum with a key of "text" and a value containing the original content: -// the "1.2 ..." in the above example. Our examination of many GNDS files shows -// that some pcdata nodes contain integers, while others contain doubles. We -// therefore define pcdata as a Child with , so that we can access it -// in its original form and thus dig further down to its "text" metadatum, at -// which point we can decide elsewhere what's appropriate for that. (Read into -// a vector of ints? A vector of doubles? Something else?) -inline const Child - pcdata("pcdata"); - -} // namespace child diff --git a/src/GNDStk/misc/src/detail.hpp b/src/GNDStk/misc/src/detail.hpp deleted file mode 100644 index 44c5e34e0..000000000 --- a/src/GNDStk/misc/src/detail.hpp +++ /dev/null @@ -1,15 +0,0 @@ - -namespace detail { - -// text_metadatum_to_string -// Helper for cdata and comment -class text_metadatum_to_string { -public: - template - void operator()(const NODE &node, std::string &to) const - { - to = node.meta("text"); - } -}; - -} // namespace detail diff --git a/src/GNDStk/misc/src/meta.hpp b/src/GNDStk/misc/src/meta.hpp deleted file mode 100644 index 99004b9cc..000000000 --- a/src/GNDStk/misc/src/meta.hpp +++ /dev/null @@ -1,142 +0,0 @@ - -namespace meta { - -// ----------------------------------------------------------------------------- -// Meta Objects -// ----------------------------------------------------------------------------- - -// bool -GNDSTK_MAKE_META(bool, calculateChannelRadius); -GNDSTK_MAKE_META(bool, calculatedAtThermal); -GNDSTK_MAKE_META(bool, calculatePenetrability); -GNDSTK_MAKE_META(bool, identicalParticles); -GNDSTK_MAKE_META(bool, supportsAngularReconstruction); -GNDSTK_MAKE_META(bool, useForSelfShieldingOnly); -GNDSTK_MAKE_META(bool, complete); - -// int -GNDSTK_MAKE_META(int, A); -GNDSTK_MAKE_META(int, columnIndex); -GNDSTK_MAKE_META(int, columns); -GNDSTK_MAKE_META(int, ENDF_MT); -GNDSTK_MAKE_META(int, index); -GNDSTK_MAKE_META(int, L); -GNDSTK_MAKE_META(int, lowerIndex); -GNDSTK_MAKE_META(int, MAT); -GNDSTK_MAKE_META(int, matrixStartIndex); -GNDSTK_MAKE_META(int, metaStableIndex); -GNDSTK_MAKE_META(int, nParameters); -GNDSTK_MAKE_META(int, numberOfProducts); -GNDSTK_MAKE_META(int, numberPerMolecule); -GNDSTK_MAKE_META(int, parity); -GNDSTK_MAKE_META(int, rows); -GNDSTK_MAKE_META(int, Z); - -// double -GNDSTK_MAKE_META(double, coefficient); -GNDSTK_MAKE_META(double, domainMax); -GNDSTK_MAKE_META(double, domainMin); -GNDSTK_MAKE_META(double, electronNumber); -GNDSTK_MAKE_META(double, format); -GNDSTK_MAKE_META(double, max); -GNDSTK_MAKE_META(double, min); -GNDSTK_MAKE_META(double, muCutoff); - -// string -GNDSTK_MAKE_META(std::string, approximation); -GNDSTK_MAKE_META(std::string, asymmetric); -GNDSTK_MAKE_META(std::string, boundaryCondition); -GNDSTK_MAKE_META(std::string, compression); -GNDSTK_MAKE_META(std::string, crossTerm); -GNDSTK_MAKE_META(std::string, dependenceOnProcessedGroupWidth); -GNDSTK_MAKE_META(std::string, derivedFrom); -GNDSTK_MAKE_META(std::string, domainUnit); -GNDSTK_MAKE_META(std::string, ejectile); -GNDSTK_MAKE_META(std::string, eliminated); -GNDSTK_MAKE_META(std::string, emissionMode); -GNDSTK_MAKE_META(std::string, encoding); -GNDSTK_MAKE_META(std::string, ENDF_MFMT); -GNDSTK_MAKE_META(std::string, evaluation); -GNDSTK_MAKE_META(std::string, final); // is a C++ *contextual* keyword; so OK -GNDSTK_MAKE_META(std::string, fissionGenre); -GNDSTK_MAKE_META(std::string, flags); -GNDSTK_MAKE_META(std::string, functionalForm); -GNDSTK_MAKE_META(std::string, generation); -GNDSTK_MAKE_META(std::string, genre); -GNDSTK_MAKE_META(std::string, href); -GNDSTK_MAKE_META(std::string, id); -GNDSTK_MAKE_META(std::string, initial); -GNDSTK_MAKE_META(std::string, interpolation); -GNDSTK_MAKE_META(std::string, interpolationQualifier); -GNDSTK_MAKE_META(std::string, label); -GNDSTK_MAKE_META(std::string, library); -GNDSTK_MAKE_META(std::string, material); -GNDSTK_MAKE_META(std::string, mode); -GNDSTK_MAKE_META(std::string, name); -GNDSTK_MAKE_META(std::string, path); -GNDSTK_MAKE_META(std::string, pid); -GNDSTK_MAKE_META(std::string, process); -GNDSTK_MAKE_META(std::string, productFrame); -GNDSTK_MAKE_META(std::string, projectile); -GNDSTK_MAKE_META(std::string, projectileFrame); -GNDSTK_MAKE_META(std::string, resonanceReaction); -GNDSTK_MAKE_META(std::string, shape); -GNDSTK_MAKE_META(std::string, style); -GNDSTK_MAKE_META(std::string, subshell); -GNDSTK_MAKE_META(std::string, symbol); -GNDSTK_MAKE_META(std::string, symmetry); -GNDSTK_MAKE_META(std::string, target); -GNDSTK_MAKE_META(std::string, type); -GNDSTK_MAKE_META(std::string, unit); -GNDSTK_MAKE_META(std::string, version); -GNDSTK_MAKE_META(std::string, valueType); -GNDSTK_MAKE_META(std::string, date); -GNDSTK_MAKE_META(std::string, decayRate); // always has double and "1/s"? - - - -// ----------------------------------------------------------------------------- -// Meta Objects -// Special cases -// ----------------------------------------------------------------------------- - -// ------------------------ -// Variant cases; comma in -// variant<,> prevents use -// of the macro -// ------------------------ - -// constant -inline const Meta> -constant("constant"); - -// degreesOfFreedom -// I'd have expected an int for this, always, but some of the GNDS files have -// a non-integral double. Perhaps we could arrange to always read as a double. -inline const Meta> -degreesOfFreedom("degreesOfFreedom"); - -// value -inline const Meta> -value("value"); - -// [ids]value -// Shorthands for specific cases. -// Prefixes {i,d,s} mean {int,double,string}. -inline const Meta ivalue("value"); -inline const Meta dvalue("value"); -inline const Meta svalue("value"); - -// channelSpin -// This actually looks to me like it's always either an int, or some kind -// of fraction, so figure out something clever in place of variant. Perhaps -// a rational-number class? -inline const Meta> -channelSpin("channelSpin"); - -// spin -// Same remark as for channelSpin. -inline const Meta> -spin("spin"); - -} // namespace meta diff --git a/src/GNDStk/node2type.hpp b/src/GNDStk/node2type.hpp index 7ad32a1e5..d076caae2 100644 --- a/src/GNDStk/node2type.hpp +++ b/src/GNDStk/node2type.hpp @@ -22,10 +22,11 @@ to an istream prior to operator>>. // convert(Node,Node) // ----------------------------------------------------------------------------- -inline void convert(const Node &from, Node &to) +inline bool convert(const Node &from, Node &to) { try { to = from; + return true; } catch (...) { log::function("convert(Node,Node)"); throw; diff --git a/src/GNDStk/node2type/test/CMakeLists.txt b/src/GNDStk/node2type/test/CMakeLists.txt index 73fd2abbe..e8a222031 100644 --- a/src/GNDStk/node2type/test/CMakeLists.txt +++ b/src/GNDStk/node2type/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.node2type.test node2type.test.cpp ) +add_executable( + GNDStk.node2type.test + node2type.test.cpp +) + target_compile_options( GNDStk.node2type.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} @@ -10,5 +14,5 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.node2type.test PUBLIC GNDStk ) -add_test( NAME GNDStk.node2type COMMAND GNDStk.node2type.test ) \ No newline at end of file +target_link_libraries( GNDStk.node2type.test PUBLIC GNDStk ) +add_test( NAME GNDStk.node2type COMMAND GNDStk.node2type.test ) diff --git a/src/GNDStk/node2type/test/node2type.test.cpp b/src/GNDStk/node2type/test/node2type.test.cpp index 34f53e512..4d402d96d 100644 --- a/src/GNDStk/node2type/test/node2type.test.cpp +++ b/src/GNDStk/node2type/test/node2type.test.cpp @@ -3,6 +3,7 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "GNDStk/test/keys.hpp" using namespace njoy::GNDStk; @@ -39,19 +40,20 @@ SCENARIO("Testing GNDStk convert(Node,type)") { WHEN("We make a Node foo with particular content") { Node foo("foo"); - // If a Node has a "text" metadatum, then the convert(Node,container) + // If a Node has a special::text metadatum, then the + // convert(Node,container) // function, where container is e.g. vector, will attempt to fill - // the container with the contents of the "text" metadatum's value. - foo.add("text","12 34 56 78 90"); + // the container with the contents of the special::text metadatum's value. + foo.add(special::text,"12 34 56 78 90"); // Update, 2020-10-19. The relevant convert() functionality has been - // reformulated into the detail::convert_pcdata_text_t callable object, + // reformulated into the detail::convert_data_text_t callable object, // so we'll reformulate with that. Ultimately, due to the location of // the new code, we should probably put this test material elsewhere. THEN("convert(foo,deque) extracts the content correctly") { std::deque container; - detail::convert_pcdata_text_t{}(foo,container); + detail::convert_data_text_t{}(foo,container); CHECK(container.size() == 5); CHECK(container[0] == 12); CHECK(container[1] == 34); @@ -62,7 +64,7 @@ SCENARIO("Testing GNDStk convert(Node,type)") { THEN("convert(foo,list) extracts the content correctly") { std::list container; - detail::convert_pcdata_text_t{}(foo,container); + detail::convert_data_text_t{}(foo,container); CHECK(container.size() == 5); auto iter = container.begin(); CHECK(*iter++ == 12); @@ -74,7 +76,7 @@ SCENARIO("Testing GNDStk convert(Node,type)") { THEN("convert(foo,vector) extracts the content correctly") { std::vector container; - detail::convert_pcdata_text_t{}(foo,container); + detail::convert_data_text_t{}(foo,container); CHECK(container.size() == 5); CHECK(container[0] == 12); CHECK(container[1] == 34); diff --git a/src/GNDStk/or.hpp b/src/GNDStk/or.hpp index abe2a4e51..1e24b511b 100644 --- a/src/GNDStk/or.hpp +++ b/src/GNDStk/or.hpp @@ -1,326 +1,147 @@ -// ----------------------------------------------------------------------------- -// fixme -// Material here should be rearranged at some point, to be consistent with the -// general NJOY21 source structure. For now, we're making it available quickly. -// ----------------------------------------------------------------------------- - -// ----------------------------------------------------------------------------- -// Helper classes: -// IsMeta -// IsChild -// IsMetaOrChild -// IsStringOrRegex -// for SFINAE. -// ----------------------------------------------------------------------------- - -namespace detail { - -// ------------------------ -// IsMeta -// ------------------------ - -// default -template -class IsMeta { -public: - static constexpr bool value = false; -}; - -// Meta -template -class IsMeta> { -public: - static constexpr bool value = true; -}; - - -// ------------------------ -// IsChild -// ------------------------ - -// default -template -class IsChild { -public: - static constexpr bool value = false; -}; - -// Child -template -class IsChild> { -public: - static constexpr bool value = true; -}; - - -// ------------------------ -// IsMetaOrChild -// ------------------------ - -template -class IsMetaOrChild { -public: - static constexpr bool value = IsMeta::value || IsChild::value; -}; - - -// ------------------------ -// IsStringOrRegex -// ------------------------ - -// default -template -class IsStringOrRegex { -public: - static constexpr bool value = false; -}; - -// string -template<> -class IsStringOrRegex { -public: - static constexpr bool value = true; - using type = std::string; -}; - -// char * -template<> -class IsStringOrRegex { -public: - static constexpr bool value = true; - using type = std::string; -}; - -// const char * -template<> -class IsStringOrRegex { -public: - static constexpr bool value = true; - using type = std::string; -}; - -// char[N] -template -class IsStringOrRegex { -public: - static constexpr bool value = true; - using type = std::string; -}; - -// regex -template<> -class IsStringOrRegex { -public: - static constexpr bool value = true; - using type = std::regex; -}; - - -// ------------------------ -// IsPairChildStringOrRegex -// ------------------------ - -// default -template -class IsPairChildStringOrRegex { -public: - static constexpr bool value = false; -}; - -// pair -template -class IsPairChildStringOrRegex> { -public: - static constexpr bool value = - IsChild::value && IsStringOrRegex::value; -}; - -} // namespace detail - - - -// ----------------------------------------------------------------------------- -// Helper functionality for std::tuple -// ----------------------------------------------------------------------------- - -namespace detail { - -// ------------------------ -// tupleAllButLast -// ------------------------ - -// These are adapted from: https://stackoverflow.com/questions/51810702 - -template -constexpr auto tupleAllButLastHelper( - const std::tuple &tup, - std::index_sequence -) { - return std::tuple(std::get(tup)...); -} - -template< - class... Args, - class = std::enable_if_t<(0 < sizeof...(Args))> -> -constexpr auto tupleAllButLast(const std::tuple &tup) -{ - return tupleAllButLastHelper( - tup, - std::make_index_sequence{} - ); -} - - -// ------------------------ -// tupleReplaceLast -// ------------------------ - -// Given a tuple with at least one element, make a new tuple that's mostly the -// same, except for a different last element, which can be of a different type. - -template< - class... Args, class RHS, - class = std::enable_if_t<(0 < sizeof...(Args))> -> -constexpr auto tupleReplaceLast(const std::tuple &tup, const RHS &rhs) -{ - return std::tuple_cat(tupleAllButLast(tup), std::tuple(rhs)); -} - -} // namespace detail +#include "GNDStk/or/src/detail.hpp" +/* +Discussion. + +KeyTuple is based mostly on std::tuple, but is specifically designed to help +GNDStk's multi-query system work smoothly. + +makeKeyTuple() can be understood in terms of the KEYS() function in a class +that derives from GNDStk::Component. Typically, a KEYS() function returns some +number of Meta and/or Child objects, |'d together with one of the operator| +overloads that we provide at the end of this file. However, a KEYS() function +can in fact return any of: + + - A KeyTuple (via operator| as described above). + - A single Meta object. + - A single Child object. + - A std::tuple<>. + +The first use is probably the most common, but all are allowed. The purpose of +makeKeyTuple() (which could be considered analogous to std::make_pair in C++) +is to take any of the above, and return an appropriately templated version of +KeyTuple, representing what KEYS() is asking for. Other functions can then be +defined uniformly in terms of KeyTuple only - not KeyTuple, Meta, etc. +*/ // ----------------------------------------------------------------------------- -// KeywordTup +// KeyTuple // ----------------------------------------------------------------------------- // default template -class KeywordTup { +class KeyTuple { public: std::tuple tup; + // last_t using last_t = - // Sans std::decay, const &ness can break detail::IsSomething<> traits. - // Note: sizeof...(Ks) >= 1 here, because we'll specialize the <> case + // Without std::decay, const &ness can break detail::IsSomething<> traits. + // Note: sizeof...(Ks) >= 1 here; we've specialized the KeyTuple<> case. std::decay_t(tup))>; - // KeywordTup(KeywordTup, RHS) + // KeyTuple(KeyTuple, RHS) template< class... LHS, class RHS, - // ensure Ks... == LHS... RHS + // require Ks... == LHS... RHS class = std::enable_if_t< - std::is_same_v< - std::tuple, - std::tuple - > + std::is_same_v, std::tuple> >, - // ensure RHS \in {Meta, Child, pair, string, regex} + // require RHS \in {Meta, Child, pair} class = std::enable_if_t< - detail::IsMetaOrChild::value || - detail::IsPairChildStringOrRegex::value + detail::IsMetaOrChild_v || + detail::IsPairChildStringOrRegex_v > > - KeywordTup(const KeywordTup &lhs, const RHS &rhs) : + KeyTuple(const KeyTuple &lhs, const RHS &rhs) : tup(std::tuple_cat(lhs.tup, std::tuple(rhs))) { } - // KeywordTup(tuple) - KeywordTup(const std::tuple &tup) : - tup(tup) - { } + // KeyTuple(tuple) + KeyTuple(const std::tuple &tup) : tup(tup) { } }; - // <> -// intentionally non-constructible template<> -class KeywordTup<> +class KeyTuple<> { - KeywordTup() = delete; - KeywordTup(const KeywordTup &) = delete; - KeywordTup(KeywordTup &&) = delete; +public: + std::tuple<> tup; + KeyTuple(const std::tuple<> &tup) : tup(tup) { } }; - -// just Meta +// for Meta template -class KeywordTup> { +class KeyTuple> { using M = Meta; public: std::tuple tup; - explicit KeywordTup(const M &m) : tup(m) { } + explicit KeyTuple(const M &m) : tup(m) { } }; - -// just Child +// for Child template -class KeywordTup> { +class KeyTuple> { using C = Child; public: std::tuple tup; - explicit KeywordTup(const C &c) : tup(c) { } + explicit KeyTuple(const C &c) : tup(c) { } }; - -// std::pair +// for std::pair template -class KeywordTup,std::string>> { +class KeyTuple,std::string>> { using CPAIR = std::pair,std::string>; public: using last_t = CPAIR; std::tuple tup; - explicit KeywordTup(const CPAIR &cpair) : tup(cpair) { } + explicit KeyTuple(const CPAIR &cpair) : tup(cpair) { } }; - -// std::pair +// for std::pair template -class KeywordTup,std::regex>> { +class KeyTuple,std::regex>> { using CPAIR = std::pair,std::regex>; public: using last_t = CPAIR; std::tuple tup; - explicit KeywordTup(const CPAIR &cpair) : tup(cpair) { } + explicit KeyTuple(const CPAIR &cpair) : tup(cpair) { } }; - // ----------------------------------------------------------------------------- -// toKeywordTup +// makeKeyTuple // ----------------------------------------------------------------------------- -// for std::tuple +// for KeyTuple template -constexpr auto toKeywordTup(const std::tuple &tup) +constexpr auto makeKeyTuple(const KeyTuple &keytup) { - return KeywordTup(tup); -} - -// for KeywordTup -template -constexpr auto toKeywordTup(const KeywordTup &kwds) -{ - return kwds; + return keytup; } // for Meta, Child, and pair -// Returns a 1-element KeywordTup made from the object +// Returns a 1-element KeyTuple made from the object template< class T, class = std::enable_if_t< - detail::IsMetaOrChild::value || - detail::IsPairChildStringOrRegex::value + detail::IsMetaOrChild_v || + detail::IsPairChildStringOrRegex_v > > -constexpr auto toKeywordTup(const T &obj) +constexpr auto makeKeyTuple(const T &obj) { - return KeywordTup(obj); + return KeyTuple(obj); } +// for std::tuple +template +constexpr auto makeKeyTuple(const std::tuple &tup) +{ + return KeyTuple(tup); +} // ----------------------------------------------------------------------------- @@ -332,56 +153,55 @@ constexpr auto toKeywordTup(const T &obj) CASES ------------------------ -Below, KeywordTup<...> doesn't include <>; at least one element must exist. - ------------------------------------------+------------------------------------ - CASE | RESULT ------------------------------------------+------------------------------------ -1. Meta/Child | Meta/Child | - a. Meta | Meta | KeywordTup - b. Meta | Child | KeywordTup - c. Child | Meta | KeywordTup - d. Child | Child | KeywordTup ------------------------------------------+------------------------------------ -2. Child | string/regex | - a. Child | string | KeywordTup> - b. Child | char * | KeywordTup> - c. Child | regex | KeywordTup> ------------------------------------------+------------------------------------ -3. KeywordTup<...> | Meta/Child | - a. KeywordTup<...> | Meta | KeywordTup<...,Meta> - b. KeywordTup<...> | Child | KeywordTup<...,Child> ------------------------------------------+------------------------------------ -4. KeywordTup<...,Child> | string/regex | - a. KeywordTup<...,Child> | string | KeywordTup<...,pair> - b. KeywordTup<...,Child> | char * | KeywordTup<...,pair> - c. KeywordTup<...,Child> | regex | KeywordTup<...,pair> ------------------------------------------+------------------------------------ +Below, KeyTuple<...> doesn't include <>; at least one element must exist. + +---------------------------------------+------------------------------------ + CASE | RESULT +---------------------------------------+------------------------------------ +1. Meta/Child | Meta/Child | + a. Meta | Meta | KeyTuple + b. Meta | Child | KeyTuple + c. Child | Meta | KeyTuple + d. Child | Child | KeyTuple +---------------------------------------+------------------------------------ +2. Child | string/regex | + a. Child | string | KeyTuple> + b. Child | char * | KeyTuple> + c. Child | regex | KeyTuple> +---------------------------------------+------------------------------------ +3. KeyTuple<...> | Meta/Child | + a. KeyTuple<...> | Meta | KeyTuple<...,Meta> + b. KeyTuple<...> | Child | KeyTuple<...,Child> +---------------------------------------+------------------------------------ +4. KeyTuple<...,Child> | string/regex | + a. KeyTuple<...,Child> | string | KeyTuple<...,pair> + b. KeyTuple<...,Child> | char * | KeyTuple<...,pair> + c. KeyTuple<...,Child> | regex | KeyTuple<...,pair> +---------------------------------------+------------------------------------ */ // ------------------------ -// Bootstrap KeywordTup<...> +// Bootstrap KeyTuple<...> // ------------------------ // 1. Meta/Child | Meta/Child -// ==> KeywordTup +// ==> KeyTuple template< class LHS, class RHS, - class = std::enable_if_t::value>, - class = std::enable_if_t::value> + class = std::enable_if_t>, + class = std::enable_if_t> > auto operator|( const LHS &lhs, // via SFINAE: Meta or Child const RHS &rhs // via SFINAE: Meta or Child ) { - log::debug("or #1: Meta/Child | Meta/Child"); - return KeywordTup(KeywordTup(lhs),rhs); + return KeyTuple(KeyTuple(lhs),rhs); } // 2. Child | string/regex -// ==> KeywordTup> +// ==> KeyTuple> template< class TYPE, Allow ALLOW, class CONVERTER, class FILTER, class RHS, class StringOrRegex = typename detail::IsStringOrRegex::type @@ -390,54 +210,50 @@ auto operator|( const Child &lhs, const RHS &rhs // via SFINAE: string (or char * etc.) or regex ) { - log::debug("or #2: Child | string/regex"); using LHS = Child; - return KeywordTup>( + return KeyTuple>( std::pair(lhs,StringOrRegex(rhs)) ); } - // ------------------------ -// Append to KeywordTup<...> +// Append to KeyTuple<...> // ------------------------ -// 3. KeywordTup<...> | Meta/Child -// ==> KeywordTup<..., Meta/Child> +// 3. KeyTuple<...> | Meta/Child +// ==> KeyTuple<..., Meta/Child> template< class... LHS, class RHS, - class = std::enable_if_t::value> + class = std::enable_if_t> > auto operator|( - const KeywordTup &lhs, + const KeyTuple &lhs, const RHS &rhs // via SFINAE: Meta or Child ) { - log::debug("or #3: KeywordTup<...> | Meta/Child"); - return KeywordTup(lhs,rhs); + return KeyTuple(lhs,rhs); } -// 4. KeywordTup<...,Child> | string/regex -// ==> KeywordTup<..., pair> +// 4. KeyTuple<...,Child> | string/regex +// ==> KeyTuple<..., pair> template< class... LHS, class RHS, class = std::enable_if_t< - detail::IsChild::last_t>::value + detail::IsChild::last_t>::value >, class StringOrRegex = typename detail::IsStringOrRegex::type > auto operator|( - const KeywordTup &lhs, - const RHS &rhs // via SFINAE: string (or char * etc.) or regex + const KeyTuple &lhs, + const RHS &rhs // via SFINAE: string or char array, or regex ) { - log::debug("or #4: KeywordTup<...,Child> | string/regex"); - return toKeywordTup( + return makeKeyTuple( detail::tupleReplaceLast( lhs.tup, std::make_pair( std::get(lhs.tup), - StringOrRegex(rhs) + StringOrRegex(rhs) // cast ensures char array ==> std::string ) ) ); diff --git a/src/GNDStk/or/src/detail.hpp b/src/GNDStk/or/src/detail.hpp new file mode 100644 index 000000000..da350fb32 --- /dev/null +++ b/src/GNDStk/or/src/detail.hpp @@ -0,0 +1,172 @@ + +namespace detail { + +// ----------------------------------------------------------------------------- +// Helper classes for SFINAE +// ----------------------------------------------------------------------------- + +// ------------------------ +// IsMeta +// ------------------------ + +// default +template +struct IsMeta { + static constexpr bool value = false; +}; + +// Meta +template +struct IsMeta> { + static constexpr bool value = true; +}; + + +// ------------------------ +// IsChild +// ------------------------ + +// default +template +struct IsChild { + static constexpr bool value = false; +}; + +// Child +template +struct IsChild> { + static constexpr bool value = true; +}; + + +// ------------------------ +// IsMetaOrChild +// ------------------------ + +template +struct IsMetaOrChild { + static constexpr bool value = IsMeta::value || IsChild::value; +}; + +// IsMetaOrChild_v +template +inline constexpr bool IsMetaOrChild_v = IsMetaOrChild::value; + + +// ------------------------ +// IsStringOrRegex +// ------------------------ + +// default +template +struct IsStringOrRegex { + static constexpr bool value = false; +}; + +// string +template<> +struct IsStringOrRegex { + static constexpr bool value = true; + using type = std::string; +}; + +// char * +template<> +struct IsStringOrRegex { + static constexpr bool value = true; + using type = std::string; +}; + +// const char * +template<> +struct IsStringOrRegex { + static constexpr bool value = true; + using type = std::string; +}; + +// char[N] +template +struct IsStringOrRegex { + static constexpr bool value = true; + using type = std::string; +}; + +// regex +template<> +struct IsStringOrRegex { + static constexpr bool value = true; + using type = std::regex; +}; + + +// ------------------------ +// IsPairChildStringOrRegex +// ------------------------ + +// default +template +struct IsPairChildStringOrRegex { + static constexpr bool value = false; +}; + +// pair +template +struct IsPairChildStringOrRegex> { + static constexpr bool value = + IsChild::value && IsStringOrRegex::value; +}; + +// IsPairChildStringOrRegex_v +template +inline constexpr bool IsPairChildStringOrRegex_v = + IsPairChildStringOrRegex::value; + + +// ----------------------------------------------------------------------------- +// Helper functionality for std::tuple +// ----------------------------------------------------------------------------- + +// ------------------------ +// tupleAllButLast +// ------------------------ + +// Adapted from: https://stackoverflow.com/questions/51810702 + +template +constexpr auto tupleAllButLastHelper( + const std::tuple &tup, + std::index_sequence +) { + return std::tuple(std::get(tup)...); +} + +template< + class... Args, + class = std::enable_if_t<(0 < sizeof...(Args))> +> +constexpr auto tupleAllButLast(const std::tuple &tup) +{ + return tupleAllButLastHelper( + tup, + std::make_index_sequence{} + ); +} + + +// ------------------------ +// tupleReplaceLast +// ------------------------ + +// Given a tuple with at least one element, make a new tuple that's mostly the +// same, except for a different last element, which can be of a different type. + +template< + class... Args, class RHS, + class = std::enable_if_t<(0 < sizeof...(Args))> +> +constexpr auto tupleReplaceLast(const std::tuple &tup, const RHS &rhs) +{ + return std::tuple_cat(tupleAllButLast(tup), std::tuple(rhs)); +} + +} // namespace detail diff --git a/src/GNDStk/precision.hpp b/src/GNDStk/precision.hpp index 72600a092..9dca03f2c 100644 --- a/src/GNDStk/precision.hpp +++ b/src/GNDStk/precision.hpp @@ -19,7 +19,7 @@ // reals: all of the above // in each of: // GNDStk::metadata:: -// GNDStk::data:: (in body text, i.e. XML "plain character data") +// GNDStk::data:: (in block data, i.e. XML "plain character data") // GNDStk:: // the last meaning for both metadata:: and data::. diff --git a/src/GNDStk/precision/src/detail.hpp b/src/GNDStk/precision/src/detail.hpp index e54a3148d..afa44a4a5 100644 --- a/src/GNDStk/precision/src/detail.hpp +++ b/src/GNDStk/precision/src/detail.hpp @@ -8,26 +8,32 @@ namespace detail { // PrecisionContext enum class PrecisionContext { metadata, // for GNDStk metadata values - data, // for "body text", a.k.a. XML "plain character data" - general // for both of the above together + data, // for block data, a.k.a. XML "plain character data" + general // for both of the above }; // PrecisionType enum class PrecisionType { - // use formatting that's available through C++ input and output streams + // Use formatting that's available through C++ input and output streams. stream, - // use GNDStk's ability to use to_chars()/from_chars() if SFINAE detects - // that they're available in std:: with the C++ distro that's being used + + // For input, prefer using strtof(), strtod(), and strtold() (for float, + // double, and long double, respectively) over using an input stream. Our + // experience suggests that these are faster for reading big data vectors. + strto, + + // Use GNDStk's ability to use to_chars()/from_chars(), if conditional + // compilation and SFINAE indicate that they're available in std:: with + // the C++ distro that's being used. fixed, scientific, shortest }; - // ----------------------------------------------------------------------------- // Classes behind GNDStk's own floating-point manipulators. -// These match with our three custom PrecisionType values. +// These match with our to/from_chars()-related PrecisionType values. // ----------------------------------------------------------------------------- class Fixed { }; @@ -35,7 +41,6 @@ class Scientific { }; class Shortest { }; - // ----------------------------------------------------------------------------- // Precision class // ----------------------------------------------------------------------------- @@ -52,12 +57,12 @@ to produce a decimal representation of that number. What we plan to *do* with the decimal representation isn't relevant here. Perhaps we'll write it to std::cout, or to some other output stream. Perhaps we don't wish to do anything with it stream-wise, but instead plan to place -it into a GNDStk Tree. Here, now, we're concerned only with the process of -producing a decimal representation of the number. +it into a GNDStk Node in some form. Here, now, we're concerned only with the +process of producing a decimal representation of the number. Naturally, for the decimal representation, we'll use a std::string. -So: given a floating-point number, we want to produce a string. We already +So: given a floating-point number, we wish to produce a string. We already know that C++ provides more than one way to do this. A basic and reasonably flexible way is to begin with an output string stream (a std::ostringstream), use its operator<< to write the floating-point number, and then call the @@ -67,11 +72,11 @@ I/O manipulators. For example, oss << std::setprecision(10) << thenumber, where oss is the std::ostringstream. GNDStk provides that methodology. To do so, objects of the below Precision -class contain a std::ostringstream, the properties of which can be set in -the usual way: by calling << on the Precision object. Precision's operator<< -will pass on its arguments to the std::ostringstream, where those arguments -will be "stored," so to speak, for use whenever the std::ostringstream is -used for the output of a floating-point number. +class contain a std::ostringstream, the properties of which can be set by +calling << on the Precision object. Precision's operator<< passes on its +arguments to the std::ostringstream, where those arguments are "stored," so +to speak, in the std::ostringstream, to be used when the std::ostringstream +is used for writing a floating-point number. However, for the fun and profit of our users, we wish to provide something extra. Sufficiently recent C++-17 enabled compilers provide the to_chars() @@ -81,21 +86,20 @@ such representation. The round-trip guarantee essentially means that if we start with, say, a double-precision number (at the time of this writing, probably 64 bits in memory), use to_chars() to make a string, and then read the string with from_chars(), then we're guaranteed to recover exactly the -same 64 bits in memory - that is, precisely the same double we began with. +same 64 bits in memory - precisely the same double we began with. -Aside: the guarantee requires that from_chars(), not necessarily any old -string-to-floating-point process, be used to read back a string that was +Aside: the guarantee requires that from_chars(), not necessarily any string- +to-floating-point process, be used to read from a string that was earlier produced by to_chars(). Also, obviously, such a guarantee simply cannot be honored if different compilers, computing platforms, or floating-point sizes are used for to_chars() versus from_chars(). Under those circumstances, no -algorithm in the universe could make the guarantee. +algorithm in the universe could make the "round-trip" guarantee. The above discussion speaks in terms of output: operator<<, std::ostringstream, -etc. Our Precision class, below, handles *input* just as fully. +etc. Our Precision class, below, handles *input* in the analogous manner. */ - // ----------------------------------------------------------------------------- // Precision // Set properties for: in the given context, the given floating-point type. @@ -106,13 +110,14 @@ class Precision { // The following hold properties that can be set by using operator<< and // operator>>. The properties might or might not be used when writing or - // reading floating-point numbers, depending on the *type flags below. + // reading floating-point numbers; that depends on the *type flags below. static std::ostringstream oss; static std::istringstream iss; // The value of the following determines whether the above *stringstreams // will be used when writing or reading floating-point numbers, or whether - // to_chars() and from_chars() will be used instead. + // to_chars() and from_chars() will be used instead, or perhaps (for input) + // whether the strto*() family of functions are used. static PrecisionType otype; static PrecisionType itype; @@ -127,14 +132,15 @@ class Precision { // If it doesn't, 0 converts to double and the second version is called. // Thus the final parameter helps with overloading; its value isn't used. -#ifdef GNDSTK_PRECISION +#ifdef NJOY_GNDSTK_PRECISION // OK, apparently it may be impossible to make the SFINAE work as intended // in the event that the std::chars_format enum class doesn't even exist, // so that the token [chars_format] (which is used in both the SFINAE and // in the function body itself) doesn't even make sense to the compiler. // Perhaps we can find a way around this. For now, given that we don't want - // to_chars() and from_chars() to be GNDStk's default at this time, we'll - // use an #ifdef to remove this code altogether unless someone wants it. + // to_chars() and from_chars() to be GNDStk's default at this time (they're + // slower, and they require a later-model compiler than our users may have), + // we'll use an #ifdef to remove this code unless someone asks for it. template< class T, @@ -149,30 +155,36 @@ class Precision { std::to_chars_result >> > - bool write(const T &value, std::string &str, int) + bool write(const T &value, std::string &str, int) const { - // todo: Use a T-dependent sufficient size + // todo: compute a T-dependent sufficient size std::string chars(100,'\0'); // todo: check to_chars' return value - if (otype == PrecisionType::fixed) + if (otype == PrecisionType::fixed) { + // fixed std::to_chars(chars.data(), chars.data() + chars.size(), value, std::chars_format::fixed); - else if (otype == PrecisionType::scientific) + } else if (otype == PrecisionType::scientific) { + // scientific std::to_chars(chars.data(), chars.data() + chars.size(), value, std::chars_format::scientific); - else + } else { + // shortest std::to_chars(chars.data(), chars.data() + chars.size(), value); + } - str = chars.data(); // ensure output std::string stops at \0 + str = chars.data(); // ensure output std::string stops at the first \0 return true; } #endif template - bool write(const T &, std::string &, double) + bool write(const T &, std::string &, double) const { - // tell the caller that floating-point to_chars() isn't available + // Tell the caller that floating-point to_chars() isn't available. + // In this case the "write to string" didn't happen here, and MUST + // instead be done by the caller. return false; } @@ -184,11 +196,11 @@ class Precision { // SFINAE test call. Using T{}, as we did in write(), but here for the (NON- // const &) from_chars() parameter, would in normal circumstances be a C++ // error (rvalue passed to non-const lvalue reference). Here, the attempt to - // do so would make the SFINAE fail always, defeating its purpose. + // do so would instead make the SFINAE fail always, defeating its purpose. -#ifdef GNDSTK_PRECISION +#ifdef NJOY_GNDSTK_PRECISION template - auto read(const std::string &str, T &value, int) -> + auto read(const std::string &str, T &value, int) const -> std::enable_if_t< std::is_same_v< decltype(std::from_chars((char*)0, (char*)0, value)), @@ -198,7 +210,8 @@ class Precision { > { // Provide a clean slate for from_chars(), which skips white space - // but doesn't like '+'. So we'll skip the white space, AND any '+'. + // but doesn't like '+'. So we'll skip the white space ourselves, + // and then skip any '+' as well. const char *first = str.data(); while (isspace(*first)) first++; @@ -211,57 +224,264 @@ class Precision { #endif template - bool read(const std::string &, T &, double) + bool read(const std::string &, T &, double) const { - // tell the caller that floating-point from_chars() isn't available + // Tell the caller that floating-point from_chars() isn't available. + // In this case the "read from string" didn't happen here, and MUST + // instead be done by the caller. return false; } public: // ------------------------ - // write + // write single value // ------------------------ - std::string write(const REAL &value) + // The value's std::string representation is returned + std::string write(const REAL &value) const { - if (otype != PrecisionType::stream) { - // Use std::to_chars() for REAL, if it exists; - // else fall through and use the ostringstream + // N.B.: the two code blocks below can't be reordered, + // because of the potential fall-through. + + // CASE: fixed, scientific, shortest + if ( + otype == PrecisionType::fixed || + otype == PrecisionType::scientific || + otype == PrecisionType::shortest + ) { + // Use std::to_chars(), if it exists for REAL; + // otherwise, FALL THROUGH and use the ostringstream. std::string str; if (write(value,str,0)) return str; } - // Use the ostringstream - oss.str(""); - oss.clear(); - oss << value; + // CASE: strto, stream + // Use the ostringstream. Note that here, in write(), the PrecisionType:: + // strto case arrives here - in the PrecisionType::stream case - because + // strto does something special only for *input*. See the read()s, below. + oss.clear(); // <== clear any existing error flags + oss.str(""); // <== clear any previously printed value + oss << value; // with whatever properties oss happens to have right now return oss.str(); } // ------------------------ - // read + // read single value // ------------------------ - REAL read(const std::string &str) + // The value (as obtained from the std::string) is returned + REAL read(const std::string &str) const { - REAL value = REAL(0); + // CASE: strto + // One would probably use the strto*() functions for speed, relative + // to the other options. In that spirit, check for this case first. + if (itype == PrecisionType::strto) { + if constexpr (std::is_same_v) + return strtof (str.data(), nullptr); + if constexpr (std::is_same_v) + return strtod (str.data(), nullptr); + if constexpr (std::is_same_v) + return strtold(str.data(), nullptr); + } + + REAL value; - if (itype != PrecisionType::stream) { - // Use std::from_chars() for REAL, if it exists; - // else fall through and use the istringstream + // CASE: fixed, scientific, shortest + if ( + itype == PrecisionType::fixed || + itype == PrecisionType::scientific || + itype == PrecisionType::shortest + ) { + // Use std::from_chars(), if it exists for REAL; + // otherwise, FALL THROUGH and use the istringstream. if (read(str,value,0)) return value; } + // CASE: stream // Use the istringstream - iss.str(str); - iss.clear(); - iss >> value; + iss.clear(); // <== clear any existing error flags + iss.str(str); // <== set str as the brand-new input string + iss >> value; // with whatever properties iss happens to have right now return value; } + // ------------------------ + // read vector of values: + // private OpenMP version + // ------------------------ + +private: + +#ifdef _OPENMP + bool readOpenMP(const std::string &str, std::vector &vec) const + { + // Number of threads. + // If there's just *one* thread, then we certainly won't bother with the + // overhead of using OpenMP. Instead, we'll return to the serial read(). + const int nthreads = detail::get_nthreads(); + if (nthreads == 1) + return false; + + // String size. + const size_t size = str.size(); + + // Assume, as a approximation that probably isn't too terrible, that the + // printed floating-point numbers in the input string average around some + // number nchars of characters in length, including separating whitespace. + // Compute a rough estimate of how many floating-points are in the string. + // If that value is less than some minimum threshold, then don't deal with + // OpenMP's overhead, and instead return to the serial read(). + // todo: It might be worth factoring float vs. double vs. long double into + // this computation. It also might be worth considering the actual number + // of threads, as computed above - and possibly, in borderline situations, + // reducing the number of threads but still using more than just one. + static const size_t NCHARS = 10, MINFLOATS = 200; + if (size/NCHARS < MINFLOATS) + return false; + + // Compute an approximate splitting of the input string into substrings, + // each to be handled by a different thread. + std::vector loc; + loc.reserve(nthreads+1); + for (int t = 0; t < nthreads; ++t) + loc.push_back(&str[t*(size/nthreads)]); + loc.push_back(&str[size]); // <== simplifies some logic below + + // Refine the approximate splitting so that borders occur at whitespace; + // specifically, at the beginnings of runs of whitespace. + for (int t = 1; t < nthreads; ++t) { + while (loc[t-1] < loc[t] && !isspace(*(loc[t] ))) loc[t]--; + while (loc[t-1] < loc[t] && isspace(*(loc[t]-1))) loc[t]--; + } + + // Set number of threads + detail::set_nthreads(nthreads); + std::vector> subvec(nthreads); + + // CASE: strto + if (itype == PrecisionType::strto) { + if constexpr (std::is_floating_point_v) { + #pragma omp parallel + { + const int t = detail::this_thread(); + char *end = (char *)loc[t]; + REAL element; + + for (const char *begin = end; end < loc[t+1]; begin = end+1) { + if constexpr (std::is_same_v) + if (element = strtof (begin,&end), end <= begin) break; + if constexpr (std::is_same_v) + if (element = strtod (begin,&end), end <= begin) break; + if constexpr (std::is_same_v) + if (element = strtold(begin,&end), end <= begin) break; + subvec[t].push_back(element); + } + } + + // Splice the per-thread vectors; then we're done. Note that we + // begin with total[size] = vec.size(), not 0, below, to compute + // the necessary reserve. The caller may or may not have been told, + // by *its* caller, to clear the vector. Either cleared, or not + // cleared, is perfectly allowable. + size_t total = vec.size(); + for (int t = 0; t < nthreads; ++t) + total += subvec[t].size(); + vec.reserve(total); + for (int t = 0; t < nthreads; ++t) + vec.insert(vec.end(), subvec[t].begin(), subvec[t].end()); + return true; + } + // Fall through... + } + + // todo Implement parallel support for other than PrecisionType::strto + return false; + } +#endif // #ifdef _OPENMP + +public: + + // ------------------------ + // read vector of values + // ------------------------ + + // Values obtained from the std::string parameter + // are read into the std::vector parameter + void read( + const std::string &str, + std::vector &vec, const bool clear = true + ) const { + // Clear the vector, unless the caller has indicated otherwise. + if (clear) + vec.clear(); + + // If the string is empty, there's nothing more to do. + if (str.size() == 0) + return; + + // If OpenMP is available, AND circumstances are such that the + // readOpenMP() function actually does the reading, then we're + // done in this function. Else, continue and do the read below. + #ifdef _OPENMP + if (readOpenMP(str,vec)) + return; + #endif + + REAL element; + + // CASE: strto + if (itype == PrecisionType::strto) { + // Otherwise, we'll need to fall through to other cases, and in fact + // we wouldn't want to enter the below do-loop... + if constexpr (std::is_floating_point_v) { + const char *begin = str.data(); + char *end; + + do { + if constexpr (std::is_same_v) + element = strtof (begin,&end); + if constexpr (std::is_same_v) + element = strtod (begin,&end); + if constexpr (std::is_same_v) + element = strtold(begin,&end); + if (end == begin) break; + vec.push_back(element); + begin = end+1; + } while (*end); + return; // done + } + // Fall through... + } + + // CASE: fixed, scientific, shortest + if ( + itype == PrecisionType::fixed || + itype == PrecisionType::scientific || + itype == PrecisionType::shortest + ) { + // The following amounts to a test of whether std::from_chars() + // exists for REAL. We proceed here if and only if it does; and + // otherwise fall through to the stream case. + if (read("1",element,0)) { + std::istringstream i(str); + std::string tmpstr; + while (i >> tmpstr) + vec.push_back(read(tmpstr,element,0)); + } + // Fall through... + } + + // CASE: stream + // Use the istringstream + iss.clear(); // <== clear any existing error flags + iss.str(str); // <== set str as the brand-new input string + while (iss >> element) + vec.push_back(element); + } + // ------------------------ // For C++ I/O stream // manipulators @@ -295,7 +515,7 @@ class Precision { // ------------------------ // For special GNDStk - // manipulators... + // manipulators // ------------------------ // When you use the below specializations of operator<< and operator>>, i.e. @@ -304,9 +524,9 @@ class Precision { // for input should automatically use it for output; and vice versa. Our // special manipulators cause std::to_chars() and std::from_chars() to be // used, if they're available. std::to_chars() and std::from_chars() are - // designed to be ideal when uses with each other (although they don't need - // to be used together); so, it makes sense that we'd want to "tie" their - // use together, at least by default. + // designed to be ideal when used with each other (although they don't NEED + // to be used together). Therefore, it makes sense that we'd want to "tie" + // their use together, at least by default. bool tie = true; // ------------------------ @@ -361,9 +581,8 @@ class Precision { }; - // ----------------------------------------------------------------------------- -// static initialization +// Static initialization // ----------------------------------------------------------------------------- template @@ -384,8 +603,7 @@ template PrecisionType Precision::otype = PrecisionType::stream; template -PrecisionType Precision::itype = PrecisionType::stream; - +PrecisionType Precision::itype = PrecisionType::strto; // ----------------------------------------------------------------------------- @@ -418,7 +636,6 @@ class Precision { }; - // ----------------------------------------------------------------------------- // Precision // Set properties for: in metadata and data, the given floating-point type. @@ -447,7 +664,6 @@ class Precision { }; - // ----------------------------------------------------------------------------- // Precision // Set properties for: in metadata and data, float, double, and long double. diff --git a/src/GNDStk/precision/test/CMakeLists.txt b/src/GNDStk/precision/test/CMakeLists.txt index 4f3b154d3..d85f44837 100644 --- a/src/GNDStk/precision/test/CMakeLists.txt +++ b/src/GNDStk/precision/test/CMakeLists.txt @@ -1,7 +1,10 @@ -add_executable( GNDStk.precision.test - precision.test.cpp - detail.test.cpp ) +add_executable( + GNDStk.precision.test + precision.test.cpp + detail.test.cpp +) + target_compile_options( GNDStk.precision.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} diff --git a/src/GNDStk/precision/test/detail.test.cpp b/src/GNDStk/precision/test/detail.test.cpp index 11a0b7f44..bcd705b2a 100644 --- a/src/GNDStk/precision/test/detail.test.cpp +++ b/src/GNDStk/precision/test/detail.test.cpp @@ -2,7 +2,7 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; // helper template @@ -117,7 +117,7 @@ SCENARIO("Testing precision detail:: functionality") { { detail::Precision p; }; */ - // Use for the test... + // Use Precision for the test... detail::Precision v; detail::Precision f; detail::Precision d; diff --git a/src/GNDStk/precision/test/precision-test-classes.json b/src/GNDStk/precision/test/precision-test-classes.json index 61c0fb333..84c22938a 100644 --- a/src/GNDStk/precision/test/precision-test-classes.json +++ b/src/GNDStk/precision/test/precision-test-classes.json @@ -18,7 +18,7 @@ "required": false } }, - "data": "float", + "vector": "float", "childNodes": {} }, @@ -39,7 +39,7 @@ "required": false } }, - "data": "double", + "vector": "double", "childNodes": {} }, @@ -60,7 +60,7 @@ "required": false } }, - "data": "long double", + "vector": "long double", "childNodes": {} }, @@ -120,19 +120,19 @@ }, "childNodes": { "floats": { - "occurrence": "1", + "times": "1", "required": false }, "doubles": { - "occurrence": "1", + "times": "1", "required": false }, "quads": { - "occurrence": "1", + "times": "1", "required": false }, "reals": { - "occurrence": "1", + "times": "1", "required": false } } diff --git a/src/GNDStk/precision/test/precision.test.cpp b/src/GNDStk/precision/test/precision.test.cpp index f851a9334..f0f5be648 100644 --- a/src/GNDStk/precision/test/precision.test.cpp +++ b/src/GNDStk/precision/test/precision.test.cpp @@ -3,7 +3,7 @@ #include "catch.hpp" #include "GNDStk.hpp" -using namespace njoy::GNDStk::core; +using namespace njoy::GNDStk; #include "precision.test.hpp" // ----------------------------------------------------------------------------- @@ -65,23 +65,19 @@ R"***( const std::string xml_metadata_individual = R"***( - -)***"; +)***"; const std::string xml_metadata_real = R"***( - -)***"; +)***"; const std::string xml_gndstk_individual = R"***( - -)***"; +)***"; const std::string xml_gndstk_real = R"***( - -)***"; +)***"; // ------------------------ @@ -149,7 +145,7 @@ SCENARIO("Precision code in the convert()s between stream and real, " // SCENARIO // ----------------------------------------------------------------------------- -SCENARIO("Precision code in BodyText::get(), " +SCENARIO("Precision code in BlockData::get(), " "for reworking a data vector to have a different data type") { // Context/action: @@ -240,28 +236,28 @@ SCENARIO("Precision code in BodyText::get(), " num.reals() = fvec; data::floats << std::setprecision(4); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "1.414 1.732 2.236"); + CHECK((Node(num))(reals).data() == "1.414 1.732 2.236"); } THEN("data::reals precision has the intended effect") { num.reals() = fvec; data::reals << std::setprecision(5); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "1.4142 1.7321 2.2361"); + CHECK((Node(num))(reals).data() == "1.4142 1.7321 2.2361"); } THEN("GNDStk::floats precision has the intended effect") { num.reals() = fvec; njoy::GNDStk::floats << std::setprecision(6); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "1.41421 1.73205 2.23607"); + CHECK((Node(num))(reals).data() == "1.41421 1.73205 2.23607"); } THEN("GNDStk::reals precision has the intended effect") { num.reals() = fvec; njoy::GNDStk::reals << std::setprecision(7); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "1.414214 1.732051 2.236068"); + CHECK((Node(num))(reals).data() == "1.414214 1.732051 2.236068"); } } // WHEN @@ -282,28 +278,28 @@ SCENARIO("Precision code in BodyText::get(), " num.reals() = dvec; data::doubles << std::setprecision(4); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "2.646 3.317 3.606"); + CHECK((Node(num))(reals).data() == "2.646 3.317 3.606"); } THEN("data::reals precision has the intended effect") { num.reals() = dvec; data::reals << std::setprecision(5); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "2.6458 3.3166 3.6056"); + CHECK((Node(num))(reals).data() == "2.6458 3.3166 3.6056"); } THEN("GNDStk::doubles precision has the intended effect") { num.reals() = dvec; njoy::GNDStk::doubles << std::setprecision(6); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "2.64575 3.31662 3.60555"); + CHECK((Node(num))(reals).data() == "2.64575 3.31662 3.60555"); } THEN("GNDStk::reals precision has the intended effect") { num.reals() = dvec; njoy::GNDStk::reals << std::setprecision(7); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "2.645751 3.316625 3.605551"); + CHECK((Node(num))(reals).data() == "2.645751 3.316625 3.605551"); } } // WHEN @@ -324,28 +320,28 @@ SCENARIO("Precision code in BodyText::get(), " num.reals() = qvec; data::longdoubles << std::setprecision(4); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "4.123 4.359 4.796"); + CHECK((Node(num))(reals).data() == "4.123 4.359 4.796"); } THEN("data::reals precision has the intended effect") { num.reals() = qvec; data::reals << std::setprecision(5); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "4.1231 4.3589 4.7958"); + CHECK((Node(num))(reals).data() == "4.1231 4.3589 4.7958"); } THEN("GNDStk::longdoubles precision has the intended effect") { num.reals() = qvec; njoy::GNDStk::longdoubles << std::setprecision(6); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "4.12311 4.3589 4.79583"); + CHECK((Node(num))(reals).data() == "4.12311 4.3589 4.79583"); } THEN("GNDStk::reals precision has the intended effect") { num.reals() = qvec; njoy::GNDStk::reals << std::setprecision(7); num.reals()->get>(); - CHECK((Node(num))(reals).pcdata() == "4.123106 4.358899 4.795832"); + CHECK((Node(num))(reals).data() == "4.123106 4.358899 4.795832"); } } // WHEN } // SCENARIO @@ -356,7 +352,7 @@ SCENARIO("Precision code in BodyText::get(), " // SCENARIO // ----------------------------------------------------------------------------- -SCENARIO("Precision code in BodyText::get(), " +SCENARIO("Precision code in BlockData::get(), " "for converting from a raw string to a vector of data") { // Context/action: @@ -373,7 +369,7 @@ SCENARIO("Precision code in BodyText::get(), " // raw string to floats // ------------------------ - WHEN("We convert a raw \"body text\" string to a vector") { + WHEN("We convert a raw \"block data\" string to a vector") { // Initialize the raw string r = string; @@ -392,7 +388,7 @@ SCENARIO("Precision code in BodyText::get(), " // raw string to doubles // ------------------------ - WHEN("We convert a raw \"body text\" string to a vector") { + WHEN("We convert a raw \"block data\" string to a vector") { r = string; THEN("We get the expected result") { r.get>(); @@ -406,7 +402,7 @@ SCENARIO("Precision code in BodyText::get(), " // raw string to long doubles // ------------------------ - WHEN("We convert a raw \"body text\" string to a vector") { + WHEN("We convert a raw \"block data\" string to a vector") { r = string; THEN("We get the expected result") { r.get>(); @@ -423,7 +419,7 @@ SCENARIO("Precision code in BodyText::get(), " // SCENARIO // ----------------------------------------------------------------------------- -SCENARIO("Precision code in BodyText::toNode(), " +SCENARIO("Precision code in BlockData::toNode(), " "for writing... VALUES THAT ARE TO GO HERE") { // Context/action: @@ -454,25 +450,25 @@ SCENARIO("Precision code in BodyText::toNode(), " THEN("data::floats precision has the intended effect") { r = fvec; data::floats << std::setprecision(4); - CHECK((Node(r)).pcdata() == "1.414 1.732 2.236"); + CHECK((Node(r)).data() == "1.414 1.732 2.236"); } THEN("data::reals precision has the intended effect") { r = fvec; data::reals << std::setprecision(5); - CHECK((Node(r)).pcdata() == "1.4142 1.7321 2.2361"); + CHECK((Node(r)).data() == "1.4142 1.7321 2.2361"); } THEN("GNDStk::floats precision has the intended effect") { r = fvec; njoy::GNDStk::floats << std::setprecision(6); - CHECK((Node(r)).pcdata() == "1.41421 1.73205 2.23607"); + CHECK((Node(r)).data() == "1.41421 1.73205 2.23607"); } THEN("GNDStk::reals precision has the intended effect") { r = fvec; njoy::GNDStk::reals << std::setprecision(7); - CHECK((Node(r)).pcdata() == "1.414214 1.732051 2.236068"); + CHECK((Node(r)).data() == "1.414214 1.732051 2.236068"); } } // WHEN @@ -490,25 +486,25 @@ SCENARIO("Precision code in BodyText::toNode(), " THEN("data::doubles precision has the intended effect") { r = dvec; data::doubles << std::setprecision(4); - CHECK((Node(r)).pcdata() == "2.646 3.317 3.606"); + CHECK((Node(r)).data() == "2.646 3.317 3.606"); } THEN("data::reals precision has the intended effect") { r = dvec; data::reals << std::setprecision(5); - CHECK((Node(r)).pcdata() == "2.6458 3.3166 3.6056"); + CHECK((Node(r)).data() == "2.6458 3.3166 3.6056"); } THEN("GNDStk::doubles precision has the intended effect") { r = dvec; njoy::GNDStk::doubles << std::setprecision(6); - CHECK((Node(r)).pcdata() == "2.64575 3.31662 3.60555"); + CHECK((Node(r)).data() == "2.64575 3.31662 3.60555"); } THEN("GNDStk::reals precision has the intended effect") { r = dvec; njoy::GNDStk::reals << std::setprecision(7); - CHECK((Node(r)).pcdata() == "2.645751 3.316625 3.605551"); + CHECK((Node(r)).data() == "2.645751 3.316625 3.605551"); } } // WHEN @@ -526,25 +522,25 @@ SCENARIO("Precision code in BodyText::toNode(), " THEN("data::longdoubles precision has the intended effect") { r = qvec; data::longdoubles << std::setprecision(4); - CHECK((Node(r)).pcdata() == "4.123 4.359 4.796"); + CHECK((Node(r)).data() == "4.123 4.359 4.796"); } THEN("data::reals precision has the intended effect") { r = qvec; data::reals << std::setprecision(5); - CHECK((Node(r)).pcdata() == "4.1231 4.3589 4.7958"); + CHECK((Node(r)).data() == "4.1231 4.3589 4.7958"); } THEN("GNDStk::longdoubles precision has the intended effect") { r = qvec; njoy::GNDStk::longdoubles << std::setprecision(6); - CHECK((Node(r)).pcdata() == "4.12311 4.3589 4.79583"); + CHECK((Node(r)).data() == "4.12311 4.3589 4.79583"); } THEN("GNDStk::reals precision has the intended effect") { r = qvec; njoy::GNDStk::reals << std::setprecision(7); - CHECK((Node(r)).pcdata() == "4.123106 4.358899 4.795832"); + CHECK((Node(r)).data() == "4.123106 4.358899 4.795832"); } } // WHEN } // SCENARIO @@ -560,63 +556,47 @@ SCENARIO("Precision code in BodyText::toNode(), " // ------------------------ const std::string printed_metadata_individual = -R"***(precision::Numbers { // GNDS: numbers - adouble : 1.414214 - afloat : 1.7321 - aquad : 2.23606798 - bdouble : 2.44949 - bfloat : 2.6458 - bquad : 2.82842712 - doubles : // optional; has no value - floats : // optional; has no value - quads : // optional; has no value - reals : // optional; has no value -} // precision::Numbers +R"***({ + adouble : 1.414214 // its default + afloat : 1.7321 // its default + aquad : 2.23606798 // its default + bdouble : 2.44949 // its default + bfloat : 2.6458 // its default + bquad : 2.82842712 // its default +} )***"; const std::string printed_metadata_real = -R"***(precision::Numbers { // GNDS: numbers - adouble : 1.41 - afloat : 1.73 - aquad : 2.24 - bdouble : 2.45 - bfloat : 2.65 - bquad : 2.83 - doubles : // optional; has no value - floats : // optional; has no value - quads : // optional; has no value - reals : // optional; has no value -} // precision::Numbers +R"***({ + adouble : 1.41 // its default + afloat : 1.73 // its default + aquad : 2.24 // its default + bdouble : 2.45 // its default + bfloat : 2.65 // its default + bquad : 2.83 // its default +} )***"; const std::string printed_gndstk_individual = -R"***(precision::Numbers { // GNDS: numbers - adouble : 1.4142136 - afloat : 1.73205 - aquad : 2.236067977 - bdouble : 2.4494897 - bfloat : 2.64575 - bquad : 2.828427125 - doubles : // optional; has no value - floats : // optional; has no value - quads : // optional; has no value - reals : // optional; has no value -} // precision::Numbers +R"***({ + adouble : 1.4142136 // its default + afloat : 1.73205 // its default + aquad : 2.236067977 // its default + bdouble : 2.4494897 // its default + bfloat : 2.64575 // its default + bquad : 2.828427125 // its default +} )***"; const std::string printed_gndstk_real = -R"***(precision::Numbers { // GNDS: numbers - adouble : 1.414 - afloat : 1.732 - aquad : 2.236 - bdouble : 2.449 - bfloat : 2.646 - bquad : 2.828 - doubles : // optional; has no value - floats : // optional; has no value - quads : // optional; has no value - reals : // optional; has no value -} // precision::Numbers +R"***({ + adouble : 1.414 // its default + afloat : 1.732 // its default + aquad : 2.236 // its default + bdouble : 2.449 // its default + bfloat : 2.646 // its default + bquad : 2.828 // its default +} )***"; @@ -630,6 +610,9 @@ SCENARIO("Precision code in Component::write(), " // Context/action: // metadata, write + njoy::GNDStk::colors = false; + njoy::GNDStk::shades = false; + Node node; node << input_numbers_metadata; @@ -725,135 +708,107 @@ R"***( // ------------------------ const std::string block_data_individual = -R"***(precision::Numbers { // GNDS: numbers - adouble : // defaulted; is its default (1.414) - afloat : // defaulted; is its default (1.732) - aquad : // defaulted; is its default (2.236) - bdouble : // defaulted; is its default (2.449) - bfloat : // defaulted; is its default (2.646) - bquad : // defaulted; is its default (2.828) - precision::Doubles { // GNDS: doubles - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value +R"***({ + adouble : 1.414 // its default + afloat : 1.732 // its default + aquad : 2.236 // its default + bdouble : 2.449 // its default + bfloat : 2.646 // its default + bquad : 2.828 // its default + doubles { + start : 0 // its default 3.352228 7.682296 2.777747 5.5397 4.773971 6.288709 - } // precision::Doubles - precision::Floats { // GNDS: floats - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value + } // doubles + floats { + start : 0 // its default 8.4019 3.9438 7.831 7.9844 9.1165 1.9755 - } // precision::Floats - precision::Quads { // GNDS: quads - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value + } // floats + quads { + start : 0 // its default 3.64784473 5.1340091 9.52229725 9.16195068 6.35711728 7.17296929 - } // precision::Quads - reals : // optional; has no value -} // precision::Numbers + } // quads +} )***"; const std::string block_data_real = -R"***(precision::Numbers { // GNDS: numbers - adouble : // defaulted; is its default (1.414) - afloat : // defaulted; is its default (1.732) - aquad : // defaulted; is its default (2.236) - bdouble : // defaulted; is its default (2.449) - bfloat : // defaulted; is its default (2.646) - bquad : // defaulted; is its default (2.828) - precision::Doubles { // GNDS: doubles - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value +R"***({ + adouble : 1.414 // its default + afloat : 1.732 // its default + aquad : 2.236 // its default + bdouble : 2.449 // its default + bfloat : 2.646 // its default + bquad : 2.828 // its default + doubles { + start : 0 // its default 3.35 7.68 2.78 5.54 4.77 6.29 - } // precision::Doubles - precision::Floats { // GNDS: floats - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value + } // doubles + floats { + start : 0 // its default 8.4 3.94 7.83 7.98 9.12 1.98 - } // precision::Floats - precision::Quads { // GNDS: quads - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value + } // floats + quads { + start : 0 // its default 3.65 5.13 9.52 9.16 6.36 7.17 - } // precision::Quads - reals : // optional; has no value -} // precision::Numbers + } // quads +} )***"; const std::string block_gndstk_individual = -R"***(precision::Numbers { // GNDS: numbers - adouble : // defaulted; is its default (1.4142136) - afloat : // defaulted; is its default (1.73205) - aquad : // defaulted; is its default (2.236067977) - bdouble : // defaulted; is its default (2.4494897) - bfloat : // defaulted; is its default (2.64575) - bquad : // defaulted; is its default (2.828427125) - precision::Doubles { // GNDS: doubles - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value +R"***({ + adouble : 1.4142136 // its default + afloat : 1.73205 // its default + aquad : 2.236067977 // its default + bdouble : 2.4494897 // its default + bfloat : 2.64575 // its default + bquad : 2.828427125 // its default + doubles { + start : 0 // its default 3.3522276 7.6822959 2.7777471 5.5396996 4.7739705 6.2887092 - } // precision::Doubles - precision::Floats { // GNDS: floats - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value + } // doubles + floats { + start : 0 // its default 8.40188 3.94383 7.83099 7.9844 9.11647 1.97551 - } // precision::Floats - precision::Quads { // GNDS: quads - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value + } // floats + quads { + start : 0 // its default 3.647844728 5.134009102 9.522297252 9.16195068 6.35711728 7.172969294 - } // precision::Quads - reals : // optional; has no value -} // precision::Numbers + } // quads +} )***"; const std::string block_gndstk_real = -R"***(precision::Numbers { // GNDS: numbers - adouble : // defaulted; is its default (1.414) - afloat : // defaulted; is its default (1.732) - aquad : // defaulted; is its default (2.236) - bdouble : // defaulted; is its default (2.449) - bfloat : // defaulted; is its default (2.646) - bquad : // defaulted; is its default (2.828) - precision::Doubles { // GNDS: doubles - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value +R"***({ + adouble : 1.414 // its default + afloat : 1.732 // its default + aquad : 2.236 // its default + bdouble : 2.449 // its default + bfloat : 2.646 // its default + bquad : 2.828 // its default + doubles { + start : 0 // its default 3.352 7.682 2.778 5.54 4.774 6.289 - } // precision::Doubles - precision::Floats { // GNDS: floats - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value + } // doubles + floats { + start : 0 // its default 8.402 3.944 7.831 7.984 9.116 1.976 - } // precision::Floats - precision::Quads { // GNDS: quads - length : // optional; has no value - start : // defaulted; is its default (0) - valueType : // optional; has no value + } // floats + quads { + start : 0 // its default 3.648 5.134 9.522 9.162 6.357 7.173 - } // precision::Quads - reals : // optional; has no value -} // precision::Numbers + } // quads +} )***"; @@ -861,12 +816,12 @@ R"***(precision::Numbers { // GNDS: numbers // SCENARIO // ------------------------ -SCENARIO("Precision code in BodyText::write(), " +SCENARIO("Precision code in BlockData::write(), " "for writing data blocks with Component::write()'s prettyprinter") { // Context/action: // data, write - // This actually happens in detail::writeComponentPart() + // This actually happens in detail::printComponentPart() Node node; node << input_numbers_full; diff --git a/src/GNDStk/precision/test/precision.test.hpp b/src/GNDStk/precision/test/precision.test.hpp index 531e64571..0e8f1c5bc 100644 --- a/src/GNDStk/precision/test/precision.test.hpp +++ b/src/GNDStk/precision/test/precision.test.hpp @@ -15,12 +15,12 @@ class Floats : public Component { friend class Component; // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "precision"; } - static auto className() { return "Floats"; } - static auto GNDSName() { return "floats"; } + static auto NAMESPACE() { return "precision"; } + static auto CLASS() { return "Floats"; } + static auto NODENAME() { return "floats"; } // Core Interface object to extract metadata and child nodes - static auto keys() + static auto KEYS() { return // metadata @@ -33,10 +33,30 @@ class Floats : public Component { ; } + static const auto &FIELDNAMES() + { + static const std::vector names = { + "length", + "start", + "valueType" + }; + return names; + } + + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "length", + "start", + "value_type" + }; + return names; + } + public: using Component::construct; - using BodyText::operator=; + using BlockData::operator=; // ------------------------ // Relevant defaults @@ -56,7 +76,7 @@ class Floats : public Component { mutable std::optional length; mutable Defaulted start{0}; mutable std::optional valueType; - } content; + } Content; // ------------------------ // Getters @@ -65,21 +85,21 @@ class Floats : public Component { // length const std::optional &length() const - { return content.length; } + { return Content.length; } std::optional &length() - { return content.length; } + { return Content.length; } // start const Defaulted &start() const - { return content.start; } + { return Content.start; } Defaulted &start() - { return content.start; } + { return Content.start; } // valueType const std::optional &valueType() const - { return content.valueType; } + { return Content.valueType; } std::optional &valueType() - { return content.valueType; } + { return Content.valueType; } // ------------------------ // Setters @@ -89,17 +109,17 @@ class Floats : public Component { // length(value) Floats &length(const std::optional &obj) - { BodyText::length(length() = obj); return *this; } + { BlockData::length(length() = obj); return *this; } // start(value) Floats &start(const Defaulted &obj) - { BodyText::start(content.start = obj); return *this; } + { BlockData::start(start() = obj); return *this; } Floats &start(const std::optional &obj) - { BodyText::start(content.start = obj); return *this; } + { BlockData::start(start() = obj); return *this; } // valueType(value) Floats &valueType(const std::optional &obj) - { BodyText::valueType(valueType() = obj); return *this; } + { BlockData::valueType(valueType() = obj); return *this; } // ------------------------ // Construction @@ -108,10 +128,10 @@ class Floats : public Component { // default Floats() : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(); @@ -121,11 +141,11 @@ class Floats : public Component { Floats(const Floats &other) : Component{ other, - content.length, - content.start, - content.valueType + this->length(), + this->start(), + this->valueType() }, - content{other.content} + Content{other.Content} { Component::finish(other); } @@ -134,11 +154,11 @@ class Floats : public Component { Floats(Floats &&other) : Component{ other, - content.length, - content.start, - content.valueType + this->length(), + this->start(), + this->valueType() }, - content{std::move(other.content)} + Content{std::move(other.Content)} { Component::finish(other); } @@ -146,10 +166,10 @@ class Floats : public Component { // from node Floats(const Node &node) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(node); @@ -163,12 +183,12 @@ class Floats : public Component { const std::optional &valueType ) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() }, - content{ + Content{ length, Defaulted(defaults.start,start), valueType @@ -178,13 +198,13 @@ class Floats : public Component { } // from vector - template>> + template>> Floats(const std::vector &vector) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(vector); @@ -221,12 +241,12 @@ class Doubles : public Component { friend class Component; // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "precision"; } - static auto className() { return "Doubles"; } - static auto GNDSName() { return "doubles"; } + static auto NAMESPACE() { return "precision"; } + static auto CLASS() { return "Doubles"; } + static auto NODENAME() { return "doubles"; } // Core Interface object to extract metadata and child nodes - static auto keys() + static auto KEYS() { return // metadata @@ -239,10 +259,30 @@ class Doubles : public Component { ; } + static const auto &FIELDNAMES() + { + static const std::vector names = { + "length", + "start", + "valueType" + }; + return names; + } + + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "length", + "start", + "value_type" + }; + return names; + } + public: using Component::construct; - using BodyText::operator=; + using BlockData::operator=; // ------------------------ // Relevant defaults @@ -262,7 +302,7 @@ class Doubles : public Component { mutable std::optional length; mutable Defaulted start{0}; mutable std::optional valueType; - } content; + } Content; // ------------------------ // Getters @@ -271,21 +311,21 @@ class Doubles : public Component { // length const std::optional &length() const - { return content.length; } + { return Content.length; } std::optional &length() - { return content.length; } + { return Content.length; } // start const Defaulted &start() const - { return content.start; } + { return Content.start; } Defaulted &start() - { return content.start; } + { return Content.start; } // valueType const std::optional &valueType() const - { return content.valueType; } + { return Content.valueType; } std::optional &valueType() - { return content.valueType; } + { return Content.valueType; } // ------------------------ // Setters @@ -295,17 +335,17 @@ class Doubles : public Component { // length(value) Doubles &length(const std::optional &obj) - { BodyText::length(length() = obj); return *this; } + { BlockData::length(length() = obj); return *this; } // start(value) Doubles &start(const Defaulted &obj) - { BodyText::start(content.start = obj); return *this; } + { BlockData::start(start() = obj); return *this; } Doubles &start(const std::optional &obj) - { BodyText::start(content.start = obj); return *this; } + { BlockData::start(start() = obj); return *this; } // valueType(value) Doubles &valueType(const std::optional &obj) - { BodyText::valueType(valueType() = obj); return *this; } + { BlockData::valueType(valueType() = obj); return *this; } // ------------------------ // Construction @@ -314,10 +354,10 @@ class Doubles : public Component { // default Doubles() : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(); @@ -327,11 +367,11 @@ class Doubles : public Component { Doubles(const Doubles &other) : Component{ other, - content.length, - content.start, - content.valueType + this->length(), + this->start(), + this->valueType() }, - content{other.content} + Content{other.Content} { Component::finish(other); } @@ -340,11 +380,11 @@ class Doubles : public Component { Doubles(Doubles &&other) : Component{ other, - content.length, - content.start, - content.valueType + this->length(), + this->start(), + this->valueType() }, - content{std::move(other.content)} + Content{std::move(other.Content)} { Component::finish(other); } @@ -352,10 +392,10 @@ class Doubles : public Component { // from node Doubles(const Node &node) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(node); @@ -369,12 +409,12 @@ class Doubles : public Component { const std::optional &valueType ) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() }, - content{ + Content{ length, Defaulted(defaults.start,start), valueType @@ -384,13 +424,13 @@ class Doubles : public Component { } // from vector - template>> + template>> Doubles(const std::vector &vector) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(vector); @@ -427,12 +467,12 @@ class Quads : public Component { friend class Component; // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "precision"; } - static auto className() { return "Quads"; } - static auto GNDSName() { return "quads"; } + static auto NAMESPACE() { return "precision"; } + static auto CLASS() { return "Quads"; } + static auto NODENAME() { return "quads"; } // Core Interface object to extract metadata and child nodes - static auto keys() + static auto KEYS() { return // metadata @@ -445,10 +485,30 @@ class Quads : public Component { ; } + static const auto &FIELDNAMES() + { + static const std::vector names = { + "length", + "start", + "valueType" + }; + return names; + } + + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "length", + "start", + "value_type" + }; + return names; + } + public: using Component::construct; - using BodyText::operator=; + using BlockData::operator=; // ------------------------ // Relevant defaults @@ -468,7 +528,7 @@ class Quads : public Component { mutable std::optional length; mutable Defaulted start{0}; mutable std::optional valueType; - } content; + } Content; // ------------------------ // Getters @@ -477,21 +537,21 @@ class Quads : public Component { // length const std::optional &length() const - { return content.length; } + { return Content.length; } std::optional &length() - { return content.length; } + { return Content.length; } // start const Defaulted &start() const - { return content.start; } + { return Content.start; } Defaulted &start() - { return content.start; } + { return Content.start; } // valueType const std::optional &valueType() const - { return content.valueType; } + { return Content.valueType; } std::optional &valueType() - { return content.valueType; } + { return Content.valueType; } // ------------------------ // Setters @@ -501,17 +561,17 @@ class Quads : public Component { // length(value) Quads &length(const std::optional &obj) - { BodyText::length(length() = obj); return *this; } + { BlockData::length(length() = obj); return *this; } // start(value) Quads &start(const Defaulted &obj) - { BodyText::start(content.start = obj); return *this; } + { BlockData::start(start() = obj); return *this; } Quads &start(const std::optional &obj) - { BodyText::start(content.start = obj); return *this; } + { BlockData::start(start() = obj); return *this; } // valueType(value) Quads &valueType(const std::optional &obj) - { BodyText::valueType(valueType() = obj); return *this; } + { BlockData::valueType(valueType() = obj); return *this; } // ------------------------ // Construction @@ -520,10 +580,10 @@ class Quads : public Component { // default Quads() : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(); @@ -533,11 +593,11 @@ class Quads : public Component { Quads(const Quads &other) : Component{ other, - content.length, - content.start, - content.valueType + this->length(), + this->start(), + this->valueType() }, - content{other.content} + Content{other.Content} { Component::finish(other); } @@ -546,11 +606,11 @@ class Quads : public Component { Quads(Quads &&other) : Component{ other, - content.length, - content.start, - content.valueType + this->length(), + this->start(), + this->valueType() }, - content{std::move(other.content)} + Content{std::move(other.Content)} { Component::finish(other); } @@ -558,10 +618,10 @@ class Quads : public Component { // from node Quads(const Node &node) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(node); @@ -575,12 +635,12 @@ class Quads : public Component { const std::optional &valueType ) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() }, - content{ + Content{ length, Defaulted(defaults.start,start), valueType @@ -590,13 +650,13 @@ class Quads : public Component { } // from vector - template>> + template>> Quads(const std::vector &vector) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(vector); @@ -633,12 +693,12 @@ class Reals : public Component { friend class Component; // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "precision"; } - static auto className() { return "Reals"; } - static auto GNDSName() { return "reals"; } + static auto NAMESPACE() { return "precision"; } + static auto CLASS() { return "Reals"; } + static auto NODENAME() { return "reals"; } // Core Interface object to extract metadata and child nodes - static auto keys() + static auto KEYS() { return // metadata @@ -651,10 +711,30 @@ class Reals : public Component { ; } + static const auto &FIELDNAMES() + { + static const std::vector names = { + "length", + "start", + "valueType" + }; + return names; + } + + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "length", + "start", + "value_type" + }; + return names; + } + public: using Component::construct; - using BodyText::operator=; + using BlockData::operator=; // ------------------------ // Relevant defaults @@ -674,7 +754,7 @@ class Reals : public Component { mutable std::optional length; mutable Defaulted start{0}; mutable std::optional valueType; - } content; + } Content; // ------------------------ // Getters @@ -683,21 +763,21 @@ class Reals : public Component { // length const std::optional &length() const - { return content.length; } + { return Content.length; } std::optional &length() - { return content.length; } + { return Content.length; } // start const Defaulted &start() const - { return content.start; } + { return Content.start; } Defaulted &start() - { return content.start; } + { return Content.start; } // valueType const std::optional &valueType() const - { return content.valueType; } + { return Content.valueType; } std::optional &valueType() - { return content.valueType; } + { return Content.valueType; } // ------------------------ // Setters @@ -707,17 +787,17 @@ class Reals : public Component { // length(value) Reals &length(const std::optional &obj) - { BodyText::length(length() = obj); return *this; } + { BlockData::length(length() = obj); return *this; } // start(value) Reals &start(const Defaulted &obj) - { BodyText::start(content.start = obj); return *this; } + { BlockData::start(start() = obj); return *this; } Reals &start(const std::optional &obj) - { BodyText::start(content.start = obj); return *this; } + { BlockData::start(start() = obj); return *this; } // valueType(value) Reals &valueType(const std::optional &obj) - { BodyText::valueType(valueType() = obj); return *this; } + { BlockData::valueType(valueType() = obj); return *this; } // ------------------------ // Construction @@ -726,10 +806,10 @@ class Reals : public Component { // default Reals() : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(); @@ -739,11 +819,11 @@ class Reals : public Component { Reals(const Reals &other) : Component{ other, - content.length, - content.start, - content.valueType + this->length(), + this->start(), + this->valueType() }, - content{other.content} + Content{other.Content} { Component::finish(other); } @@ -752,11 +832,11 @@ class Reals : public Component { Reals(Reals &&other) : Component{ other, - content.length, - content.start, - content.valueType + this->length(), + this->start(), + this->valueType() }, - content{std::move(other.content)} + Content{std::move(other.Content)} { Component::finish(other); } @@ -764,10 +844,10 @@ class Reals : public Component { // from node Reals(const Node &node) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(node); @@ -781,12 +861,12 @@ class Reals : public Component { const std::optional &valueType ) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() }, - content{ + Content{ length, Defaulted(defaults.start,start), valueType @@ -796,13 +876,13 @@ class Reals : public Component { } // from vector - template>> + template>> Reals(const std::vector &vector) : Component{ - BodyText{}, - content.length, - content.start, - content.valueType + BlockData{}, + this->length(), + this->start(), + this->valueType() } { Component::finish(vector); @@ -839,26 +919,32 @@ class Numbers : public Component { friend class Component; // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "precision"; } - static auto className() { return "Numbers"; } - static auto GNDSName() { return "numbers"; } + static auto NAMESPACE() { return "precision"; } + static auto CLASS() { return "Numbers"; } + static auto NODENAME() { return "numbers"; } // Core Interface object to extract metadata and child nodes - static auto keys() + static auto KEYS() { return // metadata - Defaulted{1.414213562373095048801688724209698078569671875377} + Defaulted + {1.414213562373095048801688724209698078569671875377} / Meta<>("adouble") | - Defaulted{1.732050807568877293527446341505872366942805253810} + Defaulted + {1.732050807568877293527446341505872366942805253810} / Meta<>("afloat") | - Defaulted{2.236067977499789696409173668731276235440618359612} + Defaulted + {2.236067977499789696409173668731276235440618359612} / Meta<>("aquad") | - Defaulted{2.449489742783178098197284074705891391965947480657} + Defaulted + {2.449489742783178098197284074705891391965947480657} / Meta<>("bdouble") | - Defaulted{2.645751311064590590501615753639260425710259183082} + Defaulted + {2.645751311064590590501615753639260425710259183082} / Meta<>("bfloat") | - Defaulted{2.828427124746190097603377448419396157139343750754} + Defaulted + {2.828427124746190097603377448419396157139343750754} / Meta<>("bquad") | // children std::optional{} @@ -872,6 +958,40 @@ class Numbers : public Component { ; } + static const auto &FIELDNAMES() + { + static const std::vector names = { + "adouble", + "afloat", + "aquad", + "bdouble", + "bfloat", + "bquad", + "doubles", + "floats", + "quads", + "reals" + }; + return names; + } + + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "adouble", + "afloat", + "aquad", + "bdouble", + "bfloat", + "bquad", + "doubles", + "floats", + "quads", + "reals" + }; + return names; + } + public: using Component::construct; @@ -882,12 +1002,18 @@ class Numbers : public Component { // ------------------------ static inline const struct Defaults { - static inline const double adouble = 1.414213562373095048801688724209698078569671875377; - static inline const float afloat = 1.732050807568877293527446341505872366942805253810; - static inline const long double aquad = 2.236067977499789696409173668731276235440618359612; - static inline const double bdouble = 2.449489742783178098197284074705891391965947480657; - static inline const float bfloat = 2.645751311064590590501615753639260425710259183082; - static inline const long double bquad = 2.828427124746190097603377448419396157139343750754; + static inline const double adouble = + 1.414213562373095048801688724209698078569671875377; + static inline const float afloat = + 1.732050807568877293527446341505872366942805253810; + static inline const long double aquad = + 2.236067977499789696409173668731276235440618359612; + static inline const double bdouble = + 2.449489742783178098197284074705891391965947480657; + static inline const float bfloat = + 2.645751311064590590501615753639260425710259183082; + static inline const long double bquad = + 2.828427124746190097603377448419396157139343750754; } defaults; // ------------------------ @@ -896,19 +1022,25 @@ class Numbers : public Component { struct { // metadata - Defaulted adouble{1.414213562373095048801688724209698078569671875377}; - Defaulted afloat{1.732050807568877293527446341505872366942805253810}; - Defaulted aquad{2.236067977499789696409173668731276235440618359612}; - Defaulted bdouble{2.449489742783178098197284074705891391965947480657}; - Defaulted bfloat{2.645751311064590590501615753639260425710259183082}; - Defaulted bquad{2.828427124746190097603377448419396157139343750754}; + Defaulted adouble + { 1.414213562373095048801688724209698078569671875377 }; + Defaulted afloat + { 1.732050807568877293527446341505872366942805253810 }; + Defaulted aquad + { 2.236067977499789696409173668731276235440618359612 }; + Defaulted bdouble + { 2.449489742783178098197284074705891391965947480657 }; + Defaulted bfloat + { 2.645751311064590590501615753639260425710259183082 }; + Defaulted bquad + { 2.828427124746190097603377448419396157139343750754 }; // children std::optional doubles; std::optional floats; std::optional quads; std::optional reals; - } content; + } Content; // ------------------------ // Getters @@ -917,63 +1049,63 @@ class Numbers : public Component { // adouble const Defaulted &adouble() const - { return content.adouble; } + { return Content.adouble; } Defaulted &adouble() - { return content.adouble; } + { return Content.adouble; } // afloat const Defaulted &afloat() const - { return content.afloat; } + { return Content.afloat; } Defaulted &afloat() - { return content.afloat; } + { return Content.afloat; } // aquad const Defaulted &aquad() const - { return content.aquad; } + { return Content.aquad; } Defaulted &aquad() - { return content.aquad; } + { return Content.aquad; } // bdouble const Defaulted &bdouble() const - { return content.bdouble; } + { return Content.bdouble; } Defaulted &bdouble() - { return content.bdouble; } + { return Content.bdouble; } // bfloat const Defaulted &bfloat() const - { return content.bfloat; } + { return Content.bfloat; } Defaulted &bfloat() - { return content.bfloat; } + { return Content.bfloat; } // bquad const Defaulted &bquad() const - { return content.bquad; } + { return Content.bquad; } Defaulted &bquad() - { return content.bquad; } + { return Content.bquad; } // doubles const std::optional &doubles() const - { return content.doubles; } + { return Content.doubles; } std::optional &doubles() - { return content.doubles; } + { return Content.doubles; } // floats const std::optional &floats() const - { return content.floats; } + { return Content.floats; } std::optional &floats() - { return content.floats; } + { return Content.floats; } // quads const std::optional &quads() const - { return content.quads; } + { return Content.quads; } std::optional &quads() - { return content.quads; } + { return Content.quads; } // reals const std::optional &reals() const - { return content.reals; } + { return Content.reals; } std::optional &reals() - { return content.reals; } + { return Content.reals; } // ------------------------ // Setters @@ -983,39 +1115,39 @@ class Numbers : public Component { // adouble(value) Numbers &adouble(const Defaulted &obj) - { content.adouble = obj; return *this; } + { adouble() = obj; return *this; } Numbers &adouble(const std::optional &obj) - { content.adouble = obj; return *this; } + { adouble() = obj; return *this; } // afloat(value) Numbers &afloat(const Defaulted &obj) - { content.afloat = obj; return *this; } + { afloat() = obj; return *this; } Numbers &afloat(const std::optional &obj) - { content.afloat = obj; return *this; } + { afloat() = obj; return *this; } // aquad(value) Numbers &aquad(const Defaulted &obj) - { content.aquad = obj; return *this; } + { aquad() = obj; return *this; } Numbers &aquad(const std::optional &obj) - { content.aquad = obj; return *this; } + { aquad() = obj; return *this; } // bdouble(value) Numbers &bdouble(const Defaulted &obj) - { content.bdouble = obj; return *this; } + { bdouble() = obj; return *this; } Numbers &bdouble(const std::optional &obj) - { content.bdouble = obj; return *this; } + { bdouble() = obj; return *this; } // bfloat(value) Numbers &bfloat(const Defaulted &obj) - { content.bfloat = obj; return *this; } + { bfloat() = obj; return *this; } Numbers &bfloat(const std::optional &obj) - { content.bfloat = obj; return *this; } + { bfloat() = obj; return *this; } // bquad(value) Numbers &bquad(const Defaulted &obj) - { content.bquad = obj; return *this; } + { bquad() = obj; return *this; } Numbers &bquad(const std::optional &obj) - { content.bquad = obj; return *this; } + { bquad() = obj; return *this; } // doubles(value) Numbers &doubles(const std::optional &obj) @@ -1040,17 +1172,17 @@ class Numbers : public Component { // default Numbers() : Component{ - BodyText{}, - content.adouble, - content.afloat, - content.aquad, - content.bdouble, - content.bfloat, - content.bquad, - content.doubles, - content.floats, - content.quads, - content.reals + BlockData{}, + this->adouble(), + this->afloat(), + this->aquad(), + this->bdouble(), + this->bfloat(), + this->bquad(), + this->doubles(), + this->floats(), + this->quads(), + this->reals() } { Component::finish(); @@ -1060,18 +1192,18 @@ class Numbers : public Component { Numbers(const Numbers &other) : Component{ other, - content.adouble, - content.afloat, - content.aquad, - content.bdouble, - content.bfloat, - content.bquad, - content.doubles, - content.floats, - content.quads, - content.reals + this->adouble(), + this->afloat(), + this->aquad(), + this->bdouble(), + this->bfloat(), + this->bquad(), + this->doubles(), + this->floats(), + this->quads(), + this->reals() }, - content{other.content} + Content{other.Content} { Component::finish(other); } @@ -1080,18 +1212,18 @@ class Numbers : public Component { Numbers(Numbers &&other) : Component{ other, - content.adouble, - content.afloat, - content.aquad, - content.bdouble, - content.bfloat, - content.bquad, - content.doubles, - content.floats, - content.quads, - content.reals + this->adouble(), + this->afloat(), + this->aquad(), + this->bdouble(), + this->bfloat(), + this->bquad(), + this->doubles(), + this->floats(), + this->quads(), + this->reals() }, - content{std::move(other.content)} + Content{std::move(other.Content)} { Component::finish(other); } @@ -1099,17 +1231,17 @@ class Numbers : public Component { // from node Numbers(const Node &node) : Component{ - BodyText{}, - content.adouble, - content.afloat, - content.aquad, - content.bdouble, - content.bfloat, - content.bquad, - content.doubles, - content.floats, - content.quads, - content.reals + BlockData{}, + this->adouble(), + this->afloat(), + this->aquad(), + this->bdouble(), + this->bfloat(), + this->bquad(), + this->doubles(), + this->floats(), + this->quads(), + this->reals() } { Component::finish(node); @@ -1130,19 +1262,19 @@ class Numbers : public Component { const std::optional &reals ) : Component{ - BodyText{}, - content.adouble, - content.afloat, - content.aquad, - content.bdouble, - content.bfloat, - content.bquad, - content.doubles, - content.floats, - content.quads, - content.reals + BlockData{}, + this->adouble(), + this->afloat(), + this->aquad(), + this->bdouble(), + this->bfloat(), + this->bquad(), + this->doubles(), + this->floats(), + this->quads(), + this->reals() }, - content{ + Content{ Defaulted(defaults.adouble,adouble), Defaulted(defaults.afloat,afloat), Defaulted(defaults.aquad,aquad), diff --git a/src/GNDStk/string2type.hpp b/src/GNDStk/string2type.hpp index edbd7f838..b297aefd3 100644 --- a/src/GNDStk/string2type.hpp +++ b/src/GNDStk/string2type.hpp @@ -42,7 +42,7 @@ convert(string,type) for some existing C++ container types. // default template -inline void convert(std::istream &is, T &value) +void convert(std::istream &is, T &value) { if constexpr (std::is_floating_point_v) { std::string str; @@ -55,9 +55,15 @@ inline void convert(std::istream &is, T &value) } } +// string +inline void convert(std::istream &is, std::string &value) +{ + is >> value; +} + // pair template -inline void convert(std::istream &is, std::pair &p) +void convert(std::istream &is, std::pair &p) { // we allow: // x y @@ -71,7 +77,7 @@ inline void convert(std::istream &is, std::pair &p) } // some sequence containers -#define GNDSTK_CONVERT(container) \ +#define NJOY_GNDSTK_CONVERT(container) \ template \ inline void convert( \ std::istream &is, \ @@ -81,20 +87,20 @@ inline void convert(std::istream &is, std::pair &p) T val; \ while ((convert(is,val),is)) { \ value.push_back(val); \ - /* The following of course means that any ',' after the container */ \ - /* elements will be eaten, but we don't believe this will create */ \ - /* problems, given this function's usage. In fact the container's */ \ - /* last element is *probably* at the end of the istream anyway. */ \ + /* The following of course means that any ',' after the container */ \ + /* elements will be eaten, but we don't believe this will create */ \ + /* problems, given this function's usage. In fact, the container's */ \ + /* last element is *probably* at the end of the istream anyway. */ \ if (is.get() != ',') \ is.unget(); \ } \ } - GNDSTK_CONVERT(deque) - GNDSTK_CONVERT(list) - GNDSTK_CONVERT(vector) + NJOY_GNDSTK_CONVERT(deque) + NJOY_GNDSTK_CONVERT(list) + NJOY_GNDSTK_CONVERT(vector) -#undef GNDSTK_CONVERT +#undef NJOY_GNDSTK_CONVERT // ----------------------------------------------------------------------------- @@ -104,7 +110,7 @@ inline void convert(std::istream &is, std::pair &p) // default template -inline void convert(const std::string &str, T &value) +void convert(const std::string &str, T &value) { // try block, in case someone overloads our convert()s try { @@ -143,17 +149,17 @@ inline void convert(const std::string &str, bool &value) // miscellaneous // string-to-T specializations that may be faster than our default -#define GNDSTK_CONVERT(fun,TYPE) \ +#define NJOY_GNDSTK_CONVERT(fun,TYPE) \ inline void convert(const std::string &str, TYPE &value) \ { \ value = std::fun(str); \ } - GNDSTK_CONVERT(stoi, int) - GNDSTK_CONVERT(stol, long) - GNDSTK_CONVERT(stoll, long long) - GNDSTK_CONVERT(stoul, unsigned) // apparently there's no std::stou() - GNDSTK_CONVERT(stoul, unsigned long) - GNDSTK_CONVERT(stoull, unsigned long long) + NJOY_GNDSTK_CONVERT(stoi, int) + NJOY_GNDSTK_CONVERT(stol, long) + NJOY_GNDSTK_CONVERT(stoll, long long) + NJOY_GNDSTK_CONVERT(stoul, unsigned) // apparently there's no std::stou() + NJOY_GNDSTK_CONVERT(stoul, unsigned long) + NJOY_GNDSTK_CONVERT(stoull, unsigned long long) -#undef GNDSTK_CONVERT +#undef NJOY_GNDSTK_CONVERT diff --git a/src/GNDStk/string2type/test/CMakeLists.txt b/src/GNDStk/string2type/test/CMakeLists.txt index 79df0ba11..7f60f0e7f 100644 --- a/src/GNDStk/string2type/test/CMakeLists.txt +++ b/src/GNDStk/string2type/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.string2type.test string2type.test.cpp ) +add_executable( + GNDStk.string2type.test + string2type.test.cpp +) + target_compile_options( GNDStk.string2type.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} @@ -10,5 +14,5 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.string2type.test PUBLIC GNDStk ) -add_test( NAME GNDStk.string2type COMMAND GNDStk.string2type.test ) \ No newline at end of file +target_link_libraries( GNDStk.string2type.test PUBLIC GNDStk ) +add_test( NAME GNDStk.string2type COMMAND GNDStk.string2type.test ) diff --git a/src/GNDStk/string2type/test/string2type.test.cpp b/src/GNDStk/string2type/test/string2type.test.cpp index 6302388f5..d036e9a84 100644 --- a/src/GNDStk/string2type/test/string2type.test.cpp +++ b/src/GNDStk/string2type/test/string2type.test.cpp @@ -84,7 +84,7 @@ SCENARIO("Testing GNDStk convert(istream/string,type)") { CHECK(*iter++ == 300); } - THEN("It works for T == vector") { + THEN("It works for T == vector") { std::istringstream iss("1000 2000 3000"); std::vector container; convert(iss,container); @@ -93,6 +93,17 @@ SCENARIO("Testing GNDStk convert(istream/string,type)") { CHECK(container[1] == 2000); CHECK(container[2] == 3000); } + + THEN("It works for T == vector") { + std::istringstream iss("a bc def ghij"); + std::vector container; + convert(iss,container); + CHECK(container.size() == 4); + CHECK(container[0] == "a"); + CHECK(container[1] == "bc"); + CHECK(container[2] == "def"); + CHECK(container[3] == "ghij"); + } } // ------------------------ @@ -193,6 +204,27 @@ SCENARIO("Testing GNDStk convert(istream/string,type)") { convert(str,val); CHECK(val == 7.89L); } + + THEN("It works correctly for vector") { + const std::string str("1000 2000 3000"); + std::vector container; + convert(str,container); + CHECK(container.size() == 3); + CHECK(container[0] == 1000); + CHECK(container[1] == 2000); + CHECK(container[2] == 3000); + } + + THEN("It works correctly for vector") { + const std::string str("a bc def ghij"); + std::vector container; + convert(str,container); + CHECK(container.size() == 4); + CHECK(container[0] == "a"); + CHECK(container[1] == "bc"); + CHECK(container[2] == "def"); + CHECK(container[3] == "ghij"); + } } // WHEN } // SCENARIO diff --git a/src/GNDStk/test/CMakeLists.txt b/src/GNDStk/test/CMakeLists.txt deleted file mode 100644 index cad85f9e3..000000000 --- a/src/GNDStk/test/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ - -add_executable( GNDStk.test GNDStk.test.cpp ) -target_compile_options( GNDStk.test PRIVATE ${${PREFIX}_common_flags} -$<$:${${PREFIX}_strict_flags}>$<$: -${${PREFIX}_DEBUG_flags} -$<$:${${PREFIX}_coverage_flags}>> -$<$: -${${PREFIX}_RELEASE_flags} -$<$:${${PREFIX}_link_time_optimization_flags}> -$<$:${${PREFIX}_nonportable_optimization_flags}>> - -${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.test PUBLIC GNDStk ) -add_test( NAME GNDStk COMMAND GNDStk.test ) \ No newline at end of file diff --git a/src/GNDStk/test/GNDStk.test.cpp b/src/GNDStk/test/GNDStk.test.cpp deleted file mode 100644 index 81c033903..000000000 --- a/src/GNDStk/test/GNDStk.test.cpp +++ /dev/null @@ -1,4 +0,0 @@ - -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" diff --git a/src/GNDStk/test/keys.hpp b/src/GNDStk/test/keys.hpp new file mode 100644 index 000000000..f1262bf5d --- /dev/null +++ b/src/GNDStk/test/keys.hpp @@ -0,0 +1,324 @@ + +// ----------------------------------------------------------------------------- +// basic:: +// Some Meta and Child objects that use , meaning that they'll retrieve +// metadata and child nodes in their original form in the GNDS tree. These are +// used in various test codes. +// ----------------------------------------------------------------------------- + +namespace basic { + +// ------------------------ +// Meta<> +// ------------------------ + +namespace meta { + inline const njoy::GNDStk::Meta + ENDF_MT ("ENDF_MT" ), + index ("index" ), + label ("label" ), + projectile("projectile"), + symbol ("symbol" ), + TEXT (njoy::GNDStk::special::text), + unit ("unit" ), + value ("value" ), + version ("version" ); +} // namespace meta + +// ------------------------ +// Child<> +// ------------------------ + +namespace child { + + // Some top-level nodes, per LLNL-TR-774621-DRAFT + inline const njoy::GNDStk::Child + PoPs("PoPs"), + reactionSuite("reactionSuite"); + + // With Allow::one + inline const njoy::GNDStk::Child + RMatrix ("RMatrix" ), + angularTwoBody ("angularTwoBody" ), + axes ("axes" ), + CDATA (njoy::GNDStk::special::cdata), + chemicalElements ("chemicalElements" ), + crossSection ("crossSection" ), + data ("data" ), + distribution ("distribution" ), + documentation ("documentation" ), + documentations ("documentations" ), + Double ("double" ), + gaugeBosons ("gaugeBosons" ), + mass ("mass" ), + outputChannel ("outputChannel" ), + DATA (njoy::GNDStk::special::data), + products ("products" ), + reactions ("reactions" ), + regions2d ("regions2d" ), + resolved ("resolved" ), + resonanceParameters("resonanceParameters"), + resonances ("resonances" ), + spin ("spin" ), + spinGroups ("spinGroups" ), + styles ("styles" ), + table ("table" ), + temperature ("temperature" ); + + // With Allow::many + inline const njoy::GNDStk::Child + XYs1d ("XYs1d" ), + axis ("axis" ), + chemicalElement("chemicalElement"), + evaluated ("evaluated" ), + fraction ("fraction" ), + gaugeBoson ("gaugeBoson" ), + product ("product" ), + reaction ("reaction" ), + spinGroup ("spinGroup" ), + values ("values" ); +} // namespace child + +using namespace meta; +using namespace child; + +} // namespace basic + + + +// ----------------------------------------------------------------------------- +// misc:: +// Some miscellaneous Meta and Child objects for use in various test codes. +// These are "miscellaneous" in the sense that some use , meaning that +// they'll retrieve metadata and child nodes in their original form in the +// GNDS tree, while others stipulate specific types. +// ----------------------------------------------------------------------------- + +// Helper for the CDATA Child object below +namespace njoy { +namespace GNDStk { +namespace detail { + // text_metadatum_to_string + class text_metadatum_to_string { + public: + template + void operator()(const NODE &node, std::string &to) const + { + to = node.meta(special::text); + } + }; +} // namespace detail +} // namespace GNDStk +} // namespace njoy + +namespace misc { + +// ------------------------ +// Meta<> +// ------------------------ + +namespace meta { + // int + NJOY_GNDSTK_MAKE_META(int, A); + NJOY_GNDSTK_MAKE_META(int, ENDF_MT); + + // double + NJOY_GNDSTK_MAKE_META(double, format); + + // string + NJOY_GNDSTK_MAKE_META(std::string, encoding); + NJOY_GNDSTK_MAKE_META(std::string, evaluation); + NJOY_GNDSTK_MAKE_META(std::string, id); + NJOY_GNDSTK_MAKE_META(std::string, label); + NJOY_GNDSTK_MAKE_META(std::string, projectile); + NJOY_GNDSTK_MAKE_META(std::string, projectileFrame); + NJOY_GNDSTK_MAKE_META(std::string, symbol); + NJOY_GNDSTK_MAKE_META(std::string, target); + NJOY_GNDSTK_MAKE_META(std::string, unit); + NJOY_GNDSTK_MAKE_META(std::string, version); + + // value, as double + inline const njoy::GNDStk::Meta dvalue("value"); +} // namespace meta + +// ------------------------ +// Child<> +// ------------------------ + +namespace child { + // Some top-level nodes, per LLNL-TR-774621-DRAFT + inline const njoy::GNDStk::Child + PoPs ("PoPs"), + reactionSuite ("reactionSuite"), + covarianceSuite ("covarianceSuite"), + thermalScattering("thermalScattering"); + + // Misc. Child Objects + NJOY_GNDSTK_MAKE_CHILD(void, axes, one); + NJOY_GNDSTK_MAKE_CHILD(void, axis, many); + NJOY_GNDSTK_MAKE_CHILD(void, chemicalElements, one); + NJOY_GNDSTK_MAKE_CHILD(void, chemicalElement, many); + NJOY_GNDSTK_MAKE_CHILD(void, isotopes, one); + NJOY_GNDSTK_MAKE_CHILD(void, isotope, many); + NJOY_GNDSTK_MAKE_CHILD(void, nuclides, one); + NJOY_GNDSTK_MAKE_CHILD(void, reactions, one); + NJOY_GNDSTK_MAKE_CHILD(void, reaction, many); + NJOY_GNDSTK_MAKE_CHILD(void, crossSection, one); + NJOY_GNDSTK_MAKE_CHILD(void, styles, one); + NJOY_GNDSTK_MAKE_CHILD(void, temperature, one); + inline const njoy::GNDStk::Child + xml(njoy::GNDStk::special::xml); + NJOY_GNDSTK_MAKE_CHILD(void, evaluated, many); + NJOY_GNDSTK_MAKE_CHILD(void, XYs1d, many); + + // CDATA + inline const njoy::GNDStk::Child< + std::string, + njoy::GNDStk::Allow::one, + njoy::GNDStk::detail::text_metadatum_to_string + > + CDATA(njoy::GNDStk::special::cdata); +} // namespace child + +using namespace meta; +using namespace child; + +} // namespace misc + + + +// ----------------------------------------------------------------------------- +// Some Child objects that are useful enough as-is that we wish to include them +// in other sets of such objects, in other namespaces. +// ----------------------------------------------------------------------------- + +namespace njoy { +namespace GNDStk { +namespace detail { + +// ------------------------ +// convert_data_text_t +// ------------------------ + +class convert_data_text_t { +public: + + // Node to container + template + void operator()(const njoy::GNDStk::Node &node, CONTAINER &container) const + { + using namespace njoy::GNDStk; + try { + // Context: + // We're inside of a data node that's inside of a node that + // looked something like this (in XML): + // 0.0 1.0 2.0 3.0 4.0 + // In GNDStk, the data node has a metadatum with the key special::text. + // The metadatum's string value is the content: "0.0 1.0 ..." in our + // example. Goal here: extract that content into the container. + container.clear(); + for (const auto &m : node.metadata) + if (m.first == special::text) { + convert(m.second, container); + return; + } + log::error( + "Could not find metadatum key \"#text\" " + "in the current Node (\"{}\")", + node.name + ); + throw std::exception{}; + } catch (...) { + log::function("convert_data_text_t(Node,container)"); + throw; + } + } + + // container to Node + template + void operator()(const CONTAINER &container, njoy::GNDStk::Node &node) const + { + using namespace njoy::GNDStk; + try { + node.clear(); + node.name = special::data; + std::string &destination = node.add(special::text,"").second; + convert(container, destination); + } catch (...) { + log::function("convert_data_text_t(container,Node)"); + throw; + } + } +}; + +// ------------------------ +// numeric_type +// ------------------------ + +// default +// create vector +template +class numeric_type { +public: + using type = std::vector; +}; + +// keep deque +template +class numeric_type> { +public: + using type = std::deque; +}; + +// keep list +template +class numeric_type> { +public: + using type = std::list; +}; + +// keep vector +template +class numeric_type> { +public: + using type = std::vector; +}; + +} // namespace detail +} // namespace GNDStk +} // namespace njoy + +// ------------------------ +// Child<> +// ------------------------ + +namespace common { + +// Helper: getNumeric +// Doing numeric (below) strictly as a variable template would lead +// to initialization-order issues with the specializations. +template +const auto &getNumeric() +{ + static const njoy::GNDStk::Child< + // for general T, the following produces a vector; + // for T already a vector, it remains as-is + typename njoy::GNDStk::detail::numeric_type::type, + njoy::GNDStk::Allow::one, + njoy::GNDStk::detail::convert_data_text_t + > ret(njoy::GNDStk::special::data); + return ret; +} + +// numeric +template +inline const auto numeric = getNumeric(); + +// specializations, for float and double +inline const auto floats = getNumeric(); +inline const auto doubles = getNumeric(); + +} // namespace common + +namespace basic { using namespace common; } +namespace misc { using namespace common; } diff --git a/src/GNDStk/type2node.hpp b/src/GNDStk/type2node.hpp index 4fe0bedef..cca58db71 100644 --- a/src/GNDStk/type2node.hpp +++ b/src/GNDStk/type2node.hpp @@ -10,7 +10,7 @@ The description of those, seen in reverse, applies here. In short, these functions are for taking various types, perhaps user-defined, and converting them into a Node that's destined to be added as a child node. -At the moment, this file is empty except for comments. We're intentionally +At the moment, this file is empty except for remarks. We're intentionally leaving it here, as a placeholder, in case we decide that we *should* have some default type-to-Node convert() functions. */ diff --git a/src/GNDStk/type2node/test/CMakeLists.txt b/src/GNDStk/type2node/test/CMakeLists.txt index 3db818395..d62e08abf 100644 --- a/src/GNDStk/type2node/test/CMakeLists.txt +++ b/src/GNDStk/type2node/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.type2node.test type2node.test.cpp ) +add_executable( + GNDStk.type2node.test + type2node.test.cpp +) + target_compile_options( GNDStk.type2node.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} @@ -10,5 +14,5 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.type2node.test PUBLIC GNDStk ) -add_test( NAME GNDStk.type2node COMMAND GNDStk.type2node.test ) \ No newline at end of file +target_link_libraries( GNDStk.type2node.test PUBLIC GNDStk ) +add_test( NAME GNDStk.type2node COMMAND GNDStk.type2node.test ) diff --git a/src/GNDStk/type2node/test/type2node.test.cpp b/src/GNDStk/type2node/test/type2node.test.cpp index 6df6ba386..08869528d 100644 --- a/src/GNDStk/type2node/test/type2node.test.cpp +++ b/src/GNDStk/type2node/test/type2node.test.cpp @@ -3,12 +3,13 @@ #include "catch.hpp" #include "GNDStk.hpp" +#include "GNDStk/test/keys.hpp" using namespace njoy::GNDStk; static const std::string correct_node = -R"***(pcdata: - text: 1 2.3 4.56)***"; +R"***(#data: + #text: 1 2.3 4.56)***"; SCENARIO("Testing GNDStk convert(type,Node)") { @@ -18,20 +19,20 @@ SCENARIO("Testing GNDStk convert(type,Node)") { // convert(type,Node) function. // Update, 2020-10-19. The relevant convert() functionality has been - // reformulated into the detail::convert_pcdata_text_t callable object, + // reformulated into the detail::convert_data_text_t callable object, // so we'll reformulate with that. Ultimately, due to the location of // the new code, we should probably put this test material elsewhere. WHEN("type is vector") { std::vector container = { 1, 2.3, 4.56 }; Node n("old name"); - detail::convert_pcdata_text_t{}(container,n); + detail::convert_data_text_t{}(container,n); // one way to check the Node - CHECK(n.name == "pcdata"); + CHECK(n.name == special::data); CHECK(n.metadata.size() == 1); CHECK(n.children.size() == 0); - CHECK(n.metadata[0].first == "text"); + CHECK(n.metadata[0].first == special::text); CHECK(n.metadata[0].second == "1 2.3 4.56"); // a shorter way @@ -42,7 +43,7 @@ SCENARIO("Testing GNDStk convert(type,Node)") { WHEN("type is deque") { std::deque container = { 1, 2.3, 4.56 }; Node n("old name"); - detail::convert_pcdata_text_t{}(container,n); + detail::convert_data_text_t{}(container,n); std::ostringstream oss; oss << n; CHECK(oss.str() == correct_node); } @@ -50,7 +51,7 @@ SCENARIO("Testing GNDStk convert(type,Node)") { WHEN("type is list") { std::list container = { 1, 2.3, 4.56 }; Node n("old name"); - detail::convert_pcdata_text_t{}(container,n); + detail::convert_data_text_t{}(container,n); std::ostringstream oss; oss << n; CHECK(oss.str() == correct_node); } diff --git a/src/GNDStk/type2string.hpp b/src/GNDStk/type2string.hpp index 1ae8f0c38..a111d89b4 100644 --- a/src/GNDStk/type2string.hpp +++ b/src/GNDStk/type2string.hpp @@ -13,7 +13,7 @@ key/value pair. */ // User-settable flag -inline bool comma = false; +inline bool commas = false; // ----------------------------------------------------------------------------- @@ -23,7 +23,7 @@ inline bool comma = false; // default template -inline void convert(const T &value, std::ostream &os) +void convert(const T &value, std::ostream &os) { if constexpr (std::is_floating_point_v) { os << detail::Precision< @@ -34,33 +34,39 @@ inline void convert(const T &value, std::ostream &os) } } +// string +inline void convert(const std::string &value, std::ostream &os) +{ + os << value; +} + // pair template -inline void convert(const std::pair &p, std::ostream &os) +void convert(const std::pair &p, std::ostream &os) { - if ((convert(p.first,os),os) && os << (GNDStk::comma ? ',' : ' ')) + if ((convert(p.first,os),os) && os << (GNDStk::commas ? ',' : ' ')) convert(p.second,os); } // some sequence containers -#define GNDSTK_CONVERT(container) \ +#define NJOY_GNDSTK_CONVERT(container) \ template \ inline void convert( \ const std::container &value, \ std::ostream &os \ ) { \ - const std::string sep = GNDStk::comma ? "," : " "; \ - std::size_t count = 0; \ + const std::string sep = GNDStk::commas ? "," : " "; \ + size_t count = 0; \ for (const T &val : value) \ if (!(os << (count++ ? sep : "") && (convert(val,os),os))) \ break; /* might as well, because the stream is broken */ \ } - GNDSTK_CONVERT(deque) - GNDSTK_CONVERT(list) - GNDSTK_CONVERT(vector) + NJOY_GNDSTK_CONVERT(deque) + NJOY_GNDSTK_CONVERT(list) + NJOY_GNDSTK_CONVERT(vector) -#undef GNDSTK_CONVERT +#undef NJOY_GNDSTK_CONVERT // ----------------------------------------------------------------------------- @@ -70,7 +76,7 @@ inline void convert(const std::pair &p, std::ostream &os) // default template -inline void convert(const T &value, std::string &str) +void convert(const T &value, std::string &str) { // try block, in case someone overloads our convert()s try { @@ -103,17 +109,17 @@ inline void convert(const bool &value, std::string &str) // miscellaneous // Integral T-to-string specializations that may be faster than our default -#define GNDSTK_CONVERT(TYPE) \ +#define NJOY_GNDSTK_CONVERT(TYPE) \ inline void convert(const TYPE &value, std::string &str) \ { \ str = std::to_string(value); \ } - GNDSTK_CONVERT(int) - GNDSTK_CONVERT(long) - GNDSTK_CONVERT(long long) - GNDSTK_CONVERT(unsigned) - GNDSTK_CONVERT(unsigned long) - GNDSTK_CONVERT(unsigned long long) + NJOY_GNDSTK_CONVERT(int) + NJOY_GNDSTK_CONVERT(long) + NJOY_GNDSTK_CONVERT(long long) + NJOY_GNDSTK_CONVERT(unsigned) + NJOY_GNDSTK_CONVERT(unsigned long) + NJOY_GNDSTK_CONVERT(unsigned long long) -#undef GNDSTK_CONVERT +#undef NJOY_GNDSTK_CONVERT diff --git a/src/GNDStk/type2string/test/CMakeLists.txt b/src/GNDStk/type2string/test/CMakeLists.txt index 33e7f774c..b5f393dee 100644 --- a/src/GNDStk/type2string/test/CMakeLists.txt +++ b/src/GNDStk/type2string/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.type2string.test type2string.test.cpp ) +add_executable( + GNDStk.type2string.test + type2string.test.cpp +) + target_compile_options( GNDStk.type2string.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} @@ -10,5 +14,5 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.type2string.test PUBLIC GNDStk ) -add_test( NAME GNDStk.type2string COMMAND GNDStk.type2string.test ) \ No newline at end of file +target_link_libraries( GNDStk.type2string.test PUBLIC GNDStk ) +add_test( NAME GNDStk.type2string COMMAND GNDStk.type2string.test ) diff --git a/src/GNDStk/type2string/test/type2string.test.cpp b/src/GNDStk/type2string/test/type2string.test.cpp index cf403cfa0..23d9f3c35 100644 --- a/src/GNDStk/type2string/test/type2string.test.cpp +++ b/src/GNDStk/type2string/test/type2string.test.cpp @@ -212,8 +212,8 @@ SCENARIO("Testing some GNDStk::convert(pair,ostream) functionality") { // ------------------------ WHEN("We call convert(pair,ostream)") { - THEN("It works correctly when GNDStk::comma == false") { - njoy::GNDStk::comma = false; // we don't want a comma in the output... + THEN("It works correctly when GNDStk::commas == false") { + njoy::GNDStk::commas = false; // we don't want a comma in the output... const std::pair p(12,34); std::ostringstream oss; njoy::GNDStk::convert(p,oss); @@ -221,8 +221,8 @@ SCENARIO("Testing some GNDStk::convert(pair,ostream) functionality") { CHECK(str == "12 34"); // ...so, no comma } - THEN("It works correctly when GNDStk::comma == true") { - njoy::GNDStk::comma = true; // we do want a comma in the output... + THEN("It works correctly when GNDStk::commas == true") { + njoy::GNDStk::commas = true; // we want a comma in the output... const std::pair p(56,78); std::ostringstream oss; njoy::GNDStk::convert(p,oss); diff --git a/src/GNDStk/utility.hpp b/src/GNDStk/utility.hpp index 1c0979664..3cd300078 100644 --- a/src/GNDStk/utility.hpp +++ b/src/GNDStk/utility.hpp @@ -16,17 +16,12 @@ inline std::string indentTo(const int level) // Should Node's debugging output print addresses and parent-node addresses? inline bool parents = false; -// top -// When reading, check whether the document node is in our list of allowable -// GNDS top-level nodes -inline bool top = false; - // file type / format enum class FileType { - // default, automagick, etc. - null, - // our plain text format (for writing only) - text, + // default: guess from file magic number (input) or extension (output) + guess, + // our plain-text "debug format"; for writing only (not reading) + debug, // give users easy-to-type lowercase as well as acronym-style uppercase... xml, XML = xml, json, JSON = json, @@ -39,6 +34,25 @@ enum class Allow { many }; +namespace special { + inline const char prefix = '#'; + + inline const std::string + any = prefix + std::string(""), + decl = prefix + std::string(""), + nodename = prefix + std::string("nodename"), + metadata = prefix + std::string("metadata"), + cdata = prefix + std::string("cdata"), + data = prefix + std::string("data"), + self = prefix + std::string("self"), + anydata = cdata + "|" + data, // either + comment = prefix + std::string("comment"), + text = prefix + std::string("text"), + xml = prefix + std::string("xml"), + json = prefix + std::string("json"), + hdf5 = prefix + std::string("hdf5"); +} + namespace detail { // default_* @@ -59,19 +73,6 @@ inline bool sent(const std::string &string) return &string != &default_string; } -// allowable declaration nodes -inline std::set AllowedDecl = { - "xml", - "json", - "hdf5", -}; - -// allowable top-level GNDS nodes -inline std::set AllowedTop = { - // added as they're identified - // in our Child class -}; - // noFilter class noFilter { public: @@ -90,39 +91,15 @@ inline void failback(std::istream &is, const std::streampos pos) } // namespace detail - // ----------------------------------------------------------------------------- -// Helper constructs for some simple Log-enhancing pretty-printing +// Helper constructs for some simple Log-enhancing prettyprinting // ----------------------------------------------------------------------------- -// align, color +// align, colors // Users can set these in their own codes. // Remember that they're scoped in njoy::GNDStk, like other things. -inline bool align = true; // extra spaces, to line stuff up for easy reading -inline bool color = false; // default: impose no ANSI escape-sequence clutter - -// fixme A possible concern here is that the alignment, as controlled by the -// align bool, is only applied to the message string that's sent as the first -// parameter to our log:: functions - not to the entire message that might be -// constructed and printed. -// -// Imagine that you wrote: -// -// log::error("Some information: {}", someStringParameterWithNewlines); -// -// Our log:: functions ultimately forward their own parameters to the external -// Log library for final handling. Before doing so, they process the message -// string ("Some information: {}", in our example above). If align == true, -// they create a *modified* message string - with spacing for alignment after -// any newlines. However, content that arrives through the "{}"s, from other -// parameters, and that has newlines, doesn't get alignment spacing. Someone -// might then see the diagnostic, and believe that our alignment flag is broken. -// -// We should consider solutions to this - ones that don't require replicating -// too much content from the external Log library, and that allow us to still -// take advantage of its convenient "{}" notation for writing parameters. For -// now, a few particular "long" diagnostic messages in GNDStk are formatted -// and printed completely into the format string, so that we avoid this issue. +inline bool align = true; // extra spaces, to line stuff up for easy reading +inline bool colors = true; // default: yes, colors. Switch off if not wanted. namespace detail { @@ -132,21 +109,37 @@ inline std::string diagnostic( const std::string &message, const std::string &prefix = "" ) { + // Remark. Below, if align == true, we place spaces after any newlines that + // appear in the message, so that output that would otherwise: + // [error] look something + // like this + // will instead: + // [error] look something + // like this + // Later, in functions like our error() and warning(), strings returned from + // this present (diagnostic()) function are sent to one of the Log:: library + // functions. Those replace instances of "{}" with the values of parameters, + // similarly to how the old C language printf() replaces "%". The code below + // just does the alignment business for the message string, not for any of + // those additional parameters. In the event that one of those is a string, + // and has newlines, alignment may not be as one might initially expect. So, + // this is just something to be aware of. + static std::map codes = { - { "info", "\033[36;21m" }, // cyan - { "warning", "\033[33;1m" }, // yellow - { "error", "\033[31;21m" }, // red - { "debug", "\033[37;21m" } // white + { "info", "\033[32;1m" }, // green + { "warning", "\033[33;1m" }, // yellow + { "error", "\033[31;1m" }, // red + { "debug", "\033[37;1m" } // white }; static const std::string under = "\033[4m"; // underline on static const std::string unoff = "\033[24m"; // underline off - static const std::string reset = "\033[0m"; // all color/decorations off - static const std::size_t warn = 7; // length of "warning", the longest label + static const std::string reset = "\033[0m"; // all colors/decorations off + static const size_t warn = 7; // length of "warning", the longest label // full text, including the (possibly underlined) prefix if one was provided const std::string text = prefix == "" ? message - : (color ? under : "") + prefix + (color ? unoff : "") + ": " + message; + : (colors ? under : "") + prefix + (colors ? unoff : "") + ": " + message; // full text, possibly spaced for alignment std::string spaced, indent = std::string(warn+3,' '); // 3 for '[', ']', ' ' @@ -157,52 +150,63 @@ inline std::string diagnostic( } else spaced = text; - // final message, possibly colorized - return color ? codes[label] + spaced + reset : spaced; + // final message, possibly colored + return colors ? codes[label] + spaced + reset : spaced; } -} // namespace detail +// context +inline std::string context(const std::string &type, const std::string &name) +{ + return diagnostic("info", type + " " + name, "Context"); +} +} // namespace detail // ----------------------------------------------------------------------------- -// Miscellaneous output/printing related flags +// Miscellaneous flags // ----------------------------------------------------------------------------- // ------------------------ // re: Component class // ------------------------ -// Should Component's generic write() function print comments? +// Should vectors in Component-derived classes be sorted automatically? +inline bool sort = false; + +// Should Component's generic print() function print comments? inline bool comments = true; // For printing. -// When writing a Component with its generic write() function (or its stream -// output, which uses write()), AND the Component is based on a BodyText with -// hasBodyText == true, values will be printed with GNDStk::columns across. -// "columns" is aliased to "across" for convenience, because, at the time of -// this writing, GNDStk has a Meta<> object, named "columns", which would also -// be in scope if the core namespace is used. So, a user might prefer to use -// the name "across". -inline std::size_t columns = 4; -inline std::size_t &across = columns; - +// +// Applicable when writing a Component with its "prettyprinting" generic write() +// function - or with its stream output, which uses its generic write(). +// +// If the Component is based on a BlockData with hasBlockData == true, then data +// are printed using GNDStk::columns columns. If columns <= 0, it means to print +// all data on one line. +// +// If the data array's size is large, a user may wish to limit the total number +// of printed values. This can be done with the "elements" variable. A value of +// less than 0 means unlimited. All other values, including 0, mean to print no +// more than that number of values. +inline long columns = 4; +inline long elements = -1; // ----------------------------------------------------------------------------- // Flags for fine-tuning diagnostic output // ----------------------------------------------------------------------------- -// Names of these flags align with those in our log:: functions (see below), -// for consistency and predictability. These are in namespace GNDStk while -// those are in namespace GNDStk::log, so the names don't conflict. +// Names of these flags reflect names in our log:: functions (see below), for +// consistency and predictability. These flags are in namespace GNDStk, while +// those are in namespace GNDStk::log; so, the names don't conflict. // Print info messages? (with log::info()) -inline bool info = true; +inline bool notes = true; // Print warnings? (with log::warning()) -inline bool warning = true; -inline bool &warnings = warning; // alias; plural may "read" better +inline bool warnings = true; // Print debug messages? (with log::debug()) inline bool debug = false; @@ -211,13 +215,13 @@ inline bool debug = false; // log::function() // log::member() // log::ctor() +// log::dtor() // log::assign() inline bool context = true; // We don't provide a way to suppress errors; too much could go wrong - // ----------------------------------------------------------------------------- // Shortcuts to njoy::Log functions // ----------------------------------------------------------------------------- @@ -230,9 +234,9 @@ namespace log { // info template -inline void info(const std::string &str, Args &&...args) +void info(const std::string &str, Args &&...args) { - if (GNDStk::info) { + if (GNDStk::notes) { const std::string msg = detail::diagnostic("info",str); Log::info(msg.data(), std::forward(args)...); } @@ -240,9 +244,9 @@ inline void info(const std::string &str, Args &&...args) // warning template -inline void warning(const std::string &str, Args &&...args) +void warning(const std::string &str, Args &&...args) { - if (GNDStk::warning) { + if (GNDStk::warnings) { const std::string msg = detail::diagnostic("warning",str); Log::warning(msg.data(), std::forward(args)...); } @@ -250,7 +254,7 @@ inline void warning(const std::string &str, Args &&...args) // error template -inline void error(const std::string &str, Args &&...args) +void error(const std::string &str, Args &&...args) { const std::string msg = detail::diagnostic("error",str); Log::error(msg.data(), std::forward(args)...); @@ -258,7 +262,7 @@ inline void error(const std::string &str, Args &&...args) // debug template -inline void debug(const std::string &str, Args &&...args) +void debug(const std::string &str, Args &&...args) { if (GNDStk::debug) { const std::string msg = detail::diagnostic("debug",str); @@ -272,103 +276,122 @@ inline void debug(const std::string &str, Args &&...args) // some context information // ------------------------ -// context is a regular function +// context (general) template -inline void function(const std::string &str, Args &&...args) +void context(const std::string &str, Args &&...args) { if (GNDStk::context) { - const std::string msg = - detail::diagnostic("info", "function " + str, "Context"); + const std::string msg = detail::diagnostic("info",str); Log::info(msg.data(), std::forward(args)...); } } +// context is a regular function +template +void function(const std::string &str, Args &&...args) +{ + if (GNDStk::context) + Log::info(detail::context("function", str).data(), + std::forward(args)...); +} + // context is a member function template -inline void member(const std::string &str, Args &&...args) +void member(const std::string &str, Args &&...args) { - if (GNDStk::context) { - const std::string msg = - detail::diagnostic("info", "member function " + str, "Context"); - Log::info(msg.data(), std::forward(args)...); - } + if (GNDStk::context) + Log::info(detail::context("member function", str).data(), + std::forward(args)...); } // context is a constructor template -inline void ctor(const std::string &str, Args &&...args) +void ctor(const std::string &str, Args &&...args) { - if (GNDStk::context) { - const std::string msg = - detail::diagnostic("info", "constructor " + str, "Context"); - Log::info(msg.data(), std::forward(args)...); - } + if (GNDStk::context) + Log::info(detail::context("constructor", str).data(), + std::forward(args)...); +} + +// context is a destructor +template +void dtor(const std::string &str, Args &&...args) +{ + if (GNDStk::context) + Log::info(detail::context("destructor", str).data(), + std::forward(args)...); } // context is an assignment operator template -inline void assign(const std::string &str, Args &&...args) +void assign(const std::string &str, Args &&...args) { - if (GNDStk::context) { - const std::string msg = - detail::diagnostic("info", "assignment " + str, "Context"); - Log::info(msg.data(), std::forward(args)...); - } + if (GNDStk::context) + Log::info(detail::context("assignment", str).data(), + std::forward(args)...); } } // namespace log - // ----------------------------------------------------------------------------- // Forward declarations: some classes; convert // We're not fans of having lots of forward declarations, but these are here -// because (1) the relevant classes (Tree, XML, JSON) use these functions in, -// e.g., their constructors, which are defined in-class; and (2) the convert() -// functions in turn work with the classes and thus need the class definitions -// to be available. The alternative would be to mostly define the classes, but -// only declare their constructors; then define the convert()s; then finally -// define the constructors. We think the forward declarations are clearer. +// because (1) relevant classes use these functions in, for example, their +// constructors, which are defined in-class; and (2) our convert() functions +// in turn work with the classes and thus need the class definitions to be +// available. The alternative would be to mostly define the classes, but only +// declare their constructors; then define the convert()s; then finally define +// the constructors. We think the forward declarations are clearer. // ----------------------------------------------------------------------------- -// Node class Node; - -// Tree -class Tree; - -// XML, JSON class XML; class JSON; +class HDF5; -// Node to {XML,JSON} -bool convert(const Node &, XML &x); -bool convert(const Node &, JSON &j); - -// Tree to {Tree,XML,JSON} -bool convert(const Tree &, Tree &); -bool convert(const Tree &, XML &); -bool convert(const Tree &, JSON &); +// Node ==> {Node,XML,JSON,HDF5} +bool convert(const Node &, Node &); +bool convert(const Node &, XML &); +bool convert(const Node &, JSON &); +bool convert(const Node &, HDF5 &, const std::string & = ""); -// XML to {Node,Tree,XML,JSON} -bool convert(const XML &, Node &, const bool); -bool convert(const XML &, Tree &); +// XML ==> {Node,XML,JSON,HDF5} +bool convert(const XML &, Node &, const bool & = detail::default_bool); bool convert(const XML &, XML &); +#ifndef NJOY_GNDSTK_DISABLE_JSON bool convert(const XML &, JSON &); - -// JSON to {Node,Tree,XML,JSON} -bool convert(const JSON &, Node &, const bool); -bool convert(const JSON &, Tree &); +#endif +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +bool convert(const XML &, HDF5 &); +#endif + +// JSON ==> {Node,XML,JSON,HDF5} +bool convert(const JSON &, Node &, const bool & = detail::default_bool); +#ifndef NJOY_GNDSTK_DISABLE_JSON bool convert(const JSON &, XML &); bool convert(const JSON &, JSON &); - +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +bool convert(const JSON &, HDF5 &); +#endif +#endif + +// HDF5 ==> {Node,XML,JSON,HDF5} +bool convert(const HDF5 &, Node &, const bool & = detail::default_bool); +#ifndef NJOY_GNDSTK_DISABLE_HDF5 +bool convert(const HDF5 &, XML &); +#ifndef NJOY_GNDSTK_DISABLE_JSON +bool convert(const HDF5 &, JSON &); +#endif +bool convert(const HDF5 &, HDF5 &); +#endif // ----------------------------------------------------------------------------- // Utility constructs // The functions here could possibly go into the detail namespace, but could // arguably be useful, in their own right, to users. So, I'll leave them out -// in the overall project namespace (which enclosed the #include of this file). +// in the overall project namespace. // ----------------------------------------------------------------------------- // endsin @@ -378,11 +401,17 @@ inline bool endsin(const std::string &str, const std::string &end) return str.size() >= end.size() && &str[str.size()-end.size()] == end; } +// beginsin +inline bool beginsin(const std::string &str, const std::string &begin) +{ + return strncmp(&str[0], &begin[0], begin.size()) == 0; +} + // nocasecmp // Case-insensitive string comparison. -// The old C-language strcasecmp() is nonstandard. A modern, true caseless +// The old C language strcasecmp() is nonstandard. A modern, true caseless // string comparison is actually a tougher nut to crack than meets the eye, -// but the following will suffice for our English-language purposes. +// but the following should suffice for our purposes. inline bool nocasecmp(const std::string &one, const std::string &two) { return std::equal( @@ -393,7 +422,6 @@ inline bool nocasecmp(const std::string &one, const std::string &two) } - // ----------------------------------------------------------------------------- // Re: file extensions // ----------------------------------------------------------------------------- @@ -424,36 +452,43 @@ inline bool endsin_json(const std::string &str) inline bool endsin_hdf5(const std::string &str) { return - endsin(str,".hdf" ) - || endsin(str,".HDF" ) - || endsin(str,".h5" ) + endsin(str,".h5" ) || endsin(str,".H5" ) || endsin(str,".hdf5") || endsin(str,".HDF5") || endsin(str,".he5" ) - || endsin(str,".HE5" ); + || endsin(str,".HE5" ) + || endsin(str,".hdf" ) + || endsin(str,".HDF" ); + // The last two aren't official HDF5 extensions, but we'll allow them. This + // was motivated by the experience of one of our users, who wrote a file with + // the .hdf extension. At the time, we didn't recognize .hdf as an allowable + // HDF5 extention, and so our "file type guesser" fell back on its default: + // our internal debug-dump format. The user saw the debug dump, and wondered + // if it was HDF5. (It wasn't.) So, now, we'll write HDF5 when someone calls + // their file something.hdf or something.HDF. But if that happens, then we'll + // also print a message about that extension not officially being for HDF5. } - // ----------------------------------------------------------------------------- // Re: file format indicators -// These are used in places where we're allowing a user to give a string, +// These are used in places where we're allowing a user to provide a string, // e.g. "xml", in place of a file format specifier ala enum class file. // ----------------------------------------------------------------------------- -// null -inline bool eq_null(const std::string &str) +// guess +inline bool eq_guess(const std::string &str) { return - nocasecmp(str,"null") || str == ""; + nocasecmp(str,"guess") || str == ""; } // tree -inline bool eq_text(const std::string &str) +inline bool eq_debug(const std::string &str) { return - nocasecmp(str,"text"); + nocasecmp(str,"debug"); } // xml @@ -474,12 +509,24 @@ inline bool eq_json(const std::string &str) inline bool eq_hdf5(const std::string &str) { return - nocasecmp(str,"hdf" ) - || nocasecmp(str,"h5" ) + nocasecmp(str,"h5" ) || nocasecmp(str,"hdf5") - || nocasecmp(str,"he5" ); + || nocasecmp(str,"he5" ) + || nocasecmp(str,"hdf" ); // not official, but we'll allow } +inline FileType string2filetype(const std::string &str, bool &matched) +{ + matched = true; + if (eq_guess(str)) return FileType::guess; + if (eq_debug(str)) return FileType::debug; + if (eq_xml (str)) return FileType::xml; + if (eq_json (str)) return FileType::json; + if (eq_hdf5 (str)) return FileType::hdf5; + + matched = false; + return FileType::guess; +} // ----------------------------------------------------------------------------- @@ -488,168 +535,153 @@ inline bool eq_hdf5(const std::string &str) namespace detail { -// ------------------------ -// isVariant -// ------------------------ - +// is_void_v template -class isVariant { -public: - static constexpr bool value = false; -}; - -template -class isVariant> { -public: - static constexpr bool value = true; -}; +inline constexpr bool is_void_v = std::is_same_v; -// ------------------------ -// isAlternative -// ------------------------ - -// Is T one of the alternatives in variant? - -// no (general case) -template -class is_alternative { -public: - static constexpr bool value = false; -}; - -// yes +// is_in_v +// Does T appear in Ts? (gives false if the pack is empty, per fold's || rules) template -class is_alternative> { -public: - static constexpr bool value = (std::is_same_v || ...); -}; - -template -inline constexpr bool isAlternative = - is_alternative::value; - -// ------------------------ -// isAlternativeOrTheVariant -// ------------------------ - -// Is T one of the alternatives in variant, OR is T == variant -// itself? (Not any variant, but precisely that one.) -// -// Consider the functionality (Node::meta() and Node::child(), at the time of -// this writing) that use this. Invoked with a particular type from the variant, -// a call - say, to meta() - might look like node.template meta(M), where -// M is a Meta<> object with the variant type. In contrast, one could merely -// write node.meta(M) for the full variant, i.e. with no specific alternative -// type stipulated. By making this SFINAE work for the full variant, not just -// for each of its constituent types (as with isAlternative), we allow the -// node.template meta(M) form also to work for the full variant. While -// the short (and no doubt preferred) form would be available even without the -// following, we choose to support consistency by allowing the .template form -// to be used too. This might prove to be useful if, for instance, a user embeds -// the call in question into a single function template that invokes the long -// form, while intending to support calls of either the full variant or any of -// its types. - -template -class is_alternativeOrTheVariant { -public: - static constexpr bool value = - isAlternative || std::is_same_v; -}; - -template -inline constexpr bool isAlternativeOrTheVariant = - is_alternativeOrTheVariant::value; +inline constexpr bool is_in_v = (std::is_same_v || ...); +template +inline constexpr bool is_in_v> = is_in_v; // ------------------------ -// is_void +// isVariant // ------------------------ -// general template -class is_void { -public: +struct isVariant { static constexpr bool value = false; }; -// void -template<> -class is_void { -public: +template +struct isVariant> { static constexpr bool value = true; - using type = void; }; -// isVoid template -inline constexpr bool isVoid = is_void::value; - -// ------------------------ -// isNotVoid -// ------------------------ +inline constexpr bool isVariant_v = isVariant::value; -// general template -class isNotVoid { -public: - static constexpr bool value = true; - using type = T; -}; - -// void -template<> -class isNotVoid { -public: - static constexpr bool value = false; -}; - +using isVariant_t = std::enable_if_t>; // ------------------------ // isIterable // ------------------------ -// fixme -// At some point, we really need a reliable "is_container" traits class. -// For now, I'll use this. +// The intention of this traits class is to decide if an object of the given +// type is suitable for use as the range-expression in a range-based for-loop. +// For now, we're just checking that it has a begin() and an end(). This is +// probably sufficient for our needs, and could be relaxed later if necessary. template -class isIterable { -public: +struct isIterable { static constexpr bool value = false; }; template -class isIterable< +struct isIterable< T, std::void_t< decltype(std::declval().begin()), decltype(std::declval().end()) > > { -public: static constexpr bool value = true; }; } // namespace detail - // ----------------------------------------------------------------------------- -// print_format +// printFormat // ----------------------------------------------------------------------------- namespace detail { -inline std::string print_format(const FileType f, const bool brief = false) +inline std::string printFormat(const FileType f) { - return std::string(brief ? "" : "FileType::") + ( - f == FileType::null ? "null" - : f == FileType::text ? "text" - : f == FileType::xml ? "XML" - : f == FileType::json ? "JSON" - : f == FileType::hdf5 ? "HDF5" + return std::string("FileType::") + ( + f == FileType::guess ? "guess" + : f == FileType::debug ? "debug" + : f == FileType::xml ? "XML" + : f == FileType::json ? "JSON" + : f == FileType::hdf5 ? "HDF5" : "unknown" ); } } // namespace detail + + +// ----------------------------------------------------------------------------- +// Re: OpenMP +// Completely optional - and turned off by default - to use in GNDStk. +// A user must compile with -fopenmp (g++/clang++) to get OpenMP at all. +// At the moment, what we do with threading is very limited. +// ----------------------------------------------------------------------------- + +// Number of threads +// Users can set this in their own codes +inline int threads = 1; + +namespace detail { + +#ifdef _OPENMP + // get_nthreads() + inline int get_nthreads() + { + const int want = njoy::GNDStk::threads; + const int have = omp_get_num_procs(); + + if (want <= 0) + return std::max(1,want+have); + if (want >= have) + return have; + return want; + } + + // set_nthreads() + inline void set_nthreads(const int nthreads) + { + omp_set_num_threads(nthreads); + } + + // this_thread() + inline int this_thread() + { + return omp_get_thread_num(); + } +#else + inline int get_nthreads() { return 1; } + inline void set_nthreads(const int) { /* nothing */ } + inline int this_thread () { return 0; } +#endif + +} // namespace detail + + +// ----------------------------------------------------------------------------- +// DataNode +// ----------------------------------------------------------------------------- + +template +struct DataNode : public T +{ + using T::operator=; + bool cdata = preferCDATA; + + // constructors + explicit DataNode(const T &from = T{}) : T(from) { } + DataNode(const DataNode &from) = default; + DataNode(DataNode &&from) = default; + + // assignment + DataNode &operator=(const DataNode &from) = default; + DataNode &operator=(DataNode &&from) = default; + + // baseObject + const T &baseObject() const { return *this; } + T &baseObject() { return *this; } +}; diff --git a/src/GNDStk/utility/test/CMakeLists.txt b/src/GNDStk/utility/test/CMakeLists.txt index 8e636d2b1..75e79c84f 100644 --- a/src/GNDStk/utility/test/CMakeLists.txt +++ b/src/GNDStk/utility/test/CMakeLists.txt @@ -1,5 +1,9 @@ -add_executable( GNDStk.utility.test utility.test.cpp ) +add_executable( + GNDStk.utility.test + utility.test.cpp +) + target_compile_options( GNDStk.utility.test PRIVATE ${${PREFIX}_common_flags} $<$:${${PREFIX}_strict_flags}>$<$: ${${PREFIX}_DEBUG_flags} @@ -10,5 +14,5 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${GNDStk_appended_flags} ) -target_link_libraries( GNDStk.utility.test PUBLIC GNDStk ) -add_test( NAME GNDStk.utility COMMAND GNDStk.utility.test ) \ No newline at end of file +target_link_libraries( GNDStk.utility.test PUBLIC GNDStk ) +add_test( NAME GNDStk.utility COMMAND GNDStk.utility.test ) diff --git a/src/GNDStk/v1.9.hpp b/src/GNDStk/v1.9.hpp deleted file mode 100644 index a38502179..000000000 --- a/src/GNDStk/v1.9.hpp +++ /dev/null @@ -1,23 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9 -#define NJOY_GNDSTK_V1_9 - -#include "GNDStk/v1.9/containers/Axes.hpp" -#include "GNDStk/v1.9/containers/Axis.hpp" -#include "GNDStk/v1.9/containers/Grid.hpp" -#include "GNDStk/v1.9/containers/Link.hpp" -#include "GNDStk/v1.9/containers/Regions1d.hpp" -#include "GNDStk/v1.9/containers/Values.hpp" -#include "GNDStk/v1.9/containers/XYs1d.hpp" - -#include "GNDStk/v1.9/transport/CrossSection.hpp" -#include "GNDStk/v1.9/transport/Reaction.hpp" -#include "GNDStk/v1.9/transport/ReactionSuite.hpp" -#include "GNDStk/v1.9/transport/Reactions.hpp" - -#include "GNDStk/v1.9/key.hpp" - -#endif diff --git a/src/GNDStk/v1.9/containers/Axes.hpp b/src/GNDStk/v1.9/containers/Axes.hpp deleted file mode 100644 index cee1b9753..000000000 --- a/src/GNDStk/v1.9/containers/Axes.hpp +++ /dev/null @@ -1,294 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9_CONTAINERS_AXES -#define NJOY_GNDSTK_V1_9_CONTAINERS_AXES - -// core interface -#include "GNDStk.hpp" - -// v1.9 dependencies -#include "GNDStk/v1.9/containers/Axis.hpp" -#include "GNDStk/v1.9/containers/Grid.hpp" - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// containers:: -// class Axes -// ----------------------------------------------------------------------------- - -namespace containers { - -class Axes : public Component { - - using axis_grid_t = std::variant< - containers::Axis, - containers::Grid - >; - - // ------------------------ - // For Component - // ------------------------ - - friend class Component; - - // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "containers"; } - static auto className() { return "Axes"; } - static auto GNDSName() { return "axes"; } - - // Core Interface multi-query to extract metadata and child nodes - static auto keys() - { - return - // metadata - std::optional{} - / Meta<>("href") | - // children - axis_grid_t{} - / ++(Child<>("axis") || Child<>("grid")) - ; - } - -public: - - using Component::construct; - - // ------------------------ - // Relevant defaults - // FYI for users - // ------------------------ - - static inline const struct Defaults { - } defaults; - - // ------------------------ - // Raw GNDS content - // ------------------------ - - struct { - // metadata - std::optional href; - // children - variant - std::vector axis_grid; - } content; - - // ------------------------ - // Getters - // const and non-const - // ------------------------ - - // href - const std::optional &href() const - { return content.href; } - std::optional &href() - { return content.href; } - - // axis_grid - const std::vector &axis_grid() const - { return content.axis_grid; } - std::vector &axis_grid() - { return content.axis_grid; } - - // axis_grid(index) - const axis_grid_t &axis_grid(const std::size_t index) const - { return getter(axis_grid(), index, "axis_grid"); } - axis_grid_t &axis_grid(const std::size_t index) - { return getter(axis_grid(), index, "axis_grid"); } - - // axis_grid(label) - const axis_grid_t &axis_grid(const std::string &label) const - { return getter(axis_grid(), label, "axis_grid"); } - axis_grid_t &axis_grid(const std::string &label) - { return getter(axis_grid(), label, "axis_grid"); } - - // axis(index) - const containers::Axis *axis(const std::size_t index) const - { return getter(axis_grid(), index, "axis"); } - containers::Axis *axis(const std::size_t index) - { return getter(axis_grid(), index, "axis"); } - - // axis(label) - const containers::Axis *axis(const std::string &label) const - { return getter(axis_grid(), label, "axis"); } - containers::Axis *axis(const std::string &label) - { return getter(axis_grid(), label, "axis"); } - - // grid(index) - const containers::Grid *grid(const std::size_t index) const - { return getter(axis_grid(), index, "grid"); } - containers::Grid *grid(const std::size_t index) - { return getter(axis_grid(), index, "grid"); } - - // grid(label) - const containers::Grid *grid(const std::string &label) const - { return getter(axis_grid(), label, "grid"); } - containers::Grid *grid(const std::string &label) - { return getter(axis_grid(), label, "grid"); } - - // ------------------------ - // Setters - // non-const - // All return *this - // ------------------------ - - // href(value) - Axes &href(const std::optional &obj) - { href() = obj; return *this; } - - // axis_grid(value) - Axes &axis_grid(const std::vector &obj) - { axis_grid() = obj; return *this; } - - // axis_grid(index,value) - Axes &axis_grid( - const std::size_t index, - const axis_grid_t &obj - ) { - axis_grid(index) = obj; return *this; - } - - // axis_grid(label,value) - Axes &axis_grid( - const std::string &label, - const axis_grid_t &obj - ) { - axis_grid(label) = obj; return *this; - } - - // axis(index,value) - Axes &axis( - const std::size_t index, - const std::optional &obj - ) { - if (obj) axis_grid(index,obj.value()); - return *this; - } - - // axis(label,value) - Axes &axis( - const std::string &label, - const std::optional &obj - ) { - if (obj) axis_grid(label,obj.value()); - return *this; - } - - // grid(index,value) - Axes &grid( - const std::size_t index, - const std::optional &obj - ) { - if (obj) axis_grid(index,obj.value()); - return *this; - } - - // grid(label,value) - Axes &grid( - const std::string &label, - const std::optional &obj - ) { - if (obj) axis_grid(label,obj.value()); - return *this; - } - - // ------------------------ - // Construction - // ------------------------ - - // default - Axes() : - Component{ - BodyText{}, - content.href, - content.axis_grid - } - { - Component::finish(); - } - - // copy - Axes(const Axes &other) : - Component{ - other, - content.href, - content.axis_grid - }, - content{other.content} - { - Component::finish(other); - } - - // move - Axes(Axes &&other) : - Component{ - other, - content.href, - content.axis_grid - }, - content{std::move(other.content)} - { - Component::finish(other); - } - - // from node - Axes(const Node &node) : - Component{ - BodyText{}, - content.href, - content.axis_grid - } - { - Component::finish(node); - } - - // from fields - explicit Axes( - const std::optional &href, - const std::vector &axis_grid - ) : - Component{ - BodyText{}, - content.href, - content.axis_grid - }, - content{ - href, - axis_grid - } - { - Component::finish(); - } - - // ------------------------ - // Assignment - // ------------------------ - - // copy - Axes &operator=(const Axes &) = default; - - // move - Axes &operator=(Axes &&) = default; - - // ------------------------ - // Custom functionality - // ------------------------ - - #include "GNDStk/v1.9/containers/Axes/src/custom.hpp" - -}; // class Axes - -} // namespace containers -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/src/GNDStk/v1.9/containers/Axes/test/Axes.test.cpp b/src/GNDStk/v1.9/containers/Axes/test/Axes.test.cpp deleted file mode 100644 index 38e513bd2..000000000 --- a/src/GNDStk/v1.9/containers/Axes/test/Axes.test.cpp +++ /dev/null @@ -1,278 +0,0 @@ -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk/v1.9/containers/Axes.hpp" - -// other includes - -// convenience typedefs -using namespace njoy::GNDStk; -using Axes = v1_9::containers::Axes; -using Axis = v1_9::containers::Axis; -using Grid = v1_9::containers::Grid; -using Values = v1_9::containers::Values; -using Link = v1_9::containers::Link; - -std::string chunk(); -void verifyChunk( const Axes& ); -std::string invalidName(); - -SCENARIO( "Axes" ) { - - GIVEN( "valid data for the component" ) { - - std::string string = chunk(); - - WHEN( "autogenerated constructor: the data is given explicitly" ) { - - std::vector< std::variant< Axis, Grid > > axis = { - - Axis( 1, "energy_in", "eV" ), - Axis( 0, "radius", "fm" ) - }; - - Axes chunk( std::nullopt, axis ); - - THEN( "the component can be constructed and members can be tested" ) { - - verifyChunk( chunk ); - } // THEN - - THEN( "it can be written in XML" ) { - - std::ostringstream out; - XML( Node( chunk ) ).write( out, false ); - - CHECK( out.str() == string ); - } // THEN - } // WHEN - - WHEN( "the data is constructed from a node" ) { - - Node node; - node << chunk(); - Axes chunk( node ); - - THEN( "the component can be constructed and members can be tested" ) { - - verifyChunk( chunk ); - } // THEN - - THEN( "it can be written in XML" ) { - - std::ostringstream out; - XML( Node( chunk ) ).write( out, false ); - - CHECK( out.str() == string ); - } // THEN - } // WHEN - } // GIVEN - - GIVEN( "a valid component instance" ) { - - WHEN( "the component is copied" ) { - - Node node; - node << chunk(); - Axes chunk( node ); - - // copy constructor - Axes copy( chunk ); - - // copy assignment - Axes assign; - assign = chunk; - - THEN( "the component can be constructed and members can be tested" ) { - - verifyChunk( copy ); - verifyChunk( assign ); - } // THEN - } // WHEN - - WHEN( "the data is moved" ) { - - Node node; - node << chunk(); - Axes chunk( node ); - Axes chunk2( node ); - - // move constructor - Axes move( std::move( chunk ) ); - - // move assignment - Axes assign; - assign = std::move( chunk2 ); - - THEN( "the component can be constructed and members can be tested" ) { - - verifyChunk( move ); - verifyChunk( assign ); - } // THEN - } // WHEN - } // GIVEN - - GIVEN( "invalid data" ) { - - WHEN( "when the wrong node is used" ) { - - Node node; - node << invalidName(); - - THEN( "an exception is thrown" ) { - - CHECK_THROWS( Axes( node ) ); - } // THEN - } // WHEN - } // GIVEN -} // SCENARIO - -std::string chunk() { - - return -R"***( - - - -)***"; -} - -void verifyChunk( const Axes& component ) { - - CHECK( std::nullopt == component.href() ); - - CHECK( 2 == component.axis_grid().size() ); - CHECK( 2 == component.size() ); - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // indexing into the vector and accessing the variant directly - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - decltype(auto) axis_i0 = std::get< Axis >( component.axis_grid()[0] ); - - CHECK( std::nullopt != axis_i0.index() ); - CHECK( std::nullopt != axis_i0.label() ); - CHECK( std::nullopt != axis_i0.unit() ); - - CHECK( 0 == axis_i0.index().value() ); - CHECK( "radius" == axis_i0.label().value() ); - CHECK( "fm" == axis_i0.unit().value() ); - - decltype(auto) axis_i1 = std::get< Axis >( component.axis_grid()[1] ); - - CHECK( std::nullopt != axis_i1.index() ); - CHECK( std::nullopt != axis_i1.label() ); - CHECK( std::nullopt != axis_i1.unit() ); - - CHECK( 1 == axis_i1.index().value() ); - CHECK( "energy_in" == axis_i1.label().value() ); - CHECK( "eV" == axis_i1.unit().value() ); - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // using the index based axis_grid getter and accessing the variant directly - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//! @todo a compilation issue exists, where a pointer is returned instead of a reference? - - decltype(auto) axis_ii0 = std::get< Axis >( component.axis_grid( 0 ) ); - - CHECK( std::nullopt != axis_ii0.index() ); - CHECK( std::nullopt != axis_ii0.label() ); - CHECK( std::nullopt != axis_ii0.unit() ); - - CHECK( 0 == axis_ii0.index().value() ); - CHECK( "radius" == axis_ii0.label().value() ); - CHECK( "fm" == axis_ii0.unit().value() ); - - decltype(auto) axis_ii1 = std::get< Axis >( component.axis_grid( 1 ) ); - - CHECK( std::nullopt != axis_ii1.index() ); - CHECK( std::nullopt != axis_ii1.label() ); - CHECK( std::nullopt != axis_ii1.unit() ); - - CHECK( 1 == axis_ii1.index().value() ); - CHECK( "energy_in" == axis_ii1.label().value() ); - CHECK( "eV" == axis_ii1.unit().value() ); - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // using the label based axis_grid getter and accessing the variant directly - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - decltype(auto) axis_iii0 = std::get< Axis >( component.axis_grid( "radius" ) ); - - CHECK( std::nullopt != axis_iii0.index() ); - CHECK( std::nullopt != axis_iii0.label() ); - CHECK( std::nullopt != axis_iii0.unit() ); - - CHECK( 0 == axis_iii0.index().value() ); - CHECK( "radius" == axis_iii0.label().value() ); - CHECK( "fm" == axis_iii0.unit().value() ); - - decltype(auto) axis_iii1 = std::get< Axis >( component.axis_grid( "energy_in" ) ); - - CHECK( std::nullopt != axis_iii1.index() ); - CHECK( std::nullopt != axis_iii1.label() ); - CHECK( std::nullopt != axis_iii1.unit() ); - - CHECK( 1 == axis_iii1.index().value() ); - CHECK( "energy_in" == axis_iii1.label().value() ); - CHECK( "eV" == axis_iii1.unit().value() ); - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // using the index based axis getter - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - decltype(auto) axis_iv0 = *component.axis( 0 ); - - CHECK( std::nullopt != axis_iv0.index() ); - CHECK( std::nullopt != axis_iv0.label() ); - CHECK( std::nullopt != axis_iv0.unit() ); - - CHECK( 0 == axis_iv0.index().value() ); - CHECK( "radius" == axis_iv0.label().value() ); - CHECK( "fm" == axis_iv0.unit().value() ); - - decltype(auto) axis_iv1 = *component.axis( 1 ); - - CHECK( std::nullopt != axis_iv1.index() ); - CHECK( std::nullopt != axis_iv1.label() ); - CHECK( std::nullopt != axis_iv1.unit() ); - - CHECK( 1 == axis_iv1.index().value() ); - CHECK( "energy_in" == axis_iv1.label().value() ); - CHECK( "eV" == axis_iv1.unit().value() ); - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // using the label based axis getter - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - decltype(auto) axis_v0 = *component.axis( "radius" ); - - CHECK( std::nullopt != axis_v0.index() ); - CHECK( std::nullopt != axis_v0.label() ); - CHECK( std::nullopt != axis_v0.unit() ); - - CHECK( 0 == axis_v0.index().value() ); - CHECK( "radius" == axis_v0.label().value() ); - CHECK( "fm" == axis_v0.unit().value() ); - - decltype(auto) axis_v1 = *component.axis( "energy_in" ); - - CHECK( std::nullopt != axis_v1.index() ); - CHECK( std::nullopt != axis_v1.label() ); - CHECK( std::nullopt != axis_v1.unit() ); - - CHECK( 1 == axis_v1.index().value() ); - CHECK( "energy_in" == axis_v1.label().value() ); - CHECK( "eV" == axis_v1.unit().value() ); -} - -std::string invalidName() { - - // wrong name for the node - return -R"***( - - -)***"; -} diff --git a/src/GNDStk/v1.9/containers/Axis.hpp b/src/GNDStk/v1.9/containers/Axis.hpp deleted file mode 100644 index 2fb9d900f..000000000 --- a/src/GNDStk/v1.9/containers/Axis.hpp +++ /dev/null @@ -1,216 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9_CONTAINERS_AXIS -#define NJOY_GNDSTK_V1_9_CONTAINERS_AXIS - -// core interface -#include "GNDStk.hpp" - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// containers:: -// class Axis -// ----------------------------------------------------------------------------- - -namespace containers { - -class Axis : public Component { - - - // ------------------------ - // For Component - // ------------------------ - - friend class Component; - - // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "containers"; } - static auto className() { return "Axis"; } - static auto GNDSName() { return "axis"; } - - // Core Interface multi-query to extract metadata and child nodes - static auto keys() - { - return - // metadata - std::optional{} - / Meta<>("index") | - std::optional{} - / Meta<>("label") | - std::optional{} - / Meta<>("unit") - ; - } - -public: - - using Component::construct; - - // ------------------------ - // Relevant defaults - // FYI for users - // ------------------------ - - static inline const struct Defaults { - } defaults; - - // ------------------------ - // Raw GNDS content - // ------------------------ - - struct { - // metadata - std::optional index; - std::optional label; - std::optional unit; - } content; - - // ------------------------ - // Getters - // const and non-const - // ------------------------ - - // index - const std::optional &index() const - { return content.index; } - std::optional &index() - { return content.index; } - - // label - const std::optional &label() const - { return content.label; } - std::optional &label() - { return content.label; } - - // unit - const std::optional &unit() const - { return content.unit; } - std::optional &unit() - { return content.unit; } - - // ------------------------ - // Setters - // non-const - // All return *this - // ------------------------ - - // index(value) - Axis &index(const std::optional &obj) - { index() = obj; return *this; } - - // label(value) - Axis &label(const std::optional &obj) - { label() = obj; return *this; } - - // unit(value) - Axis &unit(const std::optional &obj) - { unit() = obj; return *this; } - - // ------------------------ - // Construction - // ------------------------ - - // default - Axis() : - Component{ - BodyText{}, - content.index, - content.label, - content.unit - } - { - Component::finish(); - } - - // copy - Axis(const Axis &other) : - Component{ - other, - content.index, - content.label, - content.unit - }, - content{other.content} - { - Component::finish(other); - } - - // move - Axis(Axis &&other) : - Component{ - other, - content.index, - content.label, - content.unit - }, - content{std::move(other.content)} - { - Component::finish(other); - } - - // from node - Axis(const Node &node) : - Component{ - BodyText{}, - content.index, - content.label, - content.unit - } - { - Component::finish(node); - } - - // from fields - explicit Axis( - const std::optional &index, - const std::optional &label, - const std::optional &unit - ) : - Component{ - BodyText{}, - content.index, - content.label, - content.unit - }, - content{ - index, - label, - unit - } - { - Component::finish(); - } - - // ------------------------ - // Assignment - // ------------------------ - - // copy - Axis &operator=(const Axis &) = default; - - // move - Axis &operator=(Axis &&) = default; - - // ------------------------ - // Custom functionality - // ------------------------ - - #include "GNDStk/v1.9/containers/Axis/src/custom.hpp" - -}; // class Axis - -} // namespace containers -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/src/GNDStk/v1.9/containers/Axis/src/custom.hpp b/src/GNDStk/v1.9/containers/Axis/src/custom.hpp deleted file mode 100644 index 0dd9bcbf2..000000000 --- a/src/GNDStk/v1.9/containers/Axis/src/custom.hpp +++ /dev/null @@ -1,18 +0,0 @@ -private: - - static inline helpMap help = { - - { "", "A GNDS 1.9 basic container component: an axis with an index, label and\n" - "optional unit\n\n" - "This component in used in the axes node, which in turn is used in most\n" - "functional containers." }, - { "constructor", "Initialise the axis component\n\n" - "Arguments:\n" - " self the axis component\n" - " index the index of the axis component\n" - " label the label of the axis component\n" - " unit the unit of the axis component\n" }, - { "index", "The index of the axis component" }, - { "label", "The label of the axis component" }, - { "unit", "The unit of the axis component" } - }; diff --git a/src/GNDStk/v1.9/containers/Grid.hpp b/src/GNDStk/v1.9/containers/Grid.hpp deleted file mode 100644 index bf20dbf93..000000000 --- a/src/GNDStk/v1.9/containers/Grid.hpp +++ /dev/null @@ -1,310 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9_CONTAINERS_GRID -#define NJOY_GNDSTK_V1_9_CONTAINERS_GRID - -// core interface -#include "GNDStk.hpp" - -// v1.9 dependencies -#include "GNDStk/v1.9/containers/Link.hpp" -#include "GNDStk/v1.9/containers/Values.hpp" - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// containers:: -// class Grid -// ----------------------------------------------------------------------------- - -namespace containers { - -class Grid : public Component { - - using link_values_t = std::variant< - containers::Link, - containers::Values - >; - - // ------------------------ - // For Component - // ------------------------ - - friend class Component; - - // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "containers"; } - static auto className() { return "Grid"; } - static auto GNDSName() { return "grid"; } - - // Core Interface multi-query to extract metadata and child nodes - static auto keys() - { - return - // metadata - std::optional{} - / Meta<>("index") | - Defaulted{enums::Interpolation::linlin} - / Meta<>("interpolation") | - std::optional{} - / Meta<>("label") | - std::optional{} - / Meta<>("style") | - std::optional{} - / Meta<>("unit") | - // children - link_values_t{} - / --(Child<>("link") || Child<>("values")) - ; - } - -public: - - using Component::construct; - - // ------------------------ - // Relevant defaults - // FYI for users - // ------------------------ - - static inline const struct Defaults { - static inline const enums::Interpolation interpolation = enums::Interpolation::linlin; - } defaults; - - // ------------------------ - // Raw GNDS content - // ------------------------ - - struct { - // metadata - std::optional index; - Defaulted interpolation{enums::Interpolation::linlin}; - std::optional label; - std::optional style; - std::optional unit; - // children - variant - link_values_t link_values; - } content; - - // ------------------------ - // Getters - // const and non-const - // ------------------------ - - // index - const std::optional &index() const - { return content.index; } - std::optional &index() - { return content.index; } - - // interpolation - const Defaulted &interpolation() const - { return content.interpolation; } - Defaulted &interpolation() - { return content.interpolation; } - - // label - const std::optional &label() const - { return content.label; } - std::optional &label() - { return content.label; } - - // style - const std::optional &style() const - { return content.style; } - std::optional &style() - { return content.style; } - - // unit - const std::optional &unit() const - { return content.unit; } - std::optional &unit() - { return content.unit; } - - // link_values - const link_values_t &link_values() const - { return content.link_values; } - link_values_t &link_values() - { return content.link_values; } - - // link - const containers::Link *link() const - { return getter(link_values(), "link"); } - containers::Link *link() - { return getter(link_values(), "link"); } - - // values - const containers::Values *values() const - { return getter(link_values(), "values"); } - containers::Values *values() - { return getter(link_values(), "values"); } - - // ------------------------ - // Setters - // non-const - // All return *this - // ------------------------ - - // index(value) - Grid &index(const std::optional &obj) - { index() = obj; return *this; } - - // interpolation(value) - Grid &interpolation(const Defaulted &obj) - { content.interpolation = obj; return *this; } - Grid &interpolation(const std::optional &obj) - { content.interpolation = obj; return *this; } - - // label(value) - Grid &label(const std::optional &obj) - { label() = obj; return *this; } - - // style(value) - Grid &style(const std::optional &obj) - { style() = obj; return *this; } - - // unit(value) - Grid &unit(const std::optional &obj) - { unit() = obj; return *this; } - - // link_values(value) - Grid &link_values(const link_values_t &obj) - { link_values() = obj; return *this; } - - // link(value) - Grid &link(const std::optional &obj) - { if (obj) link_values(obj.value()); return *this; } - - // values(value) - Grid &values(const std::optional &obj) - { if (obj) link_values(obj.value()); return *this; } - - // ------------------------ - // Construction - // ------------------------ - - // default - Grid() : - Component{ - BodyText{}, - content.index, - content.interpolation, - content.label, - content.style, - content.unit, - content.link_values - } - { - Component::finish(); - } - - // copy - Grid(const Grid &other) : - Component{ - other, - content.index, - content.interpolation, - content.label, - content.style, - content.unit, - content.link_values - }, - content{other.content} - { - Component::finish(other); - } - - // move - Grid(Grid &&other) : - Component{ - other, - content.index, - content.interpolation, - content.label, - content.style, - content.unit, - content.link_values - }, - content{std::move(other.content)} - { - Component::finish(other); - } - - // from node - Grid(const Node &node) : - Component{ - BodyText{}, - content.index, - content.interpolation, - content.label, - content.style, - content.unit, - content.link_values - } - { - Component::finish(node); - } - - // from fields - // std::optional replaces Defaulted; this class knows the default(s) - explicit Grid( - const std::optional &index, - const std::optional &interpolation, - const std::optional &label, - const std::optional &style, - const std::optional &unit, - const link_values_t &link_values - ) : - Component{ - BodyText{}, - content.index, - content.interpolation, - content.label, - content.style, - content.unit, - content.link_values - }, - content{ - index, - Defaulted(defaults.interpolation,interpolation), - label, - style, - unit, - link_values - } - { - Component::finish(); - } - - // ------------------------ - // Assignment - // ------------------------ - - // copy - Grid &operator=(const Grid &) = default; - - // move - Grid &operator=(Grid &&) = default; - - // ------------------------ - // Custom functionality - // ------------------------ - - #include "GNDStk/v1.9/containers/Grid/src/custom.hpp" - -}; // class Grid - -} // namespace containers -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/src/GNDStk/v1.9/containers/Grid/test/Grid.test.cpp b/src/GNDStk/v1.9/containers/Grid/test/Grid.test.cpp deleted file mode 100644 index 078ac9417..000000000 --- a/src/GNDStk/v1.9/containers/Grid/test/Grid.test.cpp +++ /dev/null @@ -1,256 +0,0 @@ -#define CATCH_CONFIG_MAIN - -#include "catch.hpp" -#include "GNDStk/v1.9/containers/Grid.hpp" - -// other includes - -// convenience typedefs -using namespace njoy::GNDStk; -using Values = v1_9::containers::Values; -using Link = v1_9::containers::Link; -using Grid = v1_9::containers::Grid; - -std::string chunk(); -void verifyChunk( const Grid& ); -std::string chunkWithLink(); -void verifyChunkWithLink( const Grid& ); -std::string invalidName(); - -SCENARIO( "Grid" ) { - - GIVEN( "valid data for the component with a Values component" ) { - - std::string string = chunk(); - - WHEN( "autogenerated constructor: the data is given explicitly" ) { - - unsigned int index = 2; - std::string label = "row_energy_bounds"; - std::string unit = "eV"; - enums::GridStyle style = enums::GridStyle::boundaries; - std::vector< double > values = { 1e-5, 2e7 }; - - Grid chunk( index, std::nullopt, label, style, unit, Values( values ) ); - - THEN( "the component can be constructed and members can be tested" ) { - - verifyChunk( chunk ); - } // THEN - - THEN( "it can be written in XML" ) { - - std::ostringstream out; - XML( Node( chunk ) ).write( out, false ); - - CHECK( out.str() == string ); - } // THEN - } // WHEN - - WHEN( "the data is constructed from a node" ) { - - Node node; - node << chunk(); - Grid chunk( node ); - - THEN( "the component can be constructed and members can be tested" ) { - - verifyChunk( chunk ); - } // THEN - - THEN( "it can be written in XML" ) { - - std::ostringstream out; - XML( Node( chunk ) ).write( out, false ); - - CHECK( out.str() == string ); - } // THEN - } // WHEN - } // GIVEN - - GIVEN( "valid data for the component with a Link component" ) { - - std::string string = chunkWithLink(); - - WHEN( "autogenerated constructor: the data is given explicitly" ) { - - unsigned int index = 1; - std::string label = "column_energy_bounds"; - std::string unit = "eV"; - enums::GridStyle style = enums::GridStyle::link; - std::string href = "../../grid[@index='2']/values"; - - Grid chunk( index, std::nullopt, label, style, unit, - Link( href ) ); - - THEN( "the component can be constructed and members can be tested" ) { - - verifyChunkWithLink( chunk ); - } // THEN - - THEN( "it can be written in XML" ) { - - std::ostringstream out; - XML( Node( chunk ) ).write( out, false ); - - CHECK( out.str() == string ); - } // THEN - } // WHEN - - WHEN( "the data is constructed from a node" ) { - - Node node; - node << chunkWithLink(); - Grid chunk( node ); - - THEN( "the component can be constructed and members can be tested" ) { - - verifyChunkWithLink( chunk ); - } // THEN - - THEN( "it can be written in XML" ) { - - std::ostringstream out; - XML( Node( chunk ) ).write( out, false ); - - CHECK( out.str() == string ); - } // THEN - } // WHEN - } // GIVEN - - GIVEN( "a valid component instance" ) { - - WHEN( "the component is copied" ) { - - Node node; - node << chunk(); - Grid chunk( node ); - - // copy constructor - Grid copy( chunk ); - - // copy assignment - Grid assign; - assign = chunk; - - THEN( "the component can be constructed and members can be tested" ) { - - verifyChunk( copy ); - verifyChunk( assign ); - } // THEN - } // WHEN - - WHEN( "the data is moved" ) { - - Node node; - node << chunk(); - Grid chunk( node ); - Grid chunk2( node ); - - // move constructor - Grid move( std::move( chunk ) ); - - // move assignment - Grid assign; - assign = std::move( chunk2 ); - - THEN( "the component can be constructed and members can be tested" ) { - - verifyChunk( move ); - verifyChunk( assign ); - } // THEN - } // WHEN - } // GIVEN - - GIVEN( "invalid data" ) { - - WHEN( "when the wrong node is used" ) { - - Node node; - node << invalidName(); - - THEN( "an exception is thrown" ) { - - CHECK_THROWS( Grid( node ) ); - } // THEN - } // WHEN - } // GIVEN -} // SCENARIO - -std::string chunk() { - - return -R"***( - 1e-05 2e+07 - -)***"; -} - -void verifyChunk( const Grid& component ) { - - CHECK( std::nullopt != component.index() ); - CHECK( std::nullopt != component.label() ); - CHECK( std::nullopt != component.style() ); - CHECK( std::nullopt != component.unit() ); - - CHECK( 2 == component.index().value() ); - CHECK( "row_energy_bounds" == component.label().value() ); - CHECK( "eV" == component.unit().value() ); - CHECK( enums::GridStyle::boundaries == component.style().value() ); - - CHECK( 2 == component.index() ); - CHECK( "row_energy_bounds" == component.label() ); - CHECK( "eV" == component.unit() ); - CHECK( enums::GridStyle::boundaries == component.style() ); - - decltype(auto) values = std::get< Values >( component.link_values() ); - CHECK( 2 == values.length() ); - CHECK( 0 == values.start() ); - CHECK( "Float64" == values.valueType().value() ); - - CHECK( 2 == values.size() ); - CHECK( 2 == values.doubles().size() ); - - CHECK( 1e-5 == Approx( values.doubles()[0] ) ); - CHECK( 2e+7 == Approx( values.doubles()[1] ) ); -} - -std::string chunkWithLink() { - - return -R"***( - - -)***"; -} - -void verifyChunkWithLink( const Grid& component ) { - - CHECK( std::nullopt != component.index() ); - CHECK( std::nullopt != component.label() ); - CHECK( std::nullopt != component.style() ); - CHECK( std::nullopt != component.unit() ); - - CHECK( 1 == component.index().value() ); - CHECK( "column_energy_bounds" == component.label().value() ); - CHECK( "eV" == component.unit().value() ); - CHECK( enums::GridStyle::link == component.style().value() ); - - CHECK( 1 == component.index() ); - CHECK( "column_energy_bounds" == component.label() ); - CHECK( "eV" == component.unit() ); - CHECK( enums::GridStyle::link == component.style() ); - - decltype(auto) link = std::get< Link >( component.link_values() ); - CHECK( "../../grid[@index='2']/values" == link.href() ); -} - -std::string invalidName() { - - // wrong name for the node - return -R"***( - - -)***"; -} diff --git a/src/GNDStk/v1.9/containers/Link.hpp b/src/GNDStk/v1.9/containers/Link.hpp deleted file mode 100644 index 0367513d2..000000000 --- a/src/GNDStk/v1.9/containers/Link.hpp +++ /dev/null @@ -1,176 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9_CONTAINERS_LINK -#define NJOY_GNDSTK_V1_9_CONTAINERS_LINK - -// core interface -#include "GNDStk.hpp" - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// containers:: -// class Link -// ----------------------------------------------------------------------------- - -namespace containers { - -class Link : public Component { - - - // ------------------------ - // For Component - // ------------------------ - - friend class Component; - - // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "containers"; } - static auto className() { return "Link"; } - static auto GNDSName() { return "link"; } - - // Core Interface multi-query to extract metadata and child nodes - static auto keys() - { - return - // metadata - std::string{} - / Meta<>("href") - ; - } - -public: - - using Component::construct; - - // ------------------------ - // Relevant defaults - // FYI for users - // ------------------------ - - static inline const struct Defaults { - } defaults; - - // ------------------------ - // Raw GNDS content - // ------------------------ - - struct { - // metadata - std::string href; - } content; - - // ------------------------ - // Getters - // const and non-const - // ------------------------ - - // href - const std::string &href() const - { return content.href; } - std::string &href() - { return content.href; } - - // ------------------------ - // Setters - // non-const - // All return *this - // ------------------------ - - // href(value) - Link &href(const std::string &obj) - { href() = obj; return *this; } - - // ------------------------ - // Construction - // ------------------------ - - // default - Link() : - Component{ - BodyText{}, - content.href - } - { - Component::finish(); - } - - // copy - Link(const Link &other) : - Component{ - other, - content.href - }, - content{other.content} - { - Component::finish(other); - } - - // move - Link(Link &&other) : - Component{ - other, - content.href - }, - content{std::move(other.content)} - { - Component::finish(other); - } - - // from node - Link(const Node &node) : - Component{ - BodyText{}, - content.href - } - { - Component::finish(node); - } - - // from fields - explicit Link( - const std::string &href - ) : - Component{ - BodyText{}, - content.href - }, - content{ - href - } - { - Component::finish(); - } - - // ------------------------ - // Assignment - // ------------------------ - - // copy - Link &operator=(const Link &) = default; - - // move - Link &operator=(Link &&) = default; - - // ------------------------ - // Custom functionality - // ------------------------ - - #include "GNDStk/v1.9/containers/Link/src/custom.hpp" - -}; // class Link - -} // namespace containers -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/src/GNDStk/v1.9/containers/Regions1d.hpp b/src/GNDStk/v1.9/containers/Regions1d.hpp deleted file mode 100644 index c1a3c1002..000000000 --- a/src/GNDStk/v1.9/containers/Regions1d.hpp +++ /dev/null @@ -1,270 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9_CONTAINERS_REGIONS1D -#define NJOY_GNDSTK_V1_9_CONTAINERS_REGIONS1D - -// core interface -#include "GNDStk.hpp" - -// v1.9 dependencies -#include "GNDStk/v1.9/containers/XYs1d.hpp" -#include "GNDStk/v1.9/containers/Axes.hpp" - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// containers:: -// class Regions1d -// ----------------------------------------------------------------------------- - -namespace containers { - -class Regions1d : public Component { - - - // ------------------------ - // For Component - // ------------------------ - - friend class Component; - - // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "containers"; } - static auto className() { return "Regions1d"; } - static auto GNDSName() { return "regions1d"; } - - // Core Interface multi-query to extract metadata and child nodes - static auto keys() - { - return - // metadata - std::optional{} - / Meta<>("label") | - std::optional{} - / Meta<>("outerDomainValue") | - // children - containers::XYs1d{} - / ++Child<>("XYs1d") | - std::optional{} - / --Child<>("axes") - ; - } - -public: - - using Component::construct; - - // ------------------------ - // Relevant defaults - // FYI for users - // ------------------------ - - static inline const struct Defaults { - } defaults; - - // ------------------------ - // Raw GNDS content - // ------------------------ - - struct { - // metadata - std::optional label; - std::optional outerDomainValue; - // children - std::vector XYs1d; - std::optional axes; - } content; - - // ------------------------ - // Getters - // const and non-const - // ------------------------ - - // label - const std::optional &label() const - { return content.label; } - std::optional &label() - { return content.label; } - - // outerDomainValue - const std::optional &outerDomainValue() const - { return content.outerDomainValue; } - std::optional &outerDomainValue() - { return content.outerDomainValue; } - - // XYs1d - const std::vector &XYs1d() const - { return content.XYs1d; } - std::vector &XYs1d() - { return content.XYs1d; } - - // XYs1d(index) - const containers::XYs1d &XYs1d(const std::size_t index) const - { return getter(XYs1d(), index, "XYs1d"); } - containers::XYs1d &XYs1d(const std::size_t index) - { return getter(XYs1d(), index, "XYs1d"); } - - // XYs1d(label) - const containers::XYs1d &XYs1d(const std::string &label) const - { return getter(XYs1d(), label, "XYs1d"); } - containers::XYs1d &XYs1d(const std::string &label) - { return getter(XYs1d(), label, "XYs1d"); } - - // axes - const std::optional &axes() const - { return content.axes; } - std::optional &axes() - { return content.axes; } - - // ------------------------ - // Setters - // non-const - // All return *this - // ------------------------ - - // label(value) - Regions1d &label(const std::optional &obj) - { label() = obj; return *this; } - - // outerDomainValue(value) - Regions1d &outerDomainValue(const std::optional &obj) - { outerDomainValue() = obj; return *this; } - - // XYs1d(value) - Regions1d &XYs1d(const std::vector &obj) - { XYs1d() = obj; return *this; } - - // XYs1d(index,value) - Regions1d &XYs1d( - const std::size_t index, - const containers::XYs1d &obj - ) { - XYs1d(index) = obj; return *this; - } - - // XYs1d(label,value) - Regions1d &XYs1d( - const std::string &label, - const containers::XYs1d &obj - ) { - XYs1d(label) = obj; return *this; - } - - // axes(value) - Regions1d &axes(const std::optional &obj) - { axes() = obj; return *this; } - - // ------------------------ - // Construction - // ------------------------ - - // default - Regions1d() : - Component{ - BodyText{}, - content.label, - content.outerDomainValue, - content.XYs1d, - content.axes - } - { - Component::finish(); - } - - // copy - Regions1d(const Regions1d &other) : - Component{ - other, - content.label, - content.outerDomainValue, - content.XYs1d, - content.axes - }, - content{other.content} - { - Component::finish(other); - } - - // move - Regions1d(Regions1d &&other) : - Component{ - other, - content.label, - content.outerDomainValue, - content.XYs1d, - content.axes - }, - content{std::move(other.content)} - { - Component::finish(other); - } - - // from node - Regions1d(const Node &node) : - Component{ - BodyText{}, - content.label, - content.outerDomainValue, - content.XYs1d, - content.axes - } - { - Component::finish(node); - } - - // from fields - explicit Regions1d( - const std::optional &label, - const std::optional &outerDomainValue, - const std::vector &XYs1d, - const std::optional &axes - ) : - Component{ - BodyText{}, - content.label, - content.outerDomainValue, - content.XYs1d, - content.axes - }, - content{ - label, - outerDomainValue, - XYs1d, - axes - } - { - Component::finish(); - } - - // ------------------------ - // Assignment - // ------------------------ - - // copy - Regions1d &operator=(const Regions1d &) = default; - - // move - Regions1d &operator=(Regions1d &&) = default; - - // ------------------------ - // Custom functionality - // ------------------------ - - #include "GNDStk/v1.9/containers/Regions1d/src/custom.hpp" - -}; // class Regions1d - -} // namespace containers -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/src/GNDStk/v1.9/containers/Values.hpp b/src/GNDStk/v1.9/containers/Values.hpp deleted file mode 100644 index 257ea0d1e..000000000 --- a/src/GNDStk/v1.9/containers/Values.hpp +++ /dev/null @@ -1,237 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9_CONTAINERS_VALUES -#define NJOY_GNDSTK_V1_9_CONTAINERS_VALUES - -// core interface -#include "GNDStk.hpp" - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// containers:: -// class Values -// ----------------------------------------------------------------------------- - -namespace containers { - -class Values : public Component { - - - // ------------------------ - // For Component - // ------------------------ - - friend class Component; - - // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "containers"; } - static auto className() { return "Values"; } - static auto GNDSName() { return "values"; } - - // Core Interface multi-query to extract metadata and child nodes - static auto keys() - { - return - // metadata - std::optional{} - / Meta<>("length") | - Defaulted{0} - / Meta<>("start") | - Defaulted{"double"} - / Meta<>("valueType") - ; - } - -public: - - using Component::construct; - using BodyText::operator=; - - // ------------------------ - // Relevant defaults - // FYI for users - // ------------------------ - - static inline const struct Defaults { - static inline const int start = 0; - static inline const std::string valueType = "double"; - } defaults; - - // ------------------------ - // Raw GNDS content - // ------------------------ - - struct { - // metadata - mutable std::optional length; - mutable Defaulted start{0}; - mutable Defaulted valueType{"double"}; - } content; - - // ------------------------ - // Getters - // const and non-const - // ------------------------ - - // length - const std::optional &length() const - { return content.length; } - std::optional &length() - { return content.length; } - - // start - const Defaulted &start() const - { return content.start; } - Defaulted &start() - { return content.start; } - - // valueType - const Defaulted &valueType() const - { return content.valueType; } - Defaulted &valueType() - { return content.valueType; } - - // ------------------------ - // Setters - // non-const - // All return *this - // ------------------------ - - // length(value) - Values &length(const std::optional &obj) - { BodyText::length(length() = obj); return *this; } - - // start(value) - Values &start(const Defaulted &obj) - { BodyText::start(content.start = obj); return *this; } - Values &start(const std::optional &obj) - { BodyText::start(content.start = obj); return *this; } - - // valueType(value) - Values &valueType(const Defaulted &obj) - { BodyText::valueType(content.valueType = obj); return *this; } - Values &valueType(const std::optional &obj) - { BodyText::valueType(content.valueType = obj); return *this; } - - // ------------------------ - // Construction - // ------------------------ - - // default - Values() : - Component{ - BodyText{}, - content.length, - content.start, - content.valueType - } - { - Component::finish(); - } - - // copy - Values(const Values &other) : - Component{ - other, - content.length, - content.start, - content.valueType - }, - content{other.content} - { - Component::finish(other); - } - - // move - Values(Values &&other) : - Component{ - other, - content.length, - content.start, - content.valueType - }, - content{std::move(other.content)} - { - Component::finish(other); - } - - // from node - Values(const Node &node) : - Component{ - BodyText{}, - content.length, - content.start, - content.valueType - } - { - Component::finish(node); - } - - // from fields - // std::optional replaces Defaulted; this class knows the default(s) - explicit Values( - const std::optional &length, - const std::optional &start, - const std::optional &valueType - ) : - Component{ - BodyText{}, - content.length, - content.start, - content.valueType - }, - content{ - length, - Defaulted(defaults.start,start), - Defaulted(defaults.valueType,valueType) - } - { - Component::finish(); - } - - // from vector - template>> - Values(const std::vector &vector) : - Component{ - BodyText{}, - content.length, - content.start, - content.valueType - } - { - Component::finish(vector); - } - - // ------------------------ - // Assignment - // ------------------------ - - // copy - Values &operator=(const Values &) = default; - - // move - Values &operator=(Values &&) = default; - - // ------------------------ - // Custom functionality - // ------------------------ - - #include "GNDStk/v1.9/containers/Values/src/custom.hpp" - -}; // class Values - -} // namespace containers -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/src/GNDStk/v1.9/containers/Values/src/custom.hpp b/src/GNDStk/v1.9/containers/Values/src/custom.hpp deleted file mode 100644 index 562142c21..000000000 --- a/src/GNDStk/v1.9/containers/Values/src/custom.hpp +++ /dev/null @@ -1,60 +0,0 @@ -private: - - static inline helpMap help = { - - { "", "A GNDS basic component: a list of values\n\n" - "This component is used in the nodes like XYs1D or the grid node." }, - { "constructor", "Initialise the values component\n\n" - "Arguments:\n" - " self the values component\n" - " values the values\n" - " start the starting index of the values\n" - " value_type the value type\n" }, - { "length", "The length of the values" }, - { "start", "The starting index of the values (default = 0)" }, - { "value_type", "The value type (default = 'Float64')" }, - { "doubles", "The underlying values" } - }; - - /** - * Custom construct function - */ - void construct() { - - if ( this->length() != std::nullopt ) { - - if ( this->length() != this->size() + this->start() ) { - - log::error( "Inconsistent size for \"values\" array" ); - log::info( "start: {}", this->start() ); - log::info( "length: {}", this->length().value() ); - log::info( "number of values: {}", this->size() ); - throw std::exception(); - } - } - } - -public: - - template < typename T, - typename = std::enable_if_t< - detail::isAlternative< T, VariantOfScalars > > > - Values( const std::optional< int >& length, - const std::optional< int >& start, - const std::optional< std::string >& valueType, - const std::vector< T >& values ) : - Component{ - BodyText{}, - content.length, - content.start, - content.valueType - } - { - - *this = values; - this->length( length ); - this->start( start ); - this->valueType( valueType ); - - Component::finish(); // ensure that construct() gets called - } diff --git a/src/GNDStk/v1.9/containers/XYs1d.hpp b/src/GNDStk/v1.9/containers/XYs1d.hpp deleted file mode 100644 index 6cf404257..000000000 --- a/src/GNDStk/v1.9/containers/XYs1d.hpp +++ /dev/null @@ -1,286 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9_CONTAINERS_XYS1D -#define NJOY_GNDSTK_V1_9_CONTAINERS_XYS1D - -// core interface -#include "GNDStk.hpp" - -// v1.9 dependencies -#include "GNDStk/v1.9/containers/Axes.hpp" -#include "GNDStk/v1.9/containers/Values.hpp" - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// containers:: -// class XYs1d -// ----------------------------------------------------------------------------- - -namespace containers { - -class XYs1d : public Component { - - - // ------------------------ - // For Component - // ------------------------ - - friend class Component; - - // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "containers"; } - static auto className() { return "XYs1d"; } - static auto GNDSName() { return "XYs1d"; } - - // Core Interface multi-query to extract metadata and child nodes - static auto keys() - { - return - // metadata - std::optional{} - / Meta<>("index") | - Defaulted{enums::Interpolation::linlin} - / Meta<>("interpolation") | - std::optional{} - / Meta<>("label") | - std::optional{} - / Meta<>("outerDomainValue") | - // children - std::optional{} - / --Child<>("axes") | - containers::Values{} - / --Child<>("values") - ; - } - -public: - - using Component::construct; - - // ------------------------ - // Relevant defaults - // FYI for users - // ------------------------ - - static inline const struct Defaults { - static inline const enums::Interpolation interpolation = enums::Interpolation::linlin; - } defaults; - - // ------------------------ - // Raw GNDS content - // ------------------------ - - struct { - // metadata - std::optional index; - Defaulted interpolation{enums::Interpolation::linlin}; - std::optional label; - std::optional outerDomainValue; - // children - std::optional axes; - containers::Values values; - } content; - - // ------------------------ - // Getters - // const and non-const - // ------------------------ - - // index - const std::optional &index() const - { return content.index; } - std::optional &index() - { return content.index; } - - // interpolation - const Defaulted &interpolation() const - { return content.interpolation; } - Defaulted &interpolation() - { return content.interpolation; } - - // label - const std::optional &label() const - { return content.label; } - std::optional &label() - { return content.label; } - - // outerDomainValue - const std::optional &outerDomainValue() const - { return content.outerDomainValue; } - std::optional &outerDomainValue() - { return content.outerDomainValue; } - - // axes - const std::optional &axes() const - { return content.axes; } - std::optional &axes() - { return content.axes; } - - // values - const containers::Values &values() const - { return content.values; } - containers::Values &values() - { return content.values; } - - // ------------------------ - // Setters - // non-const - // All return *this - // ------------------------ - - // index(value) - XYs1d &index(const std::optional &obj) - { index() = obj; return *this; } - - // interpolation(value) - XYs1d &interpolation(const Defaulted &obj) - { content.interpolation = obj; return *this; } - XYs1d &interpolation(const std::optional &obj) - { content.interpolation = obj; return *this; } - - // label(value) - XYs1d &label(const std::optional &obj) - { label() = obj; return *this; } - - // outerDomainValue(value) - XYs1d &outerDomainValue(const std::optional &obj) - { outerDomainValue() = obj; return *this; } - - // axes(value) - XYs1d &axes(const std::optional &obj) - { axes() = obj; return *this; } - - // values(value) - XYs1d &values(const containers::Values &obj) - { values() = obj; return *this; } - - // ------------------------ - // Construction - // ------------------------ - - // default - XYs1d() : - Component{ - BodyText{}, - content.index, - content.interpolation, - content.label, - content.outerDomainValue, - content.axes, - content.values - } - { - Component::finish(); - } - - // copy - XYs1d(const XYs1d &other) : - Component{ - other, - content.index, - content.interpolation, - content.label, - content.outerDomainValue, - content.axes, - content.values - }, - content{other.content} - { - Component::finish(other); - } - - // move - XYs1d(XYs1d &&other) : - Component{ - other, - content.index, - content.interpolation, - content.label, - content.outerDomainValue, - content.axes, - content.values - }, - content{std::move(other.content)} - { - Component::finish(other); - } - - // from node - XYs1d(const Node &node) : - Component{ - BodyText{}, - content.index, - content.interpolation, - content.label, - content.outerDomainValue, - content.axes, - content.values - } - { - Component::finish(node); - } - - // from fields - // std::optional replaces Defaulted; this class knows the default(s) - explicit XYs1d( - const std::optional &index, - const std::optional &interpolation, - const std::optional &label, - const std::optional &outerDomainValue, - const std::optional &axes, - const containers::Values &values - ) : - Component{ - BodyText{}, - content.index, - content.interpolation, - content.label, - content.outerDomainValue, - content.axes, - content.values - }, - content{ - index, - Defaulted(defaults.interpolation,interpolation), - label, - outerDomainValue, - axes, - values - } - { - Component::finish(); - } - - // ------------------------ - // Assignment - // ------------------------ - - // copy - XYs1d &operator=(const XYs1d &) = default; - - // move - XYs1d &operator=(XYs1d &&) = default; - - // ------------------------ - // Custom functionality - // ------------------------ - - #include "GNDStk/v1.9/containers/XYs1d/src/custom.hpp" - -}; // class XYs1d - -} // namespace containers -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/src/GNDStk/v1.9/key.hpp b/src/GNDStk/v1.9/key.hpp deleted file mode 100644 index 214b239e0..000000000 --- a/src/GNDStk/v1.9/key.hpp +++ /dev/null @@ -1,114 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -/* -This file contains Meta and Child objects for metadata and child nodes in the -current GNDS version. These may prove to be useful if you wish to use the Core -Interface in conjunction with the autogenerated classes for this GNDS version. - -Within the outer njoy::GNDStk::version namespace below, the remaining namespace -arrangement was chosen to make the use of these objects smooth and logical. - -Meta and Child objects are collectively called "keys." Meta keys are placed -into key::meta. Child keys correspond to autogenerated classes, each of which -is already in some namespace; we thus use theNamespace::key::child::. That way, -an autogenerated class [ns::Foo] has [ns::key::foo] as its Child object, and -a "using namespace ns" allows the class and the Child object to be [Foo] and -[key::foo], respectively. (If we reordered ns:: and key::, that wouldn't work.) - -Within key::, we use meta:: and child:: around Meta and Child objects, just in -case there exist any identical GNDS metadata names and child-node names. (That -can, in fact, happen). The "using namespace meta" and "using namespace child" -directives then make the Meta<> and Child<> objects appear directly in key::, -so that "meta::" and "child::" are needed only to disambiguate identical names. -*/ - -#ifndef NJOY_GNDSTK_V1_9_KEY -#define NJOY_GNDSTK_V1_9_KEY - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - - -// ----------------------------------------------------------------------------- -// key::meta:: -// ----------------------------------------------------------------------------- - -namespace key { -namespace meta { - -inline const Meta<> ENDF_MT("ENDF_MT"); -inline const Meta<> evaluation("evaluation"); -inline const Meta<> fissionGenre("fissionGenre"); -inline const Meta<> format("format"); -inline const Meta<> href("href"); -inline const Meta<> index("index"); -inline const Meta<> interaction("interaction"); -inline const Meta<> interpolation("interpolation"); -inline const Meta<> label("label"); -inline const Meta<> length("length"); -inline const Meta<> outerDomainValue("outerDomainValue"); -inline const Meta<> projectile("projectile"); -inline const Meta<> projectileFrame("projectileFrame"); -inline const Meta<> start("start"); -inline const Meta<> style("style"); -inline const Meta<> target("target"); -inline const Meta<> unit("unit"); -inline const Meta<> valueType("valueType"); - -} // namespace meta -using namespace meta; -} // namespace key - - -// ----------------------------------------------------------------------------- -// containers::key::child:: -// ----------------------------------------------------------------------------- - -namespace containers { -namespace key { -namespace child { - -inline const Child<> XYs1d("XYs1d"); -inline const Child<> axes("axes"); -inline const Child<> axis("axis"); -inline const Child<> grid("grid"); -inline const Child<> link("link"); -inline const Child<> regions1d("regions1d"); -inline const Child<> values("values"); - -} // namespace child -using namespace child; -} // namespace key -} // namespace containers - - -// ----------------------------------------------------------------------------- -// transport::key::child:: -// ----------------------------------------------------------------------------- - -namespace transport { -namespace key { -namespace child { - -inline const Child<> crossSection("crossSection"); -inline const Child<> reaction("reaction"); -inline const Child<> reactionSuite("reactionSuite"); -inline const Child<> reactions("reactions"); - -} // namespace child -using namespace child; -} // namespace key -} // namespace transport - - -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- - -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/src/GNDStk/v1.9/transport/CrossSection.hpp b/src/GNDStk/v1.9/transport/CrossSection.hpp deleted file mode 100644 index 12aeb298f..000000000 --- a/src/GNDStk/v1.9/transport/CrossSection.hpp +++ /dev/null @@ -1,272 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9_TRANSPORT_CROSSSECTION -#define NJOY_GNDSTK_V1_9_TRANSPORT_CROSSSECTION - -// core interface -#include "GNDStk.hpp" - -// v1.9 dependencies -#include "GNDStk/v1.9/containers/XYs1d.hpp" -#include "GNDStk/v1.9/containers/Regions1d.hpp" - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// transport:: -// class CrossSection -// ----------------------------------------------------------------------------- - -namespace transport { - -class CrossSection : public Component { - - using XYs1d_regions1d_t = std::variant< - containers::XYs1d, - containers::Regions1d - >; - - // ------------------------ - // For Component - // ------------------------ - - friend class Component; - - // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "transport"; } - static auto className() { return "CrossSection"; } - static auto GNDSName() { return "crossSection"; } - - // Core Interface multi-query to extract metadata and child nodes - static auto keys() - { - return - // children - XYs1d_regions1d_t{} - / ++(Child<>("XYs1d") || Child<>("regions1d")) - ; - } - -public: - - using Component::construct; - - // ------------------------ - // Relevant defaults - // FYI for users - // ------------------------ - - static inline const struct Defaults { - } defaults; - - // ------------------------ - // Raw GNDS content - // ------------------------ - - struct { - // children - variant - std::vector XYs1d_regions1d; - } content; - - // ------------------------ - // Getters - // const and non-const - // ------------------------ - - // XYs1d_regions1d - const std::vector &XYs1d_regions1d() const - { return content.XYs1d_regions1d; } - std::vector &XYs1d_regions1d() - { return content.XYs1d_regions1d; } - - // XYs1d_regions1d(index) - const XYs1d_regions1d_t &XYs1d_regions1d(const std::size_t index) const - { return getter(XYs1d_regions1d(), index, "XYs1d_regions1d"); } - XYs1d_regions1d_t &XYs1d_regions1d(const std::size_t index) - { return getter(XYs1d_regions1d(), index, "XYs1d_regions1d"); } - - // XYs1d_regions1d(label) - const XYs1d_regions1d_t &XYs1d_regions1d(const std::string &label) const - { return getter(XYs1d_regions1d(), label, "XYs1d_regions1d"); } - XYs1d_regions1d_t &XYs1d_regions1d(const std::string &label) - { return getter(XYs1d_regions1d(), label, "XYs1d_regions1d"); } - - // XYs1d(index) - const containers::XYs1d *XYs1d(const std::size_t index) const - { return getter(XYs1d_regions1d(), index, "XYs1d"); } - containers::XYs1d *XYs1d(const std::size_t index) - { return getter(XYs1d_regions1d(), index, "XYs1d"); } - - // XYs1d(label) - const containers::XYs1d *XYs1d(const std::string &label) const - { return getter(XYs1d_regions1d(), label, "XYs1d"); } - containers::XYs1d *XYs1d(const std::string &label) - { return getter(XYs1d_regions1d(), label, "XYs1d"); } - - // regions1d(index) - const containers::Regions1d *regions1d(const std::size_t index) const - { return getter(XYs1d_regions1d(), index, "regions1d"); } - containers::Regions1d *regions1d(const std::size_t index) - { return getter(XYs1d_regions1d(), index, "regions1d"); } - - // regions1d(label) - const containers::Regions1d *regions1d(const std::string &label) const - { return getter(XYs1d_regions1d(), label, "regions1d"); } - containers::Regions1d *regions1d(const std::string &label) - { return getter(XYs1d_regions1d(), label, "regions1d"); } - - // ------------------------ - // Setters - // non-const - // All return *this - // ------------------------ - - // XYs1d_regions1d(value) - CrossSection &XYs1d_regions1d(const std::vector &obj) - { XYs1d_regions1d() = obj; return *this; } - - // XYs1d_regions1d(index,value) - CrossSection &XYs1d_regions1d( - const std::size_t index, - const XYs1d_regions1d_t &obj - ) { - XYs1d_regions1d(index) = obj; return *this; - } - - // XYs1d_regions1d(label,value) - CrossSection &XYs1d_regions1d( - const std::string &label, - const XYs1d_regions1d_t &obj - ) { - XYs1d_regions1d(label) = obj; return *this; - } - - // XYs1d(index,value) - CrossSection &XYs1d( - const std::size_t index, - const std::optional &obj - ) { - if (obj) XYs1d_regions1d(index,obj.value()); - return *this; - } - - // XYs1d(label,value) - CrossSection &XYs1d( - const std::string &label, - const std::optional &obj - ) { - if (obj) XYs1d_regions1d(label,obj.value()); - return *this; - } - - // regions1d(index,value) - CrossSection ®ions1d( - const std::size_t index, - const std::optional &obj - ) { - if (obj) XYs1d_regions1d(index,obj.value()); - return *this; - } - - // regions1d(label,value) - CrossSection ®ions1d( - const std::string &label, - const std::optional &obj - ) { - if (obj) XYs1d_regions1d(label,obj.value()); - return *this; - } - - // ------------------------ - // Construction - // ------------------------ - - // default - CrossSection() : - Component{ - BodyText{}, - content.XYs1d_regions1d - } - { - Component::finish(); - } - - // copy - CrossSection(const CrossSection &other) : - Component{ - other, - content.XYs1d_regions1d - }, - content{other.content} - { - Component::finish(other); - } - - // move - CrossSection(CrossSection &&other) : - Component{ - other, - content.XYs1d_regions1d - }, - content{std::move(other.content)} - { - Component::finish(other); - } - - // from node - CrossSection(const Node &node) : - Component{ - BodyText{}, - content.XYs1d_regions1d - } - { - Component::finish(node); - } - - // from fields - explicit CrossSection( - const std::vector &XYs1d_regions1d - ) : - Component{ - BodyText{}, - content.XYs1d_regions1d - }, - content{ - XYs1d_regions1d - } - { - Component::finish(); - } - - // ------------------------ - // Assignment - // ------------------------ - - // copy - CrossSection &operator=(const CrossSection &) = default; - - // move - CrossSection &operator=(CrossSection &&) = default; - - // ------------------------ - // Custom functionality - // ------------------------ - - #include "GNDStk/v1.9/transport/CrossSection/src/custom.hpp" - -}; // class CrossSection - -} // namespace transport -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/src/GNDStk/v1.9/transport/Reaction.hpp b/src/GNDStk/v1.9/transport/Reaction.hpp deleted file mode 100644 index bb15a3f88..000000000 --- a/src/GNDStk/v1.9/transport/Reaction.hpp +++ /dev/null @@ -1,241 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9_TRANSPORT_REACTION -#define NJOY_GNDSTK_V1_9_TRANSPORT_REACTION - -// core interface -#include "GNDStk.hpp" - -// v1.9 dependencies -#include "GNDStk/v1.9/transport/CrossSection.hpp" - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// transport:: -// class Reaction -// ----------------------------------------------------------------------------- - -namespace transport { - -class Reaction : public Component { - - - // ------------------------ - // For Component - // ------------------------ - - friend class Component; - - // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "transport"; } - static auto className() { return "Reaction"; } - static auto GNDSName() { return "reaction"; } - - // Core Interface multi-query to extract metadata and child nodes - static auto keys() - { - return - // metadata - int{} - / Meta<>("ENDF_MT") | - std::optional{} - / Meta<>("fissionGenre") | - std::string{} - / Meta<>("label") | - // children - transport::CrossSection{} - / --Child<>("crossSection") - ; - } - -public: - - using Component::construct; - - // ------------------------ - // Relevant defaults - // FYI for users - // ------------------------ - - static inline const struct Defaults { - } defaults; - - // ------------------------ - // Raw GNDS content - // ------------------------ - - struct { - // metadata - int ENDF_MT; - std::optional fissionGenre; - std::string label; - // children - transport::CrossSection crossSection; - } content; - - // ------------------------ - // Getters - // const and non-const - // ------------------------ - - // ENDF_MT - const int &ENDF_MT() const - { return content.ENDF_MT; } - int &ENDF_MT() - { return content.ENDF_MT; } - - // fissionGenre - const std::optional &fissionGenre() const - { return content.fissionGenre; } - std::optional &fissionGenre() - { return content.fissionGenre; } - - // label - const std::string &label() const - { return content.label; } - std::string &label() - { return content.label; } - - // crossSection - const transport::CrossSection &crossSection() const - { return content.crossSection; } - transport::CrossSection &crossSection() - { return content.crossSection; } - - // ------------------------ - // Setters - // non-const - // All return *this - // ------------------------ - - // ENDF_MT(value) - Reaction &ENDF_MT(const int &obj) - { ENDF_MT() = obj; return *this; } - - // fissionGenre(value) - Reaction &fissionGenre(const std::optional &obj) - { fissionGenre() = obj; return *this; } - - // label(value) - Reaction &label(const std::string &obj) - { label() = obj; return *this; } - - // crossSection(value) - Reaction &crossSection(const transport::CrossSection &obj) - { crossSection() = obj; return *this; } - - // ------------------------ - // Construction - // ------------------------ - - // default - Reaction() : - Component{ - BodyText{}, - content.ENDF_MT, - content.fissionGenre, - content.label, - content.crossSection - } - { - Component::finish(); - } - - // copy - Reaction(const Reaction &other) : - Component{ - other, - content.ENDF_MT, - content.fissionGenre, - content.label, - content.crossSection - }, - content{other.content} - { - Component::finish(other); - } - - // move - Reaction(Reaction &&other) : - Component{ - other, - content.ENDF_MT, - content.fissionGenre, - content.label, - content.crossSection - }, - content{std::move(other.content)} - { - Component::finish(other); - } - - // from node - Reaction(const Node &node) : - Component{ - BodyText{}, - content.ENDF_MT, - content.fissionGenre, - content.label, - content.crossSection - } - { - Component::finish(node); - } - - // from fields - explicit Reaction( - const int &ENDF_MT, - const std::optional &fissionGenre, - const std::string &label, - const transport::CrossSection &crossSection - ) : - Component{ - BodyText{}, - content.ENDF_MT, - content.fissionGenre, - content.label, - content.crossSection - }, - content{ - ENDF_MT, - fissionGenre, - label, - crossSection - } - { - Component::finish(); - } - - // ------------------------ - // Assignment - // ------------------------ - - // copy - Reaction &operator=(const Reaction &) = default; - - // move - Reaction &operator=(Reaction &&) = default; - - // ------------------------ - // Custom functionality - // ------------------------ - - #include "GNDStk/v1.9/transport/Reaction/src/custom.hpp" - -}; // class Reaction - -} // namespace transport -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/src/GNDStk/v1.9/transport/ReactionSuite.hpp b/src/GNDStk/v1.9/transport/ReactionSuite.hpp deleted file mode 100644 index 86601b7d2..000000000 --- a/src/GNDStk/v1.9/transport/ReactionSuite.hpp +++ /dev/null @@ -1,301 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9_TRANSPORT_REACTIONSUITE -#define NJOY_GNDSTK_V1_9_TRANSPORT_REACTIONSUITE - -// core interface -#include "GNDStk.hpp" - -// v1.9 dependencies -#include "GNDStk/v1.9/transport/Reactions.hpp" - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// transport:: -// class ReactionSuite -// ----------------------------------------------------------------------------- - -namespace transport { - -class ReactionSuite : public Component { - - - // ------------------------ - // For Component - // ------------------------ - - friend class Component; - - // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "transport"; } - static auto className() { return "ReactionSuite"; } - static auto GNDSName() { return "reactionSuite"; } - - // Core Interface multi-query to extract metadata and child nodes - static auto keys() - { - return - // metadata - std::string{} - / Meta<>("evaluation") | - std::string{} - / Meta<>("format") | - std::optional{} - / Meta<>("interaction") | - std::string{} - / Meta<>("projectile") | - enums::Frame{} - / Meta<>("projectileFrame") | - std::string{} - / Meta<>("target") | - // children - std::optional{} - / --Child<>("reactions") - ; - } - -public: - - using Component::construct; - - // ------------------------ - // Relevant defaults - // FYI for users - // ------------------------ - - static inline const struct Defaults { - } defaults; - - // ------------------------ - // Raw GNDS content - // ------------------------ - - struct { - // metadata - std::string evaluation; - std::string format; - std::optional interaction; - std::string projectile; - enums::Frame projectileFrame; - std::string target; - // children - std::optional reactions; - } content; - - // ------------------------ - // Getters - // const and non-const - // ------------------------ - - // evaluation - const std::string &evaluation() const - { return content.evaluation; } - std::string &evaluation() - { return content.evaluation; } - - // format - const std::string &format() const - { return content.format; } - std::string &format() - { return content.format; } - - // interaction - const std::optional &interaction() const - { return content.interaction; } - std::optional &interaction() - { return content.interaction; } - - // projectile - const std::string &projectile() const - { return content.projectile; } - std::string &projectile() - { return content.projectile; } - - // projectileFrame - const enums::Frame &projectileFrame() const - { return content.projectileFrame; } - enums::Frame &projectileFrame() - { return content.projectileFrame; } - - // target - const std::string &target() const - { return content.target; } - std::string &target() - { return content.target; } - - // reactions - const std::optional &reactions() const - { return content.reactions; } - std::optional &reactions() - { return content.reactions; } - - // ------------------------ - // Setters - // non-const - // All return *this - // ------------------------ - - // evaluation(value) - ReactionSuite &evaluation(const std::string &obj) - { evaluation() = obj; return *this; } - - // format(value) - ReactionSuite &format(const std::string &obj) - { format() = obj; return *this; } - - // interaction(value) - ReactionSuite &interaction(const std::optional &obj) - { interaction() = obj; return *this; } - - // projectile(value) - ReactionSuite &projectile(const std::string &obj) - { projectile() = obj; return *this; } - - // projectileFrame(value) - ReactionSuite &projectileFrame(const enums::Frame &obj) - { projectileFrame() = obj; return *this; } - - // target(value) - ReactionSuite &target(const std::string &obj) - { target() = obj; return *this; } - - // reactions(value) - ReactionSuite &reactions(const std::optional &obj) - { reactions() = obj; return *this; } - - // ------------------------ - // Construction - // ------------------------ - - // default - ReactionSuite() : - Component{ - BodyText{}, - content.evaluation, - content.format, - content.interaction, - content.projectile, - content.projectileFrame, - content.target, - content.reactions - } - { - Component::finish(); - } - - // copy - ReactionSuite(const ReactionSuite &other) : - Component{ - other, - content.evaluation, - content.format, - content.interaction, - content.projectile, - content.projectileFrame, - content.target, - content.reactions - }, - content{other.content} - { - Component::finish(other); - } - - // move - ReactionSuite(ReactionSuite &&other) : - Component{ - other, - content.evaluation, - content.format, - content.interaction, - content.projectile, - content.projectileFrame, - content.target, - content.reactions - }, - content{std::move(other.content)} - { - Component::finish(other); - } - - // from node - ReactionSuite(const Node &node) : - Component{ - BodyText{}, - content.evaluation, - content.format, - content.interaction, - content.projectile, - content.projectileFrame, - content.target, - content.reactions - } - { - Component::finish(node); - } - - // from fields - explicit ReactionSuite( - const std::string &evaluation, - const std::string &format, - const std::optional &interaction, - const std::string &projectile, - const enums::Frame &projectileFrame, - const std::string &target, - const std::optional &reactions - ) : - Component{ - BodyText{}, - content.evaluation, - content.format, - content.interaction, - content.projectile, - content.projectileFrame, - content.target, - content.reactions - }, - content{ - evaluation, - format, - interaction, - projectile, - projectileFrame, - target, - reactions - } - { - Component::finish(); - } - - // ------------------------ - // Assignment - // ------------------------ - - // copy - ReactionSuite &operator=(const ReactionSuite &) = default; - - // move - ReactionSuite &operator=(ReactionSuite &&) = default; - - // ------------------------ - // Custom functionality - // ------------------------ - - #include "GNDStk/v1.9/transport/ReactionSuite/src/custom.hpp" - -}; // class ReactionSuite - -} // namespace transport -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/src/GNDStk/v1.9/transport/Reactions.hpp b/src/GNDStk/v1.9/transport/Reactions.hpp deleted file mode 100644 index bf92b5bdc..000000000 --- a/src/GNDStk/v1.9/transport/Reactions.hpp +++ /dev/null @@ -1,207 +0,0 @@ - -// THIS FILE WAS AUTOGENERATED! -// DO NOT MODIFY! - -#ifndef NJOY_GNDSTK_V1_9_TRANSPORT_REACTIONS -#define NJOY_GNDSTK_V1_9_TRANSPORT_REACTIONS - -// core interface -#include "GNDStk.hpp" - -// v1.9 dependencies -#include "GNDStk/v1.9/transport/Reaction.hpp" - -namespace njoy { -namespace GNDStk { -namespace v1_9 { - -using namespace njoy::GNDStk::core; - - - -// ----------------------------------------------------------------------------- -// transport:: -// class Reactions -// ----------------------------------------------------------------------------- - -namespace transport { - -class Reactions : public Component { - - - // ------------------------ - // For Component - // ------------------------ - - friend class Component; - - // Current namespace, current class, and GNDS node name - static auto namespaceName() { return "transport"; } - static auto className() { return "Reactions"; } - static auto GNDSName() { return "reactions"; } - - // Core Interface multi-query to extract metadata and child nodes - static auto keys() - { - return - // children - transport::Reaction{} - / ++Child<>("reaction") - ; - } - -public: - - using Component::construct; - - // ------------------------ - // Relevant defaults - // FYI for users - // ------------------------ - - static inline const struct Defaults { - } defaults; - - // ------------------------ - // Raw GNDS content - // ------------------------ - - struct { - // children - std::vector reaction; - } content; - - // ------------------------ - // Getters - // const and non-const - // ------------------------ - - // reaction - const std::vector &reaction() const - { return content.reaction; } - std::vector &reaction() - { return content.reaction; } - - // reaction(index) - const transport::Reaction &reaction(const std::size_t index) const - { return getter(reaction(), index, "reaction"); } - transport::Reaction &reaction(const std::size_t index) - { return getter(reaction(), index, "reaction"); } - - // reaction(label) - const transport::Reaction &reaction(const std::string &label) const - { return getter(reaction(), label, "reaction"); } - transport::Reaction &reaction(const std::string &label) - { return getter(reaction(), label, "reaction"); } - - // ------------------------ - // Setters - // non-const - // All return *this - // ------------------------ - - // reaction(value) - Reactions &reaction(const std::vector &obj) - { reaction() = obj; return *this; } - - // reaction(index,value) - Reactions &reaction( - const std::size_t index, - const transport::Reaction &obj - ) { - reaction(index) = obj; return *this; - } - - // reaction(label,value) - Reactions &reaction( - const std::string &label, - const transport::Reaction &obj - ) { - reaction(label) = obj; return *this; - } - - // ------------------------ - // Construction - // ------------------------ - - // default - Reactions() : - Component{ - BodyText{}, - content.reaction - } - { - Component::finish(); - } - - // copy - Reactions(const Reactions &other) : - Component{ - other, - content.reaction - }, - content{other.content} - { - Component::finish(other); - } - - // move - Reactions(Reactions &&other) : - Component{ - other, - content.reaction - }, - content{std::move(other.content)} - { - Component::finish(other); - } - - // from node - Reactions(const Node &node) : - Component{ - BodyText{}, - content.reaction - } - { - Component::finish(node); - } - - // from fields - explicit Reactions( - const std::vector &reaction - ) : - Component{ - BodyText{}, - content.reaction - }, - content{ - reaction - } - { - Component::finish(); - } - - // ------------------------ - // Assignment - // ------------------------ - - // copy - Reactions &operator=(const Reactions &) = default; - - // move - Reactions &operator=(Reactions &&) = default; - - // ------------------------ - // Custom functionality - // ------------------------ - - #include "GNDStk/v1.9/transport/Reactions/src/custom.hpp" - -}; // class Reactions - -} // namespace transport -} // namespace v1_9 -} // namespace GNDStk -} // namespace njoy - -#endif diff --git a/versions/GNDS-v2.0/.gitignore b/versions/GNDS-v2.0/.gitignore new file mode 100644 index 000000000..c9237e44b --- /dev/null +++ b/versions/GNDS-v2.0/.gitignore @@ -0,0 +1,12 @@ + +m +j +p +v +deps +*.o +out +[12]* +notes +GNDStk +*.mod diff --git a/versions/GNDS-v2.0/1.cpp b/versions/GNDS-v2.0/1.cpp new file mode 100644 index 000000000..3504b2e86 --- /dev/null +++ b/versions/GNDS-v2.0/1.cpp @@ -0,0 +1,44 @@ + +#include "GNDS/v2.0.hpp" +using namespace GNDS; +using namespace v2_0; + +// Run this code with any or all GNDS 2.0 files as command-line arguments +int main(const int argc, const char *const *const argv) +{ + for (int i = 1; i < argc; ++i) { + const std::string file = argv[i]; + std::cout << "File: " << file << std::endl; + + try { + // Read node from file. + Node node; + node.read(file); + std::cout << " " << node.name << std::endl; + + // Read object from node. We *can* read an object directly from a file, + // not merely from a node, if we already know what kind of node is in + // the file. Here, in the context of reading any GNDS 2.0 file, we must + // examine the top-level node in order to determine what kind of object + // we're dealing with. + if (node.name == "reactionSuite") { + top::ReactionSuite obj; + obj.read(node); + } else if (node.name == "covarianceSuite") { + top::CovarianceSuite obj; + obj.read(node); + } else if (node.name == "PoPs") { + top::PoPs obj; + obj.read(node); + } else if (node.name == "fissionFragmentData") { + top::FissionFragmentData obj; + obj.read(node); + } else { + std::cout << "This shouldn't happen" << std::endl; + } + } catch (...) { + if (i < argc-1) + std::cout << "\nContinuing to the next file...\n" << std::endl; + } + } +} diff --git a/versions/GNDS-v2.0/2.cpp b/versions/GNDS-v2.0/2.cpp new file mode 100644 index 000000000..af9853246 --- /dev/null +++ b/versions/GNDS-v2.0/2.cpp @@ -0,0 +1,49 @@ + +#include "GNDS/v2.0.hpp" +using namespace GNDS; +using namespace v2_0; + +int main(const int argc, const char *const *const argv) +{ + // For prettyprinting: + colors = true; // Use color markup. + shades = true; // Colorize array values based on relative intensity. + indent = 3; // Indent by this number of spaces. + printMode = PrintMode::python; + elements = 10; + + for (int i = 1; i < argc; ++i) { + // Assume here that it's a . Note that where an XML node + // is named foo (lower-case 'f'), its *class* in the generated code will + // be named Foo (upper-case 'F'). Fields - data members in the class - + // will have lower-case names again. So, for this ReactionSuite r (from + // the XML node, we'll have, for example, r.reactions, + // of class Reactions, for the XML node . Technically we use + // a Field, where Field is a wrapper class that the generated + // code uses for a number of purposes. (That's why we write r.reactions(), + // with those () parenthesis, below, instead of r.reactions. This is + // something to talk about.) + top::ReactionSuite r; + + // Read from the given file. Note that we SHOULD NOT try to *construct* + // like this above: + // top::ReactionSuite r(argv[i]); + // because this doesn't actually mean, "read from that file," but means + // something else (both for ReactionSuite, and in general for generated + // classes). In particular, it tries to initialize the class fields by + // using the parameters. ReactionSuite's first field (aside from the + // boilerplate "comment" field we always add, and which doesn't play + // a role in the constructors) happens to be the metadatum "projectile". + // So, writing top::ReactionSuite r(argv[i]) would inadvertently create + // an otherwise blank ReactionSuite but with metadatum projectile equal + // to whatever name is in argv[i]. We don't want that here, because the + // argv entries are intended to be file names in this example code! + r.read(argv[i]); + + // Prettyprint the entire ReactionSuite. + r.print(); + + // Prettyprint just the portion. + r.reactions().print(); // <== ask me about the () business + } +} diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0.h new file mode 100644 index 000000000..89e0bc253 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0.h @@ -0,0 +1,313 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// ----------------------------------------------------------------------------- +// This header file is designed to work with both C and C++ +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0 +#define C_INTERFACE_GNDS_V2_0 + +#include "GNDStk.h" + +#ifdef __cplusplus + // For C++ + #include "GNDS/v2.0.hpp" +#endif + +#include "v2.0/general/Add.h" +#include "v2.0/general/Alias.h" +#include "v2.0/general/Aliases.h" +#include "v2.0/general/Angular.h" +#include "v2.0/general/AngularEnergy.h" +#include "v2.0/general/AngularTwoBody.h" +#include "v2.0/general/ApplicationData.h" + +#include "v2.0/g2d/Array.h" + +#include "v2.0/g3d/Array.h" + +#include "v2.0/general/Array.h" +#include "v2.0/general/Atomic.h" +#include "v2.0/general/Author.h" +#include "v2.0/general/Authors.h" +#include "v2.0/general/AverageEnergies.h" +#include "v2.0/general/AverageEnergy.h" +#include "v2.0/general/AverageParameterCovariance.h" +#include "v2.0/general/AverageProductEnergy.h" +#include "v2.0/general/Axes.h" +#include "v2.0/general/Axis.h" +#include "v2.0/general/Background.h" +#include "v2.0/general/Baryon.h" +#include "v2.0/general/Baryons.h" +#include "v2.0/general/BindingEnergy.h" +#include "v2.0/general/Body.h" +#include "v2.0/general/BoundAtomCrossSection.h" +#include "v2.0/general/Branching1d.h" +#include "v2.0/general/Branching3d.h" +#include "v2.0/general/BreitWigner.h" +#include "v2.0/general/Channel.h" +#include "v2.0/general/Channels.h" +#include "v2.0/general/Charge.h" +#include "v2.0/general/ChemicalElement.h" +#include "v2.0/general/ChemicalElements.h" +#include "v2.0/general/CoherentPhotonScattering.h" +#include "v2.0/general/Column.h" +#include "v2.0/general/ColumnData.h" +#include "v2.0/general/ColumnHeaders.h" +#include "v2.0/general/Configuration.h" +#include "v2.0/general/Configurations.h" +#include "v2.0/general/Constant1d.h" +#include "v2.0/general/Continuum.h" +#include "v2.0/general/Conversion.h" +#include "v2.0/general/CoulombPlusNuclearElastic.h" +#include "v2.0/general/Covariance.h" +#include "v2.0/general/CovarianceMatrix.h" +#include "v2.0/general/CovarianceSection.h" +#include "v2.0/general/CovarianceSections.h" + +#include "v2.0/top/CovarianceSuite.h" + +#include "v2.0/general/CrossSection.h" + +#include "v2.0/reduced/CrossSection.h" + +#include "v2.0/general/CrossSectionReconstructed.h" +#include "v2.0/general/CrossSectionSum.h" +#include "v2.0/general/CrossSectionSums.h" +#include "v2.0/general/Data.h" +#include "v2.0/general/Date.h" +#include "v2.0/general/Dates.h" +#include "v2.0/general/DebyeWallerIntegral.h" +#include "v2.0/general/Decay.h" +#include "v2.0/general/DecayData.h" +#include "v2.0/general/DecayMode.h" +#include "v2.0/general/DecayModes.h" +#include "v2.0/general/DecayPath.h" +#include "v2.0/general/DelayedBetaEnergy.h" +#include "v2.0/general/DelayedGammaEnergy.h" +#include "v2.0/general/DelayedNeutron.h" +#include "v2.0/general/DelayedNeutronKE.h" +#include "v2.0/general/DelayedNeutrons.h" +#include "v2.0/general/Discrete.h" +#include "v2.0/general/DiscreteGamma.h" +#include "v2.0/general/Distribution.h" + +#include "v2.0/reduced/Distribution.h" + +#include "v2.0/general/Documentation.h" +#include "v2.0/general/Double.h" + +#include "v2.0/reduced/Double.h" + +#include "v2.0/general/DoubleDifferentialCrossSection.h" +#include "v2.0/general/EFH.h" +#include "v2.0/general/EFL.h" +#include "v2.0/general/ENDFconversionFlags.h" +#include "v2.0/general/E_critical.h" +#include "v2.0/general/E_max.h" +#include "v2.0/general/ElapsedTime.h" +#include "v2.0/general/ElapsedTimes.h" +#include "v2.0/general/EndfCompatible.h" +#include "v2.0/general/Energy.h" +#include "v2.0/general/EnergyAngular.h" +#include "v2.0/general/Evaluated.h" +#include "v2.0/general/Evaporation.h" +#include "v2.0/general/ExternalFile.h" +#include "v2.0/general/ExternalFiles.h" +#include "v2.0/general/F.h" +#include "v2.0/general/FastRegion.h" +#include "v2.0/general/FissionComponent.h" +#include "v2.0/general/FissionComponents.h" +#include "v2.0/general/FissionEnergyRelease.h" +#include "v2.0/general/FissionEnergyReleases.h" + +#include "v2.0/top/FissionFragmentData.h" + +#include "v2.0/general/FormFactor.h" +#include "v2.0/general/Fraction.h" +#include "v2.0/general/FreeGasApproximation.h" +#include "v2.0/general/Function1ds.h" + +#include "v2.0/reduced/Function1ds.h" + +#include "v2.0/general/Function2ds.h" +#include "v2.0/general/G.h" +#include "v2.0/general/GaugeBoson.h" +#include "v2.0/general/GaugeBosons.h" +#include "v2.0/general/GeneralEvaporation.h" +#include "v2.0/general/Grid.h" +#include "v2.0/general/Gridded2d.h" +#include "v2.0/general/Gridded3d.h" +#include "v2.0/general/Halflife.h" +#include "v2.0/general/HardSphereRadius.h" +#include "v2.0/general/ImaginaryAnomalousFactor.h" +#include "v2.0/general/ImaginaryInterferenceTerm.h" +#include "v2.0/general/IncidentEnergies.h" +#include "v2.0/general/IncidentEnergy.h" +#include "v2.0/general/IncoherentPhotonScattering.h" +#include "v2.0/general/IncompleteReactions.h" +#include "v2.0/general/Institution.h" +#include "v2.0/general/Integer.h" +#include "v2.0/general/Intensity.h" +#include "v2.0/general/InternalConversionCoefficients.h" +#include "v2.0/general/Isotope.h" +#include "v2.0/general/Isotopes.h" +#include "v2.0/general/Isotropic2d.h" +#include "v2.0/general/J.h" +#include "v2.0/general/Js.h" +#include "v2.0/general/KalbachMann.h" +#include "v2.0/general/L.h" +#include "v2.0/general/Legendre.h" + +#include "v2.0/g3d/Lengths.h" + +#include "v2.0/general/Lepton.h" +#include "v2.0/general/Leptons.h" +#include "v2.0/general/LevelSpacing.h" +#include "v2.0/general/Link.h" +#include "v2.0/general/ListOfCovariances.h" +#include "v2.0/general/Ls.h" +#include "v2.0/general/MadlandNix.h" +#include "v2.0/general/Mass.h" +#include "v2.0/general/MetaStable.h" +#include "v2.0/general/Mixed.h" +#include "v2.0/general/Multiplicity.h" +#include "v2.0/general/MultiplicitySum.h" +#include "v2.0/general/MultiplicitySums.h" +#include "v2.0/general/NBodyPhaseSpace.h" +#include "v2.0/general/NeutrinoEnergy.h" +#include "v2.0/general/NonNeutrinoEnergy.h" +#include "v2.0/general/NuclearAmplitudeExpansion.h" +#include "v2.0/general/NuclearPlusInterference.h" +#include "v2.0/general/NuclearTerm.h" +#include "v2.0/general/Nucleus.h" +#include "v2.0/general/Nuclide.h" +#include "v2.0/general/Nuclides.h" + +#include "v2.0/reduced/Nuclides.h" + +#include "v2.0/general/OrphanProduct.h" +#include "v2.0/general/OrphanProducts.h" +#include "v2.0/general/OutputChannel.h" + +#include "v2.0/reduced/OutputChannel.h" + +#include "v2.0/general/ParameterCovariance.h" +#include "v2.0/general/ParameterCovarianceMatrix.h" +#include "v2.0/general/ParameterCovariances.h" +#include "v2.0/general/ParameterLink.h" +#include "v2.0/general/Parameters.h" +#include "v2.0/general/Parity.h" +#include "v2.0/general/PhotonEmissionProbabilities.h" + +#include "v2.0/top/PoPs.h" + +#include "v2.0/general/Polynomial1d.h" + +#include "v2.0/reduced/Polynomial1d.h" + +#include "v2.0/general/PositronEmissionIntensity.h" +#include "v2.0/general/PrimaryGamma.h" +#include "v2.0/general/Probability.h" +#include "v2.0/general/Product.h" + +#include "v2.0/reduced/Product.h" + +#include "v2.0/general/ProductYield.h" +#include "v2.0/general/ProductYields.h" +#include "v2.0/general/Production.h" +#include "v2.0/general/Productions.h" +#include "v2.0/general/Products.h" + +#include "v2.0/reduced/Products.h" + +#include "v2.0/general/ProjectileEnergyDomain.h" +#include "v2.0/general/PromptGammaEnergy.h" +#include "v2.0/general/PromptNeutronKE.h" +#include "v2.0/general/PromptProductKE.h" +#include "v2.0/general/Q.h" +#include "v2.0/general/R.h" +#include "v2.0/general/RMatrix.h" +#include "v2.0/general/Rate.h" +#include "v2.0/general/Reaction.h" + +#include "v2.0/top/ReactionSuite.h" + +#include "v2.0/general/Reactions.h" +#include "v2.0/general/RealAnomalousFactor.h" +#include "v2.0/general/RealInterferenceTerm.h" +#include "v2.0/general/Recoil.h" +#include "v2.0/general/Reference.h" +#include "v2.0/general/Regions1d.h" +#include "v2.0/general/Regions2d.h" +#include "v2.0/general/Resolved.h" +#include "v2.0/general/ResolvedRegion.h" +#include "v2.0/general/ResonanceParameters.h" +#include "v2.0/general/ResonanceReaction.h" +#include "v2.0/general/ResonanceReactions.h" +#include "v2.0/general/Resonances.h" +#include "v2.0/general/ResonancesWithBackground.h" +#include "v2.0/general/RowData.h" +#include "v2.0/general/RutherfordScattering.h" +#include "v2.0/general/SCTApproximation.h" +#include "v2.0/general/S_table.h" +#include "v2.0/general/ScatteringAtom.h" +#include "v2.0/general/ScatteringAtoms.h" +#include "v2.0/general/ScatteringFactor.h" +#include "v2.0/general/ScatteringRadius.h" +#include "v2.0/general/SelfScatteringKernel.h" +#include "v2.0/general/Shell.h" +#include "v2.0/general/ShortRangeSelfScalingVariance.h" +#include "v2.0/general/SimpleMaxwellianFission.h" +#include "v2.0/general/Slice.h" +#include "v2.0/general/Slices.h" +#include "v2.0/general/Spectra.h" +#include "v2.0/general/Spectrum.h" +#include "v2.0/general/Spin.h" +#include "v2.0/general/SpinGroup.h" +#include "v2.0/general/SpinGroups.h" +#include "v2.0/general/Standard.h" + +#include "v2.0/g3d/Starts.h" + +#include "v2.0/general/String.h" +#include "v2.0/general/Styles.h" +#include "v2.0/general/Sum.h" +#include "v2.0/general/Summand.h" +#include "v2.0/general/Summands.h" +#include "v2.0/general/Sums.h" +#include "v2.0/general/T_M.h" +#include "v2.0/general/T_effective.h" +#include "v2.0/general/Table.h" +#include "v2.0/general/TabulatedWidths.h" +#include "v2.0/general/Temperature.h" +#include "v2.0/general/ThermalNeutronScatteringLaw.h" +#include "v2.0/general/ThermalNeutronScatteringLaw1d.h" +#include "v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.h" +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.h" +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.h" +#include "v2.0/general/Theta.h" +#include "v2.0/general/Time.h" +#include "v2.0/general/Title.h" +#include "v2.0/general/TotalEnergy.h" +#include "v2.0/general/U.h" +#include "v2.0/general/Uncertainty.h" +#include "v2.0/general/Uncorrelated.h" +#include "v2.0/general/Unorthodox.h" +#include "v2.0/general/Unorthodoxes.h" +#include "v2.0/general/Unresolved.h" +#include "v2.0/general/UnresolvedRegion.h" +#include "v2.0/general/Unspecified.h" +#include "v2.0/general/Values.h" +#include "v2.0/general/Weighted.h" +#include "v2.0/general/WeightedFunctionals.h" +#include "v2.0/general/Width.h" +#include "v2.0/general/Widths.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/XYs2d.h" +#include "v2.0/general/XYs3d.h" +#include "v2.0/general/Yields.h" + +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g2d/Array.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g2d/Array.cpp new file mode 100644 index 000000000..3bd00abb9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g2d/Array.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/g2d/Array.hpp" +#include "Array.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ArrayClass; +using CPP = multigroup::Array; + +static const std::string CLASSNAME = "Array"; + +namespace extract { + static auto shape = [](auto &obj) { return &obj.shape; }; + static auto compression = [](auto &obj) { return &obj.compression; }; + static auto symmetry = [](auto &obj) { return &obj.symmetry; }; + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPValues = general::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstArray +ArrayDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Array +ArrayDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstArray +ArrayCreateConst( + const char *const shape, + const char *const compression, + const char *const symmetry, + ConstHandle2ConstValues values +) { + ConstHandle2Array handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + shape, + compression, + symmetry, + detail::tocpp(values) + ); + return handle; +} + +// Create, general, non-const +Handle2Array +ArrayCreate( + const char *const shape, + const char *const compression, + const char *const symmetry, + ConstHandle2ConstValues values +) { + ConstHandle2Array handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + shape, + compression, + symmetry, + detail::tocpp(values) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ArrayAssign(ConstHandle2Array self, ConstHandle2ConstArray from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ArrayDelete(ConstHandle2ConstArray self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ArrayRead(ConstHandle2Array self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ArrayWrite(ConstHandle2ConstArray self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ArrayPrint(ConstHandle2ConstArray self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ArrayPrintXML(ConstHandle2ConstArray self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ArrayPrintJSON(ConstHandle2ConstArray self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: shape +// ----------------------------------------------------------------------------- + +// Has +int +ArrayShapeHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ShapeHas", self, extract::shape); +} + +// Get +// Returns by value +const char * +ArrayShapeGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ShapeGet", self, extract::shape); +} + +// Set +void +ArrayShapeSet(ConstHandle2Array self, const char *const shape) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ShapeSet", self, extract::shape, shape); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: compression +// ----------------------------------------------------------------------------- + +// Has +int +ArrayCompressionHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CompressionHas", self, extract::compression); +} + +// Get +// Returns by value +const char * +ArrayCompressionGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CompressionGet", self, extract::compression); +} + +// Set +void +ArrayCompressionSet(ConstHandle2Array self, const char *const compression) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CompressionSet", self, extract::compression, compression); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: symmetry +// ----------------------------------------------------------------------------- + +// Has +int +ArraySymmetryHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SymmetryHas", self, extract::symmetry); +} + +// Get +// Returns by value +const char * +ArraySymmetryGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SymmetryGet", self, extract::symmetry); +} + +// Set +void +ArraySymmetrySet(ConstHandle2Array self, const char *const symmetry) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SymmetrySet", self, extract::symmetry, symmetry); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +ArrayValuesHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +ArrayValuesGetConst(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +ArrayValuesGet(ConstHandle2Array self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +ArrayValuesSet(ConstHandle2Array self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/g2d/Array/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g2d/Array.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g2d/Array.h new file mode 100644 index 000000000..d599f3c5c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g2d/Array.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Array is the basic handle type in this file. Example: +// // Create a default Array object: +// Array handle = ArrayDefault(); +// Functions involving Array are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_G2D_ARRAY +#define C_INTERFACE_GNDS_V2_0_G2D_ARRAY + +#include "GNDStk.h" +#include "v2.0/general/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ArrayClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Array +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ArrayClass *Array; + +// --- Const-aware handles. +typedef const struct ArrayClass *const ConstHandle2ConstArray; +typedef struct ArrayClass *const ConstHandle2Array; +typedef const struct ArrayClass * Handle2ConstArray; +typedef struct ArrayClass * Handle2Array; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstArray +ArrayDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Array +ArrayDefault(); + +// --- Create, general, const +extern_c Handle2ConstArray +ArrayCreateConst( + const char *const shape, + const char *const compression, + const char *const symmetry, + ConstHandle2ConstValues values +); + +// +++ Create, general, non-const +extern_c Handle2Array +ArrayCreate( + const char *const shape, + const char *const compression, + const char *const symmetry, + ConstHandle2ConstValues values +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ArrayAssign(ConstHandle2Array self, ConstHandle2ConstArray from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ArrayDelete(ConstHandle2ConstArray self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ArrayRead(ConstHandle2Array self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ArrayWrite(ConstHandle2ConstArray self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ArrayPrint(ConstHandle2ConstArray self); + +// +++ Print to standard output, as XML +extern_c int +ArrayPrintXML(ConstHandle2ConstArray self); + +// +++ Print to standard output, as JSON +extern_c int +ArrayPrintJSON(ConstHandle2ConstArray self); + + +// ----------------------------------------------------------------------------- +// Metadatum: shape +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayShapeHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ArrayShapeGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArrayShapeSet(ConstHandle2Array self, const char *const shape); + + +// ----------------------------------------------------------------------------- +// Metadatum: compression +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayCompressionHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ArrayCompressionGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArrayCompressionSet(ConstHandle2Array self, const char *const compression); + + +// ----------------------------------------------------------------------------- +// Metadatum: symmetry +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArraySymmetryHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ArraySymmetryGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArraySymmetrySet(ConstHandle2Array self, const char *const symmetry); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayValuesHas(ConstHandle2ConstArray self); + +// --- Get, const +extern_c Handle2ConstValues +ArrayValuesGetConst(ConstHandle2ConstArray self); + +// +++ Get, non-const +extern_c Handle2Values +ArrayValuesGet(ConstHandle2Array self); + +// +++ Set +extern_c void +ArrayValuesSet(ConstHandle2Array self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/g2d/Array/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g2d/Array/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g2d/Array/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g2d/Array/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g2d/Array/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Array.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Array.cpp new file mode 100644 index 000000000..832a98ae6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Array.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/g3d/Array.hpp" +#include "Array.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ArrayClass; +using CPP = multigroup::Array; + +static const std::string CLASSNAME = "Array"; + +namespace extract { + static auto shape = [](auto &obj) { return &obj.shape; }; + static auto compression = [](auto &obj) { return &obj.compression; }; + static auto symmetry = [](auto &obj) { return &obj.symmetry; }; + static auto starts = [](auto &obj) { return &obj.starts; }; + static auto lengths = [](auto &obj) { return &obj.lengths; }; + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPStarts = g3d::Starts; +using CPPLengths = g3d::Lengths; +using CPPValues = general::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstArray +ArrayDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Array +ArrayDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstArray +ArrayCreateConst( + const char *const shape, + const char *const compression, + const char *const symmetry, + ConstHandle2ConstStarts starts, + ConstHandle2ConstLengths lengths, + ConstHandle2ConstValues values +) { + ConstHandle2Array handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + shape, + compression, + symmetry, + detail::tocpp(starts), + detail::tocpp(lengths), + detail::tocpp(values) + ); + return handle; +} + +// Create, general, non-const +Handle2Array +ArrayCreate( + const char *const shape, + const char *const compression, + const char *const symmetry, + ConstHandle2ConstStarts starts, + ConstHandle2ConstLengths lengths, + ConstHandle2ConstValues values +) { + ConstHandle2Array handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + shape, + compression, + symmetry, + detail::tocpp(starts), + detail::tocpp(lengths), + detail::tocpp(values) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ArrayAssign(ConstHandle2Array self, ConstHandle2ConstArray from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ArrayDelete(ConstHandle2ConstArray self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ArrayRead(ConstHandle2Array self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ArrayWrite(ConstHandle2ConstArray self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ArrayPrint(ConstHandle2ConstArray self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ArrayPrintXML(ConstHandle2ConstArray self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ArrayPrintJSON(ConstHandle2ConstArray self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: shape +// ----------------------------------------------------------------------------- + +// Has +int +ArrayShapeHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ShapeHas", self, extract::shape); +} + +// Get +// Returns by value +const char * +ArrayShapeGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ShapeGet", self, extract::shape); +} + +// Set +void +ArrayShapeSet(ConstHandle2Array self, const char *const shape) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ShapeSet", self, extract::shape, shape); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: compression +// ----------------------------------------------------------------------------- + +// Has +int +ArrayCompressionHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CompressionHas", self, extract::compression); +} + +// Get +// Returns by value +const char * +ArrayCompressionGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CompressionGet", self, extract::compression); +} + +// Set +void +ArrayCompressionSet(ConstHandle2Array self, const char *const compression) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CompressionSet", self, extract::compression, compression); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: symmetry +// ----------------------------------------------------------------------------- + +// Has +int +ArraySymmetryHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SymmetryHas", self, extract::symmetry); +} + +// Get +// Returns by value +const char * +ArraySymmetryGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SymmetryGet", self, extract::symmetry); +} + +// Set +void +ArraySymmetrySet(ConstHandle2Array self, const char *const symmetry) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SymmetrySet", self, extract::symmetry, symmetry); +} + + +// ----------------------------------------------------------------------------- +// Child: starts +// ----------------------------------------------------------------------------- + +// Has +int +ArrayStartsHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StartsHas", self, extract::starts); +} + +// Get, const +Handle2ConstStarts +ArrayStartsGetConst(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StartsGetConst", self, extract::starts); +} + +// Get, non-const +Handle2Starts +ArrayStartsGet(ConstHandle2Array self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StartsGet", self, extract::starts); +} + +// Set +void +ArrayStartsSet(ConstHandle2Array self, ConstHandle2ConstStarts starts) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StartsSet", self, extract::starts, starts); +} + + +// ----------------------------------------------------------------------------- +// Child: lengths +// ----------------------------------------------------------------------------- + +// Has +int +ArrayLengthsHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LengthsHas", self, extract::lengths); +} + +// Get, const +Handle2ConstLengths +ArrayLengthsGetConst(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LengthsGetConst", self, extract::lengths); +} + +// Get, non-const +Handle2Lengths +ArrayLengthsGet(ConstHandle2Array self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LengthsGet", self, extract::lengths); +} + +// Set +void +ArrayLengthsSet(ConstHandle2Array self, ConstHandle2ConstLengths lengths) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LengthsSet", self, extract::lengths, lengths); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +ArrayValuesHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +ArrayValuesGetConst(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +ArrayValuesGet(ConstHandle2Array self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +ArrayValuesSet(ConstHandle2Array self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/g3d/Array/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Array.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Array.h new file mode 100644 index 000000000..4f4821c18 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Array.h @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Array is the basic handle type in this file. Example: +// // Create a default Array object: +// Array handle = ArrayDefault(); +// Functions involving Array are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_G3D_ARRAY +#define C_INTERFACE_GNDS_V2_0_G3D_ARRAY + +#include "GNDStk.h" +#include "v2.0/g3d/Starts.h" +#include "v2.0/g3d/Lengths.h" +#include "v2.0/general/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ArrayClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Array +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ArrayClass *Array; + +// --- Const-aware handles. +typedef const struct ArrayClass *const ConstHandle2ConstArray; +typedef struct ArrayClass *const ConstHandle2Array; +typedef const struct ArrayClass * Handle2ConstArray; +typedef struct ArrayClass * Handle2Array; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstArray +ArrayDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Array +ArrayDefault(); + +// --- Create, general, const +extern_c Handle2ConstArray +ArrayCreateConst( + const char *const shape, + const char *const compression, + const char *const symmetry, + ConstHandle2ConstStarts starts, + ConstHandle2ConstLengths lengths, + ConstHandle2ConstValues values +); + +// +++ Create, general, non-const +extern_c Handle2Array +ArrayCreate( + const char *const shape, + const char *const compression, + const char *const symmetry, + ConstHandle2ConstStarts starts, + ConstHandle2ConstLengths lengths, + ConstHandle2ConstValues values +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ArrayAssign(ConstHandle2Array self, ConstHandle2ConstArray from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ArrayDelete(ConstHandle2ConstArray self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ArrayRead(ConstHandle2Array self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ArrayWrite(ConstHandle2ConstArray self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ArrayPrint(ConstHandle2ConstArray self); + +// +++ Print to standard output, as XML +extern_c int +ArrayPrintXML(ConstHandle2ConstArray self); + +// +++ Print to standard output, as JSON +extern_c int +ArrayPrintJSON(ConstHandle2ConstArray self); + + +// ----------------------------------------------------------------------------- +// Metadatum: shape +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayShapeHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ArrayShapeGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArrayShapeSet(ConstHandle2Array self, const char *const shape); + + +// ----------------------------------------------------------------------------- +// Metadatum: compression +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayCompressionHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ArrayCompressionGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArrayCompressionSet(ConstHandle2Array self, const char *const compression); + + +// ----------------------------------------------------------------------------- +// Metadatum: symmetry +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArraySymmetryHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ArraySymmetryGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArraySymmetrySet(ConstHandle2Array self, const char *const symmetry); + + +// ----------------------------------------------------------------------------- +// Child: starts +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayStartsHas(ConstHandle2ConstArray self); + +// --- Get, const +extern_c Handle2ConstStarts +ArrayStartsGetConst(ConstHandle2ConstArray self); + +// +++ Get, non-const +extern_c Handle2Starts +ArrayStartsGet(ConstHandle2Array self); + +// +++ Set +extern_c void +ArrayStartsSet(ConstHandle2Array self, ConstHandle2ConstStarts starts); + + +// ----------------------------------------------------------------------------- +// Child: lengths +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayLengthsHas(ConstHandle2ConstArray self); + +// --- Get, const +extern_c Handle2ConstLengths +ArrayLengthsGetConst(ConstHandle2ConstArray self); + +// +++ Get, non-const +extern_c Handle2Lengths +ArrayLengthsGet(ConstHandle2Array self); + +// +++ Set +extern_c void +ArrayLengthsSet(ConstHandle2Array self, ConstHandle2ConstLengths lengths); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayValuesHas(ConstHandle2ConstArray self); + +// --- Get, const +extern_c Handle2ConstValues +ArrayValuesGetConst(ConstHandle2ConstArray self); + +// +++ Get, non-const +extern_c Handle2Values +ArrayValuesGet(ConstHandle2Array self); + +// +++ Set +extern_c void +ArrayValuesSet(ConstHandle2Array self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/g3d/Array/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Array/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Array/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Array/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Array/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Lengths.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Lengths.cpp new file mode 100644 index 000000000..c4388e71b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Lengths.cpp @@ -0,0 +1,270 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/g3d/Lengths.hpp" +#include "Lengths.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = LengthsClass; +using CPP = multigroup::Lengths; + +static const std::string CLASSNAME = "Lengths"; + +namespace extract { + static auto valueType = [](auto &obj) { return &obj.valueType; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLengths +LengthsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Lengths +LengthsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLengths +LengthsCreateConst( + const char *const valueType, + const char *const label +) { + ConstHandle2Lengths handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + valueType, + label + ); + return handle; +} + +// Create, general, non-const +Handle2Lengths +LengthsCreate( + const char *const valueType, + const char *const label +) { + ConstHandle2Lengths handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + valueType, + label + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +LengthsAssign(ConstHandle2Lengths self, ConstHandle2ConstLengths from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LengthsDelete(ConstHandle2ConstLengths self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LengthsRead(ConstHandle2Lengths self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LengthsWrite(ConstHandle2ConstLengths self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LengthsPrint(ConstHandle2ConstLengths self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LengthsPrintXML(ConstHandle2ConstLengths self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LengthsPrintJSON(ConstHandle2ConstLengths self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// Clear +void +LengthsIntsClear(ConstHandle2Lengths self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +LengthsIntsSize(ConstHandle2ConstLengths self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +LengthsIntsGet(ConstHandle2ConstLengths self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +LengthsIntsSet(ConstHandle2Lengths self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +LengthsIntsGetArrayConst(ConstHandle2ConstLengths self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +LengthsIntsGetArray(ConstHandle2Lengths self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +LengthsIntsSetArray(ConstHandle2Lengths self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: valueType +// ----------------------------------------------------------------------------- + +// Has +int +LengthsValueTypeHas(ConstHandle2ConstLengths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueTypeHas", self, extract::valueType); +} + +// Get +// Returns by value +const char * +LengthsValueTypeGet(ConstHandle2ConstLengths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueTypeGet", self, extract::valueType); +} + +// Set +void +LengthsValueTypeSet(ConstHandle2Lengths self, const char *const valueType) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueTypeSet", self, extract::valueType, valueType); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +LengthsLabelHas(ConstHandle2ConstLengths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +LengthsLabelGet(ConstHandle2ConstLengths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +LengthsLabelSet(ConstHandle2Lengths self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/g3d/Lengths/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Lengths.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Lengths.h new file mode 100644 index 000000000..35f6168ac --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Lengths.h @@ -0,0 +1,212 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Lengths is the basic handle type in this file. Example: +// // Create a default Lengths object: +// Lengths handle = LengthsDefault(); +// Functions involving Lengths are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_G3D_LENGTHS +#define C_INTERFACE_GNDS_V2_0_G3D_LENGTHS + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LengthsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Lengths +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LengthsClass *Lengths; + +// --- Const-aware handles. +typedef const struct LengthsClass *const ConstHandle2ConstLengths; +typedef struct LengthsClass *const ConstHandle2Lengths; +typedef const struct LengthsClass * Handle2ConstLengths; +typedef struct LengthsClass * Handle2Lengths; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstLengths +LengthsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Lengths +LengthsDefault(); + +// --- Create, general, const +extern_c Handle2ConstLengths +LengthsCreateConst( + const char *const valueType, + const char *const label +); + +// +++ Create, general, non-const +extern_c Handle2Lengths +LengthsCreate( + const char *const valueType, + const char *const label +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +LengthsAssign(ConstHandle2Lengths self, ConstHandle2ConstLengths from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LengthsDelete(ConstHandle2ConstLengths self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LengthsRead(ConstHandle2Lengths self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LengthsWrite(ConstHandle2ConstLengths self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LengthsPrint(ConstHandle2ConstLengths self); + +// +++ Print to standard output, as XML +extern_c int +LengthsPrintXML(ConstHandle2ConstLengths self); + +// +++ Print to standard output, as JSON +extern_c int +LengthsPrintJSON(ConstHandle2ConstLengths self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// +++ Clear +extern_c void +LengthsIntsClear(ConstHandle2Lengths self); + +// +++ Get size +extern_c size_t +LengthsIntsSize(ConstHandle2ConstLengths self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +LengthsIntsGet(ConstHandle2ConstLengths self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +LengthsIntsSet(ConstHandle2Lengths self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +LengthsIntsGetArrayConst(ConstHandle2ConstLengths self); + +// +++ Get pointer to existing values, non-const +extern_c int * +LengthsIntsGetArray(ConstHandle2Lengths self); + +// +++ Set completely new values and size +extern_c void +LengthsIntsSetArray(ConstHandle2Lengths self, const int *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: valueType +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LengthsValueTypeHas(ConstHandle2ConstLengths self); + +// +++ Get +// +++ Returns by value +extern_c const char * +LengthsValueTypeGet(ConstHandle2ConstLengths self); + +// +++ Set +extern_c void +LengthsValueTypeSet(ConstHandle2Lengths self, const char *const valueType); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LengthsLabelHas(ConstHandle2ConstLengths self); + +// +++ Get +// +++ Returns by value +extern_c const char * +LengthsLabelGet(ConstHandle2ConstLengths self); + +// +++ Set +extern_c void +LengthsLabelSet(ConstHandle2Lengths self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/g3d/Lengths/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Lengths/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Lengths/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Lengths/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Lengths/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Starts.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Starts.cpp new file mode 100644 index 000000000..6cb99d0c3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Starts.cpp @@ -0,0 +1,270 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/g3d/Starts.hpp" +#include "Starts.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = StartsClass; +using CPP = multigroup::Starts; + +static const std::string CLASSNAME = "Starts"; + +namespace extract { + static auto valueType = [](auto &obj) { return &obj.valueType; }; + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstStarts +StartsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Starts +StartsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstStarts +StartsCreateConst( + const char *const valueType, + const char *const label +) { + ConstHandle2Starts handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + valueType, + label + ); + return handle; +} + +// Create, general, non-const +Handle2Starts +StartsCreate( + const char *const valueType, + const char *const label +) { + ConstHandle2Starts handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + valueType, + label + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +StartsAssign(ConstHandle2Starts self, ConstHandle2ConstStarts from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +StartsDelete(ConstHandle2ConstStarts self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +StartsRead(ConstHandle2Starts self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +StartsWrite(ConstHandle2ConstStarts self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +StartsPrint(ConstHandle2ConstStarts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +StartsPrintXML(ConstHandle2ConstStarts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +StartsPrintJSON(ConstHandle2ConstStarts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// Clear +void +StartsIntsClear(ConstHandle2Starts self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"IntsClear", self); +} + +// Get size +size_t +StartsIntsSize(ConstHandle2ConstStarts self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"IntsSize", self); +} + +// Get value +// By index \in [0,size) +int +StartsIntsGet(ConstHandle2ConstStarts self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +StartsIntsSet(ConstHandle2Starts self, const size_t index, const int value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSet", self, index, value); +} + +// Get pointer to existing values, const +const int * +StartsIntsGetArrayConst(ConstHandle2ConstStarts self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArrayConst", self); +} + +// Get pointer to existing values, non-const +int * +StartsIntsGetArray(ConstHandle2Starts self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"IntsGetArray", self); +} + +// Set completely new values and size +void +StartsIntsSetArray(ConstHandle2Starts self, const int *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"IntsSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: valueType +// ----------------------------------------------------------------------------- + +// Has +int +StartsValueTypeHas(ConstHandle2ConstStarts self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueTypeHas", self, extract::valueType); +} + +// Get +// Returns by value +const char * +StartsValueTypeGet(ConstHandle2ConstStarts self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueTypeGet", self, extract::valueType); +} + +// Set +void +StartsValueTypeSet(ConstHandle2Starts self, const char *const valueType) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueTypeSet", self, extract::valueType, valueType); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +StartsLabelHas(ConstHandle2ConstStarts self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +StartsLabelGet(ConstHandle2ConstStarts self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +StartsLabelSet(ConstHandle2Starts self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/g3d/Starts/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Starts.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Starts.h new file mode 100644 index 000000000..91f70729b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Starts.h @@ -0,0 +1,212 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Starts is the basic handle type in this file. Example: +// // Create a default Starts object: +// Starts handle = StartsDefault(); +// Functions involving Starts are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_G3D_STARTS +#define C_INTERFACE_GNDS_V2_0_G3D_STARTS + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct StartsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Starts +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct StartsClass *Starts; + +// --- Const-aware handles. +typedef const struct StartsClass *const ConstHandle2ConstStarts; +typedef struct StartsClass *const ConstHandle2Starts; +typedef const struct StartsClass * Handle2ConstStarts; +typedef struct StartsClass * Handle2Starts; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstStarts +StartsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Starts +StartsDefault(); + +// --- Create, general, const +extern_c Handle2ConstStarts +StartsCreateConst( + const char *const valueType, + const char *const label +); + +// +++ Create, general, non-const +extern_c Handle2Starts +StartsCreate( + const char *const valueType, + const char *const label +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +StartsAssign(ConstHandle2Starts self, ConstHandle2ConstStarts from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +StartsDelete(ConstHandle2ConstStarts self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +StartsRead(ConstHandle2Starts self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +StartsWrite(ConstHandle2ConstStarts self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +StartsPrint(ConstHandle2ConstStarts self); + +// +++ Print to standard output, as XML +extern_c int +StartsPrintXML(ConstHandle2ConstStarts self); + +// +++ Print to standard output, as JSON +extern_c int +StartsPrintJSON(ConstHandle2ConstStarts self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// +++ Clear +extern_c void +StartsIntsClear(ConstHandle2Starts self); + +// +++ Get size +extern_c size_t +StartsIntsSize(ConstHandle2ConstStarts self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c int +StartsIntsGet(ConstHandle2ConstStarts self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +StartsIntsSet(ConstHandle2Starts self, const size_t index, const int value); + +// --- Get pointer to existing values, const +extern_c const int * +StartsIntsGetArrayConst(ConstHandle2ConstStarts self); + +// +++ Get pointer to existing values, non-const +extern_c int * +StartsIntsGetArray(ConstHandle2Starts self); + +// +++ Set completely new values and size +extern_c void +StartsIntsSetArray(ConstHandle2Starts self, const int *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Metadatum: valueType +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StartsValueTypeHas(ConstHandle2ConstStarts self); + +// +++ Get +// +++ Returns by value +extern_c const char * +StartsValueTypeGet(ConstHandle2ConstStarts self); + +// +++ Set +extern_c void +StartsValueTypeSet(ConstHandle2Starts self, const char *const valueType); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StartsLabelHas(ConstHandle2ConstStarts self); + +// +++ Get +// +++ Returns by value +extern_c const char * +StartsLabelGet(ConstHandle2ConstStarts self); + +// +++ Set +extern_c void +StartsLabelSet(ConstHandle2Starts self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/g3d/Starts/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Starts/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Starts/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Starts/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/g3d/Starts/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Add.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Add.cpp new file mode 100644 index 000000000..875d0be64 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Add.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Add.hpp" +#include "Add.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AddClass; +using CPP = multigroup::Add; + +static const std::string CLASSNAME = "Add"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAdd +AddDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Add +AddDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAdd +AddCreateConst( + const char *const href +) { + ConstHandle2Add handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href + ); + return handle; +} + +// Create, general, non-const +Handle2Add +AddCreate( + const char *const href +) { + ConstHandle2Add handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AddAssign(ConstHandle2Add self, ConstHandle2ConstAdd from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AddDelete(ConstHandle2ConstAdd self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AddRead(ConstHandle2Add self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AddWrite(ConstHandle2ConstAdd self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AddPrint(ConstHandle2ConstAdd self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AddPrintXML(ConstHandle2ConstAdd self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AddPrintJSON(ConstHandle2ConstAdd self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +AddHrefHas(ConstHandle2ConstAdd self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +AddHrefGet(ConstHandle2ConstAdd self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +AddHrefSet(ConstHandle2Add self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Add/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Add.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Add.h new file mode 100644 index 000000000..34f336247 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Add.h @@ -0,0 +1,157 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Add is the basic handle type in this file. Example: +// // Create a default Add object: +// Add handle = AddDefault(); +// Functions involving Add are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ADD +#define C_INTERFACE_GNDS_V2_0_GENERAL_ADD + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AddClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Add +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AddClass *Add; + +// --- Const-aware handles. +typedef const struct AddClass *const ConstHandle2ConstAdd; +typedef struct AddClass *const ConstHandle2Add; +typedef const struct AddClass * Handle2ConstAdd; +typedef struct AddClass * Handle2Add; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAdd +AddDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Add +AddDefault(); + +// --- Create, general, const +extern_c Handle2ConstAdd +AddCreateConst( + const char *const href +); + +// +++ Create, general, non-const +extern_c Handle2Add +AddCreate( + const char *const href +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AddAssign(ConstHandle2Add self, ConstHandle2ConstAdd from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AddDelete(ConstHandle2ConstAdd self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AddRead(ConstHandle2Add self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AddWrite(ConstHandle2ConstAdd self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AddPrint(ConstHandle2ConstAdd self); + +// +++ Print to standard output, as XML +extern_c int +AddPrintXML(ConstHandle2ConstAdd self); + +// +++ Print to standard output, as JSON +extern_c int +AddPrintJSON(ConstHandle2ConstAdd self); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AddHrefHas(ConstHandle2ConstAdd self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AddHrefGet(ConstHandle2ConstAdd self); + +// +++ Set +extern_c void +AddHrefSet(ConstHandle2Add self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Add/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Add/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Add/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Add/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Add/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Alias.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Alias.cpp new file mode 100644 index 000000000..df265d6e8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Alias.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Alias.hpp" +#include "Alias.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AliasClass; +using CPP = multigroup::Alias; + +static const std::string CLASSNAME = "Alias"; + +namespace extract { + static auto id = [](auto &obj) { return &obj.id; }; + static auto pid = [](auto &obj) { return &obj.pid; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAlias +AliasDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Alias +AliasDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAlias +AliasCreateConst( + const char *const id, + const char *const pid +) { + ConstHandle2Alias handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + pid + ); + return handle; +} + +// Create, general, non-const +Handle2Alias +AliasCreate( + const char *const id, + const char *const pid +) { + ConstHandle2Alias handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + pid + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AliasAssign(ConstHandle2Alias self, ConstHandle2ConstAlias from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AliasDelete(ConstHandle2ConstAlias self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AliasRead(ConstHandle2Alias self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AliasWrite(ConstHandle2ConstAlias self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AliasPrint(ConstHandle2ConstAlias self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AliasPrintXML(ConstHandle2ConstAlias self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AliasPrintJSON(ConstHandle2ConstAlias self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// Has +int +AliasIdHas(ConstHandle2ConstAlias self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IdHas", self, extract::id); +} + +// Get +// Returns by value +const char * +AliasIdGet(ConstHandle2ConstAlias self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +AliasIdSet(ConstHandle2Alias self, const char *const id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +AliasPidHas(ConstHandle2ConstAlias self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +AliasPidGet(ConstHandle2ConstAlias self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +AliasPidSet(ConstHandle2Alias self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Alias/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Alias.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Alias.h new file mode 100644 index 000000000..4219a1c2e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Alias.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Alias is the basic handle type in this file. Example: +// // Create a default Alias object: +// Alias handle = AliasDefault(); +// Functions involving Alias are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ALIAS +#define C_INTERFACE_GNDS_V2_0_GENERAL_ALIAS + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AliasClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Alias +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AliasClass *Alias; + +// --- Const-aware handles. +typedef const struct AliasClass *const ConstHandle2ConstAlias; +typedef struct AliasClass *const ConstHandle2Alias; +typedef const struct AliasClass * Handle2ConstAlias; +typedef struct AliasClass * Handle2Alias; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAlias +AliasDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Alias +AliasDefault(); + +// --- Create, general, const +extern_c Handle2ConstAlias +AliasCreateConst( + const char *const id, + const char *const pid +); + +// +++ Create, general, non-const +extern_c Handle2Alias +AliasCreate( + const char *const id, + const char *const pid +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AliasAssign(ConstHandle2Alias self, ConstHandle2ConstAlias from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AliasDelete(ConstHandle2ConstAlias self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AliasRead(ConstHandle2Alias self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AliasWrite(ConstHandle2ConstAlias self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AliasPrint(ConstHandle2ConstAlias self); + +// +++ Print to standard output, as XML +extern_c int +AliasPrintXML(ConstHandle2ConstAlias self); + +// +++ Print to standard output, as JSON +extern_c int +AliasPrintJSON(ConstHandle2ConstAlias self); + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AliasIdHas(ConstHandle2ConstAlias self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AliasIdGet(ConstHandle2ConstAlias self); + +// +++ Set +extern_c void +AliasIdSet(ConstHandle2Alias self, const char *const id); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AliasPidHas(ConstHandle2ConstAlias self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AliasPidGet(ConstHandle2ConstAlias self); + +// +++ Set +extern_c void +AliasPidSet(ConstHandle2Alias self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Alias/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Alias/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Alias/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Alias/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Alias/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Aliases.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Aliases.cpp new file mode 100644 index 000000000..200ea74f1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Aliases.cpp @@ -0,0 +1,531 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Aliases.hpp" +#include "Aliases.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AliasesClass; +using CPP = multigroup::Aliases; + +static const std::string CLASSNAME = "Aliases"; + +namespace extract { + static auto alias = [](auto &obj) { return &obj.alias; }; + static auto metaStable = [](auto &obj) { return &obj.metaStable; }; +} + +using CPPAlias = general::Alias; +using CPPMetaStable = general::MetaStable; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAliases +AliasesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Aliases +AliasesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAliases +AliasesCreateConst( + ConstHandle2Alias *const alias, const size_t aliasSize, + ConstHandle2MetaStable *const metaStable, const size_t metaStableSize +) { + ConstHandle2Aliases handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{}, + std::vector{} + ); + for (size_t AliasN = 0; AliasN < aliasSize; ++AliasN) + AliasesAliasAdd(handle, alias[AliasN]); + for (size_t MetaStableN = 0; MetaStableN < metaStableSize; ++MetaStableN) + AliasesMetaStableAdd(handle, metaStable[MetaStableN]); + return handle; +} + +// Create, general, non-const +Handle2Aliases +AliasesCreate( + ConstHandle2Alias *const alias, const size_t aliasSize, + ConstHandle2MetaStable *const metaStable, const size_t metaStableSize +) { + ConstHandle2Aliases handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{}, + std::vector{} + ); + for (size_t AliasN = 0; AliasN < aliasSize; ++AliasN) + AliasesAliasAdd(handle, alias[AliasN]); + for (size_t MetaStableN = 0; MetaStableN < metaStableSize; ++MetaStableN) + AliasesMetaStableAdd(handle, metaStable[MetaStableN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AliasesAssign(ConstHandle2Aliases self, ConstHandle2ConstAliases from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AliasesDelete(ConstHandle2ConstAliases self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AliasesRead(ConstHandle2Aliases self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AliasesWrite(ConstHandle2ConstAliases self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AliasesPrint(ConstHandle2ConstAliases self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AliasesPrintXML(ConstHandle2ConstAliases self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AliasesPrintJSON(ConstHandle2ConstAliases self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: alias +// ----------------------------------------------------------------------------- + +// Has +int +AliasesAliasHas(ConstHandle2ConstAliases self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AliasHas", self, extract::alias); +} + +// Clear +void +AliasesAliasClear(ConstHandle2Aliases self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"AliasClear", self, extract::alias); +} + +// Size +size_t +AliasesAliasSize(ConstHandle2ConstAliases self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"AliasSize", self, extract::alias); +} + +// Add +void +AliasesAliasAdd(ConstHandle2Aliases self, ConstHandle2ConstAlias alias) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"AliasAdd", self, extract::alias, alias); +} + +// Get, by index \in [0,size), const +Handle2ConstAlias +AliasesAliasGetConst(ConstHandle2ConstAliases self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AliasGetConst", self, extract::alias, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Alias +AliasesAliasGet(ConstHandle2Aliases self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AliasGet", self, extract::alias, index_); +} + +// Set, by index \in [0,size) +void +AliasesAliasSet( + ConstHandle2Aliases self, + const size_t index_, + ConstHandle2ConstAlias alias +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"AliasSet", self, extract::alias, index_, alias); +} + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// Has, by id +int +AliasesAliasHasById( + ConstHandle2ConstAliases self, + const char *const id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AliasHasById", + self, extract::alias, meta::id, id); +} + +// Get, by id, const +Handle2ConstAlias +AliasesAliasGetByIdConst( + ConstHandle2ConstAliases self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AliasGetByIdConst", + self, extract::alias, meta::id, id); +} + +// Get, by id, non-const +Handle2Alias +AliasesAliasGetById( + ConstHandle2Aliases self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AliasGetById", + self, extract::alias, meta::id, id); +} + +// Set, by id +void +AliasesAliasSetById( + ConstHandle2Aliases self, + const char *const id, + ConstHandle2ConstAlias alias +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AliasSetById", + self, extract::alias, meta::id, id, alias); +} + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// Has, by pid +int +AliasesAliasHasByPid( + ConstHandle2ConstAliases self, + const char *const pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AliasHasByPid", + self, extract::alias, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstAlias +AliasesAliasGetByPidConst( + ConstHandle2ConstAliases self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AliasGetByPidConst", + self, extract::alias, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2Alias +AliasesAliasGetByPid( + ConstHandle2Aliases self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AliasGetByPid", + self, extract::alias, meta::pid, pid); +} + +// Set, by pid +void +AliasesAliasSetByPid( + ConstHandle2Aliases self, + const char *const pid, + ConstHandle2ConstAlias alias +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AliasSetByPid", + self, extract::alias, meta::pid, pid, alias); +} + + +// ----------------------------------------------------------------------------- +// Child: metaStable +// ----------------------------------------------------------------------------- + +// Has +int +AliasesMetaStableHas(ConstHandle2ConstAliases self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MetaStableHas", self, extract::metaStable); +} + +// Clear +void +AliasesMetaStableClear(ConstHandle2Aliases self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"MetaStableClear", self, extract::metaStable); +} + +// Size +size_t +AliasesMetaStableSize(ConstHandle2ConstAliases self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"MetaStableSize", self, extract::metaStable); +} + +// Add +void +AliasesMetaStableAdd(ConstHandle2Aliases self, ConstHandle2ConstMetaStable metaStable) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"MetaStableAdd", self, extract::metaStable, metaStable); +} + +// Get, by index \in [0,size), const +Handle2ConstMetaStable +AliasesMetaStableGetConst(ConstHandle2ConstAliases self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"MetaStableGetConst", self, extract::metaStable, index_); +} + +// Get, by index \in [0,size), non-const +Handle2MetaStable +AliasesMetaStableGet(ConstHandle2Aliases self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"MetaStableGet", self, extract::metaStable, index_); +} + +// Set, by index \in [0,size) +void +AliasesMetaStableSet( + ConstHandle2Aliases self, + const size_t index_, + ConstHandle2ConstMetaStable metaStable +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"MetaStableSet", self, extract::metaStable, index_, metaStable); +} + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// Has, by id +int +AliasesMetaStableHasById( + ConstHandle2ConstAliases self, + const char *const id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableHasById", + self, extract::metaStable, meta::id, id); +} + +// Get, by id, const +Handle2ConstMetaStable +AliasesMetaStableGetByIdConst( + ConstHandle2ConstAliases self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetByIdConst", + self, extract::metaStable, meta::id, id); +} + +// Get, by id, non-const +Handle2MetaStable +AliasesMetaStableGetById( + ConstHandle2Aliases self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetById", + self, extract::metaStable, meta::id, id); +} + +// Set, by id +void +AliasesMetaStableSetById( + ConstHandle2Aliases self, + const char *const id, + ConstHandle2ConstMetaStable metaStable +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableSetById", + self, extract::metaStable, meta::id, id, metaStable); +} + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// Has, by pid +int +AliasesMetaStableHasByPid( + ConstHandle2ConstAliases self, + const char *const pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableHasByPid", + self, extract::metaStable, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstMetaStable +AliasesMetaStableGetByPidConst( + ConstHandle2ConstAliases self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetByPidConst", + self, extract::metaStable, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2MetaStable +AliasesMetaStableGetByPid( + ConstHandle2Aliases self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetByPid", + self, extract::metaStable, meta::pid, pid); +} + +// Set, by pid +void +AliasesMetaStableSetByPid( + ConstHandle2Aliases self, + const char *const pid, + ConstHandle2ConstMetaStable metaStable +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableSetByPid", + self, extract::metaStable, meta::pid, pid, metaStable); +} + +// ------------------------ +// Re: metadatum metaStableIndex +// ------------------------ + +// Has, by metaStableIndex +int +AliasesMetaStableHasByMetaStableIndex( + ConstHandle2ConstAliases self, + const int metaStableIndex +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableHasByMetaStableIndex", + self, extract::metaStable, meta::metaStableIndex, metaStableIndex); +} + +// Get, by metaStableIndex, const +Handle2ConstMetaStable +AliasesMetaStableGetByMetaStableIndexConst( + ConstHandle2ConstAliases self, + const int metaStableIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetByMetaStableIndexConst", + self, extract::metaStable, meta::metaStableIndex, metaStableIndex); +} + +// Get, by metaStableIndex, non-const +Handle2MetaStable +AliasesMetaStableGetByMetaStableIndex( + ConstHandle2Aliases self, + const int metaStableIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableGetByMetaStableIndex", + self, extract::metaStable, meta::metaStableIndex, metaStableIndex); +} + +// Set, by metaStableIndex +void +AliasesMetaStableSetByMetaStableIndex( + ConstHandle2Aliases self, + const int metaStableIndex, + ConstHandle2ConstMetaStable metaStable +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MetaStableSetByMetaStableIndex", + self, extract::metaStable, meta::metaStableIndex, metaStableIndex, metaStable); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Aliases/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Aliases.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Aliases.h new file mode 100644 index 000000000..7c9a862e6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Aliases.h @@ -0,0 +1,382 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Aliases is the basic handle type in this file. Example: +// // Create a default Aliases object: +// Aliases handle = AliasesDefault(); +// Functions involving Aliases are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ALIASES +#define C_INTERFACE_GNDS_V2_0_GENERAL_ALIASES + +#include "GNDStk.h" +#include "v2.0/general/Alias.h" +#include "v2.0/general/MetaStable.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AliasesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Aliases +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AliasesClass *Aliases; + +// --- Const-aware handles. +typedef const struct AliasesClass *const ConstHandle2ConstAliases; +typedef struct AliasesClass *const ConstHandle2Aliases; +typedef const struct AliasesClass * Handle2ConstAliases; +typedef struct AliasesClass * Handle2Aliases; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAliases +AliasesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Aliases +AliasesDefault(); + +// --- Create, general, const +extern_c Handle2ConstAliases +AliasesCreateConst( + ConstHandle2Alias *const alias, const size_t aliasSize, + ConstHandle2MetaStable *const metaStable, const size_t metaStableSize +); + +// +++ Create, general, non-const +extern_c Handle2Aliases +AliasesCreate( + ConstHandle2Alias *const alias, const size_t aliasSize, + ConstHandle2MetaStable *const metaStable, const size_t metaStableSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AliasesAssign(ConstHandle2Aliases self, ConstHandle2ConstAliases from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AliasesDelete(ConstHandle2ConstAliases self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AliasesRead(ConstHandle2Aliases self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AliasesWrite(ConstHandle2ConstAliases self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AliasesPrint(ConstHandle2ConstAliases self); + +// +++ Print to standard output, as XML +extern_c int +AliasesPrintXML(ConstHandle2ConstAliases self); + +// +++ Print to standard output, as JSON +extern_c int +AliasesPrintJSON(ConstHandle2ConstAliases self); + + +// ----------------------------------------------------------------------------- +// Child: alias +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AliasesAliasHas(ConstHandle2ConstAliases self); + +// +++ Clear +extern_c void +AliasesAliasClear(ConstHandle2Aliases self); + +// +++ Size +extern_c size_t +AliasesAliasSize(ConstHandle2ConstAliases self); + +// +++ Add +extern_c void +AliasesAliasAdd(ConstHandle2Aliases self, ConstHandle2ConstAlias alias); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstAlias +AliasesAliasGetConst(ConstHandle2ConstAliases self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Alias +AliasesAliasGet(ConstHandle2Aliases self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +AliasesAliasSet( + ConstHandle2Aliases self, + const size_t index_, + ConstHandle2ConstAlias alias +); + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// +++ Has, by id +extern_c int +AliasesAliasHasById( + ConstHandle2ConstAliases self, + const char *const id +); + +// --- Get, by id, const +extern_c Handle2ConstAlias +AliasesAliasGetByIdConst( + ConstHandle2ConstAliases self, + const char *const id +); + +// +++ Get, by id, non-const +extern_c Handle2Alias +AliasesAliasGetById( + ConstHandle2Aliases self, + const char *const id +); + +// +++ Set, by id +extern_c void +AliasesAliasSetById( + ConstHandle2Aliases self, + const char *const id, + ConstHandle2ConstAlias alias +); + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// +++ Has, by pid +extern_c int +AliasesAliasHasByPid( + ConstHandle2ConstAliases self, + const char *const pid +); + +// --- Get, by pid, const +extern_c Handle2ConstAlias +AliasesAliasGetByPidConst( + ConstHandle2ConstAliases self, + const char *const pid +); + +// +++ Get, by pid, non-const +extern_c Handle2Alias +AliasesAliasGetByPid( + ConstHandle2Aliases self, + const char *const pid +); + +// +++ Set, by pid +extern_c void +AliasesAliasSetByPid( + ConstHandle2Aliases self, + const char *const pid, + ConstHandle2ConstAlias alias +); + + +// ----------------------------------------------------------------------------- +// Child: metaStable +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AliasesMetaStableHas(ConstHandle2ConstAliases self); + +// +++ Clear +extern_c void +AliasesMetaStableClear(ConstHandle2Aliases self); + +// +++ Size +extern_c size_t +AliasesMetaStableSize(ConstHandle2ConstAliases self); + +// +++ Add +extern_c void +AliasesMetaStableAdd(ConstHandle2Aliases self, ConstHandle2ConstMetaStable metaStable); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstMetaStable +AliasesMetaStableGetConst(ConstHandle2ConstAliases self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2MetaStable +AliasesMetaStableGet(ConstHandle2Aliases self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +AliasesMetaStableSet( + ConstHandle2Aliases self, + const size_t index_, + ConstHandle2ConstMetaStable metaStable +); + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// +++ Has, by id +extern_c int +AliasesMetaStableHasById( + ConstHandle2ConstAliases self, + const char *const id +); + +// --- Get, by id, const +extern_c Handle2ConstMetaStable +AliasesMetaStableGetByIdConst( + ConstHandle2ConstAliases self, + const char *const id +); + +// +++ Get, by id, non-const +extern_c Handle2MetaStable +AliasesMetaStableGetById( + ConstHandle2Aliases self, + const char *const id +); + +// +++ Set, by id +extern_c void +AliasesMetaStableSetById( + ConstHandle2Aliases self, + const char *const id, + ConstHandle2ConstMetaStable metaStable +); + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// +++ Has, by pid +extern_c int +AliasesMetaStableHasByPid( + ConstHandle2ConstAliases self, + const char *const pid +); + +// --- Get, by pid, const +extern_c Handle2ConstMetaStable +AliasesMetaStableGetByPidConst( + ConstHandle2ConstAliases self, + const char *const pid +); + +// +++ Get, by pid, non-const +extern_c Handle2MetaStable +AliasesMetaStableGetByPid( + ConstHandle2Aliases self, + const char *const pid +); + +// +++ Set, by pid +extern_c void +AliasesMetaStableSetByPid( + ConstHandle2Aliases self, + const char *const pid, + ConstHandle2ConstMetaStable metaStable +); + +// ------------------------ +// Re: metadatum metaStableIndex +// ------------------------ + +// +++ Has, by metaStableIndex +extern_c int +AliasesMetaStableHasByMetaStableIndex( + ConstHandle2ConstAliases self, + const int metaStableIndex +); + +// --- Get, by metaStableIndex, const +extern_c Handle2ConstMetaStable +AliasesMetaStableGetByMetaStableIndexConst( + ConstHandle2ConstAliases self, + const int metaStableIndex +); + +// +++ Get, by metaStableIndex, non-const +extern_c Handle2MetaStable +AliasesMetaStableGetByMetaStableIndex( + ConstHandle2Aliases self, + const int metaStableIndex +); + +// +++ Set, by metaStableIndex +extern_c void +AliasesMetaStableSetByMetaStableIndex( + ConstHandle2Aliases self, + const int metaStableIndex, + ConstHandle2ConstMetaStable metaStable +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Aliases/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Aliases/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Aliases/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Aliases/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Aliases/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Angular.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Angular.cpp new file mode 100644 index 000000000..94aa74862 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Angular.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Angular.hpp" +#include "Angular.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AngularClass; +using CPP = multigroup::Angular; + +static const std::string CLASSNAME = "Angular"; + +namespace extract { + static auto isotropic2d = [](auto &obj) { return &obj.isotropic2d; }; + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; +} + +using CPPIsotropic2d = general::Isotropic2d; +using CPPXYs2d = general::XYs2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAngular +AngularDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Angular +AngularDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAngular +AngularCreateConst( + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2Angular handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(isotropic2d), + detail::tocpp(XYs2d) + ); + return handle; +} + +// Create, general, non-const +Handle2Angular +AngularCreate( + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2Angular handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(isotropic2d), + detail::tocpp(XYs2d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AngularAssign(ConstHandle2Angular self, ConstHandle2ConstAngular from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AngularDelete(ConstHandle2ConstAngular self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AngularRead(ConstHandle2Angular self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AngularWrite(ConstHandle2ConstAngular self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AngularPrint(ConstHandle2ConstAngular self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AngularPrintXML(ConstHandle2ConstAngular self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AngularPrintJSON(ConstHandle2ConstAngular self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: isotropic2d +// ----------------------------------------------------------------------------- + +// Has +int +AngularIsotropic2dHas(ConstHandle2ConstAngular self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Isotropic2dHas", self, extract::isotropic2d); +} + +// Get, const +Handle2ConstIsotropic2d +AngularIsotropic2dGetConst(ConstHandle2ConstAngular self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Isotropic2dGetConst", self, extract::isotropic2d); +} + +// Get, non-const +Handle2Isotropic2d +AngularIsotropic2dGet(ConstHandle2Angular self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Isotropic2dGet", self, extract::isotropic2d); +} + +// Set +void +AngularIsotropic2dSet(ConstHandle2Angular self, ConstHandle2ConstIsotropic2d isotropic2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Isotropic2dSet", self, extract::isotropic2d, isotropic2d); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +AngularXYs2dHas(ConstHandle2ConstAngular self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +AngularXYs2dGetConst(ConstHandle2ConstAngular self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +AngularXYs2dGet(ConstHandle2Angular self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +AngularXYs2dSet(ConstHandle2Angular self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Angular/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Angular.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Angular.h new file mode 100644 index 000000000..b52c1a048 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Angular.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Angular is the basic handle type in this file. Example: +// // Create a default Angular object: +// Angular handle = AngularDefault(); +// Functions involving Angular are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ANGULAR +#define C_INTERFACE_GNDS_V2_0_GENERAL_ANGULAR + +#include "GNDStk.h" +#include "v2.0/general/Isotropic2d.h" +#include "v2.0/general/XYs2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AngularClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Angular +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AngularClass *Angular; + +// --- Const-aware handles. +typedef const struct AngularClass *const ConstHandle2ConstAngular; +typedef struct AngularClass *const ConstHandle2Angular; +typedef const struct AngularClass * Handle2ConstAngular; +typedef struct AngularClass * Handle2Angular; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAngular +AngularDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Angular +AngularDefault(); + +// --- Create, general, const +extern_c Handle2ConstAngular +AngularCreateConst( + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general, non-const +extern_c Handle2Angular +AngularCreate( + ConstHandle2ConstIsotropic2d isotropic2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AngularAssign(ConstHandle2Angular self, ConstHandle2ConstAngular from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AngularDelete(ConstHandle2ConstAngular self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AngularRead(ConstHandle2Angular self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AngularWrite(ConstHandle2ConstAngular self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AngularPrint(ConstHandle2ConstAngular self); + +// +++ Print to standard output, as XML +extern_c int +AngularPrintXML(ConstHandle2ConstAngular self); + +// +++ Print to standard output, as JSON +extern_c int +AngularPrintJSON(ConstHandle2ConstAngular self); + + +// ----------------------------------------------------------------------------- +// Child: isotropic2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularIsotropic2dHas(ConstHandle2ConstAngular self); + +// --- Get, const +extern_c Handle2ConstIsotropic2d +AngularIsotropic2dGetConst(ConstHandle2ConstAngular self); + +// +++ Get, non-const +extern_c Handle2Isotropic2d +AngularIsotropic2dGet(ConstHandle2Angular self); + +// +++ Set +extern_c void +AngularIsotropic2dSet(ConstHandle2Angular self, ConstHandle2ConstIsotropic2d isotropic2d); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularXYs2dHas(ConstHandle2ConstAngular self); + +// --- Get, const +extern_c Handle2ConstXYs2d +AngularXYs2dGetConst(ConstHandle2ConstAngular self); + +// +++ Get, non-const +extern_c Handle2XYs2d +AngularXYs2dGet(ConstHandle2Angular self); + +// +++ Set +extern_c void +AngularXYs2dSet(ConstHandle2Angular self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Angular/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Angular/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Angular/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Angular/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Angular/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularEnergy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularEnergy.cpp new file mode 100644 index 000000000..122bad538 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularEnergy.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/AngularEnergy.hpp" +#include "AngularEnergy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AngularEnergyClass; +using CPP = multigroup::AngularEnergy; + +static const std::string CLASSNAME = "AngularEnergy"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto XYs3d = [](auto &obj) { return &obj.XYs3d; }; +} + +using CPPXYs3d = general::XYs3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAngularEnergy +AngularEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2AngularEnergy +AngularEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAngularEnergy +AngularEnergyCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs3d XYs3d +) { + ConstHandle2AngularEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(XYs3d) + ); + return handle; +} + +// Create, general, non-const +Handle2AngularEnergy +AngularEnergyCreate( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs3d XYs3d +) { + ConstHandle2AngularEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(XYs3d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AngularEnergyAssign(ConstHandle2AngularEnergy self, ConstHandle2ConstAngularEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AngularEnergyDelete(ConstHandle2ConstAngularEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AngularEnergyRead(ConstHandle2AngularEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AngularEnergyWrite(ConstHandle2ConstAngularEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AngularEnergyPrint(ConstHandle2ConstAngularEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AngularEnergyPrintXML(ConstHandle2ConstAngularEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AngularEnergyPrintJSON(ConstHandle2ConstAngularEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AngularEnergyLabelHas(ConstHandle2ConstAngularEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +AngularEnergyLabelGet(ConstHandle2ConstAngularEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AngularEnergyLabelSet(ConstHandle2AngularEnergy self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +AngularEnergyProductFrameHas(ConstHandle2ConstAngularEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +AngularEnergyProductFrameGet(ConstHandle2ConstAngularEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +AngularEnergyProductFrameSet(ConstHandle2AngularEnergy self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs3d +// ----------------------------------------------------------------------------- + +// Has +int +AngularEnergyXYs3dHas(ConstHandle2ConstAngularEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs3dHas", self, extract::XYs3d); +} + +// Get, const +Handle2ConstXYs3d +AngularEnergyXYs3dGetConst(ConstHandle2ConstAngularEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs3dGetConst", self, extract::XYs3d); +} + +// Get, non-const +Handle2XYs3d +AngularEnergyXYs3dGet(ConstHandle2AngularEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs3dGet", self, extract::XYs3d); +} + +// Set +void +AngularEnergyXYs3dSet(ConstHandle2AngularEnergy self, ConstHandle2ConstXYs3d XYs3d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs3dSet", self, extract::XYs3d, XYs3d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AngularEnergy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularEnergy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularEnergy.h new file mode 100644 index 000000000..0c95510ab --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularEnergy.h @@ -0,0 +1,201 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// AngularEnergy is the basic handle type in this file. Example: +// // Create a default AngularEnergy object: +// AngularEnergy handle = AngularEnergyDefault(); +// Functions involving AngularEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ANGULARENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_ANGULARENERGY + +#include "GNDStk.h" +#include "v2.0/general/XYs3d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AngularEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AngularEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AngularEnergyClass *AngularEnergy; + +// --- Const-aware handles. +typedef const struct AngularEnergyClass *const ConstHandle2ConstAngularEnergy; +typedef struct AngularEnergyClass *const ConstHandle2AngularEnergy; +typedef const struct AngularEnergyClass * Handle2ConstAngularEnergy; +typedef struct AngularEnergyClass * Handle2AngularEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAngularEnergy +AngularEnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2AngularEnergy +AngularEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstAngularEnergy +AngularEnergyCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs3d XYs3d +); + +// +++ Create, general, non-const +extern_c Handle2AngularEnergy +AngularEnergyCreate( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs3d XYs3d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AngularEnergyAssign(ConstHandle2AngularEnergy self, ConstHandle2ConstAngularEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AngularEnergyDelete(ConstHandle2ConstAngularEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AngularEnergyRead(ConstHandle2AngularEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AngularEnergyWrite(ConstHandle2ConstAngularEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AngularEnergyPrint(ConstHandle2ConstAngularEnergy self); + +// +++ Print to standard output, as XML +extern_c int +AngularEnergyPrintXML(ConstHandle2ConstAngularEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +AngularEnergyPrintJSON(ConstHandle2ConstAngularEnergy self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularEnergyLabelHas(ConstHandle2ConstAngularEnergy self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AngularEnergyLabelGet(ConstHandle2ConstAngularEnergy self); + +// +++ Set +extern_c void +AngularEnergyLabelSet(ConstHandle2AngularEnergy self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularEnergyProductFrameHas(ConstHandle2ConstAngularEnergy self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AngularEnergyProductFrameGet(ConstHandle2ConstAngularEnergy self); + +// +++ Set +extern_c void +AngularEnergyProductFrameSet(ConstHandle2AngularEnergy self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Child: XYs3d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularEnergyXYs3dHas(ConstHandle2ConstAngularEnergy self); + +// --- Get, const +extern_c Handle2ConstXYs3d +AngularEnergyXYs3dGetConst(ConstHandle2ConstAngularEnergy self); + +// +++ Get, non-const +extern_c Handle2XYs3d +AngularEnergyXYs3dGet(ConstHandle2AngularEnergy self); + +// +++ Set +extern_c void +AngularEnergyXYs3dSet(ConstHandle2AngularEnergy self, ConstHandle2ConstXYs3d XYs3d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AngularEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularEnergy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularEnergy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularTwoBody.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularTwoBody.cpp new file mode 100644 index 000000000..980dcef38 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularTwoBody.cpp @@ -0,0 +1,380 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/AngularTwoBody.hpp" +#include "AngularTwoBody.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AngularTwoBodyClass; +using CPP = multigroup::AngularTwoBody; + +static const std::string CLASSNAME = "AngularTwoBody"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; + static auto regions2d = [](auto &obj) { return &obj.regions2d; }; + static auto recoil = [](auto &obj) { return &obj.recoil; }; + static auto isotropic2d = [](auto &obj) { return &obj.isotropic2d; }; +} + +using CPPXYs2d = general::XYs2d; +using CPPRegions2d = general::Regions2d; +using CPPRecoil = general::Recoil; +using CPPIsotropic2d = general::Isotropic2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAngularTwoBody +AngularTwoBodyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2AngularTwoBody +AngularTwoBodyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAngularTwoBody +AngularTwoBodyCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstRecoil recoil, + ConstHandle2ConstIsotropic2d isotropic2d +) { + ConstHandle2AngularTwoBody handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(XYs2d), + detail::tocpp(regions2d), + detail::tocpp(recoil), + detail::tocpp(isotropic2d) + ); + return handle; +} + +// Create, general, non-const +Handle2AngularTwoBody +AngularTwoBodyCreate( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstRecoil recoil, + ConstHandle2ConstIsotropic2d isotropic2d +) { + ConstHandle2AngularTwoBody handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(XYs2d), + detail::tocpp(regions2d), + detail::tocpp(recoil), + detail::tocpp(isotropic2d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AngularTwoBodyAssign(ConstHandle2AngularTwoBody self, ConstHandle2ConstAngularTwoBody from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AngularTwoBodyDelete(ConstHandle2ConstAngularTwoBody self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AngularTwoBodyRead(ConstHandle2AngularTwoBody self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AngularTwoBodyWrite(ConstHandle2ConstAngularTwoBody self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AngularTwoBodyPrint(ConstHandle2ConstAngularTwoBody self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AngularTwoBodyPrintXML(ConstHandle2ConstAngularTwoBody self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AngularTwoBodyPrintJSON(ConstHandle2ConstAngularTwoBody self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AngularTwoBodyLabelHas(ConstHandle2ConstAngularTwoBody self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +AngularTwoBodyLabelGet(ConstHandle2ConstAngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AngularTwoBodyLabelSet(ConstHandle2AngularTwoBody self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +AngularTwoBodyProductFrameHas(ConstHandle2ConstAngularTwoBody self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +AngularTwoBodyProductFrameGet(ConstHandle2ConstAngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +AngularTwoBodyProductFrameSet(ConstHandle2AngularTwoBody self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +AngularTwoBodyXYs2dHas(ConstHandle2ConstAngularTwoBody self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +AngularTwoBodyXYs2dGetConst(ConstHandle2ConstAngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +AngularTwoBodyXYs2dGet(ConstHandle2AngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +AngularTwoBodyXYs2dSet(ConstHandle2AngularTwoBody self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions2d +// ----------------------------------------------------------------------------- + +// Has +int +AngularTwoBodyRegions2dHas(ConstHandle2ConstAngularTwoBody self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions2dHas", self, extract::regions2d); +} + +// Get, const +Handle2ConstRegions2d +AngularTwoBodyRegions2dGetConst(ConstHandle2ConstAngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions2dGetConst", self, extract::regions2d); +} + +// Get, non-const +Handle2Regions2d +AngularTwoBodyRegions2dGet(ConstHandle2AngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions2dGet", self, extract::regions2d); +} + +// Set +void +AngularTwoBodyRegions2dSet(ConstHandle2AngularTwoBody self, ConstHandle2ConstRegions2d regions2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions2dSet", self, extract::regions2d, regions2d); +} + + +// ----------------------------------------------------------------------------- +// Child: recoil +// ----------------------------------------------------------------------------- + +// Has +int +AngularTwoBodyRecoilHas(ConstHandle2ConstAngularTwoBody self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RecoilHas", self, extract::recoil); +} + +// Get, const +Handle2ConstRecoil +AngularTwoBodyRecoilGetConst(ConstHandle2ConstAngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RecoilGetConst", self, extract::recoil); +} + +// Get, non-const +Handle2Recoil +AngularTwoBodyRecoilGet(ConstHandle2AngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RecoilGet", self, extract::recoil); +} + +// Set +void +AngularTwoBodyRecoilSet(ConstHandle2AngularTwoBody self, ConstHandle2ConstRecoil recoil) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RecoilSet", self, extract::recoil, recoil); +} + + +// ----------------------------------------------------------------------------- +// Child: isotropic2d +// ----------------------------------------------------------------------------- + +// Has +int +AngularTwoBodyIsotropic2dHas(ConstHandle2ConstAngularTwoBody self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Isotropic2dHas", self, extract::isotropic2d); +} + +// Get, const +Handle2ConstIsotropic2d +AngularTwoBodyIsotropic2dGetConst(ConstHandle2ConstAngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Isotropic2dGetConst", self, extract::isotropic2d); +} + +// Get, non-const +Handle2Isotropic2d +AngularTwoBodyIsotropic2dGet(ConstHandle2AngularTwoBody self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Isotropic2dGet", self, extract::isotropic2d); +} + +// Set +void +AngularTwoBodyIsotropic2dSet(ConstHandle2AngularTwoBody self, ConstHandle2ConstIsotropic2d isotropic2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Isotropic2dSet", self, extract::isotropic2d, isotropic2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AngularTwoBody/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularTwoBody.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularTwoBody.h new file mode 100644 index 000000000..94f65129a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularTwoBody.h @@ -0,0 +1,273 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// AngularTwoBody is the basic handle type in this file. Example: +// // Create a default AngularTwoBody object: +// AngularTwoBody handle = AngularTwoBodyDefault(); +// Functions involving AngularTwoBody are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ANGULARTWOBODY +#define C_INTERFACE_GNDS_V2_0_GENERAL_ANGULARTWOBODY + +#include "GNDStk.h" +#include "v2.0/general/XYs2d.h" +#include "v2.0/general/Regions2d.h" +#include "v2.0/general/Recoil.h" +#include "v2.0/general/Isotropic2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AngularTwoBodyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AngularTwoBody +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AngularTwoBodyClass *AngularTwoBody; + +// --- Const-aware handles. +typedef const struct AngularTwoBodyClass *const ConstHandle2ConstAngularTwoBody; +typedef struct AngularTwoBodyClass *const ConstHandle2AngularTwoBody; +typedef const struct AngularTwoBodyClass * Handle2ConstAngularTwoBody; +typedef struct AngularTwoBodyClass * Handle2AngularTwoBody; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAngularTwoBody +AngularTwoBodyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2AngularTwoBody +AngularTwoBodyDefault(); + +// --- Create, general, const +extern_c Handle2ConstAngularTwoBody +AngularTwoBodyCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstRecoil recoil, + ConstHandle2ConstIsotropic2d isotropic2d +); + +// +++ Create, general, non-const +extern_c Handle2AngularTwoBody +AngularTwoBodyCreate( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstRecoil recoil, + ConstHandle2ConstIsotropic2d isotropic2d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AngularTwoBodyAssign(ConstHandle2AngularTwoBody self, ConstHandle2ConstAngularTwoBody from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AngularTwoBodyDelete(ConstHandle2ConstAngularTwoBody self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AngularTwoBodyRead(ConstHandle2AngularTwoBody self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AngularTwoBodyWrite(ConstHandle2ConstAngularTwoBody self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AngularTwoBodyPrint(ConstHandle2ConstAngularTwoBody self); + +// +++ Print to standard output, as XML +extern_c int +AngularTwoBodyPrintXML(ConstHandle2ConstAngularTwoBody self); + +// +++ Print to standard output, as JSON +extern_c int +AngularTwoBodyPrintJSON(ConstHandle2ConstAngularTwoBody self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularTwoBodyLabelHas(ConstHandle2ConstAngularTwoBody self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AngularTwoBodyLabelGet(ConstHandle2ConstAngularTwoBody self); + +// +++ Set +extern_c void +AngularTwoBodyLabelSet(ConstHandle2AngularTwoBody self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularTwoBodyProductFrameHas(ConstHandle2ConstAngularTwoBody self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AngularTwoBodyProductFrameGet(ConstHandle2ConstAngularTwoBody self); + +// +++ Set +extern_c void +AngularTwoBodyProductFrameSet(ConstHandle2AngularTwoBody self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularTwoBodyXYs2dHas(ConstHandle2ConstAngularTwoBody self); + +// --- Get, const +extern_c Handle2ConstXYs2d +AngularTwoBodyXYs2dGetConst(ConstHandle2ConstAngularTwoBody self); + +// +++ Get, non-const +extern_c Handle2XYs2d +AngularTwoBodyXYs2dGet(ConstHandle2AngularTwoBody self); + +// +++ Set +extern_c void +AngularTwoBodyXYs2dSet(ConstHandle2AngularTwoBody self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Child: regions2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularTwoBodyRegions2dHas(ConstHandle2ConstAngularTwoBody self); + +// --- Get, const +extern_c Handle2ConstRegions2d +AngularTwoBodyRegions2dGetConst(ConstHandle2ConstAngularTwoBody self); + +// +++ Get, non-const +extern_c Handle2Regions2d +AngularTwoBodyRegions2dGet(ConstHandle2AngularTwoBody self); + +// +++ Set +extern_c void +AngularTwoBodyRegions2dSet(ConstHandle2AngularTwoBody self, ConstHandle2ConstRegions2d regions2d); + + +// ----------------------------------------------------------------------------- +// Child: recoil +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularTwoBodyRecoilHas(ConstHandle2ConstAngularTwoBody self); + +// --- Get, const +extern_c Handle2ConstRecoil +AngularTwoBodyRecoilGetConst(ConstHandle2ConstAngularTwoBody self); + +// +++ Get, non-const +extern_c Handle2Recoil +AngularTwoBodyRecoilGet(ConstHandle2AngularTwoBody self); + +// +++ Set +extern_c void +AngularTwoBodyRecoilSet(ConstHandle2AngularTwoBody self, ConstHandle2ConstRecoil recoil); + + +// ----------------------------------------------------------------------------- +// Child: isotropic2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AngularTwoBodyIsotropic2dHas(ConstHandle2ConstAngularTwoBody self); + +// --- Get, const +extern_c Handle2ConstIsotropic2d +AngularTwoBodyIsotropic2dGetConst(ConstHandle2ConstAngularTwoBody self); + +// +++ Get, non-const +extern_c Handle2Isotropic2d +AngularTwoBodyIsotropic2dGet(ConstHandle2AngularTwoBody self); + +// +++ Set +extern_c void +AngularTwoBodyIsotropic2dSet(ConstHandle2AngularTwoBody self, ConstHandle2ConstIsotropic2d isotropic2d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AngularTwoBody/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularTwoBody/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularTwoBody/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularTwoBody/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AngularTwoBody/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ApplicationData.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ApplicationData.cpp new file mode 100644 index 000000000..e3bc1e2f4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ApplicationData.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ApplicationData.hpp" +#include "ApplicationData.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ApplicationDataClass; +using CPP = multigroup::ApplicationData; + +static const std::string CLASSNAME = "ApplicationData"; + +namespace extract { + static auto institution = [](auto &obj) { return &obj.institution; }; +} + +using CPPInstitution = general::Institution; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstApplicationData +ApplicationDataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ApplicationData +ApplicationDataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstApplicationData +ApplicationDataCreateConst( + ConstHandle2ConstInstitution institution +) { + ConstHandle2ApplicationData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(institution) + ); + return handle; +} + +// Create, general, non-const +Handle2ApplicationData +ApplicationDataCreate( + ConstHandle2ConstInstitution institution +) { + ConstHandle2ApplicationData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(institution) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ApplicationDataAssign(ConstHandle2ApplicationData self, ConstHandle2ConstApplicationData from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ApplicationDataDelete(ConstHandle2ConstApplicationData self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ApplicationDataRead(ConstHandle2ApplicationData self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ApplicationDataWrite(ConstHandle2ConstApplicationData self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ApplicationDataPrint(ConstHandle2ConstApplicationData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ApplicationDataPrintXML(ConstHandle2ConstApplicationData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ApplicationDataPrintJSON(ConstHandle2ConstApplicationData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: institution +// ----------------------------------------------------------------------------- + +// Has +int +ApplicationDataInstitutionHas(ConstHandle2ConstApplicationData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InstitutionHas", self, extract::institution); +} + +// Get, const +Handle2ConstInstitution +ApplicationDataInstitutionGetConst(ConstHandle2ConstApplicationData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InstitutionGetConst", self, extract::institution); +} + +// Get, non-const +Handle2Institution +ApplicationDataInstitutionGet(ConstHandle2ApplicationData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InstitutionGet", self, extract::institution); +} + +// Set +void +ApplicationDataInstitutionSet(ConstHandle2ApplicationData self, ConstHandle2ConstInstitution institution) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InstitutionSet", self, extract::institution, institution); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ApplicationData/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ApplicationData.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ApplicationData.h new file mode 100644 index 000000000..d657bb70f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ApplicationData.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ApplicationData is the basic handle type in this file. Example: +// // Create a default ApplicationData object: +// ApplicationData handle = ApplicationDataDefault(); +// Functions involving ApplicationData are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_APPLICATIONDATA +#define C_INTERFACE_GNDS_V2_0_GENERAL_APPLICATIONDATA + +#include "GNDStk.h" +#include "v2.0/general/Institution.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ApplicationDataClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ApplicationData +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ApplicationDataClass *ApplicationData; + +// --- Const-aware handles. +typedef const struct ApplicationDataClass *const ConstHandle2ConstApplicationData; +typedef struct ApplicationDataClass *const ConstHandle2ApplicationData; +typedef const struct ApplicationDataClass * Handle2ConstApplicationData; +typedef struct ApplicationDataClass * Handle2ApplicationData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstApplicationData +ApplicationDataDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ApplicationData +ApplicationDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstApplicationData +ApplicationDataCreateConst( + ConstHandle2ConstInstitution institution +); + +// +++ Create, general, non-const +extern_c Handle2ApplicationData +ApplicationDataCreate( + ConstHandle2ConstInstitution institution +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ApplicationDataAssign(ConstHandle2ApplicationData self, ConstHandle2ConstApplicationData from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ApplicationDataDelete(ConstHandle2ConstApplicationData self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ApplicationDataRead(ConstHandle2ApplicationData self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ApplicationDataWrite(ConstHandle2ConstApplicationData self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ApplicationDataPrint(ConstHandle2ConstApplicationData self); + +// +++ Print to standard output, as XML +extern_c int +ApplicationDataPrintXML(ConstHandle2ConstApplicationData self); + +// +++ Print to standard output, as JSON +extern_c int +ApplicationDataPrintJSON(ConstHandle2ConstApplicationData self); + + +// ----------------------------------------------------------------------------- +// Child: institution +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ApplicationDataInstitutionHas(ConstHandle2ConstApplicationData self); + +// --- Get, const +extern_c Handle2ConstInstitution +ApplicationDataInstitutionGetConst(ConstHandle2ConstApplicationData self); + +// +++ Get, non-const +extern_c Handle2Institution +ApplicationDataInstitutionGet(ConstHandle2ApplicationData self); + +// +++ Set +extern_c void +ApplicationDataInstitutionSet(ConstHandle2ApplicationData self, ConstHandle2ConstInstitution institution); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ApplicationData/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ApplicationData/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ApplicationData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ApplicationData/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ApplicationData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Array.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Array.cpp new file mode 100644 index 000000000..4e0133c73 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Array.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Array.hpp" +#include "Array.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ArrayClass; +using CPP = multigroup::Array; + +static const std::string CLASSNAME = "Array"; + +namespace extract { + static auto shape = [](auto &obj) { return &obj.shape; }; + static auto compression = [](auto &obj) { return &obj.compression; }; + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPValues = general::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstArray +ArrayDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Array +ArrayDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstArray +ArrayCreateConst( + const char *const shape, + const char *const compression, + ConstHandle2ConstValues values +) { + ConstHandle2Array handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + shape, + compression, + detail::tocpp(values) + ); + return handle; +} + +// Create, general, non-const +Handle2Array +ArrayCreate( + const char *const shape, + const char *const compression, + ConstHandle2ConstValues values +) { + ConstHandle2Array handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + shape, + compression, + detail::tocpp(values) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ArrayAssign(ConstHandle2Array self, ConstHandle2ConstArray from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ArrayDelete(ConstHandle2ConstArray self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ArrayRead(ConstHandle2Array self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ArrayWrite(ConstHandle2ConstArray self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ArrayPrint(ConstHandle2ConstArray self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ArrayPrintXML(ConstHandle2ConstArray self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ArrayPrintJSON(ConstHandle2ConstArray self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: shape +// ----------------------------------------------------------------------------- + +// Has +int +ArrayShapeHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ShapeHas", self, extract::shape); +} + +// Get +// Returns by value +const char * +ArrayShapeGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ShapeGet", self, extract::shape); +} + +// Set +void +ArrayShapeSet(ConstHandle2Array self, const char *const shape) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ShapeSet", self, extract::shape, shape); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: compression +// ----------------------------------------------------------------------------- + +// Has +int +ArrayCompressionHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CompressionHas", self, extract::compression); +} + +// Get +// Returns by value +const char * +ArrayCompressionGet(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CompressionGet", self, extract::compression); +} + +// Set +void +ArrayCompressionSet(ConstHandle2Array self, const char *const compression) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CompressionSet", self, extract::compression, compression); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +ArrayValuesHas(ConstHandle2ConstArray self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +ArrayValuesGetConst(ConstHandle2ConstArray self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +ArrayValuesGet(ConstHandle2Array self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +ArrayValuesSet(ConstHandle2Array self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Array/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Array.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Array.h new file mode 100644 index 000000000..3b3ed41ee --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Array.h @@ -0,0 +1,201 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Array is the basic handle type in this file. Example: +// // Create a default Array object: +// Array handle = ArrayDefault(); +// Functions involving Array are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ARRAY +#define C_INTERFACE_GNDS_V2_0_GENERAL_ARRAY + +#include "GNDStk.h" +#include "v2.0/general/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ArrayClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Array +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ArrayClass *Array; + +// --- Const-aware handles. +typedef const struct ArrayClass *const ConstHandle2ConstArray; +typedef struct ArrayClass *const ConstHandle2Array; +typedef const struct ArrayClass * Handle2ConstArray; +typedef struct ArrayClass * Handle2Array; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstArray +ArrayDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Array +ArrayDefault(); + +// --- Create, general, const +extern_c Handle2ConstArray +ArrayCreateConst( + const char *const shape, + const char *const compression, + ConstHandle2ConstValues values +); + +// +++ Create, general, non-const +extern_c Handle2Array +ArrayCreate( + const char *const shape, + const char *const compression, + ConstHandle2ConstValues values +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ArrayAssign(ConstHandle2Array self, ConstHandle2ConstArray from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ArrayDelete(ConstHandle2ConstArray self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ArrayRead(ConstHandle2Array self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ArrayWrite(ConstHandle2ConstArray self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ArrayPrint(ConstHandle2ConstArray self); + +// +++ Print to standard output, as XML +extern_c int +ArrayPrintXML(ConstHandle2ConstArray self); + +// +++ Print to standard output, as JSON +extern_c int +ArrayPrintJSON(ConstHandle2ConstArray self); + + +// ----------------------------------------------------------------------------- +// Metadatum: shape +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayShapeHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ArrayShapeGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArrayShapeSet(ConstHandle2Array self, const char *const shape); + + +// ----------------------------------------------------------------------------- +// Metadatum: compression +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayCompressionHas(ConstHandle2ConstArray self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ArrayCompressionGet(ConstHandle2ConstArray self); + +// +++ Set +extern_c void +ArrayCompressionSet(ConstHandle2Array self, const char *const compression); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ArrayValuesHas(ConstHandle2ConstArray self); + +// --- Get, const +extern_c Handle2ConstValues +ArrayValuesGetConst(ConstHandle2ConstArray self); + +// +++ Get, non-const +extern_c Handle2Values +ArrayValuesGet(ConstHandle2Array self); + +// +++ Set +extern_c void +ArrayValuesSet(ConstHandle2Array self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Array/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Array/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Array/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Array/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Array/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Atomic.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Atomic.cpp new file mode 100644 index 000000000..b663f68bb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Atomic.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Atomic.hpp" +#include "Atomic.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AtomicClass; +using CPP = multigroup::Atomic; + +static const std::string CLASSNAME = "Atomic"; + +namespace extract { + static auto configurations = [](auto &obj) { return &obj.configurations; }; +} + +using CPPConfigurations = general::Configurations; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAtomic +AtomicDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Atomic +AtomicDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAtomic +AtomicCreateConst( + ConstHandle2ConstConfigurations configurations +) { + ConstHandle2Atomic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(configurations) + ); + return handle; +} + +// Create, general, non-const +Handle2Atomic +AtomicCreate( + ConstHandle2ConstConfigurations configurations +) { + ConstHandle2Atomic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(configurations) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AtomicAssign(ConstHandle2Atomic self, ConstHandle2ConstAtomic from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AtomicDelete(ConstHandle2ConstAtomic self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AtomicRead(ConstHandle2Atomic self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AtomicWrite(ConstHandle2ConstAtomic self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AtomicPrint(ConstHandle2ConstAtomic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AtomicPrintXML(ConstHandle2ConstAtomic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AtomicPrintJSON(ConstHandle2ConstAtomic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: configurations +// ----------------------------------------------------------------------------- + +// Has +int +AtomicConfigurationsHas(ConstHandle2ConstAtomic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ConfigurationsHas", self, extract::configurations); +} + +// Get, const +Handle2ConstConfigurations +AtomicConfigurationsGetConst(ConstHandle2ConstAtomic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConfigurationsGetConst", self, extract::configurations); +} + +// Get, non-const +Handle2Configurations +AtomicConfigurationsGet(ConstHandle2Atomic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ConfigurationsGet", self, extract::configurations); +} + +// Set +void +AtomicConfigurationsSet(ConstHandle2Atomic self, ConstHandle2ConstConfigurations configurations) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ConfigurationsSet", self, extract::configurations, configurations); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Atomic/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Atomic.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Atomic.h new file mode 100644 index 000000000..341ffae99 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Atomic.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Atomic is the basic handle type in this file. Example: +// // Create a default Atomic object: +// Atomic handle = AtomicDefault(); +// Functions involving Atomic are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ATOMIC +#define C_INTERFACE_GNDS_V2_0_GENERAL_ATOMIC + +#include "GNDStk.h" +#include "v2.0/general/Configurations.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AtomicClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Atomic +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AtomicClass *Atomic; + +// --- Const-aware handles. +typedef const struct AtomicClass *const ConstHandle2ConstAtomic; +typedef struct AtomicClass *const ConstHandle2Atomic; +typedef const struct AtomicClass * Handle2ConstAtomic; +typedef struct AtomicClass * Handle2Atomic; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAtomic +AtomicDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Atomic +AtomicDefault(); + +// --- Create, general, const +extern_c Handle2ConstAtomic +AtomicCreateConst( + ConstHandle2ConstConfigurations configurations +); + +// +++ Create, general, non-const +extern_c Handle2Atomic +AtomicCreate( + ConstHandle2ConstConfigurations configurations +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AtomicAssign(ConstHandle2Atomic self, ConstHandle2ConstAtomic from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AtomicDelete(ConstHandle2ConstAtomic self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AtomicRead(ConstHandle2Atomic self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AtomicWrite(ConstHandle2ConstAtomic self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AtomicPrint(ConstHandle2ConstAtomic self); + +// +++ Print to standard output, as XML +extern_c int +AtomicPrintXML(ConstHandle2ConstAtomic self); + +// +++ Print to standard output, as JSON +extern_c int +AtomicPrintJSON(ConstHandle2ConstAtomic self); + + +// ----------------------------------------------------------------------------- +// Child: configurations +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AtomicConfigurationsHas(ConstHandle2ConstAtomic self); + +// --- Get, const +extern_c Handle2ConstConfigurations +AtomicConfigurationsGetConst(ConstHandle2ConstAtomic self); + +// +++ Get, non-const +extern_c Handle2Configurations +AtomicConfigurationsGet(ConstHandle2Atomic self); + +// +++ Set +extern_c void +AtomicConfigurationsSet(ConstHandle2Atomic self, ConstHandle2ConstConfigurations configurations); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Atomic/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Atomic/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Atomic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Atomic/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Atomic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Author.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Author.cpp new file mode 100644 index 000000000..a11943bbe --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Author.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Author.hpp" +#include "Author.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AuthorClass; +using CPP = multigroup::Author; + +static const std::string CLASSNAME = "Author"; + +namespace extract { + static auto name = [](auto &obj) { return &obj.name; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAuthor +AuthorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Author +AuthorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAuthor +AuthorCreateConst( + const char *const name +) { + ConstHandle2Author handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + name + ); + return handle; +} + +// Create, general, non-const +Handle2Author +AuthorCreate( + const char *const name +) { + ConstHandle2Author handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + name + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AuthorAssign(ConstHandle2Author self, ConstHandle2ConstAuthor from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AuthorDelete(ConstHandle2ConstAuthor self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AuthorRead(ConstHandle2Author self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AuthorWrite(ConstHandle2ConstAuthor self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AuthorPrint(ConstHandle2ConstAuthor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AuthorPrintXML(ConstHandle2ConstAuthor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AuthorPrintJSON(ConstHandle2ConstAuthor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// Has +int +AuthorNameHas(ConstHandle2ConstAuthor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NameHas", self, extract::name); +} + +// Get +// Returns by value +const char * +AuthorNameGet(ConstHandle2ConstAuthor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +AuthorNameSet(ConstHandle2Author self, const char *const name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Author/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Author.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Author.h new file mode 100644 index 000000000..9928417e1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Author.h @@ -0,0 +1,157 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Author is the basic handle type in this file. Example: +// // Create a default Author object: +// Author handle = AuthorDefault(); +// Functions involving Author are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_AUTHOR +#define C_INTERFACE_GNDS_V2_0_GENERAL_AUTHOR + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AuthorClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Author +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AuthorClass *Author; + +// --- Const-aware handles. +typedef const struct AuthorClass *const ConstHandle2ConstAuthor; +typedef struct AuthorClass *const ConstHandle2Author; +typedef const struct AuthorClass * Handle2ConstAuthor; +typedef struct AuthorClass * Handle2Author; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAuthor +AuthorDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Author +AuthorDefault(); + +// --- Create, general, const +extern_c Handle2ConstAuthor +AuthorCreateConst( + const char *const name +); + +// +++ Create, general, non-const +extern_c Handle2Author +AuthorCreate( + const char *const name +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AuthorAssign(ConstHandle2Author self, ConstHandle2ConstAuthor from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AuthorDelete(ConstHandle2ConstAuthor self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AuthorRead(ConstHandle2Author self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AuthorWrite(ConstHandle2ConstAuthor self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AuthorPrint(ConstHandle2ConstAuthor self); + +// +++ Print to standard output, as XML +extern_c int +AuthorPrintXML(ConstHandle2ConstAuthor self); + +// +++ Print to standard output, as JSON +extern_c int +AuthorPrintJSON(ConstHandle2ConstAuthor self); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AuthorNameHas(ConstHandle2ConstAuthor self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AuthorNameGet(ConstHandle2ConstAuthor self); + +// +++ Set +extern_c void +AuthorNameSet(ConstHandle2Author self, const char *const name); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Author/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Author/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Author/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Author/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Author/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Authors.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Authors.cpp new file mode 100644 index 000000000..61bd9d8a9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Authors.cpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Authors.hpp" +#include "Authors.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AuthorsClass; +using CPP = multigroup::Authors; + +static const std::string CLASSNAME = "Authors"; + +namespace extract { + static auto author = [](auto &obj) { return &obj.author; }; +} + +using CPPAuthor = general::Author; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAuthors +AuthorsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Authors +AuthorsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAuthors +AuthorsCreateConst( + ConstHandle2Author *const author, const size_t authorSize +) { + ConstHandle2Authors handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t AuthorN = 0; AuthorN < authorSize; ++AuthorN) + AuthorsAuthorAdd(handle, author[AuthorN]); + return handle; +} + +// Create, general, non-const +Handle2Authors +AuthorsCreate( + ConstHandle2Author *const author, const size_t authorSize +) { + ConstHandle2Authors handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t AuthorN = 0; AuthorN < authorSize; ++AuthorN) + AuthorsAuthorAdd(handle, author[AuthorN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AuthorsAssign(ConstHandle2Authors self, ConstHandle2ConstAuthors from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AuthorsDelete(ConstHandle2ConstAuthors self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AuthorsRead(ConstHandle2Authors self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AuthorsWrite(ConstHandle2ConstAuthors self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AuthorsPrint(ConstHandle2ConstAuthors self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AuthorsPrintXML(ConstHandle2ConstAuthors self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AuthorsPrintJSON(ConstHandle2ConstAuthors self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: author +// ----------------------------------------------------------------------------- + +// Has +int +AuthorsAuthorHas(ConstHandle2ConstAuthors self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AuthorHas", self, extract::author); +} + +// Clear +void +AuthorsAuthorClear(ConstHandle2Authors self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"AuthorClear", self, extract::author); +} + +// Size +size_t +AuthorsAuthorSize(ConstHandle2ConstAuthors self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"AuthorSize", self, extract::author); +} + +// Add +void +AuthorsAuthorAdd(ConstHandle2Authors self, ConstHandle2ConstAuthor author) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"AuthorAdd", self, extract::author, author); +} + +// Get, by index \in [0,size), const +Handle2ConstAuthor +AuthorsAuthorGetConst(ConstHandle2ConstAuthors self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AuthorGetConst", self, extract::author, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Author +AuthorsAuthorGet(ConstHandle2Authors self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AuthorGet", self, extract::author, index_); +} + +// Set, by index \in [0,size) +void +AuthorsAuthorSet( + ConstHandle2Authors self, + const size_t index_, + ConstHandle2ConstAuthor author +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"AuthorSet", self, extract::author, index_, author); +} + +// ------------------------ +// Re: metadatum name +// ------------------------ + +// Has, by name +int +AuthorsAuthorHasByName( + ConstHandle2ConstAuthors self, + const char *const name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AuthorHasByName", + self, extract::author, meta::name, name); +} + +// Get, by name, const +Handle2ConstAuthor +AuthorsAuthorGetByNameConst( + ConstHandle2ConstAuthors self, + const char *const name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByNameConst", + self, extract::author, meta::name, name); +} + +// Get, by name, non-const +Handle2Author +AuthorsAuthorGetByName( + ConstHandle2Authors self, + const char *const name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AuthorGetByName", + self, extract::author, meta::name, name); +} + +// Set, by name +void +AuthorsAuthorSetByName( + ConstHandle2Authors self, + const char *const name, + ConstHandle2ConstAuthor author +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AuthorSetByName", + self, extract::author, meta::name, name, author); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Authors/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Authors.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Authors.h new file mode 100644 index 000000000..ea4001c25 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Authors.h @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Authors is the basic handle type in this file. Example: +// // Create a default Authors object: +// Authors handle = AuthorsDefault(); +// Functions involving Authors are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_AUTHORS +#define C_INTERFACE_GNDS_V2_0_GENERAL_AUTHORS + +#include "GNDStk.h" +#include "v2.0/general/Author.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AuthorsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Authors +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AuthorsClass *Authors; + +// --- Const-aware handles. +typedef const struct AuthorsClass *const ConstHandle2ConstAuthors; +typedef struct AuthorsClass *const ConstHandle2Authors; +typedef const struct AuthorsClass * Handle2ConstAuthors; +typedef struct AuthorsClass * Handle2Authors; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAuthors +AuthorsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Authors +AuthorsDefault(); + +// --- Create, general, const +extern_c Handle2ConstAuthors +AuthorsCreateConst( + ConstHandle2Author *const author, const size_t authorSize +); + +// +++ Create, general, non-const +extern_c Handle2Authors +AuthorsCreate( + ConstHandle2Author *const author, const size_t authorSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AuthorsAssign(ConstHandle2Authors self, ConstHandle2ConstAuthors from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AuthorsDelete(ConstHandle2ConstAuthors self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AuthorsRead(ConstHandle2Authors self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AuthorsWrite(ConstHandle2ConstAuthors self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AuthorsPrint(ConstHandle2ConstAuthors self); + +// +++ Print to standard output, as XML +extern_c int +AuthorsPrintXML(ConstHandle2ConstAuthors self); + +// +++ Print to standard output, as JSON +extern_c int +AuthorsPrintJSON(ConstHandle2ConstAuthors self); + + +// ----------------------------------------------------------------------------- +// Child: author +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AuthorsAuthorHas(ConstHandle2ConstAuthors self); + +// +++ Clear +extern_c void +AuthorsAuthorClear(ConstHandle2Authors self); + +// +++ Size +extern_c size_t +AuthorsAuthorSize(ConstHandle2ConstAuthors self); + +// +++ Add +extern_c void +AuthorsAuthorAdd(ConstHandle2Authors self, ConstHandle2ConstAuthor author); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstAuthor +AuthorsAuthorGetConst(ConstHandle2ConstAuthors self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Author +AuthorsAuthorGet(ConstHandle2Authors self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +AuthorsAuthorSet( + ConstHandle2Authors self, + const size_t index_, + ConstHandle2ConstAuthor author +); + +// ------------------------ +// Re: metadatum name +// ------------------------ + +// +++ Has, by name +extern_c int +AuthorsAuthorHasByName( + ConstHandle2ConstAuthors self, + const char *const name +); + +// --- Get, by name, const +extern_c Handle2ConstAuthor +AuthorsAuthorGetByNameConst( + ConstHandle2ConstAuthors self, + const char *const name +); + +// +++ Get, by name, non-const +extern_c Handle2Author +AuthorsAuthorGetByName( + ConstHandle2Authors self, + const char *const name +); + +// +++ Set, by name +extern_c void +AuthorsAuthorSetByName( + ConstHandle2Authors self, + const char *const name, + ConstHandle2ConstAuthor author +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Authors/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Authors/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Authors/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Authors/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Authors/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergies.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergies.cpp new file mode 100644 index 000000000..0f1c0acc4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergies.cpp @@ -0,0 +1,359 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/AverageEnergies.hpp" +#include "AverageEnergies.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AverageEnergiesClass; +using CPP = multigroup::AverageEnergies; + +static const std::string CLASSNAME = "AverageEnergies"; + +namespace extract { + static auto averageEnergy = [](auto &obj) { return &obj.averageEnergy; }; +} + +using CPPAverageEnergy = general::AverageEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAverageEnergies +AverageEnergiesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2AverageEnergies +AverageEnergiesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAverageEnergies +AverageEnergiesCreateConst( + ConstHandle2AverageEnergy *const averageEnergy, const size_t averageEnergySize +) { + ConstHandle2AverageEnergies handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t AverageEnergyN = 0; AverageEnergyN < averageEnergySize; ++AverageEnergyN) + AverageEnergiesAverageEnergyAdd(handle, averageEnergy[AverageEnergyN]); + return handle; +} + +// Create, general, non-const +Handle2AverageEnergies +AverageEnergiesCreate( + ConstHandle2AverageEnergy *const averageEnergy, const size_t averageEnergySize +) { + ConstHandle2AverageEnergies handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t AverageEnergyN = 0; AverageEnergyN < averageEnergySize; ++AverageEnergyN) + AverageEnergiesAverageEnergyAdd(handle, averageEnergy[AverageEnergyN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AverageEnergiesAssign(ConstHandle2AverageEnergies self, ConstHandle2ConstAverageEnergies from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AverageEnergiesDelete(ConstHandle2ConstAverageEnergies self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AverageEnergiesRead(ConstHandle2AverageEnergies self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AverageEnergiesWrite(ConstHandle2ConstAverageEnergies self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AverageEnergiesPrint(ConstHandle2ConstAverageEnergies self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AverageEnergiesPrintXML(ConstHandle2ConstAverageEnergies self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AverageEnergiesPrintJSON(ConstHandle2ConstAverageEnergies self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: averageEnergy +// ----------------------------------------------------------------------------- + +// Has +int +AverageEnergiesAverageEnergyHas(ConstHandle2ConstAverageEnergies self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AverageEnergyHas", self, extract::averageEnergy); +} + +// Clear +void +AverageEnergiesAverageEnergyClear(ConstHandle2AverageEnergies self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"AverageEnergyClear", self, extract::averageEnergy); +} + +// Size +size_t +AverageEnergiesAverageEnergySize(ConstHandle2ConstAverageEnergies self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"AverageEnergySize", self, extract::averageEnergy); +} + +// Add +void +AverageEnergiesAverageEnergyAdd(ConstHandle2AverageEnergies self, ConstHandle2ConstAverageEnergy averageEnergy) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"AverageEnergyAdd", self, extract::averageEnergy, averageEnergy); +} + +// Get, by index \in [0,size), const +Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetConst(ConstHandle2ConstAverageEnergies self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AverageEnergyGetConst", self, extract::averageEnergy, index_); +} + +// Get, by index \in [0,size), non-const +Handle2AverageEnergy +AverageEnergiesAverageEnergyGet(ConstHandle2AverageEnergies self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AverageEnergyGet", self, extract::averageEnergy, index_); +} + +// Set, by index \in [0,size) +void +AverageEnergiesAverageEnergySet( + ConstHandle2AverageEnergies self, + const size_t index_, + ConstHandle2ConstAverageEnergy averageEnergy +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"AverageEnergySet", self, extract::averageEnergy, index_, averageEnergy); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +AverageEnergiesAverageEnergyHasByLabel( + ConstHandle2ConstAverageEnergies self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyHasByLabel", + self, extract::averageEnergy, meta::label, label); +} + +// Get, by label, const +Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByLabelConst( + ConstHandle2ConstAverageEnergies self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByLabelConst", + self, extract::averageEnergy, meta::label, label); +} + +// Get, by label, non-const +Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByLabel( + ConstHandle2AverageEnergies self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByLabel", + self, extract::averageEnergy, meta::label, label); +} + +// Set, by label +void +AverageEnergiesAverageEnergySetByLabel( + ConstHandle2AverageEnergies self, + const char *const label, + ConstHandle2ConstAverageEnergy averageEnergy +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergySetByLabel", + self, extract::averageEnergy, meta::label, label, averageEnergy); +} + +// ------------------------ +// Re: metadatum value +// ------------------------ + +// Has, by value +int +AverageEnergiesAverageEnergyHasByValue( + ConstHandle2ConstAverageEnergies self, + const double value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyHasByValue", + self, extract::averageEnergy, meta::value, value); +} + +// Get, by value, const +Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByValueConst( + ConstHandle2ConstAverageEnergies self, + const double value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByValueConst", + self, extract::averageEnergy, meta::value, value); +} + +// Get, by value, non-const +Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByValue( + ConstHandle2AverageEnergies self, + const double value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByValue", + self, extract::averageEnergy, meta::value, value); +} + +// Set, by value +void +AverageEnergiesAverageEnergySetByValue( + ConstHandle2AverageEnergies self, + const double value, + ConstHandle2ConstAverageEnergy averageEnergy +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergySetByValue", + self, extract::averageEnergy, meta::value, value, averageEnergy); +} + +// ------------------------ +// Re: metadatum unit +// ------------------------ + +// Has, by unit +int +AverageEnergiesAverageEnergyHasByUnit( + ConstHandle2ConstAverageEnergies self, + const char *const unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyHasByUnit", + self, extract::averageEnergy, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByUnitConst( + ConstHandle2ConstAverageEnergies self, + const char *const unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByUnitConst", + self, extract::averageEnergy, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByUnit( + ConstHandle2AverageEnergies self, + const char *const unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergyGetByUnit", + self, extract::averageEnergy, meta::unit, unit); +} + +// Set, by unit +void +AverageEnergiesAverageEnergySetByUnit( + ConstHandle2AverageEnergies self, + const char *const unit, + ConstHandle2ConstAverageEnergy averageEnergy +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageEnergySetByUnit", + self, extract::averageEnergy, meta::unit, unit, averageEnergy); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AverageEnergies/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergies.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergies.h new file mode 100644 index 000000000..ef81995b4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergies.h @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// AverageEnergies is the basic handle type in this file. Example: +// // Create a default AverageEnergies object: +// AverageEnergies handle = AverageEnergiesDefault(); +// Functions involving AverageEnergies are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_AVERAGEENERGIES +#define C_INTERFACE_GNDS_V2_0_GENERAL_AVERAGEENERGIES + +#include "GNDStk.h" +#include "v2.0/general/AverageEnergy.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AverageEnergiesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AverageEnergies +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AverageEnergiesClass *AverageEnergies; + +// --- Const-aware handles. +typedef const struct AverageEnergiesClass *const ConstHandle2ConstAverageEnergies; +typedef struct AverageEnergiesClass *const ConstHandle2AverageEnergies; +typedef const struct AverageEnergiesClass * Handle2ConstAverageEnergies; +typedef struct AverageEnergiesClass * Handle2AverageEnergies; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAverageEnergies +AverageEnergiesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2AverageEnergies +AverageEnergiesDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageEnergies +AverageEnergiesCreateConst( + ConstHandle2AverageEnergy *const averageEnergy, const size_t averageEnergySize +); + +// +++ Create, general, non-const +extern_c Handle2AverageEnergies +AverageEnergiesCreate( + ConstHandle2AverageEnergy *const averageEnergy, const size_t averageEnergySize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AverageEnergiesAssign(ConstHandle2AverageEnergies self, ConstHandle2ConstAverageEnergies from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AverageEnergiesDelete(ConstHandle2ConstAverageEnergies self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AverageEnergiesRead(ConstHandle2AverageEnergies self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AverageEnergiesWrite(ConstHandle2ConstAverageEnergies self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AverageEnergiesPrint(ConstHandle2ConstAverageEnergies self); + +// +++ Print to standard output, as XML +extern_c int +AverageEnergiesPrintXML(ConstHandle2ConstAverageEnergies self); + +// +++ Print to standard output, as JSON +extern_c int +AverageEnergiesPrintJSON(ConstHandle2ConstAverageEnergies self); + + +// ----------------------------------------------------------------------------- +// Child: averageEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageEnergiesAverageEnergyHas(ConstHandle2ConstAverageEnergies self); + +// +++ Clear +extern_c void +AverageEnergiesAverageEnergyClear(ConstHandle2AverageEnergies self); + +// +++ Size +extern_c size_t +AverageEnergiesAverageEnergySize(ConstHandle2ConstAverageEnergies self); + +// +++ Add +extern_c void +AverageEnergiesAverageEnergyAdd(ConstHandle2AverageEnergies self, ConstHandle2ConstAverageEnergy averageEnergy); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetConst(ConstHandle2ConstAverageEnergies self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2AverageEnergy +AverageEnergiesAverageEnergyGet(ConstHandle2AverageEnergies self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +AverageEnergiesAverageEnergySet( + ConstHandle2AverageEnergies self, + const size_t index_, + ConstHandle2ConstAverageEnergy averageEnergy +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +AverageEnergiesAverageEnergyHasByLabel( + ConstHandle2ConstAverageEnergies self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByLabelConst( + ConstHandle2ConstAverageEnergies self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByLabel( + ConstHandle2AverageEnergies self, + const char *const label +); + +// +++ Set, by label +extern_c void +AverageEnergiesAverageEnergySetByLabel( + ConstHandle2AverageEnergies self, + const char *const label, + ConstHandle2ConstAverageEnergy averageEnergy +); + +// ------------------------ +// Re: metadatum value +// ------------------------ + +// +++ Has, by value +extern_c int +AverageEnergiesAverageEnergyHasByValue( + ConstHandle2ConstAverageEnergies self, + const double value +); + +// --- Get, by value, const +extern_c Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByValueConst( + ConstHandle2ConstAverageEnergies self, + const double value +); + +// +++ Get, by value, non-const +extern_c Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByValue( + ConstHandle2AverageEnergies self, + const double value +); + +// +++ Set, by value +extern_c void +AverageEnergiesAverageEnergySetByValue( + ConstHandle2AverageEnergies self, + const double value, + ConstHandle2ConstAverageEnergy averageEnergy +); + +// ------------------------ +// Re: metadatum unit +// ------------------------ + +// +++ Has, by unit +extern_c int +AverageEnergiesAverageEnergyHasByUnit( + ConstHandle2ConstAverageEnergies self, + const char *const unit +); + +// --- Get, by unit, const +extern_c Handle2ConstAverageEnergy +AverageEnergiesAverageEnergyGetByUnitConst( + ConstHandle2ConstAverageEnergies self, + const char *const unit +); + +// +++ Get, by unit, non-const +extern_c Handle2AverageEnergy +AverageEnergiesAverageEnergyGetByUnit( + ConstHandle2AverageEnergies self, + const char *const unit +); + +// +++ Set, by unit +extern_c void +AverageEnergiesAverageEnergySetByUnit( + ConstHandle2AverageEnergies self, + const char *const unit, + ConstHandle2ConstAverageEnergy averageEnergy +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AverageEnergies/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergies/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergies/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergies/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergies/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergy.cpp new file mode 100644 index 000000000..67e369999 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergy.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/AverageEnergy.hpp" +#include "AverageEnergy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AverageEnergyClass; +using CPP = multigroup::AverageEnergy; + +static const std::string CLASSNAME = "AverageEnergy"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPUncertainty = general::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAverageEnergy +AverageEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2AverageEnergy +AverageEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAverageEnergy +AverageEnergyCreateConst( + const char *const label, + const double value, + const char *const unit, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2AverageEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + unit, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general, non-const +Handle2AverageEnergy +AverageEnergyCreate( + const char *const label, + const double value, + const char *const unit, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2AverageEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + unit, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AverageEnergyAssign(ConstHandle2AverageEnergy self, ConstHandle2ConstAverageEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AverageEnergyDelete(ConstHandle2ConstAverageEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AverageEnergyRead(ConstHandle2AverageEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AverageEnergyWrite(ConstHandle2ConstAverageEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AverageEnergyPrint(ConstHandle2ConstAverageEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AverageEnergyPrintXML(ConstHandle2ConstAverageEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AverageEnergyPrintJSON(ConstHandle2ConstAverageEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AverageEnergyLabelHas(ConstHandle2ConstAverageEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +AverageEnergyLabelGet(ConstHandle2ConstAverageEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AverageEnergyLabelSet(ConstHandle2AverageEnergy self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +AverageEnergyValueHas(ConstHandle2ConstAverageEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +AverageEnergyValueGet(ConstHandle2ConstAverageEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +AverageEnergyValueSet(ConstHandle2AverageEnergy self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +AverageEnergyUnitHas(ConstHandle2ConstAverageEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +AverageEnergyUnitGet(ConstHandle2ConstAverageEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +AverageEnergyUnitSet(ConstHandle2AverageEnergy self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +AverageEnergyUncertaintyHas(ConstHandle2ConstAverageEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +AverageEnergyUncertaintyGetConst(ConstHandle2ConstAverageEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +AverageEnergyUncertaintyGet(ConstHandle2AverageEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +AverageEnergyUncertaintySet(ConstHandle2AverageEnergy self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AverageEnergy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergy.h new file mode 100644 index 000000000..631d3be65 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergy.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// AverageEnergy is the basic handle type in this file. Example: +// // Create a default AverageEnergy object: +// AverageEnergy handle = AverageEnergyDefault(); +// Functions involving AverageEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_AVERAGEENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_AVERAGEENERGY + +#include "GNDStk.h" +#include "v2.0/general/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AverageEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AverageEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AverageEnergyClass *AverageEnergy; + +// --- Const-aware handles. +typedef const struct AverageEnergyClass *const ConstHandle2ConstAverageEnergy; +typedef struct AverageEnergyClass *const ConstHandle2AverageEnergy; +typedef const struct AverageEnergyClass * Handle2ConstAverageEnergy; +typedef struct AverageEnergyClass * Handle2AverageEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAverageEnergy +AverageEnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2AverageEnergy +AverageEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageEnergy +AverageEnergyCreateConst( + const char *const label, + const double value, + const char *const unit, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general, non-const +extern_c Handle2AverageEnergy +AverageEnergyCreate( + const char *const label, + const double value, + const char *const unit, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AverageEnergyAssign(ConstHandle2AverageEnergy self, ConstHandle2ConstAverageEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AverageEnergyDelete(ConstHandle2ConstAverageEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AverageEnergyRead(ConstHandle2AverageEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AverageEnergyWrite(ConstHandle2ConstAverageEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AverageEnergyPrint(ConstHandle2ConstAverageEnergy self); + +// +++ Print to standard output, as XML +extern_c int +AverageEnergyPrintXML(ConstHandle2ConstAverageEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +AverageEnergyPrintJSON(ConstHandle2ConstAverageEnergy self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageEnergyLabelHas(ConstHandle2ConstAverageEnergy self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AverageEnergyLabelGet(ConstHandle2ConstAverageEnergy self); + +// +++ Set +extern_c void +AverageEnergyLabelSet(ConstHandle2AverageEnergy self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageEnergyValueHas(ConstHandle2ConstAverageEnergy self); + +// +++ Get +// +++ Returns by value +extern_c double +AverageEnergyValueGet(ConstHandle2ConstAverageEnergy self); + +// +++ Set +extern_c void +AverageEnergyValueSet(ConstHandle2AverageEnergy self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageEnergyUnitHas(ConstHandle2ConstAverageEnergy self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AverageEnergyUnitGet(ConstHandle2ConstAverageEnergy self); + +// +++ Set +extern_c void +AverageEnergyUnitSet(ConstHandle2AverageEnergy self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageEnergyUncertaintyHas(ConstHandle2ConstAverageEnergy self); + +// --- Get, const +extern_c Handle2ConstUncertainty +AverageEnergyUncertaintyGetConst(ConstHandle2ConstAverageEnergy self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +AverageEnergyUncertaintyGet(ConstHandle2AverageEnergy self); + +// +++ Set +extern_c void +AverageEnergyUncertaintySet(ConstHandle2AverageEnergy self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AverageEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageParameterCovariance.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageParameterCovariance.cpp new file mode 100644 index 000000000..565c0813a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageParameterCovariance.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/AverageParameterCovariance.hpp" +#include "AverageParameterCovariance.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AverageParameterCovarianceClass; +using CPP = multigroup::AverageParameterCovariance; + +static const std::string CLASSNAME = "AverageParameterCovariance"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto crossTerm = [](auto &obj) { return &obj.crossTerm; }; + static auto covarianceMatrix = [](auto &obj) { return &obj.covarianceMatrix; }; + static auto rowData = [](auto &obj) { return &obj.rowData; }; + static auto columnData = [](auto &obj) { return &obj.columnData; }; +} + +using CPPCovarianceMatrix = general::CovarianceMatrix; +using CPPRowData = general::RowData; +using CPPColumnData = general::ColumnData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAverageParameterCovariance +AverageParameterCovarianceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2AverageParameterCovariance +AverageParameterCovarianceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAverageParameterCovariance +AverageParameterCovarianceCreateConst( + const char *const label, + const bool crossTerm, + ConstHandle2ConstCovarianceMatrix covarianceMatrix, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstColumnData columnData +) { + ConstHandle2AverageParameterCovariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + crossTerm, + detail::tocpp(covarianceMatrix), + detail::tocpp(rowData), + detail::tocpp(columnData) + ); + return handle; +} + +// Create, general, non-const +Handle2AverageParameterCovariance +AverageParameterCovarianceCreate( + const char *const label, + const bool crossTerm, + ConstHandle2ConstCovarianceMatrix covarianceMatrix, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstColumnData columnData +) { + ConstHandle2AverageParameterCovariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + crossTerm, + detail::tocpp(covarianceMatrix), + detail::tocpp(rowData), + detail::tocpp(columnData) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AverageParameterCovarianceAssign(ConstHandle2AverageParameterCovariance self, ConstHandle2ConstAverageParameterCovariance from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AverageParameterCovarianceDelete(ConstHandle2ConstAverageParameterCovariance self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AverageParameterCovarianceRead(ConstHandle2AverageParameterCovariance self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AverageParameterCovarianceWrite(ConstHandle2ConstAverageParameterCovariance self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AverageParameterCovariancePrint(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AverageParameterCovariancePrintXML(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AverageParameterCovariancePrintJSON(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AverageParameterCovarianceLabelHas(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +AverageParameterCovarianceLabelGet(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AverageParameterCovarianceLabelSet(ConstHandle2AverageParameterCovariance self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: crossTerm +// ----------------------------------------------------------------------------- + +// Has +int +AverageParameterCovarianceCrossTermHas(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossTermHas", self, extract::crossTerm); +} + +// Get +// Returns by value +bool +AverageParameterCovarianceCrossTermGet(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossTermGet", self, extract::crossTerm); +} + +// Set +void +AverageParameterCovarianceCrossTermSet(ConstHandle2AverageParameterCovariance self, const bool crossTerm) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CrossTermSet", self, extract::crossTerm, crossTerm); +} + + +// ----------------------------------------------------------------------------- +// Child: covarianceMatrix +// ----------------------------------------------------------------------------- + +// Has +int +AverageParameterCovarianceCovarianceMatrixHas(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CovarianceMatrixHas", self, extract::covarianceMatrix); +} + +// Get, const +Handle2ConstCovarianceMatrix +AverageParameterCovarianceCovarianceMatrixGetConst(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetConst", self, extract::covarianceMatrix); +} + +// Get, non-const +Handle2CovarianceMatrix +AverageParameterCovarianceCovarianceMatrixGet(ConstHandle2AverageParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceMatrixGet", self, extract::covarianceMatrix); +} + +// Set +void +AverageParameterCovarianceCovarianceMatrixSet(ConstHandle2AverageParameterCovariance self, ConstHandle2ConstCovarianceMatrix covarianceMatrix) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CovarianceMatrixSet", self, extract::covarianceMatrix, covarianceMatrix); +} + + +// ----------------------------------------------------------------------------- +// Child: rowData +// ----------------------------------------------------------------------------- + +// Has +int +AverageParameterCovarianceRowDataHas(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RowDataHas", self, extract::rowData); +} + +// Get, const +Handle2ConstRowData +AverageParameterCovarianceRowDataGetConst(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RowDataGetConst", self, extract::rowData); +} + +// Get, non-const +Handle2RowData +AverageParameterCovarianceRowDataGet(ConstHandle2AverageParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RowDataGet", self, extract::rowData); +} + +// Set +void +AverageParameterCovarianceRowDataSet(ConstHandle2AverageParameterCovariance self, ConstHandle2ConstRowData rowData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RowDataSet", self, extract::rowData, rowData); +} + + +// ----------------------------------------------------------------------------- +// Child: columnData +// ----------------------------------------------------------------------------- + +// Has +int +AverageParameterCovarianceColumnDataHas(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ColumnDataHas", self, extract::columnData); +} + +// Get, const +Handle2ConstColumnData +AverageParameterCovarianceColumnDataGetConst(ConstHandle2ConstAverageParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnDataGetConst", self, extract::columnData); +} + +// Get, non-const +Handle2ColumnData +AverageParameterCovarianceColumnDataGet(ConstHandle2AverageParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnDataGet", self, extract::columnData); +} + +// Set +void +AverageParameterCovarianceColumnDataSet(ConstHandle2AverageParameterCovariance self, ConstHandle2ConstColumnData columnData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ColumnDataSet", self, extract::columnData, columnData); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AverageParameterCovariance/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageParameterCovariance.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageParameterCovariance.h new file mode 100644 index 000000000..3a4997e80 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageParameterCovariance.h @@ -0,0 +1,249 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// AverageParameterCovariance is the basic handle type in this file. Example: +// // Create a default AverageParameterCovariance object: +// AverageParameterCovariance handle = AverageParameterCovarianceDefault(); +// Functions involving AverageParameterCovariance are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_AVERAGEPARAMETERCOVARIANCE +#define C_INTERFACE_GNDS_V2_0_GENERAL_AVERAGEPARAMETERCOVARIANCE + +#include "GNDStk.h" +#include "v2.0/general/CovarianceMatrix.h" +#include "v2.0/general/RowData.h" +#include "v2.0/general/ColumnData.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AverageParameterCovarianceClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AverageParameterCovariance +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AverageParameterCovarianceClass *AverageParameterCovariance; + +// --- Const-aware handles. +typedef const struct AverageParameterCovarianceClass *const ConstHandle2ConstAverageParameterCovariance; +typedef struct AverageParameterCovarianceClass *const ConstHandle2AverageParameterCovariance; +typedef const struct AverageParameterCovarianceClass * Handle2ConstAverageParameterCovariance; +typedef struct AverageParameterCovarianceClass * Handle2AverageParameterCovariance; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAverageParameterCovariance +AverageParameterCovarianceDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2AverageParameterCovariance +AverageParameterCovarianceDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageParameterCovariance +AverageParameterCovarianceCreateConst( + const char *const label, + const bool crossTerm, + ConstHandle2ConstCovarianceMatrix covarianceMatrix, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstColumnData columnData +); + +// +++ Create, general, non-const +extern_c Handle2AverageParameterCovariance +AverageParameterCovarianceCreate( + const char *const label, + const bool crossTerm, + ConstHandle2ConstCovarianceMatrix covarianceMatrix, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstColumnData columnData +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AverageParameterCovarianceAssign(ConstHandle2AverageParameterCovariance self, ConstHandle2ConstAverageParameterCovariance from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AverageParameterCovarianceDelete(ConstHandle2ConstAverageParameterCovariance self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AverageParameterCovarianceRead(ConstHandle2AverageParameterCovariance self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AverageParameterCovarianceWrite(ConstHandle2ConstAverageParameterCovariance self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AverageParameterCovariancePrint(ConstHandle2ConstAverageParameterCovariance self); + +// +++ Print to standard output, as XML +extern_c int +AverageParameterCovariancePrintXML(ConstHandle2ConstAverageParameterCovariance self); + +// +++ Print to standard output, as JSON +extern_c int +AverageParameterCovariancePrintJSON(ConstHandle2ConstAverageParameterCovariance self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageParameterCovarianceLabelHas(ConstHandle2ConstAverageParameterCovariance self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AverageParameterCovarianceLabelGet(ConstHandle2ConstAverageParameterCovariance self); + +// +++ Set +extern_c void +AverageParameterCovarianceLabelSet(ConstHandle2AverageParameterCovariance self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: crossTerm +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageParameterCovarianceCrossTermHas(ConstHandle2ConstAverageParameterCovariance self); + +// +++ Get +// +++ Returns by value +extern_c bool +AverageParameterCovarianceCrossTermGet(ConstHandle2ConstAverageParameterCovariance self); + +// +++ Set +extern_c void +AverageParameterCovarianceCrossTermSet(ConstHandle2AverageParameterCovariance self, const bool crossTerm); + + +// ----------------------------------------------------------------------------- +// Child: covarianceMatrix +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageParameterCovarianceCovarianceMatrixHas(ConstHandle2ConstAverageParameterCovariance self); + +// --- Get, const +extern_c Handle2ConstCovarianceMatrix +AverageParameterCovarianceCovarianceMatrixGetConst(ConstHandle2ConstAverageParameterCovariance self); + +// +++ Get, non-const +extern_c Handle2CovarianceMatrix +AverageParameterCovarianceCovarianceMatrixGet(ConstHandle2AverageParameterCovariance self); + +// +++ Set +extern_c void +AverageParameterCovarianceCovarianceMatrixSet(ConstHandle2AverageParameterCovariance self, ConstHandle2ConstCovarianceMatrix covarianceMatrix); + + +// ----------------------------------------------------------------------------- +// Child: rowData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageParameterCovarianceRowDataHas(ConstHandle2ConstAverageParameterCovariance self); + +// --- Get, const +extern_c Handle2ConstRowData +AverageParameterCovarianceRowDataGetConst(ConstHandle2ConstAverageParameterCovariance self); + +// +++ Get, non-const +extern_c Handle2RowData +AverageParameterCovarianceRowDataGet(ConstHandle2AverageParameterCovariance self); + +// +++ Set +extern_c void +AverageParameterCovarianceRowDataSet(ConstHandle2AverageParameterCovariance self, ConstHandle2ConstRowData rowData); + + +// ----------------------------------------------------------------------------- +// Child: columnData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageParameterCovarianceColumnDataHas(ConstHandle2ConstAverageParameterCovariance self); + +// --- Get, const +extern_c Handle2ConstColumnData +AverageParameterCovarianceColumnDataGetConst(ConstHandle2ConstAverageParameterCovariance self); + +// +++ Get, non-const +extern_c Handle2ColumnData +AverageParameterCovarianceColumnDataGet(ConstHandle2AverageParameterCovariance self); + +// +++ Set +extern_c void +AverageParameterCovarianceColumnDataSet(ConstHandle2AverageParameterCovariance self, ConstHandle2ConstColumnData columnData); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AverageParameterCovariance/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageParameterCovariance/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageParameterCovariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageParameterCovariance/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageParameterCovariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageProductEnergy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageProductEnergy.cpp new file mode 100644 index 000000000..55083dcf7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageProductEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/AverageProductEnergy.hpp" +#include "AverageProductEnergy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AverageProductEnergyClass; +using CPP = multigroup::AverageProductEnergy; + +static const std::string CLASSNAME = "AverageProductEnergy"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAverageProductEnergy +AverageProductEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2AverageProductEnergy +AverageProductEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAverageProductEnergy +AverageProductEnergyCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2AverageProductEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2AverageProductEnergy +AverageProductEnergyCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2AverageProductEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AverageProductEnergyAssign(ConstHandle2AverageProductEnergy self, ConstHandle2ConstAverageProductEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AverageProductEnergyDelete(ConstHandle2ConstAverageProductEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AverageProductEnergyRead(ConstHandle2AverageProductEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AverageProductEnergyWrite(ConstHandle2ConstAverageProductEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AverageProductEnergyPrint(ConstHandle2ConstAverageProductEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AverageProductEnergyPrintXML(ConstHandle2ConstAverageProductEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AverageProductEnergyPrintJSON(ConstHandle2ConstAverageProductEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +AverageProductEnergyXYs1dHas(ConstHandle2ConstAverageProductEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +AverageProductEnergyXYs1dGetConst(ConstHandle2ConstAverageProductEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +AverageProductEnergyXYs1dGet(ConstHandle2AverageProductEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +AverageProductEnergyXYs1dSet(ConstHandle2AverageProductEnergy self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AverageProductEnergy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageProductEnergy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageProductEnergy.h new file mode 100644 index 000000000..904cd9b6b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageProductEnergy.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// AverageProductEnergy is the basic handle type in this file. Example: +// // Create a default AverageProductEnergy object: +// AverageProductEnergy handle = AverageProductEnergyDefault(); +// Functions involving AverageProductEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_AVERAGEPRODUCTENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_AVERAGEPRODUCTENERGY + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AverageProductEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ AverageProductEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AverageProductEnergyClass *AverageProductEnergy; + +// --- Const-aware handles. +typedef const struct AverageProductEnergyClass *const ConstHandle2ConstAverageProductEnergy; +typedef struct AverageProductEnergyClass *const ConstHandle2AverageProductEnergy; +typedef const struct AverageProductEnergyClass * Handle2ConstAverageProductEnergy; +typedef struct AverageProductEnergyClass * Handle2AverageProductEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAverageProductEnergy +AverageProductEnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2AverageProductEnergy +AverageProductEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstAverageProductEnergy +AverageProductEnergyCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2AverageProductEnergy +AverageProductEnergyCreate( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AverageProductEnergyAssign(ConstHandle2AverageProductEnergy self, ConstHandle2ConstAverageProductEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AverageProductEnergyDelete(ConstHandle2ConstAverageProductEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AverageProductEnergyRead(ConstHandle2AverageProductEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AverageProductEnergyWrite(ConstHandle2ConstAverageProductEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AverageProductEnergyPrint(ConstHandle2ConstAverageProductEnergy self); + +// +++ Print to standard output, as XML +extern_c int +AverageProductEnergyPrintXML(ConstHandle2ConstAverageProductEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +AverageProductEnergyPrintJSON(ConstHandle2ConstAverageProductEnergy self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AverageProductEnergyXYs1dHas(ConstHandle2ConstAverageProductEnergy self); + +// --- Get, const +extern_c Handle2ConstXYs1d +AverageProductEnergyXYs1dGetConst(ConstHandle2ConstAverageProductEnergy self); + +// +++ Get, non-const +extern_c Handle2XYs1d +AverageProductEnergyXYs1dGet(ConstHandle2AverageProductEnergy self); + +// +++ Set +extern_c void +AverageProductEnergyXYs1dSet(ConstHandle2AverageProductEnergy self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/AverageProductEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageProductEnergy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageProductEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageProductEnergy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/AverageProductEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axes.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axes.cpp new file mode 100644 index 000000000..09148648f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axes.cpp @@ -0,0 +1,678 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Axes.hpp" +#include "Axes.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AxesClass; +using CPP = multigroup::Axes; + +static const std::string CLASSNAME = "Axes"; + +namespace extract { + static auto axis = [](auto &obj) { return &obj.axis; }; + static auto grid = [](auto &obj) { return &obj.grid; }; +} + +using CPPAxis = general::Axis; +using CPPGrid = general::Grid; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAxes +AxesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Axes +AxesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAxes +AxesCreateConst( + ConstHandle2Axis *const axis, const size_t axisSize, + ConstHandle2Grid *const grid, const size_t gridSize +) { + ConstHandle2Axes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{}, + std::vector{} + ); + for (size_t AxisN = 0; AxisN < axisSize; ++AxisN) + AxesAxisAdd(handle, axis[AxisN]); + for (size_t GridN = 0; GridN < gridSize; ++GridN) + AxesGridAdd(handle, grid[GridN]); + return handle; +} + +// Create, general, non-const +Handle2Axes +AxesCreate( + ConstHandle2Axis *const axis, const size_t axisSize, + ConstHandle2Grid *const grid, const size_t gridSize +) { + ConstHandle2Axes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{}, + std::vector{} + ); + for (size_t AxisN = 0; AxisN < axisSize; ++AxisN) + AxesAxisAdd(handle, axis[AxisN]); + for (size_t GridN = 0; GridN < gridSize; ++GridN) + AxesGridAdd(handle, grid[GridN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AxesAssign(ConstHandle2Axes self, ConstHandle2ConstAxes from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AxesDelete(ConstHandle2ConstAxes self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AxesRead(ConstHandle2Axes self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AxesWrite(ConstHandle2ConstAxes self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AxesPrint(ConstHandle2ConstAxes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AxesPrintXML(ConstHandle2ConstAxes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AxesPrintJSON(ConstHandle2ConstAxes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: axis +// ----------------------------------------------------------------------------- + +// Has +int +AxesAxisHas(ConstHandle2ConstAxes self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxisHas", self, extract::axis); +} + +// Clear +void +AxesAxisClear(ConstHandle2Axes self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"AxisClear", self, extract::axis); +} + +// Size +size_t +AxesAxisSize(ConstHandle2ConstAxes self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"AxisSize", self, extract::axis); +} + +// Add +void +AxesAxisAdd(ConstHandle2Axes self, ConstHandle2ConstAxis axis) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"AxisAdd", self, extract::axis, axis); +} + +// Get, by index \in [0,size), const +Handle2ConstAxis +AxesAxisGetConst(ConstHandle2ConstAxes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AxisGetConst", self, extract::axis, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Axis +AxesAxisGet(ConstHandle2Axes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AxisGet", self, extract::axis, index_); +} + +// Set, by index \in [0,size) +void +AxesAxisSet( + ConstHandle2Axes self, + const size_t index_, + ConstHandle2ConstAxis axis +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"AxisSet", self, extract::axis, index_, axis); +} + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// Has, by index +int +AxesAxisHasByIndex( + ConstHandle2ConstAxes self, + const int index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AxisHasByIndex", + self, extract::axis, meta::index, index); +} + +// Get, by index, const +Handle2ConstAxis +AxesAxisGetByIndexConst( + ConstHandle2ConstAxes self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByIndexConst", + self, extract::axis, meta::index, index); +} + +// Get, by index, non-const +Handle2Axis +AxesAxisGetByIndex( + ConstHandle2Axes self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByIndex", + self, extract::axis, meta::index, index); +} + +// Set, by index +void +AxesAxisSetByIndex( + ConstHandle2Axes self, + const int index, + ConstHandle2ConstAxis axis +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AxisSetByIndex", + self, extract::axis, meta::index, index, axis); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +AxesAxisHasByLabel( + ConstHandle2ConstAxes self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AxisHasByLabel", + self, extract::axis, meta::label, label); +} + +// Get, by label, const +Handle2ConstAxis +AxesAxisGetByLabelConst( + ConstHandle2ConstAxes self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByLabelConst", + self, extract::axis, meta::label, label); +} + +// Get, by label, non-const +Handle2Axis +AxesAxisGetByLabel( + ConstHandle2Axes self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByLabel", + self, extract::axis, meta::label, label); +} + +// Set, by label +void +AxesAxisSetByLabel( + ConstHandle2Axes self, + const char *const label, + ConstHandle2ConstAxis axis +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AxisSetByLabel", + self, extract::axis, meta::label, label, axis); +} + +// ------------------------ +// Re: metadatum unit +// ------------------------ + +// Has, by unit +int +AxesAxisHasByUnit( + ConstHandle2ConstAxes self, + const char *const unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AxisHasByUnit", + self, extract::axis, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstAxis +AxesAxisGetByUnitConst( + ConstHandle2ConstAxes self, + const char *const unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByUnitConst", + self, extract::axis, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Axis +AxesAxisGetByUnit( + ConstHandle2Axes self, + const char *const unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AxisGetByUnit", + self, extract::axis, meta::unit, unit); +} + +// Set, by unit +void +AxesAxisSetByUnit( + ConstHandle2Axes self, + const char *const unit, + ConstHandle2ConstAxis axis +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AxisSetByUnit", + self, extract::axis, meta::unit, unit, axis); +} + + +// ----------------------------------------------------------------------------- +// Child: grid +// ----------------------------------------------------------------------------- + +// Has +int +AxesGridHas(ConstHandle2ConstAxes self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GridHas", self, extract::grid); +} + +// Clear +void +AxesGridClear(ConstHandle2Axes self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"GridClear", self, extract::grid); +} + +// Size +size_t +AxesGridSize(ConstHandle2ConstAxes self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"GridSize", self, extract::grid); +} + +// Add +void +AxesGridAdd(ConstHandle2Axes self, ConstHandle2ConstGrid grid) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"GridAdd", self, extract::grid, grid); +} + +// Get, by index \in [0,size), const +Handle2ConstGrid +AxesGridGetConst(ConstHandle2ConstAxes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"GridGetConst", self, extract::grid, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Grid +AxesGridGet(ConstHandle2Axes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"GridGet", self, extract::grid, index_); +} + +// Set, by index \in [0,size) +void +AxesGridSet( + ConstHandle2Axes self, + const size_t index_, + ConstHandle2ConstGrid grid +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"GridSet", self, extract::grid, index_, grid); +} + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// Has, by index +int +AxesGridHasByIndex( + ConstHandle2ConstAxes self, + const int index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GridHasByIndex", + self, extract::grid, meta::index, index); +} + +// Get, by index, const +Handle2ConstGrid +AxesGridGetByIndexConst( + ConstHandle2ConstAxes self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByIndexConst", + self, extract::grid, meta::index, index); +} + +// Get, by index, non-const +Handle2Grid +AxesGridGetByIndex( + ConstHandle2Axes self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByIndex", + self, extract::grid, meta::index, index); +} + +// Set, by index +void +AxesGridSetByIndex( + ConstHandle2Axes self, + const int index, + ConstHandle2ConstGrid grid +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GridSetByIndex", + self, extract::grid, meta::index, index, grid); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +AxesGridHasByLabel( + ConstHandle2ConstAxes self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GridHasByLabel", + self, extract::grid, meta::label, label); +} + +// Get, by label, const +Handle2ConstGrid +AxesGridGetByLabelConst( + ConstHandle2ConstAxes self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByLabelConst", + self, extract::grid, meta::label, label); +} + +// Get, by label, non-const +Handle2Grid +AxesGridGetByLabel( + ConstHandle2Axes self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByLabel", + self, extract::grid, meta::label, label); +} + +// Set, by label +void +AxesGridSetByLabel( + ConstHandle2Axes self, + const char *const label, + ConstHandle2ConstGrid grid +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GridSetByLabel", + self, extract::grid, meta::label, label, grid); +} + +// ------------------------ +// Re: metadatum unit +// ------------------------ + +// Has, by unit +int +AxesGridHasByUnit( + ConstHandle2ConstAxes self, + const char *const unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GridHasByUnit", + self, extract::grid, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstGrid +AxesGridGetByUnitConst( + ConstHandle2ConstAxes self, + const char *const unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByUnitConst", + self, extract::grid, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Grid +AxesGridGetByUnit( + ConstHandle2Axes self, + const char *const unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByUnit", + self, extract::grid, meta::unit, unit); +} + +// Set, by unit +void +AxesGridSetByUnit( + ConstHandle2Axes self, + const char *const unit, + ConstHandle2ConstGrid grid +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GridSetByUnit", + self, extract::grid, meta::unit, unit, grid); +} + +// ------------------------ +// Re: metadatum style +// ------------------------ + +// Has, by style +int +AxesGridHasByStyle( + ConstHandle2ConstAxes self, + const char *const style +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GridHasByStyle", + self, extract::grid, meta::style, style); +} + +// Get, by style, const +Handle2ConstGrid +AxesGridGetByStyleConst( + ConstHandle2ConstAxes self, + const char *const style +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByStyleConst", + self, extract::grid, meta::style, style); +} + +// Get, by style, non-const +Handle2Grid +AxesGridGetByStyle( + ConstHandle2Axes self, + const char *const style +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByStyle", + self, extract::grid, meta::style, style); +} + +// Set, by style +void +AxesGridSetByStyle( + ConstHandle2Axes self, + const char *const style, + ConstHandle2ConstGrid grid +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GridSetByStyle", + self, extract::grid, meta::style, style, grid); +} + +// ------------------------ +// Re: metadatum interpolation +// ------------------------ + +// Has, by interpolation +int +AxesGridHasByInterpolation( + ConstHandle2ConstAxes self, + const char *const interpolation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GridHasByInterpolation", + self, extract::grid, meta::interpolation, interpolation); +} + +// Get, by interpolation, const +Handle2ConstGrid +AxesGridGetByInterpolationConst( + ConstHandle2ConstAxes self, + const char *const interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByInterpolationConst", + self, extract::grid, meta::interpolation, interpolation); +} + +// Get, by interpolation, non-const +Handle2Grid +AxesGridGetByInterpolation( + ConstHandle2Axes self, + const char *const interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GridGetByInterpolation", + self, extract::grid, meta::interpolation, interpolation); +} + +// Set, by interpolation +void +AxesGridSetByInterpolation( + ConstHandle2Axes self, + const char *const interpolation, + ConstHandle2ConstGrid grid +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GridSetByInterpolation", + self, extract::grid, meta::interpolation, interpolation, grid); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Axes/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axes.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axes.h new file mode 100644 index 000000000..3fd56a51f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axes.h @@ -0,0 +1,481 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Axes is the basic handle type in this file. Example: +// // Create a default Axes object: +// Axes handle = AxesDefault(); +// Functions involving Axes are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_AXES +#define C_INTERFACE_GNDS_V2_0_GENERAL_AXES + +#include "GNDStk.h" +#include "v2.0/general/Axis.h" +#include "v2.0/general/Grid.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AxesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Axes +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AxesClass *Axes; + +// --- Const-aware handles. +typedef const struct AxesClass *const ConstHandle2ConstAxes; +typedef struct AxesClass *const ConstHandle2Axes; +typedef const struct AxesClass * Handle2ConstAxes; +typedef struct AxesClass * Handle2Axes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAxes +AxesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Axes +AxesDefault(); + +// --- Create, general, const +extern_c Handle2ConstAxes +AxesCreateConst( + ConstHandle2Axis *const axis, const size_t axisSize, + ConstHandle2Grid *const grid, const size_t gridSize +); + +// +++ Create, general, non-const +extern_c Handle2Axes +AxesCreate( + ConstHandle2Axis *const axis, const size_t axisSize, + ConstHandle2Grid *const grid, const size_t gridSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AxesAssign(ConstHandle2Axes self, ConstHandle2ConstAxes from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AxesDelete(ConstHandle2ConstAxes self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AxesRead(ConstHandle2Axes self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AxesWrite(ConstHandle2ConstAxes self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AxesPrint(ConstHandle2ConstAxes self); + +// +++ Print to standard output, as XML +extern_c int +AxesPrintXML(ConstHandle2ConstAxes self); + +// +++ Print to standard output, as JSON +extern_c int +AxesPrintJSON(ConstHandle2ConstAxes self); + + +// ----------------------------------------------------------------------------- +// Child: axis +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxesAxisHas(ConstHandle2ConstAxes self); + +// +++ Clear +extern_c void +AxesAxisClear(ConstHandle2Axes self); + +// +++ Size +extern_c size_t +AxesAxisSize(ConstHandle2ConstAxes self); + +// +++ Add +extern_c void +AxesAxisAdd(ConstHandle2Axes self, ConstHandle2ConstAxis axis); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstAxis +AxesAxisGetConst(ConstHandle2ConstAxes self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Axis +AxesAxisGet(ConstHandle2Axes self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +AxesAxisSet( + ConstHandle2Axes self, + const size_t index_, + ConstHandle2ConstAxis axis +); + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// +++ Has, by index +extern_c int +AxesAxisHasByIndex( + ConstHandle2ConstAxes self, + const int index +); + +// --- Get, by index, const +extern_c Handle2ConstAxis +AxesAxisGetByIndexConst( + ConstHandle2ConstAxes self, + const int index +); + +// +++ Get, by index, non-const +extern_c Handle2Axis +AxesAxisGetByIndex( + ConstHandle2Axes self, + const int index +); + +// +++ Set, by index +extern_c void +AxesAxisSetByIndex( + ConstHandle2Axes self, + const int index, + ConstHandle2ConstAxis axis +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +AxesAxisHasByLabel( + ConstHandle2ConstAxes self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstAxis +AxesAxisGetByLabelConst( + ConstHandle2ConstAxes self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Axis +AxesAxisGetByLabel( + ConstHandle2Axes self, + const char *const label +); + +// +++ Set, by label +extern_c void +AxesAxisSetByLabel( + ConstHandle2Axes self, + const char *const label, + ConstHandle2ConstAxis axis +); + +// ------------------------ +// Re: metadatum unit +// ------------------------ + +// +++ Has, by unit +extern_c int +AxesAxisHasByUnit( + ConstHandle2ConstAxes self, + const char *const unit +); + +// --- Get, by unit, const +extern_c Handle2ConstAxis +AxesAxisGetByUnitConst( + ConstHandle2ConstAxes self, + const char *const unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Axis +AxesAxisGetByUnit( + ConstHandle2Axes self, + const char *const unit +); + +// +++ Set, by unit +extern_c void +AxesAxisSetByUnit( + ConstHandle2Axes self, + const char *const unit, + ConstHandle2ConstAxis axis +); + + +// ----------------------------------------------------------------------------- +// Child: grid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxesGridHas(ConstHandle2ConstAxes self); + +// +++ Clear +extern_c void +AxesGridClear(ConstHandle2Axes self); + +// +++ Size +extern_c size_t +AxesGridSize(ConstHandle2ConstAxes self); + +// +++ Add +extern_c void +AxesGridAdd(ConstHandle2Axes self, ConstHandle2ConstGrid grid); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstGrid +AxesGridGetConst(ConstHandle2ConstAxes self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Grid +AxesGridGet(ConstHandle2Axes self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +AxesGridSet( + ConstHandle2Axes self, + const size_t index_, + ConstHandle2ConstGrid grid +); + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// +++ Has, by index +extern_c int +AxesGridHasByIndex( + ConstHandle2ConstAxes self, + const int index +); + +// --- Get, by index, const +extern_c Handle2ConstGrid +AxesGridGetByIndexConst( + ConstHandle2ConstAxes self, + const int index +); + +// +++ Get, by index, non-const +extern_c Handle2Grid +AxesGridGetByIndex( + ConstHandle2Axes self, + const int index +); + +// +++ Set, by index +extern_c void +AxesGridSetByIndex( + ConstHandle2Axes self, + const int index, + ConstHandle2ConstGrid grid +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +AxesGridHasByLabel( + ConstHandle2ConstAxes self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstGrid +AxesGridGetByLabelConst( + ConstHandle2ConstAxes self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Grid +AxesGridGetByLabel( + ConstHandle2Axes self, + const char *const label +); + +// +++ Set, by label +extern_c void +AxesGridSetByLabel( + ConstHandle2Axes self, + const char *const label, + ConstHandle2ConstGrid grid +); + +// ------------------------ +// Re: metadatum unit +// ------------------------ + +// +++ Has, by unit +extern_c int +AxesGridHasByUnit( + ConstHandle2ConstAxes self, + const char *const unit +); + +// --- Get, by unit, const +extern_c Handle2ConstGrid +AxesGridGetByUnitConst( + ConstHandle2ConstAxes self, + const char *const unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Grid +AxesGridGetByUnit( + ConstHandle2Axes self, + const char *const unit +); + +// +++ Set, by unit +extern_c void +AxesGridSetByUnit( + ConstHandle2Axes self, + const char *const unit, + ConstHandle2ConstGrid grid +); + +// ------------------------ +// Re: metadatum style +// ------------------------ + +// +++ Has, by style +extern_c int +AxesGridHasByStyle( + ConstHandle2ConstAxes self, + const char *const style +); + +// --- Get, by style, const +extern_c Handle2ConstGrid +AxesGridGetByStyleConst( + ConstHandle2ConstAxes self, + const char *const style +); + +// +++ Get, by style, non-const +extern_c Handle2Grid +AxesGridGetByStyle( + ConstHandle2Axes self, + const char *const style +); + +// +++ Set, by style +extern_c void +AxesGridSetByStyle( + ConstHandle2Axes self, + const char *const style, + ConstHandle2ConstGrid grid +); + +// ------------------------ +// Re: metadatum interpolation +// ------------------------ + +// +++ Has, by interpolation +extern_c int +AxesGridHasByInterpolation( + ConstHandle2ConstAxes self, + const char *const interpolation +); + +// --- Get, by interpolation, const +extern_c Handle2ConstGrid +AxesGridGetByInterpolationConst( + ConstHandle2ConstAxes self, + const char *const interpolation +); + +// +++ Get, by interpolation, non-const +extern_c Handle2Grid +AxesGridGetByInterpolation( + ConstHandle2Axes self, + const char *const interpolation +); + +// +++ Set, by interpolation +extern_c void +AxesGridSetByInterpolation( + ConstHandle2Axes self, + const char *const interpolation, + ConstHandle2ConstGrid grid +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Axes/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axes/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axes/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axis.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axis.cpp new file mode 100644 index 000000000..c83c0372a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axis.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Axis.hpp" +#include "Axis.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = AxisClass; +using CPP = multigroup::Axis; + +static const std::string CLASSNAME = "Axis"; + +namespace extract { + static auto index = [](auto &obj) { return &obj.index; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstAxis +AxisDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Axis +AxisDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstAxis +AxisCreateConst( + const int index, + const char *const label, + const char *const unit +) { + ConstHandle2Axis handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + label, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2Axis +AxisCreate( + const int index, + const char *const label, + const char *const unit +) { + ConstHandle2Axis handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + index, + label, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +AxisAssign(ConstHandle2Axis self, ConstHandle2ConstAxis from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +AxisDelete(ConstHandle2ConstAxis self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +AxisRead(ConstHandle2Axis self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +AxisWrite(ConstHandle2ConstAxis self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +AxisPrint(ConstHandle2ConstAxis self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +AxisPrintXML(ConstHandle2ConstAxis self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +AxisPrintJSON(ConstHandle2ConstAxis self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// Has +int +AxisIndexHas(ConstHandle2ConstAxis self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IndexHas", self, extract::index); +} + +// Get +// Returns by value +int +AxisIndexGet(ConstHandle2ConstAxis self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +AxisIndexSet(ConstHandle2Axis self, const int index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +AxisLabelHas(ConstHandle2ConstAxis self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +AxisLabelGet(ConstHandle2ConstAxis self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +AxisLabelSet(ConstHandle2Axis self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +AxisUnitHas(ConstHandle2ConstAxis self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +AxisUnitGet(ConstHandle2ConstAxis self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +AxisUnitSet(ConstHandle2Axis self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Axis/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axis.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axis.h new file mode 100644 index 000000000..655231a2f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axis.h @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Axis is the basic handle type in this file. Example: +// // Create a default Axis object: +// Axis handle = AxisDefault(); +// Functions involving Axis are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_AXIS +#define C_INTERFACE_GNDS_V2_0_GENERAL_AXIS + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct AxisClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Axis +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct AxisClass *Axis; + +// --- Const-aware handles. +typedef const struct AxisClass *const ConstHandle2ConstAxis; +typedef struct AxisClass *const ConstHandle2Axis; +typedef const struct AxisClass * Handle2ConstAxis; +typedef struct AxisClass * Handle2Axis; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstAxis +AxisDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Axis +AxisDefault(); + +// --- Create, general, const +extern_c Handle2ConstAxis +AxisCreateConst( + const int index, + const char *const label, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2Axis +AxisCreate( + const int index, + const char *const label, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +AxisAssign(ConstHandle2Axis self, ConstHandle2ConstAxis from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +AxisDelete(ConstHandle2ConstAxis self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +AxisRead(ConstHandle2Axis self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +AxisWrite(ConstHandle2ConstAxis self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +AxisPrint(ConstHandle2ConstAxis self); + +// +++ Print to standard output, as XML +extern_c int +AxisPrintXML(ConstHandle2ConstAxis self); + +// +++ Print to standard output, as JSON +extern_c int +AxisPrintJSON(ConstHandle2ConstAxis self); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxisIndexHas(ConstHandle2ConstAxis self); + +// +++ Get +// +++ Returns by value +extern_c int +AxisIndexGet(ConstHandle2ConstAxis self); + +// +++ Set +extern_c void +AxisIndexSet(ConstHandle2Axis self, const int index); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxisLabelHas(ConstHandle2ConstAxis self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AxisLabelGet(ConstHandle2ConstAxis self); + +// +++ Set +extern_c void +AxisLabelSet(ConstHandle2Axis self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +AxisUnitHas(ConstHandle2ConstAxis self); + +// +++ Get +// +++ Returns by value +extern_c const char * +AxisUnitGet(ConstHandle2ConstAxis self); + +// +++ Set +extern_c void +AxisUnitSet(ConstHandle2Axis self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Axis/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axis/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axis/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axis/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Axis/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Background.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Background.cpp new file mode 100644 index 000000000..248016e3d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Background.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Background.hpp" +#include "Background.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = BackgroundClass; +using CPP = multigroup::Background; + +static const std::string CLASSNAME = "Background"; + +namespace extract { + static auto resolvedRegion = [](auto &obj) { return &obj.resolvedRegion; }; + static auto fastRegion = [](auto &obj) { return &obj.fastRegion; }; + static auto unresolvedRegion = [](auto &obj) { return &obj.unresolvedRegion; }; +} + +using CPPResolvedRegion = general::ResolvedRegion; +using CPPFastRegion = general::FastRegion; +using CPPUnresolvedRegion = general::UnresolvedRegion; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBackground +BackgroundDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Background +BackgroundDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBackground +BackgroundCreateConst( + ConstHandle2ConstResolvedRegion resolvedRegion, + ConstHandle2ConstFastRegion fastRegion, + ConstHandle2ConstUnresolvedRegion unresolvedRegion +) { + ConstHandle2Background handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(resolvedRegion), + detail::tocpp(fastRegion), + detail::tocpp(unresolvedRegion) + ); + return handle; +} + +// Create, general, non-const +Handle2Background +BackgroundCreate( + ConstHandle2ConstResolvedRegion resolvedRegion, + ConstHandle2ConstFastRegion fastRegion, + ConstHandle2ConstUnresolvedRegion unresolvedRegion +) { + ConstHandle2Background handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(resolvedRegion), + detail::tocpp(fastRegion), + detail::tocpp(unresolvedRegion) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BackgroundAssign(ConstHandle2Background self, ConstHandle2ConstBackground from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BackgroundDelete(ConstHandle2ConstBackground self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BackgroundRead(ConstHandle2Background self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BackgroundWrite(ConstHandle2ConstBackground self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BackgroundPrint(ConstHandle2ConstBackground self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BackgroundPrintXML(ConstHandle2ConstBackground self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BackgroundPrintJSON(ConstHandle2ConstBackground self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: resolvedRegion +// ----------------------------------------------------------------------------- + +// Has +int +BackgroundResolvedRegionHas(ConstHandle2ConstBackground self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResolvedRegionHas", self, extract::resolvedRegion); +} + +// Get, const +Handle2ConstResolvedRegion +BackgroundResolvedRegionGetConst(ConstHandle2ConstBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResolvedRegionGetConst", self, extract::resolvedRegion); +} + +// Get, non-const +Handle2ResolvedRegion +BackgroundResolvedRegionGet(ConstHandle2Background self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResolvedRegionGet", self, extract::resolvedRegion); +} + +// Set +void +BackgroundResolvedRegionSet(ConstHandle2Background self, ConstHandle2ConstResolvedRegion resolvedRegion) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResolvedRegionSet", self, extract::resolvedRegion, resolvedRegion); +} + + +// ----------------------------------------------------------------------------- +// Child: fastRegion +// ----------------------------------------------------------------------------- + +// Has +int +BackgroundFastRegionHas(ConstHandle2ConstBackground self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FastRegionHas", self, extract::fastRegion); +} + +// Get, const +Handle2ConstFastRegion +BackgroundFastRegionGetConst(ConstHandle2ConstBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FastRegionGetConst", self, extract::fastRegion); +} + +// Get, non-const +Handle2FastRegion +BackgroundFastRegionGet(ConstHandle2Background self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FastRegionGet", self, extract::fastRegion); +} + +// Set +void +BackgroundFastRegionSet(ConstHandle2Background self, ConstHandle2ConstFastRegion fastRegion) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FastRegionSet", self, extract::fastRegion, fastRegion); +} + + +// ----------------------------------------------------------------------------- +// Child: unresolvedRegion +// ----------------------------------------------------------------------------- + +// Has +int +BackgroundUnresolvedRegionHas(ConstHandle2ConstBackground self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnresolvedRegionHas", self, extract::unresolvedRegion); +} + +// Get, const +Handle2ConstUnresolvedRegion +BackgroundUnresolvedRegionGetConst(ConstHandle2ConstBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnresolvedRegionGetConst", self, extract::unresolvedRegion); +} + +// Get, non-const +Handle2UnresolvedRegion +BackgroundUnresolvedRegionGet(ConstHandle2Background self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnresolvedRegionGet", self, extract::unresolvedRegion); +} + +// Set +void +BackgroundUnresolvedRegionSet(ConstHandle2Background self, ConstHandle2ConstUnresolvedRegion unresolvedRegion) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnresolvedRegionSet", self, extract::unresolvedRegion, unresolvedRegion); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Background/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Background.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Background.h new file mode 100644 index 000000000..785b6b45a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Background.h @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Background is the basic handle type in this file. Example: +// // Create a default Background object: +// Background handle = BackgroundDefault(); +// Functions involving Background are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_BACKGROUND +#define C_INTERFACE_GNDS_V2_0_GENERAL_BACKGROUND + +#include "GNDStk.h" +#include "v2.0/general/ResolvedRegion.h" +#include "v2.0/general/FastRegion.h" +#include "v2.0/general/UnresolvedRegion.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BackgroundClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Background +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BackgroundClass *Background; + +// --- Const-aware handles. +typedef const struct BackgroundClass *const ConstHandle2ConstBackground; +typedef struct BackgroundClass *const ConstHandle2Background; +typedef const struct BackgroundClass * Handle2ConstBackground; +typedef struct BackgroundClass * Handle2Background; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBackground +BackgroundDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Background +BackgroundDefault(); + +// --- Create, general, const +extern_c Handle2ConstBackground +BackgroundCreateConst( + ConstHandle2ConstResolvedRegion resolvedRegion, + ConstHandle2ConstFastRegion fastRegion, + ConstHandle2ConstUnresolvedRegion unresolvedRegion +); + +// +++ Create, general, non-const +extern_c Handle2Background +BackgroundCreate( + ConstHandle2ConstResolvedRegion resolvedRegion, + ConstHandle2ConstFastRegion fastRegion, + ConstHandle2ConstUnresolvedRegion unresolvedRegion +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BackgroundAssign(ConstHandle2Background self, ConstHandle2ConstBackground from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BackgroundDelete(ConstHandle2ConstBackground self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BackgroundRead(ConstHandle2Background self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BackgroundWrite(ConstHandle2ConstBackground self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BackgroundPrint(ConstHandle2ConstBackground self); + +// +++ Print to standard output, as XML +extern_c int +BackgroundPrintXML(ConstHandle2ConstBackground self); + +// +++ Print to standard output, as JSON +extern_c int +BackgroundPrintJSON(ConstHandle2ConstBackground self); + + +// ----------------------------------------------------------------------------- +// Child: resolvedRegion +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BackgroundResolvedRegionHas(ConstHandle2ConstBackground self); + +// --- Get, const +extern_c Handle2ConstResolvedRegion +BackgroundResolvedRegionGetConst(ConstHandle2ConstBackground self); + +// +++ Get, non-const +extern_c Handle2ResolvedRegion +BackgroundResolvedRegionGet(ConstHandle2Background self); + +// +++ Set +extern_c void +BackgroundResolvedRegionSet(ConstHandle2Background self, ConstHandle2ConstResolvedRegion resolvedRegion); + + +// ----------------------------------------------------------------------------- +// Child: fastRegion +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BackgroundFastRegionHas(ConstHandle2ConstBackground self); + +// --- Get, const +extern_c Handle2ConstFastRegion +BackgroundFastRegionGetConst(ConstHandle2ConstBackground self); + +// +++ Get, non-const +extern_c Handle2FastRegion +BackgroundFastRegionGet(ConstHandle2Background self); + +// +++ Set +extern_c void +BackgroundFastRegionSet(ConstHandle2Background self, ConstHandle2ConstFastRegion fastRegion); + + +// ----------------------------------------------------------------------------- +// Child: unresolvedRegion +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BackgroundUnresolvedRegionHas(ConstHandle2ConstBackground self); + +// --- Get, const +extern_c Handle2ConstUnresolvedRegion +BackgroundUnresolvedRegionGetConst(ConstHandle2ConstBackground self); + +// +++ Get, non-const +extern_c Handle2UnresolvedRegion +BackgroundUnresolvedRegionGet(ConstHandle2Background self); + +// +++ Set +extern_c void +BackgroundUnresolvedRegionSet(ConstHandle2Background self, ConstHandle2ConstUnresolvedRegion unresolvedRegion); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Background/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Background/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Background/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Background/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Background/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryon.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryon.cpp new file mode 100644 index 000000000..be8d78def --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryon.cpp @@ -0,0 +1,431 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Baryon.hpp" +#include "Baryon.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = BaryonClass; +using CPP = multigroup::Baryon; + +static const std::string CLASSNAME = "Baryon"; + +namespace extract { + static auto id = [](auto &obj) { return &obj.id; }; + static auto mass = [](auto &obj) { return &obj.mass; }; + static auto spin = [](auto &obj) { return &obj.spin; }; + static auto parity = [](auto &obj) { return &obj.parity; }; + static auto charge = [](auto &obj) { return &obj.charge; }; + static auto halflife = [](auto &obj) { return &obj.halflife; }; + static auto decayData = [](auto &obj) { return &obj.decayData; }; +} + +using CPPMass = general::Mass; +using CPPSpin = general::Spin; +using CPPParity = general::Parity; +using CPPCharge = general::Charge; +using CPPHalflife = general::Halflife; +using CPPDecayData = general::DecayData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBaryon +BaryonDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Baryon +BaryonDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBaryon +BaryonCreateConst( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2Baryon handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(charge), + detail::tocpp(halflife), + detail::tocpp(decayData) + ); + return handle; +} + +// Create, general, non-const +Handle2Baryon +BaryonCreate( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2Baryon handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(charge), + detail::tocpp(halflife), + detail::tocpp(decayData) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BaryonAssign(ConstHandle2Baryon self, ConstHandle2ConstBaryon from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BaryonDelete(ConstHandle2ConstBaryon self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BaryonRead(ConstHandle2Baryon self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BaryonWrite(ConstHandle2ConstBaryon self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BaryonPrint(ConstHandle2ConstBaryon self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BaryonPrintXML(ConstHandle2ConstBaryon self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BaryonPrintJSON(ConstHandle2ConstBaryon self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// Has +int +BaryonIdHas(ConstHandle2ConstBaryon self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IdHas", self, extract::id); +} + +// Get +// Returns by value +const char * +BaryonIdGet(ConstHandle2ConstBaryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +BaryonIdSet(ConstHandle2Baryon self, const char *const id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// Has +int +BaryonMassHas(ConstHandle2ConstBaryon self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MassHas", self, extract::mass); +} + +// Get, const +Handle2ConstMass +BaryonMassGetConst(ConstHandle2ConstBaryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGetConst", self, extract::mass); +} + +// Get, non-const +Handle2Mass +BaryonMassGet(ConstHandle2Baryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGet", self, extract::mass); +} + +// Set +void +BaryonMassSet(ConstHandle2Baryon self, ConstHandle2ConstMass mass) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MassSet", self, extract::mass, mass); +} + + +// ----------------------------------------------------------------------------- +// Child: spin +// ----------------------------------------------------------------------------- + +// Has +int +BaryonSpinHas(ConstHandle2ConstBaryon self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SpinHas", self, extract::spin); +} + +// Get, const +Handle2ConstSpin +BaryonSpinGetConst(ConstHandle2ConstBaryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGetConst", self, extract::spin); +} + +// Get, non-const +Handle2Spin +BaryonSpinGet(ConstHandle2Baryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGet", self, extract::spin); +} + +// Set +void +BaryonSpinSet(ConstHandle2Baryon self, ConstHandle2ConstSpin spin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SpinSet", self, extract::spin, spin); +} + + +// ----------------------------------------------------------------------------- +// Child: parity +// ----------------------------------------------------------------------------- + +// Has +int +BaryonParityHas(ConstHandle2ConstBaryon self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ParityHas", self, extract::parity); +} + +// Get, const +Handle2ConstParity +BaryonParityGetConst(ConstHandle2ConstBaryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGetConst", self, extract::parity); +} + +// Get, non-const +Handle2Parity +BaryonParityGet(ConstHandle2Baryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGet", self, extract::parity); +} + +// Set +void +BaryonParitySet(ConstHandle2Baryon self, ConstHandle2ConstParity parity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ParitySet", self, extract::parity, parity); +} + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// Has +int +BaryonChargeHas(ConstHandle2ConstBaryon self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChargeHas", self, extract::charge); +} + +// Get, const +Handle2ConstCharge +BaryonChargeGetConst(ConstHandle2ConstBaryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGetConst", self, extract::charge); +} + +// Get, non-const +Handle2Charge +BaryonChargeGet(ConstHandle2Baryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGet", self, extract::charge); +} + +// Set +void +BaryonChargeSet(ConstHandle2Baryon self, ConstHandle2ConstCharge charge) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChargeSet", self, extract::charge, charge); +} + + +// ----------------------------------------------------------------------------- +// Child: halflife +// ----------------------------------------------------------------------------- + +// Has +int +BaryonHalflifeHas(ConstHandle2ConstBaryon self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HalflifeHas", self, extract::halflife); +} + +// Get, const +Handle2ConstHalflife +BaryonHalflifeGetConst(ConstHandle2ConstBaryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HalflifeGetConst", self, extract::halflife); +} + +// Get, non-const +Handle2Halflife +BaryonHalflifeGet(ConstHandle2Baryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HalflifeGet", self, extract::halflife); +} + +// Set +void +BaryonHalflifeSet(ConstHandle2Baryon self, ConstHandle2ConstHalflife halflife) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HalflifeSet", self, extract::halflife, halflife); +} + + +// ----------------------------------------------------------------------------- +// Child: decayData +// ----------------------------------------------------------------------------- + +// Has +int +BaryonDecayDataHas(ConstHandle2ConstBaryon self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DecayDataHas", self, extract::decayData); +} + +// Get, const +Handle2ConstDecayData +BaryonDecayDataGetConst(ConstHandle2ConstBaryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGetConst", self, extract::decayData); +} + +// Get, non-const +Handle2DecayData +BaryonDecayDataGet(ConstHandle2Baryon self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGet", self, extract::decayData); +} + +// Set +void +BaryonDecayDataSet(ConstHandle2Baryon self, ConstHandle2ConstDecayData decayData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DecayDataSet", self, extract::decayData, decayData); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Baryon/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryon.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryon.h new file mode 100644 index 000000000..36356c275 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryon.h @@ -0,0 +1,301 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Baryon is the basic handle type in this file. Example: +// // Create a default Baryon object: +// Baryon handle = BaryonDefault(); +// Functions involving Baryon are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_BARYON +#define C_INTERFACE_GNDS_V2_0_GENERAL_BARYON + +#include "GNDStk.h" +#include "v2.0/general/Mass.h" +#include "v2.0/general/Spin.h" +#include "v2.0/general/Parity.h" +#include "v2.0/general/Charge.h" +#include "v2.0/general/Halflife.h" +#include "v2.0/general/DecayData.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BaryonClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Baryon +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BaryonClass *Baryon; + +// --- Const-aware handles. +typedef const struct BaryonClass *const ConstHandle2ConstBaryon; +typedef struct BaryonClass *const ConstHandle2Baryon; +typedef const struct BaryonClass * Handle2ConstBaryon; +typedef struct BaryonClass * Handle2Baryon; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBaryon +BaryonDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Baryon +BaryonDefault(); + +// --- Create, general, const +extern_c Handle2ConstBaryon +BaryonCreateConst( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstDecayData decayData +); + +// +++ Create, general, non-const +extern_c Handle2Baryon +BaryonCreate( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstDecayData decayData +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BaryonAssign(ConstHandle2Baryon self, ConstHandle2ConstBaryon from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BaryonDelete(ConstHandle2ConstBaryon self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BaryonRead(ConstHandle2Baryon self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BaryonWrite(ConstHandle2ConstBaryon self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BaryonPrint(ConstHandle2ConstBaryon self); + +// +++ Print to standard output, as XML +extern_c int +BaryonPrintXML(ConstHandle2ConstBaryon self); + +// +++ Print to standard output, as JSON +extern_c int +BaryonPrintJSON(ConstHandle2ConstBaryon self); + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BaryonIdHas(ConstHandle2ConstBaryon self); + +// +++ Get +// +++ Returns by value +extern_c const char * +BaryonIdGet(ConstHandle2ConstBaryon self); + +// +++ Set +extern_c void +BaryonIdSet(ConstHandle2Baryon self, const char *const id); + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BaryonMassHas(ConstHandle2ConstBaryon self); + +// --- Get, const +extern_c Handle2ConstMass +BaryonMassGetConst(ConstHandle2ConstBaryon self); + +// +++ Get, non-const +extern_c Handle2Mass +BaryonMassGet(ConstHandle2Baryon self); + +// +++ Set +extern_c void +BaryonMassSet(ConstHandle2Baryon self, ConstHandle2ConstMass mass); + + +// ----------------------------------------------------------------------------- +// Child: spin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BaryonSpinHas(ConstHandle2ConstBaryon self); + +// --- Get, const +extern_c Handle2ConstSpin +BaryonSpinGetConst(ConstHandle2ConstBaryon self); + +// +++ Get, non-const +extern_c Handle2Spin +BaryonSpinGet(ConstHandle2Baryon self); + +// +++ Set +extern_c void +BaryonSpinSet(ConstHandle2Baryon self, ConstHandle2ConstSpin spin); + + +// ----------------------------------------------------------------------------- +// Child: parity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BaryonParityHas(ConstHandle2ConstBaryon self); + +// --- Get, const +extern_c Handle2ConstParity +BaryonParityGetConst(ConstHandle2ConstBaryon self); + +// +++ Get, non-const +extern_c Handle2Parity +BaryonParityGet(ConstHandle2Baryon self); + +// +++ Set +extern_c void +BaryonParitySet(ConstHandle2Baryon self, ConstHandle2ConstParity parity); + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BaryonChargeHas(ConstHandle2ConstBaryon self); + +// --- Get, const +extern_c Handle2ConstCharge +BaryonChargeGetConst(ConstHandle2ConstBaryon self); + +// +++ Get, non-const +extern_c Handle2Charge +BaryonChargeGet(ConstHandle2Baryon self); + +// +++ Set +extern_c void +BaryonChargeSet(ConstHandle2Baryon self, ConstHandle2ConstCharge charge); + + +// ----------------------------------------------------------------------------- +// Child: halflife +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BaryonHalflifeHas(ConstHandle2ConstBaryon self); + +// --- Get, const +extern_c Handle2ConstHalflife +BaryonHalflifeGetConst(ConstHandle2ConstBaryon self); + +// +++ Get, non-const +extern_c Handle2Halflife +BaryonHalflifeGet(ConstHandle2Baryon self); + +// +++ Set +extern_c void +BaryonHalflifeSet(ConstHandle2Baryon self, ConstHandle2ConstHalflife halflife); + + +// ----------------------------------------------------------------------------- +// Child: decayData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BaryonDecayDataHas(ConstHandle2ConstBaryon self); + +// --- Get, const +extern_c Handle2ConstDecayData +BaryonDecayDataGetConst(ConstHandle2ConstBaryon self); + +// +++ Get, non-const +extern_c Handle2DecayData +BaryonDecayDataGet(ConstHandle2Baryon self); + +// +++ Set +extern_c void +BaryonDecayDataSet(ConstHandle2Baryon self, ConstHandle2ConstDecayData decayData); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Baryon/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryon/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryon/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryon/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryon/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryons.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryons.cpp new file mode 100644 index 000000000..acc6ca506 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryons.cpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Baryons.hpp" +#include "Baryons.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = BaryonsClass; +using CPP = multigroup::Baryons; + +static const std::string CLASSNAME = "Baryons"; + +namespace extract { + static auto baryon = [](auto &obj) { return &obj.baryon; }; +} + +using CPPBaryon = general::Baryon; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBaryons +BaryonsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Baryons +BaryonsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBaryons +BaryonsCreateConst( + ConstHandle2Baryon *const baryon, const size_t baryonSize +) { + ConstHandle2Baryons handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t BaryonN = 0; BaryonN < baryonSize; ++BaryonN) + BaryonsBaryonAdd(handle, baryon[BaryonN]); + return handle; +} + +// Create, general, non-const +Handle2Baryons +BaryonsCreate( + ConstHandle2Baryon *const baryon, const size_t baryonSize +) { + ConstHandle2Baryons handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t BaryonN = 0; BaryonN < baryonSize; ++BaryonN) + BaryonsBaryonAdd(handle, baryon[BaryonN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BaryonsAssign(ConstHandle2Baryons self, ConstHandle2ConstBaryons from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BaryonsDelete(ConstHandle2ConstBaryons self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BaryonsRead(ConstHandle2Baryons self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BaryonsWrite(ConstHandle2ConstBaryons self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BaryonsPrint(ConstHandle2ConstBaryons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BaryonsPrintXML(ConstHandle2ConstBaryons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BaryonsPrintJSON(ConstHandle2ConstBaryons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: baryon +// ----------------------------------------------------------------------------- + +// Has +int +BaryonsBaryonHas(ConstHandle2ConstBaryons self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BaryonHas", self, extract::baryon); +} + +// Clear +void +BaryonsBaryonClear(ConstHandle2Baryons self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"BaryonClear", self, extract::baryon); +} + +// Size +size_t +BaryonsBaryonSize(ConstHandle2ConstBaryons self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"BaryonSize", self, extract::baryon); +} + +// Add +void +BaryonsBaryonAdd(ConstHandle2Baryons self, ConstHandle2ConstBaryon baryon) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"BaryonAdd", self, extract::baryon, baryon); +} + +// Get, by index \in [0,size), const +Handle2ConstBaryon +BaryonsBaryonGetConst(ConstHandle2ConstBaryons self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"BaryonGetConst", self, extract::baryon, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Baryon +BaryonsBaryonGet(ConstHandle2Baryons self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"BaryonGet", self, extract::baryon, index_); +} + +// Set, by index \in [0,size) +void +BaryonsBaryonSet( + ConstHandle2Baryons self, + const size_t index_, + ConstHandle2ConstBaryon baryon +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"BaryonSet", self, extract::baryon, index_, baryon); +} + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// Has, by id +int +BaryonsBaryonHasById( + ConstHandle2ConstBaryons self, + const char *const id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"BaryonHasById", + self, extract::baryon, meta::id, id); +} + +// Get, by id, const +Handle2ConstBaryon +BaryonsBaryonGetByIdConst( + ConstHandle2ConstBaryons self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BaryonGetByIdConst", + self, extract::baryon, meta::id, id); +} + +// Get, by id, non-const +Handle2Baryon +BaryonsBaryonGetById( + ConstHandle2Baryons self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"BaryonGetById", + self, extract::baryon, meta::id, id); +} + +// Set, by id +void +BaryonsBaryonSetById( + ConstHandle2Baryons self, + const char *const id, + ConstHandle2ConstBaryon baryon +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"BaryonSetById", + self, extract::baryon, meta::id, id, baryon); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Baryons/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryons.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryons.h new file mode 100644 index 000000000..26b995078 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryons.h @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Baryons is the basic handle type in this file. Example: +// // Create a default Baryons object: +// Baryons handle = BaryonsDefault(); +// Functions involving Baryons are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_BARYONS +#define C_INTERFACE_GNDS_V2_0_GENERAL_BARYONS + +#include "GNDStk.h" +#include "v2.0/general/Baryon.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BaryonsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Baryons +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BaryonsClass *Baryons; + +// --- Const-aware handles. +typedef const struct BaryonsClass *const ConstHandle2ConstBaryons; +typedef struct BaryonsClass *const ConstHandle2Baryons; +typedef const struct BaryonsClass * Handle2ConstBaryons; +typedef struct BaryonsClass * Handle2Baryons; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBaryons +BaryonsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Baryons +BaryonsDefault(); + +// --- Create, general, const +extern_c Handle2ConstBaryons +BaryonsCreateConst( + ConstHandle2Baryon *const baryon, const size_t baryonSize +); + +// +++ Create, general, non-const +extern_c Handle2Baryons +BaryonsCreate( + ConstHandle2Baryon *const baryon, const size_t baryonSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BaryonsAssign(ConstHandle2Baryons self, ConstHandle2ConstBaryons from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BaryonsDelete(ConstHandle2ConstBaryons self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BaryonsRead(ConstHandle2Baryons self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BaryonsWrite(ConstHandle2ConstBaryons self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BaryonsPrint(ConstHandle2ConstBaryons self); + +// +++ Print to standard output, as XML +extern_c int +BaryonsPrintXML(ConstHandle2ConstBaryons self); + +// +++ Print to standard output, as JSON +extern_c int +BaryonsPrintJSON(ConstHandle2ConstBaryons self); + + +// ----------------------------------------------------------------------------- +// Child: baryon +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BaryonsBaryonHas(ConstHandle2ConstBaryons self); + +// +++ Clear +extern_c void +BaryonsBaryonClear(ConstHandle2Baryons self); + +// +++ Size +extern_c size_t +BaryonsBaryonSize(ConstHandle2ConstBaryons self); + +// +++ Add +extern_c void +BaryonsBaryonAdd(ConstHandle2Baryons self, ConstHandle2ConstBaryon baryon); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstBaryon +BaryonsBaryonGetConst(ConstHandle2ConstBaryons self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Baryon +BaryonsBaryonGet(ConstHandle2Baryons self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +BaryonsBaryonSet( + ConstHandle2Baryons self, + const size_t index_, + ConstHandle2ConstBaryon baryon +); + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// +++ Has, by id +extern_c int +BaryonsBaryonHasById( + ConstHandle2ConstBaryons self, + const char *const id +); + +// --- Get, by id, const +extern_c Handle2ConstBaryon +BaryonsBaryonGetByIdConst( + ConstHandle2ConstBaryons self, + const char *const id +); + +// +++ Get, by id, non-const +extern_c Handle2Baryon +BaryonsBaryonGetById( + ConstHandle2Baryons self, + const char *const id +); + +// +++ Set, by id +extern_c void +BaryonsBaryonSetById( + ConstHandle2Baryons self, + const char *const id, + ConstHandle2ConstBaryon baryon +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Baryons/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryons/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryons/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Baryons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BindingEnergy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BindingEnergy.cpp new file mode 100644 index 000000000..db7f59379 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BindingEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/BindingEnergy.hpp" +#include "BindingEnergy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = BindingEnergyClass; +using CPP = multigroup::BindingEnergy; + +static const std::string CLASSNAME = "BindingEnergy"; + +namespace extract { + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDouble = general::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBindingEnergy +BindingEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2BindingEnergy +BindingEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBindingEnergy +BindingEnergyCreateConst( + ConstHandle2ConstDouble Double +) { + ConstHandle2BindingEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(Double) + ); + return handle; +} + +// Create, general, non-const +Handle2BindingEnergy +BindingEnergyCreate( + ConstHandle2ConstDouble Double +) { + ConstHandle2BindingEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(Double) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BindingEnergyAssign(ConstHandle2BindingEnergy self, ConstHandle2ConstBindingEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BindingEnergyDelete(ConstHandle2ConstBindingEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BindingEnergyRead(ConstHandle2BindingEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BindingEnergyWrite(ConstHandle2ConstBindingEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BindingEnergyPrint(ConstHandle2ConstBindingEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BindingEnergyPrintXML(ConstHandle2ConstBindingEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BindingEnergyPrintJSON(ConstHandle2ConstBindingEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +BindingEnergyDoubleHas(ConstHandle2ConstBindingEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Get, const +Handle2ConstDouble +BindingEnergyDoubleGetConst(ConstHandle2ConstBindingEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double); +} + +// Get, non-const +Handle2Double +BindingEnergyDoubleGet(ConstHandle2BindingEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double); +} + +// Set +void +BindingEnergyDoubleSet(ConstHandle2BindingEnergy self, ConstHandle2ConstDouble Double) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/BindingEnergy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BindingEnergy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BindingEnergy.h new file mode 100644 index 000000000..a30533645 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BindingEnergy.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// BindingEnergy is the basic handle type in this file. Example: +// // Create a default BindingEnergy object: +// BindingEnergy handle = BindingEnergyDefault(); +// Functions involving BindingEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_BINDINGENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_BINDINGENERGY + +#include "GNDStk.h" +#include "v2.0/general/Double.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BindingEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ BindingEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BindingEnergyClass *BindingEnergy; + +// --- Const-aware handles. +typedef const struct BindingEnergyClass *const ConstHandle2ConstBindingEnergy; +typedef struct BindingEnergyClass *const ConstHandle2BindingEnergy; +typedef const struct BindingEnergyClass * Handle2ConstBindingEnergy; +typedef struct BindingEnergyClass * Handle2BindingEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBindingEnergy +BindingEnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2BindingEnergy +BindingEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstBindingEnergy +BindingEnergyCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general, non-const +extern_c Handle2BindingEnergy +BindingEnergyCreate( + ConstHandle2ConstDouble Double +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BindingEnergyAssign(ConstHandle2BindingEnergy self, ConstHandle2ConstBindingEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BindingEnergyDelete(ConstHandle2ConstBindingEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BindingEnergyRead(ConstHandle2BindingEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BindingEnergyWrite(ConstHandle2ConstBindingEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BindingEnergyPrint(ConstHandle2ConstBindingEnergy self); + +// +++ Print to standard output, as XML +extern_c int +BindingEnergyPrintXML(ConstHandle2ConstBindingEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +BindingEnergyPrintJSON(ConstHandle2ConstBindingEnergy self); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BindingEnergyDoubleHas(ConstHandle2ConstBindingEnergy self); + +// --- Get, const +extern_c Handle2ConstDouble +BindingEnergyDoubleGetConst(ConstHandle2ConstBindingEnergy self); + +// +++ Get, non-const +extern_c Handle2Double +BindingEnergyDoubleGet(ConstHandle2BindingEnergy self); + +// +++ Set +extern_c void +BindingEnergyDoubleSet(ConstHandle2BindingEnergy self, ConstHandle2ConstDouble Double); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/BindingEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BindingEnergy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BindingEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BindingEnergy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BindingEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Body.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Body.cpp new file mode 100644 index 000000000..4296fde2e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Body.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Body.hpp" +#include "Body.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = BodyClass; +using CPP = multigroup::Body; + +static const std::string CLASSNAME = "Body"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBody +BodyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Body +BodyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBody +BodyCreateConst() +{ + ConstHandle2Body handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general, non-const +Handle2Body +BodyCreate() +{ + ConstHandle2Body handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create" + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BodyAssign(ConstHandle2Body self, ConstHandle2ConstBody from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BodyDelete(ConstHandle2ConstBody self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BodyRead(ConstHandle2Body self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BodyWrite(ConstHandle2ConstBody self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BodyPrint(ConstHandle2ConstBody self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BodyPrintXML(ConstHandle2ConstBody self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BodyPrintJSON(ConstHandle2ConstBody self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Body/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Body.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Body.h new file mode 100644 index 000000000..1c3cb93e8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Body.h @@ -0,0 +1,135 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Body is the basic handle type in this file. Example: +// // Create a default Body object: +// Body handle = BodyDefault(); +// Functions involving Body are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_BODY +#define C_INTERFACE_GNDS_V2_0_GENERAL_BODY + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BodyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Body +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BodyClass *Body; + +// --- Const-aware handles. +typedef const struct BodyClass *const ConstHandle2ConstBody; +typedef struct BodyClass *const ConstHandle2Body; +typedef const struct BodyClass * Handle2ConstBody; +typedef struct BodyClass * Handle2Body; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBody +BodyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Body +BodyDefault(); + +// --- Create, general, const +extern_c Handle2ConstBody +BodyCreateConst(); + +// +++ Create, general, non-const +extern_c Handle2Body +BodyCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BodyAssign(ConstHandle2Body self, ConstHandle2ConstBody from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BodyDelete(ConstHandle2ConstBody self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BodyRead(ConstHandle2Body self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BodyWrite(ConstHandle2ConstBody self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BodyPrint(ConstHandle2ConstBody self); + +// +++ Print to standard output, as XML +extern_c int +BodyPrintXML(ConstHandle2ConstBody self); + +// +++ Print to standard output, as JSON +extern_c int +BodyPrintJSON(ConstHandle2ConstBody self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Body/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Body/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Body/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Body/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Body/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BoundAtomCrossSection.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BoundAtomCrossSection.cpp new file mode 100644 index 000000000..6b2120ac8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BoundAtomCrossSection.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/BoundAtomCrossSection.hpp" +#include "BoundAtomCrossSection.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = BoundAtomCrossSectionClass; +using CPP = multigroup::BoundAtomCrossSection; + +static const std::string CLASSNAME = "BoundAtomCrossSection"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBoundAtomCrossSection +BoundAtomCrossSectionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2BoundAtomCrossSection +BoundAtomCrossSectionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBoundAtomCrossSection +BoundAtomCrossSectionCreateConst( + const double value, + const char *const unit +) { + ConstHandle2BoundAtomCrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2BoundAtomCrossSection +BoundAtomCrossSectionCreate( + const double value, + const char *const unit +) { + ConstHandle2BoundAtomCrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BoundAtomCrossSectionAssign(ConstHandle2BoundAtomCrossSection self, ConstHandle2ConstBoundAtomCrossSection from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BoundAtomCrossSectionDelete(ConstHandle2ConstBoundAtomCrossSection self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BoundAtomCrossSectionRead(ConstHandle2BoundAtomCrossSection self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BoundAtomCrossSectionWrite(ConstHandle2ConstBoundAtomCrossSection self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BoundAtomCrossSectionPrint(ConstHandle2ConstBoundAtomCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BoundAtomCrossSectionPrintXML(ConstHandle2ConstBoundAtomCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BoundAtomCrossSectionPrintJSON(ConstHandle2ConstBoundAtomCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +BoundAtomCrossSectionValueHas(ConstHandle2ConstBoundAtomCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +BoundAtomCrossSectionValueGet(ConstHandle2ConstBoundAtomCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +BoundAtomCrossSectionValueSet(ConstHandle2BoundAtomCrossSection self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +BoundAtomCrossSectionUnitHas(ConstHandle2ConstBoundAtomCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +BoundAtomCrossSectionUnitGet(ConstHandle2ConstBoundAtomCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +BoundAtomCrossSectionUnitSet(ConstHandle2BoundAtomCrossSection self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/BoundAtomCrossSection/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BoundAtomCrossSection.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BoundAtomCrossSection.h new file mode 100644 index 000000000..29238fe0b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BoundAtomCrossSection.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// BoundAtomCrossSection is the basic handle type in this file. Example: +// // Create a default BoundAtomCrossSection object: +// BoundAtomCrossSection handle = BoundAtomCrossSectionDefault(); +// Functions involving BoundAtomCrossSection are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_BOUNDATOMCROSSSECTION +#define C_INTERFACE_GNDS_V2_0_GENERAL_BOUNDATOMCROSSSECTION + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BoundAtomCrossSectionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ BoundAtomCrossSection +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BoundAtomCrossSectionClass *BoundAtomCrossSection; + +// --- Const-aware handles. +typedef const struct BoundAtomCrossSectionClass *const ConstHandle2ConstBoundAtomCrossSection; +typedef struct BoundAtomCrossSectionClass *const ConstHandle2BoundAtomCrossSection; +typedef const struct BoundAtomCrossSectionClass * Handle2ConstBoundAtomCrossSection; +typedef struct BoundAtomCrossSectionClass * Handle2BoundAtomCrossSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBoundAtomCrossSection +BoundAtomCrossSectionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2BoundAtomCrossSection +BoundAtomCrossSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstBoundAtomCrossSection +BoundAtomCrossSectionCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2BoundAtomCrossSection +BoundAtomCrossSectionCreate( + const double value, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BoundAtomCrossSectionAssign(ConstHandle2BoundAtomCrossSection self, ConstHandle2ConstBoundAtomCrossSection from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BoundAtomCrossSectionDelete(ConstHandle2ConstBoundAtomCrossSection self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BoundAtomCrossSectionRead(ConstHandle2BoundAtomCrossSection self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BoundAtomCrossSectionWrite(ConstHandle2ConstBoundAtomCrossSection self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BoundAtomCrossSectionPrint(ConstHandle2ConstBoundAtomCrossSection self); + +// +++ Print to standard output, as XML +extern_c int +BoundAtomCrossSectionPrintXML(ConstHandle2ConstBoundAtomCrossSection self); + +// +++ Print to standard output, as JSON +extern_c int +BoundAtomCrossSectionPrintJSON(ConstHandle2ConstBoundAtomCrossSection self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BoundAtomCrossSectionValueHas(ConstHandle2ConstBoundAtomCrossSection self); + +// +++ Get +// +++ Returns by value +extern_c double +BoundAtomCrossSectionValueGet(ConstHandle2ConstBoundAtomCrossSection self); + +// +++ Set +extern_c void +BoundAtomCrossSectionValueSet(ConstHandle2BoundAtomCrossSection self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BoundAtomCrossSectionUnitHas(ConstHandle2ConstBoundAtomCrossSection self); + +// +++ Get +// +++ Returns by value +extern_c const char * +BoundAtomCrossSectionUnitGet(ConstHandle2ConstBoundAtomCrossSection self); + +// +++ Set +extern_c void +BoundAtomCrossSectionUnitSet(ConstHandle2BoundAtomCrossSection self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/BoundAtomCrossSection/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BoundAtomCrossSection/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BoundAtomCrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BoundAtomCrossSection/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BoundAtomCrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching1d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching1d.cpp new file mode 100644 index 000000000..1270bd75b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching1d.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Branching1d.hpp" +#include "Branching1d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Branching1dClass; +using CPP = multigroup::Branching1d; + +static const std::string CLASSNAME = "Branching1d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBranching1d +Branching1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Branching1d +Branching1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBranching1d +Branching1dCreateConst( + const char *const label +) { + ConstHandle2Branching1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label + ); + return handle; +} + +// Create, general, non-const +Handle2Branching1d +Branching1dCreate( + const char *const label +) { + ConstHandle2Branching1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Branching1dAssign(ConstHandle2Branching1d self, ConstHandle2ConstBranching1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Branching1dDelete(ConstHandle2ConstBranching1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Branching1dRead(ConstHandle2Branching1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Branching1dWrite(ConstHandle2ConstBranching1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Branching1dPrint(ConstHandle2ConstBranching1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Branching1dPrintXML(ConstHandle2ConstBranching1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Branching1dPrintJSON(ConstHandle2ConstBranching1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Branching1dLabelHas(ConstHandle2ConstBranching1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +Branching1dLabelGet(ConstHandle2ConstBranching1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Branching1dLabelSet(ConstHandle2Branching1d self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Branching1d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching1d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching1d.h new file mode 100644 index 000000000..a346d7120 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching1d.h @@ -0,0 +1,157 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Branching1d is the basic handle type in this file. Example: +// // Create a default Branching1d object: +// Branching1d handle = Branching1dDefault(); +// Functions involving Branching1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_BRANCHING1D +#define C_INTERFACE_GNDS_V2_0_GENERAL_BRANCHING1D + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Branching1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Branching1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Branching1dClass *Branching1d; + +// --- Const-aware handles. +typedef const struct Branching1dClass *const ConstHandle2ConstBranching1d; +typedef struct Branching1dClass *const ConstHandle2Branching1d; +typedef const struct Branching1dClass * Handle2ConstBranching1d; +typedef struct Branching1dClass * Handle2Branching1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBranching1d +Branching1dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Branching1d +Branching1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstBranching1d +Branching1dCreateConst( + const char *const label +); + +// +++ Create, general, non-const +extern_c Handle2Branching1d +Branching1dCreate( + const char *const label +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Branching1dAssign(ConstHandle2Branching1d self, ConstHandle2ConstBranching1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Branching1dDelete(ConstHandle2ConstBranching1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Branching1dRead(ConstHandle2Branching1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Branching1dWrite(ConstHandle2ConstBranching1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Branching1dPrint(ConstHandle2ConstBranching1d self); + +// +++ Print to standard output, as XML +extern_c int +Branching1dPrintXML(ConstHandle2ConstBranching1d self); + +// +++ Print to standard output, as JSON +extern_c int +Branching1dPrintJSON(ConstHandle2ConstBranching1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Branching1dLabelHas(ConstHandle2ConstBranching1d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +Branching1dLabelGet(ConstHandle2ConstBranching1d self); + +// +++ Set +extern_c void +Branching1dLabelSet(ConstHandle2Branching1d self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Branching1d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching1d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching1d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching3d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching3d.cpp new file mode 100644 index 000000000..b0adea103 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching3d.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Branching3d.hpp" +#include "Branching3d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Branching3dClass; +using CPP = multigroup::Branching3d; + +static const std::string CLASSNAME = "Branching3d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBranching3d +Branching3dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Branching3d +Branching3dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBranching3d +Branching3dCreateConst( + const char *const label, + const char *const productFrame +) { + ConstHandle2Branching3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame + ); + return handle; +} + +// Create, general, non-const +Handle2Branching3d +Branching3dCreate( + const char *const label, + const char *const productFrame +) { + ConstHandle2Branching3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Branching3dAssign(ConstHandle2Branching3d self, ConstHandle2ConstBranching3d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Branching3dDelete(ConstHandle2ConstBranching3d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Branching3dRead(ConstHandle2Branching3d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Branching3dWrite(ConstHandle2ConstBranching3d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Branching3dPrint(ConstHandle2ConstBranching3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Branching3dPrintXML(ConstHandle2ConstBranching3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Branching3dPrintJSON(ConstHandle2ConstBranching3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Branching3dLabelHas(ConstHandle2ConstBranching3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +Branching3dLabelGet(ConstHandle2ConstBranching3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Branching3dLabelSet(ConstHandle2Branching3d self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +Branching3dProductFrameHas(ConstHandle2ConstBranching3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +Branching3dProductFrameGet(ConstHandle2ConstBranching3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +Branching3dProductFrameSet(ConstHandle2Branching3d self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Branching3d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching3d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching3d.h new file mode 100644 index 000000000..28a09b6f4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching3d.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Branching3d is the basic handle type in this file. Example: +// // Create a default Branching3d object: +// Branching3d handle = Branching3dDefault(); +// Functions involving Branching3d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_BRANCHING3D +#define C_INTERFACE_GNDS_V2_0_GENERAL_BRANCHING3D + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Branching3dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Branching3d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Branching3dClass *Branching3d; + +// --- Const-aware handles. +typedef const struct Branching3dClass *const ConstHandle2ConstBranching3d; +typedef struct Branching3dClass *const ConstHandle2Branching3d; +typedef const struct Branching3dClass * Handle2ConstBranching3d; +typedef struct Branching3dClass * Handle2Branching3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBranching3d +Branching3dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Branching3d +Branching3dDefault(); + +// --- Create, general, const +extern_c Handle2ConstBranching3d +Branching3dCreateConst( + const char *const label, + const char *const productFrame +); + +// +++ Create, general, non-const +extern_c Handle2Branching3d +Branching3dCreate( + const char *const label, + const char *const productFrame +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Branching3dAssign(ConstHandle2Branching3d self, ConstHandle2ConstBranching3d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Branching3dDelete(ConstHandle2ConstBranching3d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Branching3dRead(ConstHandle2Branching3d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Branching3dWrite(ConstHandle2ConstBranching3d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Branching3dPrint(ConstHandle2ConstBranching3d self); + +// +++ Print to standard output, as XML +extern_c int +Branching3dPrintXML(ConstHandle2ConstBranching3d self); + +// +++ Print to standard output, as JSON +extern_c int +Branching3dPrintJSON(ConstHandle2ConstBranching3d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Branching3dLabelHas(ConstHandle2ConstBranching3d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +Branching3dLabelGet(ConstHandle2ConstBranching3d self); + +// +++ Set +extern_c void +Branching3dLabelSet(ConstHandle2Branching3d self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Branching3dProductFrameHas(ConstHandle2ConstBranching3d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +Branching3dProductFrameGet(ConstHandle2ConstBranching3d self); + +// +++ Set +extern_c void +Branching3dProductFrameSet(ConstHandle2Branching3d self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Branching3d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching3d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching3d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Branching3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BreitWigner.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BreitWigner.cpp new file mode 100644 index 000000000..bf01db3d0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BreitWigner.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/BreitWigner.hpp" +#include "BreitWigner.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = BreitWignerClass; +using CPP = multigroup::BreitWigner; + +static const std::string CLASSNAME = "BreitWigner"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto approximation = [](auto &obj) { return &obj.approximation; }; + static auto calculateChannelRadius = [](auto &obj) { return &obj.calculateChannelRadius; }; + static auto resonanceParameters = [](auto &obj) { return &obj.resonanceParameters; }; + static auto PoPs = [](auto &obj) { return &obj.PoPs; }; + static auto scatteringRadius = [](auto &obj) { return &obj.scatteringRadius; }; +} + +using CPPResonanceParameters = general::ResonanceParameters; +using CPPPoPs = top::PoPs; +using CPPScatteringRadius = general::ScatteringRadius; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstBreitWigner +BreitWignerDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2BreitWigner +BreitWignerDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstBreitWigner +BreitWignerCreateConst( + const char *const label, + const char *const approximation, + const bool calculateChannelRadius, + ConstHandle2ConstResonanceParameters resonanceParameters, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstScatteringRadius scatteringRadius +) { + ConstHandle2BreitWigner handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + approximation, + calculateChannelRadius, + detail::tocpp(resonanceParameters), + detail::tocpp(PoPs), + detail::tocpp(scatteringRadius) + ); + return handle; +} + +// Create, general, non-const +Handle2BreitWigner +BreitWignerCreate( + const char *const label, + const char *const approximation, + const bool calculateChannelRadius, + ConstHandle2ConstResonanceParameters resonanceParameters, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstScatteringRadius scatteringRadius +) { + ConstHandle2BreitWigner handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + approximation, + calculateChannelRadius, + detail::tocpp(resonanceParameters), + detail::tocpp(PoPs), + detail::tocpp(scatteringRadius) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +BreitWignerAssign(ConstHandle2BreitWigner self, ConstHandle2ConstBreitWigner from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +BreitWignerDelete(ConstHandle2ConstBreitWigner self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +BreitWignerRead(ConstHandle2BreitWigner self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +BreitWignerWrite(ConstHandle2ConstBreitWigner self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +BreitWignerPrint(ConstHandle2ConstBreitWigner self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +BreitWignerPrintXML(ConstHandle2ConstBreitWigner self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +BreitWignerPrintJSON(ConstHandle2ConstBreitWigner self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +BreitWignerLabelHas(ConstHandle2ConstBreitWigner self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +BreitWignerLabelGet(ConstHandle2ConstBreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +BreitWignerLabelSet(ConstHandle2BreitWigner self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: approximation +// ----------------------------------------------------------------------------- + +// Has +int +BreitWignerApproximationHas(ConstHandle2ConstBreitWigner self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ApproximationHas", self, extract::approximation); +} + +// Get +// Returns by value +const char * +BreitWignerApproximationGet(ConstHandle2ConstBreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ApproximationGet", self, extract::approximation); +} + +// Set +void +BreitWignerApproximationSet(ConstHandle2BreitWigner self, const char *const approximation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ApproximationSet", self, extract::approximation, approximation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: calculateChannelRadius +// ----------------------------------------------------------------------------- + +// Has +int +BreitWignerCalculateChannelRadiusHas(ConstHandle2ConstBreitWigner self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CalculateChannelRadiusHas", self, extract::calculateChannelRadius); +} + +// Get +// Returns by value +bool +BreitWignerCalculateChannelRadiusGet(ConstHandle2ConstBreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CalculateChannelRadiusGet", self, extract::calculateChannelRadius); +} + +// Set +void +BreitWignerCalculateChannelRadiusSet(ConstHandle2BreitWigner self, const bool calculateChannelRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CalculateChannelRadiusSet", self, extract::calculateChannelRadius, calculateChannelRadius); +} + + +// ----------------------------------------------------------------------------- +// Child: resonanceParameters +// ----------------------------------------------------------------------------- + +// Has +int +BreitWignerResonanceParametersHas(ConstHandle2ConstBreitWigner self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResonanceParametersHas", self, extract::resonanceParameters); +} + +// Get, const +Handle2ConstResonanceParameters +BreitWignerResonanceParametersGetConst(ConstHandle2ConstBreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonanceParametersGetConst", self, extract::resonanceParameters); +} + +// Get, non-const +Handle2ResonanceParameters +BreitWignerResonanceParametersGet(ConstHandle2BreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonanceParametersGet", self, extract::resonanceParameters); +} + +// Set +void +BreitWignerResonanceParametersSet(ConstHandle2BreitWigner self, ConstHandle2ConstResonanceParameters resonanceParameters) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResonanceParametersSet", self, extract::resonanceParameters, resonanceParameters); +} + + +// ----------------------------------------------------------------------------- +// Child: PoPs +// ----------------------------------------------------------------------------- + +// Has +int +BreitWignerPoPsHas(ConstHandle2ConstBreitWigner self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PoPsHas", self, extract::PoPs); +} + +// Get, const +Handle2ConstPoPs +BreitWignerPoPsGetConst(ConstHandle2ConstBreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPsGetConst", self, extract::PoPs); +} + +// Get, non-const +Handle2PoPs +BreitWignerPoPsGet(ConstHandle2BreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPsGet", self, extract::PoPs); +} + +// Set +void +BreitWignerPoPsSet(ConstHandle2BreitWigner self, ConstHandle2ConstPoPs PoPs) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PoPsSet", self, extract::PoPs, PoPs); +} + + +// ----------------------------------------------------------------------------- +// Child: scatteringRadius +// ----------------------------------------------------------------------------- + +// Has +int +BreitWignerScatteringRadiusHas(ConstHandle2ConstBreitWigner self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ScatteringRadiusHas", self, extract::scatteringRadius); +} + +// Get, const +Handle2ConstScatteringRadius +BreitWignerScatteringRadiusGetConst(ConstHandle2ConstBreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringRadiusGetConst", self, extract::scatteringRadius); +} + +// Get, non-const +Handle2ScatteringRadius +BreitWignerScatteringRadiusGet(ConstHandle2BreitWigner self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringRadiusGet", self, extract::scatteringRadius); +} + +// Set +void +BreitWignerScatteringRadiusSet(ConstHandle2BreitWigner self, ConstHandle2ConstScatteringRadius scatteringRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ScatteringRadiusSet", self, extract::scatteringRadius, scatteringRadius); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/BreitWigner/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BreitWigner.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BreitWigner.h new file mode 100644 index 000000000..aca218ce3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BreitWigner.h @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// BreitWigner is the basic handle type in this file. Example: +// // Create a default BreitWigner object: +// BreitWigner handle = BreitWignerDefault(); +// Functions involving BreitWigner are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_BREITWIGNER +#define C_INTERFACE_GNDS_V2_0_GENERAL_BREITWIGNER + +#include "GNDStk.h" +#include "v2.0/general/ResonanceParameters.h" +#include "v2.0/top/PoPs.h" +#include "v2.0/general/ScatteringRadius.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct BreitWignerClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ BreitWigner +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct BreitWignerClass *BreitWigner; + +// --- Const-aware handles. +typedef const struct BreitWignerClass *const ConstHandle2ConstBreitWigner; +typedef struct BreitWignerClass *const ConstHandle2BreitWigner; +typedef const struct BreitWignerClass * Handle2ConstBreitWigner; +typedef struct BreitWignerClass * Handle2BreitWigner; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstBreitWigner +BreitWignerDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2BreitWigner +BreitWignerDefault(); + +// --- Create, general, const +extern_c Handle2ConstBreitWigner +BreitWignerCreateConst( + const char *const label, + const char *const approximation, + const bool calculateChannelRadius, + ConstHandle2ConstResonanceParameters resonanceParameters, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstScatteringRadius scatteringRadius +); + +// +++ Create, general, non-const +extern_c Handle2BreitWigner +BreitWignerCreate( + const char *const label, + const char *const approximation, + const bool calculateChannelRadius, + ConstHandle2ConstResonanceParameters resonanceParameters, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstScatteringRadius scatteringRadius +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +BreitWignerAssign(ConstHandle2BreitWigner self, ConstHandle2ConstBreitWigner from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +BreitWignerDelete(ConstHandle2ConstBreitWigner self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +BreitWignerRead(ConstHandle2BreitWigner self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +BreitWignerWrite(ConstHandle2ConstBreitWigner self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +BreitWignerPrint(ConstHandle2ConstBreitWigner self); + +// +++ Print to standard output, as XML +extern_c int +BreitWignerPrintXML(ConstHandle2ConstBreitWigner self); + +// +++ Print to standard output, as JSON +extern_c int +BreitWignerPrintJSON(ConstHandle2ConstBreitWigner self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BreitWignerLabelHas(ConstHandle2ConstBreitWigner self); + +// +++ Get +// +++ Returns by value +extern_c const char * +BreitWignerLabelGet(ConstHandle2ConstBreitWigner self); + +// +++ Set +extern_c void +BreitWignerLabelSet(ConstHandle2BreitWigner self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: approximation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BreitWignerApproximationHas(ConstHandle2ConstBreitWigner self); + +// +++ Get +// +++ Returns by value +extern_c const char * +BreitWignerApproximationGet(ConstHandle2ConstBreitWigner self); + +// +++ Set +extern_c void +BreitWignerApproximationSet(ConstHandle2BreitWigner self, const char *const approximation); + + +// ----------------------------------------------------------------------------- +// Metadatum: calculateChannelRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BreitWignerCalculateChannelRadiusHas(ConstHandle2ConstBreitWigner self); + +// +++ Get +// +++ Returns by value +extern_c bool +BreitWignerCalculateChannelRadiusGet(ConstHandle2ConstBreitWigner self); + +// +++ Set +extern_c void +BreitWignerCalculateChannelRadiusSet(ConstHandle2BreitWigner self, const bool calculateChannelRadius); + + +// ----------------------------------------------------------------------------- +// Child: resonanceParameters +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BreitWignerResonanceParametersHas(ConstHandle2ConstBreitWigner self); + +// --- Get, const +extern_c Handle2ConstResonanceParameters +BreitWignerResonanceParametersGetConst(ConstHandle2ConstBreitWigner self); + +// +++ Get, non-const +extern_c Handle2ResonanceParameters +BreitWignerResonanceParametersGet(ConstHandle2BreitWigner self); + +// +++ Set +extern_c void +BreitWignerResonanceParametersSet(ConstHandle2BreitWigner self, ConstHandle2ConstResonanceParameters resonanceParameters); + + +// ----------------------------------------------------------------------------- +// Child: PoPs +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BreitWignerPoPsHas(ConstHandle2ConstBreitWigner self); + +// --- Get, const +extern_c Handle2ConstPoPs +BreitWignerPoPsGetConst(ConstHandle2ConstBreitWigner self); + +// +++ Get, non-const +extern_c Handle2PoPs +BreitWignerPoPsGet(ConstHandle2BreitWigner self); + +// +++ Set +extern_c void +BreitWignerPoPsSet(ConstHandle2BreitWigner self, ConstHandle2ConstPoPs PoPs); + + +// ----------------------------------------------------------------------------- +// Child: scatteringRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +BreitWignerScatteringRadiusHas(ConstHandle2ConstBreitWigner self); + +// --- Get, const +extern_c Handle2ConstScatteringRadius +BreitWignerScatteringRadiusGetConst(ConstHandle2ConstBreitWigner self); + +// +++ Get, non-const +extern_c Handle2ScatteringRadius +BreitWignerScatteringRadiusGet(ConstHandle2BreitWigner self); + +// +++ Set +extern_c void +BreitWignerScatteringRadiusSet(ConstHandle2BreitWigner self, ConstHandle2ConstScatteringRadius scatteringRadius); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/BreitWigner/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BreitWigner/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BreitWigner/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BreitWigner/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/BreitWigner/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channel.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channel.cpp new file mode 100644 index 000000000..69869fa73 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channel.cpp @@ -0,0 +1,399 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Channel.hpp" +#include "Channel.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ChannelClass; +using CPP = multigroup::Channel; + +static const std::string CLASSNAME = "Channel"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto resonanceReaction = [](auto &obj) { return &obj.resonanceReaction; }; + static auto L = [](auto &obj) { return &obj.L; }; + static auto channelSpin = [](auto &obj) { return &obj.channelSpin; }; + static auto columnIndex = [](auto &obj) { return &obj.columnIndex; }; + static auto scatteringRadius = [](auto &obj) { return &obj.scatteringRadius; }; + static auto hardSphereRadius = [](auto &obj) { return &obj.hardSphereRadius; }; +} + +using CPPScatteringRadius = general::ScatteringRadius; +using CPPHardSphereRadius = general::HardSphereRadius; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstChannel +ChannelDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Channel +ChannelDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstChannel +ChannelCreateConst( + const char *const label, + const char *const resonanceReaction, + const int L, + const int channelSpin, + const int columnIndex, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius +) { + ConstHandle2Channel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + resonanceReaction, + L, + channelSpin, + columnIndex, + detail::tocpp(scatteringRadius), + detail::tocpp(hardSphereRadius) + ); + return handle; +} + +// Create, general, non-const +Handle2Channel +ChannelCreate( + const char *const label, + const char *const resonanceReaction, + const int L, + const int channelSpin, + const int columnIndex, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius +) { + ConstHandle2Channel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + resonanceReaction, + L, + channelSpin, + columnIndex, + detail::tocpp(scatteringRadius), + detail::tocpp(hardSphereRadius) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ChannelAssign(ConstHandle2Channel self, ConstHandle2ConstChannel from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ChannelDelete(ConstHandle2ConstChannel self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ChannelRead(ConstHandle2Channel self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ChannelWrite(ConstHandle2ConstChannel self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ChannelPrint(ConstHandle2ConstChannel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ChannelPrintXML(ConstHandle2ConstChannel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ChannelPrintJSON(ConstHandle2ConstChannel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ChannelLabelHas(ConstHandle2ConstChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ChannelLabelGet(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ChannelLabelSet(ConstHandle2Channel self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: resonanceReaction +// ----------------------------------------------------------------------------- + +// Has +int +ChannelResonanceReactionHas(ConstHandle2ConstChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResonanceReactionHas", self, extract::resonanceReaction); +} + +// Get +// Returns by value +const char * +ChannelResonanceReactionGet(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonanceReactionGet", self, extract::resonanceReaction); +} + +// Set +void +ChannelResonanceReactionSet(ConstHandle2Channel self, const char *const resonanceReaction) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResonanceReactionSet", self, extract::resonanceReaction, resonanceReaction); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: L +// ----------------------------------------------------------------------------- + +// Has +int +ChannelLHas(ConstHandle2ConstChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LHas", self, extract::L); +} + +// Get +// Returns by value +int +ChannelLGet(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LGet", self, extract::L); +} + +// Set +void +ChannelLSet(ConstHandle2Channel self, const int L) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LSet", self, extract::L, L); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: channelSpin +// ----------------------------------------------------------------------------- + +// Has +int +ChannelChannelSpinHas(ConstHandle2ConstChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChannelSpinHas", self, extract::channelSpin); +} + +// Get +// Returns by value +int +ChannelChannelSpinGet(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChannelSpinGet", self, extract::channelSpin); +} + +// Set +void +ChannelChannelSpinSet(ConstHandle2Channel self, const int channelSpin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChannelSpinSet", self, extract::channelSpin, channelSpin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: columnIndex +// ----------------------------------------------------------------------------- + +// Has +int +ChannelColumnIndexHas(ConstHandle2ConstChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ColumnIndexHas", self, extract::columnIndex); +} + +// Get +// Returns by value +int +ChannelColumnIndexGet(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnIndexGet", self, extract::columnIndex); +} + +// Set +void +ChannelColumnIndexSet(ConstHandle2Channel self, const int columnIndex) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ColumnIndexSet", self, extract::columnIndex, columnIndex); +} + + +// ----------------------------------------------------------------------------- +// Child: scatteringRadius +// ----------------------------------------------------------------------------- + +// Has +int +ChannelScatteringRadiusHas(ConstHandle2ConstChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ScatteringRadiusHas", self, extract::scatteringRadius); +} + +// Get, const +Handle2ConstScatteringRadius +ChannelScatteringRadiusGetConst(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringRadiusGetConst", self, extract::scatteringRadius); +} + +// Get, non-const +Handle2ScatteringRadius +ChannelScatteringRadiusGet(ConstHandle2Channel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringRadiusGet", self, extract::scatteringRadius); +} + +// Set +void +ChannelScatteringRadiusSet(ConstHandle2Channel self, ConstHandle2ConstScatteringRadius scatteringRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ScatteringRadiusSet", self, extract::scatteringRadius, scatteringRadius); +} + + +// ----------------------------------------------------------------------------- +// Child: hardSphereRadius +// ----------------------------------------------------------------------------- + +// Has +int +ChannelHardSphereRadiusHas(ConstHandle2ConstChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HardSphereRadiusHas", self, extract::hardSphereRadius); +} + +// Get, const +Handle2ConstHardSphereRadius +ChannelHardSphereRadiusGetConst(ConstHandle2ConstChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HardSphereRadiusGetConst", self, extract::hardSphereRadius); +} + +// Get, non-const +Handle2HardSphereRadius +ChannelHardSphereRadiusGet(ConstHandle2Channel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HardSphereRadiusGet", self, extract::hardSphereRadius); +} + +// Set +void +ChannelHardSphereRadiusSet(ConstHandle2Channel self, ConstHandle2ConstHardSphereRadius hardSphereRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HardSphereRadiusSet", self, extract::hardSphereRadius, hardSphereRadius); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Channel/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channel.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channel.h new file mode 100644 index 000000000..9f3659012 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channel.h @@ -0,0 +1,285 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Channel is the basic handle type in this file. Example: +// // Create a default Channel object: +// Channel handle = ChannelDefault(); +// Functions involving Channel are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CHANNEL +#define C_INTERFACE_GNDS_V2_0_GENERAL_CHANNEL + +#include "GNDStk.h" +#include "v2.0/general/ScatteringRadius.h" +#include "v2.0/general/HardSphereRadius.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ChannelClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Channel +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ChannelClass *Channel; + +// --- Const-aware handles. +typedef const struct ChannelClass *const ConstHandle2ConstChannel; +typedef struct ChannelClass *const ConstHandle2Channel; +typedef const struct ChannelClass * Handle2ConstChannel; +typedef struct ChannelClass * Handle2Channel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstChannel +ChannelDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Channel +ChannelDefault(); + +// --- Create, general, const +extern_c Handle2ConstChannel +ChannelCreateConst( + const char *const label, + const char *const resonanceReaction, + const int L, + const int channelSpin, + const int columnIndex, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius +); + +// +++ Create, general, non-const +extern_c Handle2Channel +ChannelCreate( + const char *const label, + const char *const resonanceReaction, + const int L, + const int channelSpin, + const int columnIndex, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstHardSphereRadius hardSphereRadius +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ChannelAssign(ConstHandle2Channel self, ConstHandle2ConstChannel from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ChannelDelete(ConstHandle2ConstChannel self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ChannelRead(ConstHandle2Channel self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ChannelWrite(ConstHandle2ConstChannel self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ChannelPrint(ConstHandle2ConstChannel self); + +// +++ Print to standard output, as XML +extern_c int +ChannelPrintXML(ConstHandle2ConstChannel self); + +// +++ Print to standard output, as JSON +extern_c int +ChannelPrintJSON(ConstHandle2ConstChannel self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelLabelHas(ConstHandle2ConstChannel self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ChannelLabelGet(ConstHandle2ConstChannel self); + +// +++ Set +extern_c void +ChannelLabelSet(ConstHandle2Channel self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: resonanceReaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelResonanceReactionHas(ConstHandle2ConstChannel self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ChannelResonanceReactionGet(ConstHandle2ConstChannel self); + +// +++ Set +extern_c void +ChannelResonanceReactionSet(ConstHandle2Channel self, const char *const resonanceReaction); + + +// ----------------------------------------------------------------------------- +// Metadatum: L +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelLHas(ConstHandle2ConstChannel self); + +// +++ Get +// +++ Returns by value +extern_c int +ChannelLGet(ConstHandle2ConstChannel self); + +// +++ Set +extern_c void +ChannelLSet(ConstHandle2Channel self, const int L); + + +// ----------------------------------------------------------------------------- +// Metadatum: channelSpin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelChannelSpinHas(ConstHandle2ConstChannel self); + +// +++ Get +// +++ Returns by value +extern_c int +ChannelChannelSpinGet(ConstHandle2ConstChannel self); + +// +++ Set +extern_c void +ChannelChannelSpinSet(ConstHandle2Channel self, const int channelSpin); + + +// ----------------------------------------------------------------------------- +// Metadatum: columnIndex +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelColumnIndexHas(ConstHandle2ConstChannel self); + +// +++ Get +// +++ Returns by value +extern_c int +ChannelColumnIndexGet(ConstHandle2ConstChannel self); + +// +++ Set +extern_c void +ChannelColumnIndexSet(ConstHandle2Channel self, const int columnIndex); + + +// ----------------------------------------------------------------------------- +// Child: scatteringRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelScatteringRadiusHas(ConstHandle2ConstChannel self); + +// --- Get, const +extern_c Handle2ConstScatteringRadius +ChannelScatteringRadiusGetConst(ConstHandle2ConstChannel self); + +// +++ Get, non-const +extern_c Handle2ScatteringRadius +ChannelScatteringRadiusGet(ConstHandle2Channel self); + +// +++ Set +extern_c void +ChannelScatteringRadiusSet(ConstHandle2Channel self, ConstHandle2ConstScatteringRadius scatteringRadius); + + +// ----------------------------------------------------------------------------- +// Child: hardSphereRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelHardSphereRadiusHas(ConstHandle2ConstChannel self); + +// --- Get, const +extern_c Handle2ConstHardSphereRadius +ChannelHardSphereRadiusGetConst(ConstHandle2ConstChannel self); + +// +++ Get, non-const +extern_c Handle2HardSphereRadius +ChannelHardSphereRadiusGet(ConstHandle2Channel self); + +// +++ Set +extern_c void +ChannelHardSphereRadiusSet(ConstHandle2Channel self, ConstHandle2ConstHardSphereRadius hardSphereRadius); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Channel/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channel/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channel/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channels.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channels.cpp new file mode 100644 index 000000000..5fba27ebe --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channels.cpp @@ -0,0 +1,457 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Channels.hpp" +#include "Channels.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ChannelsClass; +using CPP = multigroup::Channels; + +static const std::string CLASSNAME = "Channels"; + +namespace extract { + static auto channel = [](auto &obj) { return &obj.channel; }; +} + +using CPPChannel = general::Channel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstChannels +ChannelsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Channels +ChannelsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstChannels +ChannelsCreateConst( + ConstHandle2Channel *const channel, const size_t channelSize +) { + ConstHandle2Channels handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ChannelN = 0; ChannelN < channelSize; ++ChannelN) + ChannelsChannelAdd(handle, channel[ChannelN]); + return handle; +} + +// Create, general, non-const +Handle2Channels +ChannelsCreate( + ConstHandle2Channel *const channel, const size_t channelSize +) { + ConstHandle2Channels handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ChannelN = 0; ChannelN < channelSize; ++ChannelN) + ChannelsChannelAdd(handle, channel[ChannelN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ChannelsAssign(ConstHandle2Channels self, ConstHandle2ConstChannels from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ChannelsDelete(ConstHandle2ConstChannels self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ChannelsRead(ConstHandle2Channels self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ChannelsWrite(ConstHandle2ConstChannels self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ChannelsPrint(ConstHandle2ConstChannels self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ChannelsPrintXML(ConstHandle2ConstChannels self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ChannelsPrintJSON(ConstHandle2ConstChannels self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: channel +// ----------------------------------------------------------------------------- + +// Has +int +ChannelsChannelHas(ConstHandle2ConstChannels self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChannelHas", self, extract::channel); +} + +// Clear +void +ChannelsChannelClear(ConstHandle2Channels self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ChannelClear", self, extract::channel); +} + +// Size +size_t +ChannelsChannelSize(ConstHandle2ConstChannels self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ChannelSize", self, extract::channel); +} + +// Add +void +ChannelsChannelAdd(ConstHandle2Channels self, ConstHandle2ConstChannel channel) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ChannelAdd", self, extract::channel, channel); +} + +// Get, by index \in [0,size), const +Handle2ConstChannel +ChannelsChannelGetConst(ConstHandle2ConstChannels self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ChannelGetConst", self, extract::channel, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Channel +ChannelsChannelGet(ConstHandle2Channels self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ChannelGet", self, extract::channel, index_); +} + +// Set, by index \in [0,size) +void +ChannelsChannelSet( + ConstHandle2Channels self, + const size_t index_, + ConstHandle2ConstChannel channel +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ChannelSet", self, extract::channel, index_, channel); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ChannelsChannelHasByLabel( + ConstHandle2ConstChannels self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChannelHasByLabel", + self, extract::channel, meta::label, label); +} + +// Get, by label, const +Handle2ConstChannel +ChannelsChannelGetByLabelConst( + ConstHandle2ConstChannels self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByLabelConst", + self, extract::channel, meta::label, label); +} + +// Get, by label, non-const +Handle2Channel +ChannelsChannelGetByLabel( + ConstHandle2Channels self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByLabel", + self, extract::channel, meta::label, label); +} + +// Set, by label +void +ChannelsChannelSetByLabel( + ConstHandle2Channels self, + const char *const label, + ConstHandle2ConstChannel channel +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChannelSetByLabel", + self, extract::channel, meta::label, label, channel); +} + +// ------------------------ +// Re: metadatum resonanceReaction +// ------------------------ + +// Has, by resonanceReaction +int +ChannelsChannelHasByResonanceReaction( + ConstHandle2ConstChannels self, + const char *const resonanceReaction +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChannelHasByResonanceReaction", + self, extract::channel, meta::resonanceReaction, resonanceReaction); +} + +// Get, by resonanceReaction, const +Handle2ConstChannel +ChannelsChannelGetByResonanceReactionConst( + ConstHandle2ConstChannels self, + const char *const resonanceReaction +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByResonanceReactionConst", + self, extract::channel, meta::resonanceReaction, resonanceReaction); +} + +// Get, by resonanceReaction, non-const +Handle2Channel +ChannelsChannelGetByResonanceReaction( + ConstHandle2Channels self, + const char *const resonanceReaction +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByResonanceReaction", + self, extract::channel, meta::resonanceReaction, resonanceReaction); +} + +// Set, by resonanceReaction +void +ChannelsChannelSetByResonanceReaction( + ConstHandle2Channels self, + const char *const resonanceReaction, + ConstHandle2ConstChannel channel +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChannelSetByResonanceReaction", + self, extract::channel, meta::resonanceReaction, resonanceReaction, channel); +} + +// ------------------------ +// Re: metadatum L +// ------------------------ + +// Has, by L +int +ChannelsChannelHasByL( + ConstHandle2ConstChannels self, + const int L +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChannelHasByL", + self, extract::channel, meta::L, L); +} + +// Get, by L, const +Handle2ConstChannel +ChannelsChannelGetByLConst( + ConstHandle2ConstChannels self, + const int L +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByLConst", + self, extract::channel, meta::L, L); +} + +// Get, by L, non-const +Handle2Channel +ChannelsChannelGetByL( + ConstHandle2Channels self, + const int L +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByL", + self, extract::channel, meta::L, L); +} + +// Set, by L +void +ChannelsChannelSetByL( + ConstHandle2Channels self, + const int L, + ConstHandle2ConstChannel channel +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChannelSetByL", + self, extract::channel, meta::L, L, channel); +} + +// ------------------------ +// Re: metadatum channelSpin +// ------------------------ + +// Has, by channelSpin +int +ChannelsChannelHasByChannelSpin( + ConstHandle2ConstChannels self, + const int channelSpin +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChannelHasByChannelSpin", + self, extract::channel, meta::channelSpin, channelSpin); +} + +// Get, by channelSpin, const +Handle2ConstChannel +ChannelsChannelGetByChannelSpinConst( + ConstHandle2ConstChannels self, + const int channelSpin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByChannelSpinConst", + self, extract::channel, meta::channelSpin, channelSpin); +} + +// Get, by channelSpin, non-const +Handle2Channel +ChannelsChannelGetByChannelSpin( + ConstHandle2Channels self, + const int channelSpin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByChannelSpin", + self, extract::channel, meta::channelSpin, channelSpin); +} + +// Set, by channelSpin +void +ChannelsChannelSetByChannelSpin( + ConstHandle2Channels self, + const int channelSpin, + ConstHandle2ConstChannel channel +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChannelSetByChannelSpin", + self, extract::channel, meta::channelSpin, channelSpin, channel); +} + +// ------------------------ +// Re: metadatum columnIndex +// ------------------------ + +// Has, by columnIndex +int +ChannelsChannelHasByColumnIndex( + ConstHandle2ConstChannels self, + const int columnIndex +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChannelHasByColumnIndex", + self, extract::channel, meta::columnIndex, columnIndex); +} + +// Get, by columnIndex, const +Handle2ConstChannel +ChannelsChannelGetByColumnIndexConst( + ConstHandle2ConstChannels self, + const int columnIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByColumnIndexConst", + self, extract::channel, meta::columnIndex, columnIndex); +} + +// Get, by columnIndex, non-const +Handle2Channel +ChannelsChannelGetByColumnIndex( + ConstHandle2Channels self, + const int columnIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChannelGetByColumnIndex", + self, extract::channel, meta::columnIndex, columnIndex); +} + +// Set, by columnIndex +void +ChannelsChannelSetByColumnIndex( + ConstHandle2Channels self, + const int columnIndex, + ConstHandle2ConstChannel channel +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChannelSetByColumnIndex", + self, extract::channel, meta::columnIndex, columnIndex, channel); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Channels/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channels.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channels.h new file mode 100644 index 000000000..c88bebcf3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channels.h @@ -0,0 +1,342 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Channels is the basic handle type in this file. Example: +// // Create a default Channels object: +// Channels handle = ChannelsDefault(); +// Functions involving Channels are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CHANNELS +#define C_INTERFACE_GNDS_V2_0_GENERAL_CHANNELS + +#include "GNDStk.h" +#include "v2.0/general/Channel.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ChannelsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Channels +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ChannelsClass *Channels; + +// --- Const-aware handles. +typedef const struct ChannelsClass *const ConstHandle2ConstChannels; +typedef struct ChannelsClass *const ConstHandle2Channels; +typedef const struct ChannelsClass * Handle2ConstChannels; +typedef struct ChannelsClass * Handle2Channels; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstChannels +ChannelsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Channels +ChannelsDefault(); + +// --- Create, general, const +extern_c Handle2ConstChannels +ChannelsCreateConst( + ConstHandle2Channel *const channel, const size_t channelSize +); + +// +++ Create, general, non-const +extern_c Handle2Channels +ChannelsCreate( + ConstHandle2Channel *const channel, const size_t channelSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ChannelsAssign(ConstHandle2Channels self, ConstHandle2ConstChannels from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ChannelsDelete(ConstHandle2ConstChannels self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ChannelsRead(ConstHandle2Channels self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ChannelsWrite(ConstHandle2ConstChannels self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ChannelsPrint(ConstHandle2ConstChannels self); + +// +++ Print to standard output, as XML +extern_c int +ChannelsPrintXML(ConstHandle2ConstChannels self); + +// +++ Print to standard output, as JSON +extern_c int +ChannelsPrintJSON(ConstHandle2ConstChannels self); + + +// ----------------------------------------------------------------------------- +// Child: channel +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChannelsChannelHas(ConstHandle2ConstChannels self); + +// +++ Clear +extern_c void +ChannelsChannelClear(ConstHandle2Channels self); + +// +++ Size +extern_c size_t +ChannelsChannelSize(ConstHandle2ConstChannels self); + +// +++ Add +extern_c void +ChannelsChannelAdd(ConstHandle2Channels self, ConstHandle2ConstChannel channel); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstChannel +ChannelsChannelGetConst(ConstHandle2ConstChannels self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Channel +ChannelsChannelGet(ConstHandle2Channels self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ChannelsChannelSet( + ConstHandle2Channels self, + const size_t index_, + ConstHandle2ConstChannel channel +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ChannelsChannelHasByLabel( + ConstHandle2ConstChannels self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstChannel +ChannelsChannelGetByLabelConst( + ConstHandle2ConstChannels self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Channel +ChannelsChannelGetByLabel( + ConstHandle2Channels self, + const char *const label +); + +// +++ Set, by label +extern_c void +ChannelsChannelSetByLabel( + ConstHandle2Channels self, + const char *const label, + ConstHandle2ConstChannel channel +); + +// ------------------------ +// Re: metadatum resonanceReaction +// ------------------------ + +// +++ Has, by resonanceReaction +extern_c int +ChannelsChannelHasByResonanceReaction( + ConstHandle2ConstChannels self, + const char *const resonanceReaction +); + +// --- Get, by resonanceReaction, const +extern_c Handle2ConstChannel +ChannelsChannelGetByResonanceReactionConst( + ConstHandle2ConstChannels self, + const char *const resonanceReaction +); + +// +++ Get, by resonanceReaction, non-const +extern_c Handle2Channel +ChannelsChannelGetByResonanceReaction( + ConstHandle2Channels self, + const char *const resonanceReaction +); + +// +++ Set, by resonanceReaction +extern_c void +ChannelsChannelSetByResonanceReaction( + ConstHandle2Channels self, + const char *const resonanceReaction, + ConstHandle2ConstChannel channel +); + +// ------------------------ +// Re: metadatum L +// ------------------------ + +// +++ Has, by L +extern_c int +ChannelsChannelHasByL( + ConstHandle2ConstChannels self, + const int L +); + +// --- Get, by L, const +extern_c Handle2ConstChannel +ChannelsChannelGetByLConst( + ConstHandle2ConstChannels self, + const int L +); + +// +++ Get, by L, non-const +extern_c Handle2Channel +ChannelsChannelGetByL( + ConstHandle2Channels self, + const int L +); + +// +++ Set, by L +extern_c void +ChannelsChannelSetByL( + ConstHandle2Channels self, + const int L, + ConstHandle2ConstChannel channel +); + +// ------------------------ +// Re: metadatum channelSpin +// ------------------------ + +// +++ Has, by channelSpin +extern_c int +ChannelsChannelHasByChannelSpin( + ConstHandle2ConstChannels self, + const int channelSpin +); + +// --- Get, by channelSpin, const +extern_c Handle2ConstChannel +ChannelsChannelGetByChannelSpinConst( + ConstHandle2ConstChannels self, + const int channelSpin +); + +// +++ Get, by channelSpin, non-const +extern_c Handle2Channel +ChannelsChannelGetByChannelSpin( + ConstHandle2Channels self, + const int channelSpin +); + +// +++ Set, by channelSpin +extern_c void +ChannelsChannelSetByChannelSpin( + ConstHandle2Channels self, + const int channelSpin, + ConstHandle2ConstChannel channel +); + +// ------------------------ +// Re: metadatum columnIndex +// ------------------------ + +// +++ Has, by columnIndex +extern_c int +ChannelsChannelHasByColumnIndex( + ConstHandle2ConstChannels self, + const int columnIndex +); + +// --- Get, by columnIndex, const +extern_c Handle2ConstChannel +ChannelsChannelGetByColumnIndexConst( + ConstHandle2ConstChannels self, + const int columnIndex +); + +// +++ Get, by columnIndex, non-const +extern_c Handle2Channel +ChannelsChannelGetByColumnIndex( + ConstHandle2Channels self, + const int columnIndex +); + +// +++ Set, by columnIndex +extern_c void +ChannelsChannelSetByColumnIndex( + ConstHandle2Channels self, + const int columnIndex, + ConstHandle2ConstChannel channel +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Channels/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channels/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channels/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channels/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Channels/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Charge.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Charge.cpp new file mode 100644 index 000000000..5d3b4f908 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Charge.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Charge.hpp" +#include "Charge.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ChargeClass; +using CPP = multigroup::Charge; + +static const std::string CLASSNAME = "Charge"; + +namespace extract { + static auto integer = [](auto &obj) { return &obj.integer; }; +} + +using CPPInteger = general::Integer; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCharge +ChargeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Charge +ChargeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCharge +ChargeCreateConst( + ConstHandle2ConstInteger integer +) { + ConstHandle2Charge handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(integer) + ); + return handle; +} + +// Create, general, non-const +Handle2Charge +ChargeCreate( + ConstHandle2ConstInteger integer +) { + ConstHandle2Charge handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(integer) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ChargeAssign(ConstHandle2Charge self, ConstHandle2ConstCharge from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ChargeDelete(ConstHandle2ConstCharge self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ChargeRead(ConstHandle2Charge self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ChargeWrite(ConstHandle2ConstCharge self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ChargePrint(ConstHandle2ConstCharge self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ChargePrintXML(ConstHandle2ConstCharge self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ChargePrintJSON(ConstHandle2ConstCharge self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: integer +// ----------------------------------------------------------------------------- + +// Has +int +ChargeIntegerHas(ConstHandle2ConstCharge self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IntegerHas", self, extract::integer); +} + +// Get, const +Handle2ConstInteger +ChargeIntegerGetConst(ConstHandle2ConstCharge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IntegerGetConst", self, extract::integer); +} + +// Get, non-const +Handle2Integer +ChargeIntegerGet(ConstHandle2Charge self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IntegerGet", self, extract::integer); +} + +// Set +void +ChargeIntegerSet(ConstHandle2Charge self, ConstHandle2ConstInteger integer) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IntegerSet", self, extract::integer, integer); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Charge/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Charge.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Charge.h new file mode 100644 index 000000000..2a1787e24 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Charge.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Charge is the basic handle type in this file. Example: +// // Create a default Charge object: +// Charge handle = ChargeDefault(); +// Functions involving Charge are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CHARGE +#define C_INTERFACE_GNDS_V2_0_GENERAL_CHARGE + +#include "GNDStk.h" +#include "v2.0/general/Integer.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ChargeClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Charge +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ChargeClass *Charge; + +// --- Const-aware handles. +typedef const struct ChargeClass *const ConstHandle2ConstCharge; +typedef struct ChargeClass *const ConstHandle2Charge; +typedef const struct ChargeClass * Handle2ConstCharge; +typedef struct ChargeClass * Handle2Charge; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCharge +ChargeDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Charge +ChargeDefault(); + +// --- Create, general, const +extern_c Handle2ConstCharge +ChargeCreateConst( + ConstHandle2ConstInteger integer +); + +// +++ Create, general, non-const +extern_c Handle2Charge +ChargeCreate( + ConstHandle2ConstInteger integer +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ChargeAssign(ConstHandle2Charge self, ConstHandle2ConstCharge from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ChargeDelete(ConstHandle2ConstCharge self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ChargeRead(ConstHandle2Charge self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ChargeWrite(ConstHandle2ConstCharge self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ChargePrint(ConstHandle2ConstCharge self); + +// +++ Print to standard output, as XML +extern_c int +ChargePrintXML(ConstHandle2ConstCharge self); + +// +++ Print to standard output, as JSON +extern_c int +ChargePrintJSON(ConstHandle2ConstCharge self); + + +// ----------------------------------------------------------------------------- +// Child: integer +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChargeIntegerHas(ConstHandle2ConstCharge self); + +// --- Get, const +extern_c Handle2ConstInteger +ChargeIntegerGetConst(ConstHandle2ConstCharge self); + +// +++ Get, non-const +extern_c Handle2Integer +ChargeIntegerGet(ConstHandle2Charge self); + +// +++ Set +extern_c void +ChargeIntegerSet(ConstHandle2Charge self, ConstHandle2ConstInteger integer); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Charge/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Charge/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Charge/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Charge/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Charge/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElement.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElement.cpp new file mode 100644 index 000000000..235fab542 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElement.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ChemicalElement.hpp" +#include "ChemicalElement.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ChemicalElementClass; +using CPP = multigroup::ChemicalElement; + +static const std::string CLASSNAME = "ChemicalElement"; + +namespace extract { + static auto symbol = [](auto &obj) { return &obj.symbol; }; + static auto Z = [](auto &obj) { return &obj.Z; }; + static auto name = [](auto &obj) { return &obj.name; }; + static auto atomic = [](auto &obj) { return &obj.atomic; }; + static auto isotopes = [](auto &obj) { return &obj.isotopes; }; +} + +using CPPAtomic = general::Atomic; +using CPPIsotopes = general::Isotopes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstChemicalElement +ChemicalElementDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ChemicalElement +ChemicalElementDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstChemicalElement +ChemicalElementCreateConst( + const char *const symbol, + const int Z, + const char *const name, + ConstHandle2ConstAtomic atomic, + ConstHandle2ConstIsotopes isotopes +) { + ConstHandle2ChemicalElement handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + symbol, + Z, + name, + detail::tocpp(atomic), + detail::tocpp(isotopes) + ); + return handle; +} + +// Create, general, non-const +Handle2ChemicalElement +ChemicalElementCreate( + const char *const symbol, + const int Z, + const char *const name, + ConstHandle2ConstAtomic atomic, + ConstHandle2ConstIsotopes isotopes +) { + ConstHandle2ChemicalElement handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + symbol, + Z, + name, + detail::tocpp(atomic), + detail::tocpp(isotopes) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ChemicalElementAssign(ConstHandle2ChemicalElement self, ConstHandle2ConstChemicalElement from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ChemicalElementDelete(ConstHandle2ConstChemicalElement self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ChemicalElementRead(ConstHandle2ChemicalElement self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ChemicalElementWrite(ConstHandle2ConstChemicalElement self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ChemicalElementPrint(ConstHandle2ConstChemicalElement self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ChemicalElementPrintXML(ConstHandle2ConstChemicalElement self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ChemicalElementPrintJSON(ConstHandle2ConstChemicalElement self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: symbol +// ----------------------------------------------------------------------------- + +// Has +int +ChemicalElementSymbolHas(ConstHandle2ConstChemicalElement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SymbolHas", self, extract::symbol); +} + +// Get +// Returns by value +const char * +ChemicalElementSymbolGet(ConstHandle2ConstChemicalElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SymbolGet", self, extract::symbol); +} + +// Set +void +ChemicalElementSymbolSet(ConstHandle2ChemicalElement self, const char *const symbol) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SymbolSet", self, extract::symbol, symbol); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: Z +// ----------------------------------------------------------------------------- + +// Has +int +ChemicalElementZHas(ConstHandle2ConstChemicalElement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ZHas", self, extract::Z); +} + +// Get +// Returns by value +int +ChemicalElementZGet(ConstHandle2ConstChemicalElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ZGet", self, extract::Z); +} + +// Set +void +ChemicalElementZSet(ConstHandle2ChemicalElement self, const int Z) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ZSet", self, extract::Z, Z); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// Has +int +ChemicalElementNameHas(ConstHandle2ConstChemicalElement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NameHas", self, extract::name); +} + +// Get +// Returns by value +const char * +ChemicalElementNameGet(ConstHandle2ConstChemicalElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +ChemicalElementNameSet(ConstHandle2ChemicalElement self, const char *const name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Child: atomic +// ----------------------------------------------------------------------------- + +// Has +int +ChemicalElementAtomicHas(ConstHandle2ConstChemicalElement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AtomicHas", self, extract::atomic); +} + +// Get, const +Handle2ConstAtomic +ChemicalElementAtomicGetConst(ConstHandle2ConstChemicalElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AtomicGetConst", self, extract::atomic); +} + +// Get, non-const +Handle2Atomic +ChemicalElementAtomicGet(ConstHandle2ChemicalElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AtomicGet", self, extract::atomic); +} + +// Set +void +ChemicalElementAtomicSet(ConstHandle2ChemicalElement self, ConstHandle2ConstAtomic atomic) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AtomicSet", self, extract::atomic, atomic); +} + + +// ----------------------------------------------------------------------------- +// Child: isotopes +// ----------------------------------------------------------------------------- + +// Has +int +ChemicalElementIsotopesHas(ConstHandle2ConstChemicalElement self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IsotopesHas", self, extract::isotopes); +} + +// Get, const +Handle2ConstIsotopes +ChemicalElementIsotopesGetConst(ConstHandle2ConstChemicalElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IsotopesGetConst", self, extract::isotopes); +} + +// Get, non-const +Handle2Isotopes +ChemicalElementIsotopesGet(ConstHandle2ChemicalElement self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IsotopesGet", self, extract::isotopes); +} + +// Set +void +ChemicalElementIsotopesSet(ConstHandle2ChemicalElement self, ConstHandle2ConstIsotopes isotopes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IsotopesSet", self, extract::isotopes, isotopes); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ChemicalElement/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElement.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElement.h new file mode 100644 index 000000000..690ee7e06 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElement.h @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ChemicalElement is the basic handle type in this file. Example: +// // Create a default ChemicalElement object: +// ChemicalElement handle = ChemicalElementDefault(); +// Functions involving ChemicalElement are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CHEMICALELEMENT +#define C_INTERFACE_GNDS_V2_0_GENERAL_CHEMICALELEMENT + +#include "GNDStk.h" +#include "v2.0/general/Atomic.h" +#include "v2.0/general/Isotopes.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ChemicalElementClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ChemicalElement +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ChemicalElementClass *ChemicalElement; + +// --- Const-aware handles. +typedef const struct ChemicalElementClass *const ConstHandle2ConstChemicalElement; +typedef struct ChemicalElementClass *const ConstHandle2ChemicalElement; +typedef const struct ChemicalElementClass * Handle2ConstChemicalElement; +typedef struct ChemicalElementClass * Handle2ChemicalElement; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstChemicalElement +ChemicalElementDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ChemicalElement +ChemicalElementDefault(); + +// --- Create, general, const +extern_c Handle2ConstChemicalElement +ChemicalElementCreateConst( + const char *const symbol, + const int Z, + const char *const name, + ConstHandle2ConstAtomic atomic, + ConstHandle2ConstIsotopes isotopes +); + +// +++ Create, general, non-const +extern_c Handle2ChemicalElement +ChemicalElementCreate( + const char *const symbol, + const int Z, + const char *const name, + ConstHandle2ConstAtomic atomic, + ConstHandle2ConstIsotopes isotopes +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ChemicalElementAssign(ConstHandle2ChemicalElement self, ConstHandle2ConstChemicalElement from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ChemicalElementDelete(ConstHandle2ConstChemicalElement self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ChemicalElementRead(ConstHandle2ChemicalElement self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ChemicalElementWrite(ConstHandle2ConstChemicalElement self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ChemicalElementPrint(ConstHandle2ConstChemicalElement self); + +// +++ Print to standard output, as XML +extern_c int +ChemicalElementPrintXML(ConstHandle2ConstChemicalElement self); + +// +++ Print to standard output, as JSON +extern_c int +ChemicalElementPrintJSON(ConstHandle2ConstChemicalElement self); + + +// ----------------------------------------------------------------------------- +// Metadatum: symbol +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChemicalElementSymbolHas(ConstHandle2ConstChemicalElement self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ChemicalElementSymbolGet(ConstHandle2ConstChemicalElement self); + +// +++ Set +extern_c void +ChemicalElementSymbolSet(ConstHandle2ChemicalElement self, const char *const symbol); + + +// ----------------------------------------------------------------------------- +// Metadatum: Z +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChemicalElementZHas(ConstHandle2ConstChemicalElement self); + +// +++ Get +// +++ Returns by value +extern_c int +ChemicalElementZGet(ConstHandle2ConstChemicalElement self); + +// +++ Set +extern_c void +ChemicalElementZSet(ConstHandle2ChemicalElement self, const int Z); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChemicalElementNameHas(ConstHandle2ConstChemicalElement self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ChemicalElementNameGet(ConstHandle2ConstChemicalElement self); + +// +++ Set +extern_c void +ChemicalElementNameSet(ConstHandle2ChemicalElement self, const char *const name); + + +// ----------------------------------------------------------------------------- +// Child: atomic +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChemicalElementAtomicHas(ConstHandle2ConstChemicalElement self); + +// --- Get, const +extern_c Handle2ConstAtomic +ChemicalElementAtomicGetConst(ConstHandle2ConstChemicalElement self); + +// +++ Get, non-const +extern_c Handle2Atomic +ChemicalElementAtomicGet(ConstHandle2ChemicalElement self); + +// +++ Set +extern_c void +ChemicalElementAtomicSet(ConstHandle2ChemicalElement self, ConstHandle2ConstAtomic atomic); + + +// ----------------------------------------------------------------------------- +// Child: isotopes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChemicalElementIsotopesHas(ConstHandle2ConstChemicalElement self); + +// --- Get, const +extern_c Handle2ConstIsotopes +ChemicalElementIsotopesGetConst(ConstHandle2ConstChemicalElement self); + +// +++ Get, non-const +extern_c Handle2Isotopes +ChemicalElementIsotopesGet(ConstHandle2ChemicalElement self); + +// +++ Set +extern_c void +ChemicalElementIsotopesSet(ConstHandle2ChemicalElement self, ConstHandle2ConstIsotopes isotopes); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ChemicalElement/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElement/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElement/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElement/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElement/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElements.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElements.cpp new file mode 100644 index 000000000..a3ecc147f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElements.cpp @@ -0,0 +1,359 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ChemicalElements.hpp" +#include "ChemicalElements.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ChemicalElementsClass; +using CPP = multigroup::ChemicalElements; + +static const std::string CLASSNAME = "ChemicalElements"; + +namespace extract { + static auto chemicalElement = [](auto &obj) { return &obj.chemicalElement; }; +} + +using CPPChemicalElement = general::ChemicalElement; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstChemicalElements +ChemicalElementsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ChemicalElements +ChemicalElementsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstChemicalElements +ChemicalElementsCreateConst( + ConstHandle2ChemicalElement *const chemicalElement, const size_t chemicalElementSize +) { + ConstHandle2ChemicalElements handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ChemicalElementN = 0; ChemicalElementN < chemicalElementSize; ++ChemicalElementN) + ChemicalElementsChemicalElementAdd(handle, chemicalElement[ChemicalElementN]); + return handle; +} + +// Create, general, non-const +Handle2ChemicalElements +ChemicalElementsCreate( + ConstHandle2ChemicalElement *const chemicalElement, const size_t chemicalElementSize +) { + ConstHandle2ChemicalElements handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ChemicalElementN = 0; ChemicalElementN < chemicalElementSize; ++ChemicalElementN) + ChemicalElementsChemicalElementAdd(handle, chemicalElement[ChemicalElementN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ChemicalElementsAssign(ConstHandle2ChemicalElements self, ConstHandle2ConstChemicalElements from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ChemicalElementsDelete(ConstHandle2ConstChemicalElements self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ChemicalElementsRead(ConstHandle2ChemicalElements self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ChemicalElementsWrite(ConstHandle2ConstChemicalElements self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ChemicalElementsPrint(ConstHandle2ConstChemicalElements self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ChemicalElementsPrintXML(ConstHandle2ConstChemicalElements self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ChemicalElementsPrintJSON(ConstHandle2ConstChemicalElements self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: chemicalElement +// ----------------------------------------------------------------------------- + +// Has +int +ChemicalElementsChemicalElementHas(ConstHandle2ConstChemicalElements self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChemicalElementHas", self, extract::chemicalElement); +} + +// Clear +void +ChemicalElementsChemicalElementClear(ConstHandle2ChemicalElements self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ChemicalElementClear", self, extract::chemicalElement); +} + +// Size +size_t +ChemicalElementsChemicalElementSize(ConstHandle2ConstChemicalElements self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ChemicalElementSize", self, extract::chemicalElement); +} + +// Add +void +ChemicalElementsChemicalElementAdd(ConstHandle2ChemicalElements self, ConstHandle2ConstChemicalElement chemicalElement) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ChemicalElementAdd", self, extract::chemicalElement, chemicalElement); +} + +// Get, by index \in [0,size), const +Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetConst(ConstHandle2ConstChemicalElements self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ChemicalElementGetConst", self, extract::chemicalElement, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ChemicalElement +ChemicalElementsChemicalElementGet(ConstHandle2ChemicalElements self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ChemicalElementGet", self, extract::chemicalElement, index_); +} + +// Set, by index \in [0,size) +void +ChemicalElementsChemicalElementSet( + ConstHandle2ChemicalElements self, + const size_t index_, + ConstHandle2ConstChemicalElement chemicalElement +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ChemicalElementSet", self, extract::chemicalElement, index_, chemicalElement); +} + +// ------------------------ +// Re: metadatum symbol +// ------------------------ + +// Has, by symbol +int +ChemicalElementsChemicalElementHasBySymbol( + ConstHandle2ConstChemicalElements self, + const char *const symbol +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementHasBySymbol", + self, extract::chemicalElement, meta::symbol, symbol); +} + +// Get, by symbol, const +Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetBySymbolConst( + ConstHandle2ConstChemicalElements self, + const char *const symbol +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetBySymbolConst", + self, extract::chemicalElement, meta::symbol, symbol); +} + +// Get, by symbol, non-const +Handle2ChemicalElement +ChemicalElementsChemicalElementGetBySymbol( + ConstHandle2ChemicalElements self, + const char *const symbol +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetBySymbol", + self, extract::chemicalElement, meta::symbol, symbol); +} + +// Set, by symbol +void +ChemicalElementsChemicalElementSetBySymbol( + ConstHandle2ChemicalElements self, + const char *const symbol, + ConstHandle2ConstChemicalElement chemicalElement +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementSetBySymbol", + self, extract::chemicalElement, meta::symbol, symbol, chemicalElement); +} + +// ------------------------ +// Re: metadatum Z +// ------------------------ + +// Has, by Z +int +ChemicalElementsChemicalElementHasByZ( + ConstHandle2ConstChemicalElements self, + const int Z +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementHasByZ", + self, extract::chemicalElement, meta::Z, Z); +} + +// Get, by Z, const +Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetByZConst( + ConstHandle2ConstChemicalElements self, + const int Z +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetByZConst", + self, extract::chemicalElement, meta::Z, Z); +} + +// Get, by Z, non-const +Handle2ChemicalElement +ChemicalElementsChemicalElementGetByZ( + ConstHandle2ChemicalElements self, + const int Z +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetByZ", + self, extract::chemicalElement, meta::Z, Z); +} + +// Set, by Z +void +ChemicalElementsChemicalElementSetByZ( + ConstHandle2ChemicalElements self, + const int Z, + ConstHandle2ConstChemicalElement chemicalElement +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementSetByZ", + self, extract::chemicalElement, meta::Z, Z, chemicalElement); +} + +// ------------------------ +// Re: metadatum name +// ------------------------ + +// Has, by name +int +ChemicalElementsChemicalElementHasByName( + ConstHandle2ConstChemicalElements self, + const char *const name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementHasByName", + self, extract::chemicalElement, meta::name, name); +} + +// Get, by name, const +Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetByNameConst( + ConstHandle2ConstChemicalElements self, + const char *const name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetByNameConst", + self, extract::chemicalElement, meta::name, name); +} + +// Get, by name, non-const +Handle2ChemicalElement +ChemicalElementsChemicalElementGetByName( + ConstHandle2ChemicalElements self, + const char *const name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementGetByName", + self, extract::chemicalElement, meta::name, name); +} + +// Set, by name +void +ChemicalElementsChemicalElementSetByName( + ConstHandle2ChemicalElements self, + const char *const name, + ConstHandle2ConstChemicalElement chemicalElement +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ChemicalElementSetByName", + self, extract::chemicalElement, meta::name, name, chemicalElement); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ChemicalElements/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElements.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElements.h new file mode 100644 index 000000000..a66851b31 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElements.h @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ChemicalElements is the basic handle type in this file. Example: +// // Create a default ChemicalElements object: +// ChemicalElements handle = ChemicalElementsDefault(); +// Functions involving ChemicalElements are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CHEMICALELEMENTS +#define C_INTERFACE_GNDS_V2_0_GENERAL_CHEMICALELEMENTS + +#include "GNDStk.h" +#include "v2.0/general/ChemicalElement.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ChemicalElementsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ChemicalElements +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ChemicalElementsClass *ChemicalElements; + +// --- Const-aware handles. +typedef const struct ChemicalElementsClass *const ConstHandle2ConstChemicalElements; +typedef struct ChemicalElementsClass *const ConstHandle2ChemicalElements; +typedef const struct ChemicalElementsClass * Handle2ConstChemicalElements; +typedef struct ChemicalElementsClass * Handle2ChemicalElements; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstChemicalElements +ChemicalElementsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ChemicalElements +ChemicalElementsDefault(); + +// --- Create, general, const +extern_c Handle2ConstChemicalElements +ChemicalElementsCreateConst( + ConstHandle2ChemicalElement *const chemicalElement, const size_t chemicalElementSize +); + +// +++ Create, general, non-const +extern_c Handle2ChemicalElements +ChemicalElementsCreate( + ConstHandle2ChemicalElement *const chemicalElement, const size_t chemicalElementSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ChemicalElementsAssign(ConstHandle2ChemicalElements self, ConstHandle2ConstChemicalElements from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ChemicalElementsDelete(ConstHandle2ConstChemicalElements self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ChemicalElementsRead(ConstHandle2ChemicalElements self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ChemicalElementsWrite(ConstHandle2ConstChemicalElements self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ChemicalElementsPrint(ConstHandle2ConstChemicalElements self); + +// +++ Print to standard output, as XML +extern_c int +ChemicalElementsPrintXML(ConstHandle2ConstChemicalElements self); + +// +++ Print to standard output, as JSON +extern_c int +ChemicalElementsPrintJSON(ConstHandle2ConstChemicalElements self); + + +// ----------------------------------------------------------------------------- +// Child: chemicalElement +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ChemicalElementsChemicalElementHas(ConstHandle2ConstChemicalElements self); + +// +++ Clear +extern_c void +ChemicalElementsChemicalElementClear(ConstHandle2ChemicalElements self); + +// +++ Size +extern_c size_t +ChemicalElementsChemicalElementSize(ConstHandle2ConstChemicalElements self); + +// +++ Add +extern_c void +ChemicalElementsChemicalElementAdd(ConstHandle2ChemicalElements self, ConstHandle2ConstChemicalElement chemicalElement); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetConst(ConstHandle2ConstChemicalElements self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ChemicalElement +ChemicalElementsChemicalElementGet(ConstHandle2ChemicalElements self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ChemicalElementsChemicalElementSet( + ConstHandle2ChemicalElements self, + const size_t index_, + ConstHandle2ConstChemicalElement chemicalElement +); + +// ------------------------ +// Re: metadatum symbol +// ------------------------ + +// +++ Has, by symbol +extern_c int +ChemicalElementsChemicalElementHasBySymbol( + ConstHandle2ConstChemicalElements self, + const char *const symbol +); + +// --- Get, by symbol, const +extern_c Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetBySymbolConst( + ConstHandle2ConstChemicalElements self, + const char *const symbol +); + +// +++ Get, by symbol, non-const +extern_c Handle2ChemicalElement +ChemicalElementsChemicalElementGetBySymbol( + ConstHandle2ChemicalElements self, + const char *const symbol +); + +// +++ Set, by symbol +extern_c void +ChemicalElementsChemicalElementSetBySymbol( + ConstHandle2ChemicalElements self, + const char *const symbol, + ConstHandle2ConstChemicalElement chemicalElement +); + +// ------------------------ +// Re: metadatum Z +// ------------------------ + +// +++ Has, by Z +extern_c int +ChemicalElementsChemicalElementHasByZ( + ConstHandle2ConstChemicalElements self, + const int Z +); + +// --- Get, by Z, const +extern_c Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetByZConst( + ConstHandle2ConstChemicalElements self, + const int Z +); + +// +++ Get, by Z, non-const +extern_c Handle2ChemicalElement +ChemicalElementsChemicalElementGetByZ( + ConstHandle2ChemicalElements self, + const int Z +); + +// +++ Set, by Z +extern_c void +ChemicalElementsChemicalElementSetByZ( + ConstHandle2ChemicalElements self, + const int Z, + ConstHandle2ConstChemicalElement chemicalElement +); + +// ------------------------ +// Re: metadatum name +// ------------------------ + +// +++ Has, by name +extern_c int +ChemicalElementsChemicalElementHasByName( + ConstHandle2ConstChemicalElements self, + const char *const name +); + +// --- Get, by name, const +extern_c Handle2ConstChemicalElement +ChemicalElementsChemicalElementGetByNameConst( + ConstHandle2ConstChemicalElements self, + const char *const name +); + +// +++ Get, by name, non-const +extern_c Handle2ChemicalElement +ChemicalElementsChemicalElementGetByName( + ConstHandle2ChemicalElements self, + const char *const name +); + +// +++ Set, by name +extern_c void +ChemicalElementsChemicalElementSetByName( + ConstHandle2ChemicalElements self, + const char *const name, + ConstHandle2ConstChemicalElement chemicalElement +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ChemicalElements/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElements/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElements/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElements/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ChemicalElements/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoherentPhotonScattering.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoherentPhotonScattering.cpp new file mode 100644 index 000000000..fb7732b30 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoherentPhotonScattering.cpp @@ -0,0 +1,407 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/CoherentPhotonScattering.hpp" +#include "CoherentPhotonScattering.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CoherentPhotonScatteringClass; +using CPP = multigroup::CoherentPhotonScattering; + +static const std::string CLASSNAME = "CoherentPhotonScattering"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto href = [](auto &obj) { return &obj.href; }; + static auto pid = [](auto &obj) { return &obj.pid; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto formFactor = [](auto &obj) { return &obj.formFactor; }; + static auto realAnomalousFactor = [](auto &obj) { return &obj.realAnomalousFactor; }; + static auto imaginaryAnomalousFactor = [](auto &obj) { return &obj.imaginaryAnomalousFactor; }; +} + +using CPPFormFactor = general::FormFactor; +using CPPRealAnomalousFactor = general::RealAnomalousFactor; +using CPPImaginaryAnomalousFactor = general::ImaginaryAnomalousFactor; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCoherentPhotonScattering +CoherentPhotonScatteringDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2CoherentPhotonScattering +CoherentPhotonScatteringDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCoherentPhotonScattering +CoherentPhotonScatteringCreateConst( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstFormFactor formFactor, + ConstHandle2ConstRealAnomalousFactor realAnomalousFactor, + ConstHandle2ConstImaginaryAnomalousFactor imaginaryAnomalousFactor +) { + ConstHandle2CoherentPhotonScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href, + pid, + productFrame, + detail::tocpp(formFactor), + detail::tocpp(realAnomalousFactor), + detail::tocpp(imaginaryAnomalousFactor) + ); + return handle; +} + +// Create, general, non-const +Handle2CoherentPhotonScattering +CoherentPhotonScatteringCreate( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstFormFactor formFactor, + ConstHandle2ConstRealAnomalousFactor realAnomalousFactor, + ConstHandle2ConstImaginaryAnomalousFactor imaginaryAnomalousFactor +) { + ConstHandle2CoherentPhotonScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + href, + pid, + productFrame, + detail::tocpp(formFactor), + detail::tocpp(realAnomalousFactor), + detail::tocpp(imaginaryAnomalousFactor) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CoherentPhotonScatteringAssign(ConstHandle2CoherentPhotonScattering self, ConstHandle2ConstCoherentPhotonScattering from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CoherentPhotonScatteringDelete(ConstHandle2ConstCoherentPhotonScattering self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CoherentPhotonScatteringRead(ConstHandle2CoherentPhotonScattering self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CoherentPhotonScatteringWrite(ConstHandle2ConstCoherentPhotonScattering self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CoherentPhotonScatteringPrint(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CoherentPhotonScatteringPrintXML(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CoherentPhotonScatteringPrintJSON(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CoherentPhotonScatteringLabelHas(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +CoherentPhotonScatteringLabelGet(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CoherentPhotonScatteringLabelSet(ConstHandle2CoherentPhotonScattering self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +CoherentPhotonScatteringHrefHas(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +CoherentPhotonScatteringHrefGet(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +CoherentPhotonScatteringHrefSet(ConstHandle2CoherentPhotonScattering self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +CoherentPhotonScatteringPidHas(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +CoherentPhotonScatteringPidGet(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +CoherentPhotonScatteringPidSet(ConstHandle2CoherentPhotonScattering self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +CoherentPhotonScatteringProductFrameHas(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +CoherentPhotonScatteringProductFrameGet(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +CoherentPhotonScatteringProductFrameSet(ConstHandle2CoherentPhotonScattering self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: formFactor +// ----------------------------------------------------------------------------- + +// Has +int +CoherentPhotonScatteringFormFactorHas(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FormFactorHas", self, extract::formFactor); +} + +// Get, const +Handle2ConstFormFactor +CoherentPhotonScatteringFormFactorGetConst(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FormFactorGetConst", self, extract::formFactor); +} + +// Get, non-const +Handle2FormFactor +CoherentPhotonScatteringFormFactorGet(ConstHandle2CoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FormFactorGet", self, extract::formFactor); +} + +// Set +void +CoherentPhotonScatteringFormFactorSet(ConstHandle2CoherentPhotonScattering self, ConstHandle2ConstFormFactor formFactor) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FormFactorSet", self, extract::formFactor, formFactor); +} + + +// ----------------------------------------------------------------------------- +// Child: realAnomalousFactor +// ----------------------------------------------------------------------------- + +// Has +int +CoherentPhotonScatteringRealAnomalousFactorHas(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RealAnomalousFactorHas", self, extract::realAnomalousFactor); +} + +// Get, const +Handle2ConstRealAnomalousFactor +CoherentPhotonScatteringRealAnomalousFactorGetConst(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RealAnomalousFactorGetConst", self, extract::realAnomalousFactor); +} + +// Get, non-const +Handle2RealAnomalousFactor +CoherentPhotonScatteringRealAnomalousFactorGet(ConstHandle2CoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RealAnomalousFactorGet", self, extract::realAnomalousFactor); +} + +// Set +void +CoherentPhotonScatteringRealAnomalousFactorSet(ConstHandle2CoherentPhotonScattering self, ConstHandle2ConstRealAnomalousFactor realAnomalousFactor) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RealAnomalousFactorSet", self, extract::realAnomalousFactor, realAnomalousFactor); +} + + +// ----------------------------------------------------------------------------- +// Child: imaginaryAnomalousFactor +// ----------------------------------------------------------------------------- + +// Has +int +CoherentPhotonScatteringImaginaryAnomalousFactorHas(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ImaginaryAnomalousFactorHas", self, extract::imaginaryAnomalousFactor); +} + +// Get, const +Handle2ConstImaginaryAnomalousFactor +CoherentPhotonScatteringImaginaryAnomalousFactorGetConst(ConstHandle2ConstCoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ImaginaryAnomalousFactorGetConst", self, extract::imaginaryAnomalousFactor); +} + +// Get, non-const +Handle2ImaginaryAnomalousFactor +CoherentPhotonScatteringImaginaryAnomalousFactorGet(ConstHandle2CoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ImaginaryAnomalousFactorGet", self, extract::imaginaryAnomalousFactor); +} + +// Set +void +CoherentPhotonScatteringImaginaryAnomalousFactorSet(ConstHandle2CoherentPhotonScattering self, ConstHandle2ConstImaginaryAnomalousFactor imaginaryAnomalousFactor) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ImaginaryAnomalousFactorSet", self, extract::imaginaryAnomalousFactor, imaginaryAnomalousFactor); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CoherentPhotonScattering/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoherentPhotonScattering.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoherentPhotonScattering.h new file mode 100644 index 000000000..b3d6aa919 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoherentPhotonScattering.h @@ -0,0 +1,289 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CoherentPhotonScattering is the basic handle type in this file. Example: +// // Create a default CoherentPhotonScattering object: +// CoherentPhotonScattering handle = CoherentPhotonScatteringDefault(); +// Functions involving CoherentPhotonScattering are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_COHERENTPHOTONSCATTERING +#define C_INTERFACE_GNDS_V2_0_GENERAL_COHERENTPHOTONSCATTERING + +#include "GNDStk.h" +#include "v2.0/general/FormFactor.h" +#include "v2.0/general/RealAnomalousFactor.h" +#include "v2.0/general/ImaginaryAnomalousFactor.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CoherentPhotonScatteringClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CoherentPhotonScattering +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CoherentPhotonScatteringClass *CoherentPhotonScattering; + +// --- Const-aware handles. +typedef const struct CoherentPhotonScatteringClass *const ConstHandle2ConstCoherentPhotonScattering; +typedef struct CoherentPhotonScatteringClass *const ConstHandle2CoherentPhotonScattering; +typedef const struct CoherentPhotonScatteringClass * Handle2ConstCoherentPhotonScattering; +typedef struct CoherentPhotonScatteringClass * Handle2CoherentPhotonScattering; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCoherentPhotonScattering +CoherentPhotonScatteringDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2CoherentPhotonScattering +CoherentPhotonScatteringDefault(); + +// --- Create, general, const +extern_c Handle2ConstCoherentPhotonScattering +CoherentPhotonScatteringCreateConst( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstFormFactor formFactor, + ConstHandle2ConstRealAnomalousFactor realAnomalousFactor, + ConstHandle2ConstImaginaryAnomalousFactor imaginaryAnomalousFactor +); + +// +++ Create, general, non-const +extern_c Handle2CoherentPhotonScattering +CoherentPhotonScatteringCreate( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstFormFactor formFactor, + ConstHandle2ConstRealAnomalousFactor realAnomalousFactor, + ConstHandle2ConstImaginaryAnomalousFactor imaginaryAnomalousFactor +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CoherentPhotonScatteringAssign(ConstHandle2CoherentPhotonScattering self, ConstHandle2ConstCoherentPhotonScattering from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CoherentPhotonScatteringDelete(ConstHandle2ConstCoherentPhotonScattering self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CoherentPhotonScatteringRead(ConstHandle2CoherentPhotonScattering self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CoherentPhotonScatteringWrite(ConstHandle2ConstCoherentPhotonScattering self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CoherentPhotonScatteringPrint(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Print to standard output, as XML +extern_c int +CoherentPhotonScatteringPrintXML(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Print to standard output, as JSON +extern_c int +CoherentPhotonScatteringPrintJSON(ConstHandle2ConstCoherentPhotonScattering self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentPhotonScatteringLabelHas(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CoherentPhotonScatteringLabelGet(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Set +extern_c void +CoherentPhotonScatteringLabelSet(ConstHandle2CoherentPhotonScattering self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentPhotonScatteringHrefHas(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CoherentPhotonScatteringHrefGet(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Set +extern_c void +CoherentPhotonScatteringHrefSet(ConstHandle2CoherentPhotonScattering self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentPhotonScatteringPidHas(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CoherentPhotonScatteringPidGet(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Set +extern_c void +CoherentPhotonScatteringPidSet(ConstHandle2CoherentPhotonScattering self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentPhotonScatteringProductFrameHas(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CoherentPhotonScatteringProductFrameGet(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Set +extern_c void +CoherentPhotonScatteringProductFrameSet(ConstHandle2CoherentPhotonScattering self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Child: formFactor +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentPhotonScatteringFormFactorHas(ConstHandle2ConstCoherentPhotonScattering self); + +// --- Get, const +extern_c Handle2ConstFormFactor +CoherentPhotonScatteringFormFactorGetConst(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Get, non-const +extern_c Handle2FormFactor +CoherentPhotonScatteringFormFactorGet(ConstHandle2CoherentPhotonScattering self); + +// +++ Set +extern_c void +CoherentPhotonScatteringFormFactorSet(ConstHandle2CoherentPhotonScattering self, ConstHandle2ConstFormFactor formFactor); + + +// ----------------------------------------------------------------------------- +// Child: realAnomalousFactor +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentPhotonScatteringRealAnomalousFactorHas(ConstHandle2ConstCoherentPhotonScattering self); + +// --- Get, const +extern_c Handle2ConstRealAnomalousFactor +CoherentPhotonScatteringRealAnomalousFactorGetConst(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Get, non-const +extern_c Handle2RealAnomalousFactor +CoherentPhotonScatteringRealAnomalousFactorGet(ConstHandle2CoherentPhotonScattering self); + +// +++ Set +extern_c void +CoherentPhotonScatteringRealAnomalousFactorSet(ConstHandle2CoherentPhotonScattering self, ConstHandle2ConstRealAnomalousFactor realAnomalousFactor); + + +// ----------------------------------------------------------------------------- +// Child: imaginaryAnomalousFactor +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoherentPhotonScatteringImaginaryAnomalousFactorHas(ConstHandle2ConstCoherentPhotonScattering self); + +// --- Get, const +extern_c Handle2ConstImaginaryAnomalousFactor +CoherentPhotonScatteringImaginaryAnomalousFactorGetConst(ConstHandle2ConstCoherentPhotonScattering self); + +// +++ Get, non-const +extern_c Handle2ImaginaryAnomalousFactor +CoherentPhotonScatteringImaginaryAnomalousFactorGet(ConstHandle2CoherentPhotonScattering self); + +// +++ Set +extern_c void +CoherentPhotonScatteringImaginaryAnomalousFactorSet(ConstHandle2CoherentPhotonScattering self, ConstHandle2ConstImaginaryAnomalousFactor imaginaryAnomalousFactor); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CoherentPhotonScattering/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoherentPhotonScattering/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoherentPhotonScattering/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoherentPhotonScattering/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoherentPhotonScattering/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Column.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Column.cpp new file mode 100644 index 000000000..5aa5afcc5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Column.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Column.hpp" +#include "Column.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ColumnClass; +using CPP = multigroup::Column; + +static const std::string CLASSNAME = "Column"; + +namespace extract { + static auto index = [](auto &obj) { return &obj.index; }; + static auto name = [](auto &obj) { return &obj.name; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstColumn +ColumnDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Column +ColumnDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstColumn +ColumnCreateConst( + const int index, + const char *const name, + const char *const unit +) { + ConstHandle2Column handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + name, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2Column +ColumnCreate( + const int index, + const char *const name, + const char *const unit +) { + ConstHandle2Column handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + index, + name, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ColumnAssign(ConstHandle2Column self, ConstHandle2ConstColumn from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ColumnDelete(ConstHandle2ConstColumn self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ColumnRead(ConstHandle2Column self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ColumnWrite(ConstHandle2ConstColumn self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ColumnPrint(ConstHandle2ConstColumn self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ColumnPrintXML(ConstHandle2ConstColumn self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ColumnPrintJSON(ConstHandle2ConstColumn self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// Has +int +ColumnIndexHas(ConstHandle2ConstColumn self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IndexHas", self, extract::index); +} + +// Get +// Returns by value +int +ColumnIndexGet(ConstHandle2ConstColumn self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +ColumnIndexSet(ConstHandle2Column self, const int index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// Has +int +ColumnNameHas(ConstHandle2ConstColumn self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NameHas", self, extract::name); +} + +// Get +// Returns by value +const char * +ColumnNameGet(ConstHandle2ConstColumn self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +ColumnNameSet(ConstHandle2Column self, const char *const name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +ColumnUnitHas(ConstHandle2ConstColumn self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +ColumnUnitGet(ConstHandle2ConstColumn self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +ColumnUnitSet(ConstHandle2Column self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Column/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Column.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Column.h new file mode 100644 index 000000000..ed6bdb327 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Column.h @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Column is the basic handle type in this file. Example: +// // Create a default Column object: +// Column handle = ColumnDefault(); +// Functions involving Column are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_COLUMN +#define C_INTERFACE_GNDS_V2_0_GENERAL_COLUMN + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ColumnClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Column +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ColumnClass *Column; + +// --- Const-aware handles. +typedef const struct ColumnClass *const ConstHandle2ConstColumn; +typedef struct ColumnClass *const ConstHandle2Column; +typedef const struct ColumnClass * Handle2ConstColumn; +typedef struct ColumnClass * Handle2Column; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstColumn +ColumnDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Column +ColumnDefault(); + +// --- Create, general, const +extern_c Handle2ConstColumn +ColumnCreateConst( + const int index, + const char *const name, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2Column +ColumnCreate( + const int index, + const char *const name, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ColumnAssign(ConstHandle2Column self, ConstHandle2ConstColumn from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ColumnDelete(ConstHandle2ConstColumn self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ColumnRead(ConstHandle2Column self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ColumnWrite(ConstHandle2ConstColumn self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ColumnPrint(ConstHandle2ConstColumn self); + +// +++ Print to standard output, as XML +extern_c int +ColumnPrintXML(ConstHandle2ConstColumn self); + +// +++ Print to standard output, as JSON +extern_c int +ColumnPrintJSON(ConstHandle2ConstColumn self); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnIndexHas(ConstHandle2ConstColumn self); + +// +++ Get +// +++ Returns by value +extern_c int +ColumnIndexGet(ConstHandle2ConstColumn self); + +// +++ Set +extern_c void +ColumnIndexSet(ConstHandle2Column self, const int index); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnNameHas(ConstHandle2ConstColumn self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ColumnNameGet(ConstHandle2ConstColumn self); + +// +++ Set +extern_c void +ColumnNameSet(ConstHandle2Column self, const char *const name); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnUnitHas(ConstHandle2ConstColumn self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ColumnUnitGet(ConstHandle2ConstColumn self); + +// +++ Set +extern_c void +ColumnUnitSet(ConstHandle2Column self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Column/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Column/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Column/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Column/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Column/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnData.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnData.cpp new file mode 100644 index 000000000..480a7edff --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnData.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ColumnData.hpp" +#include "ColumnData.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ColumnDataClass; +using CPP = multigroup::ColumnData; + +static const std::string CLASSNAME = "ColumnData"; + +namespace extract { + static auto ENDF_MFMT = [](auto &obj) { return &obj.ENDF_MFMT; }; + static auto href = [](auto &obj) { return &obj.href; }; + static auto slices = [](auto &obj) { return &obj.slices; }; +} + +using CPPSlices = general::Slices; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstColumnData +ColumnDataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ColumnData +ColumnDataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstColumnData +ColumnDataCreateConst( + const char *const ENDF_MFMT, + const char *const href, + ConstHandle2ConstSlices slices +) { + ConstHandle2ColumnData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MFMT, + href, + detail::tocpp(slices) + ); + return handle; +} + +// Create, general, non-const +Handle2ColumnData +ColumnDataCreate( + const char *const ENDF_MFMT, + const char *const href, + ConstHandle2ConstSlices slices +) { + ConstHandle2ColumnData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MFMT, + href, + detail::tocpp(slices) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ColumnDataAssign(ConstHandle2ColumnData self, ConstHandle2ConstColumnData from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ColumnDataDelete(ConstHandle2ConstColumnData self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ColumnDataRead(ConstHandle2ColumnData self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ColumnDataWrite(ConstHandle2ConstColumnData self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ColumnDataPrint(ConstHandle2ConstColumnData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ColumnDataPrintXML(ConstHandle2ConstColumnData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ColumnDataPrintJSON(ConstHandle2ConstColumnData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MFMT +// ----------------------------------------------------------------------------- + +// Has +int +ColumnDataENDFMFMTHas(ConstHandle2ConstColumnData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMFMTHas", self, extract::ENDF_MFMT); +} + +// Get +// Returns by value +const char * +ColumnDataENDFMFMTGet(ConstHandle2ConstColumnData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMFMTGet", self, extract::ENDF_MFMT); +} + +// Set +void +ColumnDataENDFMFMTSet(ConstHandle2ColumnData self, const char *const ENDF_MFMT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMFMTSet", self, extract::ENDF_MFMT, ENDF_MFMT); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +ColumnDataHrefHas(ConstHandle2ConstColumnData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +ColumnDataHrefGet(ConstHandle2ConstColumnData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ColumnDataHrefSet(ConstHandle2ColumnData self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Child: slices +// ----------------------------------------------------------------------------- + +// Has +int +ColumnDataSlicesHas(ConstHandle2ConstColumnData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SlicesHas", self, extract::slices); +} + +// Get, const +Handle2ConstSlices +ColumnDataSlicesGetConst(ConstHandle2ConstColumnData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SlicesGetConst", self, extract::slices); +} + +// Get, non-const +Handle2Slices +ColumnDataSlicesGet(ConstHandle2ColumnData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SlicesGet", self, extract::slices); +} + +// Set +void +ColumnDataSlicesSet(ConstHandle2ColumnData self, ConstHandle2ConstSlices slices) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SlicesSet", self, extract::slices, slices); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ColumnData/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnData.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnData.h new file mode 100644 index 000000000..101897ec9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnData.h @@ -0,0 +1,201 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ColumnData is the basic handle type in this file. Example: +// // Create a default ColumnData object: +// ColumnData handle = ColumnDataDefault(); +// Functions involving ColumnData are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_COLUMNDATA +#define C_INTERFACE_GNDS_V2_0_GENERAL_COLUMNDATA + +#include "GNDStk.h" +#include "v2.0/general/Slices.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ColumnDataClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ColumnData +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ColumnDataClass *ColumnData; + +// --- Const-aware handles. +typedef const struct ColumnDataClass *const ConstHandle2ConstColumnData; +typedef struct ColumnDataClass *const ConstHandle2ColumnData; +typedef const struct ColumnDataClass * Handle2ConstColumnData; +typedef struct ColumnDataClass * Handle2ColumnData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstColumnData +ColumnDataDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ColumnData +ColumnDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstColumnData +ColumnDataCreateConst( + const char *const ENDF_MFMT, + const char *const href, + ConstHandle2ConstSlices slices +); + +// +++ Create, general, non-const +extern_c Handle2ColumnData +ColumnDataCreate( + const char *const ENDF_MFMT, + const char *const href, + ConstHandle2ConstSlices slices +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ColumnDataAssign(ConstHandle2ColumnData self, ConstHandle2ConstColumnData from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ColumnDataDelete(ConstHandle2ConstColumnData self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ColumnDataRead(ConstHandle2ColumnData self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ColumnDataWrite(ConstHandle2ConstColumnData self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ColumnDataPrint(ConstHandle2ConstColumnData self); + +// +++ Print to standard output, as XML +extern_c int +ColumnDataPrintXML(ConstHandle2ConstColumnData self); + +// +++ Print to standard output, as JSON +extern_c int +ColumnDataPrintJSON(ConstHandle2ConstColumnData self); + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MFMT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnDataENDFMFMTHas(ConstHandle2ConstColumnData self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ColumnDataENDFMFMTGet(ConstHandle2ConstColumnData self); + +// +++ Set +extern_c void +ColumnDataENDFMFMTSet(ConstHandle2ColumnData self, const char *const ENDF_MFMT); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnDataHrefHas(ConstHandle2ConstColumnData self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ColumnDataHrefGet(ConstHandle2ConstColumnData self); + +// +++ Set +extern_c void +ColumnDataHrefSet(ConstHandle2ColumnData self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Child: slices +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnDataSlicesHas(ConstHandle2ConstColumnData self); + +// --- Get, const +extern_c Handle2ConstSlices +ColumnDataSlicesGetConst(ConstHandle2ConstColumnData self); + +// +++ Get, non-const +extern_c Handle2Slices +ColumnDataSlicesGet(ConstHandle2ColumnData self); + +// +++ Set +extern_c void +ColumnDataSlicesSet(ConstHandle2ColumnData self, ConstHandle2ConstSlices slices); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ColumnData/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnData/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnData/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnHeaders.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnHeaders.cpp new file mode 100644 index 000000000..902edb80a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnHeaders.cpp @@ -0,0 +1,359 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ColumnHeaders.hpp" +#include "ColumnHeaders.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ColumnHeadersClass; +using CPP = multigroup::ColumnHeaders; + +static const std::string CLASSNAME = "ColumnHeaders"; + +namespace extract { + static auto column = [](auto &obj) { return &obj.column; }; +} + +using CPPColumn = general::Column; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstColumnHeaders +ColumnHeadersDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ColumnHeaders +ColumnHeadersDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstColumnHeaders +ColumnHeadersCreateConst( + ConstHandle2Column *const column, const size_t columnSize +) { + ConstHandle2ColumnHeaders handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ColumnN = 0; ColumnN < columnSize; ++ColumnN) + ColumnHeadersColumnAdd(handle, column[ColumnN]); + return handle; +} + +// Create, general, non-const +Handle2ColumnHeaders +ColumnHeadersCreate( + ConstHandle2Column *const column, const size_t columnSize +) { + ConstHandle2ColumnHeaders handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ColumnN = 0; ColumnN < columnSize; ++ColumnN) + ColumnHeadersColumnAdd(handle, column[ColumnN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ColumnHeadersAssign(ConstHandle2ColumnHeaders self, ConstHandle2ConstColumnHeaders from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ColumnHeadersDelete(ConstHandle2ConstColumnHeaders self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ColumnHeadersRead(ConstHandle2ColumnHeaders self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ColumnHeadersWrite(ConstHandle2ConstColumnHeaders self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ColumnHeadersPrint(ConstHandle2ConstColumnHeaders self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ColumnHeadersPrintXML(ConstHandle2ConstColumnHeaders self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ColumnHeadersPrintJSON(ConstHandle2ConstColumnHeaders self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: column +// ----------------------------------------------------------------------------- + +// Has +int +ColumnHeadersColumnHas(ConstHandle2ConstColumnHeaders self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ColumnHas", self, extract::column); +} + +// Clear +void +ColumnHeadersColumnClear(ConstHandle2ColumnHeaders self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ColumnClear", self, extract::column); +} + +// Size +size_t +ColumnHeadersColumnSize(ConstHandle2ConstColumnHeaders self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ColumnSize", self, extract::column); +} + +// Add +void +ColumnHeadersColumnAdd(ConstHandle2ColumnHeaders self, ConstHandle2ConstColumn column) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ColumnAdd", self, extract::column, column); +} + +// Get, by index \in [0,size), const +Handle2ConstColumn +ColumnHeadersColumnGetConst(ConstHandle2ConstColumnHeaders self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ColumnGetConst", self, extract::column, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Column +ColumnHeadersColumnGet(ConstHandle2ColumnHeaders self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ColumnGet", self, extract::column, index_); +} + +// Set, by index \in [0,size) +void +ColumnHeadersColumnSet( + ConstHandle2ColumnHeaders self, + const size_t index_, + ConstHandle2ConstColumn column +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ColumnSet", self, extract::column, index_, column); +} + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// Has, by index +int +ColumnHeadersColumnHasByIndex( + ConstHandle2ConstColumnHeaders self, + const int index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ColumnHasByIndex", + self, extract::column, meta::index, index); +} + +// Get, by index, const +Handle2ConstColumn +ColumnHeadersColumnGetByIndexConst( + ConstHandle2ConstColumnHeaders self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByIndexConst", + self, extract::column, meta::index, index); +} + +// Get, by index, non-const +Handle2Column +ColumnHeadersColumnGetByIndex( + ConstHandle2ColumnHeaders self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByIndex", + self, extract::column, meta::index, index); +} + +// Set, by index +void +ColumnHeadersColumnSetByIndex( + ConstHandle2ColumnHeaders self, + const int index, + ConstHandle2ConstColumn column +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ColumnSetByIndex", + self, extract::column, meta::index, index, column); +} + +// ------------------------ +// Re: metadatum name +// ------------------------ + +// Has, by name +int +ColumnHeadersColumnHasByName( + ConstHandle2ConstColumnHeaders self, + const char *const name +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ColumnHasByName", + self, extract::column, meta::name, name); +} + +// Get, by name, const +Handle2ConstColumn +ColumnHeadersColumnGetByNameConst( + ConstHandle2ConstColumnHeaders self, + const char *const name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByNameConst", + self, extract::column, meta::name, name); +} + +// Get, by name, non-const +Handle2Column +ColumnHeadersColumnGetByName( + ConstHandle2ColumnHeaders self, + const char *const name +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByName", + self, extract::column, meta::name, name); +} + +// Set, by name +void +ColumnHeadersColumnSetByName( + ConstHandle2ColumnHeaders self, + const char *const name, + ConstHandle2ConstColumn column +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ColumnSetByName", + self, extract::column, meta::name, name, column); +} + +// ------------------------ +// Re: metadatum unit +// ------------------------ + +// Has, by unit +int +ColumnHeadersColumnHasByUnit( + ConstHandle2ConstColumnHeaders self, + const char *const unit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ColumnHasByUnit", + self, extract::column, meta::unit, unit); +} + +// Get, by unit, const +Handle2ConstColumn +ColumnHeadersColumnGetByUnitConst( + ConstHandle2ConstColumnHeaders self, + const char *const unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByUnitConst", + self, extract::column, meta::unit, unit); +} + +// Get, by unit, non-const +Handle2Column +ColumnHeadersColumnGetByUnit( + ConstHandle2ColumnHeaders self, + const char *const unit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ColumnGetByUnit", + self, extract::column, meta::unit, unit); +} + +// Set, by unit +void +ColumnHeadersColumnSetByUnit( + ConstHandle2ColumnHeaders self, + const char *const unit, + ConstHandle2ConstColumn column +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ColumnSetByUnit", + self, extract::column, meta::unit, unit, column); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ColumnHeaders/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnHeaders.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnHeaders.h new file mode 100644 index 000000000..4b4803654 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnHeaders.h @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ColumnHeaders is the basic handle type in this file. Example: +// // Create a default ColumnHeaders object: +// ColumnHeaders handle = ColumnHeadersDefault(); +// Functions involving ColumnHeaders are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_COLUMNHEADERS +#define C_INTERFACE_GNDS_V2_0_GENERAL_COLUMNHEADERS + +#include "GNDStk.h" +#include "v2.0/general/Column.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ColumnHeadersClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ColumnHeaders +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ColumnHeadersClass *ColumnHeaders; + +// --- Const-aware handles. +typedef const struct ColumnHeadersClass *const ConstHandle2ConstColumnHeaders; +typedef struct ColumnHeadersClass *const ConstHandle2ColumnHeaders; +typedef const struct ColumnHeadersClass * Handle2ConstColumnHeaders; +typedef struct ColumnHeadersClass * Handle2ColumnHeaders; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstColumnHeaders +ColumnHeadersDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ColumnHeaders +ColumnHeadersDefault(); + +// --- Create, general, const +extern_c Handle2ConstColumnHeaders +ColumnHeadersCreateConst( + ConstHandle2Column *const column, const size_t columnSize +); + +// +++ Create, general, non-const +extern_c Handle2ColumnHeaders +ColumnHeadersCreate( + ConstHandle2Column *const column, const size_t columnSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ColumnHeadersAssign(ConstHandle2ColumnHeaders self, ConstHandle2ConstColumnHeaders from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ColumnHeadersDelete(ConstHandle2ConstColumnHeaders self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ColumnHeadersRead(ConstHandle2ColumnHeaders self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ColumnHeadersWrite(ConstHandle2ConstColumnHeaders self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ColumnHeadersPrint(ConstHandle2ConstColumnHeaders self); + +// +++ Print to standard output, as XML +extern_c int +ColumnHeadersPrintXML(ConstHandle2ConstColumnHeaders self); + +// +++ Print to standard output, as JSON +extern_c int +ColumnHeadersPrintJSON(ConstHandle2ConstColumnHeaders self); + + +// ----------------------------------------------------------------------------- +// Child: column +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ColumnHeadersColumnHas(ConstHandle2ConstColumnHeaders self); + +// +++ Clear +extern_c void +ColumnHeadersColumnClear(ConstHandle2ColumnHeaders self); + +// +++ Size +extern_c size_t +ColumnHeadersColumnSize(ConstHandle2ConstColumnHeaders self); + +// +++ Add +extern_c void +ColumnHeadersColumnAdd(ConstHandle2ColumnHeaders self, ConstHandle2ConstColumn column); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstColumn +ColumnHeadersColumnGetConst(ConstHandle2ConstColumnHeaders self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Column +ColumnHeadersColumnGet(ConstHandle2ColumnHeaders self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ColumnHeadersColumnSet( + ConstHandle2ColumnHeaders self, + const size_t index_, + ConstHandle2ConstColumn column +); + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// +++ Has, by index +extern_c int +ColumnHeadersColumnHasByIndex( + ConstHandle2ConstColumnHeaders self, + const int index +); + +// --- Get, by index, const +extern_c Handle2ConstColumn +ColumnHeadersColumnGetByIndexConst( + ConstHandle2ConstColumnHeaders self, + const int index +); + +// +++ Get, by index, non-const +extern_c Handle2Column +ColumnHeadersColumnGetByIndex( + ConstHandle2ColumnHeaders self, + const int index +); + +// +++ Set, by index +extern_c void +ColumnHeadersColumnSetByIndex( + ConstHandle2ColumnHeaders self, + const int index, + ConstHandle2ConstColumn column +); + +// ------------------------ +// Re: metadatum name +// ------------------------ + +// +++ Has, by name +extern_c int +ColumnHeadersColumnHasByName( + ConstHandle2ConstColumnHeaders self, + const char *const name +); + +// --- Get, by name, const +extern_c Handle2ConstColumn +ColumnHeadersColumnGetByNameConst( + ConstHandle2ConstColumnHeaders self, + const char *const name +); + +// +++ Get, by name, non-const +extern_c Handle2Column +ColumnHeadersColumnGetByName( + ConstHandle2ColumnHeaders self, + const char *const name +); + +// +++ Set, by name +extern_c void +ColumnHeadersColumnSetByName( + ConstHandle2ColumnHeaders self, + const char *const name, + ConstHandle2ConstColumn column +); + +// ------------------------ +// Re: metadatum unit +// ------------------------ + +// +++ Has, by unit +extern_c int +ColumnHeadersColumnHasByUnit( + ConstHandle2ConstColumnHeaders self, + const char *const unit +); + +// --- Get, by unit, const +extern_c Handle2ConstColumn +ColumnHeadersColumnGetByUnitConst( + ConstHandle2ConstColumnHeaders self, + const char *const unit +); + +// +++ Get, by unit, non-const +extern_c Handle2Column +ColumnHeadersColumnGetByUnit( + ConstHandle2ColumnHeaders self, + const char *const unit +); + +// +++ Set, by unit +extern_c void +ColumnHeadersColumnSetByUnit( + ConstHandle2ColumnHeaders self, + const char *const unit, + ConstHandle2ConstColumn column +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ColumnHeaders/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnHeaders/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnHeaders/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnHeaders/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ColumnHeaders/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configuration.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configuration.cpp new file mode 100644 index 000000000..05dfc266c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configuration.cpp @@ -0,0 +1,325 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Configuration.hpp" +#include "Configuration.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ConfigurationClass; +using CPP = multigroup::Configuration; + +static const std::string CLASSNAME = "Configuration"; + +namespace extract { + static auto subshell = [](auto &obj) { return &obj.subshell; }; + static auto electronNumber = [](auto &obj) { return &obj.electronNumber; }; + static auto bindingEnergy = [](auto &obj) { return &obj.bindingEnergy; }; + static auto decayData = [](auto &obj) { return &obj.decayData; }; +} + +using CPPBindingEnergy = general::BindingEnergy; +using CPPDecayData = general::DecayData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstConfiguration +ConfigurationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Configuration +ConfigurationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstConfiguration +ConfigurationCreateConst( + const char *const subshell, + const double electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy, + ConstHandle2DecayData *const decayData, const size_t decayDataSize +) { + ConstHandle2Configuration handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + subshell, + electronNumber, + detail::tocpp(bindingEnergy), + std::vector{} + ); + for (size_t DecayDataN = 0; DecayDataN < decayDataSize; ++DecayDataN) + ConfigurationDecayDataAdd(handle, decayData[DecayDataN]); + return handle; +} + +// Create, general, non-const +Handle2Configuration +ConfigurationCreate( + const char *const subshell, + const double electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy, + ConstHandle2DecayData *const decayData, const size_t decayDataSize +) { + ConstHandle2Configuration handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + subshell, + electronNumber, + detail::tocpp(bindingEnergy), + std::vector{} + ); + for (size_t DecayDataN = 0; DecayDataN < decayDataSize; ++DecayDataN) + ConfigurationDecayDataAdd(handle, decayData[DecayDataN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ConfigurationAssign(ConstHandle2Configuration self, ConstHandle2ConstConfiguration from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ConfigurationDelete(ConstHandle2ConstConfiguration self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ConfigurationRead(ConstHandle2Configuration self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ConfigurationWrite(ConstHandle2ConstConfiguration self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ConfigurationPrint(ConstHandle2ConstConfiguration self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ConfigurationPrintXML(ConstHandle2ConstConfiguration self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ConfigurationPrintJSON(ConstHandle2ConstConfiguration self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: subshell +// ----------------------------------------------------------------------------- + +// Has +int +ConfigurationSubshellHas(ConstHandle2ConstConfiguration self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SubshellHas", self, extract::subshell); +} + +// Get +// Returns by value +const char * +ConfigurationSubshellGet(ConstHandle2ConstConfiguration self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SubshellGet", self, extract::subshell); +} + +// Set +void +ConfigurationSubshellSet(ConstHandle2Configuration self, const char *const subshell) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SubshellSet", self, extract::subshell, subshell); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: electronNumber +// ----------------------------------------------------------------------------- + +// Has +int +ConfigurationElectronNumberHas(ConstHandle2ConstConfiguration self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ElectronNumberHas", self, extract::electronNumber); +} + +// Get +// Returns by value +double +ConfigurationElectronNumberGet(ConstHandle2ConstConfiguration self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ElectronNumberGet", self, extract::electronNumber); +} + +// Set +void +ConfigurationElectronNumberSet(ConstHandle2Configuration self, const double electronNumber) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ElectronNumberSet", self, extract::electronNumber, electronNumber); +} + + +// ----------------------------------------------------------------------------- +// Child: bindingEnergy +// ----------------------------------------------------------------------------- + +// Has +int +ConfigurationBindingEnergyHas(ConstHandle2ConstConfiguration self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BindingEnergyHas", self, extract::bindingEnergy); +} + +// Get, const +Handle2ConstBindingEnergy +ConfigurationBindingEnergyGetConst(ConstHandle2ConstConfiguration self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BindingEnergyGetConst", self, extract::bindingEnergy); +} + +// Get, non-const +Handle2BindingEnergy +ConfigurationBindingEnergyGet(ConstHandle2Configuration self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BindingEnergyGet", self, extract::bindingEnergy); +} + +// Set +void +ConfigurationBindingEnergySet(ConstHandle2Configuration self, ConstHandle2ConstBindingEnergy bindingEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BindingEnergySet", self, extract::bindingEnergy, bindingEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: decayData +// ----------------------------------------------------------------------------- + +// Has +int +ConfigurationDecayDataHas(ConstHandle2ConstConfiguration self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DecayDataHas", self, extract::decayData); +} + +// Clear +void +ConfigurationDecayDataClear(ConstHandle2Configuration self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DecayDataClear", self, extract::decayData); +} + +// Size +size_t +ConfigurationDecayDataSize(ConstHandle2ConstConfiguration self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DecayDataSize", self, extract::decayData); +} + +// Add +void +ConfigurationDecayDataAdd(ConstHandle2Configuration self, ConstHandle2ConstDecayData decayData) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DecayDataAdd", self, extract::decayData, decayData); +} + +// Get, by index \in [0,size), const +Handle2ConstDecayData +ConfigurationDecayDataGetConst(ConstHandle2ConstConfiguration self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DecayDataGetConst", self, extract::decayData, index_); +} + +// Get, by index \in [0,size), non-const +Handle2DecayData +ConfigurationDecayDataGet(ConstHandle2Configuration self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DecayDataGet", self, extract::decayData, index_); +} + +// Set, by index \in [0,size) +void +ConfigurationDecayDataSet( + ConstHandle2Configuration self, + const size_t index_, + ConstHandle2ConstDecayData decayData +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DecayDataSet", self, extract::decayData, index_, decayData); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Configuration/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configuration.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configuration.h new file mode 100644 index 000000000..484bf937f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configuration.h @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Configuration is the basic handle type in this file. Example: +// // Create a default Configuration object: +// Configuration handle = ConfigurationDefault(); +// Functions involving Configuration are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CONFIGURATION +#define C_INTERFACE_GNDS_V2_0_GENERAL_CONFIGURATION + +#include "GNDStk.h" +#include "v2.0/general/BindingEnergy.h" +#include "v2.0/general/DecayData.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ConfigurationClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Configuration +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ConfigurationClass *Configuration; + +// --- Const-aware handles. +typedef const struct ConfigurationClass *const ConstHandle2ConstConfiguration; +typedef struct ConfigurationClass *const ConstHandle2Configuration; +typedef const struct ConfigurationClass * Handle2ConstConfiguration; +typedef struct ConfigurationClass * Handle2Configuration; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstConfiguration +ConfigurationDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Configuration +ConfigurationDefault(); + +// --- Create, general, const +extern_c Handle2ConstConfiguration +ConfigurationCreateConst( + const char *const subshell, + const double electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy, + ConstHandle2DecayData *const decayData, const size_t decayDataSize +); + +// +++ Create, general, non-const +extern_c Handle2Configuration +ConfigurationCreate( + const char *const subshell, + const double electronNumber, + ConstHandle2ConstBindingEnergy bindingEnergy, + ConstHandle2DecayData *const decayData, const size_t decayDataSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ConfigurationAssign(ConstHandle2Configuration self, ConstHandle2ConstConfiguration from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ConfigurationDelete(ConstHandle2ConstConfiguration self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ConfigurationRead(ConstHandle2Configuration self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ConfigurationWrite(ConstHandle2ConstConfiguration self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ConfigurationPrint(ConstHandle2ConstConfiguration self); + +// +++ Print to standard output, as XML +extern_c int +ConfigurationPrintXML(ConstHandle2ConstConfiguration self); + +// +++ Print to standard output, as JSON +extern_c int +ConfigurationPrintJSON(ConstHandle2ConstConfiguration self); + + +// ----------------------------------------------------------------------------- +// Metadatum: subshell +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ConfigurationSubshellHas(ConstHandle2ConstConfiguration self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ConfigurationSubshellGet(ConstHandle2ConstConfiguration self); + +// +++ Set +extern_c void +ConfigurationSubshellSet(ConstHandle2Configuration self, const char *const subshell); + + +// ----------------------------------------------------------------------------- +// Metadatum: electronNumber +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ConfigurationElectronNumberHas(ConstHandle2ConstConfiguration self); + +// +++ Get +// +++ Returns by value +extern_c double +ConfigurationElectronNumberGet(ConstHandle2ConstConfiguration self); + +// +++ Set +extern_c void +ConfigurationElectronNumberSet(ConstHandle2Configuration self, const double electronNumber); + + +// ----------------------------------------------------------------------------- +// Child: bindingEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ConfigurationBindingEnergyHas(ConstHandle2ConstConfiguration self); + +// --- Get, const +extern_c Handle2ConstBindingEnergy +ConfigurationBindingEnergyGetConst(ConstHandle2ConstConfiguration self); + +// +++ Get, non-const +extern_c Handle2BindingEnergy +ConfigurationBindingEnergyGet(ConstHandle2Configuration self); + +// +++ Set +extern_c void +ConfigurationBindingEnergySet(ConstHandle2Configuration self, ConstHandle2ConstBindingEnergy bindingEnergy); + + +// ----------------------------------------------------------------------------- +// Child: decayData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ConfigurationDecayDataHas(ConstHandle2ConstConfiguration self); + +// +++ Clear +extern_c void +ConfigurationDecayDataClear(ConstHandle2Configuration self); + +// +++ Size +extern_c size_t +ConfigurationDecayDataSize(ConstHandle2ConstConfiguration self); + +// +++ Add +extern_c void +ConfigurationDecayDataAdd(ConstHandle2Configuration self, ConstHandle2ConstDecayData decayData); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDecayData +ConfigurationDecayDataGetConst(ConstHandle2ConstConfiguration self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2DecayData +ConfigurationDecayDataGet(ConstHandle2Configuration self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ConfigurationDecayDataSet( + ConstHandle2Configuration self, + const size_t index_, + ConstHandle2ConstDecayData decayData +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Configuration/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configuration/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configuration/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configuration/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configuration/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configurations.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configurations.cpp new file mode 100644 index 000000000..9c8e438ca --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configurations.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Configurations.hpp" +#include "Configurations.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ConfigurationsClass; +using CPP = multigroup::Configurations; + +static const std::string CLASSNAME = "Configurations"; + +namespace extract { + static auto configuration = [](auto &obj) { return &obj.configuration; }; +} + +using CPPConfiguration = general::Configuration; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstConfigurations +ConfigurationsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Configurations +ConfigurationsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstConfigurations +ConfigurationsCreateConst( + ConstHandle2Configuration *const configuration, const size_t configurationSize +) { + ConstHandle2Configurations handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ConfigurationN = 0; ConfigurationN < configurationSize; ++ConfigurationN) + ConfigurationsConfigurationAdd(handle, configuration[ConfigurationN]); + return handle; +} + +// Create, general, non-const +Handle2Configurations +ConfigurationsCreate( + ConstHandle2Configuration *const configuration, const size_t configurationSize +) { + ConstHandle2Configurations handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ConfigurationN = 0; ConfigurationN < configurationSize; ++ConfigurationN) + ConfigurationsConfigurationAdd(handle, configuration[ConfigurationN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ConfigurationsAssign(ConstHandle2Configurations self, ConstHandle2ConstConfigurations from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ConfigurationsDelete(ConstHandle2ConstConfigurations self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ConfigurationsRead(ConstHandle2Configurations self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ConfigurationsWrite(ConstHandle2ConstConfigurations self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ConfigurationsPrint(ConstHandle2ConstConfigurations self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ConfigurationsPrintXML(ConstHandle2ConstConfigurations self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ConfigurationsPrintJSON(ConstHandle2ConstConfigurations self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: configuration +// ----------------------------------------------------------------------------- + +// Has +int +ConfigurationsConfigurationHas(ConstHandle2ConstConfigurations self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ConfigurationHas", self, extract::configuration); +} + +// Clear +void +ConfigurationsConfigurationClear(ConstHandle2Configurations self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ConfigurationClear", self, extract::configuration); +} + +// Size +size_t +ConfigurationsConfigurationSize(ConstHandle2ConstConfigurations self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ConfigurationSize", self, extract::configuration); +} + +// Add +void +ConfigurationsConfigurationAdd(ConstHandle2Configurations self, ConstHandle2ConstConfiguration configuration) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ConfigurationAdd", self, extract::configuration, configuration); +} + +// Get, by index \in [0,size), const +Handle2ConstConfiguration +ConfigurationsConfigurationGetConst(ConstHandle2ConstConfigurations self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ConfigurationGetConst", self, extract::configuration, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Configuration +ConfigurationsConfigurationGet(ConstHandle2Configurations self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ConfigurationGet", self, extract::configuration, index_); +} + +// Set, by index \in [0,size) +void +ConfigurationsConfigurationSet( + ConstHandle2Configurations self, + const size_t index_, + ConstHandle2ConstConfiguration configuration +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ConfigurationSet", self, extract::configuration, index_, configuration); +} + +// ------------------------ +// Re: metadatum subshell +// ------------------------ + +// Has, by subshell +int +ConfigurationsConfigurationHasBySubshell( + ConstHandle2ConstConfigurations self, + const char *const subshell +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationHasBySubshell", + self, extract::configuration, meta::subshell, subshell); +} + +// Get, by subshell, const +Handle2ConstConfiguration +ConfigurationsConfigurationGetBySubshellConst( + ConstHandle2ConstConfigurations self, + const char *const subshell +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationGetBySubshellConst", + self, extract::configuration, meta::subshell, subshell); +} + +// Get, by subshell, non-const +Handle2Configuration +ConfigurationsConfigurationGetBySubshell( + ConstHandle2Configurations self, + const char *const subshell +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationGetBySubshell", + self, extract::configuration, meta::subshell, subshell); +} + +// Set, by subshell +void +ConfigurationsConfigurationSetBySubshell( + ConstHandle2Configurations self, + const char *const subshell, + ConstHandle2ConstConfiguration configuration +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationSetBySubshell", + self, extract::configuration, meta::subshell, subshell, configuration); +} + +// ------------------------ +// Re: metadatum electronNumber +// ------------------------ + +// Has, by electronNumber +int +ConfigurationsConfigurationHasByElectronNumber( + ConstHandle2ConstConfigurations self, + const double electronNumber +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationHasByElectronNumber", + self, extract::configuration, meta::electronNumber, electronNumber); +} + +// Get, by electronNumber, const +Handle2ConstConfiguration +ConfigurationsConfigurationGetByElectronNumberConst( + ConstHandle2ConstConfigurations self, + const double electronNumber +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationGetByElectronNumberConst", + self, extract::configuration, meta::electronNumber, electronNumber); +} + +// Get, by electronNumber, non-const +Handle2Configuration +ConfigurationsConfigurationGetByElectronNumber( + ConstHandle2Configurations self, + const double electronNumber +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationGetByElectronNumber", + self, extract::configuration, meta::electronNumber, electronNumber); +} + +// Set, by electronNumber +void +ConfigurationsConfigurationSetByElectronNumber( + ConstHandle2Configurations self, + const double electronNumber, + ConstHandle2ConstConfiguration configuration +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ConfigurationSetByElectronNumber", + self, extract::configuration, meta::electronNumber, electronNumber, configuration); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Configurations/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configurations.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configurations.h new file mode 100644 index 000000000..bb37259d7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configurations.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Configurations is the basic handle type in this file. Example: +// // Create a default Configurations object: +// Configurations handle = ConfigurationsDefault(); +// Functions involving Configurations are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CONFIGURATIONS +#define C_INTERFACE_GNDS_V2_0_GENERAL_CONFIGURATIONS + +#include "GNDStk.h" +#include "v2.0/general/Configuration.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ConfigurationsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Configurations +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ConfigurationsClass *Configurations; + +// --- Const-aware handles. +typedef const struct ConfigurationsClass *const ConstHandle2ConstConfigurations; +typedef struct ConfigurationsClass *const ConstHandle2Configurations; +typedef const struct ConfigurationsClass * Handle2ConstConfigurations; +typedef struct ConfigurationsClass * Handle2Configurations; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstConfigurations +ConfigurationsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Configurations +ConfigurationsDefault(); + +// --- Create, general, const +extern_c Handle2ConstConfigurations +ConfigurationsCreateConst( + ConstHandle2Configuration *const configuration, const size_t configurationSize +); + +// +++ Create, general, non-const +extern_c Handle2Configurations +ConfigurationsCreate( + ConstHandle2Configuration *const configuration, const size_t configurationSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ConfigurationsAssign(ConstHandle2Configurations self, ConstHandle2ConstConfigurations from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ConfigurationsDelete(ConstHandle2ConstConfigurations self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ConfigurationsRead(ConstHandle2Configurations self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ConfigurationsWrite(ConstHandle2ConstConfigurations self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ConfigurationsPrint(ConstHandle2ConstConfigurations self); + +// +++ Print to standard output, as XML +extern_c int +ConfigurationsPrintXML(ConstHandle2ConstConfigurations self); + +// +++ Print to standard output, as JSON +extern_c int +ConfigurationsPrintJSON(ConstHandle2ConstConfigurations self); + + +// ----------------------------------------------------------------------------- +// Child: configuration +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ConfigurationsConfigurationHas(ConstHandle2ConstConfigurations self); + +// +++ Clear +extern_c void +ConfigurationsConfigurationClear(ConstHandle2Configurations self); + +// +++ Size +extern_c size_t +ConfigurationsConfigurationSize(ConstHandle2ConstConfigurations self); + +// +++ Add +extern_c void +ConfigurationsConfigurationAdd(ConstHandle2Configurations self, ConstHandle2ConstConfiguration configuration); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstConfiguration +ConfigurationsConfigurationGetConst(ConstHandle2ConstConfigurations self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Configuration +ConfigurationsConfigurationGet(ConstHandle2Configurations self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ConfigurationsConfigurationSet( + ConstHandle2Configurations self, + const size_t index_, + ConstHandle2ConstConfiguration configuration +); + +// ------------------------ +// Re: metadatum subshell +// ------------------------ + +// +++ Has, by subshell +extern_c int +ConfigurationsConfigurationHasBySubshell( + ConstHandle2ConstConfigurations self, + const char *const subshell +); + +// --- Get, by subshell, const +extern_c Handle2ConstConfiguration +ConfigurationsConfigurationGetBySubshellConst( + ConstHandle2ConstConfigurations self, + const char *const subshell +); + +// +++ Get, by subshell, non-const +extern_c Handle2Configuration +ConfigurationsConfigurationGetBySubshell( + ConstHandle2Configurations self, + const char *const subshell +); + +// +++ Set, by subshell +extern_c void +ConfigurationsConfigurationSetBySubshell( + ConstHandle2Configurations self, + const char *const subshell, + ConstHandle2ConstConfiguration configuration +); + +// ------------------------ +// Re: metadatum electronNumber +// ------------------------ + +// +++ Has, by electronNumber +extern_c int +ConfigurationsConfigurationHasByElectronNumber( + ConstHandle2ConstConfigurations self, + const double electronNumber +); + +// --- Get, by electronNumber, const +extern_c Handle2ConstConfiguration +ConfigurationsConfigurationGetByElectronNumberConst( + ConstHandle2ConstConfigurations self, + const double electronNumber +); + +// +++ Get, by electronNumber, non-const +extern_c Handle2Configuration +ConfigurationsConfigurationGetByElectronNumber( + ConstHandle2Configurations self, + const double electronNumber +); + +// +++ Set, by electronNumber +extern_c void +ConfigurationsConfigurationSetByElectronNumber( + ConstHandle2Configurations self, + const double electronNumber, + ConstHandle2ConstConfiguration configuration +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Configurations/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configurations/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configurations/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configurations/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Configurations/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Constant1d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Constant1d.cpp new file mode 100644 index 000000000..ac761f8ce --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Constant1d.cpp @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Constant1d.hpp" +#include "Constant1d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Constant1dClass; +using CPP = multigroup::Constant1d; + +static const std::string CLASSNAME = "Constant1d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto axes = [](auto &obj) { return &obj.axes; }; +} + +using CPPAxes = general::Axes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstConstant1d +Constant1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Constant1d +Constant1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstConstant1d +Constant1dCreateConst( + const char *const label, + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +) { + ConstHandle2Constant1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + domainMin, + domainMax, + detail::tocpp(axes) + ); + return handle; +} + +// Create, general, non-const +Handle2Constant1d +Constant1dCreate( + const char *const label, + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +) { + ConstHandle2Constant1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + domainMin, + domainMax, + detail::tocpp(axes) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Constant1dAssign(ConstHandle2Constant1d self, ConstHandle2ConstConstant1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Constant1dDelete(ConstHandle2ConstConstant1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Constant1dRead(ConstHandle2Constant1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Constant1dWrite(ConstHandle2ConstConstant1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Constant1dPrint(ConstHandle2ConstConstant1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Constant1dPrintXML(ConstHandle2ConstConstant1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Constant1dPrintJSON(ConstHandle2ConstConstant1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Constant1dLabelHas(ConstHandle2ConstConstant1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +Constant1dLabelGet(ConstHandle2ConstConstant1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Constant1dLabelSet(ConstHandle2Constant1d self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +Constant1dValueHas(ConstHandle2ConstConstant1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +Constant1dValueGet(ConstHandle2ConstConstant1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +Constant1dValueSet(ConstHandle2Constant1d self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +Constant1dDomainMinHas(ConstHandle2ConstConstant1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +double +Constant1dDomainMinGet(ConstHandle2ConstConstant1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +Constant1dDomainMinSet(ConstHandle2Constant1d self, const double domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +Constant1dDomainMaxHas(ConstHandle2ConstConstant1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +double +Constant1dDomainMaxGet(ConstHandle2ConstConstant1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +Constant1dDomainMaxSet(ConstHandle2Constant1d self, const double domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +Constant1dAxesHas(ConstHandle2ConstConstant1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +Constant1dAxesGetConst(ConstHandle2ConstConstant1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +Constant1dAxesGet(ConstHandle2Constant1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +Constant1dAxesSet(ConstHandle2Constant1d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Constant1d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Constant1d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Constant1d.h new file mode 100644 index 000000000..b902af302 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Constant1d.h @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Constant1d is the basic handle type in this file. Example: +// // Create a default Constant1d object: +// Constant1d handle = Constant1dDefault(); +// Functions involving Constant1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CONSTANT1D +#define C_INTERFACE_GNDS_V2_0_GENERAL_CONSTANT1D + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Constant1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Constant1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Constant1dClass *Constant1d; + +// --- Const-aware handles. +typedef const struct Constant1dClass *const ConstHandle2ConstConstant1d; +typedef struct Constant1dClass *const ConstHandle2Constant1d; +typedef const struct Constant1dClass * Handle2ConstConstant1d; +typedef struct Constant1dClass * Handle2Constant1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstConstant1d +Constant1dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Constant1d +Constant1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstConstant1d +Constant1dCreateConst( + const char *const label, + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +); + +// +++ Create, general, non-const +extern_c Handle2Constant1d +Constant1dCreate( + const char *const label, + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Constant1dAssign(ConstHandle2Constant1d self, ConstHandle2ConstConstant1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Constant1dDelete(ConstHandle2ConstConstant1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Constant1dRead(ConstHandle2Constant1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Constant1dWrite(ConstHandle2ConstConstant1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Constant1dPrint(ConstHandle2ConstConstant1d self); + +// +++ Print to standard output, as XML +extern_c int +Constant1dPrintXML(ConstHandle2ConstConstant1d self); + +// +++ Print to standard output, as JSON +extern_c int +Constant1dPrintJSON(ConstHandle2ConstConstant1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Constant1dLabelHas(ConstHandle2ConstConstant1d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +Constant1dLabelGet(ConstHandle2ConstConstant1d self); + +// +++ Set +extern_c void +Constant1dLabelSet(ConstHandle2Constant1d self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Constant1dValueHas(ConstHandle2ConstConstant1d self); + +// +++ Get +// +++ Returns by value +extern_c double +Constant1dValueGet(ConstHandle2ConstConstant1d self); + +// +++ Set +extern_c void +Constant1dValueSet(ConstHandle2Constant1d self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Constant1dDomainMinHas(ConstHandle2ConstConstant1d self); + +// +++ Get +// +++ Returns by value +extern_c double +Constant1dDomainMinGet(ConstHandle2ConstConstant1d self); + +// +++ Set +extern_c void +Constant1dDomainMinSet(ConstHandle2Constant1d self, const double domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Constant1dDomainMaxHas(ConstHandle2ConstConstant1d self); + +// +++ Get +// +++ Returns by value +extern_c double +Constant1dDomainMaxGet(ConstHandle2ConstConstant1d self); + +// +++ Set +extern_c void +Constant1dDomainMaxSet(ConstHandle2Constant1d self, const double domainMax); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Constant1dAxesHas(ConstHandle2ConstConstant1d self); + +// --- Get, const +extern_c Handle2ConstAxes +Constant1dAxesGetConst(ConstHandle2ConstConstant1d self); + +// +++ Get, non-const +extern_c Handle2Axes +Constant1dAxesGet(ConstHandle2Constant1d self); + +// +++ Set +extern_c void +Constant1dAxesSet(ConstHandle2Constant1d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Constant1d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Constant1d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Constant1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Constant1d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Constant1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Continuum.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Continuum.cpp new file mode 100644 index 000000000..57432d3c1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Continuum.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Continuum.hpp" +#include "Continuum.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ContinuumClass; +using CPP = multigroup::Continuum; + +static const std::string CLASSNAME = "Continuum"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstContinuum +ContinuumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Continuum +ContinuumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstContinuum +ContinuumCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2Continuum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2Continuum +ContinuumCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2Continuum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ContinuumAssign(ConstHandle2Continuum self, ConstHandle2ConstContinuum from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ContinuumDelete(ConstHandle2ConstContinuum self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ContinuumRead(ConstHandle2Continuum self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ContinuumWrite(ConstHandle2ConstContinuum self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ContinuumPrint(ConstHandle2ConstContinuum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ContinuumPrintXML(ConstHandle2ConstContinuum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ContinuumPrintJSON(ConstHandle2ConstContinuum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +ContinuumXYs1dHas(ConstHandle2ConstContinuum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +ContinuumXYs1dGetConst(ConstHandle2ConstContinuum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +ContinuumXYs1dGet(ConstHandle2Continuum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +ContinuumXYs1dSet(ConstHandle2Continuum self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Continuum/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Continuum.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Continuum.h new file mode 100644 index 000000000..1c3b06c41 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Continuum.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Continuum is the basic handle type in this file. Example: +// // Create a default Continuum object: +// Continuum handle = ContinuumDefault(); +// Functions involving Continuum are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CONTINUUM +#define C_INTERFACE_GNDS_V2_0_GENERAL_CONTINUUM + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ContinuumClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Continuum +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ContinuumClass *Continuum; + +// --- Const-aware handles. +typedef const struct ContinuumClass *const ConstHandle2ConstContinuum; +typedef struct ContinuumClass *const ConstHandle2Continuum; +typedef const struct ContinuumClass * Handle2ConstContinuum; +typedef struct ContinuumClass * Handle2Continuum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstContinuum +ContinuumDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Continuum +ContinuumDefault(); + +// --- Create, general, const +extern_c Handle2ConstContinuum +ContinuumCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2Continuum +ContinuumCreate( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ContinuumAssign(ConstHandle2Continuum self, ConstHandle2ConstContinuum from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ContinuumDelete(ConstHandle2ConstContinuum self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ContinuumRead(ConstHandle2Continuum self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ContinuumWrite(ConstHandle2ConstContinuum self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ContinuumPrint(ConstHandle2ConstContinuum self); + +// +++ Print to standard output, as XML +extern_c int +ContinuumPrintXML(ConstHandle2ConstContinuum self); + +// +++ Print to standard output, as JSON +extern_c int +ContinuumPrintJSON(ConstHandle2ConstContinuum self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ContinuumXYs1dHas(ConstHandle2ConstContinuum self); + +// --- Get, const +extern_c Handle2ConstXYs1d +ContinuumXYs1dGetConst(ConstHandle2ConstContinuum self); + +// +++ Get, non-const +extern_c Handle2XYs1d +ContinuumXYs1dGet(ConstHandle2Continuum self); + +// +++ Set +extern_c void +ContinuumXYs1dSet(ConstHandle2Continuum self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Continuum/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Continuum/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Continuum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Continuum/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Continuum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Conversion.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Conversion.cpp new file mode 100644 index 000000000..734134be8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Conversion.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Conversion.hpp" +#include "Conversion.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ConversionClass; +using CPP = multigroup::Conversion; + +static const std::string CLASSNAME = "Conversion"; + +namespace extract { + static auto flags = [](auto &obj) { return &obj.flags; }; + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstConversion +ConversionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Conversion +ConversionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstConversion +ConversionCreateConst( + const char *const flags, + const char *const href +) { + ConstHandle2Conversion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + flags, + href + ); + return handle; +} + +// Create, general, non-const +Handle2Conversion +ConversionCreate( + const char *const flags, + const char *const href +) { + ConstHandle2Conversion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + flags, + href + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ConversionAssign(ConstHandle2Conversion self, ConstHandle2ConstConversion from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ConversionDelete(ConstHandle2ConstConversion self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ConversionRead(ConstHandle2Conversion self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ConversionWrite(ConstHandle2ConstConversion self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ConversionPrint(ConstHandle2ConstConversion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ConversionPrintXML(ConstHandle2ConstConversion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ConversionPrintJSON(ConstHandle2ConstConversion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: flags +// ----------------------------------------------------------------------------- + +// Has +int +ConversionFlagsHas(ConstHandle2ConstConversion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FlagsHas", self, extract::flags); +} + +// Get +// Returns by value +const char * +ConversionFlagsGet(ConstHandle2ConstConversion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FlagsGet", self, extract::flags); +} + +// Set +void +ConversionFlagsSet(ConstHandle2Conversion self, const char *const flags) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FlagsSet", self, extract::flags, flags); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +ConversionHrefHas(ConstHandle2ConstConversion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +ConversionHrefGet(ConstHandle2ConstConversion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ConversionHrefSet(ConstHandle2Conversion self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Conversion/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Conversion.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Conversion.h new file mode 100644 index 000000000..c6a1fe797 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Conversion.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Conversion is the basic handle type in this file. Example: +// // Create a default Conversion object: +// Conversion handle = ConversionDefault(); +// Functions involving Conversion are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CONVERSION +#define C_INTERFACE_GNDS_V2_0_GENERAL_CONVERSION + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ConversionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Conversion +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ConversionClass *Conversion; + +// --- Const-aware handles. +typedef const struct ConversionClass *const ConstHandle2ConstConversion; +typedef struct ConversionClass *const ConstHandle2Conversion; +typedef const struct ConversionClass * Handle2ConstConversion; +typedef struct ConversionClass * Handle2Conversion; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstConversion +ConversionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Conversion +ConversionDefault(); + +// --- Create, general, const +extern_c Handle2ConstConversion +ConversionCreateConst( + const char *const flags, + const char *const href +); + +// +++ Create, general, non-const +extern_c Handle2Conversion +ConversionCreate( + const char *const flags, + const char *const href +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ConversionAssign(ConstHandle2Conversion self, ConstHandle2ConstConversion from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ConversionDelete(ConstHandle2ConstConversion self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ConversionRead(ConstHandle2Conversion self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ConversionWrite(ConstHandle2ConstConversion self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ConversionPrint(ConstHandle2ConstConversion self); + +// +++ Print to standard output, as XML +extern_c int +ConversionPrintXML(ConstHandle2ConstConversion self); + +// +++ Print to standard output, as JSON +extern_c int +ConversionPrintJSON(ConstHandle2ConstConversion self); + + +// ----------------------------------------------------------------------------- +// Metadatum: flags +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ConversionFlagsHas(ConstHandle2ConstConversion self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ConversionFlagsGet(ConstHandle2ConstConversion self); + +// +++ Set +extern_c void +ConversionFlagsSet(ConstHandle2Conversion self, const char *const flags); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ConversionHrefHas(ConstHandle2ConstConversion self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ConversionHrefGet(ConstHandle2ConstConversion self); + +// +++ Set +extern_c void +ConversionHrefSet(ConstHandle2Conversion self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Conversion/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Conversion/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Conversion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Conversion/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Conversion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoulombPlusNuclearElastic.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoulombPlusNuclearElastic.cpp new file mode 100644 index 000000000..3aa8680ed --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoulombPlusNuclearElastic.cpp @@ -0,0 +1,442 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "CoulombPlusNuclearElastic.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CoulombPlusNuclearElasticClass; +using CPP = multigroup::CoulombPlusNuclearElastic; + +static const std::string CLASSNAME = "CoulombPlusNuclearElastic"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto href = [](auto &obj) { return &obj.href; }; + static auto pid = [](auto &obj) { return &obj.pid; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto identicalParticles = [](auto &obj) { return &obj.identicalParticles; }; + static auto RutherfordScattering = [](auto &obj) { return &obj.RutherfordScattering; }; + static auto nuclearAmplitudeExpansion = [](auto &obj) { return &obj.nuclearAmplitudeExpansion; }; + static auto nuclearPlusInterference = [](auto &obj) { return &obj.nuclearPlusInterference; }; +} + +using CPPRutherfordScattering = general::RutherfordScattering; +using CPPNuclearAmplitudeExpansion = general::NuclearAmplitudeExpansion; +using CPPNuclearPlusInterference = general::NuclearPlusInterference; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCoulombPlusNuclearElastic +CoulombPlusNuclearElasticDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2CoulombPlusNuclearElastic +CoulombPlusNuclearElasticDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCoulombPlusNuclearElastic +CoulombPlusNuclearElasticCreateConst( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + const bool identicalParticles, + ConstHandle2ConstRutherfordScattering RutherfordScattering, + ConstHandle2ConstNuclearAmplitudeExpansion nuclearAmplitudeExpansion, + ConstHandle2ConstNuclearPlusInterference nuclearPlusInterference +) { + ConstHandle2CoulombPlusNuclearElastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href, + pid, + productFrame, + identicalParticles, + detail::tocpp(RutherfordScattering), + detail::tocpp(nuclearAmplitudeExpansion), + detail::tocpp(nuclearPlusInterference) + ); + return handle; +} + +// Create, general, non-const +Handle2CoulombPlusNuclearElastic +CoulombPlusNuclearElasticCreate( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + const bool identicalParticles, + ConstHandle2ConstRutherfordScattering RutherfordScattering, + ConstHandle2ConstNuclearAmplitudeExpansion nuclearAmplitudeExpansion, + ConstHandle2ConstNuclearPlusInterference nuclearPlusInterference +) { + ConstHandle2CoulombPlusNuclearElastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + href, + pid, + productFrame, + identicalParticles, + detail::tocpp(RutherfordScattering), + detail::tocpp(nuclearAmplitudeExpansion), + detail::tocpp(nuclearPlusInterference) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CoulombPlusNuclearElasticAssign(ConstHandle2CoulombPlusNuclearElastic self, ConstHandle2ConstCoulombPlusNuclearElastic from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CoulombPlusNuclearElasticDelete(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CoulombPlusNuclearElasticRead(ConstHandle2CoulombPlusNuclearElastic self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CoulombPlusNuclearElasticWrite(ConstHandle2ConstCoulombPlusNuclearElastic self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CoulombPlusNuclearElasticPrint(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CoulombPlusNuclearElasticPrintXML(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CoulombPlusNuclearElasticPrintJSON(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticLabelHas(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +CoulombPlusNuclearElasticLabelGet(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CoulombPlusNuclearElasticLabelSet(ConstHandle2CoulombPlusNuclearElastic self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticHrefHas(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +CoulombPlusNuclearElasticHrefGet(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +CoulombPlusNuclearElasticHrefSet(ConstHandle2CoulombPlusNuclearElastic self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticPidHas(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +CoulombPlusNuclearElasticPidGet(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +CoulombPlusNuclearElasticPidSet(ConstHandle2CoulombPlusNuclearElastic self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticProductFrameHas(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +CoulombPlusNuclearElasticProductFrameGet(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +CoulombPlusNuclearElasticProductFrameSet(ConstHandle2CoulombPlusNuclearElastic self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: identicalParticles +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticIdenticalParticlesHas(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IdenticalParticlesHas", self, extract::identicalParticles); +} + +// Get +// Returns by value +bool +CoulombPlusNuclearElasticIdenticalParticlesGet(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdenticalParticlesGet", self, extract::identicalParticles); +} + +// Set +void +CoulombPlusNuclearElasticIdenticalParticlesSet(ConstHandle2CoulombPlusNuclearElastic self, const bool identicalParticles) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdenticalParticlesSet", self, extract::identicalParticles, identicalParticles); +} + + +// ----------------------------------------------------------------------------- +// Child: RutherfordScattering +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticRutherfordScatteringHas(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RutherfordScatteringHas", self, extract::RutherfordScattering); +} + +// Get, const +Handle2ConstRutherfordScattering +CoulombPlusNuclearElasticRutherfordScatteringGetConst(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RutherfordScatteringGetConst", self, extract::RutherfordScattering); +} + +// Get, non-const +Handle2RutherfordScattering +CoulombPlusNuclearElasticRutherfordScatteringGet(ConstHandle2CoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RutherfordScatteringGet", self, extract::RutherfordScattering); +} + +// Set +void +CoulombPlusNuclearElasticRutherfordScatteringSet(ConstHandle2CoulombPlusNuclearElastic self, ConstHandle2ConstRutherfordScattering RutherfordScattering) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RutherfordScatteringSet", self, extract::RutherfordScattering, RutherfordScattering); +} + + +// ----------------------------------------------------------------------------- +// Child: nuclearAmplitudeExpansion +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticNuclearAmplitudeExpansionHas(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NuclearAmplitudeExpansionHas", self, extract::nuclearAmplitudeExpansion); +} + +// Get, const +Handle2ConstNuclearAmplitudeExpansion +CoulombPlusNuclearElasticNuclearAmplitudeExpansionGetConst(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclearAmplitudeExpansionGetConst", self, extract::nuclearAmplitudeExpansion); +} + +// Get, non-const +Handle2NuclearAmplitudeExpansion +CoulombPlusNuclearElasticNuclearAmplitudeExpansionGet(ConstHandle2CoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclearAmplitudeExpansionGet", self, extract::nuclearAmplitudeExpansion); +} + +// Set +void +CoulombPlusNuclearElasticNuclearAmplitudeExpansionSet(ConstHandle2CoulombPlusNuclearElastic self, ConstHandle2ConstNuclearAmplitudeExpansion nuclearAmplitudeExpansion) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NuclearAmplitudeExpansionSet", self, extract::nuclearAmplitudeExpansion, nuclearAmplitudeExpansion); +} + + +// ----------------------------------------------------------------------------- +// Child: nuclearPlusInterference +// ----------------------------------------------------------------------------- + +// Has +int +CoulombPlusNuclearElasticNuclearPlusInterferenceHas(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NuclearPlusInterferenceHas", self, extract::nuclearPlusInterference); +} + +// Get, const +Handle2ConstNuclearPlusInterference +CoulombPlusNuclearElasticNuclearPlusInterferenceGetConst(ConstHandle2ConstCoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclearPlusInterferenceGetConst", self, extract::nuclearPlusInterference); +} + +// Get, non-const +Handle2NuclearPlusInterference +CoulombPlusNuclearElasticNuclearPlusInterferenceGet(ConstHandle2CoulombPlusNuclearElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclearPlusInterferenceGet", self, extract::nuclearPlusInterference); +} + +// Set +void +CoulombPlusNuclearElasticNuclearPlusInterferenceSet(ConstHandle2CoulombPlusNuclearElastic self, ConstHandle2ConstNuclearPlusInterference nuclearPlusInterference) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NuclearPlusInterferenceSet", self, extract::nuclearPlusInterference, nuclearPlusInterference); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CoulombPlusNuclearElastic/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoulombPlusNuclearElastic.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoulombPlusNuclearElastic.h new file mode 100644 index 000000000..3dfaf8971 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoulombPlusNuclearElastic.h @@ -0,0 +1,309 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CoulombPlusNuclearElastic is the basic handle type in this file. Example: +// // Create a default CoulombPlusNuclearElastic object: +// CoulombPlusNuclearElastic handle = CoulombPlusNuclearElasticDefault(); +// Functions involving CoulombPlusNuclearElastic are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_COULOMBPLUSNUCLEARELASTIC +#define C_INTERFACE_GNDS_V2_0_GENERAL_COULOMBPLUSNUCLEARELASTIC + +#include "GNDStk.h" +#include "v2.0/general/RutherfordScattering.h" +#include "v2.0/general/NuclearAmplitudeExpansion.h" +#include "v2.0/general/NuclearPlusInterference.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CoulombPlusNuclearElasticClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CoulombPlusNuclearElastic +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CoulombPlusNuclearElasticClass *CoulombPlusNuclearElastic; + +// --- Const-aware handles. +typedef const struct CoulombPlusNuclearElasticClass *const ConstHandle2ConstCoulombPlusNuclearElastic; +typedef struct CoulombPlusNuclearElasticClass *const ConstHandle2CoulombPlusNuclearElastic; +typedef const struct CoulombPlusNuclearElasticClass * Handle2ConstCoulombPlusNuclearElastic; +typedef struct CoulombPlusNuclearElasticClass * Handle2CoulombPlusNuclearElastic; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCoulombPlusNuclearElastic +CoulombPlusNuclearElasticDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2CoulombPlusNuclearElastic +CoulombPlusNuclearElasticDefault(); + +// --- Create, general, const +extern_c Handle2ConstCoulombPlusNuclearElastic +CoulombPlusNuclearElasticCreateConst( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + const bool identicalParticles, + ConstHandle2ConstRutherfordScattering RutherfordScattering, + ConstHandle2ConstNuclearAmplitudeExpansion nuclearAmplitudeExpansion, + ConstHandle2ConstNuclearPlusInterference nuclearPlusInterference +); + +// +++ Create, general, non-const +extern_c Handle2CoulombPlusNuclearElastic +CoulombPlusNuclearElasticCreate( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + const bool identicalParticles, + ConstHandle2ConstRutherfordScattering RutherfordScattering, + ConstHandle2ConstNuclearAmplitudeExpansion nuclearAmplitudeExpansion, + ConstHandle2ConstNuclearPlusInterference nuclearPlusInterference +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CoulombPlusNuclearElasticAssign(ConstHandle2CoulombPlusNuclearElastic self, ConstHandle2ConstCoulombPlusNuclearElastic from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CoulombPlusNuclearElasticDelete(ConstHandle2ConstCoulombPlusNuclearElastic self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CoulombPlusNuclearElasticRead(ConstHandle2CoulombPlusNuclearElastic self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CoulombPlusNuclearElasticWrite(ConstHandle2ConstCoulombPlusNuclearElastic self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CoulombPlusNuclearElasticPrint(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Print to standard output, as XML +extern_c int +CoulombPlusNuclearElasticPrintXML(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Print to standard output, as JSON +extern_c int +CoulombPlusNuclearElasticPrintJSON(ConstHandle2ConstCoulombPlusNuclearElastic self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticLabelHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CoulombPlusNuclearElasticLabelGet(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticLabelSet(ConstHandle2CoulombPlusNuclearElastic self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticHrefHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CoulombPlusNuclearElasticHrefGet(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticHrefSet(ConstHandle2CoulombPlusNuclearElastic self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticPidHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CoulombPlusNuclearElasticPidGet(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticPidSet(ConstHandle2CoulombPlusNuclearElastic self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticProductFrameHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CoulombPlusNuclearElasticProductFrameGet(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticProductFrameSet(ConstHandle2CoulombPlusNuclearElastic self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Metadatum: identicalParticles +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticIdenticalParticlesHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get +// +++ Returns by value +extern_c bool +CoulombPlusNuclearElasticIdenticalParticlesGet(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticIdenticalParticlesSet(ConstHandle2CoulombPlusNuclearElastic self, const bool identicalParticles); + + +// ----------------------------------------------------------------------------- +// Child: RutherfordScattering +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticRutherfordScatteringHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// --- Get, const +extern_c Handle2ConstRutherfordScattering +CoulombPlusNuclearElasticRutherfordScatteringGetConst(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get, non-const +extern_c Handle2RutherfordScattering +CoulombPlusNuclearElasticRutherfordScatteringGet(ConstHandle2CoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticRutherfordScatteringSet(ConstHandle2CoulombPlusNuclearElastic self, ConstHandle2ConstRutherfordScattering RutherfordScattering); + + +// ----------------------------------------------------------------------------- +// Child: nuclearAmplitudeExpansion +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticNuclearAmplitudeExpansionHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// --- Get, const +extern_c Handle2ConstNuclearAmplitudeExpansion +CoulombPlusNuclearElasticNuclearAmplitudeExpansionGetConst(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get, non-const +extern_c Handle2NuclearAmplitudeExpansion +CoulombPlusNuclearElasticNuclearAmplitudeExpansionGet(ConstHandle2CoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticNuclearAmplitudeExpansionSet(ConstHandle2CoulombPlusNuclearElastic self, ConstHandle2ConstNuclearAmplitudeExpansion nuclearAmplitudeExpansion); + + +// ----------------------------------------------------------------------------- +// Child: nuclearPlusInterference +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CoulombPlusNuclearElasticNuclearPlusInterferenceHas(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// --- Get, const +extern_c Handle2ConstNuclearPlusInterference +CoulombPlusNuclearElasticNuclearPlusInterferenceGetConst(ConstHandle2ConstCoulombPlusNuclearElastic self); + +// +++ Get, non-const +extern_c Handle2NuclearPlusInterference +CoulombPlusNuclearElasticNuclearPlusInterferenceGet(ConstHandle2CoulombPlusNuclearElastic self); + +// +++ Set +extern_c void +CoulombPlusNuclearElasticNuclearPlusInterferenceSet(ConstHandle2CoulombPlusNuclearElastic self, ConstHandle2ConstNuclearPlusInterference nuclearPlusInterference); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CoulombPlusNuclearElastic/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoulombPlusNuclearElastic/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoulombPlusNuclearElastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoulombPlusNuclearElastic/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CoulombPlusNuclearElastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Covariance.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Covariance.cpp new file mode 100644 index 000000000..96219bf68 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Covariance.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Covariance.hpp" +#include "Covariance.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CovarianceClass; +using CPP = multigroup::Covariance; + +static const std::string CLASSNAME = "Covariance"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto href = [](auto &obj) { return &obj.href; }; + static auto array = [](auto &obj) { return &obj.array; }; +} + +using CPPArray = general::Array; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovariance +CovarianceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Covariance +CovarianceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCovariance +CovarianceCreateConst( + const char *const label, + const char *const href, + ConstHandle2ConstArray array +) { + ConstHandle2Covariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href, + detail::tocpp(array) + ); + return handle; +} + +// Create, general, non-const +Handle2Covariance +CovarianceCreate( + const char *const label, + const char *const href, + ConstHandle2ConstArray array +) { + ConstHandle2Covariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + href, + detail::tocpp(array) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CovarianceAssign(ConstHandle2Covariance self, ConstHandle2ConstCovariance from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CovarianceDelete(ConstHandle2ConstCovariance self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CovarianceRead(ConstHandle2Covariance self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CovarianceWrite(ConstHandle2ConstCovariance self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CovariancePrint(ConstHandle2ConstCovariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CovariancePrintXML(ConstHandle2ConstCovariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CovariancePrintJSON(ConstHandle2ConstCovariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceLabelHas(ConstHandle2ConstCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +CovarianceLabelGet(ConstHandle2ConstCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CovarianceLabelSet(ConstHandle2Covariance self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceHrefHas(ConstHandle2ConstCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +CovarianceHrefGet(ConstHandle2ConstCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +CovarianceHrefSet(ConstHandle2Covariance self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceArrayHas(ConstHandle2ConstCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ArrayHas", self, extract::array); +} + +// Get, const +Handle2ConstArray +CovarianceArrayGetConst(ConstHandle2ConstCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGetConst", self, extract::array); +} + +// Get, non-const +Handle2Array +CovarianceArrayGet(ConstHandle2Covariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGet", self, extract::array); +} + +// Set +void +CovarianceArraySet(ConstHandle2Covariance self, ConstHandle2ConstArray array) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ArraySet", self, extract::array, array); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Covariance/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Covariance.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Covariance.h new file mode 100644 index 000000000..3a334e737 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Covariance.h @@ -0,0 +1,201 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Covariance is the basic handle type in this file. Example: +// // Create a default Covariance object: +// Covariance handle = CovarianceDefault(); +// Functions involving Covariance are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_COVARIANCE +#define C_INTERFACE_GNDS_V2_0_GENERAL_COVARIANCE + +#include "GNDStk.h" +#include "v2.0/general/Array.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CovarianceClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Covariance +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CovarianceClass *Covariance; + +// --- Const-aware handles. +typedef const struct CovarianceClass *const ConstHandle2ConstCovariance; +typedef struct CovarianceClass *const ConstHandle2Covariance; +typedef const struct CovarianceClass * Handle2ConstCovariance; +typedef struct CovarianceClass * Handle2Covariance; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCovariance +CovarianceDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Covariance +CovarianceDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovariance +CovarianceCreateConst( + const char *const label, + const char *const href, + ConstHandle2ConstArray array +); + +// +++ Create, general, non-const +extern_c Handle2Covariance +CovarianceCreate( + const char *const label, + const char *const href, + ConstHandle2ConstArray array +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CovarianceAssign(ConstHandle2Covariance self, ConstHandle2ConstCovariance from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CovarianceDelete(ConstHandle2ConstCovariance self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CovarianceRead(ConstHandle2Covariance self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CovarianceWrite(ConstHandle2ConstCovariance self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CovariancePrint(ConstHandle2ConstCovariance self); + +// +++ Print to standard output, as XML +extern_c int +CovariancePrintXML(ConstHandle2ConstCovariance self); + +// +++ Print to standard output, as JSON +extern_c int +CovariancePrintJSON(ConstHandle2ConstCovariance self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceLabelHas(ConstHandle2ConstCovariance self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceLabelGet(ConstHandle2ConstCovariance self); + +// +++ Set +extern_c void +CovarianceLabelSet(ConstHandle2Covariance self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceHrefHas(ConstHandle2ConstCovariance self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceHrefGet(ConstHandle2ConstCovariance self); + +// +++ Set +extern_c void +CovarianceHrefSet(ConstHandle2Covariance self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceArrayHas(ConstHandle2ConstCovariance self); + +// --- Get, const +extern_c Handle2ConstArray +CovarianceArrayGetConst(ConstHandle2ConstCovariance self); + +// +++ Get, non-const +extern_c Handle2Array +CovarianceArrayGet(ConstHandle2Covariance self); + +// +++ Set +extern_c void +CovarianceArraySet(ConstHandle2Covariance self, ConstHandle2ConstArray array); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Covariance/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Covariance/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Covariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Covariance/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Covariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceMatrix.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceMatrix.cpp new file mode 100644 index 000000000..4a220f714 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceMatrix.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/CovarianceMatrix.hpp" +#include "CovarianceMatrix.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CovarianceMatrixClass; +using CPP = multigroup::CovarianceMatrix; + +static const std::string CLASSNAME = "CovarianceMatrix"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto type = [](auto &obj) { return &obj.type; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto gridded2d = [](auto &obj) { return &obj.gridded2d; }; +} + +using CPPGridded2d = general::Gridded2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovarianceMatrix +CovarianceMatrixDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2CovarianceMatrix +CovarianceMatrixDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCovarianceMatrix +CovarianceMatrixCreateConst( + const char *const label, + const char *const type, + const char *const productFrame, + ConstHandle2ConstGridded2d gridded2d +) { + ConstHandle2CovarianceMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + type, + productFrame, + detail::tocpp(gridded2d) + ); + return handle; +} + +// Create, general, non-const +Handle2CovarianceMatrix +CovarianceMatrixCreate( + const char *const label, + const char *const type, + const char *const productFrame, + ConstHandle2ConstGridded2d gridded2d +) { + ConstHandle2CovarianceMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + type, + productFrame, + detail::tocpp(gridded2d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CovarianceMatrixAssign(ConstHandle2CovarianceMatrix self, ConstHandle2ConstCovarianceMatrix from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CovarianceMatrixDelete(ConstHandle2ConstCovarianceMatrix self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CovarianceMatrixRead(ConstHandle2CovarianceMatrix self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CovarianceMatrixWrite(ConstHandle2ConstCovarianceMatrix self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CovarianceMatrixPrint(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CovarianceMatrixPrintXML(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CovarianceMatrixPrintJSON(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceMatrixLabelHas(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +CovarianceMatrixLabelGet(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CovarianceMatrixLabelSet(ConstHandle2CovarianceMatrix self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceMatrixTypeHas(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TypeHas", self, extract::type); +} + +// Get +// Returns by value +const char * +CovarianceMatrixTypeGet(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypeGet", self, extract::type); +} + +// Set +void +CovarianceMatrixTypeSet(ConstHandle2CovarianceMatrix self, const char *const type) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypeSet", self, extract::type, type); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceMatrixProductFrameHas(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +CovarianceMatrixProductFrameGet(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +CovarianceMatrixProductFrameSet(ConstHandle2CovarianceMatrix self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded2d +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceMatrixGridded2dHas(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded2dHas", self, extract::gridded2d); +} + +// Get, const +Handle2ConstGridded2d +CovarianceMatrixGridded2dGetConst(ConstHandle2ConstCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded2dGetConst", self, extract::gridded2d); +} + +// Get, non-const +Handle2Gridded2d +CovarianceMatrixGridded2dGet(ConstHandle2CovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded2dGet", self, extract::gridded2d); +} + +// Set +void +CovarianceMatrixGridded2dSet(ConstHandle2CovarianceMatrix self, ConstHandle2ConstGridded2d gridded2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded2dSet", self, extract::gridded2d, gridded2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CovarianceMatrix/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceMatrix.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceMatrix.h new file mode 100644 index 000000000..00fac7476 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceMatrix.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CovarianceMatrix is the basic handle type in this file. Example: +// // Create a default CovarianceMatrix object: +// CovarianceMatrix handle = CovarianceMatrixDefault(); +// Functions involving CovarianceMatrix are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_COVARIANCEMATRIX +#define C_INTERFACE_GNDS_V2_0_GENERAL_COVARIANCEMATRIX + +#include "GNDStk.h" +#include "v2.0/general/Gridded2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CovarianceMatrixClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CovarianceMatrix +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CovarianceMatrixClass *CovarianceMatrix; + +// --- Const-aware handles. +typedef const struct CovarianceMatrixClass *const ConstHandle2ConstCovarianceMatrix; +typedef struct CovarianceMatrixClass *const ConstHandle2CovarianceMatrix; +typedef const struct CovarianceMatrixClass * Handle2ConstCovarianceMatrix; +typedef struct CovarianceMatrixClass * Handle2CovarianceMatrix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCovarianceMatrix +CovarianceMatrixDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2CovarianceMatrix +CovarianceMatrixDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovarianceMatrix +CovarianceMatrixCreateConst( + const char *const label, + const char *const type, + const char *const productFrame, + ConstHandle2ConstGridded2d gridded2d +); + +// +++ Create, general, non-const +extern_c Handle2CovarianceMatrix +CovarianceMatrixCreate( + const char *const label, + const char *const type, + const char *const productFrame, + ConstHandle2ConstGridded2d gridded2d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CovarianceMatrixAssign(ConstHandle2CovarianceMatrix self, ConstHandle2ConstCovarianceMatrix from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CovarianceMatrixDelete(ConstHandle2ConstCovarianceMatrix self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CovarianceMatrixRead(ConstHandle2CovarianceMatrix self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CovarianceMatrixWrite(ConstHandle2ConstCovarianceMatrix self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CovarianceMatrixPrint(ConstHandle2ConstCovarianceMatrix self); + +// +++ Print to standard output, as XML +extern_c int +CovarianceMatrixPrintXML(ConstHandle2ConstCovarianceMatrix self); + +// +++ Print to standard output, as JSON +extern_c int +CovarianceMatrixPrintJSON(ConstHandle2ConstCovarianceMatrix self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceMatrixLabelHas(ConstHandle2ConstCovarianceMatrix self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceMatrixLabelGet(ConstHandle2ConstCovarianceMatrix self); + +// +++ Set +extern_c void +CovarianceMatrixLabelSet(ConstHandle2CovarianceMatrix self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceMatrixTypeHas(ConstHandle2ConstCovarianceMatrix self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceMatrixTypeGet(ConstHandle2ConstCovarianceMatrix self); + +// +++ Set +extern_c void +CovarianceMatrixTypeSet(ConstHandle2CovarianceMatrix self, const char *const type); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceMatrixProductFrameHas(ConstHandle2ConstCovarianceMatrix self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceMatrixProductFrameGet(ConstHandle2ConstCovarianceMatrix self); + +// +++ Set +extern_c void +CovarianceMatrixProductFrameSet(ConstHandle2CovarianceMatrix self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Child: gridded2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceMatrixGridded2dHas(ConstHandle2ConstCovarianceMatrix self); + +// --- Get, const +extern_c Handle2ConstGridded2d +CovarianceMatrixGridded2dGetConst(ConstHandle2ConstCovarianceMatrix self); + +// +++ Get, non-const +extern_c Handle2Gridded2d +CovarianceMatrixGridded2dGet(ConstHandle2CovarianceMatrix self); + +// +++ Set +extern_c void +CovarianceMatrixGridded2dSet(ConstHandle2CovarianceMatrix self, ConstHandle2ConstGridded2d gridded2d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CovarianceMatrix/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceMatrix/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceMatrix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceMatrix/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceMatrix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSection.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSection.cpp new file mode 100644 index 000000000..49bdd5267 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSection.cpp @@ -0,0 +1,423 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/CovarianceSection.hpp" +#include "CovarianceSection.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CovarianceSectionClass; +using CPP = multigroup::CovarianceSection; + +static const std::string CLASSNAME = "CovarianceSection"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto crossTerm = [](auto &obj) { return &obj.crossTerm; }; + static auto rowData = [](auto &obj) { return &obj.rowData; }; + static auto columnData = [](auto &obj) { return &obj.columnData; }; + static auto covarianceMatrix = [](auto &obj) { return &obj.covarianceMatrix; }; + static auto mixed = [](auto &obj) { return &obj.mixed; }; + static auto sum = [](auto &obj) { return &obj.sum; }; +} + +using CPPRowData = general::RowData; +using CPPColumnData = general::ColumnData; +using CPPCovarianceMatrix = general::CovarianceMatrix; +using CPPMixed = general::Mixed; +using CPPSum = general::Sum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovarianceSection +CovarianceSectionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2CovarianceSection +CovarianceSectionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCovarianceSection +CovarianceSectionCreateConst( + const char *const label, + const bool crossTerm, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstColumnData columnData, + ConstHandle2ConstCovarianceMatrix covarianceMatrix, + ConstHandle2ConstMixed mixed, + ConstHandle2ConstSum sum +) { + ConstHandle2CovarianceSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + crossTerm, + detail::tocpp(rowData), + detail::tocpp(columnData), + detail::tocpp(covarianceMatrix), + detail::tocpp(mixed), + detail::tocpp(sum) + ); + return handle; +} + +// Create, general, non-const +Handle2CovarianceSection +CovarianceSectionCreate( + const char *const label, + const bool crossTerm, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstColumnData columnData, + ConstHandle2ConstCovarianceMatrix covarianceMatrix, + ConstHandle2ConstMixed mixed, + ConstHandle2ConstSum sum +) { + ConstHandle2CovarianceSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + crossTerm, + detail::tocpp(rowData), + detail::tocpp(columnData), + detail::tocpp(covarianceMatrix), + detail::tocpp(mixed), + detail::tocpp(sum) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CovarianceSectionAssign(ConstHandle2CovarianceSection self, ConstHandle2ConstCovarianceSection from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CovarianceSectionDelete(ConstHandle2ConstCovarianceSection self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CovarianceSectionRead(ConstHandle2CovarianceSection self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CovarianceSectionWrite(ConstHandle2ConstCovarianceSection self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CovarianceSectionPrint(ConstHandle2ConstCovarianceSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CovarianceSectionPrintXML(ConstHandle2ConstCovarianceSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CovarianceSectionPrintJSON(ConstHandle2ConstCovarianceSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSectionLabelHas(ConstHandle2ConstCovarianceSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +CovarianceSectionLabelGet(ConstHandle2ConstCovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CovarianceSectionLabelSet(ConstHandle2CovarianceSection self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: crossTerm +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSectionCrossTermHas(ConstHandle2ConstCovarianceSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossTermHas", self, extract::crossTerm); +} + +// Get +// Returns by value +bool +CovarianceSectionCrossTermGet(ConstHandle2ConstCovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossTermGet", self, extract::crossTerm); +} + +// Set +void +CovarianceSectionCrossTermSet(ConstHandle2CovarianceSection self, const bool crossTerm) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CrossTermSet", self, extract::crossTerm, crossTerm); +} + + +// ----------------------------------------------------------------------------- +// Child: rowData +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSectionRowDataHas(ConstHandle2ConstCovarianceSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RowDataHas", self, extract::rowData); +} + +// Get, const +Handle2ConstRowData +CovarianceSectionRowDataGetConst(ConstHandle2ConstCovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RowDataGetConst", self, extract::rowData); +} + +// Get, non-const +Handle2RowData +CovarianceSectionRowDataGet(ConstHandle2CovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RowDataGet", self, extract::rowData); +} + +// Set +void +CovarianceSectionRowDataSet(ConstHandle2CovarianceSection self, ConstHandle2ConstRowData rowData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RowDataSet", self, extract::rowData, rowData); +} + + +// ----------------------------------------------------------------------------- +// Child: columnData +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSectionColumnDataHas(ConstHandle2ConstCovarianceSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ColumnDataHas", self, extract::columnData); +} + +// Get, const +Handle2ConstColumnData +CovarianceSectionColumnDataGetConst(ConstHandle2ConstCovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnDataGetConst", self, extract::columnData); +} + +// Get, non-const +Handle2ColumnData +CovarianceSectionColumnDataGet(ConstHandle2CovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnDataGet", self, extract::columnData); +} + +// Set +void +CovarianceSectionColumnDataSet(ConstHandle2CovarianceSection self, ConstHandle2ConstColumnData columnData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ColumnDataSet", self, extract::columnData, columnData); +} + + +// ----------------------------------------------------------------------------- +// Child: covarianceMatrix +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSectionCovarianceMatrixHas(ConstHandle2ConstCovarianceSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CovarianceMatrixHas", self, extract::covarianceMatrix); +} + +// Get, const +Handle2ConstCovarianceMatrix +CovarianceSectionCovarianceMatrixGetConst(ConstHandle2ConstCovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetConst", self, extract::covarianceMatrix); +} + +// Get, non-const +Handle2CovarianceMatrix +CovarianceSectionCovarianceMatrixGet(ConstHandle2CovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceMatrixGet", self, extract::covarianceMatrix); +} + +// Set +void +CovarianceSectionCovarianceMatrixSet(ConstHandle2CovarianceSection self, ConstHandle2ConstCovarianceMatrix covarianceMatrix) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CovarianceMatrixSet", self, extract::covarianceMatrix, covarianceMatrix); +} + + +// ----------------------------------------------------------------------------- +// Child: mixed +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSectionMixedHas(ConstHandle2ConstCovarianceSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MixedHas", self, extract::mixed); +} + +// Get, const +Handle2ConstMixed +CovarianceSectionMixedGetConst(ConstHandle2ConstCovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MixedGetConst", self, extract::mixed); +} + +// Get, non-const +Handle2Mixed +CovarianceSectionMixedGet(ConstHandle2CovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MixedGet", self, extract::mixed); +} + +// Set +void +CovarianceSectionMixedSet(ConstHandle2CovarianceSection self, ConstHandle2ConstMixed mixed) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MixedSet", self, extract::mixed, mixed); +} + + +// ----------------------------------------------------------------------------- +// Child: sum +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSectionSumHas(ConstHandle2ConstCovarianceSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SumHas", self, extract::sum); +} + +// Get, const +Handle2ConstSum +CovarianceSectionSumGetConst(ConstHandle2ConstCovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SumGetConst", self, extract::sum); +} + +// Get, non-const +Handle2Sum +CovarianceSectionSumGet(ConstHandle2CovarianceSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SumGet", self, extract::sum); +} + +// Set +void +CovarianceSectionSumSet(ConstHandle2CovarianceSection self, ConstHandle2ConstSum sum) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SumSet", self, extract::sum, sum); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CovarianceSection/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSection.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSection.h new file mode 100644 index 000000000..261a92ce8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSection.h @@ -0,0 +1,297 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CovarianceSection is the basic handle type in this file. Example: +// // Create a default CovarianceSection object: +// CovarianceSection handle = CovarianceSectionDefault(); +// Functions involving CovarianceSection are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_COVARIANCESECTION +#define C_INTERFACE_GNDS_V2_0_GENERAL_COVARIANCESECTION + +#include "GNDStk.h" +#include "v2.0/general/RowData.h" +#include "v2.0/general/ColumnData.h" +#include "v2.0/general/CovarianceMatrix.h" +#include "v2.0/general/Mixed.h" +#include "v2.0/general/Sum.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CovarianceSectionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CovarianceSection +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CovarianceSectionClass *CovarianceSection; + +// --- Const-aware handles. +typedef const struct CovarianceSectionClass *const ConstHandle2ConstCovarianceSection; +typedef struct CovarianceSectionClass *const ConstHandle2CovarianceSection; +typedef const struct CovarianceSectionClass * Handle2ConstCovarianceSection; +typedef struct CovarianceSectionClass * Handle2CovarianceSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCovarianceSection +CovarianceSectionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2CovarianceSection +CovarianceSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovarianceSection +CovarianceSectionCreateConst( + const char *const label, + const bool crossTerm, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstColumnData columnData, + ConstHandle2ConstCovarianceMatrix covarianceMatrix, + ConstHandle2ConstMixed mixed, + ConstHandle2ConstSum sum +); + +// +++ Create, general, non-const +extern_c Handle2CovarianceSection +CovarianceSectionCreate( + const char *const label, + const bool crossTerm, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstColumnData columnData, + ConstHandle2ConstCovarianceMatrix covarianceMatrix, + ConstHandle2ConstMixed mixed, + ConstHandle2ConstSum sum +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CovarianceSectionAssign(ConstHandle2CovarianceSection self, ConstHandle2ConstCovarianceSection from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CovarianceSectionDelete(ConstHandle2ConstCovarianceSection self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CovarianceSectionRead(ConstHandle2CovarianceSection self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CovarianceSectionWrite(ConstHandle2ConstCovarianceSection self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CovarianceSectionPrint(ConstHandle2ConstCovarianceSection self); + +// +++ Print to standard output, as XML +extern_c int +CovarianceSectionPrintXML(ConstHandle2ConstCovarianceSection self); + +// +++ Print to standard output, as JSON +extern_c int +CovarianceSectionPrintJSON(ConstHandle2ConstCovarianceSection self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSectionLabelHas(ConstHandle2ConstCovarianceSection self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceSectionLabelGet(ConstHandle2ConstCovarianceSection self); + +// +++ Set +extern_c void +CovarianceSectionLabelSet(ConstHandle2CovarianceSection self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: crossTerm +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSectionCrossTermHas(ConstHandle2ConstCovarianceSection self); + +// +++ Get +// +++ Returns by value +extern_c bool +CovarianceSectionCrossTermGet(ConstHandle2ConstCovarianceSection self); + +// +++ Set +extern_c void +CovarianceSectionCrossTermSet(ConstHandle2CovarianceSection self, const bool crossTerm); + + +// ----------------------------------------------------------------------------- +// Child: rowData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSectionRowDataHas(ConstHandle2ConstCovarianceSection self); + +// --- Get, const +extern_c Handle2ConstRowData +CovarianceSectionRowDataGetConst(ConstHandle2ConstCovarianceSection self); + +// +++ Get, non-const +extern_c Handle2RowData +CovarianceSectionRowDataGet(ConstHandle2CovarianceSection self); + +// +++ Set +extern_c void +CovarianceSectionRowDataSet(ConstHandle2CovarianceSection self, ConstHandle2ConstRowData rowData); + + +// ----------------------------------------------------------------------------- +// Child: columnData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSectionColumnDataHas(ConstHandle2ConstCovarianceSection self); + +// --- Get, const +extern_c Handle2ConstColumnData +CovarianceSectionColumnDataGetConst(ConstHandle2ConstCovarianceSection self); + +// +++ Get, non-const +extern_c Handle2ColumnData +CovarianceSectionColumnDataGet(ConstHandle2CovarianceSection self); + +// +++ Set +extern_c void +CovarianceSectionColumnDataSet(ConstHandle2CovarianceSection self, ConstHandle2ConstColumnData columnData); + + +// ----------------------------------------------------------------------------- +// Child: covarianceMatrix +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSectionCovarianceMatrixHas(ConstHandle2ConstCovarianceSection self); + +// --- Get, const +extern_c Handle2ConstCovarianceMatrix +CovarianceSectionCovarianceMatrixGetConst(ConstHandle2ConstCovarianceSection self); + +// +++ Get, non-const +extern_c Handle2CovarianceMatrix +CovarianceSectionCovarianceMatrixGet(ConstHandle2CovarianceSection self); + +// +++ Set +extern_c void +CovarianceSectionCovarianceMatrixSet(ConstHandle2CovarianceSection self, ConstHandle2ConstCovarianceMatrix covarianceMatrix); + + +// ----------------------------------------------------------------------------- +// Child: mixed +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSectionMixedHas(ConstHandle2ConstCovarianceSection self); + +// --- Get, const +extern_c Handle2ConstMixed +CovarianceSectionMixedGetConst(ConstHandle2ConstCovarianceSection self); + +// +++ Get, non-const +extern_c Handle2Mixed +CovarianceSectionMixedGet(ConstHandle2CovarianceSection self); + +// +++ Set +extern_c void +CovarianceSectionMixedSet(ConstHandle2CovarianceSection self, ConstHandle2ConstMixed mixed); + + +// ----------------------------------------------------------------------------- +// Child: sum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSectionSumHas(ConstHandle2ConstCovarianceSection self); + +// --- Get, const +extern_c Handle2ConstSum +CovarianceSectionSumGetConst(ConstHandle2ConstCovarianceSection self); + +// +++ Get, non-const +extern_c Handle2Sum +CovarianceSectionSumGet(ConstHandle2CovarianceSection self); + +// +++ Set +extern_c void +CovarianceSectionSumSet(ConstHandle2CovarianceSection self, ConstHandle2ConstSum sum); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CovarianceSection/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSection/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSection/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSections.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSections.cpp new file mode 100644 index 000000000..dd104fc72 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSections.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/CovarianceSections.hpp" +#include "CovarianceSections.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CovarianceSectionsClass; +using CPP = multigroup::CovarianceSections; + +static const std::string CLASSNAME = "CovarianceSections"; + +namespace extract { + static auto covarianceSection = [](auto &obj) { return &obj.covarianceSection; }; +} + +using CPPCovarianceSection = general::CovarianceSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovarianceSections +CovarianceSectionsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2CovarianceSections +CovarianceSectionsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCovarianceSections +CovarianceSectionsCreateConst( + ConstHandle2CovarianceSection *const covarianceSection, const size_t covarianceSectionSize +) { + ConstHandle2CovarianceSections handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t CovarianceSectionN = 0; CovarianceSectionN < covarianceSectionSize; ++CovarianceSectionN) + CovarianceSectionsCovarianceSectionAdd(handle, covarianceSection[CovarianceSectionN]); + return handle; +} + +// Create, general, non-const +Handle2CovarianceSections +CovarianceSectionsCreate( + ConstHandle2CovarianceSection *const covarianceSection, const size_t covarianceSectionSize +) { + ConstHandle2CovarianceSections handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t CovarianceSectionN = 0; CovarianceSectionN < covarianceSectionSize; ++CovarianceSectionN) + CovarianceSectionsCovarianceSectionAdd(handle, covarianceSection[CovarianceSectionN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CovarianceSectionsAssign(ConstHandle2CovarianceSections self, ConstHandle2ConstCovarianceSections from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CovarianceSectionsDelete(ConstHandle2ConstCovarianceSections self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CovarianceSectionsRead(ConstHandle2CovarianceSections self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CovarianceSectionsWrite(ConstHandle2ConstCovarianceSections self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CovarianceSectionsPrint(ConstHandle2ConstCovarianceSections self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CovarianceSectionsPrintXML(ConstHandle2ConstCovarianceSections self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CovarianceSectionsPrintJSON(ConstHandle2ConstCovarianceSections self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: covarianceSection +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSectionsCovarianceSectionHas(ConstHandle2ConstCovarianceSections self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CovarianceSectionHas", self, extract::covarianceSection); +} + +// Clear +void +CovarianceSectionsCovarianceSectionClear(ConstHandle2CovarianceSections self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"CovarianceSectionClear", self, extract::covarianceSection); +} + +// Size +size_t +CovarianceSectionsCovarianceSectionSize(ConstHandle2ConstCovarianceSections self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"CovarianceSectionSize", self, extract::covarianceSection); +} + +// Add +void +CovarianceSectionsCovarianceSectionAdd(ConstHandle2CovarianceSections self, ConstHandle2ConstCovarianceSection covarianceSection) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"CovarianceSectionAdd", self, extract::covarianceSection, covarianceSection); +} + +// Get, by index \in [0,size), const +Handle2ConstCovarianceSection +CovarianceSectionsCovarianceSectionGetConst(ConstHandle2ConstCovarianceSections self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CovarianceSectionGetConst", self, extract::covarianceSection, index_); +} + +// Get, by index \in [0,size), non-const +Handle2CovarianceSection +CovarianceSectionsCovarianceSectionGet(ConstHandle2CovarianceSections self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CovarianceSectionGet", self, extract::covarianceSection, index_); +} + +// Set, by index \in [0,size) +void +CovarianceSectionsCovarianceSectionSet( + ConstHandle2CovarianceSections self, + const size_t index_, + ConstHandle2ConstCovarianceSection covarianceSection +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"CovarianceSectionSet", self, extract::covarianceSection, index_, covarianceSection); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +CovarianceSectionsCovarianceSectionHasByLabel( + ConstHandle2ConstCovarianceSections self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionHasByLabel", + self, extract::covarianceSection, meta::label, label); +} + +// Get, by label, const +Handle2ConstCovarianceSection +CovarianceSectionsCovarianceSectionGetByLabelConst( + ConstHandle2ConstCovarianceSections self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionGetByLabelConst", + self, extract::covarianceSection, meta::label, label); +} + +// Get, by label, non-const +Handle2CovarianceSection +CovarianceSectionsCovarianceSectionGetByLabel( + ConstHandle2CovarianceSections self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionGetByLabel", + self, extract::covarianceSection, meta::label, label); +} + +// Set, by label +void +CovarianceSectionsCovarianceSectionSetByLabel( + ConstHandle2CovarianceSections self, + const char *const label, + ConstHandle2ConstCovarianceSection covarianceSection +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionSetByLabel", + self, extract::covarianceSection, meta::label, label, covarianceSection); +} + +// ------------------------ +// Re: metadatum crossTerm +// ------------------------ + +// Has, by crossTerm +int +CovarianceSectionsCovarianceSectionHasByCrossTerm( + ConstHandle2ConstCovarianceSections self, + const bool crossTerm +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionHasByCrossTerm", + self, extract::covarianceSection, meta::crossTerm, crossTerm); +} + +// Get, by crossTerm, const +Handle2ConstCovarianceSection +CovarianceSectionsCovarianceSectionGetByCrossTermConst( + ConstHandle2ConstCovarianceSections self, + const bool crossTerm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionGetByCrossTermConst", + self, extract::covarianceSection, meta::crossTerm, crossTerm); +} + +// Get, by crossTerm, non-const +Handle2CovarianceSection +CovarianceSectionsCovarianceSectionGetByCrossTerm( + ConstHandle2CovarianceSections self, + const bool crossTerm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionGetByCrossTerm", + self, extract::covarianceSection, meta::crossTerm, crossTerm); +} + +// Set, by crossTerm +void +CovarianceSectionsCovarianceSectionSetByCrossTerm( + ConstHandle2CovarianceSections self, + const bool crossTerm, + ConstHandle2ConstCovarianceSection covarianceSection +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSectionSetByCrossTerm", + self, extract::covarianceSection, meta::crossTerm, crossTerm, covarianceSection); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CovarianceSections/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSections.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSections.h new file mode 100644 index 000000000..1b9be753d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSections.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CovarianceSections is the basic handle type in this file. Example: +// // Create a default CovarianceSections object: +// CovarianceSections handle = CovarianceSectionsDefault(); +// Functions involving CovarianceSections are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_COVARIANCESECTIONS +#define C_INTERFACE_GNDS_V2_0_GENERAL_COVARIANCESECTIONS + +#include "GNDStk.h" +#include "v2.0/general/CovarianceSection.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CovarianceSectionsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CovarianceSections +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CovarianceSectionsClass *CovarianceSections; + +// --- Const-aware handles. +typedef const struct CovarianceSectionsClass *const ConstHandle2ConstCovarianceSections; +typedef struct CovarianceSectionsClass *const ConstHandle2CovarianceSections; +typedef const struct CovarianceSectionsClass * Handle2ConstCovarianceSections; +typedef struct CovarianceSectionsClass * Handle2CovarianceSections; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCovarianceSections +CovarianceSectionsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2CovarianceSections +CovarianceSectionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovarianceSections +CovarianceSectionsCreateConst( + ConstHandle2CovarianceSection *const covarianceSection, const size_t covarianceSectionSize +); + +// +++ Create, general, non-const +extern_c Handle2CovarianceSections +CovarianceSectionsCreate( + ConstHandle2CovarianceSection *const covarianceSection, const size_t covarianceSectionSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CovarianceSectionsAssign(ConstHandle2CovarianceSections self, ConstHandle2ConstCovarianceSections from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CovarianceSectionsDelete(ConstHandle2ConstCovarianceSections self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CovarianceSectionsRead(ConstHandle2CovarianceSections self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CovarianceSectionsWrite(ConstHandle2ConstCovarianceSections self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CovarianceSectionsPrint(ConstHandle2ConstCovarianceSections self); + +// +++ Print to standard output, as XML +extern_c int +CovarianceSectionsPrintXML(ConstHandle2ConstCovarianceSections self); + +// +++ Print to standard output, as JSON +extern_c int +CovarianceSectionsPrintJSON(ConstHandle2ConstCovarianceSections self); + + +// ----------------------------------------------------------------------------- +// Child: covarianceSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSectionsCovarianceSectionHas(ConstHandle2ConstCovarianceSections self); + +// +++ Clear +extern_c void +CovarianceSectionsCovarianceSectionClear(ConstHandle2CovarianceSections self); + +// +++ Size +extern_c size_t +CovarianceSectionsCovarianceSectionSize(ConstHandle2ConstCovarianceSections self); + +// +++ Add +extern_c void +CovarianceSectionsCovarianceSectionAdd(ConstHandle2CovarianceSections self, ConstHandle2ConstCovarianceSection covarianceSection); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstCovarianceSection +CovarianceSectionsCovarianceSectionGetConst(ConstHandle2ConstCovarianceSections self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2CovarianceSection +CovarianceSectionsCovarianceSectionGet(ConstHandle2CovarianceSections self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +CovarianceSectionsCovarianceSectionSet( + ConstHandle2CovarianceSections self, + const size_t index_, + ConstHandle2ConstCovarianceSection covarianceSection +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +CovarianceSectionsCovarianceSectionHasByLabel( + ConstHandle2ConstCovarianceSections self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstCovarianceSection +CovarianceSectionsCovarianceSectionGetByLabelConst( + ConstHandle2ConstCovarianceSections self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2CovarianceSection +CovarianceSectionsCovarianceSectionGetByLabel( + ConstHandle2CovarianceSections self, + const char *const label +); + +// +++ Set, by label +extern_c void +CovarianceSectionsCovarianceSectionSetByLabel( + ConstHandle2CovarianceSections self, + const char *const label, + ConstHandle2ConstCovarianceSection covarianceSection +); + +// ------------------------ +// Re: metadatum crossTerm +// ------------------------ + +// +++ Has, by crossTerm +extern_c int +CovarianceSectionsCovarianceSectionHasByCrossTerm( + ConstHandle2ConstCovarianceSections self, + const bool crossTerm +); + +// --- Get, by crossTerm, const +extern_c Handle2ConstCovarianceSection +CovarianceSectionsCovarianceSectionGetByCrossTermConst( + ConstHandle2ConstCovarianceSections self, + const bool crossTerm +); + +// +++ Get, by crossTerm, non-const +extern_c Handle2CovarianceSection +CovarianceSectionsCovarianceSectionGetByCrossTerm( + ConstHandle2CovarianceSections self, + const bool crossTerm +); + +// +++ Set, by crossTerm +extern_c void +CovarianceSectionsCovarianceSectionSetByCrossTerm( + ConstHandle2CovarianceSections self, + const bool crossTerm, + ConstHandle2ConstCovarianceSection covarianceSection +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CovarianceSections/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSections/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSections/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSections/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CovarianceSections/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSection.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSection.cpp new file mode 100644 index 000000000..5b1bf5068 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSection.cpp @@ -0,0 +1,396 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/CrossSection.hpp" +#include "CrossSection.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CrossSectionClass; +using CPP = multigroup::CrossSection; + +static const std::string CLASSNAME = "CrossSection"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; + static auto reference = [](auto &obj) { return &obj.reference; }; + static auto resonancesWithBackground = [](auto &obj) { return &obj.resonancesWithBackground; }; + static auto CoulombPlusNuclearElastic = [](auto &obj) { return &obj.CoulombPlusNuclearElastic; }; + static auto thermalNeutronScatteringLaw1d = [](auto &obj) { return &obj.thermalNeutronScatteringLaw1d; }; +} + +using CPPXYs1d = general::XYs1d; +using CPPRegions1d = general::Regions1d; +using CPPReference = general::Reference; +using CPPResonancesWithBackground = general::ResonancesWithBackground; +using CPPCoulombPlusNuclearElastic = general::CoulombPlusNuclearElastic; +using CPPThermalNeutronScatteringLaw1d = general::ThermalNeutronScatteringLaw1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCrossSection +CrossSectionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2CrossSection +CrossSectionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCrossSection +CrossSectionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstReference reference, + ConstHandle2ConstResonancesWithBackground resonancesWithBackground, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstThermalNeutronScatteringLaw1d thermalNeutronScatteringLaw1d +) { + ConstHandle2CrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d), + detail::tocpp(reference), + detail::tocpp(resonancesWithBackground), + detail::tocpp(CoulombPlusNuclearElastic), + detail::tocpp(thermalNeutronScatteringLaw1d) + ); + return handle; +} + +// Create, general, non-const +Handle2CrossSection +CrossSectionCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstReference reference, + ConstHandle2ConstResonancesWithBackground resonancesWithBackground, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstThermalNeutronScatteringLaw1d thermalNeutronScatteringLaw1d +) { + ConstHandle2CrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(regions1d), + detail::tocpp(reference), + detail::tocpp(resonancesWithBackground), + detail::tocpp(CoulombPlusNuclearElastic), + detail::tocpp(thermalNeutronScatteringLaw1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CrossSectionAssign(ConstHandle2CrossSection self, ConstHandle2ConstCrossSection from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CrossSectionDelete(ConstHandle2ConstCrossSection self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CrossSectionRead(ConstHandle2CrossSection self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CrossSectionWrite(ConstHandle2ConstCrossSection self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CrossSectionPrint(ConstHandle2ConstCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CrossSectionPrintXML(ConstHandle2ConstCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CrossSectionPrintJSON(ConstHandle2ConstCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionXYs1dHas(ConstHandle2ConstCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +CrossSectionXYs1dGetConst(ConstHandle2ConstCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +CrossSectionXYs1dGet(ConstHandle2CrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +CrossSectionXYs1dSet(ConstHandle2CrossSection self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionRegions1dHas(ConstHandle2ConstCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +CrossSectionRegions1dGetConst(ConstHandle2ConstCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +CrossSectionRegions1dGet(ConstHandle2CrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +CrossSectionRegions1dSet(ConstHandle2CrossSection self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Child: reference +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionReferenceHas(ConstHandle2ConstCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ReferenceHas", self, extract::reference); +} + +// Get, const +Handle2ConstReference +CrossSectionReferenceGetConst(ConstHandle2ConstCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReferenceGetConst", self, extract::reference); +} + +// Get, non-const +Handle2Reference +CrossSectionReferenceGet(ConstHandle2CrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReferenceGet", self, extract::reference); +} + +// Set +void +CrossSectionReferenceSet(ConstHandle2CrossSection self, ConstHandle2ConstReference reference) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ReferenceSet", self, extract::reference, reference); +} + + +// ----------------------------------------------------------------------------- +// Child: resonancesWithBackground +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionResonancesWithBackgroundHas(ConstHandle2ConstCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResonancesWithBackgroundHas", self, extract::resonancesWithBackground); +} + +// Get, const +Handle2ConstResonancesWithBackground +CrossSectionResonancesWithBackgroundGetConst(ConstHandle2ConstCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonancesWithBackgroundGetConst", self, extract::resonancesWithBackground); +} + +// Get, non-const +Handle2ResonancesWithBackground +CrossSectionResonancesWithBackgroundGet(ConstHandle2CrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonancesWithBackgroundGet", self, extract::resonancesWithBackground); +} + +// Set +void +CrossSectionResonancesWithBackgroundSet(ConstHandle2CrossSection self, ConstHandle2ConstResonancesWithBackground resonancesWithBackground) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResonancesWithBackgroundSet", self, extract::resonancesWithBackground, resonancesWithBackground); +} + + +// ----------------------------------------------------------------------------- +// Child: CoulombPlusNuclearElastic +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionCoulombPlusNuclearElasticHas(ConstHandle2ConstCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticHas", self, extract::CoulombPlusNuclearElastic); +} + +// Get, const +Handle2ConstCoulombPlusNuclearElastic +CrossSectionCoulombPlusNuclearElasticGetConst(ConstHandle2ConstCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticGetConst", self, extract::CoulombPlusNuclearElastic); +} + +// Get, non-const +Handle2CoulombPlusNuclearElastic +CrossSectionCoulombPlusNuclearElasticGet(ConstHandle2CrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticGet", self, extract::CoulombPlusNuclearElastic); +} + +// Set +void +CrossSectionCoulombPlusNuclearElasticSet(ConstHandle2CrossSection self, ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticSet", self, extract::CoulombPlusNuclearElastic, CoulombPlusNuclearElastic); +} + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw1d +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionThermalNeutronScatteringLaw1dHas(ConstHandle2ConstCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw1dHas", self, extract::thermalNeutronScatteringLaw1d); +} + +// Get, const +Handle2ConstThermalNeutronScatteringLaw1d +CrossSectionThermalNeutronScatteringLaw1dGetConst(ConstHandle2ConstCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw1dGetConst", self, extract::thermalNeutronScatteringLaw1d); +} + +// Get, non-const +Handle2ThermalNeutronScatteringLaw1d +CrossSectionThermalNeutronScatteringLaw1dGet(ConstHandle2CrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw1dGet", self, extract::thermalNeutronScatteringLaw1d); +} + +// Set +void +CrossSectionThermalNeutronScatteringLaw1dSet(ConstHandle2CrossSection self, ConstHandle2ConstThermalNeutronScatteringLaw1d thermalNeutronScatteringLaw1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw1dSet", self, extract::thermalNeutronScatteringLaw1d, thermalNeutronScatteringLaw1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CrossSection/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSection.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSection.h new file mode 100644 index 000000000..4abfae34b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSection.h @@ -0,0 +1,281 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CrossSection is the basic handle type in this file. Example: +// // Create a default CrossSection object: +// CrossSection handle = CrossSectionDefault(); +// Functions involving CrossSection are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CROSSSECTION +#define C_INTERFACE_GNDS_V2_0_GENERAL_CROSSSECTION + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/Regions1d.h" +#include "v2.0/general/Reference.h" +#include "v2.0/general/ResonancesWithBackground.h" +#include "v2.0/general/CoulombPlusNuclearElastic.h" +#include "v2.0/general/ThermalNeutronScatteringLaw1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CrossSectionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CrossSection +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CrossSectionClass *CrossSection; + +// --- Const-aware handles. +typedef const struct CrossSectionClass *const ConstHandle2ConstCrossSection; +typedef struct CrossSectionClass *const ConstHandle2CrossSection; +typedef const struct CrossSectionClass * Handle2ConstCrossSection; +typedef struct CrossSectionClass * Handle2CrossSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCrossSection +CrossSectionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2CrossSection +CrossSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstCrossSection +CrossSectionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstReference reference, + ConstHandle2ConstResonancesWithBackground resonancesWithBackground, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstThermalNeutronScatteringLaw1d thermalNeutronScatteringLaw1d +); + +// +++ Create, general, non-const +extern_c Handle2CrossSection +CrossSectionCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstReference reference, + ConstHandle2ConstResonancesWithBackground resonancesWithBackground, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstThermalNeutronScatteringLaw1d thermalNeutronScatteringLaw1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CrossSectionAssign(ConstHandle2CrossSection self, ConstHandle2ConstCrossSection from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CrossSectionDelete(ConstHandle2ConstCrossSection self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CrossSectionRead(ConstHandle2CrossSection self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CrossSectionWrite(ConstHandle2ConstCrossSection self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CrossSectionPrint(ConstHandle2ConstCrossSection self); + +// +++ Print to standard output, as XML +extern_c int +CrossSectionPrintXML(ConstHandle2ConstCrossSection self); + +// +++ Print to standard output, as JSON +extern_c int +CrossSectionPrintJSON(ConstHandle2ConstCrossSection self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionXYs1dHas(ConstHandle2ConstCrossSection self); + +// --- Get, const +extern_c Handle2ConstXYs1d +CrossSectionXYs1dGetConst(ConstHandle2ConstCrossSection self); + +// +++ Get, non-const +extern_c Handle2XYs1d +CrossSectionXYs1dGet(ConstHandle2CrossSection self); + +// +++ Set +extern_c void +CrossSectionXYs1dSet(ConstHandle2CrossSection self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionRegions1dHas(ConstHandle2ConstCrossSection self); + +// --- Get, const +extern_c Handle2ConstRegions1d +CrossSectionRegions1dGetConst(ConstHandle2ConstCrossSection self); + +// +++ Get, non-const +extern_c Handle2Regions1d +CrossSectionRegions1dGet(ConstHandle2CrossSection self); + +// +++ Set +extern_c void +CrossSectionRegions1dSet(ConstHandle2CrossSection self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Child: reference +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionReferenceHas(ConstHandle2ConstCrossSection self); + +// --- Get, const +extern_c Handle2ConstReference +CrossSectionReferenceGetConst(ConstHandle2ConstCrossSection self); + +// +++ Get, non-const +extern_c Handle2Reference +CrossSectionReferenceGet(ConstHandle2CrossSection self); + +// +++ Set +extern_c void +CrossSectionReferenceSet(ConstHandle2CrossSection self, ConstHandle2ConstReference reference); + + +// ----------------------------------------------------------------------------- +// Child: resonancesWithBackground +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionResonancesWithBackgroundHas(ConstHandle2ConstCrossSection self); + +// --- Get, const +extern_c Handle2ConstResonancesWithBackground +CrossSectionResonancesWithBackgroundGetConst(ConstHandle2ConstCrossSection self); + +// +++ Get, non-const +extern_c Handle2ResonancesWithBackground +CrossSectionResonancesWithBackgroundGet(ConstHandle2CrossSection self); + +// +++ Set +extern_c void +CrossSectionResonancesWithBackgroundSet(ConstHandle2CrossSection self, ConstHandle2ConstResonancesWithBackground resonancesWithBackground); + + +// ----------------------------------------------------------------------------- +// Child: CoulombPlusNuclearElastic +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionCoulombPlusNuclearElasticHas(ConstHandle2ConstCrossSection self); + +// --- Get, const +extern_c Handle2ConstCoulombPlusNuclearElastic +CrossSectionCoulombPlusNuclearElasticGetConst(ConstHandle2ConstCrossSection self); + +// +++ Get, non-const +extern_c Handle2CoulombPlusNuclearElastic +CrossSectionCoulombPlusNuclearElasticGet(ConstHandle2CrossSection self); + +// +++ Set +extern_c void +CrossSectionCoulombPlusNuclearElasticSet(ConstHandle2CrossSection self, ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic); + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionThermalNeutronScatteringLaw1dHas(ConstHandle2ConstCrossSection self); + +// --- Get, const +extern_c Handle2ConstThermalNeutronScatteringLaw1d +CrossSectionThermalNeutronScatteringLaw1dGetConst(ConstHandle2ConstCrossSection self); + +// +++ Get, non-const +extern_c Handle2ThermalNeutronScatteringLaw1d +CrossSectionThermalNeutronScatteringLaw1dGet(ConstHandle2CrossSection self); + +// +++ Set +extern_c void +CrossSectionThermalNeutronScatteringLaw1dSet(ConstHandle2CrossSection self, ConstHandle2ConstThermalNeutronScatteringLaw1d thermalNeutronScatteringLaw1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CrossSection/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSection/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSection/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionReconstructed.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionReconstructed.cpp new file mode 100644 index 000000000..753e932e1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionReconstructed.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/CrossSectionReconstructed.hpp" +#include "CrossSectionReconstructed.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CrossSectionReconstructedClass; +using CPP = multigroup::CrossSectionReconstructed; + +static const std::string CLASSNAME = "CrossSectionReconstructed"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto derivedFrom = [](auto &obj) { return &obj.derivedFrom; }; + static auto date = [](auto &obj) { return &obj.date; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCrossSectionReconstructed +CrossSectionReconstructedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2CrossSectionReconstructed +CrossSectionReconstructedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCrossSectionReconstructed +CrossSectionReconstructedCreateConst( + const char *const label, + const char *const derivedFrom, + const char *const date +) { + ConstHandle2CrossSectionReconstructed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + derivedFrom, + date + ); + return handle; +} + +// Create, general, non-const +Handle2CrossSectionReconstructed +CrossSectionReconstructedCreate( + const char *const label, + const char *const derivedFrom, + const char *const date +) { + ConstHandle2CrossSectionReconstructed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + derivedFrom, + date + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CrossSectionReconstructedAssign(ConstHandle2CrossSectionReconstructed self, ConstHandle2ConstCrossSectionReconstructed from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CrossSectionReconstructedDelete(ConstHandle2ConstCrossSectionReconstructed self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CrossSectionReconstructedRead(ConstHandle2CrossSectionReconstructed self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CrossSectionReconstructedWrite(ConstHandle2ConstCrossSectionReconstructed self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CrossSectionReconstructedPrint(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CrossSectionReconstructedPrintXML(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CrossSectionReconstructedPrintJSON(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionReconstructedLabelHas(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +CrossSectionReconstructedLabelGet(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CrossSectionReconstructedLabelSet(ConstHandle2CrossSectionReconstructed self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionReconstructedDerivedFromHas(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DerivedFromHas", self, extract::derivedFrom); +} + +// Get +// Returns by value +const char * +CrossSectionReconstructedDerivedFromGet(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DerivedFromGet", self, extract::derivedFrom); +} + +// Set +void +CrossSectionReconstructedDerivedFromSet(ConstHandle2CrossSectionReconstructed self, const char *const derivedFrom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DerivedFromSet", self, extract::derivedFrom, derivedFrom); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionReconstructedDateHas(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +CrossSectionReconstructedDateGet(ConstHandle2ConstCrossSectionReconstructed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +CrossSectionReconstructedDateSet(ConstHandle2CrossSectionReconstructed self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CrossSectionReconstructed/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionReconstructed.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionReconstructed.h new file mode 100644 index 000000000..18c949cd6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionReconstructed.h @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CrossSectionReconstructed is the basic handle type in this file. Example: +// // Create a default CrossSectionReconstructed object: +// CrossSectionReconstructed handle = CrossSectionReconstructedDefault(); +// Functions involving CrossSectionReconstructed are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CROSSSECTIONRECONSTRUCTED +#define C_INTERFACE_GNDS_V2_0_GENERAL_CROSSSECTIONRECONSTRUCTED + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CrossSectionReconstructedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CrossSectionReconstructed +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CrossSectionReconstructedClass *CrossSectionReconstructed; + +// --- Const-aware handles. +typedef const struct CrossSectionReconstructedClass *const ConstHandle2ConstCrossSectionReconstructed; +typedef struct CrossSectionReconstructedClass *const ConstHandle2CrossSectionReconstructed; +typedef const struct CrossSectionReconstructedClass * Handle2ConstCrossSectionReconstructed; +typedef struct CrossSectionReconstructedClass * Handle2CrossSectionReconstructed; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCrossSectionReconstructed +CrossSectionReconstructedDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2CrossSectionReconstructed +CrossSectionReconstructedDefault(); + +// --- Create, general, const +extern_c Handle2ConstCrossSectionReconstructed +CrossSectionReconstructedCreateConst( + const char *const label, + const char *const derivedFrom, + const char *const date +); + +// +++ Create, general, non-const +extern_c Handle2CrossSectionReconstructed +CrossSectionReconstructedCreate( + const char *const label, + const char *const derivedFrom, + const char *const date +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CrossSectionReconstructedAssign(ConstHandle2CrossSectionReconstructed self, ConstHandle2ConstCrossSectionReconstructed from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CrossSectionReconstructedDelete(ConstHandle2ConstCrossSectionReconstructed self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CrossSectionReconstructedRead(ConstHandle2CrossSectionReconstructed self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CrossSectionReconstructedWrite(ConstHandle2ConstCrossSectionReconstructed self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CrossSectionReconstructedPrint(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Print to standard output, as XML +extern_c int +CrossSectionReconstructedPrintXML(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Print to standard output, as JSON +extern_c int +CrossSectionReconstructedPrintJSON(ConstHandle2ConstCrossSectionReconstructed self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionReconstructedLabelHas(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CrossSectionReconstructedLabelGet(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Set +extern_c void +CrossSectionReconstructedLabelSet(ConstHandle2CrossSectionReconstructed self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: derivedFrom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionReconstructedDerivedFromHas(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CrossSectionReconstructedDerivedFromGet(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Set +extern_c void +CrossSectionReconstructedDerivedFromSet(ConstHandle2CrossSectionReconstructed self, const char *const derivedFrom); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionReconstructedDateHas(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CrossSectionReconstructedDateGet(ConstHandle2ConstCrossSectionReconstructed self); + +// +++ Set +extern_c void +CrossSectionReconstructedDateSet(ConstHandle2CrossSectionReconstructed self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CrossSectionReconstructed/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionReconstructed/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionReconstructed/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionReconstructed/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionReconstructed/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSum.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSum.cpp new file mode 100644 index 000000000..89159b824 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSum.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/CrossSectionSum.hpp" +#include "CrossSectionSum.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CrossSectionSumClass; +using CPP = multigroup::CrossSectionSum; + +static const std::string CLASSNAME = "CrossSectionSum"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto ENDF_MT = [](auto &obj) { return &obj.ENDF_MT; }; + static auto summands = [](auto &obj) { return &obj.summands; }; + static auto Q = [](auto &obj) { return &obj.Q; }; + static auto crossSection = [](auto &obj) { return &obj.crossSection; }; +} + +using CPPSummands = general::Summands; +using CPPQ = general::Q; +using CPPCrossSection = general::CrossSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCrossSectionSum +CrossSectionSumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2CrossSectionSum +CrossSectionSumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCrossSectionSum +CrossSectionSumCreateConst( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstSummands summands, + ConstHandle2ConstQ Q, + ConstHandle2ConstCrossSection crossSection +) { + ConstHandle2CrossSectionSum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + ENDF_MT, + detail::tocpp(summands), + detail::tocpp(Q), + detail::tocpp(crossSection) + ); + return handle; +} + +// Create, general, non-const +Handle2CrossSectionSum +CrossSectionSumCreate( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstSummands summands, + ConstHandle2ConstQ Q, + ConstHandle2ConstCrossSection crossSection +) { + ConstHandle2CrossSectionSum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + ENDF_MT, + detail::tocpp(summands), + detail::tocpp(Q), + detail::tocpp(crossSection) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CrossSectionSumAssign(ConstHandle2CrossSectionSum self, ConstHandle2ConstCrossSectionSum from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CrossSectionSumDelete(ConstHandle2ConstCrossSectionSum self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CrossSectionSumRead(ConstHandle2CrossSectionSum self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CrossSectionSumWrite(ConstHandle2ConstCrossSectionSum self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CrossSectionSumPrint(ConstHandle2ConstCrossSectionSum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CrossSectionSumPrintXML(ConstHandle2ConstCrossSectionSum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CrossSectionSumPrintJSON(ConstHandle2ConstCrossSectionSum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionSumLabelHas(ConstHandle2ConstCrossSectionSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +CrossSectionSumLabelGet(ConstHandle2ConstCrossSectionSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +CrossSectionSumLabelSet(ConstHandle2CrossSectionSum self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionSumENDFMTHas(ConstHandle2ConstCrossSectionSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +int +CrossSectionSumENDFMTGet(ConstHandle2ConstCrossSectionSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +CrossSectionSumENDFMTSet(ConstHandle2CrossSectionSum self, const int ENDF_MT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMTSet", self, extract::ENDF_MT, ENDF_MT); +} + + +// ----------------------------------------------------------------------------- +// Child: summands +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionSumSummandsHas(ConstHandle2ConstCrossSectionSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SummandsHas", self, extract::summands); +} + +// Get, const +Handle2ConstSummands +CrossSectionSumSummandsGetConst(ConstHandle2ConstCrossSectionSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SummandsGetConst", self, extract::summands); +} + +// Get, non-const +Handle2Summands +CrossSectionSumSummandsGet(ConstHandle2CrossSectionSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SummandsGet", self, extract::summands); +} + +// Set +void +CrossSectionSumSummandsSet(ConstHandle2CrossSectionSum self, ConstHandle2ConstSummands summands) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SummandsSet", self, extract::summands, summands); +} + + +// ----------------------------------------------------------------------------- +// Child: Q +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionSumQHas(ConstHandle2ConstCrossSectionSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"QHas", self, extract::Q); +} + +// Get, const +Handle2ConstQ +CrossSectionSumQGetConst(ConstHandle2ConstCrossSectionSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"QGetConst", self, extract::Q); +} + +// Get, non-const +Handle2Q +CrossSectionSumQGet(ConstHandle2CrossSectionSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"QGet", self, extract::Q); +} + +// Set +void +CrossSectionSumQSet(ConstHandle2CrossSectionSum self, ConstHandle2ConstQ Q) +{ + detail::setField + (CLASSNAME, CLASSNAME+"QSet", self, extract::Q, Q); +} + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionSumCrossSectionHas(ConstHandle2ConstCrossSectionSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossSectionHas", self, extract::crossSection); +} + +// Get, const +Handle2ConstCrossSection +CrossSectionSumCrossSectionGetConst(ConstHandle2ConstCrossSectionSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGetConst", self, extract::crossSection); +} + +// Get, non-const +Handle2CrossSection +CrossSectionSumCrossSectionGet(ConstHandle2CrossSectionSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGet", self, extract::crossSection); +} + +// Set +void +CrossSectionSumCrossSectionSet(ConstHandle2CrossSectionSum self, ConstHandle2ConstCrossSection crossSection) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CrossSectionSet", self, extract::crossSection, crossSection); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CrossSectionSum/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSum.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSum.h new file mode 100644 index 000000000..d79ec69b7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSum.h @@ -0,0 +1,249 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CrossSectionSum is the basic handle type in this file. Example: +// // Create a default CrossSectionSum object: +// CrossSectionSum handle = CrossSectionSumDefault(); +// Functions involving CrossSectionSum are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CROSSSECTIONSUM +#define C_INTERFACE_GNDS_V2_0_GENERAL_CROSSSECTIONSUM + +#include "GNDStk.h" +#include "v2.0/general/Summands.h" +#include "v2.0/general/Q.h" +#include "v2.0/general/CrossSection.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CrossSectionSumClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CrossSectionSum +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CrossSectionSumClass *CrossSectionSum; + +// --- Const-aware handles. +typedef const struct CrossSectionSumClass *const ConstHandle2ConstCrossSectionSum; +typedef struct CrossSectionSumClass *const ConstHandle2CrossSectionSum; +typedef const struct CrossSectionSumClass * Handle2ConstCrossSectionSum; +typedef struct CrossSectionSumClass * Handle2CrossSectionSum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCrossSectionSum +CrossSectionSumDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2CrossSectionSum +CrossSectionSumDefault(); + +// --- Create, general, const +extern_c Handle2ConstCrossSectionSum +CrossSectionSumCreateConst( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstSummands summands, + ConstHandle2ConstQ Q, + ConstHandle2ConstCrossSection crossSection +); + +// +++ Create, general, non-const +extern_c Handle2CrossSectionSum +CrossSectionSumCreate( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstSummands summands, + ConstHandle2ConstQ Q, + ConstHandle2ConstCrossSection crossSection +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CrossSectionSumAssign(ConstHandle2CrossSectionSum self, ConstHandle2ConstCrossSectionSum from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CrossSectionSumDelete(ConstHandle2ConstCrossSectionSum self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CrossSectionSumRead(ConstHandle2CrossSectionSum self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CrossSectionSumWrite(ConstHandle2ConstCrossSectionSum self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CrossSectionSumPrint(ConstHandle2ConstCrossSectionSum self); + +// +++ Print to standard output, as XML +extern_c int +CrossSectionSumPrintXML(ConstHandle2ConstCrossSectionSum self); + +// +++ Print to standard output, as JSON +extern_c int +CrossSectionSumPrintJSON(ConstHandle2ConstCrossSectionSum self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionSumLabelHas(ConstHandle2ConstCrossSectionSum self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CrossSectionSumLabelGet(ConstHandle2ConstCrossSectionSum self); + +// +++ Set +extern_c void +CrossSectionSumLabelSet(ConstHandle2CrossSectionSum self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionSumENDFMTHas(ConstHandle2ConstCrossSectionSum self); + +// +++ Get +// +++ Returns by value +extern_c int +CrossSectionSumENDFMTGet(ConstHandle2ConstCrossSectionSum self); + +// +++ Set +extern_c void +CrossSectionSumENDFMTSet(ConstHandle2CrossSectionSum self, const int ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Child: summands +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionSumSummandsHas(ConstHandle2ConstCrossSectionSum self); + +// --- Get, const +extern_c Handle2ConstSummands +CrossSectionSumSummandsGetConst(ConstHandle2ConstCrossSectionSum self); + +// +++ Get, non-const +extern_c Handle2Summands +CrossSectionSumSummandsGet(ConstHandle2CrossSectionSum self); + +// +++ Set +extern_c void +CrossSectionSumSummandsSet(ConstHandle2CrossSectionSum self, ConstHandle2ConstSummands summands); + + +// ----------------------------------------------------------------------------- +// Child: Q +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionSumQHas(ConstHandle2ConstCrossSectionSum self); + +// --- Get, const +extern_c Handle2ConstQ +CrossSectionSumQGetConst(ConstHandle2ConstCrossSectionSum self); + +// +++ Get, non-const +extern_c Handle2Q +CrossSectionSumQGet(ConstHandle2CrossSectionSum self); + +// +++ Set +extern_c void +CrossSectionSumQSet(ConstHandle2CrossSectionSum self, ConstHandle2ConstQ Q); + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionSumCrossSectionHas(ConstHandle2ConstCrossSectionSum self); + +// --- Get, const +extern_c Handle2ConstCrossSection +CrossSectionSumCrossSectionGetConst(ConstHandle2ConstCrossSectionSum self); + +// +++ Get, non-const +extern_c Handle2CrossSection +CrossSectionSumCrossSectionGet(ConstHandle2CrossSectionSum self); + +// +++ Set +extern_c void +CrossSectionSumCrossSectionSet(ConstHandle2CrossSectionSum self, ConstHandle2ConstCrossSection crossSection); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CrossSectionSum/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSum/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSum/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSums.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSums.cpp new file mode 100644 index 000000000..d8be3cb64 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSums.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/CrossSectionSums.hpp" +#include "CrossSectionSums.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CrossSectionSumsClass; +using CPP = multigroup::CrossSectionSums; + +static const std::string CLASSNAME = "CrossSectionSums"; + +namespace extract { + static auto crossSectionSum = [](auto &obj) { return &obj.crossSectionSum; }; +} + +using CPPCrossSectionSum = general::CrossSectionSum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCrossSectionSums +CrossSectionSumsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2CrossSectionSums +CrossSectionSumsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCrossSectionSums +CrossSectionSumsCreateConst( + ConstHandle2CrossSectionSum *const crossSectionSum, const size_t crossSectionSumSize +) { + ConstHandle2CrossSectionSums handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t CrossSectionSumN = 0; CrossSectionSumN < crossSectionSumSize; ++CrossSectionSumN) + CrossSectionSumsCrossSectionSumAdd(handle, crossSectionSum[CrossSectionSumN]); + return handle; +} + +// Create, general, non-const +Handle2CrossSectionSums +CrossSectionSumsCreate( + ConstHandle2CrossSectionSum *const crossSectionSum, const size_t crossSectionSumSize +) { + ConstHandle2CrossSectionSums handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t CrossSectionSumN = 0; CrossSectionSumN < crossSectionSumSize; ++CrossSectionSumN) + CrossSectionSumsCrossSectionSumAdd(handle, crossSectionSum[CrossSectionSumN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CrossSectionSumsAssign(ConstHandle2CrossSectionSums self, ConstHandle2ConstCrossSectionSums from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CrossSectionSumsDelete(ConstHandle2ConstCrossSectionSums self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CrossSectionSumsRead(ConstHandle2CrossSectionSums self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CrossSectionSumsWrite(ConstHandle2ConstCrossSectionSums self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CrossSectionSumsPrint(ConstHandle2ConstCrossSectionSums self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CrossSectionSumsPrintXML(ConstHandle2ConstCrossSectionSums self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CrossSectionSumsPrintJSON(ConstHandle2ConstCrossSectionSums self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: crossSectionSum +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionSumsCrossSectionSumHas(ConstHandle2ConstCrossSectionSums self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossSectionSumHas", self, extract::crossSectionSum); +} + +// Clear +void +CrossSectionSumsCrossSectionSumClear(ConstHandle2CrossSectionSums self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"CrossSectionSumClear", self, extract::crossSectionSum); +} + +// Size +size_t +CrossSectionSumsCrossSectionSumSize(ConstHandle2ConstCrossSectionSums self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"CrossSectionSumSize", self, extract::crossSectionSum); +} + +// Add +void +CrossSectionSumsCrossSectionSumAdd(ConstHandle2CrossSectionSums self, ConstHandle2ConstCrossSectionSum crossSectionSum) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"CrossSectionSumAdd", self, extract::crossSectionSum, crossSectionSum); +} + +// Get, by index \in [0,size), const +Handle2ConstCrossSectionSum +CrossSectionSumsCrossSectionSumGetConst(ConstHandle2ConstCrossSectionSums self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CrossSectionSumGetConst", self, extract::crossSectionSum, index_); +} + +// Get, by index \in [0,size), non-const +Handle2CrossSectionSum +CrossSectionSumsCrossSectionSumGet(ConstHandle2CrossSectionSums self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CrossSectionSumGet", self, extract::crossSectionSum, index_); +} + +// Set, by index \in [0,size) +void +CrossSectionSumsCrossSectionSumSet( + ConstHandle2CrossSectionSums self, + const size_t index_, + ConstHandle2ConstCrossSectionSum crossSectionSum +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"CrossSectionSumSet", self, extract::crossSectionSum, index_, crossSectionSum); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +CrossSectionSumsCrossSectionSumHasByLabel( + ConstHandle2ConstCrossSectionSums self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumHasByLabel", + self, extract::crossSectionSum, meta::label, label); +} + +// Get, by label, const +Handle2ConstCrossSectionSum +CrossSectionSumsCrossSectionSumGetByLabelConst( + ConstHandle2ConstCrossSectionSums self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumGetByLabelConst", + self, extract::crossSectionSum, meta::label, label); +} + +// Get, by label, non-const +Handle2CrossSectionSum +CrossSectionSumsCrossSectionSumGetByLabel( + ConstHandle2CrossSectionSums self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumGetByLabel", + self, extract::crossSectionSum, meta::label, label); +} + +// Set, by label +void +CrossSectionSumsCrossSectionSumSetByLabel( + ConstHandle2CrossSectionSums self, + const char *const label, + ConstHandle2ConstCrossSectionSum crossSectionSum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumSetByLabel", + self, extract::crossSectionSum, meta::label, label, crossSectionSum); +} + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// Has, by ENDF_MT +int +CrossSectionSumsCrossSectionSumHasByENDFMT( + ConstHandle2ConstCrossSectionSums self, + const int ENDF_MT +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumHasByENDFMT", + self, extract::crossSectionSum, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, const +Handle2ConstCrossSectionSum +CrossSectionSumsCrossSectionSumGetByENDFMTConst( + ConstHandle2ConstCrossSectionSums self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumGetByENDFMTConst", + self, extract::crossSectionSum, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, non-const +Handle2CrossSectionSum +CrossSectionSumsCrossSectionSumGetByENDFMT( + ConstHandle2CrossSectionSums self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumGetByENDFMT", + self, extract::crossSectionSum, meta::ENDF_MT, ENDF_MT); +} + +// Set, by ENDF_MT +void +CrossSectionSumsCrossSectionSumSetByENDFMT( + ConstHandle2CrossSectionSums self, + const int ENDF_MT, + ConstHandle2ConstCrossSectionSum crossSectionSum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CrossSectionSumSetByENDFMT", + self, extract::crossSectionSum, meta::ENDF_MT, ENDF_MT, crossSectionSum); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CrossSectionSums/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSums.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSums.h new file mode 100644 index 000000000..7febda0ac --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSums.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CrossSectionSums is the basic handle type in this file. Example: +// // Create a default CrossSectionSums object: +// CrossSectionSums handle = CrossSectionSumsDefault(); +// Functions involving CrossSectionSums are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_CROSSSECTIONSUMS +#define C_INTERFACE_GNDS_V2_0_GENERAL_CROSSSECTIONSUMS + +#include "GNDStk.h" +#include "v2.0/general/CrossSectionSum.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CrossSectionSumsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CrossSectionSums +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CrossSectionSumsClass *CrossSectionSums; + +// --- Const-aware handles. +typedef const struct CrossSectionSumsClass *const ConstHandle2ConstCrossSectionSums; +typedef struct CrossSectionSumsClass *const ConstHandle2CrossSectionSums; +typedef const struct CrossSectionSumsClass * Handle2ConstCrossSectionSums; +typedef struct CrossSectionSumsClass * Handle2CrossSectionSums; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCrossSectionSums +CrossSectionSumsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2CrossSectionSums +CrossSectionSumsDefault(); + +// --- Create, general, const +extern_c Handle2ConstCrossSectionSums +CrossSectionSumsCreateConst( + ConstHandle2CrossSectionSum *const crossSectionSum, const size_t crossSectionSumSize +); + +// +++ Create, general, non-const +extern_c Handle2CrossSectionSums +CrossSectionSumsCreate( + ConstHandle2CrossSectionSum *const crossSectionSum, const size_t crossSectionSumSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CrossSectionSumsAssign(ConstHandle2CrossSectionSums self, ConstHandle2ConstCrossSectionSums from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CrossSectionSumsDelete(ConstHandle2ConstCrossSectionSums self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CrossSectionSumsRead(ConstHandle2CrossSectionSums self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CrossSectionSumsWrite(ConstHandle2ConstCrossSectionSums self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CrossSectionSumsPrint(ConstHandle2ConstCrossSectionSums self); + +// +++ Print to standard output, as XML +extern_c int +CrossSectionSumsPrintXML(ConstHandle2ConstCrossSectionSums self); + +// +++ Print to standard output, as JSON +extern_c int +CrossSectionSumsPrintJSON(ConstHandle2ConstCrossSectionSums self); + + +// ----------------------------------------------------------------------------- +// Child: crossSectionSum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionSumsCrossSectionSumHas(ConstHandle2ConstCrossSectionSums self); + +// +++ Clear +extern_c void +CrossSectionSumsCrossSectionSumClear(ConstHandle2CrossSectionSums self); + +// +++ Size +extern_c size_t +CrossSectionSumsCrossSectionSumSize(ConstHandle2ConstCrossSectionSums self); + +// +++ Add +extern_c void +CrossSectionSumsCrossSectionSumAdd(ConstHandle2CrossSectionSums self, ConstHandle2ConstCrossSectionSum crossSectionSum); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstCrossSectionSum +CrossSectionSumsCrossSectionSumGetConst(ConstHandle2ConstCrossSectionSums self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2CrossSectionSum +CrossSectionSumsCrossSectionSumGet(ConstHandle2CrossSectionSums self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +CrossSectionSumsCrossSectionSumSet( + ConstHandle2CrossSectionSums self, + const size_t index_, + ConstHandle2ConstCrossSectionSum crossSectionSum +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +CrossSectionSumsCrossSectionSumHasByLabel( + ConstHandle2ConstCrossSectionSums self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstCrossSectionSum +CrossSectionSumsCrossSectionSumGetByLabelConst( + ConstHandle2ConstCrossSectionSums self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2CrossSectionSum +CrossSectionSumsCrossSectionSumGetByLabel( + ConstHandle2CrossSectionSums self, + const char *const label +); + +// +++ Set, by label +extern_c void +CrossSectionSumsCrossSectionSumSetByLabel( + ConstHandle2CrossSectionSums self, + const char *const label, + ConstHandle2ConstCrossSectionSum crossSectionSum +); + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// +++ Has, by ENDF_MT +extern_c int +CrossSectionSumsCrossSectionSumHasByENDFMT( + ConstHandle2ConstCrossSectionSums self, + const int ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstCrossSectionSum +CrossSectionSumsCrossSectionSumGetByENDFMTConst( + ConstHandle2ConstCrossSectionSums self, + const int ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2CrossSectionSum +CrossSectionSumsCrossSectionSumGetByENDFMT( + ConstHandle2CrossSectionSums self, + const int ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +CrossSectionSumsCrossSectionSumSetByENDFMT( + ConstHandle2CrossSectionSums self, + const int ENDF_MT, + ConstHandle2ConstCrossSectionSum crossSectionSum +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/CrossSectionSums/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSums/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSums/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSums/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/CrossSectionSums/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Data.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Data.cpp new file mode 100644 index 000000000..2f5d9d266 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Data.cpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Data.hpp" +#include "Data.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DataClass; +using CPP = multigroup::Data; + +static const std::string CLASSNAME = "Data"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstData +DataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Data +DataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstData +DataCreateConst() +{ + ConstHandle2Data handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general, non-const +Handle2Data +DataCreate() +{ + ConstHandle2Data handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create" + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DataAssign(ConstHandle2Data self, ConstHandle2ConstData from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DataDelete(ConstHandle2ConstData self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DataRead(ConstHandle2Data self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DataWrite(ConstHandle2ConstData self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DataPrint(ConstHandle2ConstData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DataPrintXML(ConstHandle2ConstData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DataPrintJSON(ConstHandle2ConstData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// Clear +void +DataDoublesClear(ConstHandle2Data self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +DataDoublesSize(ConstHandle2ConstData self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +DataDoublesGet(ConstHandle2ConstData self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +DataDoublesSet(ConstHandle2Data self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +DataDoublesGetArrayConst(ConstHandle2ConstData self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +DataDoublesGetArray(ConstHandle2Data self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +DataDoublesSetArray(ConstHandle2Data self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Data/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Data.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Data.h new file mode 100644 index 000000000..a33eefe9c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Data.h @@ -0,0 +1,170 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Data is the basic handle type in this file. Example: +// // Create a default Data object: +// Data handle = DataDefault(); +// Functions involving Data are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DATA +#define C_INTERFACE_GNDS_V2_0_GENERAL_DATA + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DataClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Data +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DataClass *Data; + +// --- Const-aware handles. +typedef const struct DataClass *const ConstHandle2ConstData; +typedef struct DataClass *const ConstHandle2Data; +typedef const struct DataClass * Handle2ConstData; +typedef struct DataClass * Handle2Data; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstData +DataDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Data +DataDefault(); + +// --- Create, general, const +extern_c Handle2ConstData +DataCreateConst(); + +// +++ Create, general, non-const +extern_c Handle2Data +DataCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DataAssign(ConstHandle2Data self, ConstHandle2ConstData from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DataDelete(ConstHandle2ConstData self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DataRead(ConstHandle2Data self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DataWrite(ConstHandle2ConstData self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DataPrint(ConstHandle2ConstData self); + +// +++ Print to standard output, as XML +extern_c int +DataPrintXML(ConstHandle2ConstData self); + +// +++ Print to standard output, as JSON +extern_c int +DataPrintJSON(ConstHandle2ConstData self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// +++ Clear +extern_c void +DataDoublesClear(ConstHandle2Data self); + +// +++ Get size +extern_c size_t +DataDoublesSize(ConstHandle2ConstData self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +DataDoublesGet(ConstHandle2ConstData self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +DataDoublesSet(ConstHandle2Data self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +DataDoublesGetArrayConst(ConstHandle2ConstData self); + +// +++ Get pointer to existing values, non-const +extern_c double * +DataDoublesGetArray(ConstHandle2Data self); + +// +++ Set completely new values and size +extern_c void +DataDoublesSetArray(ConstHandle2Data self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Data/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Data/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Data/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Data/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Data/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Date.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Date.cpp new file mode 100644 index 000000000..b076fd62a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Date.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Date.hpp" +#include "Date.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DateClass; +using CPP = multigroup::Date; + +static const std::string CLASSNAME = "Date"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto dateType = [](auto &obj) { return &obj.dateType; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDate +DateDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Date +DateDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDate +DateCreateConst( + const char *const value, + const char *const dateType +) { + ConstHandle2Date handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + dateType + ); + return handle; +} + +// Create, general, non-const +Handle2Date +DateCreate( + const char *const value, + const char *const dateType +) { + ConstHandle2Date handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + dateType + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DateAssign(ConstHandle2Date self, ConstHandle2ConstDate from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DateDelete(ConstHandle2ConstDate self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DateRead(ConstHandle2Date self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DateWrite(ConstHandle2ConstDate self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DatePrint(ConstHandle2ConstDate self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DatePrintXML(ConstHandle2ConstDate self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DatePrintJSON(ConstHandle2ConstDate self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +DateValueHas(ConstHandle2ConstDate self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +const char * +DateValueGet(ConstHandle2ConstDate self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +DateValueSet(ConstHandle2Date self, const char *const value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: dateType +// ----------------------------------------------------------------------------- + +// Has +int +DateDateTypeHas(ConstHandle2ConstDate self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateTypeHas", self, extract::dateType); +} + +// Get +// Returns by value +const char * +DateDateTypeGet(ConstHandle2ConstDate self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateTypeGet", self, extract::dateType); +} + +// Set +void +DateDateTypeSet(ConstHandle2Date self, const char *const dateType) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateTypeSet", self, extract::dateType, dateType); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Date/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Date.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Date.h new file mode 100644 index 000000000..d531baefd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Date.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Date is the basic handle type in this file. Example: +// // Create a default Date object: +// Date handle = DateDefault(); +// Functions involving Date are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DATE +#define C_INTERFACE_GNDS_V2_0_GENERAL_DATE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DateClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Date +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DateClass *Date; + +// --- Const-aware handles. +typedef const struct DateClass *const ConstHandle2ConstDate; +typedef struct DateClass *const ConstHandle2Date; +typedef const struct DateClass * Handle2ConstDate; +typedef struct DateClass * Handle2Date; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDate +DateDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Date +DateDefault(); + +// --- Create, general, const +extern_c Handle2ConstDate +DateCreateConst( + const char *const value, + const char *const dateType +); + +// +++ Create, general, non-const +extern_c Handle2Date +DateCreate( + const char *const value, + const char *const dateType +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DateAssign(ConstHandle2Date self, ConstHandle2ConstDate from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DateDelete(ConstHandle2ConstDate self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DateRead(ConstHandle2Date self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DateWrite(ConstHandle2ConstDate self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DatePrint(ConstHandle2ConstDate self); + +// +++ Print to standard output, as XML +extern_c int +DatePrintXML(ConstHandle2ConstDate self); + +// +++ Print to standard output, as JSON +extern_c int +DatePrintJSON(ConstHandle2ConstDate self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DateValueHas(ConstHandle2ConstDate self); + +// +++ Get +// +++ Returns by value +extern_c const char * +DateValueGet(ConstHandle2ConstDate self); + +// +++ Set +extern_c void +DateValueSet(ConstHandle2Date self, const char *const value); + + +// ----------------------------------------------------------------------------- +// Metadatum: dateType +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DateDateTypeHas(ConstHandle2ConstDate self); + +// +++ Get +// +++ Returns by value +extern_c const char * +DateDateTypeGet(ConstHandle2ConstDate self); + +// +++ Set +extern_c void +DateDateTypeSet(ConstHandle2Date self, const char *const dateType); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Date/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Date/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Date/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Date/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Date/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Dates.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Dates.cpp new file mode 100644 index 000000000..d3c6c7c12 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Dates.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Dates.hpp" +#include "Dates.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DatesClass; +using CPP = multigroup::Dates; + +static const std::string CLASSNAME = "Dates"; + +namespace extract { + static auto date = [](auto &obj) { return &obj.date; }; +} + +using CPPDate = general::Date; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDates +DatesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Dates +DatesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDates +DatesCreateConst( + ConstHandle2Date *const date, const size_t dateSize +) { + ConstHandle2Dates handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t DateN = 0; DateN < dateSize; ++DateN) + DatesDateAdd(handle, date[DateN]); + return handle; +} + +// Create, general, non-const +Handle2Dates +DatesCreate( + ConstHandle2Date *const date, const size_t dateSize +) { + ConstHandle2Dates handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t DateN = 0; DateN < dateSize; ++DateN) + DatesDateAdd(handle, date[DateN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DatesAssign(ConstHandle2Dates self, ConstHandle2ConstDates from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DatesDelete(ConstHandle2ConstDates self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DatesRead(ConstHandle2Dates self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DatesWrite(ConstHandle2ConstDates self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DatesPrint(ConstHandle2ConstDates self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DatesPrintXML(ConstHandle2ConstDates self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DatesPrintJSON(ConstHandle2ConstDates self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: date +// ----------------------------------------------------------------------------- + +// Has +int +DatesDateHas(ConstHandle2ConstDates self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Clear +void +DatesDateClear(ConstHandle2Dates self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DateClear", self, extract::date); +} + +// Size +size_t +DatesDateSize(ConstHandle2ConstDates self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DateSize", self, extract::date); +} + +// Add +void +DatesDateAdd(ConstHandle2Dates self, ConstHandle2ConstDate date) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DateAdd", self, extract::date, date); +} + +// Get, by index \in [0,size), const +Handle2ConstDate +DatesDateGetConst(ConstHandle2ConstDates self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DateGetConst", self, extract::date, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Date +DatesDateGet(ConstHandle2Dates self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date, index_); +} + +// Set, by index \in [0,size) +void +DatesDateSet( + ConstHandle2Dates self, + const size_t index_, + ConstHandle2ConstDate date +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, index_, date); +} + +// ------------------------ +// Re: metadatum value +// ------------------------ + +// Has, by value +int +DatesDateHasByValue( + ConstHandle2ConstDates self, + const char *const value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DateHasByValue", + self, extract::date, meta::value, value); +} + +// Get, by value, const +Handle2ConstDate +DatesDateGetByValueConst( + ConstHandle2ConstDates self, + const char *const value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DateGetByValueConst", + self, extract::date, meta::value, value); +} + +// Get, by value, non-const +Handle2Date +DatesDateGetByValue( + ConstHandle2Dates self, + const char *const value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DateGetByValue", + self, extract::date, meta::value, value); +} + +// Set, by value +void +DatesDateSetByValue( + ConstHandle2Dates self, + const char *const value, + ConstHandle2ConstDate date +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DateSetByValue", + self, extract::date, meta::value, value, date); +} + +// ------------------------ +// Re: metadatum dateType +// ------------------------ + +// Has, by dateType +int +DatesDateHasByDateType( + ConstHandle2ConstDates self, + const char *const dateType +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DateHasByDateType", + self, extract::date, meta::dateType, dateType); +} + +// Get, by dateType, const +Handle2ConstDate +DatesDateGetByDateTypeConst( + ConstHandle2ConstDates self, + const char *const dateType +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DateGetByDateTypeConst", + self, extract::date, meta::dateType, dateType); +} + +// Get, by dateType, non-const +Handle2Date +DatesDateGetByDateType( + ConstHandle2Dates self, + const char *const dateType +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DateGetByDateType", + self, extract::date, meta::dateType, dateType); +} + +// Set, by dateType +void +DatesDateSetByDateType( + ConstHandle2Dates self, + const char *const dateType, + ConstHandle2ConstDate date +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DateSetByDateType", + self, extract::date, meta::dateType, dateType, date); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Dates/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Dates.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Dates.h new file mode 100644 index 000000000..de3caa637 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Dates.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Dates is the basic handle type in this file. Example: +// // Create a default Dates object: +// Dates handle = DatesDefault(); +// Functions involving Dates are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DATES +#define C_INTERFACE_GNDS_V2_0_GENERAL_DATES + +#include "GNDStk.h" +#include "v2.0/general/Date.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DatesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Dates +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DatesClass *Dates; + +// --- Const-aware handles. +typedef const struct DatesClass *const ConstHandle2ConstDates; +typedef struct DatesClass *const ConstHandle2Dates; +typedef const struct DatesClass * Handle2ConstDates; +typedef struct DatesClass * Handle2Dates; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDates +DatesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Dates +DatesDefault(); + +// --- Create, general, const +extern_c Handle2ConstDates +DatesCreateConst( + ConstHandle2Date *const date, const size_t dateSize +); + +// +++ Create, general, non-const +extern_c Handle2Dates +DatesCreate( + ConstHandle2Date *const date, const size_t dateSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DatesAssign(ConstHandle2Dates self, ConstHandle2ConstDates from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DatesDelete(ConstHandle2ConstDates self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DatesRead(ConstHandle2Dates self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DatesWrite(ConstHandle2ConstDates self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DatesPrint(ConstHandle2ConstDates self); + +// +++ Print to standard output, as XML +extern_c int +DatesPrintXML(ConstHandle2ConstDates self); + +// +++ Print to standard output, as JSON +extern_c int +DatesPrintJSON(ConstHandle2ConstDates self); + + +// ----------------------------------------------------------------------------- +// Child: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DatesDateHas(ConstHandle2ConstDates self); + +// +++ Clear +extern_c void +DatesDateClear(ConstHandle2Dates self); + +// +++ Size +extern_c size_t +DatesDateSize(ConstHandle2ConstDates self); + +// +++ Add +extern_c void +DatesDateAdd(ConstHandle2Dates self, ConstHandle2ConstDate date); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDate +DatesDateGetConst(ConstHandle2ConstDates self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Date +DatesDateGet(ConstHandle2Dates self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +DatesDateSet( + ConstHandle2Dates self, + const size_t index_, + ConstHandle2ConstDate date +); + +// ------------------------ +// Re: metadatum value +// ------------------------ + +// +++ Has, by value +extern_c int +DatesDateHasByValue( + ConstHandle2ConstDates self, + const char *const value +); + +// --- Get, by value, const +extern_c Handle2ConstDate +DatesDateGetByValueConst( + ConstHandle2ConstDates self, + const char *const value +); + +// +++ Get, by value, non-const +extern_c Handle2Date +DatesDateGetByValue( + ConstHandle2Dates self, + const char *const value +); + +// +++ Set, by value +extern_c void +DatesDateSetByValue( + ConstHandle2Dates self, + const char *const value, + ConstHandle2ConstDate date +); + +// ------------------------ +// Re: metadatum dateType +// ------------------------ + +// +++ Has, by dateType +extern_c int +DatesDateHasByDateType( + ConstHandle2ConstDates self, + const char *const dateType +); + +// --- Get, by dateType, const +extern_c Handle2ConstDate +DatesDateGetByDateTypeConst( + ConstHandle2ConstDates self, + const char *const dateType +); + +// +++ Get, by dateType, non-const +extern_c Handle2Date +DatesDateGetByDateType( + ConstHandle2Dates self, + const char *const dateType +); + +// +++ Set, by dateType +extern_c void +DatesDateSetByDateType( + ConstHandle2Dates self, + const char *const dateType, + ConstHandle2ConstDate date +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Dates/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Dates/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Dates/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Dates/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Dates/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DebyeWallerIntegral.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DebyeWallerIntegral.cpp new file mode 100644 index 000000000..8d0e814ff --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DebyeWallerIntegral.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DebyeWallerIntegral.hpp" +#include "DebyeWallerIntegral.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DebyeWallerIntegralClass; +using CPP = multigroup::DebyeWallerIntegral; + +static const std::string CLASSNAME = "DebyeWallerIntegral"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDebyeWallerIntegral +DebyeWallerIntegralDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DebyeWallerIntegral +DebyeWallerIntegralDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDebyeWallerIntegral +DebyeWallerIntegralCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2DebyeWallerIntegral handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2DebyeWallerIntegral +DebyeWallerIntegralCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2DebyeWallerIntegral handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DebyeWallerIntegralAssign(ConstHandle2DebyeWallerIntegral self, ConstHandle2ConstDebyeWallerIntegral from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DebyeWallerIntegralDelete(ConstHandle2ConstDebyeWallerIntegral self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DebyeWallerIntegralRead(ConstHandle2DebyeWallerIntegral self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DebyeWallerIntegralWrite(ConstHandle2ConstDebyeWallerIntegral self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DebyeWallerIntegralPrint(ConstHandle2ConstDebyeWallerIntegral self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DebyeWallerIntegralPrintXML(ConstHandle2ConstDebyeWallerIntegral self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DebyeWallerIntegralPrintJSON(ConstHandle2ConstDebyeWallerIntegral self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +DebyeWallerIntegralXYs1dHas(ConstHandle2ConstDebyeWallerIntegral self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +DebyeWallerIntegralXYs1dGetConst(ConstHandle2ConstDebyeWallerIntegral self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +DebyeWallerIntegralXYs1dGet(ConstHandle2DebyeWallerIntegral self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +DebyeWallerIntegralXYs1dSet(ConstHandle2DebyeWallerIntegral self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DebyeWallerIntegral/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DebyeWallerIntegral.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DebyeWallerIntegral.h new file mode 100644 index 000000000..e09641c9c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DebyeWallerIntegral.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DebyeWallerIntegral is the basic handle type in this file. Example: +// // Create a default DebyeWallerIntegral object: +// DebyeWallerIntegral handle = DebyeWallerIntegralDefault(); +// Functions involving DebyeWallerIntegral are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DEBYEWALLERINTEGRAL +#define C_INTERFACE_GNDS_V2_0_GENERAL_DEBYEWALLERINTEGRAL + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DebyeWallerIntegralClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DebyeWallerIntegral +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DebyeWallerIntegralClass *DebyeWallerIntegral; + +// --- Const-aware handles. +typedef const struct DebyeWallerIntegralClass *const ConstHandle2ConstDebyeWallerIntegral; +typedef struct DebyeWallerIntegralClass *const ConstHandle2DebyeWallerIntegral; +typedef const struct DebyeWallerIntegralClass * Handle2ConstDebyeWallerIntegral; +typedef struct DebyeWallerIntegralClass * Handle2DebyeWallerIntegral; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDebyeWallerIntegral +DebyeWallerIntegralDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DebyeWallerIntegral +DebyeWallerIntegralDefault(); + +// --- Create, general, const +extern_c Handle2ConstDebyeWallerIntegral +DebyeWallerIntegralCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2DebyeWallerIntegral +DebyeWallerIntegralCreate( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DebyeWallerIntegralAssign(ConstHandle2DebyeWallerIntegral self, ConstHandle2ConstDebyeWallerIntegral from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DebyeWallerIntegralDelete(ConstHandle2ConstDebyeWallerIntegral self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DebyeWallerIntegralRead(ConstHandle2DebyeWallerIntegral self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DebyeWallerIntegralWrite(ConstHandle2ConstDebyeWallerIntegral self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DebyeWallerIntegralPrint(ConstHandle2ConstDebyeWallerIntegral self); + +// +++ Print to standard output, as XML +extern_c int +DebyeWallerIntegralPrintXML(ConstHandle2ConstDebyeWallerIntegral self); + +// +++ Print to standard output, as JSON +extern_c int +DebyeWallerIntegralPrintJSON(ConstHandle2ConstDebyeWallerIntegral self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DebyeWallerIntegralXYs1dHas(ConstHandle2ConstDebyeWallerIntegral self); + +// --- Get, const +extern_c Handle2ConstXYs1d +DebyeWallerIntegralXYs1dGetConst(ConstHandle2ConstDebyeWallerIntegral self); + +// +++ Get, non-const +extern_c Handle2XYs1d +DebyeWallerIntegralXYs1dGet(ConstHandle2DebyeWallerIntegral self); + +// +++ Set +extern_c void +DebyeWallerIntegralXYs1dSet(ConstHandle2DebyeWallerIntegral self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DebyeWallerIntegral/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DebyeWallerIntegral/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DebyeWallerIntegral/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DebyeWallerIntegral/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DebyeWallerIntegral/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Decay.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Decay.cpp new file mode 100644 index 000000000..b607f0fc0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Decay.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Decay.hpp" +#include "Decay.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DecayClass; +using CPP = multigroup::Decay; + +static const std::string CLASSNAME = "Decay"; + +namespace extract { + static auto index = [](auto &obj) { return &obj.index; }; + static auto mode = [](auto &obj) { return &obj.mode; }; + static auto complete = [](auto &obj) { return &obj.complete; }; + static auto products = [](auto &obj) { return &obj.products; }; +} + +using CPPProducts = general::Products; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDecay +DecayDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Decay +DecayDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDecay +DecayCreateConst( + const int index, + const char *const mode, + const bool complete, + ConstHandle2ConstProducts products +) { + ConstHandle2Decay handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + mode, + complete, + detail::tocpp(products) + ); + return handle; +} + +// Create, general, non-const +Handle2Decay +DecayCreate( + const int index, + const char *const mode, + const bool complete, + ConstHandle2ConstProducts products +) { + ConstHandle2Decay handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + index, + mode, + complete, + detail::tocpp(products) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DecayAssign(ConstHandle2Decay self, ConstHandle2ConstDecay from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DecayDelete(ConstHandle2ConstDecay self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DecayRead(ConstHandle2Decay self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DecayWrite(ConstHandle2ConstDecay self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DecayPrint(ConstHandle2ConstDecay self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DecayPrintXML(ConstHandle2ConstDecay self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DecayPrintJSON(ConstHandle2ConstDecay self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// Has +int +DecayIndexHas(ConstHandle2ConstDecay self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IndexHas", self, extract::index); +} + +// Get +// Returns by value +int +DecayIndexGet(ConstHandle2ConstDecay self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +DecayIndexSet(ConstHandle2Decay self, const int index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: mode +// ----------------------------------------------------------------------------- + +// Has +int +DecayModeHas(ConstHandle2ConstDecay self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ModeHas", self, extract::mode); +} + +// Get +// Returns by value +const char * +DecayModeGet(ConstHandle2ConstDecay self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ModeGet", self, extract::mode); +} + +// Set +void +DecayModeSet(ConstHandle2Decay self, const char *const mode) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ModeSet", self, extract::mode, mode); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: complete +// ----------------------------------------------------------------------------- + +// Has +int +DecayCompleteHas(ConstHandle2ConstDecay self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CompleteHas", self, extract::complete); +} + +// Get +// Returns by value +bool +DecayCompleteGet(ConstHandle2ConstDecay self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CompleteGet", self, extract::complete); +} + +// Set +void +DecayCompleteSet(ConstHandle2Decay self, const bool complete) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CompleteSet", self, extract::complete, complete); +} + + +// ----------------------------------------------------------------------------- +// Child: products +// ----------------------------------------------------------------------------- + +// Has +int +DecayProductsHas(ConstHandle2ConstDecay self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductsHas", self, extract::products); +} + +// Get, const +Handle2ConstProducts +DecayProductsGetConst(ConstHandle2ConstDecay self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductsGetConst", self, extract::products); +} + +// Get, non-const +Handle2Products +DecayProductsGet(ConstHandle2Decay self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductsGet", self, extract::products); +} + +// Set +void +DecayProductsSet(ConstHandle2Decay self, ConstHandle2ConstProducts products) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductsSet", self, extract::products, products); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Decay/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Decay.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Decay.h new file mode 100644 index 000000000..ddf6e823a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Decay.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Decay is the basic handle type in this file. Example: +// // Create a default Decay object: +// Decay handle = DecayDefault(); +// Functions involving Decay are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DECAY +#define C_INTERFACE_GNDS_V2_0_GENERAL_DECAY + +#include "GNDStk.h" +#include "v2.0/general/Products.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DecayClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Decay +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DecayClass *Decay; + +// --- Const-aware handles. +typedef const struct DecayClass *const ConstHandle2ConstDecay; +typedef struct DecayClass *const ConstHandle2Decay; +typedef const struct DecayClass * Handle2ConstDecay; +typedef struct DecayClass * Handle2Decay; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDecay +DecayDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Decay +DecayDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecay +DecayCreateConst( + const int index, + const char *const mode, + const bool complete, + ConstHandle2ConstProducts products +); + +// +++ Create, general, non-const +extern_c Handle2Decay +DecayCreate( + const int index, + const char *const mode, + const bool complete, + ConstHandle2ConstProducts products +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DecayAssign(ConstHandle2Decay self, ConstHandle2ConstDecay from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DecayDelete(ConstHandle2ConstDecay self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DecayRead(ConstHandle2Decay self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DecayWrite(ConstHandle2ConstDecay self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DecayPrint(ConstHandle2ConstDecay self); + +// +++ Print to standard output, as XML +extern_c int +DecayPrintXML(ConstHandle2ConstDecay self); + +// +++ Print to standard output, as JSON +extern_c int +DecayPrintJSON(ConstHandle2ConstDecay self); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayIndexHas(ConstHandle2ConstDecay self); + +// +++ Get +// +++ Returns by value +extern_c int +DecayIndexGet(ConstHandle2ConstDecay self); + +// +++ Set +extern_c void +DecayIndexSet(ConstHandle2Decay self, const int index); + + +// ----------------------------------------------------------------------------- +// Metadatum: mode +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModeHas(ConstHandle2ConstDecay self); + +// +++ Get +// +++ Returns by value +extern_c const char * +DecayModeGet(ConstHandle2ConstDecay self); + +// +++ Set +extern_c void +DecayModeSet(ConstHandle2Decay self, const char *const mode); + + +// ----------------------------------------------------------------------------- +// Metadatum: complete +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayCompleteHas(ConstHandle2ConstDecay self); + +// +++ Get +// +++ Returns by value +extern_c bool +DecayCompleteGet(ConstHandle2ConstDecay self); + +// +++ Set +extern_c void +DecayCompleteSet(ConstHandle2Decay self, const bool complete); + + +// ----------------------------------------------------------------------------- +// Child: products +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayProductsHas(ConstHandle2ConstDecay self); + +// --- Get, const +extern_c Handle2ConstProducts +DecayProductsGetConst(ConstHandle2ConstDecay self); + +// +++ Get, non-const +extern_c Handle2Products +DecayProductsGet(ConstHandle2Decay self); + +// +++ Set +extern_c void +DecayProductsSet(ConstHandle2Decay self, ConstHandle2ConstProducts products); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Decay/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Decay/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Decay/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Decay/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Decay/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayData.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayData.cpp new file mode 100644 index 000000000..f896b1c90 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayData.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DecayData.hpp" +#include "DecayData.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DecayDataClass; +using CPP = multigroup::DecayData; + +static const std::string CLASSNAME = "DecayData"; + +namespace extract { + static auto decayModes = [](auto &obj) { return &obj.decayModes; }; + static auto averageEnergies = [](auto &obj) { return &obj.averageEnergies; }; +} + +using CPPDecayModes = general::DecayModes; +using CPPAverageEnergies = general::AverageEnergies; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDecayData +DecayDataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DecayData +DecayDataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDecayData +DecayDataCreateConst( + ConstHandle2ConstDecayModes decayModes, + ConstHandle2ConstAverageEnergies averageEnergies +) { + ConstHandle2DecayData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(decayModes), + detail::tocpp(averageEnergies) + ); + return handle; +} + +// Create, general, non-const +Handle2DecayData +DecayDataCreate( + ConstHandle2ConstDecayModes decayModes, + ConstHandle2ConstAverageEnergies averageEnergies +) { + ConstHandle2DecayData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(decayModes), + detail::tocpp(averageEnergies) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DecayDataAssign(ConstHandle2DecayData self, ConstHandle2ConstDecayData from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DecayDataDelete(ConstHandle2ConstDecayData self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DecayDataRead(ConstHandle2DecayData self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DecayDataWrite(ConstHandle2ConstDecayData self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DecayDataPrint(ConstHandle2ConstDecayData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DecayDataPrintXML(ConstHandle2ConstDecayData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DecayDataPrintJSON(ConstHandle2ConstDecayData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: decayModes +// ----------------------------------------------------------------------------- + +// Has +int +DecayDataDecayModesHas(ConstHandle2ConstDecayData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DecayModesHas", self, extract::decayModes); +} + +// Get, const +Handle2ConstDecayModes +DecayDataDecayModesGetConst(ConstHandle2ConstDecayData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayModesGetConst", self, extract::decayModes); +} + +// Get, non-const +Handle2DecayModes +DecayDataDecayModesGet(ConstHandle2DecayData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayModesGet", self, extract::decayModes); +} + +// Set +void +DecayDataDecayModesSet(ConstHandle2DecayData self, ConstHandle2ConstDecayModes decayModes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DecayModesSet", self, extract::decayModes, decayModes); +} + + +// ----------------------------------------------------------------------------- +// Child: averageEnergies +// ----------------------------------------------------------------------------- + +// Has +int +DecayDataAverageEnergiesHas(ConstHandle2ConstDecayData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AverageEnergiesHas", self, extract::averageEnergies); +} + +// Get, const +Handle2ConstAverageEnergies +DecayDataAverageEnergiesGetConst(ConstHandle2ConstDecayData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AverageEnergiesGetConst", self, extract::averageEnergies); +} + +// Get, non-const +Handle2AverageEnergies +DecayDataAverageEnergiesGet(ConstHandle2DecayData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AverageEnergiesGet", self, extract::averageEnergies); +} + +// Set +void +DecayDataAverageEnergiesSet(ConstHandle2DecayData self, ConstHandle2ConstAverageEnergies averageEnergies) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AverageEnergiesSet", self, extract::averageEnergies, averageEnergies); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DecayData/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayData.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayData.h new file mode 100644 index 000000000..879159ee6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayData.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DecayData is the basic handle type in this file. Example: +// // Create a default DecayData object: +// DecayData handle = DecayDataDefault(); +// Functions involving DecayData are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DECAYDATA +#define C_INTERFACE_GNDS_V2_0_GENERAL_DECAYDATA + +#include "GNDStk.h" +#include "v2.0/general/DecayModes.h" +#include "v2.0/general/AverageEnergies.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DecayDataClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DecayData +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DecayDataClass *DecayData; + +// --- Const-aware handles. +typedef const struct DecayDataClass *const ConstHandle2ConstDecayData; +typedef struct DecayDataClass *const ConstHandle2DecayData; +typedef const struct DecayDataClass * Handle2ConstDecayData; +typedef struct DecayDataClass * Handle2DecayData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDecayData +DecayDataDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DecayData +DecayDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecayData +DecayDataCreateConst( + ConstHandle2ConstDecayModes decayModes, + ConstHandle2ConstAverageEnergies averageEnergies +); + +// +++ Create, general, non-const +extern_c Handle2DecayData +DecayDataCreate( + ConstHandle2ConstDecayModes decayModes, + ConstHandle2ConstAverageEnergies averageEnergies +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DecayDataAssign(ConstHandle2DecayData self, ConstHandle2ConstDecayData from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DecayDataDelete(ConstHandle2ConstDecayData self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DecayDataRead(ConstHandle2DecayData self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DecayDataWrite(ConstHandle2ConstDecayData self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DecayDataPrint(ConstHandle2ConstDecayData self); + +// +++ Print to standard output, as XML +extern_c int +DecayDataPrintXML(ConstHandle2ConstDecayData self); + +// +++ Print to standard output, as JSON +extern_c int +DecayDataPrintJSON(ConstHandle2ConstDecayData self); + + +// ----------------------------------------------------------------------------- +// Child: decayModes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayDataDecayModesHas(ConstHandle2ConstDecayData self); + +// --- Get, const +extern_c Handle2ConstDecayModes +DecayDataDecayModesGetConst(ConstHandle2ConstDecayData self); + +// +++ Get, non-const +extern_c Handle2DecayModes +DecayDataDecayModesGet(ConstHandle2DecayData self); + +// +++ Set +extern_c void +DecayDataDecayModesSet(ConstHandle2DecayData self, ConstHandle2ConstDecayModes decayModes); + + +// ----------------------------------------------------------------------------- +// Child: averageEnergies +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayDataAverageEnergiesHas(ConstHandle2ConstDecayData self); + +// --- Get, const +extern_c Handle2ConstAverageEnergies +DecayDataAverageEnergiesGetConst(ConstHandle2ConstDecayData self); + +// +++ Get, non-const +extern_c Handle2AverageEnergies +DecayDataAverageEnergiesGet(ConstHandle2DecayData self); + +// +++ Set +extern_c void +DecayDataAverageEnergiesSet(ConstHandle2DecayData self, ConstHandle2ConstAverageEnergies averageEnergies); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DecayData/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayData/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayData/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayMode.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayMode.cpp new file mode 100644 index 000000000..5fda722a0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayMode.cpp @@ -0,0 +1,423 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DecayMode.hpp" +#include "DecayMode.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DecayModeClass; +using CPP = multigroup::DecayMode; + +static const std::string CLASSNAME = "DecayMode"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto mode = [](auto &obj) { return &obj.mode; }; + static auto probability = [](auto &obj) { return &obj.probability; }; + static auto decayPath = [](auto &obj) { return &obj.decayPath; }; + static auto photonEmissionProbabilities = [](auto &obj) { return &obj.photonEmissionProbabilities; }; + static auto Q = [](auto &obj) { return &obj.Q; }; + static auto spectra = [](auto &obj) { return &obj.spectra; }; +} + +using CPPProbability = general::Probability; +using CPPDecayPath = general::DecayPath; +using CPPPhotonEmissionProbabilities = general::PhotonEmissionProbabilities; +using CPPQ = general::Q; +using CPPSpectra = general::Spectra; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDecayMode +DecayModeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DecayMode +DecayModeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDecayMode +DecayModeCreateConst( + const char *const label, + const char *const mode, + ConstHandle2ConstProbability probability, + ConstHandle2ConstDecayPath decayPath, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + ConstHandle2ConstQ Q, + ConstHandle2ConstSpectra spectra +) { + ConstHandle2DecayMode handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + mode, + detail::tocpp(probability), + detail::tocpp(decayPath), + detail::tocpp(photonEmissionProbabilities), + detail::tocpp(Q), + detail::tocpp(spectra) + ); + return handle; +} + +// Create, general, non-const +Handle2DecayMode +DecayModeCreate( + const char *const label, + const char *const mode, + ConstHandle2ConstProbability probability, + ConstHandle2ConstDecayPath decayPath, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + ConstHandle2ConstQ Q, + ConstHandle2ConstSpectra spectra +) { + ConstHandle2DecayMode handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + mode, + detail::tocpp(probability), + detail::tocpp(decayPath), + detail::tocpp(photonEmissionProbabilities), + detail::tocpp(Q), + detail::tocpp(spectra) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DecayModeAssign(ConstHandle2DecayMode self, ConstHandle2ConstDecayMode from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DecayModeDelete(ConstHandle2ConstDecayMode self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DecayModeRead(ConstHandle2DecayMode self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DecayModeWrite(ConstHandle2ConstDecayMode self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DecayModePrint(ConstHandle2ConstDecayMode self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DecayModePrintXML(ConstHandle2ConstDecayMode self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DecayModePrintJSON(ConstHandle2ConstDecayMode self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +DecayModeLabelHas(ConstHandle2ConstDecayMode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +DecayModeLabelGet(ConstHandle2ConstDecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +DecayModeLabelSet(ConstHandle2DecayMode self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: mode +// ----------------------------------------------------------------------------- + +// Has +int +DecayModeModeHas(ConstHandle2ConstDecayMode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ModeHas", self, extract::mode); +} + +// Get +// Returns by value +const char * +DecayModeModeGet(ConstHandle2ConstDecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ModeGet", self, extract::mode); +} + +// Set +void +DecayModeModeSet(ConstHandle2DecayMode self, const char *const mode) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ModeSet", self, extract::mode, mode); +} + + +// ----------------------------------------------------------------------------- +// Child: probability +// ----------------------------------------------------------------------------- + +// Has +int +DecayModeProbabilityHas(ConstHandle2ConstDecayMode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProbabilityHas", self, extract::probability); +} + +// Get, const +Handle2ConstProbability +DecayModeProbabilityGetConst(ConstHandle2ConstDecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProbabilityGetConst", self, extract::probability); +} + +// Get, non-const +Handle2Probability +DecayModeProbabilityGet(ConstHandle2DecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProbabilityGet", self, extract::probability); +} + +// Set +void +DecayModeProbabilitySet(ConstHandle2DecayMode self, ConstHandle2ConstProbability probability) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProbabilitySet", self, extract::probability, probability); +} + + +// ----------------------------------------------------------------------------- +// Child: decayPath +// ----------------------------------------------------------------------------- + +// Has +int +DecayModeDecayPathHas(ConstHandle2ConstDecayMode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DecayPathHas", self, extract::decayPath); +} + +// Get, const +Handle2ConstDecayPath +DecayModeDecayPathGetConst(ConstHandle2ConstDecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayPathGetConst", self, extract::decayPath); +} + +// Get, non-const +Handle2DecayPath +DecayModeDecayPathGet(ConstHandle2DecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayPathGet", self, extract::decayPath); +} + +// Set +void +DecayModeDecayPathSet(ConstHandle2DecayMode self, ConstHandle2ConstDecayPath decayPath) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DecayPathSet", self, extract::decayPath, decayPath); +} + + +// ----------------------------------------------------------------------------- +// Child: photonEmissionProbabilities +// ----------------------------------------------------------------------------- + +// Has +int +DecayModePhotonEmissionProbabilitiesHas(ConstHandle2ConstDecayMode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PhotonEmissionProbabilitiesHas", self, extract::photonEmissionProbabilities); +} + +// Get, const +Handle2ConstPhotonEmissionProbabilities +DecayModePhotonEmissionProbabilitiesGetConst(ConstHandle2ConstDecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PhotonEmissionProbabilitiesGetConst", self, extract::photonEmissionProbabilities); +} + +// Get, non-const +Handle2PhotonEmissionProbabilities +DecayModePhotonEmissionProbabilitiesGet(ConstHandle2DecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PhotonEmissionProbabilitiesGet", self, extract::photonEmissionProbabilities); +} + +// Set +void +DecayModePhotonEmissionProbabilitiesSet(ConstHandle2DecayMode self, ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PhotonEmissionProbabilitiesSet", self, extract::photonEmissionProbabilities, photonEmissionProbabilities); +} + + +// ----------------------------------------------------------------------------- +// Child: Q +// ----------------------------------------------------------------------------- + +// Has +int +DecayModeQHas(ConstHandle2ConstDecayMode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"QHas", self, extract::Q); +} + +// Get, const +Handle2ConstQ +DecayModeQGetConst(ConstHandle2ConstDecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"QGetConst", self, extract::Q); +} + +// Get, non-const +Handle2Q +DecayModeQGet(ConstHandle2DecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"QGet", self, extract::Q); +} + +// Set +void +DecayModeQSet(ConstHandle2DecayMode self, ConstHandle2ConstQ Q) +{ + detail::setField + (CLASSNAME, CLASSNAME+"QSet", self, extract::Q, Q); +} + + +// ----------------------------------------------------------------------------- +// Child: spectra +// ----------------------------------------------------------------------------- + +// Has +int +DecayModeSpectraHas(ConstHandle2ConstDecayMode self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SpectraHas", self, extract::spectra); +} + +// Get, const +Handle2ConstSpectra +DecayModeSpectraGetConst(ConstHandle2ConstDecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpectraGetConst", self, extract::spectra); +} + +// Get, non-const +Handle2Spectra +DecayModeSpectraGet(ConstHandle2DecayMode self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpectraGet", self, extract::spectra); +} + +// Set +void +DecayModeSpectraSet(ConstHandle2DecayMode self, ConstHandle2ConstSpectra spectra) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SpectraSet", self, extract::spectra, spectra); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DecayMode/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayMode.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayMode.h new file mode 100644 index 000000000..e8f8d24f3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayMode.h @@ -0,0 +1,297 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DecayMode is the basic handle type in this file. Example: +// // Create a default DecayMode object: +// DecayMode handle = DecayModeDefault(); +// Functions involving DecayMode are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DECAYMODE +#define C_INTERFACE_GNDS_V2_0_GENERAL_DECAYMODE + +#include "GNDStk.h" +#include "v2.0/general/Probability.h" +#include "v2.0/general/DecayPath.h" +#include "v2.0/general/PhotonEmissionProbabilities.h" +#include "v2.0/general/Q.h" +#include "v2.0/general/Spectra.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DecayModeClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DecayMode +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DecayModeClass *DecayMode; + +// --- Const-aware handles. +typedef const struct DecayModeClass *const ConstHandle2ConstDecayMode; +typedef struct DecayModeClass *const ConstHandle2DecayMode; +typedef const struct DecayModeClass * Handle2ConstDecayMode; +typedef struct DecayModeClass * Handle2DecayMode; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDecayMode +DecayModeDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DecayMode +DecayModeDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecayMode +DecayModeCreateConst( + const char *const label, + const char *const mode, + ConstHandle2ConstProbability probability, + ConstHandle2ConstDecayPath decayPath, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + ConstHandle2ConstQ Q, + ConstHandle2ConstSpectra spectra +); + +// +++ Create, general, non-const +extern_c Handle2DecayMode +DecayModeCreate( + const char *const label, + const char *const mode, + ConstHandle2ConstProbability probability, + ConstHandle2ConstDecayPath decayPath, + ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities, + ConstHandle2ConstQ Q, + ConstHandle2ConstSpectra spectra +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DecayModeAssign(ConstHandle2DecayMode self, ConstHandle2ConstDecayMode from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DecayModeDelete(ConstHandle2ConstDecayMode self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DecayModeRead(ConstHandle2DecayMode self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DecayModeWrite(ConstHandle2ConstDecayMode self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DecayModePrint(ConstHandle2ConstDecayMode self); + +// +++ Print to standard output, as XML +extern_c int +DecayModePrintXML(ConstHandle2ConstDecayMode self); + +// +++ Print to standard output, as JSON +extern_c int +DecayModePrintJSON(ConstHandle2ConstDecayMode self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModeLabelHas(ConstHandle2ConstDecayMode self); + +// +++ Get +// +++ Returns by value +extern_c const char * +DecayModeLabelGet(ConstHandle2ConstDecayMode self); + +// +++ Set +extern_c void +DecayModeLabelSet(ConstHandle2DecayMode self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: mode +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModeModeHas(ConstHandle2ConstDecayMode self); + +// +++ Get +// +++ Returns by value +extern_c const char * +DecayModeModeGet(ConstHandle2ConstDecayMode self); + +// +++ Set +extern_c void +DecayModeModeSet(ConstHandle2DecayMode self, const char *const mode); + + +// ----------------------------------------------------------------------------- +// Child: probability +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModeProbabilityHas(ConstHandle2ConstDecayMode self); + +// --- Get, const +extern_c Handle2ConstProbability +DecayModeProbabilityGetConst(ConstHandle2ConstDecayMode self); + +// +++ Get, non-const +extern_c Handle2Probability +DecayModeProbabilityGet(ConstHandle2DecayMode self); + +// +++ Set +extern_c void +DecayModeProbabilitySet(ConstHandle2DecayMode self, ConstHandle2ConstProbability probability); + + +// ----------------------------------------------------------------------------- +// Child: decayPath +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModeDecayPathHas(ConstHandle2ConstDecayMode self); + +// --- Get, const +extern_c Handle2ConstDecayPath +DecayModeDecayPathGetConst(ConstHandle2ConstDecayMode self); + +// +++ Get, non-const +extern_c Handle2DecayPath +DecayModeDecayPathGet(ConstHandle2DecayMode self); + +// +++ Set +extern_c void +DecayModeDecayPathSet(ConstHandle2DecayMode self, ConstHandle2ConstDecayPath decayPath); + + +// ----------------------------------------------------------------------------- +// Child: photonEmissionProbabilities +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModePhotonEmissionProbabilitiesHas(ConstHandle2ConstDecayMode self); + +// --- Get, const +extern_c Handle2ConstPhotonEmissionProbabilities +DecayModePhotonEmissionProbabilitiesGetConst(ConstHandle2ConstDecayMode self); + +// +++ Get, non-const +extern_c Handle2PhotonEmissionProbabilities +DecayModePhotonEmissionProbabilitiesGet(ConstHandle2DecayMode self); + +// +++ Set +extern_c void +DecayModePhotonEmissionProbabilitiesSet(ConstHandle2DecayMode self, ConstHandle2ConstPhotonEmissionProbabilities photonEmissionProbabilities); + + +// ----------------------------------------------------------------------------- +// Child: Q +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModeQHas(ConstHandle2ConstDecayMode self); + +// --- Get, const +extern_c Handle2ConstQ +DecayModeQGetConst(ConstHandle2ConstDecayMode self); + +// +++ Get, non-const +extern_c Handle2Q +DecayModeQGet(ConstHandle2DecayMode self); + +// +++ Set +extern_c void +DecayModeQSet(ConstHandle2DecayMode self, ConstHandle2ConstQ Q); + + +// ----------------------------------------------------------------------------- +// Child: spectra +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModeSpectraHas(ConstHandle2ConstDecayMode self); + +// --- Get, const +extern_c Handle2ConstSpectra +DecayModeSpectraGetConst(ConstHandle2ConstDecayMode self); + +// +++ Get, non-const +extern_c Handle2Spectra +DecayModeSpectraGet(ConstHandle2DecayMode self); + +// +++ Set +extern_c void +DecayModeSpectraSet(ConstHandle2DecayMode self, ConstHandle2ConstSpectra spectra); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DecayMode/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayMode/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayMode/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayMode/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayMode/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayModes.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayModes.cpp new file mode 100644 index 000000000..f06c1f9ab --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayModes.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DecayModes.hpp" +#include "DecayModes.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DecayModesClass; +using CPP = multigroup::DecayModes; + +static const std::string CLASSNAME = "DecayModes"; + +namespace extract { + static auto decayMode = [](auto &obj) { return &obj.decayMode; }; +} + +using CPPDecayMode = general::DecayMode; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDecayModes +DecayModesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DecayModes +DecayModesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDecayModes +DecayModesCreateConst( + ConstHandle2DecayMode *const decayMode, const size_t decayModeSize +) { + ConstHandle2DecayModes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t DecayModeN = 0; DecayModeN < decayModeSize; ++DecayModeN) + DecayModesDecayModeAdd(handle, decayMode[DecayModeN]); + return handle; +} + +// Create, general, non-const +Handle2DecayModes +DecayModesCreate( + ConstHandle2DecayMode *const decayMode, const size_t decayModeSize +) { + ConstHandle2DecayModes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t DecayModeN = 0; DecayModeN < decayModeSize; ++DecayModeN) + DecayModesDecayModeAdd(handle, decayMode[DecayModeN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DecayModesAssign(ConstHandle2DecayModes self, ConstHandle2ConstDecayModes from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DecayModesDelete(ConstHandle2ConstDecayModes self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DecayModesRead(ConstHandle2DecayModes self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DecayModesWrite(ConstHandle2ConstDecayModes self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DecayModesPrint(ConstHandle2ConstDecayModes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DecayModesPrintXML(ConstHandle2ConstDecayModes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DecayModesPrintJSON(ConstHandle2ConstDecayModes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: decayMode +// ----------------------------------------------------------------------------- + +// Has +int +DecayModesDecayModeHas(ConstHandle2ConstDecayModes self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DecayModeHas", self, extract::decayMode); +} + +// Clear +void +DecayModesDecayModeClear(ConstHandle2DecayModes self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DecayModeClear", self, extract::decayMode); +} + +// Size +size_t +DecayModesDecayModeSize(ConstHandle2ConstDecayModes self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DecayModeSize", self, extract::decayMode); +} + +// Add +void +DecayModesDecayModeAdd(ConstHandle2DecayModes self, ConstHandle2ConstDecayMode decayMode) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DecayModeAdd", self, extract::decayMode, decayMode); +} + +// Get, by index \in [0,size), const +Handle2ConstDecayMode +DecayModesDecayModeGetConst(ConstHandle2ConstDecayModes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DecayModeGetConst", self, extract::decayMode, index_); +} + +// Get, by index \in [0,size), non-const +Handle2DecayMode +DecayModesDecayModeGet(ConstHandle2DecayModes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DecayModeGet", self, extract::decayMode, index_); +} + +// Set, by index \in [0,size) +void +DecayModesDecayModeSet( + ConstHandle2DecayModes self, + const size_t index_, + ConstHandle2ConstDecayMode decayMode +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DecayModeSet", self, extract::decayMode, index_, decayMode); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +DecayModesDecayModeHasByLabel( + ConstHandle2ConstDecayModes self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeHasByLabel", + self, extract::decayMode, meta::label, label); +} + +// Get, by label, const +Handle2ConstDecayMode +DecayModesDecayModeGetByLabelConst( + ConstHandle2ConstDecayModes self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeGetByLabelConst", + self, extract::decayMode, meta::label, label); +} + +// Get, by label, non-const +Handle2DecayMode +DecayModesDecayModeGetByLabel( + ConstHandle2DecayModes self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeGetByLabel", + self, extract::decayMode, meta::label, label); +} + +// Set, by label +void +DecayModesDecayModeSetByLabel( + ConstHandle2DecayModes self, + const char *const label, + ConstHandle2ConstDecayMode decayMode +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeSetByLabel", + self, extract::decayMode, meta::label, label, decayMode); +} + +// ------------------------ +// Re: metadatum mode +// ------------------------ + +// Has, by mode +int +DecayModesDecayModeHasByMode( + ConstHandle2ConstDecayModes self, + const char *const mode +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeHasByMode", + self, extract::decayMode, meta::mode, mode); +} + +// Get, by mode, const +Handle2ConstDecayMode +DecayModesDecayModeGetByModeConst( + ConstHandle2ConstDecayModes self, + const char *const mode +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeGetByModeConst", + self, extract::decayMode, meta::mode, mode); +} + +// Get, by mode, non-const +Handle2DecayMode +DecayModesDecayModeGetByMode( + ConstHandle2DecayModes self, + const char *const mode +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeGetByMode", + self, extract::decayMode, meta::mode, mode); +} + +// Set, by mode +void +DecayModesDecayModeSetByMode( + ConstHandle2DecayModes self, + const char *const mode, + ConstHandle2ConstDecayMode decayMode +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DecayModeSetByMode", + self, extract::decayMode, meta::mode, mode, decayMode); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DecayModes/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayModes.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayModes.h new file mode 100644 index 000000000..77f04a6b0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayModes.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DecayModes is the basic handle type in this file. Example: +// // Create a default DecayModes object: +// DecayModes handle = DecayModesDefault(); +// Functions involving DecayModes are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DECAYMODES +#define C_INTERFACE_GNDS_V2_0_GENERAL_DECAYMODES + +#include "GNDStk.h" +#include "v2.0/general/DecayMode.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DecayModesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DecayModes +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DecayModesClass *DecayModes; + +// --- Const-aware handles. +typedef const struct DecayModesClass *const ConstHandle2ConstDecayModes; +typedef struct DecayModesClass *const ConstHandle2DecayModes; +typedef const struct DecayModesClass * Handle2ConstDecayModes; +typedef struct DecayModesClass * Handle2DecayModes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDecayModes +DecayModesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DecayModes +DecayModesDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecayModes +DecayModesCreateConst( + ConstHandle2DecayMode *const decayMode, const size_t decayModeSize +); + +// +++ Create, general, non-const +extern_c Handle2DecayModes +DecayModesCreate( + ConstHandle2DecayMode *const decayMode, const size_t decayModeSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DecayModesAssign(ConstHandle2DecayModes self, ConstHandle2ConstDecayModes from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DecayModesDelete(ConstHandle2ConstDecayModes self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DecayModesRead(ConstHandle2DecayModes self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DecayModesWrite(ConstHandle2ConstDecayModes self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DecayModesPrint(ConstHandle2ConstDecayModes self); + +// +++ Print to standard output, as XML +extern_c int +DecayModesPrintXML(ConstHandle2ConstDecayModes self); + +// +++ Print to standard output, as JSON +extern_c int +DecayModesPrintJSON(ConstHandle2ConstDecayModes self); + + +// ----------------------------------------------------------------------------- +// Child: decayMode +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayModesDecayModeHas(ConstHandle2ConstDecayModes self); + +// +++ Clear +extern_c void +DecayModesDecayModeClear(ConstHandle2DecayModes self); + +// +++ Size +extern_c size_t +DecayModesDecayModeSize(ConstHandle2ConstDecayModes self); + +// +++ Add +extern_c void +DecayModesDecayModeAdd(ConstHandle2DecayModes self, ConstHandle2ConstDecayMode decayMode); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDecayMode +DecayModesDecayModeGetConst(ConstHandle2ConstDecayModes self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2DecayMode +DecayModesDecayModeGet(ConstHandle2DecayModes self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +DecayModesDecayModeSet( + ConstHandle2DecayModes self, + const size_t index_, + ConstHandle2ConstDecayMode decayMode +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +DecayModesDecayModeHasByLabel( + ConstHandle2ConstDecayModes self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstDecayMode +DecayModesDecayModeGetByLabelConst( + ConstHandle2ConstDecayModes self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2DecayMode +DecayModesDecayModeGetByLabel( + ConstHandle2DecayModes self, + const char *const label +); + +// +++ Set, by label +extern_c void +DecayModesDecayModeSetByLabel( + ConstHandle2DecayModes self, + const char *const label, + ConstHandle2ConstDecayMode decayMode +); + +// ------------------------ +// Re: metadatum mode +// ------------------------ + +// +++ Has, by mode +extern_c int +DecayModesDecayModeHasByMode( + ConstHandle2ConstDecayModes self, + const char *const mode +); + +// --- Get, by mode, const +extern_c Handle2ConstDecayMode +DecayModesDecayModeGetByModeConst( + ConstHandle2ConstDecayModes self, + const char *const mode +); + +// +++ Get, by mode, non-const +extern_c Handle2DecayMode +DecayModesDecayModeGetByMode( + ConstHandle2DecayModes self, + const char *const mode +); + +// +++ Set, by mode +extern_c void +DecayModesDecayModeSetByMode( + ConstHandle2DecayModes self, + const char *const mode, + ConstHandle2ConstDecayMode decayMode +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DecayModes/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayModes/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayModes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayModes/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayModes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayPath.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayPath.cpp new file mode 100644 index 000000000..aad3b001d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayPath.cpp @@ -0,0 +1,359 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DecayPath.hpp" +#include "DecayPath.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DecayPathClass; +using CPP = multigroup::DecayPath; + +static const std::string CLASSNAME = "DecayPath"; + +namespace extract { + static auto decay = [](auto &obj) { return &obj.decay; }; +} + +using CPPDecay = general::Decay; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDecayPath +DecayPathDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DecayPath +DecayPathDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDecayPath +DecayPathCreateConst( + ConstHandle2Decay *const decay, const size_t decaySize +) { + ConstHandle2DecayPath handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t DecayN = 0; DecayN < decaySize; ++DecayN) + DecayPathDecayAdd(handle, decay[DecayN]); + return handle; +} + +// Create, general, non-const +Handle2DecayPath +DecayPathCreate( + ConstHandle2Decay *const decay, const size_t decaySize +) { + ConstHandle2DecayPath handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t DecayN = 0; DecayN < decaySize; ++DecayN) + DecayPathDecayAdd(handle, decay[DecayN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DecayPathAssign(ConstHandle2DecayPath self, ConstHandle2ConstDecayPath from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DecayPathDelete(ConstHandle2ConstDecayPath self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DecayPathRead(ConstHandle2DecayPath self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DecayPathWrite(ConstHandle2ConstDecayPath self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DecayPathPrint(ConstHandle2ConstDecayPath self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DecayPathPrintXML(ConstHandle2ConstDecayPath self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DecayPathPrintJSON(ConstHandle2ConstDecayPath self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: decay +// ----------------------------------------------------------------------------- + +// Has +int +DecayPathDecayHas(ConstHandle2ConstDecayPath self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DecayHas", self, extract::decay); +} + +// Clear +void +DecayPathDecayClear(ConstHandle2DecayPath self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DecayClear", self, extract::decay); +} + +// Size +size_t +DecayPathDecaySize(ConstHandle2ConstDecayPath self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DecaySize", self, extract::decay); +} + +// Add +void +DecayPathDecayAdd(ConstHandle2DecayPath self, ConstHandle2ConstDecay decay) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DecayAdd", self, extract::decay, decay); +} + +// Get, by index \in [0,size), const +Handle2ConstDecay +DecayPathDecayGetConst(ConstHandle2ConstDecayPath self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DecayGetConst", self, extract::decay, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Decay +DecayPathDecayGet(ConstHandle2DecayPath self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DecayGet", self, extract::decay, index_); +} + +// Set, by index \in [0,size) +void +DecayPathDecaySet( + ConstHandle2DecayPath self, + const size_t index_, + ConstHandle2ConstDecay decay +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DecaySet", self, extract::decay, index_, decay); +} + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// Has, by index +int +DecayPathDecayHasByIndex( + ConstHandle2ConstDecayPath self, + const int index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DecayHasByIndex", + self, extract::decay, meta::index, index); +} + +// Get, by index, const +Handle2ConstDecay +DecayPathDecayGetByIndexConst( + ConstHandle2ConstDecayPath self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayGetByIndexConst", + self, extract::decay, meta::index, index); +} + +// Get, by index, non-const +Handle2Decay +DecayPathDecayGetByIndex( + ConstHandle2DecayPath self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayGetByIndex", + self, extract::decay, meta::index, index); +} + +// Set, by index +void +DecayPathDecaySetByIndex( + ConstHandle2DecayPath self, + const int index, + ConstHandle2ConstDecay decay +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DecaySetByIndex", + self, extract::decay, meta::index, index, decay); +} + +// ------------------------ +// Re: metadatum mode +// ------------------------ + +// Has, by mode +int +DecayPathDecayHasByMode( + ConstHandle2ConstDecayPath self, + const char *const mode +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DecayHasByMode", + self, extract::decay, meta::mode, mode); +} + +// Get, by mode, const +Handle2ConstDecay +DecayPathDecayGetByModeConst( + ConstHandle2ConstDecayPath self, + const char *const mode +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayGetByModeConst", + self, extract::decay, meta::mode, mode); +} + +// Get, by mode, non-const +Handle2Decay +DecayPathDecayGetByMode( + ConstHandle2DecayPath self, + const char *const mode +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayGetByMode", + self, extract::decay, meta::mode, mode); +} + +// Set, by mode +void +DecayPathDecaySetByMode( + ConstHandle2DecayPath self, + const char *const mode, + ConstHandle2ConstDecay decay +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DecaySetByMode", + self, extract::decay, meta::mode, mode, decay); +} + +// ------------------------ +// Re: metadatum complete +// ------------------------ + +// Has, by complete +int +DecayPathDecayHasByComplete( + ConstHandle2ConstDecayPath self, + const bool complete +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DecayHasByComplete", + self, extract::decay, meta::complete, complete); +} + +// Get, by complete, const +Handle2ConstDecay +DecayPathDecayGetByCompleteConst( + ConstHandle2ConstDecayPath self, + const bool complete +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayGetByCompleteConst", + self, extract::decay, meta::complete, complete); +} + +// Get, by complete, non-const +Handle2Decay +DecayPathDecayGetByComplete( + ConstHandle2DecayPath self, + const bool complete +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DecayGetByComplete", + self, extract::decay, meta::complete, complete); +} + +// Set, by complete +void +DecayPathDecaySetByComplete( + ConstHandle2DecayPath self, + const bool complete, + ConstHandle2ConstDecay decay +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DecaySetByComplete", + self, extract::decay, meta::complete, complete, decay); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DecayPath/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayPath.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayPath.h new file mode 100644 index 000000000..8ed5ec1d0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayPath.h @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DecayPath is the basic handle type in this file. Example: +// // Create a default DecayPath object: +// DecayPath handle = DecayPathDefault(); +// Functions involving DecayPath are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DECAYPATH +#define C_INTERFACE_GNDS_V2_0_GENERAL_DECAYPATH + +#include "GNDStk.h" +#include "v2.0/general/Decay.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DecayPathClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DecayPath +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DecayPathClass *DecayPath; + +// --- Const-aware handles. +typedef const struct DecayPathClass *const ConstHandle2ConstDecayPath; +typedef struct DecayPathClass *const ConstHandle2DecayPath; +typedef const struct DecayPathClass * Handle2ConstDecayPath; +typedef struct DecayPathClass * Handle2DecayPath; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDecayPath +DecayPathDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DecayPath +DecayPathDefault(); + +// --- Create, general, const +extern_c Handle2ConstDecayPath +DecayPathCreateConst( + ConstHandle2Decay *const decay, const size_t decaySize +); + +// +++ Create, general, non-const +extern_c Handle2DecayPath +DecayPathCreate( + ConstHandle2Decay *const decay, const size_t decaySize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DecayPathAssign(ConstHandle2DecayPath self, ConstHandle2ConstDecayPath from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DecayPathDelete(ConstHandle2ConstDecayPath self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DecayPathRead(ConstHandle2DecayPath self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DecayPathWrite(ConstHandle2ConstDecayPath self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DecayPathPrint(ConstHandle2ConstDecayPath self); + +// +++ Print to standard output, as XML +extern_c int +DecayPathPrintXML(ConstHandle2ConstDecayPath self); + +// +++ Print to standard output, as JSON +extern_c int +DecayPathPrintJSON(ConstHandle2ConstDecayPath self); + + +// ----------------------------------------------------------------------------- +// Child: decay +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DecayPathDecayHas(ConstHandle2ConstDecayPath self); + +// +++ Clear +extern_c void +DecayPathDecayClear(ConstHandle2DecayPath self); + +// +++ Size +extern_c size_t +DecayPathDecaySize(ConstHandle2ConstDecayPath self); + +// +++ Add +extern_c void +DecayPathDecayAdd(ConstHandle2DecayPath self, ConstHandle2ConstDecay decay); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDecay +DecayPathDecayGetConst(ConstHandle2ConstDecayPath self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Decay +DecayPathDecayGet(ConstHandle2DecayPath self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +DecayPathDecaySet( + ConstHandle2DecayPath self, + const size_t index_, + ConstHandle2ConstDecay decay +); + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// +++ Has, by index +extern_c int +DecayPathDecayHasByIndex( + ConstHandle2ConstDecayPath self, + const int index +); + +// --- Get, by index, const +extern_c Handle2ConstDecay +DecayPathDecayGetByIndexConst( + ConstHandle2ConstDecayPath self, + const int index +); + +// +++ Get, by index, non-const +extern_c Handle2Decay +DecayPathDecayGetByIndex( + ConstHandle2DecayPath self, + const int index +); + +// +++ Set, by index +extern_c void +DecayPathDecaySetByIndex( + ConstHandle2DecayPath self, + const int index, + ConstHandle2ConstDecay decay +); + +// ------------------------ +// Re: metadatum mode +// ------------------------ + +// +++ Has, by mode +extern_c int +DecayPathDecayHasByMode( + ConstHandle2ConstDecayPath self, + const char *const mode +); + +// --- Get, by mode, const +extern_c Handle2ConstDecay +DecayPathDecayGetByModeConst( + ConstHandle2ConstDecayPath self, + const char *const mode +); + +// +++ Get, by mode, non-const +extern_c Handle2Decay +DecayPathDecayGetByMode( + ConstHandle2DecayPath self, + const char *const mode +); + +// +++ Set, by mode +extern_c void +DecayPathDecaySetByMode( + ConstHandle2DecayPath self, + const char *const mode, + ConstHandle2ConstDecay decay +); + +// ------------------------ +// Re: metadatum complete +// ------------------------ + +// +++ Has, by complete +extern_c int +DecayPathDecayHasByComplete( + ConstHandle2ConstDecayPath self, + const bool complete +); + +// --- Get, by complete, const +extern_c Handle2ConstDecay +DecayPathDecayGetByCompleteConst( + ConstHandle2ConstDecayPath self, + const bool complete +); + +// +++ Get, by complete, non-const +extern_c Handle2Decay +DecayPathDecayGetByComplete( + ConstHandle2DecayPath self, + const bool complete +); + +// +++ Set, by complete +extern_c void +DecayPathDecaySetByComplete( + ConstHandle2DecayPath self, + const bool complete, + ConstHandle2ConstDecay decay +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DecayPath/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayPath/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayPath/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayPath/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DecayPath/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedBetaEnergy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedBetaEnergy.cpp new file mode 100644 index 000000000..102145169 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedBetaEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DelayedBetaEnergy.hpp" +#include "DelayedBetaEnergy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DelayedBetaEnergyClass; +using CPP = multigroup::DelayedBetaEnergy; + +static const std::string CLASSNAME = "DelayedBetaEnergy"; + +namespace extract { + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; +} + +using CPPPolynomial1d = general::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDelayedBetaEnergy +DelayedBetaEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DelayedBetaEnergy +DelayedBetaEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDelayedBetaEnergy +DelayedBetaEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2DelayedBetaEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Create, general, non-const +Handle2DelayedBetaEnergy +DelayedBetaEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2DelayedBetaEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DelayedBetaEnergyAssign(ConstHandle2DelayedBetaEnergy self, ConstHandle2ConstDelayedBetaEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DelayedBetaEnergyDelete(ConstHandle2ConstDelayedBetaEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DelayedBetaEnergyRead(ConstHandle2DelayedBetaEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DelayedBetaEnergyWrite(ConstHandle2ConstDelayedBetaEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DelayedBetaEnergyPrint(ConstHandle2ConstDelayedBetaEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DelayedBetaEnergyPrintXML(ConstHandle2ConstDelayedBetaEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DelayedBetaEnergyPrintJSON(ConstHandle2ConstDelayedBetaEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// Has +int +DelayedBetaEnergyPolynomial1dHas(ConstHandle2ConstDelayedBetaEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Polynomial1dHas", self, extract::polynomial1d); +} + +// Get, const +Handle2ConstPolynomial1d +DelayedBetaEnergyPolynomial1dGetConst(ConstHandle2ConstDelayedBetaEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGetConst", self, extract::polynomial1d); +} + +// Get, non-const +Handle2Polynomial1d +DelayedBetaEnergyPolynomial1dGet(ConstHandle2DelayedBetaEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGet", self, extract::polynomial1d); +} + +// Set +void +DelayedBetaEnergyPolynomial1dSet(ConstHandle2DelayedBetaEnergy self, ConstHandle2ConstPolynomial1d polynomial1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Polynomial1dSet", self, extract::polynomial1d, polynomial1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DelayedBetaEnergy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedBetaEnergy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedBetaEnergy.h new file mode 100644 index 000000000..5dae7f3f4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedBetaEnergy.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DelayedBetaEnergy is the basic handle type in this file. Example: +// // Create a default DelayedBetaEnergy object: +// DelayedBetaEnergy handle = DelayedBetaEnergyDefault(); +// Functions involving DelayedBetaEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DELAYEDBETAENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_DELAYEDBETAENERGY + +#include "GNDStk.h" +#include "v2.0/general/Polynomial1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DelayedBetaEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DelayedBetaEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DelayedBetaEnergyClass *DelayedBetaEnergy; + +// --- Const-aware handles. +typedef const struct DelayedBetaEnergyClass *const ConstHandle2ConstDelayedBetaEnergy; +typedef struct DelayedBetaEnergyClass *const ConstHandle2DelayedBetaEnergy; +typedef const struct DelayedBetaEnergyClass * Handle2ConstDelayedBetaEnergy; +typedef struct DelayedBetaEnergyClass * Handle2DelayedBetaEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDelayedBetaEnergy +DelayedBetaEnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DelayedBetaEnergy +DelayedBetaEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedBetaEnergy +DelayedBetaEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general, non-const +extern_c Handle2DelayedBetaEnergy +DelayedBetaEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DelayedBetaEnergyAssign(ConstHandle2DelayedBetaEnergy self, ConstHandle2ConstDelayedBetaEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DelayedBetaEnergyDelete(ConstHandle2ConstDelayedBetaEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DelayedBetaEnergyRead(ConstHandle2DelayedBetaEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DelayedBetaEnergyWrite(ConstHandle2ConstDelayedBetaEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DelayedBetaEnergyPrint(ConstHandle2ConstDelayedBetaEnergy self); + +// +++ Print to standard output, as XML +extern_c int +DelayedBetaEnergyPrintXML(ConstHandle2ConstDelayedBetaEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +DelayedBetaEnergyPrintJSON(ConstHandle2ConstDelayedBetaEnergy self); + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DelayedBetaEnergyPolynomial1dHas(ConstHandle2ConstDelayedBetaEnergy self); + +// --- Get, const +extern_c Handle2ConstPolynomial1d +DelayedBetaEnergyPolynomial1dGetConst(ConstHandle2ConstDelayedBetaEnergy self); + +// +++ Get, non-const +extern_c Handle2Polynomial1d +DelayedBetaEnergyPolynomial1dGet(ConstHandle2DelayedBetaEnergy self); + +// +++ Set +extern_c void +DelayedBetaEnergyPolynomial1dSet(ConstHandle2DelayedBetaEnergy self, ConstHandle2ConstPolynomial1d polynomial1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DelayedBetaEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedBetaEnergy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedBetaEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedBetaEnergy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedBetaEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedGammaEnergy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedGammaEnergy.cpp new file mode 100644 index 000000000..710d5a4f7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedGammaEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DelayedGammaEnergy.hpp" +#include "DelayedGammaEnergy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DelayedGammaEnergyClass; +using CPP = multigroup::DelayedGammaEnergy; + +static const std::string CLASSNAME = "DelayedGammaEnergy"; + +namespace extract { + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; +} + +using CPPPolynomial1d = general::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDelayedGammaEnergy +DelayedGammaEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DelayedGammaEnergy +DelayedGammaEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDelayedGammaEnergy +DelayedGammaEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2DelayedGammaEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Create, general, non-const +Handle2DelayedGammaEnergy +DelayedGammaEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2DelayedGammaEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DelayedGammaEnergyAssign(ConstHandle2DelayedGammaEnergy self, ConstHandle2ConstDelayedGammaEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DelayedGammaEnergyDelete(ConstHandle2ConstDelayedGammaEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DelayedGammaEnergyRead(ConstHandle2DelayedGammaEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DelayedGammaEnergyWrite(ConstHandle2ConstDelayedGammaEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DelayedGammaEnergyPrint(ConstHandle2ConstDelayedGammaEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DelayedGammaEnergyPrintXML(ConstHandle2ConstDelayedGammaEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DelayedGammaEnergyPrintJSON(ConstHandle2ConstDelayedGammaEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// Has +int +DelayedGammaEnergyPolynomial1dHas(ConstHandle2ConstDelayedGammaEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Polynomial1dHas", self, extract::polynomial1d); +} + +// Get, const +Handle2ConstPolynomial1d +DelayedGammaEnergyPolynomial1dGetConst(ConstHandle2ConstDelayedGammaEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGetConst", self, extract::polynomial1d); +} + +// Get, non-const +Handle2Polynomial1d +DelayedGammaEnergyPolynomial1dGet(ConstHandle2DelayedGammaEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGet", self, extract::polynomial1d); +} + +// Set +void +DelayedGammaEnergyPolynomial1dSet(ConstHandle2DelayedGammaEnergy self, ConstHandle2ConstPolynomial1d polynomial1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Polynomial1dSet", self, extract::polynomial1d, polynomial1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DelayedGammaEnergy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedGammaEnergy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedGammaEnergy.h new file mode 100644 index 000000000..1a48825e5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedGammaEnergy.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DelayedGammaEnergy is the basic handle type in this file. Example: +// // Create a default DelayedGammaEnergy object: +// DelayedGammaEnergy handle = DelayedGammaEnergyDefault(); +// Functions involving DelayedGammaEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DELAYEDGAMMAENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_DELAYEDGAMMAENERGY + +#include "GNDStk.h" +#include "v2.0/general/Polynomial1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DelayedGammaEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DelayedGammaEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DelayedGammaEnergyClass *DelayedGammaEnergy; + +// --- Const-aware handles. +typedef const struct DelayedGammaEnergyClass *const ConstHandle2ConstDelayedGammaEnergy; +typedef struct DelayedGammaEnergyClass *const ConstHandle2DelayedGammaEnergy; +typedef const struct DelayedGammaEnergyClass * Handle2ConstDelayedGammaEnergy; +typedef struct DelayedGammaEnergyClass * Handle2DelayedGammaEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDelayedGammaEnergy +DelayedGammaEnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DelayedGammaEnergy +DelayedGammaEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedGammaEnergy +DelayedGammaEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general, non-const +extern_c Handle2DelayedGammaEnergy +DelayedGammaEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DelayedGammaEnergyAssign(ConstHandle2DelayedGammaEnergy self, ConstHandle2ConstDelayedGammaEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DelayedGammaEnergyDelete(ConstHandle2ConstDelayedGammaEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DelayedGammaEnergyRead(ConstHandle2DelayedGammaEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DelayedGammaEnergyWrite(ConstHandle2ConstDelayedGammaEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DelayedGammaEnergyPrint(ConstHandle2ConstDelayedGammaEnergy self); + +// +++ Print to standard output, as XML +extern_c int +DelayedGammaEnergyPrintXML(ConstHandle2ConstDelayedGammaEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +DelayedGammaEnergyPrintJSON(ConstHandle2ConstDelayedGammaEnergy self); + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DelayedGammaEnergyPolynomial1dHas(ConstHandle2ConstDelayedGammaEnergy self); + +// --- Get, const +extern_c Handle2ConstPolynomial1d +DelayedGammaEnergyPolynomial1dGetConst(ConstHandle2ConstDelayedGammaEnergy self); + +// +++ Get, non-const +extern_c Handle2Polynomial1d +DelayedGammaEnergyPolynomial1dGet(ConstHandle2DelayedGammaEnergy self); + +// +++ Set +extern_c void +DelayedGammaEnergyPolynomial1dSet(ConstHandle2DelayedGammaEnergy self, ConstHandle2ConstPolynomial1d polynomial1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DelayedGammaEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedGammaEnergy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedGammaEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedGammaEnergy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedGammaEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutron.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutron.cpp new file mode 100644 index 000000000..f60fab3d8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutron.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DelayedNeutron.hpp" +#include "DelayedNeutron.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DelayedNeutronClass; +using CPP = multigroup::DelayedNeutron; + +static const std::string CLASSNAME = "DelayedNeutron"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto rate = [](auto &obj) { return &obj.rate; }; + static auto product = [](auto &obj) { return &obj.product; }; +} + +using CPPRate = general::Rate; +using CPPProduct = reduced::Product; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDelayedNeutron +DelayedNeutronDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DelayedNeutron +DelayedNeutronDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDelayedNeutron +DelayedNeutronCreateConst( + const char *const label, + ConstHandle2ConstRate rate, + ConstHandle2ConstProduct product +) { + ConstHandle2DelayedNeutron handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(rate), + detail::tocpp(product) + ); + return handle; +} + +// Create, general, non-const +Handle2DelayedNeutron +DelayedNeutronCreate( + const char *const label, + ConstHandle2ConstRate rate, + ConstHandle2ConstProduct product +) { + ConstHandle2DelayedNeutron handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(rate), + detail::tocpp(product) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DelayedNeutronAssign(ConstHandle2DelayedNeutron self, ConstHandle2ConstDelayedNeutron from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DelayedNeutronDelete(ConstHandle2ConstDelayedNeutron self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DelayedNeutronRead(ConstHandle2DelayedNeutron self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DelayedNeutronWrite(ConstHandle2ConstDelayedNeutron self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DelayedNeutronPrint(ConstHandle2ConstDelayedNeutron self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DelayedNeutronPrintXML(ConstHandle2ConstDelayedNeutron self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DelayedNeutronPrintJSON(ConstHandle2ConstDelayedNeutron self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +DelayedNeutronLabelHas(ConstHandle2ConstDelayedNeutron self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +DelayedNeutronLabelGet(ConstHandle2ConstDelayedNeutron self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +DelayedNeutronLabelSet(ConstHandle2DelayedNeutron self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: rate +// ----------------------------------------------------------------------------- + +// Has +int +DelayedNeutronRateHas(ConstHandle2ConstDelayedNeutron self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RateHas", self, extract::rate); +} + +// Get, const +Handle2ConstRate +DelayedNeutronRateGetConst(ConstHandle2ConstDelayedNeutron self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RateGetConst", self, extract::rate); +} + +// Get, non-const +Handle2Rate +DelayedNeutronRateGet(ConstHandle2DelayedNeutron self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RateGet", self, extract::rate); +} + +// Set +void +DelayedNeutronRateSet(ConstHandle2DelayedNeutron self, ConstHandle2ConstRate rate) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RateSet", self, extract::rate, rate); +} + + +// ----------------------------------------------------------------------------- +// Child: product +// ----------------------------------------------------------------------------- + +// Has +int +DelayedNeutronProductHas(ConstHandle2ConstDelayedNeutron self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductHas", self, extract::product); +} + +// Get, const +Handle2ConstProduct +DelayedNeutronProductGetConst(ConstHandle2ConstDelayedNeutron self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductGetConst", self, extract::product); +} + +// Get, non-const +Handle2Product +DelayedNeutronProductGet(ConstHandle2DelayedNeutron self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductGet", self, extract::product); +} + +// Set +void +DelayedNeutronProductSet(ConstHandle2DelayedNeutron self, ConstHandle2ConstProduct product) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductSet", self, extract::product, product); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DelayedNeutron/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutron.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutron.h new file mode 100644 index 000000000..02ee8c19d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutron.h @@ -0,0 +1,205 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DelayedNeutron is the basic handle type in this file. Example: +// // Create a default DelayedNeutron object: +// DelayedNeutron handle = DelayedNeutronDefault(); +// Functions involving DelayedNeutron are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DELAYEDNEUTRON +#define C_INTERFACE_GNDS_V2_0_GENERAL_DELAYEDNEUTRON + +#include "GNDStk.h" +#include "v2.0/general/Rate.h" +#include "v2.0/reduced/Product.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DelayedNeutronClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DelayedNeutron +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DelayedNeutronClass *DelayedNeutron; + +// --- Const-aware handles. +typedef const struct DelayedNeutronClass *const ConstHandle2ConstDelayedNeutron; +typedef struct DelayedNeutronClass *const ConstHandle2DelayedNeutron; +typedef const struct DelayedNeutronClass * Handle2ConstDelayedNeutron; +typedef struct DelayedNeutronClass * Handle2DelayedNeutron; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDelayedNeutron +DelayedNeutronDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DelayedNeutron +DelayedNeutronDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedNeutron +DelayedNeutronCreateConst( + const char *const label, + ConstHandle2ConstRate rate, + ConstHandle2ConstProduct product +); + +// +++ Create, general, non-const +extern_c Handle2DelayedNeutron +DelayedNeutronCreate( + const char *const label, + ConstHandle2ConstRate rate, + ConstHandle2ConstProduct product +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DelayedNeutronAssign(ConstHandle2DelayedNeutron self, ConstHandle2ConstDelayedNeutron from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DelayedNeutronDelete(ConstHandle2ConstDelayedNeutron self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DelayedNeutronRead(ConstHandle2DelayedNeutron self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DelayedNeutronWrite(ConstHandle2ConstDelayedNeutron self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DelayedNeutronPrint(ConstHandle2ConstDelayedNeutron self); + +// +++ Print to standard output, as XML +extern_c int +DelayedNeutronPrintXML(ConstHandle2ConstDelayedNeutron self); + +// +++ Print to standard output, as JSON +extern_c int +DelayedNeutronPrintJSON(ConstHandle2ConstDelayedNeutron self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DelayedNeutronLabelHas(ConstHandle2ConstDelayedNeutron self); + +// +++ Get +// +++ Returns by value +extern_c const char * +DelayedNeutronLabelGet(ConstHandle2ConstDelayedNeutron self); + +// +++ Set +extern_c void +DelayedNeutronLabelSet(ConstHandle2DelayedNeutron self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Child: rate +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DelayedNeutronRateHas(ConstHandle2ConstDelayedNeutron self); + +// --- Get, const +extern_c Handle2ConstRate +DelayedNeutronRateGetConst(ConstHandle2ConstDelayedNeutron self); + +// +++ Get, non-const +extern_c Handle2Rate +DelayedNeutronRateGet(ConstHandle2DelayedNeutron self); + +// +++ Set +extern_c void +DelayedNeutronRateSet(ConstHandle2DelayedNeutron self, ConstHandle2ConstRate rate); + + +// ----------------------------------------------------------------------------- +// Child: product +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DelayedNeutronProductHas(ConstHandle2ConstDelayedNeutron self); + +// --- Get, const +extern_c Handle2ConstProduct +DelayedNeutronProductGetConst(ConstHandle2ConstDelayedNeutron self); + +// +++ Get, non-const +extern_c Handle2Product +DelayedNeutronProductGet(ConstHandle2DelayedNeutron self); + +// +++ Set +extern_c void +DelayedNeutronProductSet(ConstHandle2DelayedNeutron self, ConstHandle2ConstProduct product); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DelayedNeutron/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutron/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutron/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutron/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutron/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutronKE.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutronKE.cpp new file mode 100644 index 000000000..430f5b3e9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutronKE.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DelayedNeutronKE.hpp" +#include "DelayedNeutronKE.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DelayedNeutronKEClass; +using CPP = multigroup::DelayedNeutronKE; + +static const std::string CLASSNAME = "DelayedNeutronKE"; + +namespace extract { + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPPolynomial1d = general::Polynomial1d; +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDelayedNeutronKE +DelayedNeutronKEDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DelayedNeutronKE +DelayedNeutronKEDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDelayedNeutronKE +DelayedNeutronKECreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2DelayedNeutronKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(polynomial1d), + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2DelayedNeutronKE +DelayedNeutronKECreate( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2DelayedNeutronKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(polynomial1d), + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DelayedNeutronKEAssign(ConstHandle2DelayedNeutronKE self, ConstHandle2ConstDelayedNeutronKE from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DelayedNeutronKEDelete(ConstHandle2ConstDelayedNeutronKE self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DelayedNeutronKERead(ConstHandle2DelayedNeutronKE self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DelayedNeutronKEWrite(ConstHandle2ConstDelayedNeutronKE self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DelayedNeutronKEPrint(ConstHandle2ConstDelayedNeutronKE self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DelayedNeutronKEPrintXML(ConstHandle2ConstDelayedNeutronKE self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DelayedNeutronKEPrintJSON(ConstHandle2ConstDelayedNeutronKE self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// Has +int +DelayedNeutronKEPolynomial1dHas(ConstHandle2ConstDelayedNeutronKE self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Polynomial1dHas", self, extract::polynomial1d); +} + +// Get, const +Handle2ConstPolynomial1d +DelayedNeutronKEPolynomial1dGetConst(ConstHandle2ConstDelayedNeutronKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGetConst", self, extract::polynomial1d); +} + +// Get, non-const +Handle2Polynomial1d +DelayedNeutronKEPolynomial1dGet(ConstHandle2DelayedNeutronKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGet", self, extract::polynomial1d); +} + +// Set +void +DelayedNeutronKEPolynomial1dSet(ConstHandle2DelayedNeutronKE self, ConstHandle2ConstPolynomial1d polynomial1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Polynomial1dSet", self, extract::polynomial1d, polynomial1d); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +DelayedNeutronKEXYs1dHas(ConstHandle2ConstDelayedNeutronKE self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +DelayedNeutronKEXYs1dGetConst(ConstHandle2ConstDelayedNeutronKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +DelayedNeutronKEXYs1dGet(ConstHandle2DelayedNeutronKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +DelayedNeutronKEXYs1dSet(ConstHandle2DelayedNeutronKE self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DelayedNeutronKE/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutronKE.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutronKE.h new file mode 100644 index 000000000..71e8dde02 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutronKE.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DelayedNeutronKE is the basic handle type in this file. Example: +// // Create a default DelayedNeutronKE object: +// DelayedNeutronKE handle = DelayedNeutronKEDefault(); +// Functions involving DelayedNeutronKE are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DELAYEDNEUTRONKE +#define C_INTERFACE_GNDS_V2_0_GENERAL_DELAYEDNEUTRONKE + +#include "GNDStk.h" +#include "v2.0/general/Polynomial1d.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DelayedNeutronKEClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DelayedNeutronKE +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DelayedNeutronKEClass *DelayedNeutronKE; + +// --- Const-aware handles. +typedef const struct DelayedNeutronKEClass *const ConstHandle2ConstDelayedNeutronKE; +typedef struct DelayedNeutronKEClass *const ConstHandle2DelayedNeutronKE; +typedef const struct DelayedNeutronKEClass * Handle2ConstDelayedNeutronKE; +typedef struct DelayedNeutronKEClass * Handle2DelayedNeutronKE; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDelayedNeutronKE +DelayedNeutronKEDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DelayedNeutronKE +DelayedNeutronKEDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedNeutronKE +DelayedNeutronKECreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2DelayedNeutronKE +DelayedNeutronKECreate( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DelayedNeutronKEAssign(ConstHandle2DelayedNeutronKE self, ConstHandle2ConstDelayedNeutronKE from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DelayedNeutronKEDelete(ConstHandle2ConstDelayedNeutronKE self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DelayedNeutronKERead(ConstHandle2DelayedNeutronKE self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DelayedNeutronKEWrite(ConstHandle2ConstDelayedNeutronKE self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DelayedNeutronKEPrint(ConstHandle2ConstDelayedNeutronKE self); + +// +++ Print to standard output, as XML +extern_c int +DelayedNeutronKEPrintXML(ConstHandle2ConstDelayedNeutronKE self); + +// +++ Print to standard output, as JSON +extern_c int +DelayedNeutronKEPrintJSON(ConstHandle2ConstDelayedNeutronKE self); + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DelayedNeutronKEPolynomial1dHas(ConstHandle2ConstDelayedNeutronKE self); + +// --- Get, const +extern_c Handle2ConstPolynomial1d +DelayedNeutronKEPolynomial1dGetConst(ConstHandle2ConstDelayedNeutronKE self); + +// +++ Get, non-const +extern_c Handle2Polynomial1d +DelayedNeutronKEPolynomial1dGet(ConstHandle2DelayedNeutronKE self); + +// +++ Set +extern_c void +DelayedNeutronKEPolynomial1dSet(ConstHandle2DelayedNeutronKE self, ConstHandle2ConstPolynomial1d polynomial1d); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DelayedNeutronKEXYs1dHas(ConstHandle2ConstDelayedNeutronKE self); + +// --- Get, const +extern_c Handle2ConstXYs1d +DelayedNeutronKEXYs1dGetConst(ConstHandle2ConstDelayedNeutronKE self); + +// +++ Get, non-const +extern_c Handle2XYs1d +DelayedNeutronKEXYs1dGet(ConstHandle2DelayedNeutronKE self); + +// +++ Set +extern_c void +DelayedNeutronKEXYs1dSet(ConstHandle2DelayedNeutronKE self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DelayedNeutronKE/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutronKE/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutronKE/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutronKE/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutronKE/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutrons.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutrons.cpp new file mode 100644 index 000000000..e63fc4979 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutrons.cpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DelayedNeutrons.hpp" +#include "DelayedNeutrons.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DelayedNeutronsClass; +using CPP = multigroup::DelayedNeutrons; + +static const std::string CLASSNAME = "DelayedNeutrons"; + +namespace extract { + static auto delayedNeutron = [](auto &obj) { return &obj.delayedNeutron; }; +} + +using CPPDelayedNeutron = general::DelayedNeutron; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDelayedNeutrons +DelayedNeutronsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DelayedNeutrons +DelayedNeutronsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDelayedNeutrons +DelayedNeutronsCreateConst( + ConstHandle2DelayedNeutron *const delayedNeutron, const size_t delayedNeutronSize +) { + ConstHandle2DelayedNeutrons handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t DelayedNeutronN = 0; DelayedNeutronN < delayedNeutronSize; ++DelayedNeutronN) + DelayedNeutronsDelayedNeutronAdd(handle, delayedNeutron[DelayedNeutronN]); + return handle; +} + +// Create, general, non-const +Handle2DelayedNeutrons +DelayedNeutronsCreate( + ConstHandle2DelayedNeutron *const delayedNeutron, const size_t delayedNeutronSize +) { + ConstHandle2DelayedNeutrons handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t DelayedNeutronN = 0; DelayedNeutronN < delayedNeutronSize; ++DelayedNeutronN) + DelayedNeutronsDelayedNeutronAdd(handle, delayedNeutron[DelayedNeutronN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DelayedNeutronsAssign(ConstHandle2DelayedNeutrons self, ConstHandle2ConstDelayedNeutrons from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DelayedNeutronsDelete(ConstHandle2ConstDelayedNeutrons self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DelayedNeutronsRead(ConstHandle2DelayedNeutrons self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DelayedNeutronsWrite(ConstHandle2ConstDelayedNeutrons self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DelayedNeutronsPrint(ConstHandle2ConstDelayedNeutrons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DelayedNeutronsPrintXML(ConstHandle2ConstDelayedNeutrons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DelayedNeutronsPrintJSON(ConstHandle2ConstDelayedNeutrons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: delayedNeutron +// ----------------------------------------------------------------------------- + +// Has +int +DelayedNeutronsDelayedNeutronHas(ConstHandle2ConstDelayedNeutrons self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DelayedNeutronHas", self, extract::delayedNeutron); +} + +// Clear +void +DelayedNeutronsDelayedNeutronClear(ConstHandle2DelayedNeutrons self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DelayedNeutronClear", self, extract::delayedNeutron); +} + +// Size +size_t +DelayedNeutronsDelayedNeutronSize(ConstHandle2ConstDelayedNeutrons self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DelayedNeutronSize", self, extract::delayedNeutron); +} + +// Add +void +DelayedNeutronsDelayedNeutronAdd(ConstHandle2DelayedNeutrons self, ConstHandle2ConstDelayedNeutron delayedNeutron) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DelayedNeutronAdd", self, extract::delayedNeutron, delayedNeutron); +} + +// Get, by index \in [0,size), const +Handle2ConstDelayedNeutron +DelayedNeutronsDelayedNeutronGetConst(ConstHandle2ConstDelayedNeutrons self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DelayedNeutronGetConst", self, extract::delayedNeutron, index_); +} + +// Get, by index \in [0,size), non-const +Handle2DelayedNeutron +DelayedNeutronsDelayedNeutronGet(ConstHandle2DelayedNeutrons self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DelayedNeutronGet", self, extract::delayedNeutron, index_); +} + +// Set, by index \in [0,size) +void +DelayedNeutronsDelayedNeutronSet( + ConstHandle2DelayedNeutrons self, + const size_t index_, + ConstHandle2ConstDelayedNeutron delayedNeutron +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DelayedNeutronSet", self, extract::delayedNeutron, index_, delayedNeutron); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +DelayedNeutronsDelayedNeutronHasByLabel( + ConstHandle2ConstDelayedNeutrons self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DelayedNeutronHasByLabel", + self, extract::delayedNeutron, meta::label, label); +} + +// Get, by label, const +Handle2ConstDelayedNeutron +DelayedNeutronsDelayedNeutronGetByLabelConst( + ConstHandle2ConstDelayedNeutrons self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DelayedNeutronGetByLabelConst", + self, extract::delayedNeutron, meta::label, label); +} + +// Get, by label, non-const +Handle2DelayedNeutron +DelayedNeutronsDelayedNeutronGetByLabel( + ConstHandle2DelayedNeutrons self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DelayedNeutronGetByLabel", + self, extract::delayedNeutron, meta::label, label); +} + +// Set, by label +void +DelayedNeutronsDelayedNeutronSetByLabel( + ConstHandle2DelayedNeutrons self, + const char *const label, + ConstHandle2ConstDelayedNeutron delayedNeutron +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DelayedNeutronSetByLabel", + self, extract::delayedNeutron, meta::label, label, delayedNeutron); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DelayedNeutrons/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutrons.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutrons.h new file mode 100644 index 000000000..be1f3dabf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutrons.h @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DelayedNeutrons is the basic handle type in this file. Example: +// // Create a default DelayedNeutrons object: +// DelayedNeutrons handle = DelayedNeutronsDefault(); +// Functions involving DelayedNeutrons are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DELAYEDNEUTRONS +#define C_INTERFACE_GNDS_V2_0_GENERAL_DELAYEDNEUTRONS + +#include "GNDStk.h" +#include "v2.0/general/DelayedNeutron.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DelayedNeutronsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DelayedNeutrons +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DelayedNeutronsClass *DelayedNeutrons; + +// --- Const-aware handles. +typedef const struct DelayedNeutronsClass *const ConstHandle2ConstDelayedNeutrons; +typedef struct DelayedNeutronsClass *const ConstHandle2DelayedNeutrons; +typedef const struct DelayedNeutronsClass * Handle2ConstDelayedNeutrons; +typedef struct DelayedNeutronsClass * Handle2DelayedNeutrons; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDelayedNeutrons +DelayedNeutronsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DelayedNeutrons +DelayedNeutronsDefault(); + +// --- Create, general, const +extern_c Handle2ConstDelayedNeutrons +DelayedNeutronsCreateConst( + ConstHandle2DelayedNeutron *const delayedNeutron, const size_t delayedNeutronSize +); + +// +++ Create, general, non-const +extern_c Handle2DelayedNeutrons +DelayedNeutronsCreate( + ConstHandle2DelayedNeutron *const delayedNeutron, const size_t delayedNeutronSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DelayedNeutronsAssign(ConstHandle2DelayedNeutrons self, ConstHandle2ConstDelayedNeutrons from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DelayedNeutronsDelete(ConstHandle2ConstDelayedNeutrons self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DelayedNeutronsRead(ConstHandle2DelayedNeutrons self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DelayedNeutronsWrite(ConstHandle2ConstDelayedNeutrons self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DelayedNeutronsPrint(ConstHandle2ConstDelayedNeutrons self); + +// +++ Print to standard output, as XML +extern_c int +DelayedNeutronsPrintXML(ConstHandle2ConstDelayedNeutrons self); + +// +++ Print to standard output, as JSON +extern_c int +DelayedNeutronsPrintJSON(ConstHandle2ConstDelayedNeutrons self); + + +// ----------------------------------------------------------------------------- +// Child: delayedNeutron +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DelayedNeutronsDelayedNeutronHas(ConstHandle2ConstDelayedNeutrons self); + +// +++ Clear +extern_c void +DelayedNeutronsDelayedNeutronClear(ConstHandle2DelayedNeutrons self); + +// +++ Size +extern_c size_t +DelayedNeutronsDelayedNeutronSize(ConstHandle2ConstDelayedNeutrons self); + +// +++ Add +extern_c void +DelayedNeutronsDelayedNeutronAdd(ConstHandle2DelayedNeutrons self, ConstHandle2ConstDelayedNeutron delayedNeutron); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDelayedNeutron +DelayedNeutronsDelayedNeutronGetConst(ConstHandle2ConstDelayedNeutrons self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2DelayedNeutron +DelayedNeutronsDelayedNeutronGet(ConstHandle2DelayedNeutrons self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +DelayedNeutronsDelayedNeutronSet( + ConstHandle2DelayedNeutrons self, + const size_t index_, + ConstHandle2ConstDelayedNeutron delayedNeutron +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +DelayedNeutronsDelayedNeutronHasByLabel( + ConstHandle2ConstDelayedNeutrons self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstDelayedNeutron +DelayedNeutronsDelayedNeutronGetByLabelConst( + ConstHandle2ConstDelayedNeutrons self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2DelayedNeutron +DelayedNeutronsDelayedNeutronGetByLabel( + ConstHandle2DelayedNeutrons self, + const char *const label +); + +// +++ Set, by label +extern_c void +DelayedNeutronsDelayedNeutronSetByLabel( + ConstHandle2DelayedNeutrons self, + const char *const label, + ConstHandle2ConstDelayedNeutron delayedNeutron +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DelayedNeutrons/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutrons/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutrons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutrons/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DelayedNeutrons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Discrete.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Discrete.cpp new file mode 100644 index 000000000..b47f0328f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Discrete.cpp @@ -0,0 +1,345 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Discrete.hpp" +#include "Discrete.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DiscreteClass; +using CPP = multigroup::Discrete; + +static const std::string CLASSNAME = "Discrete"; + +namespace extract { + static auto type = [](auto &obj) { return &obj.type; }; + static auto intensity = [](auto &obj) { return &obj.intensity; }; + static auto energy = [](auto &obj) { return &obj.energy; }; + static auto internalConversionCoefficients = [](auto &obj) { return &obj.internalConversionCoefficients; }; + static auto positronEmissionIntensity = [](auto &obj) { return &obj.positronEmissionIntensity; }; +} + +using CPPIntensity = general::Intensity; +using CPPEnergy = general::Energy; +using CPPInternalConversionCoefficients = general::InternalConversionCoefficients; +using CPPPositronEmissionIntensity = general::PositronEmissionIntensity; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDiscrete +DiscreteDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Discrete +DiscreteDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDiscrete +DiscreteCreateConst( + const char *const type, + ConstHandle2ConstIntensity intensity, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstPositronEmissionIntensity positronEmissionIntensity +) { + ConstHandle2Discrete handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + type, + detail::tocpp(intensity), + detail::tocpp(energy), + detail::tocpp(internalConversionCoefficients), + detail::tocpp(positronEmissionIntensity) + ); + return handle; +} + +// Create, general, non-const +Handle2Discrete +DiscreteCreate( + const char *const type, + ConstHandle2ConstIntensity intensity, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstPositronEmissionIntensity positronEmissionIntensity +) { + ConstHandle2Discrete handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + type, + detail::tocpp(intensity), + detail::tocpp(energy), + detail::tocpp(internalConversionCoefficients), + detail::tocpp(positronEmissionIntensity) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DiscreteAssign(ConstHandle2Discrete self, ConstHandle2ConstDiscrete from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DiscreteDelete(ConstHandle2ConstDiscrete self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DiscreteRead(ConstHandle2Discrete self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DiscreteWrite(ConstHandle2ConstDiscrete self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DiscretePrint(ConstHandle2ConstDiscrete self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DiscretePrintXML(ConstHandle2ConstDiscrete self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DiscretePrintJSON(ConstHandle2ConstDiscrete self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteTypeHas(ConstHandle2ConstDiscrete self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TypeHas", self, extract::type); +} + +// Get +// Returns by value +const char * +DiscreteTypeGet(ConstHandle2ConstDiscrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypeGet", self, extract::type); +} + +// Set +void +DiscreteTypeSet(ConstHandle2Discrete self, const char *const type) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypeSet", self, extract::type, type); +} + + +// ----------------------------------------------------------------------------- +// Child: intensity +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteIntensityHas(ConstHandle2ConstDiscrete self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IntensityHas", self, extract::intensity); +} + +// Get, const +Handle2ConstIntensity +DiscreteIntensityGetConst(ConstHandle2ConstDiscrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IntensityGetConst", self, extract::intensity); +} + +// Get, non-const +Handle2Intensity +DiscreteIntensityGet(ConstHandle2Discrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IntensityGet", self, extract::intensity); +} + +// Set +void +DiscreteIntensitySet(ConstHandle2Discrete self, ConstHandle2ConstIntensity intensity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IntensitySet", self, extract::intensity, intensity); +} + + +// ----------------------------------------------------------------------------- +// Child: energy +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteEnergyHas(ConstHandle2ConstDiscrete self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EnergyHas", self, extract::energy); +} + +// Get, const +Handle2ConstEnergy +DiscreteEnergyGetConst(ConstHandle2ConstDiscrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyGetConst", self, extract::energy); +} + +// Get, non-const +Handle2Energy +DiscreteEnergyGet(ConstHandle2Discrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyGet", self, extract::energy); +} + +// Set +void +DiscreteEnergySet(ConstHandle2Discrete self, ConstHandle2ConstEnergy energy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EnergySet", self, extract::energy, energy); +} + + +// ----------------------------------------------------------------------------- +// Child: internalConversionCoefficients +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteInternalConversionCoefficientsHas(ConstHandle2ConstDiscrete self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InternalConversionCoefficientsHas", self, extract::internalConversionCoefficients); +} + +// Get, const +Handle2ConstInternalConversionCoefficients +DiscreteInternalConversionCoefficientsGetConst(ConstHandle2ConstDiscrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InternalConversionCoefficientsGetConst", self, extract::internalConversionCoefficients); +} + +// Get, non-const +Handle2InternalConversionCoefficients +DiscreteInternalConversionCoefficientsGet(ConstHandle2Discrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InternalConversionCoefficientsGet", self, extract::internalConversionCoefficients); +} + +// Set +void +DiscreteInternalConversionCoefficientsSet(ConstHandle2Discrete self, ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InternalConversionCoefficientsSet", self, extract::internalConversionCoefficients, internalConversionCoefficients); +} + + +// ----------------------------------------------------------------------------- +// Child: positronEmissionIntensity +// ----------------------------------------------------------------------------- + +// Has +int +DiscretePositronEmissionIntensityHas(ConstHandle2ConstDiscrete self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PositronEmissionIntensityHas", self, extract::positronEmissionIntensity); +} + +// Get, const +Handle2ConstPositronEmissionIntensity +DiscretePositronEmissionIntensityGetConst(ConstHandle2ConstDiscrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PositronEmissionIntensityGetConst", self, extract::positronEmissionIntensity); +} + +// Get, non-const +Handle2PositronEmissionIntensity +DiscretePositronEmissionIntensityGet(ConstHandle2Discrete self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PositronEmissionIntensityGet", self, extract::positronEmissionIntensity); +} + +// Set +void +DiscretePositronEmissionIntensitySet(ConstHandle2Discrete self, ConstHandle2ConstPositronEmissionIntensity positronEmissionIntensity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PositronEmissionIntensitySet", self, extract::positronEmissionIntensity, positronEmissionIntensity); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Discrete/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Discrete.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Discrete.h new file mode 100644 index 000000000..a046d44e7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Discrete.h @@ -0,0 +1,253 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Discrete is the basic handle type in this file. Example: +// // Create a default Discrete object: +// Discrete handle = DiscreteDefault(); +// Functions involving Discrete are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DISCRETE +#define C_INTERFACE_GNDS_V2_0_GENERAL_DISCRETE + +#include "GNDStk.h" +#include "v2.0/general/Intensity.h" +#include "v2.0/general/Energy.h" +#include "v2.0/general/InternalConversionCoefficients.h" +#include "v2.0/general/PositronEmissionIntensity.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DiscreteClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Discrete +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DiscreteClass *Discrete; + +// --- Const-aware handles. +typedef const struct DiscreteClass *const ConstHandle2ConstDiscrete; +typedef struct DiscreteClass *const ConstHandle2Discrete; +typedef const struct DiscreteClass * Handle2ConstDiscrete; +typedef struct DiscreteClass * Handle2Discrete; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDiscrete +DiscreteDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Discrete +DiscreteDefault(); + +// --- Create, general, const +extern_c Handle2ConstDiscrete +DiscreteCreateConst( + const char *const type, + ConstHandle2ConstIntensity intensity, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstPositronEmissionIntensity positronEmissionIntensity +); + +// +++ Create, general, non-const +extern_c Handle2Discrete +DiscreteCreate( + const char *const type, + ConstHandle2ConstIntensity intensity, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients, + ConstHandle2ConstPositronEmissionIntensity positronEmissionIntensity +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DiscreteAssign(ConstHandle2Discrete self, ConstHandle2ConstDiscrete from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DiscreteDelete(ConstHandle2ConstDiscrete self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DiscreteRead(ConstHandle2Discrete self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DiscreteWrite(ConstHandle2ConstDiscrete self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DiscretePrint(ConstHandle2ConstDiscrete self); + +// +++ Print to standard output, as XML +extern_c int +DiscretePrintXML(ConstHandle2ConstDiscrete self); + +// +++ Print to standard output, as JSON +extern_c int +DiscretePrintJSON(ConstHandle2ConstDiscrete self); + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteTypeHas(ConstHandle2ConstDiscrete self); + +// +++ Get +// +++ Returns by value +extern_c const char * +DiscreteTypeGet(ConstHandle2ConstDiscrete self); + +// +++ Set +extern_c void +DiscreteTypeSet(ConstHandle2Discrete self, const char *const type); + + +// ----------------------------------------------------------------------------- +// Child: intensity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteIntensityHas(ConstHandle2ConstDiscrete self); + +// --- Get, const +extern_c Handle2ConstIntensity +DiscreteIntensityGetConst(ConstHandle2ConstDiscrete self); + +// +++ Get, non-const +extern_c Handle2Intensity +DiscreteIntensityGet(ConstHandle2Discrete self); + +// +++ Set +extern_c void +DiscreteIntensitySet(ConstHandle2Discrete self, ConstHandle2ConstIntensity intensity); + + +// ----------------------------------------------------------------------------- +// Child: energy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteEnergyHas(ConstHandle2ConstDiscrete self); + +// --- Get, const +extern_c Handle2ConstEnergy +DiscreteEnergyGetConst(ConstHandle2ConstDiscrete self); + +// +++ Get, non-const +extern_c Handle2Energy +DiscreteEnergyGet(ConstHandle2Discrete self); + +// +++ Set +extern_c void +DiscreteEnergySet(ConstHandle2Discrete self, ConstHandle2ConstEnergy energy); + + +// ----------------------------------------------------------------------------- +// Child: internalConversionCoefficients +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteInternalConversionCoefficientsHas(ConstHandle2ConstDiscrete self); + +// --- Get, const +extern_c Handle2ConstInternalConversionCoefficients +DiscreteInternalConversionCoefficientsGetConst(ConstHandle2ConstDiscrete self); + +// +++ Get, non-const +extern_c Handle2InternalConversionCoefficients +DiscreteInternalConversionCoefficientsGet(ConstHandle2Discrete self); + +// +++ Set +extern_c void +DiscreteInternalConversionCoefficientsSet(ConstHandle2Discrete self, ConstHandle2ConstInternalConversionCoefficients internalConversionCoefficients); + + +// ----------------------------------------------------------------------------- +// Child: positronEmissionIntensity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscretePositronEmissionIntensityHas(ConstHandle2ConstDiscrete self); + +// --- Get, const +extern_c Handle2ConstPositronEmissionIntensity +DiscretePositronEmissionIntensityGetConst(ConstHandle2ConstDiscrete self); + +// +++ Get, non-const +extern_c Handle2PositronEmissionIntensity +DiscretePositronEmissionIntensityGet(ConstHandle2Discrete self); + +// +++ Set +extern_c void +DiscretePositronEmissionIntensitySet(ConstHandle2Discrete self, ConstHandle2ConstPositronEmissionIntensity positronEmissionIntensity); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Discrete/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Discrete/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Discrete/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Discrete/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Discrete/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DiscreteGamma.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DiscreteGamma.cpp new file mode 100644 index 000000000..50c9e0621 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DiscreteGamma.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DiscreteGamma.hpp" +#include "DiscreteGamma.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DiscreteGammaClass; +using CPP = multigroup::DiscreteGamma; + +static const std::string CLASSNAME = "DiscreteGamma"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto axes = [](auto &obj) { return &obj.axes; }; +} + +using CPPAxes = general::Axes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDiscreteGamma +DiscreteGammaDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DiscreteGamma +DiscreteGammaDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDiscreteGamma +DiscreteGammaCreateConst( + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +) { + ConstHandle2DiscreteGamma handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + domainMin, + domainMax, + detail::tocpp(axes) + ); + return handle; +} + +// Create, general, non-const +Handle2DiscreteGamma +DiscreteGammaCreate( + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +) { + ConstHandle2DiscreteGamma handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + domainMin, + domainMax, + detail::tocpp(axes) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DiscreteGammaAssign(ConstHandle2DiscreteGamma self, ConstHandle2ConstDiscreteGamma from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DiscreteGammaDelete(ConstHandle2ConstDiscreteGamma self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DiscreteGammaRead(ConstHandle2DiscreteGamma self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DiscreteGammaWrite(ConstHandle2ConstDiscreteGamma self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DiscreteGammaPrint(ConstHandle2ConstDiscreteGamma self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DiscreteGammaPrintXML(ConstHandle2ConstDiscreteGamma self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DiscreteGammaPrintJSON(ConstHandle2ConstDiscreteGamma self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteGammaValueHas(ConstHandle2ConstDiscreteGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +DiscreteGammaValueGet(ConstHandle2ConstDiscreteGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +DiscreteGammaValueSet(ConstHandle2DiscreteGamma self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteGammaDomainMinHas(ConstHandle2ConstDiscreteGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +double +DiscreteGammaDomainMinGet(ConstHandle2ConstDiscreteGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +DiscreteGammaDomainMinSet(ConstHandle2DiscreteGamma self, const double domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteGammaDomainMaxHas(ConstHandle2ConstDiscreteGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +double +DiscreteGammaDomainMaxGet(ConstHandle2ConstDiscreteGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +DiscreteGammaDomainMaxSet(ConstHandle2DiscreteGamma self, const double domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +DiscreteGammaAxesHas(ConstHandle2ConstDiscreteGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +DiscreteGammaAxesGetConst(ConstHandle2ConstDiscreteGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +DiscreteGammaAxesGet(ConstHandle2DiscreteGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +DiscreteGammaAxesSet(ConstHandle2DiscreteGamma self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DiscreteGamma/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DiscreteGamma.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DiscreteGamma.h new file mode 100644 index 000000000..77b40defb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DiscreteGamma.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DiscreteGamma is the basic handle type in this file. Example: +// // Create a default DiscreteGamma object: +// DiscreteGamma handle = DiscreteGammaDefault(); +// Functions involving DiscreteGamma are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DISCRETEGAMMA +#define C_INTERFACE_GNDS_V2_0_GENERAL_DISCRETEGAMMA + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DiscreteGammaClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DiscreteGamma +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DiscreteGammaClass *DiscreteGamma; + +// --- Const-aware handles. +typedef const struct DiscreteGammaClass *const ConstHandle2ConstDiscreteGamma; +typedef struct DiscreteGammaClass *const ConstHandle2DiscreteGamma; +typedef const struct DiscreteGammaClass * Handle2ConstDiscreteGamma; +typedef struct DiscreteGammaClass * Handle2DiscreteGamma; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDiscreteGamma +DiscreteGammaDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DiscreteGamma +DiscreteGammaDefault(); + +// --- Create, general, const +extern_c Handle2ConstDiscreteGamma +DiscreteGammaCreateConst( + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +); + +// +++ Create, general, non-const +extern_c Handle2DiscreteGamma +DiscreteGammaCreate( + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DiscreteGammaAssign(ConstHandle2DiscreteGamma self, ConstHandle2ConstDiscreteGamma from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DiscreteGammaDelete(ConstHandle2ConstDiscreteGamma self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DiscreteGammaRead(ConstHandle2DiscreteGamma self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DiscreteGammaWrite(ConstHandle2ConstDiscreteGamma self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DiscreteGammaPrint(ConstHandle2ConstDiscreteGamma self); + +// +++ Print to standard output, as XML +extern_c int +DiscreteGammaPrintXML(ConstHandle2ConstDiscreteGamma self); + +// +++ Print to standard output, as JSON +extern_c int +DiscreteGammaPrintJSON(ConstHandle2ConstDiscreteGamma self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteGammaValueHas(ConstHandle2ConstDiscreteGamma self); + +// +++ Get +// +++ Returns by value +extern_c double +DiscreteGammaValueGet(ConstHandle2ConstDiscreteGamma self); + +// +++ Set +extern_c void +DiscreteGammaValueSet(ConstHandle2DiscreteGamma self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteGammaDomainMinHas(ConstHandle2ConstDiscreteGamma self); + +// +++ Get +// +++ Returns by value +extern_c double +DiscreteGammaDomainMinGet(ConstHandle2ConstDiscreteGamma self); + +// +++ Set +extern_c void +DiscreteGammaDomainMinSet(ConstHandle2DiscreteGamma self, const double domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteGammaDomainMaxHas(ConstHandle2ConstDiscreteGamma self); + +// +++ Get +// +++ Returns by value +extern_c double +DiscreteGammaDomainMaxGet(ConstHandle2ConstDiscreteGamma self); + +// +++ Set +extern_c void +DiscreteGammaDomainMaxSet(ConstHandle2DiscreteGamma self, const double domainMax); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DiscreteGammaAxesHas(ConstHandle2ConstDiscreteGamma self); + +// --- Get, const +extern_c Handle2ConstAxes +DiscreteGammaAxesGetConst(ConstHandle2ConstDiscreteGamma self); + +// +++ Get, non-const +extern_c Handle2Axes +DiscreteGammaAxesGet(ConstHandle2DiscreteGamma self); + +// +++ Set +extern_c void +DiscreteGammaAxesSet(ConstHandle2DiscreteGamma self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DiscreteGamma/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DiscreteGamma/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DiscreteGamma/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DiscreteGamma/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DiscreteGamma/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Distribution.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Distribution.cpp new file mode 100644 index 000000000..0f87031f5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Distribution.cpp @@ -0,0 +1,611 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Distribution.hpp" +#include "Distribution.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DistributionClass; +using CPP = multigroup::Distribution; + +static const std::string CLASSNAME = "Distribution"; + +namespace extract { + static auto thermalNeutronScatteringLaw = [](auto &obj) { return &obj.thermalNeutronScatteringLaw; }; + static auto uncorrelated = [](auto &obj) { return &obj.uncorrelated; }; + static auto unspecified = [](auto &obj) { return &obj.unspecified; }; + static auto branching3d = [](auto &obj) { return &obj.branching3d; }; + static auto angularTwoBody = [](auto &obj) { return &obj.angularTwoBody; }; + static auto energyAngular = [](auto &obj) { return &obj.energyAngular; }; + static auto KalbachMann = [](auto &obj) { return &obj.KalbachMann; }; + static auto angularEnergy = [](auto &obj) { return &obj.angularEnergy; }; + static auto CoulombPlusNuclearElastic = [](auto &obj) { return &obj.CoulombPlusNuclearElastic; }; + static auto coherentPhotonScattering = [](auto &obj) { return &obj.coherentPhotonScattering; }; + static auto incoherentPhotonScattering = [](auto &obj) { return &obj.incoherentPhotonScattering; }; +} + +using CPPThermalNeutronScatteringLaw = general::ThermalNeutronScatteringLaw; +using CPPUncorrelated = general::Uncorrelated; +using CPPUnspecified = general::Unspecified; +using CPPBranching3d = general::Branching3d; +using CPPAngularTwoBody = general::AngularTwoBody; +using CPPEnergyAngular = general::EnergyAngular; +using CPPKalbachMann = general::KalbachMann; +using CPPAngularEnergy = general::AngularEnergy; +using CPPCoulombPlusNuclearElastic = general::CoulombPlusNuclearElastic; +using CPPCoherentPhotonScattering = general::CoherentPhotonScattering; +using CPPIncoherentPhotonScattering = general::IncoherentPhotonScattering; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDistribution +DistributionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Distribution +DistributionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDistribution +DistributionCreateConst( + ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw, + ConstHandle2ConstUncorrelated uncorrelated, + ConstHandle2ConstUnspecified unspecified, + ConstHandle2ConstBranching3d branching3d, + ConstHandle2ConstAngularTwoBody angularTwoBody, + ConstHandle2ConstEnergyAngular energyAngular, + ConstHandle2ConstKalbachMann KalbachMann, + ConstHandle2ConstAngularEnergy angularEnergy, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering, + ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering +) { + ConstHandle2Distribution handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(thermalNeutronScatteringLaw), + detail::tocpp(uncorrelated), + detail::tocpp(unspecified), + detail::tocpp(branching3d), + detail::tocpp(angularTwoBody), + detail::tocpp(energyAngular), + detail::tocpp(KalbachMann), + detail::tocpp(angularEnergy), + detail::tocpp(CoulombPlusNuclearElastic), + detail::tocpp(coherentPhotonScattering), + detail::tocpp(incoherentPhotonScattering) + ); + return handle; +} + +// Create, general, non-const +Handle2Distribution +DistributionCreate( + ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw, + ConstHandle2ConstUncorrelated uncorrelated, + ConstHandle2ConstUnspecified unspecified, + ConstHandle2ConstBranching3d branching3d, + ConstHandle2ConstAngularTwoBody angularTwoBody, + ConstHandle2ConstEnergyAngular energyAngular, + ConstHandle2ConstKalbachMann KalbachMann, + ConstHandle2ConstAngularEnergy angularEnergy, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering, + ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering +) { + ConstHandle2Distribution handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(thermalNeutronScatteringLaw), + detail::tocpp(uncorrelated), + detail::tocpp(unspecified), + detail::tocpp(branching3d), + detail::tocpp(angularTwoBody), + detail::tocpp(energyAngular), + detail::tocpp(KalbachMann), + detail::tocpp(angularEnergy), + detail::tocpp(CoulombPlusNuclearElastic), + detail::tocpp(coherentPhotonScattering), + detail::tocpp(incoherentPhotonScattering) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DistributionAssign(ConstHandle2Distribution self, ConstHandle2ConstDistribution from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DistributionDelete(ConstHandle2ConstDistribution self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DistributionRead(ConstHandle2Distribution self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DistributionWrite(ConstHandle2ConstDistribution self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DistributionPrint(ConstHandle2ConstDistribution self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DistributionPrintXML(ConstHandle2ConstDistribution self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DistributionPrintJSON(ConstHandle2ConstDistribution self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw +// ----------------------------------------------------------------------------- + +// Has +int +DistributionThermalNeutronScatteringLawHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLawHas", self, extract::thermalNeutronScatteringLaw); +} + +// Get, const +Handle2ConstThermalNeutronScatteringLaw +DistributionThermalNeutronScatteringLawGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLawGetConst", self, extract::thermalNeutronScatteringLaw); +} + +// Get, non-const +Handle2ThermalNeutronScatteringLaw +DistributionThermalNeutronScatteringLawGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLawGet", self, extract::thermalNeutronScatteringLaw); +} + +// Set +void +DistributionThermalNeutronScatteringLawSet(ConstHandle2Distribution self, ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLawSet", self, extract::thermalNeutronScatteringLaw, thermalNeutronScatteringLaw); +} + + +// ----------------------------------------------------------------------------- +// Child: uncorrelated +// ----------------------------------------------------------------------------- + +// Has +int +DistributionUncorrelatedHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncorrelatedHas", self, extract::uncorrelated); +} + +// Get, const +Handle2ConstUncorrelated +DistributionUncorrelatedGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncorrelatedGetConst", self, extract::uncorrelated); +} + +// Get, non-const +Handle2Uncorrelated +DistributionUncorrelatedGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncorrelatedGet", self, extract::uncorrelated); +} + +// Set +void +DistributionUncorrelatedSet(ConstHandle2Distribution self, ConstHandle2ConstUncorrelated uncorrelated) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncorrelatedSet", self, extract::uncorrelated, uncorrelated); +} + + +// ----------------------------------------------------------------------------- +// Child: unspecified +// ----------------------------------------------------------------------------- + +// Has +int +DistributionUnspecifiedHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnspecifiedHas", self, extract::unspecified); +} + +// Get, const +Handle2ConstUnspecified +DistributionUnspecifiedGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnspecifiedGetConst", self, extract::unspecified); +} + +// Get, non-const +Handle2Unspecified +DistributionUnspecifiedGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnspecifiedGet", self, extract::unspecified); +} + +// Set +void +DistributionUnspecifiedSet(ConstHandle2Distribution self, ConstHandle2ConstUnspecified unspecified) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnspecifiedSet", self, extract::unspecified, unspecified); +} + + +// ----------------------------------------------------------------------------- +// Child: branching3d +// ----------------------------------------------------------------------------- + +// Has +int +DistributionBranching3dHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Branching3dHas", self, extract::branching3d); +} + +// Get, const +Handle2ConstBranching3d +DistributionBranching3dGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Branching3dGetConst", self, extract::branching3d); +} + +// Get, non-const +Handle2Branching3d +DistributionBranching3dGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Branching3dGet", self, extract::branching3d); +} + +// Set +void +DistributionBranching3dSet(ConstHandle2Distribution self, ConstHandle2ConstBranching3d branching3d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Branching3dSet", self, extract::branching3d, branching3d); +} + + +// ----------------------------------------------------------------------------- +// Child: angularTwoBody +// ----------------------------------------------------------------------------- + +// Has +int +DistributionAngularTwoBodyHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AngularTwoBodyHas", self, extract::angularTwoBody); +} + +// Get, const +Handle2ConstAngularTwoBody +DistributionAngularTwoBodyGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AngularTwoBodyGetConst", self, extract::angularTwoBody); +} + +// Get, non-const +Handle2AngularTwoBody +DistributionAngularTwoBodyGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AngularTwoBodyGet", self, extract::angularTwoBody); +} + +// Set +void +DistributionAngularTwoBodySet(ConstHandle2Distribution self, ConstHandle2ConstAngularTwoBody angularTwoBody) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AngularTwoBodySet", self, extract::angularTwoBody, angularTwoBody); +} + + +// ----------------------------------------------------------------------------- +// Child: energyAngular +// ----------------------------------------------------------------------------- + +// Has +int +DistributionEnergyAngularHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EnergyAngularHas", self, extract::energyAngular); +} + +// Get, const +Handle2ConstEnergyAngular +DistributionEnergyAngularGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyAngularGetConst", self, extract::energyAngular); +} + +// Get, non-const +Handle2EnergyAngular +DistributionEnergyAngularGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyAngularGet", self, extract::energyAngular); +} + +// Set +void +DistributionEnergyAngularSet(ConstHandle2Distribution self, ConstHandle2ConstEnergyAngular energyAngular) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EnergyAngularSet", self, extract::energyAngular, energyAngular); +} + + +// ----------------------------------------------------------------------------- +// Child: KalbachMann +// ----------------------------------------------------------------------------- + +// Has +int +DistributionKalbachMannHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"KalbachMannHas", self, extract::KalbachMann); +} + +// Get, const +Handle2ConstKalbachMann +DistributionKalbachMannGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"KalbachMannGetConst", self, extract::KalbachMann); +} + +// Get, non-const +Handle2KalbachMann +DistributionKalbachMannGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"KalbachMannGet", self, extract::KalbachMann); +} + +// Set +void +DistributionKalbachMannSet(ConstHandle2Distribution self, ConstHandle2ConstKalbachMann KalbachMann) +{ + detail::setField + (CLASSNAME, CLASSNAME+"KalbachMannSet", self, extract::KalbachMann, KalbachMann); +} + + +// ----------------------------------------------------------------------------- +// Child: angularEnergy +// ----------------------------------------------------------------------------- + +// Has +int +DistributionAngularEnergyHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AngularEnergyHas", self, extract::angularEnergy); +} + +// Get, const +Handle2ConstAngularEnergy +DistributionAngularEnergyGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AngularEnergyGetConst", self, extract::angularEnergy); +} + +// Get, non-const +Handle2AngularEnergy +DistributionAngularEnergyGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AngularEnergyGet", self, extract::angularEnergy); +} + +// Set +void +DistributionAngularEnergySet(ConstHandle2Distribution self, ConstHandle2ConstAngularEnergy angularEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AngularEnergySet", self, extract::angularEnergy, angularEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: CoulombPlusNuclearElastic +// ----------------------------------------------------------------------------- + +// Has +int +DistributionCoulombPlusNuclearElasticHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticHas", self, extract::CoulombPlusNuclearElastic); +} + +// Get, const +Handle2ConstCoulombPlusNuclearElastic +DistributionCoulombPlusNuclearElasticGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticGetConst", self, extract::CoulombPlusNuclearElastic); +} + +// Get, non-const +Handle2CoulombPlusNuclearElastic +DistributionCoulombPlusNuclearElasticGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticGet", self, extract::CoulombPlusNuclearElastic); +} + +// Set +void +DistributionCoulombPlusNuclearElasticSet(ConstHandle2Distribution self, ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticSet", self, extract::CoulombPlusNuclearElastic, CoulombPlusNuclearElastic); +} + + +// ----------------------------------------------------------------------------- +// Child: coherentPhotonScattering +// ----------------------------------------------------------------------------- + +// Has +int +DistributionCoherentPhotonScatteringHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CoherentPhotonScatteringHas", self, extract::coherentPhotonScattering); +} + +// Get, const +Handle2ConstCoherentPhotonScattering +DistributionCoherentPhotonScatteringGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoherentPhotonScatteringGetConst", self, extract::coherentPhotonScattering); +} + +// Get, non-const +Handle2CoherentPhotonScattering +DistributionCoherentPhotonScatteringGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoherentPhotonScatteringGet", self, extract::coherentPhotonScattering); +} + +// Set +void +DistributionCoherentPhotonScatteringSet(ConstHandle2Distribution self, ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CoherentPhotonScatteringSet", self, extract::coherentPhotonScattering, coherentPhotonScattering); +} + + +// ----------------------------------------------------------------------------- +// Child: incoherentPhotonScattering +// ----------------------------------------------------------------------------- + +// Has +int +DistributionIncoherentPhotonScatteringHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IncoherentPhotonScatteringHas", self, extract::incoherentPhotonScattering); +} + +// Get, const +Handle2ConstIncoherentPhotonScattering +DistributionIncoherentPhotonScatteringGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IncoherentPhotonScatteringGetConst", self, extract::incoherentPhotonScattering); +} + +// Get, non-const +Handle2IncoherentPhotonScattering +DistributionIncoherentPhotonScatteringGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IncoherentPhotonScatteringGet", self, extract::incoherentPhotonScattering); +} + +// Set +void +DistributionIncoherentPhotonScatteringSet(ConstHandle2Distribution self, ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IncoherentPhotonScatteringSet", self, extract::incoherentPhotonScattering, incoherentPhotonScattering); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Distribution/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Distribution.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Distribution.h new file mode 100644 index 000000000..789d1ba2b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Distribution.h @@ -0,0 +1,401 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Distribution is the basic handle type in this file. Example: +// // Create a default Distribution object: +// Distribution handle = DistributionDefault(); +// Functions involving Distribution are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DISTRIBUTION +#define C_INTERFACE_GNDS_V2_0_GENERAL_DISTRIBUTION + +#include "GNDStk.h" +#include "v2.0/general/ThermalNeutronScatteringLaw.h" +#include "v2.0/general/Uncorrelated.h" +#include "v2.0/general/Unspecified.h" +#include "v2.0/general/Branching3d.h" +#include "v2.0/general/AngularTwoBody.h" +#include "v2.0/general/EnergyAngular.h" +#include "v2.0/general/KalbachMann.h" +#include "v2.0/general/AngularEnergy.h" +#include "v2.0/general/CoulombPlusNuclearElastic.h" +#include "v2.0/general/CoherentPhotonScattering.h" +#include "v2.0/general/IncoherentPhotonScattering.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DistributionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Distribution +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DistributionClass *Distribution; + +// --- Const-aware handles. +typedef const struct DistributionClass *const ConstHandle2ConstDistribution; +typedef struct DistributionClass *const ConstHandle2Distribution; +typedef const struct DistributionClass * Handle2ConstDistribution; +typedef struct DistributionClass * Handle2Distribution; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDistribution +DistributionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Distribution +DistributionDefault(); + +// --- Create, general, const +extern_c Handle2ConstDistribution +DistributionCreateConst( + ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw, + ConstHandle2ConstUncorrelated uncorrelated, + ConstHandle2ConstUnspecified unspecified, + ConstHandle2ConstBranching3d branching3d, + ConstHandle2ConstAngularTwoBody angularTwoBody, + ConstHandle2ConstEnergyAngular energyAngular, + ConstHandle2ConstKalbachMann KalbachMann, + ConstHandle2ConstAngularEnergy angularEnergy, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering, + ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering +); + +// +++ Create, general, non-const +extern_c Handle2Distribution +DistributionCreate( + ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw, + ConstHandle2ConstUncorrelated uncorrelated, + ConstHandle2ConstUnspecified unspecified, + ConstHandle2ConstBranching3d branching3d, + ConstHandle2ConstAngularTwoBody angularTwoBody, + ConstHandle2ConstEnergyAngular energyAngular, + ConstHandle2ConstKalbachMann KalbachMann, + ConstHandle2ConstAngularEnergy angularEnergy, + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering, + ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DistributionAssign(ConstHandle2Distribution self, ConstHandle2ConstDistribution from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DistributionDelete(ConstHandle2ConstDistribution self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DistributionRead(ConstHandle2Distribution self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DistributionWrite(ConstHandle2ConstDistribution self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DistributionPrint(ConstHandle2ConstDistribution self); + +// +++ Print to standard output, as XML +extern_c int +DistributionPrintXML(ConstHandle2ConstDistribution self); + +// +++ Print to standard output, as JSON +extern_c int +DistributionPrintJSON(ConstHandle2ConstDistribution self); + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionThermalNeutronScatteringLawHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstThermalNeutronScatteringLaw +DistributionThermalNeutronScatteringLawGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2ThermalNeutronScatteringLaw +DistributionThermalNeutronScatteringLawGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionThermalNeutronScatteringLawSet(ConstHandle2Distribution self, ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw); + + +// ----------------------------------------------------------------------------- +// Child: uncorrelated +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionUncorrelatedHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstUncorrelated +DistributionUncorrelatedGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2Uncorrelated +DistributionUncorrelatedGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionUncorrelatedSet(ConstHandle2Distribution self, ConstHandle2ConstUncorrelated uncorrelated); + + +// ----------------------------------------------------------------------------- +// Child: unspecified +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionUnspecifiedHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstUnspecified +DistributionUnspecifiedGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2Unspecified +DistributionUnspecifiedGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionUnspecifiedSet(ConstHandle2Distribution self, ConstHandle2ConstUnspecified unspecified); + + +// ----------------------------------------------------------------------------- +// Child: branching3d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionBranching3dHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstBranching3d +DistributionBranching3dGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2Branching3d +DistributionBranching3dGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionBranching3dSet(ConstHandle2Distribution self, ConstHandle2ConstBranching3d branching3d); + + +// ----------------------------------------------------------------------------- +// Child: angularTwoBody +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionAngularTwoBodyHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstAngularTwoBody +DistributionAngularTwoBodyGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2AngularTwoBody +DistributionAngularTwoBodyGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionAngularTwoBodySet(ConstHandle2Distribution self, ConstHandle2ConstAngularTwoBody angularTwoBody); + + +// ----------------------------------------------------------------------------- +// Child: energyAngular +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionEnergyAngularHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstEnergyAngular +DistributionEnergyAngularGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2EnergyAngular +DistributionEnergyAngularGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionEnergyAngularSet(ConstHandle2Distribution self, ConstHandle2ConstEnergyAngular energyAngular); + + +// ----------------------------------------------------------------------------- +// Child: KalbachMann +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionKalbachMannHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstKalbachMann +DistributionKalbachMannGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2KalbachMann +DistributionKalbachMannGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionKalbachMannSet(ConstHandle2Distribution self, ConstHandle2ConstKalbachMann KalbachMann); + + +// ----------------------------------------------------------------------------- +// Child: angularEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionAngularEnergyHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstAngularEnergy +DistributionAngularEnergyGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2AngularEnergy +DistributionAngularEnergyGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionAngularEnergySet(ConstHandle2Distribution self, ConstHandle2ConstAngularEnergy angularEnergy); + + +// ----------------------------------------------------------------------------- +// Child: CoulombPlusNuclearElastic +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionCoulombPlusNuclearElasticHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstCoulombPlusNuclearElastic +DistributionCoulombPlusNuclearElasticGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2CoulombPlusNuclearElastic +DistributionCoulombPlusNuclearElasticGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionCoulombPlusNuclearElasticSet(ConstHandle2Distribution self, ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic); + + +// ----------------------------------------------------------------------------- +// Child: coherentPhotonScattering +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionCoherentPhotonScatteringHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstCoherentPhotonScattering +DistributionCoherentPhotonScatteringGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2CoherentPhotonScattering +DistributionCoherentPhotonScatteringGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionCoherentPhotonScatteringSet(ConstHandle2Distribution self, ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering); + + +// ----------------------------------------------------------------------------- +// Child: incoherentPhotonScattering +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionIncoherentPhotonScatteringHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstIncoherentPhotonScattering +DistributionIncoherentPhotonScatteringGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2IncoherentPhotonScattering +DistributionIncoherentPhotonScatteringGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionIncoherentPhotonScatteringSet(ConstHandle2Distribution self, ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Distribution/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Distribution/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Distribution/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Distribution/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Distribution/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Documentation.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Documentation.cpp new file mode 100644 index 000000000..ee1b06cb3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Documentation.cpp @@ -0,0 +1,353 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Documentation.hpp" +#include "Documentation.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DocumentationClass; +using CPP = multigroup::Documentation; + +static const std::string CLASSNAME = "Documentation"; + +namespace extract { + static auto authors = [](auto &obj) { return &obj.authors; }; + static auto dates = [](auto &obj) { return &obj.dates; }; + static auto title = [](auto &obj) { return &obj.title; }; + static auto body = [](auto &obj) { return &obj.body; }; + static auto endfCompatible = [](auto &obj) { return &obj.endfCompatible; }; +} + +using CPPAuthors = general::Authors; +using CPPDates = general::Dates; +using CPPTitle = general::Title; +using CPPBody = general::Body; +using CPPEndfCompatible = general::EndfCompatible; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDocumentation +DocumentationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Documentation +DocumentationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDocumentation +DocumentationCreateConst( + ConstHandle2ConstAuthors authors, + ConstHandle2ConstDates dates, + ConstHandle2ConstTitle title, + ConstHandle2ConstBody body, + ConstHandle2ConstEndfCompatible endfCompatible +) { + ConstHandle2Documentation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(authors), + detail::tocpp(dates), + detail::tocpp(title), + detail::tocpp(body), + detail::tocpp(endfCompatible) + ); + return handle; +} + +// Create, general, non-const +Handle2Documentation +DocumentationCreate( + ConstHandle2ConstAuthors authors, + ConstHandle2ConstDates dates, + ConstHandle2ConstTitle title, + ConstHandle2ConstBody body, + ConstHandle2ConstEndfCompatible endfCompatible +) { + ConstHandle2Documentation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(authors), + detail::tocpp(dates), + detail::tocpp(title), + detail::tocpp(body), + detail::tocpp(endfCompatible) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DocumentationAssign(ConstHandle2Documentation self, ConstHandle2ConstDocumentation from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DocumentationDelete(ConstHandle2ConstDocumentation self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DocumentationRead(ConstHandle2Documentation self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DocumentationWrite(ConstHandle2ConstDocumentation self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DocumentationPrint(ConstHandle2ConstDocumentation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DocumentationPrintXML(ConstHandle2ConstDocumentation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DocumentationPrintJSON(ConstHandle2ConstDocumentation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: authors +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationAuthorsHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AuthorsHas", self, extract::authors); +} + +// Get, const +Handle2ConstAuthors +DocumentationAuthorsGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AuthorsGetConst", self, extract::authors); +} + +// Get, non-const +Handle2Authors +DocumentationAuthorsGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AuthorsGet", self, extract::authors); +} + +// Set +void +DocumentationAuthorsSet(ConstHandle2Documentation self, ConstHandle2ConstAuthors authors) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AuthorsSet", self, extract::authors, authors); +} + + +// ----------------------------------------------------------------------------- +// Child: dates +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationDatesHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DatesHas", self, extract::dates); +} + +// Get, const +Handle2ConstDates +DocumentationDatesGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DatesGetConst", self, extract::dates); +} + +// Get, non-const +Handle2Dates +DocumentationDatesGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DatesGet", self, extract::dates); +} + +// Set +void +DocumentationDatesSet(ConstHandle2Documentation self, ConstHandle2ConstDates dates) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DatesSet", self, extract::dates, dates); +} + + +// ----------------------------------------------------------------------------- +// Child: title +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationTitleHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TitleHas", self, extract::title); +} + +// Get, const +Handle2ConstTitle +DocumentationTitleGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TitleGetConst", self, extract::title); +} + +// Get, non-const +Handle2Title +DocumentationTitleGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TitleGet", self, extract::title); +} + +// Set +void +DocumentationTitleSet(ConstHandle2Documentation self, ConstHandle2ConstTitle title) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TitleSet", self, extract::title, title); +} + + +// ----------------------------------------------------------------------------- +// Child: body +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationBodyHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BodyHas", self, extract::body); +} + +// Get, const +Handle2ConstBody +DocumentationBodyGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BodyGetConst", self, extract::body); +} + +// Get, non-const +Handle2Body +DocumentationBodyGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BodyGet", self, extract::body); +} + +// Set +void +DocumentationBodySet(ConstHandle2Documentation self, ConstHandle2ConstBody body) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BodySet", self, extract::body, body); +} + + +// ----------------------------------------------------------------------------- +// Child: endfCompatible +// ----------------------------------------------------------------------------- + +// Has +int +DocumentationEndfCompatibleHas(ConstHandle2ConstDocumentation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EndfCompatibleHas", self, extract::endfCompatible); +} + +// Get, const +Handle2ConstEndfCompatible +DocumentationEndfCompatibleGetConst(ConstHandle2ConstDocumentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EndfCompatibleGetConst", self, extract::endfCompatible); +} + +// Get, non-const +Handle2EndfCompatible +DocumentationEndfCompatibleGet(ConstHandle2Documentation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EndfCompatibleGet", self, extract::endfCompatible); +} + +// Set +void +DocumentationEndfCompatibleSet(ConstHandle2Documentation self, ConstHandle2ConstEndfCompatible endfCompatible) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EndfCompatibleSet", self, extract::endfCompatible, endfCompatible); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Documentation/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Documentation.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Documentation.h new file mode 100644 index 000000000..fc610d9ab --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Documentation.h @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Documentation is the basic handle type in this file. Example: +// // Create a default Documentation object: +// Documentation handle = DocumentationDefault(); +// Functions involving Documentation are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DOCUMENTATION +#define C_INTERFACE_GNDS_V2_0_GENERAL_DOCUMENTATION + +#include "GNDStk.h" +#include "v2.0/general/Authors.h" +#include "v2.0/general/Dates.h" +#include "v2.0/general/Title.h" +#include "v2.0/general/Body.h" +#include "v2.0/general/EndfCompatible.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DocumentationClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Documentation +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DocumentationClass *Documentation; + +// --- Const-aware handles. +typedef const struct DocumentationClass *const ConstHandle2ConstDocumentation; +typedef struct DocumentationClass *const ConstHandle2Documentation; +typedef const struct DocumentationClass * Handle2ConstDocumentation; +typedef struct DocumentationClass * Handle2Documentation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDocumentation +DocumentationDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Documentation +DocumentationDefault(); + +// --- Create, general, const +extern_c Handle2ConstDocumentation +DocumentationCreateConst( + ConstHandle2ConstAuthors authors, + ConstHandle2ConstDates dates, + ConstHandle2ConstTitle title, + ConstHandle2ConstBody body, + ConstHandle2ConstEndfCompatible endfCompatible +); + +// +++ Create, general, non-const +extern_c Handle2Documentation +DocumentationCreate( + ConstHandle2ConstAuthors authors, + ConstHandle2ConstDates dates, + ConstHandle2ConstTitle title, + ConstHandle2ConstBody body, + ConstHandle2ConstEndfCompatible endfCompatible +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DocumentationAssign(ConstHandle2Documentation self, ConstHandle2ConstDocumentation from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DocumentationDelete(ConstHandle2ConstDocumentation self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DocumentationRead(ConstHandle2Documentation self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DocumentationWrite(ConstHandle2ConstDocumentation self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DocumentationPrint(ConstHandle2ConstDocumentation self); + +// +++ Print to standard output, as XML +extern_c int +DocumentationPrintXML(ConstHandle2ConstDocumentation self); + +// +++ Print to standard output, as JSON +extern_c int +DocumentationPrintJSON(ConstHandle2ConstDocumentation self); + + +// ----------------------------------------------------------------------------- +// Child: authors +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationAuthorsHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstAuthors +DocumentationAuthorsGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2Authors +DocumentationAuthorsGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationAuthorsSet(ConstHandle2Documentation self, ConstHandle2ConstAuthors authors); + + +// ----------------------------------------------------------------------------- +// Child: dates +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationDatesHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstDates +DocumentationDatesGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2Dates +DocumentationDatesGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationDatesSet(ConstHandle2Documentation self, ConstHandle2ConstDates dates); + + +// ----------------------------------------------------------------------------- +// Child: title +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationTitleHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstTitle +DocumentationTitleGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2Title +DocumentationTitleGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationTitleSet(ConstHandle2Documentation self, ConstHandle2ConstTitle title); + + +// ----------------------------------------------------------------------------- +// Child: body +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationBodyHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstBody +DocumentationBodyGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2Body +DocumentationBodyGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationBodySet(ConstHandle2Documentation self, ConstHandle2ConstBody body); + + +// ----------------------------------------------------------------------------- +// Child: endfCompatible +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DocumentationEndfCompatibleHas(ConstHandle2ConstDocumentation self); + +// --- Get, const +extern_c Handle2ConstEndfCompatible +DocumentationEndfCompatibleGetConst(ConstHandle2ConstDocumentation self); + +// +++ Get, non-const +extern_c Handle2EndfCompatible +DocumentationEndfCompatibleGet(ConstHandle2Documentation self); + +// +++ Set +extern_c void +DocumentationEndfCompatibleSet(ConstHandle2Documentation self, ConstHandle2ConstEndfCompatible endfCompatible); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Documentation/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Documentation/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Documentation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Documentation/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Documentation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Double.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Double.cpp new file mode 100644 index 000000000..fa48304b7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Double.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Double.hpp" +#include "Double.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DoubleClass; +using CPP = multigroup::Double; + +static const std::string CLASSNAME = "Double"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPUncertainty = general::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDouble +DoubleDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Double +DoubleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDouble +DoubleCreateConst( + const char *const label, + const double value, + const char *const unit, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Double handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + unit, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general, non-const +Handle2Double +DoubleCreate( + const char *const label, + const double value, + const char *const unit, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Double handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + unit, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DoubleAssign(ConstHandle2Double self, ConstHandle2ConstDouble from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DoubleDelete(ConstHandle2ConstDouble self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DoubleRead(ConstHandle2Double self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DoubleWrite(ConstHandle2ConstDouble self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DoublePrint(ConstHandle2ConstDouble self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DoublePrintXML(ConstHandle2ConstDouble self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DoublePrintJSON(ConstHandle2ConstDouble self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +DoubleLabelHas(ConstHandle2ConstDouble self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +DoubleLabelGet(ConstHandle2ConstDouble self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +DoubleLabelSet(ConstHandle2Double self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +DoubleValueHas(ConstHandle2ConstDouble self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +DoubleValueGet(ConstHandle2ConstDouble self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +DoubleValueSet(ConstHandle2Double self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +DoubleUnitHas(ConstHandle2ConstDouble self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +DoubleUnitGet(ConstHandle2ConstDouble self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +DoubleUnitSet(ConstHandle2Double self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +DoubleUncertaintyHas(ConstHandle2ConstDouble self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +DoubleUncertaintyGetConst(ConstHandle2ConstDouble self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +DoubleUncertaintyGet(ConstHandle2Double self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +DoubleUncertaintySet(ConstHandle2Double self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Double/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Double.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Double.h new file mode 100644 index 000000000..e7c9c96b7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Double.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Double is the basic handle type in this file. Example: +// // Create a default Double object: +// Double handle = DoubleDefault(); +// Functions involving Double are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DOUBLE +#define C_INTERFACE_GNDS_V2_0_GENERAL_DOUBLE + +#include "GNDStk.h" +#include "v2.0/general/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DoubleClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Double +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DoubleClass *Double; + +// --- Const-aware handles. +typedef const struct DoubleClass *const ConstHandle2ConstDouble; +typedef struct DoubleClass *const ConstHandle2Double; +typedef const struct DoubleClass * Handle2ConstDouble; +typedef struct DoubleClass * Handle2Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDouble +DoubleDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Double +DoubleDefault(); + +// --- Create, general, const +extern_c Handle2ConstDouble +DoubleCreateConst( + const char *const label, + const double value, + const char *const unit, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general, non-const +extern_c Handle2Double +DoubleCreate( + const char *const label, + const double value, + const char *const unit, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DoubleAssign(ConstHandle2Double self, ConstHandle2ConstDouble from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DoubleDelete(ConstHandle2ConstDouble self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DoubleRead(ConstHandle2Double self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DoubleWrite(ConstHandle2ConstDouble self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DoublePrint(ConstHandle2ConstDouble self); + +// +++ Print to standard output, as XML +extern_c int +DoublePrintXML(ConstHandle2ConstDouble self); + +// +++ Print to standard output, as JSON +extern_c int +DoublePrintJSON(ConstHandle2ConstDouble self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleLabelHas(ConstHandle2ConstDouble self); + +// +++ Get +// +++ Returns by value +extern_c const char * +DoubleLabelGet(ConstHandle2ConstDouble self); + +// +++ Set +extern_c void +DoubleLabelSet(ConstHandle2Double self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleValueHas(ConstHandle2ConstDouble self); + +// +++ Get +// +++ Returns by value +extern_c double +DoubleValueGet(ConstHandle2ConstDouble self); + +// +++ Set +extern_c void +DoubleValueSet(ConstHandle2Double self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleUnitHas(ConstHandle2ConstDouble self); + +// +++ Get +// +++ Returns by value +extern_c const char * +DoubleUnitGet(ConstHandle2ConstDouble self); + +// +++ Set +extern_c void +DoubleUnitSet(ConstHandle2Double self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleUncertaintyHas(ConstHandle2ConstDouble self); + +// --- Get, const +extern_c Handle2ConstUncertainty +DoubleUncertaintyGetConst(ConstHandle2ConstDouble self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +DoubleUncertaintyGet(ConstHandle2Double self); + +// +++ Set +extern_c void +DoubleUncertaintySet(ConstHandle2Double self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Double/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Double/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Double/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Double/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Double/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DoubleDifferentialCrossSection.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DoubleDifferentialCrossSection.cpp new file mode 100644 index 000000000..78b87f282 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DoubleDifferentialCrossSection.cpp @@ -0,0 +1,396 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/DoubleDifferentialCrossSection.hpp" +#include "DoubleDifferentialCrossSection.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DoubleDifferentialCrossSectionClass; +using CPP = multigroup::DoubleDifferentialCrossSection; + +static const std::string CLASSNAME = "DoubleDifferentialCrossSection"; + +namespace extract { + static auto CoulombPlusNuclearElastic = [](auto &obj) { return &obj.CoulombPlusNuclearElastic; }; + static auto coherentPhotonScattering = [](auto &obj) { return &obj.coherentPhotonScattering; }; + static auto incoherentPhotonScattering = [](auto &obj) { return &obj.incoherentPhotonScattering; }; + static auto thermalNeutronScatteringLaw_coherentElastic = [](auto &obj) { return &obj.thermalNeutronScatteringLaw_coherentElastic; }; + static auto thermalNeutronScatteringLaw_incoherentElastic = [](auto &obj) { return &obj.thermalNeutronScatteringLaw_incoherentElastic; }; + static auto thermalNeutronScatteringLaw_incoherentInelastic = [](auto &obj) { return &obj.thermalNeutronScatteringLaw_incoherentInelastic; }; +} + +using CPPCoulombPlusNuclearElastic = general::CoulombPlusNuclearElastic; +using CPPCoherentPhotonScattering = general::CoherentPhotonScattering; +using CPPIncoherentPhotonScattering = general::IncoherentPhotonScattering; +using CPPThermalNeutronScatteringLaw_coherentElastic = general::ThermalNeutronScatteringLaw_coherentElastic; +using CPPThermalNeutronScatteringLaw_incoherentElastic = general::ThermalNeutronScatteringLaw_incoherentElastic; +using CPPThermalNeutronScatteringLaw_incoherentInelastic = general::ThermalNeutronScatteringLaw_incoherentInelastic; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDoubleDifferentialCrossSection +DoubleDifferentialCrossSectionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2DoubleDifferentialCrossSection +DoubleDifferentialCrossSectionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDoubleDifferentialCrossSection +DoubleDifferentialCrossSectionCreateConst( + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering, + ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering, + ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic thermalNeutronScatteringLaw_coherentElastic, + ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic thermalNeutronScatteringLaw_incoherentElastic, + ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic thermalNeutronScatteringLaw_incoherentInelastic +) { + ConstHandle2DoubleDifferentialCrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(CoulombPlusNuclearElastic), + detail::tocpp(coherentPhotonScattering), + detail::tocpp(incoherentPhotonScattering), + detail::tocpp(thermalNeutronScatteringLaw_coherentElastic), + detail::tocpp(thermalNeutronScatteringLaw_incoherentElastic), + detail::tocpp(thermalNeutronScatteringLaw_incoherentInelastic) + ); + return handle; +} + +// Create, general, non-const +Handle2DoubleDifferentialCrossSection +DoubleDifferentialCrossSectionCreate( + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering, + ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering, + ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic thermalNeutronScatteringLaw_coherentElastic, + ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic thermalNeutronScatteringLaw_incoherentElastic, + ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic thermalNeutronScatteringLaw_incoherentInelastic +) { + ConstHandle2DoubleDifferentialCrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(CoulombPlusNuclearElastic), + detail::tocpp(coherentPhotonScattering), + detail::tocpp(incoherentPhotonScattering), + detail::tocpp(thermalNeutronScatteringLaw_coherentElastic), + detail::tocpp(thermalNeutronScatteringLaw_incoherentElastic), + detail::tocpp(thermalNeutronScatteringLaw_incoherentInelastic) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DoubleDifferentialCrossSectionAssign(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstDoubleDifferentialCrossSection from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DoubleDifferentialCrossSectionDelete(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DoubleDifferentialCrossSectionRead(ConstHandle2DoubleDifferentialCrossSection self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DoubleDifferentialCrossSectionWrite(ConstHandle2ConstDoubleDifferentialCrossSection self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DoubleDifferentialCrossSectionPrint(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DoubleDifferentialCrossSectionPrintXML(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DoubleDifferentialCrossSectionPrintJSON(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: CoulombPlusNuclearElastic +// ----------------------------------------------------------------------------- + +// Has +int +DoubleDifferentialCrossSectionCoulombPlusNuclearElasticHas(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticHas", self, extract::CoulombPlusNuclearElastic); +} + +// Get, const +Handle2ConstCoulombPlusNuclearElastic +DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticGetConst", self, extract::CoulombPlusNuclearElastic); +} + +// Get, non-const +Handle2CoulombPlusNuclearElastic +DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGet(ConstHandle2DoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticGet", self, extract::CoulombPlusNuclearElastic); +} + +// Set +void +DoubleDifferentialCrossSectionCoulombPlusNuclearElasticSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CoulombPlusNuclearElasticSet", self, extract::CoulombPlusNuclearElastic, CoulombPlusNuclearElastic); +} + + +// ----------------------------------------------------------------------------- +// Child: coherentPhotonScattering +// ----------------------------------------------------------------------------- + +// Has +int +DoubleDifferentialCrossSectionCoherentPhotonScatteringHas(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CoherentPhotonScatteringHas", self, extract::coherentPhotonScattering); +} + +// Get, const +Handle2ConstCoherentPhotonScattering +DoubleDifferentialCrossSectionCoherentPhotonScatteringGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoherentPhotonScatteringGetConst", self, extract::coherentPhotonScattering); +} + +// Get, non-const +Handle2CoherentPhotonScattering +DoubleDifferentialCrossSectionCoherentPhotonScatteringGet(ConstHandle2DoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoherentPhotonScatteringGet", self, extract::coherentPhotonScattering); +} + +// Set +void +DoubleDifferentialCrossSectionCoherentPhotonScatteringSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CoherentPhotonScatteringSet", self, extract::coherentPhotonScattering, coherentPhotonScattering); +} + + +// ----------------------------------------------------------------------------- +// Child: incoherentPhotonScattering +// ----------------------------------------------------------------------------- + +// Has +int +DoubleDifferentialCrossSectionIncoherentPhotonScatteringHas(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IncoherentPhotonScatteringHas", self, extract::incoherentPhotonScattering); +} + +// Get, const +Handle2ConstIncoherentPhotonScattering +DoubleDifferentialCrossSectionIncoherentPhotonScatteringGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IncoherentPhotonScatteringGetConst", self, extract::incoherentPhotonScattering); +} + +// Get, non-const +Handle2IncoherentPhotonScattering +DoubleDifferentialCrossSectionIncoherentPhotonScatteringGet(ConstHandle2DoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IncoherentPhotonScatteringGet", self, extract::incoherentPhotonScattering); +} + +// Set +void +DoubleDifferentialCrossSectionIncoherentPhotonScatteringSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IncoherentPhotonScatteringSet", self, extract::incoherentPhotonScattering, incoherentPhotonScattering); +} + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw_coherentElastic +// ----------------------------------------------------------------------------- + +// Has +int +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticHas(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_coherentElasticHas", self, extract::thermalNeutronScatteringLaw_coherentElastic); +} + +// Get, const +Handle2ConstThermalNeutronScatteringLaw_coherentElastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_coherentElasticGetConst", self, extract::thermalNeutronScatteringLaw_coherentElastic); +} + +// Get, non-const +Handle2ThermalNeutronScatteringLaw_coherentElastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGet(ConstHandle2DoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_coherentElasticGet", self, extract::thermalNeutronScatteringLaw_coherentElastic); +} + +// Set +void +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic thermalNeutronScatteringLaw_coherentElastic) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_coherentElasticSet", self, extract::thermalNeutronScatteringLaw_coherentElastic, thermalNeutronScatteringLaw_coherentElastic); +} + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw_incoherentElastic +// ----------------------------------------------------------------------------- + +// Has +int +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticHas(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_incoherentElasticHas", self, extract::thermalNeutronScatteringLaw_incoherentElastic); +} + +// Get, const +Handle2ConstThermalNeutronScatteringLaw_incoherentElastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_incoherentElasticGetConst", self, extract::thermalNeutronScatteringLaw_incoherentElastic); +} + +// Get, non-const +Handle2ThermalNeutronScatteringLaw_incoherentElastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGet(ConstHandle2DoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_incoherentElasticGet", self, extract::thermalNeutronScatteringLaw_incoherentElastic); +} + +// Set +void +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic thermalNeutronScatteringLaw_incoherentElastic) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_incoherentElasticSet", self, extract::thermalNeutronScatteringLaw_incoherentElastic, thermalNeutronScatteringLaw_incoherentElastic); +} + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw_incoherentInelastic +// ----------------------------------------------------------------------------- + +// Has +int +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticHas(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_incoherentInelasticHas", self, extract::thermalNeutronScatteringLaw_incoherentInelastic); +} + +// Get, const +Handle2ConstThermalNeutronScatteringLaw_incoherentInelastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_incoherentInelasticGetConst", self, extract::thermalNeutronScatteringLaw_incoherentInelastic); +} + +// Get, non-const +Handle2ThermalNeutronScatteringLaw_incoherentInelastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGet(ConstHandle2DoubleDifferentialCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_incoherentInelasticGet", self, extract::thermalNeutronScatteringLaw_incoherentInelastic); +} + +// Set +void +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic thermalNeutronScatteringLaw_incoherentInelastic) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLaw_incoherentInelasticSet", self, extract::thermalNeutronScatteringLaw_incoherentInelastic, thermalNeutronScatteringLaw_incoherentInelastic); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DoubleDifferentialCrossSection/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DoubleDifferentialCrossSection.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DoubleDifferentialCrossSection.h new file mode 100644 index 000000000..3764b7cd9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DoubleDifferentialCrossSection.h @@ -0,0 +1,281 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// DoubleDifferentialCrossSection is the basic handle type in this file. Example: +// // Create a default DoubleDifferentialCrossSection object: +// DoubleDifferentialCrossSection handle = DoubleDifferentialCrossSectionDefault(); +// Functions involving DoubleDifferentialCrossSection are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_DOUBLEDIFFERENTIALCROSSSECTION +#define C_INTERFACE_GNDS_V2_0_GENERAL_DOUBLEDIFFERENTIALCROSSSECTION + +#include "GNDStk.h" +#include "v2.0/general/CoulombPlusNuclearElastic.h" +#include "v2.0/general/CoherentPhotonScattering.h" +#include "v2.0/general/IncoherentPhotonScattering.h" +#include "v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.h" +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.h" +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DoubleDifferentialCrossSectionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ DoubleDifferentialCrossSection +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DoubleDifferentialCrossSectionClass *DoubleDifferentialCrossSection; + +// --- Const-aware handles. +typedef const struct DoubleDifferentialCrossSectionClass *const ConstHandle2ConstDoubleDifferentialCrossSection; +typedef struct DoubleDifferentialCrossSectionClass *const ConstHandle2DoubleDifferentialCrossSection; +typedef const struct DoubleDifferentialCrossSectionClass * Handle2ConstDoubleDifferentialCrossSection; +typedef struct DoubleDifferentialCrossSectionClass * Handle2DoubleDifferentialCrossSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDoubleDifferentialCrossSection +DoubleDifferentialCrossSectionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2DoubleDifferentialCrossSection +DoubleDifferentialCrossSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstDoubleDifferentialCrossSection +DoubleDifferentialCrossSectionCreateConst( + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering, + ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering, + ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic thermalNeutronScatteringLaw_coherentElastic, + ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic thermalNeutronScatteringLaw_incoherentElastic, + ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic thermalNeutronScatteringLaw_incoherentInelastic +); + +// +++ Create, general, non-const +extern_c Handle2DoubleDifferentialCrossSection +DoubleDifferentialCrossSectionCreate( + ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic, + ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering, + ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering, + ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic thermalNeutronScatteringLaw_coherentElastic, + ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic thermalNeutronScatteringLaw_incoherentElastic, + ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic thermalNeutronScatteringLaw_incoherentInelastic +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DoubleDifferentialCrossSectionAssign(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstDoubleDifferentialCrossSection from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DoubleDifferentialCrossSectionDelete(ConstHandle2ConstDoubleDifferentialCrossSection self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DoubleDifferentialCrossSectionRead(ConstHandle2DoubleDifferentialCrossSection self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DoubleDifferentialCrossSectionWrite(ConstHandle2ConstDoubleDifferentialCrossSection self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DoubleDifferentialCrossSectionPrint(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// +++ Print to standard output, as XML +extern_c int +DoubleDifferentialCrossSectionPrintXML(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// +++ Print to standard output, as JSON +extern_c int +DoubleDifferentialCrossSectionPrintJSON(ConstHandle2ConstDoubleDifferentialCrossSection self); + + +// ----------------------------------------------------------------------------- +// Child: CoulombPlusNuclearElastic +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleDifferentialCrossSectionCoulombPlusNuclearElasticHas(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// --- Get, const +extern_c Handle2ConstCoulombPlusNuclearElastic +DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// +++ Get, non-const +extern_c Handle2CoulombPlusNuclearElastic +DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGet(ConstHandle2DoubleDifferentialCrossSection self); + +// +++ Set +extern_c void +DoubleDifferentialCrossSectionCoulombPlusNuclearElasticSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstCoulombPlusNuclearElastic CoulombPlusNuclearElastic); + + +// ----------------------------------------------------------------------------- +// Child: coherentPhotonScattering +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleDifferentialCrossSectionCoherentPhotonScatteringHas(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// --- Get, const +extern_c Handle2ConstCoherentPhotonScattering +DoubleDifferentialCrossSectionCoherentPhotonScatteringGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// +++ Get, non-const +extern_c Handle2CoherentPhotonScattering +DoubleDifferentialCrossSectionCoherentPhotonScatteringGet(ConstHandle2DoubleDifferentialCrossSection self); + +// +++ Set +extern_c void +DoubleDifferentialCrossSectionCoherentPhotonScatteringSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstCoherentPhotonScattering coherentPhotonScattering); + + +// ----------------------------------------------------------------------------- +// Child: incoherentPhotonScattering +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleDifferentialCrossSectionIncoherentPhotonScatteringHas(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// --- Get, const +extern_c Handle2ConstIncoherentPhotonScattering +DoubleDifferentialCrossSectionIncoherentPhotonScatteringGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// +++ Get, non-const +extern_c Handle2IncoherentPhotonScattering +DoubleDifferentialCrossSectionIncoherentPhotonScatteringGet(ConstHandle2DoubleDifferentialCrossSection self); + +// +++ Set +extern_c void +DoubleDifferentialCrossSectionIncoherentPhotonScatteringSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstIncoherentPhotonScattering incoherentPhotonScattering); + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw_coherentElastic +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticHas(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// --- Get, const +extern_c Handle2ConstThermalNeutronScatteringLaw_coherentElastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// +++ Get, non-const +extern_c Handle2ThermalNeutronScatteringLaw_coherentElastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGet(ConstHandle2DoubleDifferentialCrossSection self); + +// +++ Set +extern_c void +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic thermalNeutronScatteringLaw_coherentElastic); + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw_incoherentElastic +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticHas(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// --- Get, const +extern_c Handle2ConstThermalNeutronScatteringLaw_incoherentElastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// +++ Get, non-const +extern_c Handle2ThermalNeutronScatteringLaw_incoherentElastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGet(ConstHandle2DoubleDifferentialCrossSection self); + +// +++ Set +extern_c void +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic thermalNeutronScatteringLaw_incoherentElastic); + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw_incoherentInelastic +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticHas(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// --- Get, const +extern_c Handle2ConstThermalNeutronScatteringLaw_incoherentInelastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGetConst(ConstHandle2ConstDoubleDifferentialCrossSection self); + +// +++ Get, non-const +extern_c Handle2ThermalNeutronScatteringLaw_incoherentInelastic +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGet(ConstHandle2DoubleDifferentialCrossSection self); + +// +++ Set +extern_c void +DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticSet(ConstHandle2DoubleDifferentialCrossSection self, ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic thermalNeutronScatteringLaw_incoherentInelastic); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/DoubleDifferentialCrossSection/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DoubleDifferentialCrossSection/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DoubleDifferentialCrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DoubleDifferentialCrossSection/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/DoubleDifferentialCrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFH.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFH.cpp new file mode 100644 index 000000000..639071334 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFH.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/EFH.hpp" +#include "EFH.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = EFHClass; +using CPP = multigroup::EFH; + +static const std::string CLASSNAME = "EFH"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEFH +EFHDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2EFH +EFHDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEFH +EFHCreateConst( + const double value, + const char *const unit +) { + ConstHandle2EFH handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2EFH +EFHCreate( + const double value, + const char *const unit +) { + ConstHandle2EFH handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +EFHAssign(ConstHandle2EFH self, ConstHandle2ConstEFH from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +EFHDelete(ConstHandle2ConstEFH self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +EFHRead(ConstHandle2EFH self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +EFHWrite(ConstHandle2ConstEFH self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +EFHPrint(ConstHandle2ConstEFH self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +EFHPrintXML(ConstHandle2ConstEFH self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +EFHPrintJSON(ConstHandle2ConstEFH self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +EFHValueHas(ConstHandle2ConstEFH self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +EFHValueGet(ConstHandle2ConstEFH self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +EFHValueSet(ConstHandle2EFH self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +EFHUnitHas(ConstHandle2ConstEFH self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +EFHUnitGet(ConstHandle2ConstEFH self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +EFHUnitSet(ConstHandle2EFH self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/EFH/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFH.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFH.h new file mode 100644 index 000000000..8b7409467 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFH.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// EFH is the basic handle type in this file. Example: +// // Create a default EFH object: +// EFH handle = EFHDefault(); +// Functions involving EFH are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_EFH +#define C_INTERFACE_GNDS_V2_0_GENERAL_EFH + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct EFHClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ EFH +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct EFHClass *EFH; + +// --- Const-aware handles. +typedef const struct EFHClass *const ConstHandle2ConstEFH; +typedef struct EFHClass *const ConstHandle2EFH; +typedef const struct EFHClass * Handle2ConstEFH; +typedef struct EFHClass * Handle2EFH; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEFH +EFHDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2EFH +EFHDefault(); + +// --- Create, general, const +extern_c Handle2ConstEFH +EFHCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2EFH +EFHCreate( + const double value, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +EFHAssign(ConstHandle2EFH self, ConstHandle2ConstEFH from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +EFHDelete(ConstHandle2ConstEFH self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +EFHRead(ConstHandle2EFH self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +EFHWrite(ConstHandle2ConstEFH self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +EFHPrint(ConstHandle2ConstEFH self); + +// +++ Print to standard output, as XML +extern_c int +EFHPrintXML(ConstHandle2ConstEFH self); + +// +++ Print to standard output, as JSON +extern_c int +EFHPrintJSON(ConstHandle2ConstEFH self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EFHValueHas(ConstHandle2ConstEFH self); + +// +++ Get +// +++ Returns by value +extern_c double +EFHValueGet(ConstHandle2ConstEFH self); + +// +++ Set +extern_c void +EFHValueSet(ConstHandle2EFH self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EFHUnitHas(ConstHandle2ConstEFH self); + +// +++ Get +// +++ Returns by value +extern_c const char * +EFHUnitGet(ConstHandle2ConstEFH self); + +// +++ Set +extern_c void +EFHUnitSet(ConstHandle2EFH self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/EFH/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFH/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFH/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFH/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFH/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFL.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFL.cpp new file mode 100644 index 000000000..3344d9cfd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFL.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/EFL.hpp" +#include "EFL.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = EFLClass; +using CPP = multigroup::EFL; + +static const std::string CLASSNAME = "EFL"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEFL +EFLDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2EFL +EFLDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEFL +EFLCreateConst( + const double value, + const char *const unit +) { + ConstHandle2EFL handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2EFL +EFLCreate( + const double value, + const char *const unit +) { + ConstHandle2EFL handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +EFLAssign(ConstHandle2EFL self, ConstHandle2ConstEFL from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +EFLDelete(ConstHandle2ConstEFL self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +EFLRead(ConstHandle2EFL self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +EFLWrite(ConstHandle2ConstEFL self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +EFLPrint(ConstHandle2ConstEFL self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +EFLPrintXML(ConstHandle2ConstEFL self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +EFLPrintJSON(ConstHandle2ConstEFL self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +EFLValueHas(ConstHandle2ConstEFL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +EFLValueGet(ConstHandle2ConstEFL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +EFLValueSet(ConstHandle2EFL self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +EFLUnitHas(ConstHandle2ConstEFL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +EFLUnitGet(ConstHandle2ConstEFL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +EFLUnitSet(ConstHandle2EFL self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/EFL/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFL.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFL.h new file mode 100644 index 000000000..20f3bdb66 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFL.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// EFL is the basic handle type in this file. Example: +// // Create a default EFL object: +// EFL handle = EFLDefault(); +// Functions involving EFL are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_EFL +#define C_INTERFACE_GNDS_V2_0_GENERAL_EFL + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct EFLClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ EFL +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct EFLClass *EFL; + +// --- Const-aware handles. +typedef const struct EFLClass *const ConstHandle2ConstEFL; +typedef struct EFLClass *const ConstHandle2EFL; +typedef const struct EFLClass * Handle2ConstEFL; +typedef struct EFLClass * Handle2EFL; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEFL +EFLDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2EFL +EFLDefault(); + +// --- Create, general, const +extern_c Handle2ConstEFL +EFLCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2EFL +EFLCreate( + const double value, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +EFLAssign(ConstHandle2EFL self, ConstHandle2ConstEFL from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +EFLDelete(ConstHandle2ConstEFL self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +EFLRead(ConstHandle2EFL self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +EFLWrite(ConstHandle2ConstEFL self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +EFLPrint(ConstHandle2ConstEFL self); + +// +++ Print to standard output, as XML +extern_c int +EFLPrintXML(ConstHandle2ConstEFL self); + +// +++ Print to standard output, as JSON +extern_c int +EFLPrintJSON(ConstHandle2ConstEFL self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EFLValueHas(ConstHandle2ConstEFL self); + +// +++ Get +// +++ Returns by value +extern_c double +EFLValueGet(ConstHandle2ConstEFL self); + +// +++ Set +extern_c void +EFLValueSet(ConstHandle2EFL self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EFLUnitHas(ConstHandle2ConstEFL self); + +// +++ Get +// +++ Returns by value +extern_c const char * +EFLUnitGet(ConstHandle2ConstEFL self); + +// +++ Set +extern_c void +EFLUnitSet(ConstHandle2EFL self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/EFL/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFL/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFL/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFL/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EFL/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ENDFconversionFlags.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ENDFconversionFlags.cpp new file mode 100644 index 000000000..ad911dc7f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ENDFconversionFlags.cpp @@ -0,0 +1,380 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ENDFconversionFlags.hpp" +#include "ENDFconversionFlags.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ENDFconversionFlagsClass; +using CPP = multigroup::ENDFconversionFlags; + +static const std::string CLASSNAME = "ENDFconversionFlags"; + +namespace extract { + static auto flags = [](auto &obj) { return &obj.flags; }; + static auto href = [](auto &obj) { return &obj.href; }; + static auto conversion = [](auto &obj) { return &obj.conversion; }; +} + +using CPPConversion = general::Conversion; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstENDFconversionFlags +ENDFconversionFlagsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ENDFconversionFlags +ENDFconversionFlagsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstENDFconversionFlags +ENDFconversionFlagsCreateConst( + const char *const flags, + const char *const href, + ConstHandle2Conversion *const conversion, const size_t conversionSize +) { + ConstHandle2ENDFconversionFlags handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + flags, + href, + std::vector{} + ); + for (size_t ConversionN = 0; ConversionN < conversionSize; ++ConversionN) + ENDFconversionFlagsConversionAdd(handle, conversion[ConversionN]); + return handle; +} + +// Create, general, non-const +Handle2ENDFconversionFlags +ENDFconversionFlagsCreate( + const char *const flags, + const char *const href, + ConstHandle2Conversion *const conversion, const size_t conversionSize +) { + ConstHandle2ENDFconversionFlags handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + flags, + href, + std::vector{} + ); + for (size_t ConversionN = 0; ConversionN < conversionSize; ++ConversionN) + ENDFconversionFlagsConversionAdd(handle, conversion[ConversionN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ENDFconversionFlagsAssign(ConstHandle2ENDFconversionFlags self, ConstHandle2ConstENDFconversionFlags from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ENDFconversionFlagsDelete(ConstHandle2ConstENDFconversionFlags self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ENDFconversionFlagsRead(ConstHandle2ENDFconversionFlags self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ENDFconversionFlagsWrite(ConstHandle2ConstENDFconversionFlags self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ENDFconversionFlagsPrint(ConstHandle2ConstENDFconversionFlags self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ENDFconversionFlagsPrintXML(ConstHandle2ConstENDFconversionFlags self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ENDFconversionFlagsPrintJSON(ConstHandle2ConstENDFconversionFlags self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: flags +// ----------------------------------------------------------------------------- + +// Has +int +ENDFconversionFlagsFlagsHas(ConstHandle2ConstENDFconversionFlags self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FlagsHas", self, extract::flags); +} + +// Get +// Returns by value +const char * +ENDFconversionFlagsFlagsGet(ConstHandle2ConstENDFconversionFlags self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FlagsGet", self, extract::flags); +} + +// Set +void +ENDFconversionFlagsFlagsSet(ConstHandle2ENDFconversionFlags self, const char *const flags) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FlagsSet", self, extract::flags, flags); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +ENDFconversionFlagsHrefHas(ConstHandle2ConstENDFconversionFlags self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +ENDFconversionFlagsHrefGet(ConstHandle2ConstENDFconversionFlags self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ENDFconversionFlagsHrefSet(ConstHandle2ENDFconversionFlags self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Child: conversion +// ----------------------------------------------------------------------------- + +// Has +int +ENDFconversionFlagsConversionHas(ConstHandle2ConstENDFconversionFlags self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ConversionHas", self, extract::conversion); +} + +// Clear +void +ENDFconversionFlagsConversionClear(ConstHandle2ENDFconversionFlags self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ConversionClear", self, extract::conversion); +} + +// Size +size_t +ENDFconversionFlagsConversionSize(ConstHandle2ConstENDFconversionFlags self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ConversionSize", self, extract::conversion); +} + +// Add +void +ENDFconversionFlagsConversionAdd(ConstHandle2ENDFconversionFlags self, ConstHandle2ConstConversion conversion) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ConversionAdd", self, extract::conversion, conversion); +} + +// Get, by index \in [0,size), const +Handle2ConstConversion +ENDFconversionFlagsConversionGetConst(ConstHandle2ConstENDFconversionFlags self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ConversionGetConst", self, extract::conversion, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Conversion +ENDFconversionFlagsConversionGet(ConstHandle2ENDFconversionFlags self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ConversionGet", self, extract::conversion, index_); +} + +// Set, by index \in [0,size) +void +ENDFconversionFlagsConversionSet( + ConstHandle2ENDFconversionFlags self, + const size_t index_, + ConstHandle2ConstConversion conversion +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ConversionSet", self, extract::conversion, index_, conversion); +} + +// ------------------------ +// Re: metadatum flags +// ------------------------ + +// Has, by flags +int +ENDFconversionFlagsConversionHasByFlags( + ConstHandle2ConstENDFconversionFlags self, + const char *const flags +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ConversionHasByFlags", + self, extract::conversion, meta::flags, flags); +} + +// Get, by flags, const +Handle2ConstConversion +ENDFconversionFlagsConversionGetByFlagsConst( + ConstHandle2ConstENDFconversionFlags self, + const char *const flags +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConversionGetByFlagsConst", + self, extract::conversion, meta::flags, flags); +} + +// Get, by flags, non-const +Handle2Conversion +ENDFconversionFlagsConversionGetByFlags( + ConstHandle2ENDFconversionFlags self, + const char *const flags +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConversionGetByFlags", + self, extract::conversion, meta::flags, flags); +} + +// Set, by flags +void +ENDFconversionFlagsConversionSetByFlags( + ConstHandle2ENDFconversionFlags self, + const char *const flags, + ConstHandle2ConstConversion conversion +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ConversionSetByFlags", + self, extract::conversion, meta::flags, flags, conversion); +} + +// ------------------------ +// Re: metadatum href +// ------------------------ + +// Has, by href +int +ENDFconversionFlagsConversionHasByHref( + ConstHandle2ConstENDFconversionFlags self, + const char *const href +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ConversionHasByHref", + self, extract::conversion, meta::href, href); +} + +// Get, by href, const +Handle2ConstConversion +ENDFconversionFlagsConversionGetByHrefConst( + ConstHandle2ConstENDFconversionFlags self, + const char *const href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConversionGetByHrefConst", + self, extract::conversion, meta::href, href); +} + +// Get, by href, non-const +Handle2Conversion +ENDFconversionFlagsConversionGetByHref( + ConstHandle2ENDFconversionFlags self, + const char *const href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ConversionGetByHref", + self, extract::conversion, meta::href, href); +} + +// Set, by href +void +ENDFconversionFlagsConversionSetByHref( + ConstHandle2ENDFconversionFlags self, + const char *const href, + ConstHandle2ConstConversion conversion +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ConversionSetByHref", + self, extract::conversion, meta::href, href, conversion); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ENDFconversionFlags/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ENDFconversionFlags.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ENDFconversionFlags.h new file mode 100644 index 000000000..bb4b8377a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ENDFconversionFlags.h @@ -0,0 +1,283 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ENDFconversionFlags is the basic handle type in this file. Example: +// // Create a default ENDFconversionFlags object: +// ENDFconversionFlags handle = ENDFconversionFlagsDefault(); +// Functions involving ENDFconversionFlags are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ENDFCONVERSIONFLAGS +#define C_INTERFACE_GNDS_V2_0_GENERAL_ENDFCONVERSIONFLAGS + +#include "GNDStk.h" +#include "v2.0/general/Conversion.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ENDFconversionFlagsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ENDFconversionFlags +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ENDFconversionFlagsClass *ENDFconversionFlags; + +// --- Const-aware handles. +typedef const struct ENDFconversionFlagsClass *const ConstHandle2ConstENDFconversionFlags; +typedef struct ENDFconversionFlagsClass *const ConstHandle2ENDFconversionFlags; +typedef const struct ENDFconversionFlagsClass * Handle2ConstENDFconversionFlags; +typedef struct ENDFconversionFlagsClass * Handle2ENDFconversionFlags; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstENDFconversionFlags +ENDFconversionFlagsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ENDFconversionFlags +ENDFconversionFlagsDefault(); + +// --- Create, general, const +extern_c Handle2ConstENDFconversionFlags +ENDFconversionFlagsCreateConst( + const char *const flags, + const char *const href, + ConstHandle2Conversion *const conversion, const size_t conversionSize +); + +// +++ Create, general, non-const +extern_c Handle2ENDFconversionFlags +ENDFconversionFlagsCreate( + const char *const flags, + const char *const href, + ConstHandle2Conversion *const conversion, const size_t conversionSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ENDFconversionFlagsAssign(ConstHandle2ENDFconversionFlags self, ConstHandle2ConstENDFconversionFlags from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ENDFconversionFlagsDelete(ConstHandle2ConstENDFconversionFlags self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ENDFconversionFlagsRead(ConstHandle2ENDFconversionFlags self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ENDFconversionFlagsWrite(ConstHandle2ConstENDFconversionFlags self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ENDFconversionFlagsPrint(ConstHandle2ConstENDFconversionFlags self); + +// +++ Print to standard output, as XML +extern_c int +ENDFconversionFlagsPrintXML(ConstHandle2ConstENDFconversionFlags self); + +// +++ Print to standard output, as JSON +extern_c int +ENDFconversionFlagsPrintJSON(ConstHandle2ConstENDFconversionFlags self); + + +// ----------------------------------------------------------------------------- +// Metadatum: flags +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ENDFconversionFlagsFlagsHas(ConstHandle2ConstENDFconversionFlags self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ENDFconversionFlagsFlagsGet(ConstHandle2ConstENDFconversionFlags self); + +// +++ Set +extern_c void +ENDFconversionFlagsFlagsSet(ConstHandle2ENDFconversionFlags self, const char *const flags); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ENDFconversionFlagsHrefHas(ConstHandle2ConstENDFconversionFlags self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ENDFconversionFlagsHrefGet(ConstHandle2ConstENDFconversionFlags self); + +// +++ Set +extern_c void +ENDFconversionFlagsHrefSet(ConstHandle2ENDFconversionFlags self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Child: conversion +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ENDFconversionFlagsConversionHas(ConstHandle2ConstENDFconversionFlags self); + +// +++ Clear +extern_c void +ENDFconversionFlagsConversionClear(ConstHandle2ENDFconversionFlags self); + +// +++ Size +extern_c size_t +ENDFconversionFlagsConversionSize(ConstHandle2ConstENDFconversionFlags self); + +// +++ Add +extern_c void +ENDFconversionFlagsConversionAdd(ConstHandle2ENDFconversionFlags self, ConstHandle2ConstConversion conversion); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstConversion +ENDFconversionFlagsConversionGetConst(ConstHandle2ConstENDFconversionFlags self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Conversion +ENDFconversionFlagsConversionGet(ConstHandle2ENDFconversionFlags self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ENDFconversionFlagsConversionSet( + ConstHandle2ENDFconversionFlags self, + const size_t index_, + ConstHandle2ConstConversion conversion +); + +// ------------------------ +// Re: metadatum flags +// ------------------------ + +// +++ Has, by flags +extern_c int +ENDFconversionFlagsConversionHasByFlags( + ConstHandle2ConstENDFconversionFlags self, + const char *const flags +); + +// --- Get, by flags, const +extern_c Handle2ConstConversion +ENDFconversionFlagsConversionGetByFlagsConst( + ConstHandle2ConstENDFconversionFlags self, + const char *const flags +); + +// +++ Get, by flags, non-const +extern_c Handle2Conversion +ENDFconversionFlagsConversionGetByFlags( + ConstHandle2ENDFconversionFlags self, + const char *const flags +); + +// +++ Set, by flags +extern_c void +ENDFconversionFlagsConversionSetByFlags( + ConstHandle2ENDFconversionFlags self, + const char *const flags, + ConstHandle2ConstConversion conversion +); + +// ------------------------ +// Re: metadatum href +// ------------------------ + +// +++ Has, by href +extern_c int +ENDFconversionFlagsConversionHasByHref( + ConstHandle2ConstENDFconversionFlags self, + const char *const href +); + +// --- Get, by href, const +extern_c Handle2ConstConversion +ENDFconversionFlagsConversionGetByHrefConst( + ConstHandle2ConstENDFconversionFlags self, + const char *const href +); + +// +++ Get, by href, non-const +extern_c Handle2Conversion +ENDFconversionFlagsConversionGetByHref( + ConstHandle2ENDFconversionFlags self, + const char *const href +); + +// +++ Set, by href +extern_c void +ENDFconversionFlagsConversionSetByHref( + ConstHandle2ENDFconversionFlags self, + const char *const href, + ConstHandle2ConstConversion conversion +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ENDFconversionFlags/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ENDFconversionFlags/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ENDFconversionFlags/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ENDFconversionFlags/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ENDFconversionFlags/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_critical.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_critical.cpp new file mode 100644 index 000000000..6732d4197 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_critical.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/E_critical.hpp" +#include "E_critical.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = E_criticalClass; +using CPP = multigroup::E_critical; + +static const std::string CLASSNAME = "E_critical"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstE_critical +E_criticalDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2E_critical +E_criticalDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstE_critical +E_criticalCreateConst( + const double value, + const char *const unit +) { + ConstHandle2E_critical handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2E_critical +E_criticalCreate( + const double value, + const char *const unit +) { + ConstHandle2E_critical handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +E_criticalAssign(ConstHandle2E_critical self, ConstHandle2ConstE_critical from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +E_criticalDelete(ConstHandle2ConstE_critical self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +E_criticalRead(ConstHandle2E_critical self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +E_criticalWrite(ConstHandle2ConstE_critical self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +E_criticalPrint(ConstHandle2ConstE_critical self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +E_criticalPrintXML(ConstHandle2ConstE_critical self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +E_criticalPrintJSON(ConstHandle2ConstE_critical self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +E_criticalValueHas(ConstHandle2ConstE_critical self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +E_criticalValueGet(ConstHandle2ConstE_critical self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +E_criticalValueSet(ConstHandle2E_critical self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +E_criticalUnitHas(ConstHandle2ConstE_critical self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +E_criticalUnitGet(ConstHandle2ConstE_critical self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +E_criticalUnitSet(ConstHandle2E_critical self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/E_critical/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_critical.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_critical.h new file mode 100644 index 000000000..31adba4c3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_critical.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// E_critical is the basic handle type in this file. Example: +// // Create a default E_critical object: +// E_critical handle = E_criticalDefault(); +// Functions involving E_critical are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_E_CRITICAL +#define C_INTERFACE_GNDS_V2_0_GENERAL_E_CRITICAL + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct E_criticalClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ E_critical +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct E_criticalClass *E_critical; + +// --- Const-aware handles. +typedef const struct E_criticalClass *const ConstHandle2ConstE_critical; +typedef struct E_criticalClass *const ConstHandle2E_critical; +typedef const struct E_criticalClass * Handle2ConstE_critical; +typedef struct E_criticalClass * Handle2E_critical; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstE_critical +E_criticalDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2E_critical +E_criticalDefault(); + +// --- Create, general, const +extern_c Handle2ConstE_critical +E_criticalCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2E_critical +E_criticalCreate( + const double value, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +E_criticalAssign(ConstHandle2E_critical self, ConstHandle2ConstE_critical from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +E_criticalDelete(ConstHandle2ConstE_critical self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +E_criticalRead(ConstHandle2E_critical self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +E_criticalWrite(ConstHandle2ConstE_critical self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +E_criticalPrint(ConstHandle2ConstE_critical self); + +// +++ Print to standard output, as XML +extern_c int +E_criticalPrintXML(ConstHandle2ConstE_critical self); + +// +++ Print to standard output, as JSON +extern_c int +E_criticalPrintJSON(ConstHandle2ConstE_critical self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +E_criticalValueHas(ConstHandle2ConstE_critical self); + +// +++ Get +// +++ Returns by value +extern_c double +E_criticalValueGet(ConstHandle2ConstE_critical self); + +// +++ Set +extern_c void +E_criticalValueSet(ConstHandle2E_critical self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +E_criticalUnitHas(ConstHandle2ConstE_critical self); + +// +++ Get +// +++ Returns by value +extern_c const char * +E_criticalUnitGet(ConstHandle2ConstE_critical self); + +// +++ Set +extern_c void +E_criticalUnitSet(ConstHandle2E_critical self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/E_critical/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_critical/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_critical/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_critical/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_critical/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_max.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_max.cpp new file mode 100644 index 000000000..0e250be29 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_max.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/E_max.hpp" +#include "E_max.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = E_maxClass; +using CPP = multigroup::E_max; + +static const std::string CLASSNAME = "E_max"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstE_max +E_maxDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2E_max +E_maxDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstE_max +E_maxCreateConst( + const double value, + const char *const unit +) { + ConstHandle2E_max handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2E_max +E_maxCreate( + const double value, + const char *const unit +) { + ConstHandle2E_max handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +E_maxAssign(ConstHandle2E_max self, ConstHandle2ConstE_max from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +E_maxDelete(ConstHandle2ConstE_max self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +E_maxRead(ConstHandle2E_max self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +E_maxWrite(ConstHandle2ConstE_max self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +E_maxPrint(ConstHandle2ConstE_max self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +E_maxPrintXML(ConstHandle2ConstE_max self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +E_maxPrintJSON(ConstHandle2ConstE_max self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +E_maxValueHas(ConstHandle2ConstE_max self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +E_maxValueGet(ConstHandle2ConstE_max self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +E_maxValueSet(ConstHandle2E_max self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +E_maxUnitHas(ConstHandle2ConstE_max self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +E_maxUnitGet(ConstHandle2ConstE_max self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +E_maxUnitSet(ConstHandle2E_max self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/E_max/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_max.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_max.h new file mode 100644 index 000000000..6cac84896 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_max.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// E_max is the basic handle type in this file. Example: +// // Create a default E_max object: +// E_max handle = E_maxDefault(); +// Functions involving E_max are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_E_MAX +#define C_INTERFACE_GNDS_V2_0_GENERAL_E_MAX + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct E_maxClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ E_max +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct E_maxClass *E_max; + +// --- Const-aware handles. +typedef const struct E_maxClass *const ConstHandle2ConstE_max; +typedef struct E_maxClass *const ConstHandle2E_max; +typedef const struct E_maxClass * Handle2ConstE_max; +typedef struct E_maxClass * Handle2E_max; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstE_max +E_maxDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2E_max +E_maxDefault(); + +// --- Create, general, const +extern_c Handle2ConstE_max +E_maxCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2E_max +E_maxCreate( + const double value, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +E_maxAssign(ConstHandle2E_max self, ConstHandle2ConstE_max from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +E_maxDelete(ConstHandle2ConstE_max self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +E_maxRead(ConstHandle2E_max self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +E_maxWrite(ConstHandle2ConstE_max self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +E_maxPrint(ConstHandle2ConstE_max self); + +// +++ Print to standard output, as XML +extern_c int +E_maxPrintXML(ConstHandle2ConstE_max self); + +// +++ Print to standard output, as JSON +extern_c int +E_maxPrintJSON(ConstHandle2ConstE_max self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +E_maxValueHas(ConstHandle2ConstE_max self); + +// +++ Get +// +++ Returns by value +extern_c double +E_maxValueGet(ConstHandle2ConstE_max self); + +// +++ Set +extern_c void +E_maxValueSet(ConstHandle2E_max self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +E_maxUnitHas(ConstHandle2ConstE_max self); + +// +++ Get +// +++ Returns by value +extern_c const char * +E_maxUnitGet(ConstHandle2ConstE_max self); + +// +++ Set +extern_c void +E_maxUnitSet(ConstHandle2E_max self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/E_max/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_max/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_max/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_max/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/E_max/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTime.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTime.cpp new file mode 100644 index 000000000..7bf4d5aca --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTime.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ElapsedTime.hpp" +#include "ElapsedTime.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ElapsedTimeClass; +using CPP = multigroup::ElapsedTime; + +static const std::string CLASSNAME = "ElapsedTime"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto time = [](auto &obj) { return &obj.time; }; + static auto yields = [](auto &obj) { return &obj.yields; }; + static auto incidentEnergies = [](auto &obj) { return &obj.incidentEnergies; }; +} + +using CPPTime = general::Time; +using CPPYields = general::Yields; +using CPPIncidentEnergies = general::IncidentEnergies; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstElapsedTime +ElapsedTimeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ElapsedTime +ElapsedTimeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstElapsedTime +ElapsedTimeCreateConst( + const char *const label, + ConstHandle2ConstTime time, + ConstHandle2ConstYields yields, + ConstHandle2ConstIncidentEnergies incidentEnergies +) { + ConstHandle2ElapsedTime handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(time), + detail::tocpp(yields), + detail::tocpp(incidentEnergies) + ); + return handle; +} + +// Create, general, non-const +Handle2ElapsedTime +ElapsedTimeCreate( + const char *const label, + ConstHandle2ConstTime time, + ConstHandle2ConstYields yields, + ConstHandle2ConstIncidentEnergies incidentEnergies +) { + ConstHandle2ElapsedTime handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(time), + detail::tocpp(yields), + detail::tocpp(incidentEnergies) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ElapsedTimeAssign(ConstHandle2ElapsedTime self, ConstHandle2ConstElapsedTime from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ElapsedTimeDelete(ConstHandle2ConstElapsedTime self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ElapsedTimeRead(ConstHandle2ElapsedTime self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ElapsedTimeWrite(ConstHandle2ConstElapsedTime self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ElapsedTimePrint(ConstHandle2ConstElapsedTime self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ElapsedTimePrintXML(ConstHandle2ConstElapsedTime self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ElapsedTimePrintJSON(ConstHandle2ConstElapsedTime self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ElapsedTimeLabelHas(ConstHandle2ConstElapsedTime self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ElapsedTimeLabelGet(ConstHandle2ConstElapsedTime self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ElapsedTimeLabelSet(ConstHandle2ElapsedTime self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: time +// ----------------------------------------------------------------------------- + +// Has +int +ElapsedTimeTimeHas(ConstHandle2ConstElapsedTime self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TimeHas", self, extract::time); +} + +// Get, const +Handle2ConstTime +ElapsedTimeTimeGetConst(ConstHandle2ConstElapsedTime self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TimeGetConst", self, extract::time); +} + +// Get, non-const +Handle2Time +ElapsedTimeTimeGet(ConstHandle2ElapsedTime self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TimeGet", self, extract::time); +} + +// Set +void +ElapsedTimeTimeSet(ConstHandle2ElapsedTime self, ConstHandle2ConstTime time) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TimeSet", self, extract::time, time); +} + + +// ----------------------------------------------------------------------------- +// Child: yields +// ----------------------------------------------------------------------------- + +// Has +int +ElapsedTimeYieldsHas(ConstHandle2ConstElapsedTime self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"YieldsHas", self, extract::yields); +} + +// Get, const +Handle2ConstYields +ElapsedTimeYieldsGetConst(ConstHandle2ConstElapsedTime self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"YieldsGetConst", self, extract::yields); +} + +// Get, non-const +Handle2Yields +ElapsedTimeYieldsGet(ConstHandle2ElapsedTime self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"YieldsGet", self, extract::yields); +} + +// Set +void +ElapsedTimeYieldsSet(ConstHandle2ElapsedTime self, ConstHandle2ConstYields yields) +{ + detail::setField + (CLASSNAME, CLASSNAME+"YieldsSet", self, extract::yields, yields); +} + + +// ----------------------------------------------------------------------------- +// Child: incidentEnergies +// ----------------------------------------------------------------------------- + +// Has +int +ElapsedTimeIncidentEnergiesHas(ConstHandle2ConstElapsedTime self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IncidentEnergiesHas", self, extract::incidentEnergies); +} + +// Get, const +Handle2ConstIncidentEnergies +ElapsedTimeIncidentEnergiesGetConst(ConstHandle2ConstElapsedTime self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IncidentEnergiesGetConst", self, extract::incidentEnergies); +} + +// Get, non-const +Handle2IncidentEnergies +ElapsedTimeIncidentEnergiesGet(ConstHandle2ElapsedTime self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IncidentEnergiesGet", self, extract::incidentEnergies); +} + +// Set +void +ElapsedTimeIncidentEnergiesSet(ConstHandle2ElapsedTime self, ConstHandle2ConstIncidentEnergies incidentEnergies) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IncidentEnergiesSet", self, extract::incidentEnergies, incidentEnergies); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ElapsedTime/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTime.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTime.h new file mode 100644 index 000000000..080bf026c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTime.h @@ -0,0 +1,229 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ElapsedTime is the basic handle type in this file. Example: +// // Create a default ElapsedTime object: +// ElapsedTime handle = ElapsedTimeDefault(); +// Functions involving ElapsedTime are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ELAPSEDTIME +#define C_INTERFACE_GNDS_V2_0_GENERAL_ELAPSEDTIME + +#include "GNDStk.h" +#include "v2.0/general/Time.h" +#include "v2.0/general/Yields.h" +#include "v2.0/general/IncidentEnergies.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ElapsedTimeClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ElapsedTime +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ElapsedTimeClass *ElapsedTime; + +// --- Const-aware handles. +typedef const struct ElapsedTimeClass *const ConstHandle2ConstElapsedTime; +typedef struct ElapsedTimeClass *const ConstHandle2ElapsedTime; +typedef const struct ElapsedTimeClass * Handle2ConstElapsedTime; +typedef struct ElapsedTimeClass * Handle2ElapsedTime; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstElapsedTime +ElapsedTimeDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ElapsedTime +ElapsedTimeDefault(); + +// --- Create, general, const +extern_c Handle2ConstElapsedTime +ElapsedTimeCreateConst( + const char *const label, + ConstHandle2ConstTime time, + ConstHandle2ConstYields yields, + ConstHandle2ConstIncidentEnergies incidentEnergies +); + +// +++ Create, general, non-const +extern_c Handle2ElapsedTime +ElapsedTimeCreate( + const char *const label, + ConstHandle2ConstTime time, + ConstHandle2ConstYields yields, + ConstHandle2ConstIncidentEnergies incidentEnergies +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ElapsedTimeAssign(ConstHandle2ElapsedTime self, ConstHandle2ConstElapsedTime from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ElapsedTimeDelete(ConstHandle2ConstElapsedTime self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ElapsedTimeRead(ConstHandle2ElapsedTime self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ElapsedTimeWrite(ConstHandle2ConstElapsedTime self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ElapsedTimePrint(ConstHandle2ConstElapsedTime self); + +// +++ Print to standard output, as XML +extern_c int +ElapsedTimePrintXML(ConstHandle2ConstElapsedTime self); + +// +++ Print to standard output, as JSON +extern_c int +ElapsedTimePrintJSON(ConstHandle2ConstElapsedTime self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ElapsedTimeLabelHas(ConstHandle2ConstElapsedTime self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ElapsedTimeLabelGet(ConstHandle2ConstElapsedTime self); + +// +++ Set +extern_c void +ElapsedTimeLabelSet(ConstHandle2ElapsedTime self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Child: time +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ElapsedTimeTimeHas(ConstHandle2ConstElapsedTime self); + +// --- Get, const +extern_c Handle2ConstTime +ElapsedTimeTimeGetConst(ConstHandle2ConstElapsedTime self); + +// +++ Get, non-const +extern_c Handle2Time +ElapsedTimeTimeGet(ConstHandle2ElapsedTime self); + +// +++ Set +extern_c void +ElapsedTimeTimeSet(ConstHandle2ElapsedTime self, ConstHandle2ConstTime time); + + +// ----------------------------------------------------------------------------- +// Child: yields +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ElapsedTimeYieldsHas(ConstHandle2ConstElapsedTime self); + +// --- Get, const +extern_c Handle2ConstYields +ElapsedTimeYieldsGetConst(ConstHandle2ConstElapsedTime self); + +// +++ Get, non-const +extern_c Handle2Yields +ElapsedTimeYieldsGet(ConstHandle2ElapsedTime self); + +// +++ Set +extern_c void +ElapsedTimeYieldsSet(ConstHandle2ElapsedTime self, ConstHandle2ConstYields yields); + + +// ----------------------------------------------------------------------------- +// Child: incidentEnergies +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ElapsedTimeIncidentEnergiesHas(ConstHandle2ConstElapsedTime self); + +// --- Get, const +extern_c Handle2ConstIncidentEnergies +ElapsedTimeIncidentEnergiesGetConst(ConstHandle2ConstElapsedTime self); + +// +++ Get, non-const +extern_c Handle2IncidentEnergies +ElapsedTimeIncidentEnergiesGet(ConstHandle2ElapsedTime self); + +// +++ Set +extern_c void +ElapsedTimeIncidentEnergiesSet(ConstHandle2ElapsedTime self, ConstHandle2ConstIncidentEnergies incidentEnergies); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ElapsedTime/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTime/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTime/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTime/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTime/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTimes.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTimes.cpp new file mode 100644 index 000000000..1e3c1b89d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTimes.cpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ElapsedTimes.hpp" +#include "ElapsedTimes.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ElapsedTimesClass; +using CPP = multigroup::ElapsedTimes; + +static const std::string CLASSNAME = "ElapsedTimes"; + +namespace extract { + static auto elapsedTime = [](auto &obj) { return &obj.elapsedTime; }; +} + +using CPPElapsedTime = general::ElapsedTime; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstElapsedTimes +ElapsedTimesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ElapsedTimes +ElapsedTimesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstElapsedTimes +ElapsedTimesCreateConst( + ConstHandle2ElapsedTime *const elapsedTime, const size_t elapsedTimeSize +) { + ConstHandle2ElapsedTimes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ElapsedTimeN = 0; ElapsedTimeN < elapsedTimeSize; ++ElapsedTimeN) + ElapsedTimesElapsedTimeAdd(handle, elapsedTime[ElapsedTimeN]); + return handle; +} + +// Create, general, non-const +Handle2ElapsedTimes +ElapsedTimesCreate( + ConstHandle2ElapsedTime *const elapsedTime, const size_t elapsedTimeSize +) { + ConstHandle2ElapsedTimes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ElapsedTimeN = 0; ElapsedTimeN < elapsedTimeSize; ++ElapsedTimeN) + ElapsedTimesElapsedTimeAdd(handle, elapsedTime[ElapsedTimeN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ElapsedTimesAssign(ConstHandle2ElapsedTimes self, ConstHandle2ConstElapsedTimes from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ElapsedTimesDelete(ConstHandle2ConstElapsedTimes self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ElapsedTimesRead(ConstHandle2ElapsedTimes self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ElapsedTimesWrite(ConstHandle2ConstElapsedTimes self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ElapsedTimesPrint(ConstHandle2ConstElapsedTimes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ElapsedTimesPrintXML(ConstHandle2ConstElapsedTimes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ElapsedTimesPrintJSON(ConstHandle2ConstElapsedTimes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: elapsedTime +// ----------------------------------------------------------------------------- + +// Has +int +ElapsedTimesElapsedTimeHas(ConstHandle2ConstElapsedTimes self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ElapsedTimeHas", self, extract::elapsedTime); +} + +// Clear +void +ElapsedTimesElapsedTimeClear(ConstHandle2ElapsedTimes self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ElapsedTimeClear", self, extract::elapsedTime); +} + +// Size +size_t +ElapsedTimesElapsedTimeSize(ConstHandle2ConstElapsedTimes self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ElapsedTimeSize", self, extract::elapsedTime); +} + +// Add +void +ElapsedTimesElapsedTimeAdd(ConstHandle2ElapsedTimes self, ConstHandle2ConstElapsedTime elapsedTime) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ElapsedTimeAdd", self, extract::elapsedTime, elapsedTime); +} + +// Get, by index \in [0,size), const +Handle2ConstElapsedTime +ElapsedTimesElapsedTimeGetConst(ConstHandle2ConstElapsedTimes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ElapsedTimeGetConst", self, extract::elapsedTime, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ElapsedTime +ElapsedTimesElapsedTimeGet(ConstHandle2ElapsedTimes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ElapsedTimeGet", self, extract::elapsedTime, index_); +} + +// Set, by index \in [0,size) +void +ElapsedTimesElapsedTimeSet( + ConstHandle2ElapsedTimes self, + const size_t index_, + ConstHandle2ConstElapsedTime elapsedTime +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ElapsedTimeSet", self, extract::elapsedTime, index_, elapsedTime); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ElapsedTimesElapsedTimeHasByLabel( + ConstHandle2ConstElapsedTimes self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ElapsedTimeHasByLabel", + self, extract::elapsedTime, meta::label, label); +} + +// Get, by label, const +Handle2ConstElapsedTime +ElapsedTimesElapsedTimeGetByLabelConst( + ConstHandle2ConstElapsedTimes self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ElapsedTimeGetByLabelConst", + self, extract::elapsedTime, meta::label, label); +} + +// Get, by label, non-const +Handle2ElapsedTime +ElapsedTimesElapsedTimeGetByLabel( + ConstHandle2ElapsedTimes self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ElapsedTimeGetByLabel", + self, extract::elapsedTime, meta::label, label); +} + +// Set, by label +void +ElapsedTimesElapsedTimeSetByLabel( + ConstHandle2ElapsedTimes self, + const char *const label, + ConstHandle2ConstElapsedTime elapsedTime +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ElapsedTimeSetByLabel", + self, extract::elapsedTime, meta::label, label, elapsedTime); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ElapsedTimes/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTimes.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTimes.h new file mode 100644 index 000000000..d614a5873 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTimes.h @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ElapsedTimes is the basic handle type in this file. Example: +// // Create a default ElapsedTimes object: +// ElapsedTimes handle = ElapsedTimesDefault(); +// Functions involving ElapsedTimes are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ELAPSEDTIMES +#define C_INTERFACE_GNDS_V2_0_GENERAL_ELAPSEDTIMES + +#include "GNDStk.h" +#include "v2.0/general/ElapsedTime.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ElapsedTimesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ElapsedTimes +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ElapsedTimesClass *ElapsedTimes; + +// --- Const-aware handles. +typedef const struct ElapsedTimesClass *const ConstHandle2ConstElapsedTimes; +typedef struct ElapsedTimesClass *const ConstHandle2ElapsedTimes; +typedef const struct ElapsedTimesClass * Handle2ConstElapsedTimes; +typedef struct ElapsedTimesClass * Handle2ElapsedTimes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstElapsedTimes +ElapsedTimesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ElapsedTimes +ElapsedTimesDefault(); + +// --- Create, general, const +extern_c Handle2ConstElapsedTimes +ElapsedTimesCreateConst( + ConstHandle2ElapsedTime *const elapsedTime, const size_t elapsedTimeSize +); + +// +++ Create, general, non-const +extern_c Handle2ElapsedTimes +ElapsedTimesCreate( + ConstHandle2ElapsedTime *const elapsedTime, const size_t elapsedTimeSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ElapsedTimesAssign(ConstHandle2ElapsedTimes self, ConstHandle2ConstElapsedTimes from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ElapsedTimesDelete(ConstHandle2ConstElapsedTimes self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ElapsedTimesRead(ConstHandle2ElapsedTimes self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ElapsedTimesWrite(ConstHandle2ConstElapsedTimes self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ElapsedTimesPrint(ConstHandle2ConstElapsedTimes self); + +// +++ Print to standard output, as XML +extern_c int +ElapsedTimesPrintXML(ConstHandle2ConstElapsedTimes self); + +// +++ Print to standard output, as JSON +extern_c int +ElapsedTimesPrintJSON(ConstHandle2ConstElapsedTimes self); + + +// ----------------------------------------------------------------------------- +// Child: elapsedTime +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ElapsedTimesElapsedTimeHas(ConstHandle2ConstElapsedTimes self); + +// +++ Clear +extern_c void +ElapsedTimesElapsedTimeClear(ConstHandle2ElapsedTimes self); + +// +++ Size +extern_c size_t +ElapsedTimesElapsedTimeSize(ConstHandle2ConstElapsedTimes self); + +// +++ Add +extern_c void +ElapsedTimesElapsedTimeAdd(ConstHandle2ElapsedTimes self, ConstHandle2ConstElapsedTime elapsedTime); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstElapsedTime +ElapsedTimesElapsedTimeGetConst(ConstHandle2ConstElapsedTimes self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ElapsedTime +ElapsedTimesElapsedTimeGet(ConstHandle2ElapsedTimes self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ElapsedTimesElapsedTimeSet( + ConstHandle2ElapsedTimes self, + const size_t index_, + ConstHandle2ConstElapsedTime elapsedTime +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ElapsedTimesElapsedTimeHasByLabel( + ConstHandle2ConstElapsedTimes self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstElapsedTime +ElapsedTimesElapsedTimeGetByLabelConst( + ConstHandle2ConstElapsedTimes self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2ElapsedTime +ElapsedTimesElapsedTimeGetByLabel( + ConstHandle2ElapsedTimes self, + const char *const label +); + +// +++ Set, by label +extern_c void +ElapsedTimesElapsedTimeSetByLabel( + ConstHandle2ElapsedTimes self, + const char *const label, + ConstHandle2ConstElapsedTime elapsedTime +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ElapsedTimes/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTimes/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTimes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTimes/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ElapsedTimes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EndfCompatible.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EndfCompatible.cpp new file mode 100644 index 000000000..0d5cc4358 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EndfCompatible.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/EndfCompatible.hpp" +#include "EndfCompatible.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = EndfCompatibleClass; +using CPP = multigroup::EndfCompatible; + +static const std::string CLASSNAME = "EndfCompatible"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEndfCompatible +EndfCompatibleDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2EndfCompatible +EndfCompatibleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEndfCompatible +EndfCompatibleCreateConst() +{ + ConstHandle2EndfCompatible handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general, non-const +Handle2EndfCompatible +EndfCompatibleCreate() +{ + ConstHandle2EndfCompatible handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create" + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +EndfCompatibleAssign(ConstHandle2EndfCompatible self, ConstHandle2ConstEndfCompatible from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +EndfCompatibleDelete(ConstHandle2ConstEndfCompatible self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +EndfCompatibleRead(ConstHandle2EndfCompatible self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +EndfCompatibleWrite(ConstHandle2ConstEndfCompatible self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +EndfCompatiblePrint(ConstHandle2ConstEndfCompatible self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +EndfCompatiblePrintXML(ConstHandle2ConstEndfCompatible self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +EndfCompatiblePrintJSON(ConstHandle2ConstEndfCompatible self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/EndfCompatible/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EndfCompatible.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EndfCompatible.h new file mode 100644 index 000000000..d77408917 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EndfCompatible.h @@ -0,0 +1,135 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// EndfCompatible is the basic handle type in this file. Example: +// // Create a default EndfCompatible object: +// EndfCompatible handle = EndfCompatibleDefault(); +// Functions involving EndfCompatible are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ENDFCOMPATIBLE +#define C_INTERFACE_GNDS_V2_0_GENERAL_ENDFCOMPATIBLE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct EndfCompatibleClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ EndfCompatible +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct EndfCompatibleClass *EndfCompatible; + +// --- Const-aware handles. +typedef const struct EndfCompatibleClass *const ConstHandle2ConstEndfCompatible; +typedef struct EndfCompatibleClass *const ConstHandle2EndfCompatible; +typedef const struct EndfCompatibleClass * Handle2ConstEndfCompatible; +typedef struct EndfCompatibleClass * Handle2EndfCompatible; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEndfCompatible +EndfCompatibleDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2EndfCompatible +EndfCompatibleDefault(); + +// --- Create, general, const +extern_c Handle2ConstEndfCompatible +EndfCompatibleCreateConst(); + +// +++ Create, general, non-const +extern_c Handle2EndfCompatible +EndfCompatibleCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +EndfCompatibleAssign(ConstHandle2EndfCompatible self, ConstHandle2ConstEndfCompatible from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +EndfCompatibleDelete(ConstHandle2ConstEndfCompatible self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +EndfCompatibleRead(ConstHandle2EndfCompatible self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +EndfCompatibleWrite(ConstHandle2ConstEndfCompatible self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +EndfCompatiblePrint(ConstHandle2ConstEndfCompatible self); + +// +++ Print to standard output, as XML +extern_c int +EndfCompatiblePrintXML(ConstHandle2ConstEndfCompatible self); + +// +++ Print to standard output, as JSON +extern_c int +EndfCompatiblePrintJSON(ConstHandle2ConstEndfCompatible self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/EndfCompatible/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EndfCompatible/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EndfCompatible/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EndfCompatible/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EndfCompatible/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Energy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Energy.cpp new file mode 100644 index 000000000..64a21e45f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Energy.cpp @@ -0,0 +1,681 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Energy.hpp" +#include "Energy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = EnergyClass; +using CPP = multigroup::Energy; + +static const std::string CLASSNAME = "Energy"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto Double = [](auto &obj) { return &obj.Double; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto NBodyPhaseSpace = [](auto &obj) { return &obj.NBodyPhaseSpace; }; + static auto primaryGamma = [](auto &obj) { return &obj.primaryGamma; }; + static auto discreteGamma = [](auto &obj) { return &obj.discreteGamma; }; + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; + static auto generalEvaporation = [](auto &obj) { return &obj.generalEvaporation; }; + static auto evaporation = [](auto &obj) { return &obj.evaporation; }; + static auto weightedFunctionals = [](auto &obj) { return &obj.weightedFunctionals; }; + static auto simpleMaxwellianFission = [](auto &obj) { return &obj.simpleMaxwellianFission; }; + static auto MadlandNix = [](auto &obj) { return &obj.MadlandNix; }; +} + +using CPPDouble = general::Double; +using CPPUncertainty = general::Uncertainty; +using CPPNBodyPhaseSpace = general::NBodyPhaseSpace; +using CPPPrimaryGamma = general::PrimaryGamma; +using CPPDiscreteGamma = general::DiscreteGamma; +using CPPXYs2d = general::XYs2d; +using CPPGeneralEvaporation = general::GeneralEvaporation; +using CPPEvaporation = general::Evaporation; +using CPPWeightedFunctionals = general::WeightedFunctionals; +using CPPSimpleMaxwellianFission = general::SimpleMaxwellianFission; +using CPPMadlandNix = general::MadlandNix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEnergy +EnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Energy +EnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEnergy +EnergyCreateConst( + const double value, + const char *const unit, + ConstHandle2ConstDouble Double, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace, + ConstHandle2ConstPrimaryGamma primaryGamma, + ConstHandle2ConstDiscreteGamma discreteGamma, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstWeightedFunctionals weightedFunctionals, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstMadlandNix MadlandNix +) { + ConstHandle2Energy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + unit, + detail::tocpp(Double), + detail::tocpp(uncertainty), + detail::tocpp(NBodyPhaseSpace), + detail::tocpp(primaryGamma), + detail::tocpp(discreteGamma), + detail::tocpp(XYs2d), + detail::tocpp(generalEvaporation), + detail::tocpp(evaporation), + detail::tocpp(weightedFunctionals), + detail::tocpp(simpleMaxwellianFission), + detail::tocpp(MadlandNix) + ); + return handle; +} + +// Create, general, non-const +Handle2Energy +EnergyCreate( + const double value, + const char *const unit, + ConstHandle2ConstDouble Double, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace, + ConstHandle2ConstPrimaryGamma primaryGamma, + ConstHandle2ConstDiscreteGamma discreteGamma, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstWeightedFunctionals weightedFunctionals, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstMadlandNix MadlandNix +) { + ConstHandle2Energy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + unit, + detail::tocpp(Double), + detail::tocpp(uncertainty), + detail::tocpp(NBodyPhaseSpace), + detail::tocpp(primaryGamma), + detail::tocpp(discreteGamma), + detail::tocpp(XYs2d), + detail::tocpp(generalEvaporation), + detail::tocpp(evaporation), + detail::tocpp(weightedFunctionals), + detail::tocpp(simpleMaxwellianFission), + detail::tocpp(MadlandNix) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +EnergyAssign(ConstHandle2Energy self, ConstHandle2ConstEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +EnergyDelete(ConstHandle2ConstEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +EnergyRead(ConstHandle2Energy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +EnergyWrite(ConstHandle2ConstEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +EnergyPrint(ConstHandle2ConstEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +EnergyPrintXML(ConstHandle2ConstEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +EnergyPrintJSON(ConstHandle2ConstEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +EnergyValueHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +EnergyValueGet(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +EnergyValueSet(ConstHandle2Energy self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +EnergyUnitHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +EnergyUnitGet(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +EnergyUnitSet(ConstHandle2Energy self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +EnergyDoubleHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Get, const +Handle2ConstDouble +EnergyDoubleGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double); +} + +// Get, non-const +Handle2Double +EnergyDoubleGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double); +} + +// Set +void +EnergyDoubleSet(ConstHandle2Energy self, ConstHandle2ConstDouble Double) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, Double); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +EnergyUncertaintyHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +EnergyUncertaintyGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +EnergyUncertaintyGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +EnergyUncertaintySet(ConstHandle2Energy self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Child: NBodyPhaseSpace +// ----------------------------------------------------------------------------- + +// Has +int +EnergyNBodyPhaseSpaceHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NBodyPhaseSpaceHas", self, extract::NBodyPhaseSpace); +} + +// Get, const +Handle2ConstNBodyPhaseSpace +EnergyNBodyPhaseSpaceGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NBodyPhaseSpaceGetConst", self, extract::NBodyPhaseSpace); +} + +// Get, non-const +Handle2NBodyPhaseSpace +EnergyNBodyPhaseSpaceGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NBodyPhaseSpaceGet", self, extract::NBodyPhaseSpace); +} + +// Set +void +EnergyNBodyPhaseSpaceSet(ConstHandle2Energy self, ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NBodyPhaseSpaceSet", self, extract::NBodyPhaseSpace, NBodyPhaseSpace); +} + + +// ----------------------------------------------------------------------------- +// Child: primaryGamma +// ----------------------------------------------------------------------------- + +// Has +int +EnergyPrimaryGammaHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PrimaryGammaHas", self, extract::primaryGamma); +} + +// Get, const +Handle2ConstPrimaryGamma +EnergyPrimaryGammaGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PrimaryGammaGetConst", self, extract::primaryGamma); +} + +// Get, non-const +Handle2PrimaryGamma +EnergyPrimaryGammaGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PrimaryGammaGet", self, extract::primaryGamma); +} + +// Set +void +EnergyPrimaryGammaSet(ConstHandle2Energy self, ConstHandle2ConstPrimaryGamma primaryGamma) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PrimaryGammaSet", self, extract::primaryGamma, primaryGamma); +} + + +// ----------------------------------------------------------------------------- +// Child: discreteGamma +// ----------------------------------------------------------------------------- + +// Has +int +EnergyDiscreteGammaHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DiscreteGammaHas", self, extract::discreteGamma); +} + +// Get, const +Handle2ConstDiscreteGamma +EnergyDiscreteGammaGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DiscreteGammaGetConst", self, extract::discreteGamma); +} + +// Get, non-const +Handle2DiscreteGamma +EnergyDiscreteGammaGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DiscreteGammaGet", self, extract::discreteGamma); +} + +// Set +void +EnergyDiscreteGammaSet(ConstHandle2Energy self, ConstHandle2ConstDiscreteGamma discreteGamma) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DiscreteGammaSet", self, extract::discreteGamma, discreteGamma); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +EnergyXYs2dHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +EnergyXYs2dGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +EnergyXYs2dGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +EnergyXYs2dSet(ConstHandle2Energy self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Child: generalEvaporation +// ----------------------------------------------------------------------------- + +// Has +int +EnergyGeneralEvaporationHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GeneralEvaporationHas", self, extract::generalEvaporation); +} + +// Get, const +Handle2ConstGeneralEvaporation +EnergyGeneralEvaporationGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GeneralEvaporationGetConst", self, extract::generalEvaporation); +} + +// Get, non-const +Handle2GeneralEvaporation +EnergyGeneralEvaporationGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GeneralEvaporationGet", self, extract::generalEvaporation); +} + +// Set +void +EnergyGeneralEvaporationSet(ConstHandle2Energy self, ConstHandle2ConstGeneralEvaporation generalEvaporation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GeneralEvaporationSet", self, extract::generalEvaporation, generalEvaporation); +} + + +// ----------------------------------------------------------------------------- +// Child: evaporation +// ----------------------------------------------------------------------------- + +// Has +int +EnergyEvaporationHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EvaporationHas", self, extract::evaporation); +} + +// Get, const +Handle2ConstEvaporation +EnergyEvaporationGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaporationGetConst", self, extract::evaporation); +} + +// Get, non-const +Handle2Evaporation +EnergyEvaporationGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaporationGet", self, extract::evaporation); +} + +// Set +void +EnergyEvaporationSet(ConstHandle2Energy self, ConstHandle2ConstEvaporation evaporation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EvaporationSet", self, extract::evaporation, evaporation); +} + + +// ----------------------------------------------------------------------------- +// Child: weightedFunctionals +// ----------------------------------------------------------------------------- + +// Has +int +EnergyWeightedFunctionalsHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"WeightedFunctionalsHas", self, extract::weightedFunctionals); +} + +// Get, const +Handle2ConstWeightedFunctionals +EnergyWeightedFunctionalsGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WeightedFunctionalsGetConst", self, extract::weightedFunctionals); +} + +// Get, non-const +Handle2WeightedFunctionals +EnergyWeightedFunctionalsGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WeightedFunctionalsGet", self, extract::weightedFunctionals); +} + +// Set +void +EnergyWeightedFunctionalsSet(ConstHandle2Energy self, ConstHandle2ConstWeightedFunctionals weightedFunctionals) +{ + detail::setField + (CLASSNAME, CLASSNAME+"WeightedFunctionalsSet", self, extract::weightedFunctionals, weightedFunctionals); +} + + +// ----------------------------------------------------------------------------- +// Child: simpleMaxwellianFission +// ----------------------------------------------------------------------------- + +// Has +int +EnergySimpleMaxwellianFissionHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionHas", self, extract::simpleMaxwellianFission); +} + +// Get, const +Handle2ConstSimpleMaxwellianFission +EnergySimpleMaxwellianFissionGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionGetConst", self, extract::simpleMaxwellianFission); +} + +// Get, non-const +Handle2SimpleMaxwellianFission +EnergySimpleMaxwellianFissionGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionGet", self, extract::simpleMaxwellianFission); +} + +// Set +void +EnergySimpleMaxwellianFissionSet(ConstHandle2Energy self, ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SimpleMaxwellianFissionSet", self, extract::simpleMaxwellianFission, simpleMaxwellianFission); +} + + +// ----------------------------------------------------------------------------- +// Child: MadlandNix +// ----------------------------------------------------------------------------- + +// Has +int +EnergyMadlandNixHas(ConstHandle2ConstEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MadlandNixHas", self, extract::MadlandNix); +} + +// Get, const +Handle2ConstMadlandNix +EnergyMadlandNixGetConst(ConstHandle2ConstEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MadlandNixGetConst", self, extract::MadlandNix); +} + +// Get, non-const +Handle2MadlandNix +EnergyMadlandNixGet(ConstHandle2Energy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MadlandNixGet", self, extract::MadlandNix); +} + +// Set +void +EnergyMadlandNixSet(ConstHandle2Energy self, ConstHandle2ConstMadlandNix MadlandNix) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MadlandNixSet", self, extract::MadlandNix, MadlandNix); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Energy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Energy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Energy.h new file mode 100644 index 000000000..21e26a8b4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Energy.h @@ -0,0 +1,441 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Energy is the basic handle type in this file. Example: +// // Create a default Energy object: +// Energy handle = EnergyDefault(); +// Functions involving Energy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_ENERGY + +#include "GNDStk.h" +#include "v2.0/general/Double.h" +#include "v2.0/general/Uncertainty.h" +#include "v2.0/general/NBodyPhaseSpace.h" +#include "v2.0/general/PrimaryGamma.h" +#include "v2.0/general/DiscreteGamma.h" +#include "v2.0/general/XYs2d.h" +#include "v2.0/general/GeneralEvaporation.h" +#include "v2.0/general/Evaporation.h" +#include "v2.0/general/WeightedFunctionals.h" +#include "v2.0/general/SimpleMaxwellianFission.h" +#include "v2.0/general/MadlandNix.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct EnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Energy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct EnergyClass *Energy; + +// --- Const-aware handles. +typedef const struct EnergyClass *const ConstHandle2ConstEnergy; +typedef struct EnergyClass *const ConstHandle2Energy; +typedef const struct EnergyClass * Handle2ConstEnergy; +typedef struct EnergyClass * Handle2Energy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEnergy +EnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Energy +EnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstEnergy +EnergyCreateConst( + const double value, + const char *const unit, + ConstHandle2ConstDouble Double, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace, + ConstHandle2ConstPrimaryGamma primaryGamma, + ConstHandle2ConstDiscreteGamma discreteGamma, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstWeightedFunctionals weightedFunctionals, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstMadlandNix MadlandNix +); + +// +++ Create, general, non-const +extern_c Handle2Energy +EnergyCreate( + const double value, + const char *const unit, + ConstHandle2ConstDouble Double, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace, + ConstHandle2ConstPrimaryGamma primaryGamma, + ConstHandle2ConstDiscreteGamma discreteGamma, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstGeneralEvaporation generalEvaporation, + ConstHandle2ConstEvaporation evaporation, + ConstHandle2ConstWeightedFunctionals weightedFunctionals, + ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission, + ConstHandle2ConstMadlandNix MadlandNix +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +EnergyAssign(ConstHandle2Energy self, ConstHandle2ConstEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +EnergyDelete(ConstHandle2ConstEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +EnergyRead(ConstHandle2Energy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +EnergyWrite(ConstHandle2ConstEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +EnergyPrint(ConstHandle2ConstEnergy self); + +// +++ Print to standard output, as XML +extern_c int +EnergyPrintXML(ConstHandle2ConstEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +EnergyPrintJSON(ConstHandle2ConstEnergy self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyValueHas(ConstHandle2ConstEnergy self); + +// +++ Get +// +++ Returns by value +extern_c double +EnergyValueGet(ConstHandle2ConstEnergy self); + +// +++ Set +extern_c void +EnergyValueSet(ConstHandle2Energy self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyUnitHas(ConstHandle2ConstEnergy self); + +// +++ Get +// +++ Returns by value +extern_c const char * +EnergyUnitGet(ConstHandle2ConstEnergy self); + +// +++ Set +extern_c void +EnergyUnitSet(ConstHandle2Energy self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyDoubleHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstDouble +EnergyDoubleGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2Double +EnergyDoubleGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyDoubleSet(ConstHandle2Energy self, ConstHandle2ConstDouble Double); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyUncertaintyHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstUncertainty +EnergyUncertaintyGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +EnergyUncertaintyGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyUncertaintySet(ConstHandle2Energy self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Child: NBodyPhaseSpace +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyNBodyPhaseSpaceHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstNBodyPhaseSpace +EnergyNBodyPhaseSpaceGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2NBodyPhaseSpace +EnergyNBodyPhaseSpaceGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyNBodyPhaseSpaceSet(ConstHandle2Energy self, ConstHandle2ConstNBodyPhaseSpace NBodyPhaseSpace); + + +// ----------------------------------------------------------------------------- +// Child: primaryGamma +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyPrimaryGammaHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstPrimaryGamma +EnergyPrimaryGammaGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2PrimaryGamma +EnergyPrimaryGammaGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyPrimaryGammaSet(ConstHandle2Energy self, ConstHandle2ConstPrimaryGamma primaryGamma); + + +// ----------------------------------------------------------------------------- +// Child: discreteGamma +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyDiscreteGammaHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstDiscreteGamma +EnergyDiscreteGammaGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2DiscreteGamma +EnergyDiscreteGammaGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyDiscreteGammaSet(ConstHandle2Energy self, ConstHandle2ConstDiscreteGamma discreteGamma); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyXYs2dHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstXYs2d +EnergyXYs2dGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2XYs2d +EnergyXYs2dGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyXYs2dSet(ConstHandle2Energy self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Child: generalEvaporation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyGeneralEvaporationHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstGeneralEvaporation +EnergyGeneralEvaporationGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2GeneralEvaporation +EnergyGeneralEvaporationGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyGeneralEvaporationSet(ConstHandle2Energy self, ConstHandle2ConstGeneralEvaporation generalEvaporation); + + +// ----------------------------------------------------------------------------- +// Child: evaporation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyEvaporationHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstEvaporation +EnergyEvaporationGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2Evaporation +EnergyEvaporationGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyEvaporationSet(ConstHandle2Energy self, ConstHandle2ConstEvaporation evaporation); + + +// ----------------------------------------------------------------------------- +// Child: weightedFunctionals +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyWeightedFunctionalsHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstWeightedFunctionals +EnergyWeightedFunctionalsGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2WeightedFunctionals +EnergyWeightedFunctionalsGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyWeightedFunctionalsSet(ConstHandle2Energy self, ConstHandle2ConstWeightedFunctionals weightedFunctionals); + + +// ----------------------------------------------------------------------------- +// Child: simpleMaxwellianFission +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergySimpleMaxwellianFissionHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstSimpleMaxwellianFission +EnergySimpleMaxwellianFissionGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2SimpleMaxwellianFission +EnergySimpleMaxwellianFissionGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergySimpleMaxwellianFissionSet(ConstHandle2Energy self, ConstHandle2ConstSimpleMaxwellianFission simpleMaxwellianFission); + + +// ----------------------------------------------------------------------------- +// Child: MadlandNix +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyMadlandNixHas(ConstHandle2ConstEnergy self); + +// --- Get, const +extern_c Handle2ConstMadlandNix +EnergyMadlandNixGetConst(ConstHandle2ConstEnergy self); + +// +++ Get, non-const +extern_c Handle2MadlandNix +EnergyMadlandNixGet(ConstHandle2Energy self); + +// +++ Set +extern_c void +EnergyMadlandNixSet(ConstHandle2Energy self, ConstHandle2ConstMadlandNix MadlandNix); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Energy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Energy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Energy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Energy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Energy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EnergyAngular.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EnergyAngular.cpp new file mode 100644 index 000000000..cddb85e80 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EnergyAngular.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/EnergyAngular.hpp" +#include "EnergyAngular.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = EnergyAngularClass; +using CPP = multigroup::EnergyAngular; + +static const std::string CLASSNAME = "EnergyAngular"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto XYs3d = [](auto &obj) { return &obj.XYs3d; }; +} + +using CPPXYs3d = general::XYs3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEnergyAngular +EnergyAngularDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2EnergyAngular +EnergyAngularDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEnergyAngular +EnergyAngularCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs3d XYs3d +) { + ConstHandle2EnergyAngular handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(XYs3d) + ); + return handle; +} + +// Create, general, non-const +Handle2EnergyAngular +EnergyAngularCreate( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs3d XYs3d +) { + ConstHandle2EnergyAngular handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(XYs3d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +EnergyAngularAssign(ConstHandle2EnergyAngular self, ConstHandle2ConstEnergyAngular from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +EnergyAngularDelete(ConstHandle2ConstEnergyAngular self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +EnergyAngularRead(ConstHandle2EnergyAngular self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +EnergyAngularWrite(ConstHandle2ConstEnergyAngular self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +EnergyAngularPrint(ConstHandle2ConstEnergyAngular self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +EnergyAngularPrintXML(ConstHandle2ConstEnergyAngular self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +EnergyAngularPrintJSON(ConstHandle2ConstEnergyAngular self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +EnergyAngularLabelHas(ConstHandle2ConstEnergyAngular self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +EnergyAngularLabelGet(ConstHandle2ConstEnergyAngular self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +EnergyAngularLabelSet(ConstHandle2EnergyAngular self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +EnergyAngularProductFrameHas(ConstHandle2ConstEnergyAngular self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +EnergyAngularProductFrameGet(ConstHandle2ConstEnergyAngular self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +EnergyAngularProductFrameSet(ConstHandle2EnergyAngular self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs3d +// ----------------------------------------------------------------------------- + +// Has +int +EnergyAngularXYs3dHas(ConstHandle2ConstEnergyAngular self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs3dHas", self, extract::XYs3d); +} + +// Get, const +Handle2ConstXYs3d +EnergyAngularXYs3dGetConst(ConstHandle2ConstEnergyAngular self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs3dGetConst", self, extract::XYs3d); +} + +// Get, non-const +Handle2XYs3d +EnergyAngularXYs3dGet(ConstHandle2EnergyAngular self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs3dGet", self, extract::XYs3d); +} + +// Set +void +EnergyAngularXYs3dSet(ConstHandle2EnergyAngular self, ConstHandle2ConstXYs3d XYs3d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs3dSet", self, extract::XYs3d, XYs3d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/EnergyAngular/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EnergyAngular.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EnergyAngular.h new file mode 100644 index 000000000..06cee686e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EnergyAngular.h @@ -0,0 +1,201 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// EnergyAngular is the basic handle type in this file. Example: +// // Create a default EnergyAngular object: +// EnergyAngular handle = EnergyAngularDefault(); +// Functions involving EnergyAngular are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ENERGYANGULAR +#define C_INTERFACE_GNDS_V2_0_GENERAL_ENERGYANGULAR + +#include "GNDStk.h" +#include "v2.0/general/XYs3d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct EnergyAngularClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ EnergyAngular +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct EnergyAngularClass *EnergyAngular; + +// --- Const-aware handles. +typedef const struct EnergyAngularClass *const ConstHandle2ConstEnergyAngular; +typedef struct EnergyAngularClass *const ConstHandle2EnergyAngular; +typedef const struct EnergyAngularClass * Handle2ConstEnergyAngular; +typedef struct EnergyAngularClass * Handle2EnergyAngular; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEnergyAngular +EnergyAngularDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2EnergyAngular +EnergyAngularDefault(); + +// --- Create, general, const +extern_c Handle2ConstEnergyAngular +EnergyAngularCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs3d XYs3d +); + +// +++ Create, general, non-const +extern_c Handle2EnergyAngular +EnergyAngularCreate( + const char *const label, + const char *const productFrame, + ConstHandle2ConstXYs3d XYs3d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +EnergyAngularAssign(ConstHandle2EnergyAngular self, ConstHandle2ConstEnergyAngular from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +EnergyAngularDelete(ConstHandle2ConstEnergyAngular self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +EnergyAngularRead(ConstHandle2EnergyAngular self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +EnergyAngularWrite(ConstHandle2ConstEnergyAngular self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +EnergyAngularPrint(ConstHandle2ConstEnergyAngular self); + +// +++ Print to standard output, as XML +extern_c int +EnergyAngularPrintXML(ConstHandle2ConstEnergyAngular self); + +// +++ Print to standard output, as JSON +extern_c int +EnergyAngularPrintJSON(ConstHandle2ConstEnergyAngular self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyAngularLabelHas(ConstHandle2ConstEnergyAngular self); + +// +++ Get +// +++ Returns by value +extern_c const char * +EnergyAngularLabelGet(ConstHandle2ConstEnergyAngular self); + +// +++ Set +extern_c void +EnergyAngularLabelSet(ConstHandle2EnergyAngular self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyAngularProductFrameHas(ConstHandle2ConstEnergyAngular self); + +// +++ Get +// +++ Returns by value +extern_c const char * +EnergyAngularProductFrameGet(ConstHandle2ConstEnergyAngular self); + +// +++ Set +extern_c void +EnergyAngularProductFrameSet(ConstHandle2EnergyAngular self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Child: XYs3d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EnergyAngularXYs3dHas(ConstHandle2ConstEnergyAngular self); + +// --- Get, const +extern_c Handle2ConstXYs3d +EnergyAngularXYs3dGetConst(ConstHandle2ConstEnergyAngular self); + +// +++ Get, non-const +extern_c Handle2XYs3d +EnergyAngularXYs3dGet(ConstHandle2EnergyAngular self); + +// +++ Set +extern_c void +EnergyAngularXYs3dSet(ConstHandle2EnergyAngular self, ConstHandle2ConstXYs3d XYs3d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/EnergyAngular/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EnergyAngular/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EnergyAngular/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EnergyAngular/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/EnergyAngular/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaluated.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaluated.cpp new file mode 100644 index 000000000..f37bfa618 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaluated.cpp @@ -0,0 +1,407 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Evaluated.hpp" +#include "Evaluated.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = EvaluatedClass; +using CPP = multigroup::Evaluated; + +static const std::string CLASSNAME = "Evaluated"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto date = [](auto &obj) { return &obj.date; }; + static auto library = [](auto &obj) { return &obj.library; }; + static auto version = [](auto &obj) { return &obj.version; }; + static auto documentation = [](auto &obj) { return &obj.documentation; }; + static auto temperature = [](auto &obj) { return &obj.temperature; }; + static auto projectileEnergyDomain = [](auto &obj) { return &obj.projectileEnergyDomain; }; +} + +using CPPDocumentation = general::Documentation; +using CPPTemperature = general::Temperature; +using CPPProjectileEnergyDomain = general::ProjectileEnergyDomain; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEvaluated +EvaluatedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Evaluated +EvaluatedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEvaluated +EvaluatedCreateConst( + const char *const label, + const char *const date, + const char *const library, + const char *const version, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstProjectileEnergyDomain projectileEnergyDomain +) { + ConstHandle2Evaluated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + date, + library, + version, + detail::tocpp(documentation), + detail::tocpp(temperature), + detail::tocpp(projectileEnergyDomain) + ); + return handle; +} + +// Create, general, non-const +Handle2Evaluated +EvaluatedCreate( + const char *const label, + const char *const date, + const char *const library, + const char *const version, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstProjectileEnergyDomain projectileEnergyDomain +) { + ConstHandle2Evaluated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + date, + library, + version, + detail::tocpp(documentation), + detail::tocpp(temperature), + detail::tocpp(projectileEnergyDomain) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +EvaluatedAssign(ConstHandle2Evaluated self, ConstHandle2ConstEvaluated from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +EvaluatedDelete(ConstHandle2ConstEvaluated self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +EvaluatedRead(ConstHandle2Evaluated self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +EvaluatedWrite(ConstHandle2ConstEvaluated self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +EvaluatedPrint(ConstHandle2ConstEvaluated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +EvaluatedPrintXML(ConstHandle2ConstEvaluated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +EvaluatedPrintJSON(ConstHandle2ConstEvaluated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +EvaluatedLabelHas(ConstHandle2ConstEvaluated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +EvaluatedLabelGet(ConstHandle2ConstEvaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +EvaluatedLabelSet(ConstHandle2Evaluated self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// Has +int +EvaluatedDateHas(ConstHandle2ConstEvaluated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DateHas", self, extract::date); +} + +// Get +// Returns by value +const char * +EvaluatedDateGet(ConstHandle2ConstEvaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DateGet", self, extract::date); +} + +// Set +void +EvaluatedDateSet(ConstHandle2Evaluated self, const char *const date) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DateSet", self, extract::date, date); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: library +// ----------------------------------------------------------------------------- + +// Has +int +EvaluatedLibraryHas(ConstHandle2ConstEvaluated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LibraryHas", self, extract::library); +} + +// Get +// Returns by value +const char * +EvaluatedLibraryGet(ConstHandle2ConstEvaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LibraryGet", self, extract::library); +} + +// Set +void +EvaluatedLibrarySet(ConstHandle2Evaluated self, const char *const library) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LibrarySet", self, extract::library, library); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: version +// ----------------------------------------------------------------------------- + +// Has +int +EvaluatedVersionHas(ConstHandle2ConstEvaluated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"VersionHas", self, extract::version); +} + +// Get +// Returns by value +const char * +EvaluatedVersionGet(ConstHandle2ConstEvaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"VersionGet", self, extract::version); +} + +// Set +void +EvaluatedVersionSet(ConstHandle2Evaluated self, const char *const version) +{ + detail::setField + (CLASSNAME, CLASSNAME+"VersionSet", self, extract::version, version); +} + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// Has +int +EvaluatedDocumentationHas(ConstHandle2ConstEvaluated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DocumentationHas", self, extract::documentation); +} + +// Get, const +Handle2ConstDocumentation +EvaluatedDocumentationGetConst(ConstHandle2ConstEvaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGetConst", self, extract::documentation); +} + +// Get, non-const +Handle2Documentation +EvaluatedDocumentationGet(ConstHandle2Evaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DocumentationGet", self, extract::documentation); +} + +// Set +void +EvaluatedDocumentationSet(ConstHandle2Evaluated self, ConstHandle2ConstDocumentation documentation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DocumentationSet", self, extract::documentation, documentation); +} + + +// ----------------------------------------------------------------------------- +// Child: temperature +// ----------------------------------------------------------------------------- + +// Has +int +EvaluatedTemperatureHas(ConstHandle2ConstEvaluated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TemperatureHas", self, extract::temperature); +} + +// Get, const +Handle2ConstTemperature +EvaluatedTemperatureGetConst(ConstHandle2ConstEvaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TemperatureGetConst", self, extract::temperature); +} + +// Get, non-const +Handle2Temperature +EvaluatedTemperatureGet(ConstHandle2Evaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TemperatureGet", self, extract::temperature); +} + +// Set +void +EvaluatedTemperatureSet(ConstHandle2Evaluated self, ConstHandle2ConstTemperature temperature) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TemperatureSet", self, extract::temperature, temperature); +} + + +// ----------------------------------------------------------------------------- +// Child: projectileEnergyDomain +// ----------------------------------------------------------------------------- + +// Has +int +EvaluatedProjectileEnergyDomainHas(ConstHandle2ConstEvaluated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProjectileEnergyDomainHas", self, extract::projectileEnergyDomain); +} + +// Get, const +Handle2ConstProjectileEnergyDomain +EvaluatedProjectileEnergyDomainGetConst(ConstHandle2ConstEvaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileEnergyDomainGetConst", self, extract::projectileEnergyDomain); +} + +// Get, non-const +Handle2ProjectileEnergyDomain +EvaluatedProjectileEnergyDomainGet(ConstHandle2Evaluated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileEnergyDomainGet", self, extract::projectileEnergyDomain); +} + +// Set +void +EvaluatedProjectileEnergyDomainSet(ConstHandle2Evaluated self, ConstHandle2ConstProjectileEnergyDomain projectileEnergyDomain) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProjectileEnergyDomainSet", self, extract::projectileEnergyDomain, projectileEnergyDomain); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Evaluated/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaluated.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaluated.h new file mode 100644 index 000000000..11f5be431 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaluated.h @@ -0,0 +1,289 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Evaluated is the basic handle type in this file. Example: +// // Create a default Evaluated object: +// Evaluated handle = EvaluatedDefault(); +// Functions involving Evaluated are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_EVALUATED +#define C_INTERFACE_GNDS_V2_0_GENERAL_EVALUATED + +#include "GNDStk.h" +#include "v2.0/general/Documentation.h" +#include "v2.0/general/Temperature.h" +#include "v2.0/general/ProjectileEnergyDomain.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct EvaluatedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Evaluated +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct EvaluatedClass *Evaluated; + +// --- Const-aware handles. +typedef const struct EvaluatedClass *const ConstHandle2ConstEvaluated; +typedef struct EvaluatedClass *const ConstHandle2Evaluated; +typedef const struct EvaluatedClass * Handle2ConstEvaluated; +typedef struct EvaluatedClass * Handle2Evaluated; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEvaluated +EvaluatedDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Evaluated +EvaluatedDefault(); + +// --- Create, general, const +extern_c Handle2ConstEvaluated +EvaluatedCreateConst( + const char *const label, + const char *const date, + const char *const library, + const char *const version, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstProjectileEnergyDomain projectileEnergyDomain +); + +// +++ Create, general, non-const +extern_c Handle2Evaluated +EvaluatedCreate( + const char *const label, + const char *const date, + const char *const library, + const char *const version, + ConstHandle2ConstDocumentation documentation, + ConstHandle2ConstTemperature temperature, + ConstHandle2ConstProjectileEnergyDomain projectileEnergyDomain +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +EvaluatedAssign(ConstHandle2Evaluated self, ConstHandle2ConstEvaluated from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +EvaluatedDelete(ConstHandle2ConstEvaluated self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +EvaluatedRead(ConstHandle2Evaluated self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +EvaluatedWrite(ConstHandle2ConstEvaluated self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +EvaluatedPrint(ConstHandle2ConstEvaluated self); + +// +++ Print to standard output, as XML +extern_c int +EvaluatedPrintXML(ConstHandle2ConstEvaluated self); + +// +++ Print to standard output, as JSON +extern_c int +EvaluatedPrintJSON(ConstHandle2ConstEvaluated self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaluatedLabelHas(ConstHandle2ConstEvaluated self); + +// +++ Get +// +++ Returns by value +extern_c const char * +EvaluatedLabelGet(ConstHandle2ConstEvaluated self); + +// +++ Set +extern_c void +EvaluatedLabelSet(ConstHandle2Evaluated self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: date +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaluatedDateHas(ConstHandle2ConstEvaluated self); + +// +++ Get +// +++ Returns by value +extern_c const char * +EvaluatedDateGet(ConstHandle2ConstEvaluated self); + +// +++ Set +extern_c void +EvaluatedDateSet(ConstHandle2Evaluated self, const char *const date); + + +// ----------------------------------------------------------------------------- +// Metadatum: library +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaluatedLibraryHas(ConstHandle2ConstEvaluated self); + +// +++ Get +// +++ Returns by value +extern_c const char * +EvaluatedLibraryGet(ConstHandle2ConstEvaluated self); + +// +++ Set +extern_c void +EvaluatedLibrarySet(ConstHandle2Evaluated self, const char *const library); + + +// ----------------------------------------------------------------------------- +// Metadatum: version +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaluatedVersionHas(ConstHandle2ConstEvaluated self); + +// +++ Get +// +++ Returns by value +extern_c const char * +EvaluatedVersionGet(ConstHandle2ConstEvaluated self); + +// +++ Set +extern_c void +EvaluatedVersionSet(ConstHandle2Evaluated self, const char *const version); + + +// ----------------------------------------------------------------------------- +// Child: documentation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaluatedDocumentationHas(ConstHandle2ConstEvaluated self); + +// --- Get, const +extern_c Handle2ConstDocumentation +EvaluatedDocumentationGetConst(ConstHandle2ConstEvaluated self); + +// +++ Get, non-const +extern_c Handle2Documentation +EvaluatedDocumentationGet(ConstHandle2Evaluated self); + +// +++ Set +extern_c void +EvaluatedDocumentationSet(ConstHandle2Evaluated self, ConstHandle2ConstDocumentation documentation); + + +// ----------------------------------------------------------------------------- +// Child: temperature +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaluatedTemperatureHas(ConstHandle2ConstEvaluated self); + +// --- Get, const +extern_c Handle2ConstTemperature +EvaluatedTemperatureGetConst(ConstHandle2ConstEvaluated self); + +// +++ Get, non-const +extern_c Handle2Temperature +EvaluatedTemperatureGet(ConstHandle2Evaluated self); + +// +++ Set +extern_c void +EvaluatedTemperatureSet(ConstHandle2Evaluated self, ConstHandle2ConstTemperature temperature); + + +// ----------------------------------------------------------------------------- +// Child: projectileEnergyDomain +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaluatedProjectileEnergyDomainHas(ConstHandle2ConstEvaluated self); + +// --- Get, const +extern_c Handle2ConstProjectileEnergyDomain +EvaluatedProjectileEnergyDomainGetConst(ConstHandle2ConstEvaluated self); + +// +++ Get, non-const +extern_c Handle2ProjectileEnergyDomain +EvaluatedProjectileEnergyDomainGet(ConstHandle2Evaluated self); + +// +++ Set +extern_c void +EvaluatedProjectileEnergyDomainSet(ConstHandle2Evaluated self, ConstHandle2ConstProjectileEnergyDomain projectileEnergyDomain); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Evaluated/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaluated/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaluated/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaluated/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaluated/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaporation.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaporation.cpp new file mode 100644 index 000000000..12388b950 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaporation.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Evaporation.hpp" +#include "Evaporation.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = EvaporationClass; +using CPP = multigroup::Evaporation; + +static const std::string CLASSNAME = "Evaporation"; + +namespace extract { + static auto U = [](auto &obj) { return &obj.U; }; + static auto theta = [](auto &obj) { return &obj.theta; }; +} + +using CPPU = general::U; +using CPPTheta = general::Theta; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstEvaporation +EvaporationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Evaporation +EvaporationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstEvaporation +EvaporationCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +) { + ConstHandle2Evaporation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(U), + detail::tocpp(theta) + ); + return handle; +} + +// Create, general, non-const +Handle2Evaporation +EvaporationCreate( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +) { + ConstHandle2Evaporation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(U), + detail::tocpp(theta) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +EvaporationAssign(ConstHandle2Evaporation self, ConstHandle2ConstEvaporation from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +EvaporationDelete(ConstHandle2ConstEvaporation self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +EvaporationRead(ConstHandle2Evaporation self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +EvaporationWrite(ConstHandle2ConstEvaporation self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +EvaporationPrint(ConstHandle2ConstEvaporation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +EvaporationPrintXML(ConstHandle2ConstEvaporation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +EvaporationPrintJSON(ConstHandle2ConstEvaporation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: U +// ----------------------------------------------------------------------------- + +// Has +int +EvaporationUHas(ConstHandle2ConstEvaporation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UHas", self, extract::U); +} + +// Get, const +Handle2ConstU +EvaporationUGetConst(ConstHandle2ConstEvaporation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UGetConst", self, extract::U); +} + +// Get, non-const +Handle2U +EvaporationUGet(ConstHandle2Evaporation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UGet", self, extract::U); +} + +// Set +void +EvaporationUSet(ConstHandle2Evaporation self, ConstHandle2ConstU U) +{ + detail::setField + (CLASSNAME, CLASSNAME+"USet", self, extract::U, U); +} + + +// ----------------------------------------------------------------------------- +// Child: theta +// ----------------------------------------------------------------------------- + +// Has +int +EvaporationThetaHas(ConstHandle2ConstEvaporation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ThetaHas", self, extract::theta); +} + +// Get, const +Handle2ConstTheta +EvaporationThetaGetConst(ConstHandle2ConstEvaporation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThetaGetConst", self, extract::theta); +} + +// Get, non-const +Handle2Theta +EvaporationThetaGet(ConstHandle2Evaporation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThetaGet", self, extract::theta); +} + +// Set +void +EvaporationThetaSet(ConstHandle2Evaporation self, ConstHandle2ConstTheta theta) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ThetaSet", self, extract::theta, theta); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Evaporation/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaporation.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaporation.h new file mode 100644 index 000000000..b81afb5d5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaporation.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Evaporation is the basic handle type in this file. Example: +// // Create a default Evaporation object: +// Evaporation handle = EvaporationDefault(); +// Functions involving Evaporation are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_EVAPORATION +#define C_INTERFACE_GNDS_V2_0_GENERAL_EVAPORATION + +#include "GNDStk.h" +#include "v2.0/general/U.h" +#include "v2.0/general/Theta.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct EvaporationClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Evaporation +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct EvaporationClass *Evaporation; + +// --- Const-aware handles. +typedef const struct EvaporationClass *const ConstHandle2ConstEvaporation; +typedef struct EvaporationClass *const ConstHandle2Evaporation; +typedef const struct EvaporationClass * Handle2ConstEvaporation; +typedef struct EvaporationClass * Handle2Evaporation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstEvaporation +EvaporationDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Evaporation +EvaporationDefault(); + +// --- Create, general, const +extern_c Handle2ConstEvaporation +EvaporationCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +); + +// +++ Create, general, non-const +extern_c Handle2Evaporation +EvaporationCreate( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +EvaporationAssign(ConstHandle2Evaporation self, ConstHandle2ConstEvaporation from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +EvaporationDelete(ConstHandle2ConstEvaporation self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +EvaporationRead(ConstHandle2Evaporation self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +EvaporationWrite(ConstHandle2ConstEvaporation self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +EvaporationPrint(ConstHandle2ConstEvaporation self); + +// +++ Print to standard output, as XML +extern_c int +EvaporationPrintXML(ConstHandle2ConstEvaporation self); + +// +++ Print to standard output, as JSON +extern_c int +EvaporationPrintJSON(ConstHandle2ConstEvaporation self); + + +// ----------------------------------------------------------------------------- +// Child: U +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaporationUHas(ConstHandle2ConstEvaporation self); + +// --- Get, const +extern_c Handle2ConstU +EvaporationUGetConst(ConstHandle2ConstEvaporation self); + +// +++ Get, non-const +extern_c Handle2U +EvaporationUGet(ConstHandle2Evaporation self); + +// +++ Set +extern_c void +EvaporationUSet(ConstHandle2Evaporation self, ConstHandle2ConstU U); + + +// ----------------------------------------------------------------------------- +// Child: theta +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +EvaporationThetaHas(ConstHandle2ConstEvaporation self); + +// --- Get, const +extern_c Handle2ConstTheta +EvaporationThetaGetConst(ConstHandle2ConstEvaporation self); + +// +++ Get, non-const +extern_c Handle2Theta +EvaporationThetaGet(ConstHandle2Evaporation self); + +// +++ Set +extern_c void +EvaporationThetaSet(ConstHandle2Evaporation self, ConstHandle2ConstTheta theta); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Evaporation/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaporation/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaporation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaporation/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Evaporation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFile.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFile.cpp new file mode 100644 index 000000000..c3dcc45ae --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFile.cpp @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ExternalFile.hpp" +#include "ExternalFile.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ExternalFileClass; +using CPP = multigroup::ExternalFile; + +static const std::string CLASSNAME = "ExternalFile"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto path = [](auto &obj) { return &obj.path; }; + static auto checksum = [](auto &obj) { return &obj.checksum; }; + static auto algorithm = [](auto &obj) { return &obj.algorithm; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstExternalFile +ExternalFileDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ExternalFile +ExternalFileDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstExternalFile +ExternalFileCreateConst( + const char *const label, + const char *const path, + const char *const checksum, + const char *const algorithm +) { + ConstHandle2ExternalFile handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + path, + checksum, + algorithm + ); + return handle; +} + +// Create, general, non-const +Handle2ExternalFile +ExternalFileCreate( + const char *const label, + const char *const path, + const char *const checksum, + const char *const algorithm +) { + ConstHandle2ExternalFile handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + path, + checksum, + algorithm + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ExternalFileAssign(ConstHandle2ExternalFile self, ConstHandle2ConstExternalFile from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ExternalFileDelete(ConstHandle2ConstExternalFile self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ExternalFileRead(ConstHandle2ExternalFile self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ExternalFileWrite(ConstHandle2ConstExternalFile self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ExternalFilePrint(ConstHandle2ConstExternalFile self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ExternalFilePrintXML(ConstHandle2ConstExternalFile self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ExternalFilePrintJSON(ConstHandle2ConstExternalFile self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ExternalFileLabelHas(ConstHandle2ConstExternalFile self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ExternalFileLabelGet(ConstHandle2ConstExternalFile self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ExternalFileLabelSet(ConstHandle2ExternalFile self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: path +// ----------------------------------------------------------------------------- + +// Has +int +ExternalFilePathHas(ConstHandle2ConstExternalFile self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PathHas", self, extract::path); +} + +// Get +// Returns by value +const char * +ExternalFilePathGet(ConstHandle2ConstExternalFile self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PathGet", self, extract::path); +} + +// Set +void +ExternalFilePathSet(ConstHandle2ExternalFile self, const char *const path) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PathSet", self, extract::path, path); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: checksum +// ----------------------------------------------------------------------------- + +// Has +int +ExternalFileChecksumHas(ConstHandle2ConstExternalFile self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChecksumHas", self, extract::checksum); +} + +// Get +// Returns by value +const char * +ExternalFileChecksumGet(ConstHandle2ConstExternalFile self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChecksumGet", self, extract::checksum); +} + +// Set +void +ExternalFileChecksumSet(ConstHandle2ExternalFile self, const char *const checksum) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChecksumSet", self, extract::checksum, checksum); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: algorithm +// ----------------------------------------------------------------------------- + +// Has +int +ExternalFileAlgorithmHas(ConstHandle2ConstExternalFile self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AlgorithmHas", self, extract::algorithm); +} + +// Get +// Returns by value +const char * +ExternalFileAlgorithmGet(ConstHandle2ConstExternalFile self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AlgorithmGet", self, extract::algorithm); +} + +// Set +void +ExternalFileAlgorithmSet(ConstHandle2ExternalFile self, const char *const algorithm) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AlgorithmSet", self, extract::algorithm, algorithm); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ExternalFile/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFile.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFile.h new file mode 100644 index 000000000..10cd48e98 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFile.h @@ -0,0 +1,217 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ExternalFile is the basic handle type in this file. Example: +// // Create a default ExternalFile object: +// ExternalFile handle = ExternalFileDefault(); +// Functions involving ExternalFile are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_EXTERNALFILE +#define C_INTERFACE_GNDS_V2_0_GENERAL_EXTERNALFILE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ExternalFileClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ExternalFile +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ExternalFileClass *ExternalFile; + +// --- Const-aware handles. +typedef const struct ExternalFileClass *const ConstHandle2ConstExternalFile; +typedef struct ExternalFileClass *const ConstHandle2ExternalFile; +typedef const struct ExternalFileClass * Handle2ConstExternalFile; +typedef struct ExternalFileClass * Handle2ExternalFile; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstExternalFile +ExternalFileDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ExternalFile +ExternalFileDefault(); + +// --- Create, general, const +extern_c Handle2ConstExternalFile +ExternalFileCreateConst( + const char *const label, + const char *const path, + const char *const checksum, + const char *const algorithm +); + +// +++ Create, general, non-const +extern_c Handle2ExternalFile +ExternalFileCreate( + const char *const label, + const char *const path, + const char *const checksum, + const char *const algorithm +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ExternalFileAssign(ConstHandle2ExternalFile self, ConstHandle2ConstExternalFile from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ExternalFileDelete(ConstHandle2ConstExternalFile self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ExternalFileRead(ConstHandle2ExternalFile self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ExternalFileWrite(ConstHandle2ConstExternalFile self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ExternalFilePrint(ConstHandle2ConstExternalFile self); + +// +++ Print to standard output, as XML +extern_c int +ExternalFilePrintXML(ConstHandle2ConstExternalFile self); + +// +++ Print to standard output, as JSON +extern_c int +ExternalFilePrintJSON(ConstHandle2ConstExternalFile self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExternalFileLabelHas(ConstHandle2ConstExternalFile self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ExternalFileLabelGet(ConstHandle2ConstExternalFile self); + +// +++ Set +extern_c void +ExternalFileLabelSet(ConstHandle2ExternalFile self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: path +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExternalFilePathHas(ConstHandle2ConstExternalFile self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ExternalFilePathGet(ConstHandle2ConstExternalFile self); + +// +++ Set +extern_c void +ExternalFilePathSet(ConstHandle2ExternalFile self, const char *const path); + + +// ----------------------------------------------------------------------------- +// Metadatum: checksum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExternalFileChecksumHas(ConstHandle2ConstExternalFile self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ExternalFileChecksumGet(ConstHandle2ConstExternalFile self); + +// +++ Set +extern_c void +ExternalFileChecksumSet(ConstHandle2ExternalFile self, const char *const checksum); + + +// ----------------------------------------------------------------------------- +// Metadatum: algorithm +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExternalFileAlgorithmHas(ConstHandle2ConstExternalFile self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ExternalFileAlgorithmGet(ConstHandle2ConstExternalFile self); + +// +++ Set +extern_c void +ExternalFileAlgorithmSet(ConstHandle2ExternalFile self, const char *const algorithm); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ExternalFile/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFile/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFile/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFile/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFile/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFiles.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFiles.cpp new file mode 100644 index 000000000..ac1b74889 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFiles.cpp @@ -0,0 +1,408 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ExternalFiles.hpp" +#include "ExternalFiles.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ExternalFilesClass; +using CPP = multigroup::ExternalFiles; + +static const std::string CLASSNAME = "ExternalFiles"; + +namespace extract { + static auto externalFile = [](auto &obj) { return &obj.externalFile; }; +} + +using CPPExternalFile = general::ExternalFile; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstExternalFiles +ExternalFilesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ExternalFiles +ExternalFilesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstExternalFiles +ExternalFilesCreateConst( + ConstHandle2ExternalFile *const externalFile, const size_t externalFileSize +) { + ConstHandle2ExternalFiles handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ExternalFileN = 0; ExternalFileN < externalFileSize; ++ExternalFileN) + ExternalFilesExternalFileAdd(handle, externalFile[ExternalFileN]); + return handle; +} + +// Create, general, non-const +Handle2ExternalFiles +ExternalFilesCreate( + ConstHandle2ExternalFile *const externalFile, const size_t externalFileSize +) { + ConstHandle2ExternalFiles handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ExternalFileN = 0; ExternalFileN < externalFileSize; ++ExternalFileN) + ExternalFilesExternalFileAdd(handle, externalFile[ExternalFileN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ExternalFilesAssign(ConstHandle2ExternalFiles self, ConstHandle2ConstExternalFiles from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ExternalFilesDelete(ConstHandle2ConstExternalFiles self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ExternalFilesRead(ConstHandle2ExternalFiles self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ExternalFilesWrite(ConstHandle2ConstExternalFiles self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ExternalFilesPrint(ConstHandle2ConstExternalFiles self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ExternalFilesPrintXML(ConstHandle2ConstExternalFiles self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ExternalFilesPrintJSON(ConstHandle2ConstExternalFiles self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: externalFile +// ----------------------------------------------------------------------------- + +// Has +int +ExternalFilesExternalFileHas(ConstHandle2ConstExternalFiles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ExternalFileHas", self, extract::externalFile); +} + +// Clear +void +ExternalFilesExternalFileClear(ConstHandle2ExternalFiles self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ExternalFileClear", self, extract::externalFile); +} + +// Size +size_t +ExternalFilesExternalFileSize(ConstHandle2ConstExternalFiles self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ExternalFileSize", self, extract::externalFile); +} + +// Add +void +ExternalFilesExternalFileAdd(ConstHandle2ExternalFiles self, ConstHandle2ConstExternalFile externalFile) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ExternalFileAdd", self, extract::externalFile, externalFile); +} + +// Get, by index \in [0,size), const +Handle2ConstExternalFile +ExternalFilesExternalFileGetConst(ConstHandle2ConstExternalFiles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ExternalFileGetConst", self, extract::externalFile, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ExternalFile +ExternalFilesExternalFileGet(ConstHandle2ExternalFiles self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ExternalFileGet", self, extract::externalFile, index_); +} + +// Set, by index \in [0,size) +void +ExternalFilesExternalFileSet( + ConstHandle2ExternalFiles self, + const size_t index_, + ConstHandle2ConstExternalFile externalFile +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ExternalFileSet", self, extract::externalFile, index_, externalFile); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ExternalFilesExternalFileHasByLabel( + ConstHandle2ConstExternalFiles self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileHasByLabel", + self, extract::externalFile, meta::label, label); +} + +// Get, by label, const +Handle2ConstExternalFile +ExternalFilesExternalFileGetByLabelConst( + ConstHandle2ConstExternalFiles self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByLabelConst", + self, extract::externalFile, meta::label, label); +} + +// Get, by label, non-const +Handle2ExternalFile +ExternalFilesExternalFileGetByLabel( + ConstHandle2ExternalFiles self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByLabel", + self, extract::externalFile, meta::label, label); +} + +// Set, by label +void +ExternalFilesExternalFileSetByLabel( + ConstHandle2ExternalFiles self, + const char *const label, + ConstHandle2ConstExternalFile externalFile +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileSetByLabel", + self, extract::externalFile, meta::label, label, externalFile); +} + +// ------------------------ +// Re: metadatum path +// ------------------------ + +// Has, by path +int +ExternalFilesExternalFileHasByPath( + ConstHandle2ConstExternalFiles self, + const char *const path +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileHasByPath", + self, extract::externalFile, meta::path, path); +} + +// Get, by path, const +Handle2ConstExternalFile +ExternalFilesExternalFileGetByPathConst( + ConstHandle2ConstExternalFiles self, + const char *const path +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByPathConst", + self, extract::externalFile, meta::path, path); +} + +// Get, by path, non-const +Handle2ExternalFile +ExternalFilesExternalFileGetByPath( + ConstHandle2ExternalFiles self, + const char *const path +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByPath", + self, extract::externalFile, meta::path, path); +} + +// Set, by path +void +ExternalFilesExternalFileSetByPath( + ConstHandle2ExternalFiles self, + const char *const path, + ConstHandle2ConstExternalFile externalFile +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileSetByPath", + self, extract::externalFile, meta::path, path, externalFile); +} + +// ------------------------ +// Re: metadatum checksum +// ------------------------ + +// Has, by checksum +int +ExternalFilesExternalFileHasByChecksum( + ConstHandle2ConstExternalFiles self, + const char *const checksum +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileHasByChecksum", + self, extract::externalFile, meta::checksum, checksum); +} + +// Get, by checksum, const +Handle2ConstExternalFile +ExternalFilesExternalFileGetByChecksumConst( + ConstHandle2ConstExternalFiles self, + const char *const checksum +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByChecksumConst", + self, extract::externalFile, meta::checksum, checksum); +} + +// Get, by checksum, non-const +Handle2ExternalFile +ExternalFilesExternalFileGetByChecksum( + ConstHandle2ExternalFiles self, + const char *const checksum +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByChecksum", + self, extract::externalFile, meta::checksum, checksum); +} + +// Set, by checksum +void +ExternalFilesExternalFileSetByChecksum( + ConstHandle2ExternalFiles self, + const char *const checksum, + ConstHandle2ConstExternalFile externalFile +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileSetByChecksum", + self, extract::externalFile, meta::checksum, checksum, externalFile); +} + +// ------------------------ +// Re: metadatum algorithm +// ------------------------ + +// Has, by algorithm +int +ExternalFilesExternalFileHasByAlgorithm( + ConstHandle2ConstExternalFiles self, + const char *const algorithm +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileHasByAlgorithm", + self, extract::externalFile, meta::algorithm, algorithm); +} + +// Get, by algorithm, const +Handle2ConstExternalFile +ExternalFilesExternalFileGetByAlgorithmConst( + ConstHandle2ConstExternalFiles self, + const char *const algorithm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByAlgorithmConst", + self, extract::externalFile, meta::algorithm, algorithm); +} + +// Get, by algorithm, non-const +Handle2ExternalFile +ExternalFilesExternalFileGetByAlgorithm( + ConstHandle2ExternalFiles self, + const char *const algorithm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileGetByAlgorithm", + self, extract::externalFile, meta::algorithm, algorithm); +} + +// Set, by algorithm +void +ExternalFilesExternalFileSetByAlgorithm( + ConstHandle2ExternalFiles self, + const char *const algorithm, + ConstHandle2ConstExternalFile externalFile +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ExternalFileSetByAlgorithm", + self, extract::externalFile, meta::algorithm, algorithm, externalFile); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ExternalFiles/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFiles.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFiles.h new file mode 100644 index 000000000..ba4cbc8e5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFiles.h @@ -0,0 +1,309 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ExternalFiles is the basic handle type in this file. Example: +// // Create a default ExternalFiles object: +// ExternalFiles handle = ExternalFilesDefault(); +// Functions involving ExternalFiles are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_EXTERNALFILES +#define C_INTERFACE_GNDS_V2_0_GENERAL_EXTERNALFILES + +#include "GNDStk.h" +#include "v2.0/general/ExternalFile.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ExternalFilesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ExternalFiles +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ExternalFilesClass *ExternalFiles; + +// --- Const-aware handles. +typedef const struct ExternalFilesClass *const ConstHandle2ConstExternalFiles; +typedef struct ExternalFilesClass *const ConstHandle2ExternalFiles; +typedef const struct ExternalFilesClass * Handle2ConstExternalFiles; +typedef struct ExternalFilesClass * Handle2ExternalFiles; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstExternalFiles +ExternalFilesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ExternalFiles +ExternalFilesDefault(); + +// --- Create, general, const +extern_c Handle2ConstExternalFiles +ExternalFilesCreateConst( + ConstHandle2ExternalFile *const externalFile, const size_t externalFileSize +); + +// +++ Create, general, non-const +extern_c Handle2ExternalFiles +ExternalFilesCreate( + ConstHandle2ExternalFile *const externalFile, const size_t externalFileSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ExternalFilesAssign(ConstHandle2ExternalFiles self, ConstHandle2ConstExternalFiles from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ExternalFilesDelete(ConstHandle2ConstExternalFiles self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ExternalFilesRead(ConstHandle2ExternalFiles self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ExternalFilesWrite(ConstHandle2ConstExternalFiles self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ExternalFilesPrint(ConstHandle2ConstExternalFiles self); + +// +++ Print to standard output, as XML +extern_c int +ExternalFilesPrintXML(ConstHandle2ConstExternalFiles self); + +// +++ Print to standard output, as JSON +extern_c int +ExternalFilesPrintJSON(ConstHandle2ConstExternalFiles self); + + +// ----------------------------------------------------------------------------- +// Child: externalFile +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ExternalFilesExternalFileHas(ConstHandle2ConstExternalFiles self); + +// +++ Clear +extern_c void +ExternalFilesExternalFileClear(ConstHandle2ExternalFiles self); + +// +++ Size +extern_c size_t +ExternalFilesExternalFileSize(ConstHandle2ConstExternalFiles self); + +// +++ Add +extern_c void +ExternalFilesExternalFileAdd(ConstHandle2ExternalFiles self, ConstHandle2ConstExternalFile externalFile); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstExternalFile +ExternalFilesExternalFileGetConst(ConstHandle2ConstExternalFiles self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ExternalFile +ExternalFilesExternalFileGet(ConstHandle2ExternalFiles self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ExternalFilesExternalFileSet( + ConstHandle2ExternalFiles self, + const size_t index_, + ConstHandle2ConstExternalFile externalFile +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ExternalFilesExternalFileHasByLabel( + ConstHandle2ConstExternalFiles self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstExternalFile +ExternalFilesExternalFileGetByLabelConst( + ConstHandle2ConstExternalFiles self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2ExternalFile +ExternalFilesExternalFileGetByLabel( + ConstHandle2ExternalFiles self, + const char *const label +); + +// +++ Set, by label +extern_c void +ExternalFilesExternalFileSetByLabel( + ConstHandle2ExternalFiles self, + const char *const label, + ConstHandle2ConstExternalFile externalFile +); + +// ------------------------ +// Re: metadatum path +// ------------------------ + +// +++ Has, by path +extern_c int +ExternalFilesExternalFileHasByPath( + ConstHandle2ConstExternalFiles self, + const char *const path +); + +// --- Get, by path, const +extern_c Handle2ConstExternalFile +ExternalFilesExternalFileGetByPathConst( + ConstHandle2ConstExternalFiles self, + const char *const path +); + +// +++ Get, by path, non-const +extern_c Handle2ExternalFile +ExternalFilesExternalFileGetByPath( + ConstHandle2ExternalFiles self, + const char *const path +); + +// +++ Set, by path +extern_c void +ExternalFilesExternalFileSetByPath( + ConstHandle2ExternalFiles self, + const char *const path, + ConstHandle2ConstExternalFile externalFile +); + +// ------------------------ +// Re: metadatum checksum +// ------------------------ + +// +++ Has, by checksum +extern_c int +ExternalFilesExternalFileHasByChecksum( + ConstHandle2ConstExternalFiles self, + const char *const checksum +); + +// --- Get, by checksum, const +extern_c Handle2ConstExternalFile +ExternalFilesExternalFileGetByChecksumConst( + ConstHandle2ConstExternalFiles self, + const char *const checksum +); + +// +++ Get, by checksum, non-const +extern_c Handle2ExternalFile +ExternalFilesExternalFileGetByChecksum( + ConstHandle2ExternalFiles self, + const char *const checksum +); + +// +++ Set, by checksum +extern_c void +ExternalFilesExternalFileSetByChecksum( + ConstHandle2ExternalFiles self, + const char *const checksum, + ConstHandle2ConstExternalFile externalFile +); + +// ------------------------ +// Re: metadatum algorithm +// ------------------------ + +// +++ Has, by algorithm +extern_c int +ExternalFilesExternalFileHasByAlgorithm( + ConstHandle2ConstExternalFiles self, + const char *const algorithm +); + +// --- Get, by algorithm, const +extern_c Handle2ConstExternalFile +ExternalFilesExternalFileGetByAlgorithmConst( + ConstHandle2ConstExternalFiles self, + const char *const algorithm +); + +// +++ Get, by algorithm, non-const +extern_c Handle2ExternalFile +ExternalFilesExternalFileGetByAlgorithm( + ConstHandle2ExternalFiles self, + const char *const algorithm +); + +// +++ Set, by algorithm +extern_c void +ExternalFilesExternalFileSetByAlgorithm( + ConstHandle2ExternalFiles self, + const char *const algorithm, + ConstHandle2ConstExternalFile externalFile +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ExternalFiles/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFiles/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFiles/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFiles/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ExternalFiles/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/F.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/F.cpp new file mode 100644 index 000000000..a8aaf94b3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/F.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/F.hpp" +#include "F.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = FClass; +using CPP = multigroup::F; + +static const std::string CLASSNAME = "F"; + +namespace extract { + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; +} + +using CPPXYs2d = general::XYs2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstF +FDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2F +FDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstF +FCreateConst( + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2F handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs2d) + ); + return handle; +} + +// Create, general, non-const +Handle2F +FCreate( + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2F handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs2d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +FAssign(ConstHandle2F self, ConstHandle2ConstF from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FDelete(ConstHandle2ConstF self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FRead(ConstHandle2F self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FWrite(ConstHandle2ConstF self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FPrint(ConstHandle2ConstF self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FPrintXML(ConstHandle2ConstF self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FPrintJSON(ConstHandle2ConstF self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +FXYs2dHas(ConstHandle2ConstF self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +FXYs2dGetConst(ConstHandle2ConstF self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +FXYs2dGet(ConstHandle2F self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +FXYs2dSet(ConstHandle2F self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/F/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/F.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/F.h new file mode 100644 index 000000000..5ac8641bf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/F.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// F is the basic handle type in this file. Example: +// // Create a default F object: +// F handle = FDefault(); +// Functions involving F are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_F +#define C_INTERFACE_GNDS_V2_0_GENERAL_F + +#include "GNDStk.h" +#include "v2.0/general/XYs2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ F +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FClass *F; + +// --- Const-aware handles. +typedef const struct FClass *const ConstHandle2ConstF; +typedef struct FClass *const ConstHandle2F; +typedef const struct FClass * Handle2ConstF; +typedef struct FClass * Handle2F; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstF +FDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2F +FDefault(); + +// --- Create, general, const +extern_c Handle2ConstF +FCreateConst( + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general, non-const +extern_c Handle2F +FCreate( + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +FAssign(ConstHandle2F self, ConstHandle2ConstF from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FDelete(ConstHandle2ConstF self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FRead(ConstHandle2F self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FWrite(ConstHandle2ConstF self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FPrint(ConstHandle2ConstF self); + +// +++ Print to standard output, as XML +extern_c int +FPrintXML(ConstHandle2ConstF self); + +// +++ Print to standard output, as JSON +extern_c int +FPrintJSON(ConstHandle2ConstF self); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FXYs2dHas(ConstHandle2ConstF self); + +// --- Get, const +extern_c Handle2ConstXYs2d +FXYs2dGetConst(ConstHandle2ConstF self); + +// +++ Get, non-const +extern_c Handle2XYs2d +FXYs2dGet(ConstHandle2F self); + +// +++ Set +extern_c void +FXYs2dSet(ConstHandle2F self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/F/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/F/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/F/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/F/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/F/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FastRegion.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FastRegion.cpp new file mode 100644 index 000000000..62aed4d4c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FastRegion.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/FastRegion.hpp" +#include "FastRegion.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = FastRegionClass; +using CPP = multigroup::FastRegion; + +static const std::string CLASSNAME = "FastRegion"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = general::XYs1d; +using CPPRegions1d = general::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFastRegion +FastRegionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2FastRegion +FastRegionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFastRegion +FastRegionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2FastRegion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general, non-const +Handle2FastRegion +FastRegionCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2FastRegion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +FastRegionAssign(ConstHandle2FastRegion self, ConstHandle2ConstFastRegion from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FastRegionDelete(ConstHandle2ConstFastRegion self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FastRegionRead(ConstHandle2FastRegion self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FastRegionWrite(ConstHandle2ConstFastRegion self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FastRegionPrint(ConstHandle2ConstFastRegion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FastRegionPrintXML(ConstHandle2ConstFastRegion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FastRegionPrintJSON(ConstHandle2ConstFastRegion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +FastRegionXYs1dHas(ConstHandle2ConstFastRegion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +FastRegionXYs1dGetConst(ConstHandle2ConstFastRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +FastRegionXYs1dGet(ConstHandle2FastRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +FastRegionXYs1dSet(ConstHandle2FastRegion self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +FastRegionRegions1dHas(ConstHandle2ConstFastRegion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +FastRegionRegions1dGetConst(ConstHandle2ConstFastRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +FastRegionRegions1dGet(ConstHandle2FastRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +FastRegionRegions1dSet(ConstHandle2FastRegion self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FastRegion/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FastRegion.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FastRegion.h new file mode 100644 index 000000000..1e649a661 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FastRegion.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// FastRegion is the basic handle type in this file. Example: +// // Create a default FastRegion object: +// FastRegion handle = FastRegionDefault(); +// Functions involving FastRegion are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_FASTREGION +#define C_INTERFACE_GNDS_V2_0_GENERAL_FASTREGION + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/Regions1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FastRegionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ FastRegion +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FastRegionClass *FastRegion; + +// --- Const-aware handles. +typedef const struct FastRegionClass *const ConstHandle2ConstFastRegion; +typedef struct FastRegionClass *const ConstHandle2FastRegion; +typedef const struct FastRegionClass * Handle2ConstFastRegion; +typedef struct FastRegionClass * Handle2FastRegion; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFastRegion +FastRegionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2FastRegion +FastRegionDefault(); + +// --- Create, general, const +extern_c Handle2ConstFastRegion +FastRegionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general, non-const +extern_c Handle2FastRegion +FastRegionCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +FastRegionAssign(ConstHandle2FastRegion self, ConstHandle2ConstFastRegion from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FastRegionDelete(ConstHandle2ConstFastRegion self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FastRegionRead(ConstHandle2FastRegion self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FastRegionWrite(ConstHandle2ConstFastRegion self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FastRegionPrint(ConstHandle2ConstFastRegion self); + +// +++ Print to standard output, as XML +extern_c int +FastRegionPrintXML(ConstHandle2ConstFastRegion self); + +// +++ Print to standard output, as JSON +extern_c int +FastRegionPrintJSON(ConstHandle2ConstFastRegion self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FastRegionXYs1dHas(ConstHandle2ConstFastRegion self); + +// --- Get, const +extern_c Handle2ConstXYs1d +FastRegionXYs1dGetConst(ConstHandle2ConstFastRegion self); + +// +++ Get, non-const +extern_c Handle2XYs1d +FastRegionXYs1dGet(ConstHandle2FastRegion self); + +// +++ Set +extern_c void +FastRegionXYs1dSet(ConstHandle2FastRegion self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FastRegionRegions1dHas(ConstHandle2ConstFastRegion self); + +// --- Get, const +extern_c Handle2ConstRegions1d +FastRegionRegions1dGetConst(ConstHandle2ConstFastRegion self); + +// +++ Get, non-const +extern_c Handle2Regions1d +FastRegionRegions1dGet(ConstHandle2FastRegion self); + +// +++ Set +extern_c void +FastRegionRegions1dSet(ConstHandle2FastRegion self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FastRegion/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FastRegion/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FastRegion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FastRegion/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FastRegion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponent.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponent.cpp new file mode 100644 index 000000000..1b1df3135 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponent.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/FissionComponent.hpp" +#include "FissionComponent.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = FissionComponentClass; +using CPP = multigroup::FissionComponent; + +static const std::string CLASSNAME = "FissionComponent"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto ENDF_MT = [](auto &obj) { return &obj.ENDF_MT; }; + static auto fissionGenre = [](auto &obj) { return &obj.fissionGenre; }; + static auto crossSection = [](auto &obj) { return &obj.crossSection; }; + static auto outputChannel = [](auto &obj) { return &obj.outputChannel; }; +} + +using CPPCrossSection = general::CrossSection; +using CPPOutputChannel = general::OutputChannel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFissionComponent +FissionComponentDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2FissionComponent +FissionComponentDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFissionComponent +FissionComponentCreateConst( + const char *const label, + const int ENDF_MT, + const char *const fissionGenre, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2FissionComponent handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + ENDF_MT, + fissionGenre, + detail::tocpp(crossSection), + detail::tocpp(outputChannel) + ); + return handle; +} + +// Create, general, non-const +Handle2FissionComponent +FissionComponentCreate( + const char *const label, + const int ENDF_MT, + const char *const fissionGenre, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2FissionComponent handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + ENDF_MT, + fissionGenre, + detail::tocpp(crossSection), + detail::tocpp(outputChannel) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +FissionComponentAssign(ConstHandle2FissionComponent self, ConstHandle2ConstFissionComponent from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FissionComponentDelete(ConstHandle2ConstFissionComponent self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FissionComponentRead(ConstHandle2FissionComponent self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FissionComponentWrite(ConstHandle2ConstFissionComponent self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FissionComponentPrint(ConstHandle2ConstFissionComponent self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FissionComponentPrintXML(ConstHandle2ConstFissionComponent self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FissionComponentPrintJSON(ConstHandle2ConstFissionComponent self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +FissionComponentLabelHas(ConstHandle2ConstFissionComponent self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +FissionComponentLabelGet(ConstHandle2ConstFissionComponent self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +FissionComponentLabelSet(ConstHandle2FissionComponent self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +FissionComponentENDFMTHas(ConstHandle2ConstFissionComponent self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +int +FissionComponentENDFMTGet(ConstHandle2ConstFissionComponent self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +FissionComponentENDFMTSet(ConstHandle2FissionComponent self, const int ENDF_MT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMTSet", self, extract::ENDF_MT, ENDF_MT); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: fissionGenre +// ----------------------------------------------------------------------------- + +// Has +int +FissionComponentFissionGenreHas(ConstHandle2ConstFissionComponent self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FissionGenreHas", self, extract::fissionGenre); +} + +// Get +// Returns by value +const char * +FissionComponentFissionGenreGet(ConstHandle2ConstFissionComponent self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionGenreGet", self, extract::fissionGenre); +} + +// Set +void +FissionComponentFissionGenreSet(ConstHandle2FissionComponent self, const char *const fissionGenre) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FissionGenreSet", self, extract::fissionGenre, fissionGenre); +} + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// Has +int +FissionComponentCrossSectionHas(ConstHandle2ConstFissionComponent self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossSectionHas", self, extract::crossSection); +} + +// Get, const +Handle2ConstCrossSection +FissionComponentCrossSectionGetConst(ConstHandle2ConstFissionComponent self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGetConst", self, extract::crossSection); +} + +// Get, non-const +Handle2CrossSection +FissionComponentCrossSectionGet(ConstHandle2FissionComponent self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGet", self, extract::crossSection); +} + +// Set +void +FissionComponentCrossSectionSet(ConstHandle2FissionComponent self, ConstHandle2ConstCrossSection crossSection) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CrossSectionSet", self, extract::crossSection, crossSection); +} + + +// ----------------------------------------------------------------------------- +// Child: outputChannel +// ----------------------------------------------------------------------------- + +// Has +int +FissionComponentOutputChannelHas(ConstHandle2ConstFissionComponent self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OutputChannelHas", self, extract::outputChannel); +} + +// Get, const +Handle2ConstOutputChannel +FissionComponentOutputChannelGetConst(ConstHandle2ConstFissionComponent self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputChannelGetConst", self, extract::outputChannel); +} + +// Get, non-const +Handle2OutputChannel +FissionComponentOutputChannelGet(ConstHandle2FissionComponent self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputChannelGet", self, extract::outputChannel); +} + +// Set +void +FissionComponentOutputChannelSet(ConstHandle2FissionComponent self, ConstHandle2ConstOutputChannel outputChannel) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OutputChannelSet", self, extract::outputChannel, outputChannel); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FissionComponent/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponent.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponent.h new file mode 100644 index 000000000..1e5edf18e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponent.h @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// FissionComponent is the basic handle type in this file. Example: +// // Create a default FissionComponent object: +// FissionComponent handle = FissionComponentDefault(); +// Functions involving FissionComponent are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_FISSIONCOMPONENT +#define C_INTERFACE_GNDS_V2_0_GENERAL_FISSIONCOMPONENT + +#include "GNDStk.h" +#include "v2.0/general/CrossSection.h" +#include "v2.0/general/OutputChannel.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FissionComponentClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ FissionComponent +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FissionComponentClass *FissionComponent; + +// --- Const-aware handles. +typedef const struct FissionComponentClass *const ConstHandle2ConstFissionComponent; +typedef struct FissionComponentClass *const ConstHandle2FissionComponent; +typedef const struct FissionComponentClass * Handle2ConstFissionComponent; +typedef struct FissionComponentClass * Handle2FissionComponent; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFissionComponent +FissionComponentDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2FissionComponent +FissionComponentDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionComponent +FissionComponentCreateConst( + const char *const label, + const int ENDF_MT, + const char *const fissionGenre, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +); + +// +++ Create, general, non-const +extern_c Handle2FissionComponent +FissionComponentCreate( + const char *const label, + const int ENDF_MT, + const char *const fissionGenre, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +FissionComponentAssign(ConstHandle2FissionComponent self, ConstHandle2ConstFissionComponent from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FissionComponentDelete(ConstHandle2ConstFissionComponent self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FissionComponentRead(ConstHandle2FissionComponent self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FissionComponentWrite(ConstHandle2ConstFissionComponent self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FissionComponentPrint(ConstHandle2ConstFissionComponent self); + +// +++ Print to standard output, as XML +extern_c int +FissionComponentPrintXML(ConstHandle2ConstFissionComponent self); + +// +++ Print to standard output, as JSON +extern_c int +FissionComponentPrintJSON(ConstHandle2ConstFissionComponent self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionComponentLabelHas(ConstHandle2ConstFissionComponent self); + +// +++ Get +// +++ Returns by value +extern_c const char * +FissionComponentLabelGet(ConstHandle2ConstFissionComponent self); + +// +++ Set +extern_c void +FissionComponentLabelSet(ConstHandle2FissionComponent self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionComponentENDFMTHas(ConstHandle2ConstFissionComponent self); + +// +++ Get +// +++ Returns by value +extern_c int +FissionComponentENDFMTGet(ConstHandle2ConstFissionComponent self); + +// +++ Set +extern_c void +FissionComponentENDFMTSet(ConstHandle2FissionComponent self, const int ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Metadatum: fissionGenre +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionComponentFissionGenreHas(ConstHandle2ConstFissionComponent self); + +// +++ Get +// +++ Returns by value +extern_c const char * +FissionComponentFissionGenreGet(ConstHandle2ConstFissionComponent self); + +// +++ Set +extern_c void +FissionComponentFissionGenreSet(ConstHandle2FissionComponent self, const char *const fissionGenre); + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionComponentCrossSectionHas(ConstHandle2ConstFissionComponent self); + +// --- Get, const +extern_c Handle2ConstCrossSection +FissionComponentCrossSectionGetConst(ConstHandle2ConstFissionComponent self); + +// +++ Get, non-const +extern_c Handle2CrossSection +FissionComponentCrossSectionGet(ConstHandle2FissionComponent self); + +// +++ Set +extern_c void +FissionComponentCrossSectionSet(ConstHandle2FissionComponent self, ConstHandle2ConstCrossSection crossSection); + + +// ----------------------------------------------------------------------------- +// Child: outputChannel +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionComponentOutputChannelHas(ConstHandle2ConstFissionComponent self); + +// --- Get, const +extern_c Handle2ConstOutputChannel +FissionComponentOutputChannelGetConst(ConstHandle2ConstFissionComponent self); + +// +++ Get, non-const +extern_c Handle2OutputChannel +FissionComponentOutputChannelGet(ConstHandle2FissionComponent self); + +// +++ Set +extern_c void +FissionComponentOutputChannelSet(ConstHandle2FissionComponent self, ConstHandle2ConstOutputChannel outputChannel); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FissionComponent/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponent/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponent/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponent/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponent/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponents.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponents.cpp new file mode 100644 index 000000000..8d03329b2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponents.cpp @@ -0,0 +1,359 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/FissionComponents.hpp" +#include "FissionComponents.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = FissionComponentsClass; +using CPP = multigroup::FissionComponents; + +static const std::string CLASSNAME = "FissionComponents"; + +namespace extract { + static auto fissionComponent = [](auto &obj) { return &obj.fissionComponent; }; +} + +using CPPFissionComponent = general::FissionComponent; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFissionComponents +FissionComponentsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2FissionComponents +FissionComponentsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFissionComponents +FissionComponentsCreateConst( + ConstHandle2FissionComponent *const fissionComponent, const size_t fissionComponentSize +) { + ConstHandle2FissionComponents handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t FissionComponentN = 0; FissionComponentN < fissionComponentSize; ++FissionComponentN) + FissionComponentsFissionComponentAdd(handle, fissionComponent[FissionComponentN]); + return handle; +} + +// Create, general, non-const +Handle2FissionComponents +FissionComponentsCreate( + ConstHandle2FissionComponent *const fissionComponent, const size_t fissionComponentSize +) { + ConstHandle2FissionComponents handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t FissionComponentN = 0; FissionComponentN < fissionComponentSize; ++FissionComponentN) + FissionComponentsFissionComponentAdd(handle, fissionComponent[FissionComponentN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +FissionComponentsAssign(ConstHandle2FissionComponents self, ConstHandle2ConstFissionComponents from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FissionComponentsDelete(ConstHandle2ConstFissionComponents self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FissionComponentsRead(ConstHandle2FissionComponents self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FissionComponentsWrite(ConstHandle2ConstFissionComponents self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FissionComponentsPrint(ConstHandle2ConstFissionComponents self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FissionComponentsPrintXML(ConstHandle2ConstFissionComponents self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FissionComponentsPrintJSON(ConstHandle2ConstFissionComponents self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: fissionComponent +// ----------------------------------------------------------------------------- + +// Has +int +FissionComponentsFissionComponentHas(ConstHandle2ConstFissionComponents self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FissionComponentHas", self, extract::fissionComponent); +} + +// Clear +void +FissionComponentsFissionComponentClear(ConstHandle2FissionComponents self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"FissionComponentClear", self, extract::fissionComponent); +} + +// Size +size_t +FissionComponentsFissionComponentSize(ConstHandle2ConstFissionComponents self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"FissionComponentSize", self, extract::fissionComponent); +} + +// Add +void +FissionComponentsFissionComponentAdd(ConstHandle2FissionComponents self, ConstHandle2ConstFissionComponent fissionComponent) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"FissionComponentAdd", self, extract::fissionComponent, fissionComponent); +} + +// Get, by index \in [0,size), const +Handle2ConstFissionComponent +FissionComponentsFissionComponentGetConst(ConstHandle2ConstFissionComponents self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"FissionComponentGetConst", self, extract::fissionComponent, index_); +} + +// Get, by index \in [0,size), non-const +Handle2FissionComponent +FissionComponentsFissionComponentGet(ConstHandle2FissionComponents self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"FissionComponentGet", self, extract::fissionComponent, index_); +} + +// Set, by index \in [0,size) +void +FissionComponentsFissionComponentSet( + ConstHandle2FissionComponents self, + const size_t index_, + ConstHandle2ConstFissionComponent fissionComponent +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"FissionComponentSet", self, extract::fissionComponent, index_, fissionComponent); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +FissionComponentsFissionComponentHasByLabel( + ConstHandle2ConstFissionComponents self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentHasByLabel", + self, extract::fissionComponent, meta::label, label); +} + +// Get, by label, const +Handle2ConstFissionComponent +FissionComponentsFissionComponentGetByLabelConst( + ConstHandle2ConstFissionComponents self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentGetByLabelConst", + self, extract::fissionComponent, meta::label, label); +} + +// Get, by label, non-const +Handle2FissionComponent +FissionComponentsFissionComponentGetByLabel( + ConstHandle2FissionComponents self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentGetByLabel", + self, extract::fissionComponent, meta::label, label); +} + +// Set, by label +void +FissionComponentsFissionComponentSetByLabel( + ConstHandle2FissionComponents self, + const char *const label, + ConstHandle2ConstFissionComponent fissionComponent +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentSetByLabel", + self, extract::fissionComponent, meta::label, label, fissionComponent); +} + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// Has, by ENDF_MT +int +FissionComponentsFissionComponentHasByENDFMT( + ConstHandle2ConstFissionComponents self, + const int ENDF_MT +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentHasByENDFMT", + self, extract::fissionComponent, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, const +Handle2ConstFissionComponent +FissionComponentsFissionComponentGetByENDFMTConst( + ConstHandle2ConstFissionComponents self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentGetByENDFMTConst", + self, extract::fissionComponent, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, non-const +Handle2FissionComponent +FissionComponentsFissionComponentGetByENDFMT( + ConstHandle2FissionComponents self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentGetByENDFMT", + self, extract::fissionComponent, meta::ENDF_MT, ENDF_MT); +} + +// Set, by ENDF_MT +void +FissionComponentsFissionComponentSetByENDFMT( + ConstHandle2FissionComponents self, + const int ENDF_MT, + ConstHandle2ConstFissionComponent fissionComponent +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentSetByENDFMT", + self, extract::fissionComponent, meta::ENDF_MT, ENDF_MT, fissionComponent); +} + +// ------------------------ +// Re: metadatum fissionGenre +// ------------------------ + +// Has, by fissionGenre +int +FissionComponentsFissionComponentHasByFissionGenre( + ConstHandle2ConstFissionComponents self, + const char *const fissionGenre +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentHasByFissionGenre", + self, extract::fissionComponent, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, const +Handle2ConstFissionComponent +FissionComponentsFissionComponentGetByFissionGenreConst( + ConstHandle2ConstFissionComponents self, + const char *const fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentGetByFissionGenreConst", + self, extract::fissionComponent, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, non-const +Handle2FissionComponent +FissionComponentsFissionComponentGetByFissionGenre( + ConstHandle2FissionComponents self, + const char *const fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentGetByFissionGenre", + self, extract::fissionComponent, meta::fissionGenre, fissionGenre); +} + +// Set, by fissionGenre +void +FissionComponentsFissionComponentSetByFissionGenre( + ConstHandle2FissionComponents self, + const char *const fissionGenre, + ConstHandle2ConstFissionComponent fissionComponent +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"FissionComponentSetByFissionGenre", + self, extract::fissionComponent, meta::fissionGenre, fissionGenre, fissionComponent); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FissionComponents/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponents.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponents.h new file mode 100644 index 000000000..f0cddff57 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponents.h @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// FissionComponents is the basic handle type in this file. Example: +// // Create a default FissionComponents object: +// FissionComponents handle = FissionComponentsDefault(); +// Functions involving FissionComponents are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_FISSIONCOMPONENTS +#define C_INTERFACE_GNDS_V2_0_GENERAL_FISSIONCOMPONENTS + +#include "GNDStk.h" +#include "v2.0/general/FissionComponent.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FissionComponentsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ FissionComponents +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FissionComponentsClass *FissionComponents; + +// --- Const-aware handles. +typedef const struct FissionComponentsClass *const ConstHandle2ConstFissionComponents; +typedef struct FissionComponentsClass *const ConstHandle2FissionComponents; +typedef const struct FissionComponentsClass * Handle2ConstFissionComponents; +typedef struct FissionComponentsClass * Handle2FissionComponents; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFissionComponents +FissionComponentsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2FissionComponents +FissionComponentsDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionComponents +FissionComponentsCreateConst( + ConstHandle2FissionComponent *const fissionComponent, const size_t fissionComponentSize +); + +// +++ Create, general, non-const +extern_c Handle2FissionComponents +FissionComponentsCreate( + ConstHandle2FissionComponent *const fissionComponent, const size_t fissionComponentSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +FissionComponentsAssign(ConstHandle2FissionComponents self, ConstHandle2ConstFissionComponents from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FissionComponentsDelete(ConstHandle2ConstFissionComponents self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FissionComponentsRead(ConstHandle2FissionComponents self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FissionComponentsWrite(ConstHandle2ConstFissionComponents self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FissionComponentsPrint(ConstHandle2ConstFissionComponents self); + +// +++ Print to standard output, as XML +extern_c int +FissionComponentsPrintXML(ConstHandle2ConstFissionComponents self); + +// +++ Print to standard output, as JSON +extern_c int +FissionComponentsPrintJSON(ConstHandle2ConstFissionComponents self); + + +// ----------------------------------------------------------------------------- +// Child: fissionComponent +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionComponentsFissionComponentHas(ConstHandle2ConstFissionComponents self); + +// +++ Clear +extern_c void +FissionComponentsFissionComponentClear(ConstHandle2FissionComponents self); + +// +++ Size +extern_c size_t +FissionComponentsFissionComponentSize(ConstHandle2ConstFissionComponents self); + +// +++ Add +extern_c void +FissionComponentsFissionComponentAdd(ConstHandle2FissionComponents self, ConstHandle2ConstFissionComponent fissionComponent); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstFissionComponent +FissionComponentsFissionComponentGetConst(ConstHandle2ConstFissionComponents self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2FissionComponent +FissionComponentsFissionComponentGet(ConstHandle2FissionComponents self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +FissionComponentsFissionComponentSet( + ConstHandle2FissionComponents self, + const size_t index_, + ConstHandle2ConstFissionComponent fissionComponent +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +FissionComponentsFissionComponentHasByLabel( + ConstHandle2ConstFissionComponents self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstFissionComponent +FissionComponentsFissionComponentGetByLabelConst( + ConstHandle2ConstFissionComponents self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2FissionComponent +FissionComponentsFissionComponentGetByLabel( + ConstHandle2FissionComponents self, + const char *const label +); + +// +++ Set, by label +extern_c void +FissionComponentsFissionComponentSetByLabel( + ConstHandle2FissionComponents self, + const char *const label, + ConstHandle2ConstFissionComponent fissionComponent +); + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// +++ Has, by ENDF_MT +extern_c int +FissionComponentsFissionComponentHasByENDFMT( + ConstHandle2ConstFissionComponents self, + const int ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstFissionComponent +FissionComponentsFissionComponentGetByENDFMTConst( + ConstHandle2ConstFissionComponents self, + const int ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2FissionComponent +FissionComponentsFissionComponentGetByENDFMT( + ConstHandle2FissionComponents self, + const int ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +FissionComponentsFissionComponentSetByENDFMT( + ConstHandle2FissionComponents self, + const int ENDF_MT, + ConstHandle2ConstFissionComponent fissionComponent +); + +// ------------------------ +// Re: metadatum fissionGenre +// ------------------------ + +// +++ Has, by fissionGenre +extern_c int +FissionComponentsFissionComponentHasByFissionGenre( + ConstHandle2ConstFissionComponents self, + const char *const fissionGenre +); + +// --- Get, by fissionGenre, const +extern_c Handle2ConstFissionComponent +FissionComponentsFissionComponentGetByFissionGenreConst( + ConstHandle2ConstFissionComponents self, + const char *const fissionGenre +); + +// +++ Get, by fissionGenre, non-const +extern_c Handle2FissionComponent +FissionComponentsFissionComponentGetByFissionGenre( + ConstHandle2FissionComponents self, + const char *const fissionGenre +); + +// +++ Set, by fissionGenre +extern_c void +FissionComponentsFissionComponentSetByFissionGenre( + ConstHandle2FissionComponents self, + const char *const fissionGenre, + ConstHandle2ConstFissionComponent fissionComponent +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FissionComponents/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponents/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponents/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponents/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionComponents/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyRelease.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyRelease.cpp new file mode 100644 index 000000000..de3e5baf3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyRelease.cpp @@ -0,0 +1,560 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/FissionEnergyRelease.hpp" +#include "FissionEnergyRelease.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = FissionEnergyReleaseClass; +using CPP = multigroup::FissionEnergyRelease; + +static const std::string CLASSNAME = "FissionEnergyRelease"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto promptProductKE = [](auto &obj) { return &obj.promptProductKE; }; + static auto promptNeutronKE = [](auto &obj) { return &obj.promptNeutronKE; }; + static auto delayedNeutronKE = [](auto &obj) { return &obj.delayedNeutronKE; }; + static auto promptGammaEnergy = [](auto &obj) { return &obj.promptGammaEnergy; }; + static auto delayedGammaEnergy = [](auto &obj) { return &obj.delayedGammaEnergy; }; + static auto delayedBetaEnergy = [](auto &obj) { return &obj.delayedBetaEnergy; }; + static auto neutrinoEnergy = [](auto &obj) { return &obj.neutrinoEnergy; }; + static auto nonNeutrinoEnergy = [](auto &obj) { return &obj.nonNeutrinoEnergy; }; + static auto totalEnergy = [](auto &obj) { return &obj.totalEnergy; }; +} + +using CPPPromptProductKE = general::PromptProductKE; +using CPPPromptNeutronKE = general::PromptNeutronKE; +using CPPDelayedNeutronKE = general::DelayedNeutronKE; +using CPPPromptGammaEnergy = general::PromptGammaEnergy; +using CPPDelayedGammaEnergy = general::DelayedGammaEnergy; +using CPPDelayedBetaEnergy = general::DelayedBetaEnergy; +using CPPNeutrinoEnergy = general::NeutrinoEnergy; +using CPPNonNeutrinoEnergy = general::NonNeutrinoEnergy; +using CPPTotalEnergy = general::TotalEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFissionEnergyRelease +FissionEnergyReleaseDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2FissionEnergyRelease +FissionEnergyReleaseDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFissionEnergyRelease +FissionEnergyReleaseCreateConst( + const char *const label, + ConstHandle2ConstPromptProductKE promptProductKE, + ConstHandle2ConstPromptNeutronKE promptNeutronKE, + ConstHandle2ConstDelayedNeutronKE delayedNeutronKE, + ConstHandle2ConstPromptGammaEnergy promptGammaEnergy, + ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy, + ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy, + ConstHandle2ConstNeutrinoEnergy neutrinoEnergy, + ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy, + ConstHandle2ConstTotalEnergy totalEnergy +) { + ConstHandle2FissionEnergyRelease handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(promptProductKE), + detail::tocpp(promptNeutronKE), + detail::tocpp(delayedNeutronKE), + detail::tocpp(promptGammaEnergy), + detail::tocpp(delayedGammaEnergy), + detail::tocpp(delayedBetaEnergy), + detail::tocpp(neutrinoEnergy), + detail::tocpp(nonNeutrinoEnergy), + detail::tocpp(totalEnergy) + ); + return handle; +} + +// Create, general, non-const +Handle2FissionEnergyRelease +FissionEnergyReleaseCreate( + const char *const label, + ConstHandle2ConstPromptProductKE promptProductKE, + ConstHandle2ConstPromptNeutronKE promptNeutronKE, + ConstHandle2ConstDelayedNeutronKE delayedNeutronKE, + ConstHandle2ConstPromptGammaEnergy promptGammaEnergy, + ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy, + ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy, + ConstHandle2ConstNeutrinoEnergy neutrinoEnergy, + ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy, + ConstHandle2ConstTotalEnergy totalEnergy +) { + ConstHandle2FissionEnergyRelease handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(promptProductKE), + detail::tocpp(promptNeutronKE), + detail::tocpp(delayedNeutronKE), + detail::tocpp(promptGammaEnergy), + detail::tocpp(delayedGammaEnergy), + detail::tocpp(delayedBetaEnergy), + detail::tocpp(neutrinoEnergy), + detail::tocpp(nonNeutrinoEnergy), + detail::tocpp(totalEnergy) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +FissionEnergyReleaseAssign(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstFissionEnergyRelease from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FissionEnergyReleaseDelete(ConstHandle2ConstFissionEnergyRelease self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FissionEnergyReleaseRead(ConstHandle2FissionEnergyRelease self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FissionEnergyReleaseWrite(ConstHandle2ConstFissionEnergyRelease self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FissionEnergyReleasePrint(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FissionEnergyReleasePrintXML(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FissionEnergyReleasePrintJSON(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleaseLabelHas(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +FissionEnergyReleaseLabelGet(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +FissionEnergyReleaseLabelSet(ConstHandle2FissionEnergyRelease self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: promptProductKE +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasePromptProductKEHas(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PromptProductKEHas", self, extract::promptProductKE); +} + +// Get, const +Handle2ConstPromptProductKE +FissionEnergyReleasePromptProductKEGetConst(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptProductKEGetConst", self, extract::promptProductKE); +} + +// Get, non-const +Handle2PromptProductKE +FissionEnergyReleasePromptProductKEGet(ConstHandle2FissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptProductKEGet", self, extract::promptProductKE); +} + +// Set +void +FissionEnergyReleasePromptProductKESet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstPromptProductKE promptProductKE) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PromptProductKESet", self, extract::promptProductKE, promptProductKE); +} + + +// ----------------------------------------------------------------------------- +// Child: promptNeutronKE +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasePromptNeutronKEHas(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PromptNeutronKEHas", self, extract::promptNeutronKE); +} + +// Get, const +Handle2ConstPromptNeutronKE +FissionEnergyReleasePromptNeutronKEGetConst(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptNeutronKEGetConst", self, extract::promptNeutronKE); +} + +// Get, non-const +Handle2PromptNeutronKE +FissionEnergyReleasePromptNeutronKEGet(ConstHandle2FissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptNeutronKEGet", self, extract::promptNeutronKE); +} + +// Set +void +FissionEnergyReleasePromptNeutronKESet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstPromptNeutronKE promptNeutronKE) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PromptNeutronKESet", self, extract::promptNeutronKE, promptNeutronKE); +} + + +// ----------------------------------------------------------------------------- +// Child: delayedNeutronKE +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleaseDelayedNeutronKEHas(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DelayedNeutronKEHas", self, extract::delayedNeutronKE); +} + +// Get, const +Handle2ConstDelayedNeutronKE +FissionEnergyReleaseDelayedNeutronKEGetConst(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedNeutronKEGetConst", self, extract::delayedNeutronKE); +} + +// Get, non-const +Handle2DelayedNeutronKE +FissionEnergyReleaseDelayedNeutronKEGet(ConstHandle2FissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedNeutronKEGet", self, extract::delayedNeutronKE); +} + +// Set +void +FissionEnergyReleaseDelayedNeutronKESet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstDelayedNeutronKE delayedNeutronKE) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DelayedNeutronKESet", self, extract::delayedNeutronKE, delayedNeutronKE); +} + + +// ----------------------------------------------------------------------------- +// Child: promptGammaEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasePromptGammaEnergyHas(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PromptGammaEnergyHas", self, extract::promptGammaEnergy); +} + +// Get, const +Handle2ConstPromptGammaEnergy +FissionEnergyReleasePromptGammaEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptGammaEnergyGetConst", self, extract::promptGammaEnergy); +} + +// Get, non-const +Handle2PromptGammaEnergy +FissionEnergyReleasePromptGammaEnergyGet(ConstHandle2FissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PromptGammaEnergyGet", self, extract::promptGammaEnergy); +} + +// Set +void +FissionEnergyReleasePromptGammaEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstPromptGammaEnergy promptGammaEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PromptGammaEnergySet", self, extract::promptGammaEnergy, promptGammaEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: delayedGammaEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleaseDelayedGammaEnergyHas(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DelayedGammaEnergyHas", self, extract::delayedGammaEnergy); +} + +// Get, const +Handle2ConstDelayedGammaEnergy +FissionEnergyReleaseDelayedGammaEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedGammaEnergyGetConst", self, extract::delayedGammaEnergy); +} + +// Get, non-const +Handle2DelayedGammaEnergy +FissionEnergyReleaseDelayedGammaEnergyGet(ConstHandle2FissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedGammaEnergyGet", self, extract::delayedGammaEnergy); +} + +// Set +void +FissionEnergyReleaseDelayedGammaEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DelayedGammaEnergySet", self, extract::delayedGammaEnergy, delayedGammaEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: delayedBetaEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleaseDelayedBetaEnergyHas(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DelayedBetaEnergyHas", self, extract::delayedBetaEnergy); +} + +// Get, const +Handle2ConstDelayedBetaEnergy +FissionEnergyReleaseDelayedBetaEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedBetaEnergyGetConst", self, extract::delayedBetaEnergy); +} + +// Get, non-const +Handle2DelayedBetaEnergy +FissionEnergyReleaseDelayedBetaEnergyGet(ConstHandle2FissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedBetaEnergyGet", self, extract::delayedBetaEnergy); +} + +// Set +void +FissionEnergyReleaseDelayedBetaEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DelayedBetaEnergySet", self, extract::delayedBetaEnergy, delayedBetaEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: neutrinoEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleaseNeutrinoEnergyHas(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NeutrinoEnergyHas", self, extract::neutrinoEnergy); +} + +// Get, const +Handle2ConstNeutrinoEnergy +FissionEnergyReleaseNeutrinoEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NeutrinoEnergyGetConst", self, extract::neutrinoEnergy); +} + +// Get, non-const +Handle2NeutrinoEnergy +FissionEnergyReleaseNeutrinoEnergyGet(ConstHandle2FissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NeutrinoEnergyGet", self, extract::neutrinoEnergy); +} + +// Set +void +FissionEnergyReleaseNeutrinoEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstNeutrinoEnergy neutrinoEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NeutrinoEnergySet", self, extract::neutrinoEnergy, neutrinoEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: nonNeutrinoEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleaseNonNeutrinoEnergyHas(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NonNeutrinoEnergyHas", self, extract::nonNeutrinoEnergy); +} + +// Get, const +Handle2ConstNonNeutrinoEnergy +FissionEnergyReleaseNonNeutrinoEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NonNeutrinoEnergyGetConst", self, extract::nonNeutrinoEnergy); +} + +// Get, non-const +Handle2NonNeutrinoEnergy +FissionEnergyReleaseNonNeutrinoEnergyGet(ConstHandle2FissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NonNeutrinoEnergyGet", self, extract::nonNeutrinoEnergy); +} + +// Set +void +FissionEnergyReleaseNonNeutrinoEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NonNeutrinoEnergySet", self, extract::nonNeutrinoEnergy, nonNeutrinoEnergy); +} + + +// ----------------------------------------------------------------------------- +// Child: totalEnergy +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleaseTotalEnergyHas(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TotalEnergyHas", self, extract::totalEnergy); +} + +// Get, const +Handle2ConstTotalEnergy +FissionEnergyReleaseTotalEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TotalEnergyGetConst", self, extract::totalEnergy); +} + +// Get, non-const +Handle2TotalEnergy +FissionEnergyReleaseTotalEnergyGet(ConstHandle2FissionEnergyRelease self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TotalEnergyGet", self, extract::totalEnergy); +} + +// Set +void +FissionEnergyReleaseTotalEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstTotalEnergy totalEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TotalEnergySet", self, extract::totalEnergy, totalEnergy); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FissionEnergyRelease/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyRelease.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyRelease.h new file mode 100644 index 000000000..4bda88e2f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyRelease.h @@ -0,0 +1,373 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// FissionEnergyRelease is the basic handle type in this file. Example: +// // Create a default FissionEnergyRelease object: +// FissionEnergyRelease handle = FissionEnergyReleaseDefault(); +// Functions involving FissionEnergyRelease are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_FISSIONENERGYRELEASE +#define C_INTERFACE_GNDS_V2_0_GENERAL_FISSIONENERGYRELEASE + +#include "GNDStk.h" +#include "v2.0/general/PromptProductKE.h" +#include "v2.0/general/PromptNeutronKE.h" +#include "v2.0/general/DelayedNeutronKE.h" +#include "v2.0/general/PromptGammaEnergy.h" +#include "v2.0/general/DelayedGammaEnergy.h" +#include "v2.0/general/DelayedBetaEnergy.h" +#include "v2.0/general/NeutrinoEnergy.h" +#include "v2.0/general/NonNeutrinoEnergy.h" +#include "v2.0/general/TotalEnergy.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FissionEnergyReleaseClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ FissionEnergyRelease +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FissionEnergyReleaseClass *FissionEnergyRelease; + +// --- Const-aware handles. +typedef const struct FissionEnergyReleaseClass *const ConstHandle2ConstFissionEnergyRelease; +typedef struct FissionEnergyReleaseClass *const ConstHandle2FissionEnergyRelease; +typedef const struct FissionEnergyReleaseClass * Handle2ConstFissionEnergyRelease; +typedef struct FissionEnergyReleaseClass * Handle2FissionEnergyRelease; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFissionEnergyRelease +FissionEnergyReleaseDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2FissionEnergyRelease +FissionEnergyReleaseDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionEnergyRelease +FissionEnergyReleaseCreateConst( + const char *const label, + ConstHandle2ConstPromptProductKE promptProductKE, + ConstHandle2ConstPromptNeutronKE promptNeutronKE, + ConstHandle2ConstDelayedNeutronKE delayedNeutronKE, + ConstHandle2ConstPromptGammaEnergy promptGammaEnergy, + ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy, + ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy, + ConstHandle2ConstNeutrinoEnergy neutrinoEnergy, + ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy, + ConstHandle2ConstTotalEnergy totalEnergy +); + +// +++ Create, general, non-const +extern_c Handle2FissionEnergyRelease +FissionEnergyReleaseCreate( + const char *const label, + ConstHandle2ConstPromptProductKE promptProductKE, + ConstHandle2ConstPromptNeutronKE promptNeutronKE, + ConstHandle2ConstDelayedNeutronKE delayedNeutronKE, + ConstHandle2ConstPromptGammaEnergy promptGammaEnergy, + ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy, + ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy, + ConstHandle2ConstNeutrinoEnergy neutrinoEnergy, + ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy, + ConstHandle2ConstTotalEnergy totalEnergy +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +FissionEnergyReleaseAssign(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstFissionEnergyRelease from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FissionEnergyReleaseDelete(ConstHandle2ConstFissionEnergyRelease self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FissionEnergyReleaseRead(ConstHandle2FissionEnergyRelease self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FissionEnergyReleaseWrite(ConstHandle2ConstFissionEnergyRelease self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FissionEnergyReleasePrint(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Print to standard output, as XML +extern_c int +FissionEnergyReleasePrintXML(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Print to standard output, as JSON +extern_c int +FissionEnergyReleasePrintJSON(ConstHandle2ConstFissionEnergyRelease self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleaseLabelHas(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Get +// +++ Returns by value +extern_c const char * +FissionEnergyReleaseLabelGet(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Set +extern_c void +FissionEnergyReleaseLabelSet(ConstHandle2FissionEnergyRelease self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Child: promptProductKE +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasePromptProductKEHas(ConstHandle2ConstFissionEnergyRelease self); + +// --- Get, const +extern_c Handle2ConstPromptProductKE +FissionEnergyReleasePromptProductKEGetConst(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Get, non-const +extern_c Handle2PromptProductKE +FissionEnergyReleasePromptProductKEGet(ConstHandle2FissionEnergyRelease self); + +// +++ Set +extern_c void +FissionEnergyReleasePromptProductKESet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstPromptProductKE promptProductKE); + + +// ----------------------------------------------------------------------------- +// Child: promptNeutronKE +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasePromptNeutronKEHas(ConstHandle2ConstFissionEnergyRelease self); + +// --- Get, const +extern_c Handle2ConstPromptNeutronKE +FissionEnergyReleasePromptNeutronKEGetConst(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Get, non-const +extern_c Handle2PromptNeutronKE +FissionEnergyReleasePromptNeutronKEGet(ConstHandle2FissionEnergyRelease self); + +// +++ Set +extern_c void +FissionEnergyReleasePromptNeutronKESet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstPromptNeutronKE promptNeutronKE); + + +// ----------------------------------------------------------------------------- +// Child: delayedNeutronKE +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleaseDelayedNeutronKEHas(ConstHandle2ConstFissionEnergyRelease self); + +// --- Get, const +extern_c Handle2ConstDelayedNeutronKE +FissionEnergyReleaseDelayedNeutronKEGetConst(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Get, non-const +extern_c Handle2DelayedNeutronKE +FissionEnergyReleaseDelayedNeutronKEGet(ConstHandle2FissionEnergyRelease self); + +// +++ Set +extern_c void +FissionEnergyReleaseDelayedNeutronKESet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstDelayedNeutronKE delayedNeutronKE); + + +// ----------------------------------------------------------------------------- +// Child: promptGammaEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasePromptGammaEnergyHas(ConstHandle2ConstFissionEnergyRelease self); + +// --- Get, const +extern_c Handle2ConstPromptGammaEnergy +FissionEnergyReleasePromptGammaEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Get, non-const +extern_c Handle2PromptGammaEnergy +FissionEnergyReleasePromptGammaEnergyGet(ConstHandle2FissionEnergyRelease self); + +// +++ Set +extern_c void +FissionEnergyReleasePromptGammaEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstPromptGammaEnergy promptGammaEnergy); + + +// ----------------------------------------------------------------------------- +// Child: delayedGammaEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleaseDelayedGammaEnergyHas(ConstHandle2ConstFissionEnergyRelease self); + +// --- Get, const +extern_c Handle2ConstDelayedGammaEnergy +FissionEnergyReleaseDelayedGammaEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Get, non-const +extern_c Handle2DelayedGammaEnergy +FissionEnergyReleaseDelayedGammaEnergyGet(ConstHandle2FissionEnergyRelease self); + +// +++ Set +extern_c void +FissionEnergyReleaseDelayedGammaEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstDelayedGammaEnergy delayedGammaEnergy); + + +// ----------------------------------------------------------------------------- +// Child: delayedBetaEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleaseDelayedBetaEnergyHas(ConstHandle2ConstFissionEnergyRelease self); + +// --- Get, const +extern_c Handle2ConstDelayedBetaEnergy +FissionEnergyReleaseDelayedBetaEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Get, non-const +extern_c Handle2DelayedBetaEnergy +FissionEnergyReleaseDelayedBetaEnergyGet(ConstHandle2FissionEnergyRelease self); + +// +++ Set +extern_c void +FissionEnergyReleaseDelayedBetaEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstDelayedBetaEnergy delayedBetaEnergy); + + +// ----------------------------------------------------------------------------- +// Child: neutrinoEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleaseNeutrinoEnergyHas(ConstHandle2ConstFissionEnergyRelease self); + +// --- Get, const +extern_c Handle2ConstNeutrinoEnergy +FissionEnergyReleaseNeutrinoEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Get, non-const +extern_c Handle2NeutrinoEnergy +FissionEnergyReleaseNeutrinoEnergyGet(ConstHandle2FissionEnergyRelease self); + +// +++ Set +extern_c void +FissionEnergyReleaseNeutrinoEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstNeutrinoEnergy neutrinoEnergy); + + +// ----------------------------------------------------------------------------- +// Child: nonNeutrinoEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleaseNonNeutrinoEnergyHas(ConstHandle2ConstFissionEnergyRelease self); + +// --- Get, const +extern_c Handle2ConstNonNeutrinoEnergy +FissionEnergyReleaseNonNeutrinoEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Get, non-const +extern_c Handle2NonNeutrinoEnergy +FissionEnergyReleaseNonNeutrinoEnergyGet(ConstHandle2FissionEnergyRelease self); + +// +++ Set +extern_c void +FissionEnergyReleaseNonNeutrinoEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstNonNeutrinoEnergy nonNeutrinoEnergy); + + +// ----------------------------------------------------------------------------- +// Child: totalEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleaseTotalEnergyHas(ConstHandle2ConstFissionEnergyRelease self); + +// --- Get, const +extern_c Handle2ConstTotalEnergy +FissionEnergyReleaseTotalEnergyGetConst(ConstHandle2ConstFissionEnergyRelease self); + +// +++ Get, non-const +extern_c Handle2TotalEnergy +FissionEnergyReleaseTotalEnergyGet(ConstHandle2FissionEnergyRelease self); + +// +++ Set +extern_c void +FissionEnergyReleaseTotalEnergySet(ConstHandle2FissionEnergyRelease self, ConstHandle2ConstTotalEnergy totalEnergy); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FissionEnergyRelease/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyRelease/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyRelease/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyRelease/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyRelease/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyReleases.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyReleases.cpp new file mode 100644 index 000000000..4631138e6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyReleases.cpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/FissionEnergyReleases.hpp" +#include "FissionEnergyReleases.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = FissionEnergyReleasesClass; +using CPP = multigroup::FissionEnergyReleases; + +static const std::string CLASSNAME = "FissionEnergyReleases"; + +namespace extract { + static auto fissionEnergyRelease = [](auto &obj) { return &obj.fissionEnergyRelease; }; +} + +using CPPFissionEnergyRelease = general::FissionEnergyRelease; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFissionEnergyReleases +FissionEnergyReleasesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2FissionEnergyReleases +FissionEnergyReleasesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFissionEnergyReleases +FissionEnergyReleasesCreateConst( + ConstHandle2FissionEnergyRelease *const fissionEnergyRelease, const size_t fissionEnergyReleaseSize +) { + ConstHandle2FissionEnergyReleases handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t FissionEnergyReleaseN = 0; FissionEnergyReleaseN < fissionEnergyReleaseSize; ++FissionEnergyReleaseN) + FissionEnergyReleasesFissionEnergyReleaseAdd(handle, fissionEnergyRelease[FissionEnergyReleaseN]); + return handle; +} + +// Create, general, non-const +Handle2FissionEnergyReleases +FissionEnergyReleasesCreate( + ConstHandle2FissionEnergyRelease *const fissionEnergyRelease, const size_t fissionEnergyReleaseSize +) { + ConstHandle2FissionEnergyReleases handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t FissionEnergyReleaseN = 0; FissionEnergyReleaseN < fissionEnergyReleaseSize; ++FissionEnergyReleaseN) + FissionEnergyReleasesFissionEnergyReleaseAdd(handle, fissionEnergyRelease[FissionEnergyReleaseN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +FissionEnergyReleasesAssign(ConstHandle2FissionEnergyReleases self, ConstHandle2ConstFissionEnergyReleases from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FissionEnergyReleasesDelete(ConstHandle2ConstFissionEnergyReleases self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FissionEnergyReleasesRead(ConstHandle2FissionEnergyReleases self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FissionEnergyReleasesWrite(ConstHandle2ConstFissionEnergyReleases self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FissionEnergyReleasesPrint(ConstHandle2ConstFissionEnergyReleases self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FissionEnergyReleasesPrintXML(ConstHandle2ConstFissionEnergyReleases self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FissionEnergyReleasesPrintJSON(ConstHandle2ConstFissionEnergyReleases self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: fissionEnergyRelease +// ----------------------------------------------------------------------------- + +// Has +int +FissionEnergyReleasesFissionEnergyReleaseHas(ConstHandle2ConstFissionEnergyReleases self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FissionEnergyReleaseHas", self, extract::fissionEnergyRelease); +} + +// Clear +void +FissionEnergyReleasesFissionEnergyReleaseClear(ConstHandle2FissionEnergyReleases self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"FissionEnergyReleaseClear", self, extract::fissionEnergyRelease); +} + +// Size +size_t +FissionEnergyReleasesFissionEnergyReleaseSize(ConstHandle2ConstFissionEnergyReleases self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"FissionEnergyReleaseSize", self, extract::fissionEnergyRelease); +} + +// Add +void +FissionEnergyReleasesFissionEnergyReleaseAdd(ConstHandle2FissionEnergyReleases self, ConstHandle2ConstFissionEnergyRelease fissionEnergyRelease) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"FissionEnergyReleaseAdd", self, extract::fissionEnergyRelease, fissionEnergyRelease); +} + +// Get, by index \in [0,size), const +Handle2ConstFissionEnergyRelease +FissionEnergyReleasesFissionEnergyReleaseGetConst(ConstHandle2ConstFissionEnergyReleases self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"FissionEnergyReleaseGetConst", self, extract::fissionEnergyRelease, index_); +} + +// Get, by index \in [0,size), non-const +Handle2FissionEnergyRelease +FissionEnergyReleasesFissionEnergyReleaseGet(ConstHandle2FissionEnergyReleases self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"FissionEnergyReleaseGet", self, extract::fissionEnergyRelease, index_); +} + +// Set, by index \in [0,size) +void +FissionEnergyReleasesFissionEnergyReleaseSet( + ConstHandle2FissionEnergyReleases self, + const size_t index_, + ConstHandle2ConstFissionEnergyRelease fissionEnergyRelease +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"FissionEnergyReleaseSet", self, extract::fissionEnergyRelease, index_, fissionEnergyRelease); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +FissionEnergyReleasesFissionEnergyReleaseHasByLabel( + ConstHandle2ConstFissionEnergyReleases self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"FissionEnergyReleaseHasByLabel", + self, extract::fissionEnergyRelease, meta::label, label); +} + +// Get, by label, const +Handle2ConstFissionEnergyRelease +FissionEnergyReleasesFissionEnergyReleaseGetByLabelConst( + ConstHandle2ConstFissionEnergyReleases self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionEnergyReleaseGetByLabelConst", + self, extract::fissionEnergyRelease, meta::label, label); +} + +// Get, by label, non-const +Handle2FissionEnergyRelease +FissionEnergyReleasesFissionEnergyReleaseGetByLabel( + ConstHandle2FissionEnergyReleases self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"FissionEnergyReleaseGetByLabel", + self, extract::fissionEnergyRelease, meta::label, label); +} + +// Set, by label +void +FissionEnergyReleasesFissionEnergyReleaseSetByLabel( + ConstHandle2FissionEnergyReleases self, + const char *const label, + ConstHandle2ConstFissionEnergyRelease fissionEnergyRelease +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"FissionEnergyReleaseSetByLabel", + self, extract::fissionEnergyRelease, meta::label, label, fissionEnergyRelease); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FissionEnergyReleases/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyReleases.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyReleases.h new file mode 100644 index 000000000..0db387c1b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyReleases.h @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// FissionEnergyReleases is the basic handle type in this file. Example: +// // Create a default FissionEnergyReleases object: +// FissionEnergyReleases handle = FissionEnergyReleasesDefault(); +// Functions involving FissionEnergyReleases are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_FISSIONENERGYRELEASES +#define C_INTERFACE_GNDS_V2_0_GENERAL_FISSIONENERGYRELEASES + +#include "GNDStk.h" +#include "v2.0/general/FissionEnergyRelease.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FissionEnergyReleasesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ FissionEnergyReleases +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FissionEnergyReleasesClass *FissionEnergyReleases; + +// --- Const-aware handles. +typedef const struct FissionEnergyReleasesClass *const ConstHandle2ConstFissionEnergyReleases; +typedef struct FissionEnergyReleasesClass *const ConstHandle2FissionEnergyReleases; +typedef const struct FissionEnergyReleasesClass * Handle2ConstFissionEnergyReleases; +typedef struct FissionEnergyReleasesClass * Handle2FissionEnergyReleases; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFissionEnergyReleases +FissionEnergyReleasesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2FissionEnergyReleases +FissionEnergyReleasesDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionEnergyReleases +FissionEnergyReleasesCreateConst( + ConstHandle2FissionEnergyRelease *const fissionEnergyRelease, const size_t fissionEnergyReleaseSize +); + +// +++ Create, general, non-const +extern_c Handle2FissionEnergyReleases +FissionEnergyReleasesCreate( + ConstHandle2FissionEnergyRelease *const fissionEnergyRelease, const size_t fissionEnergyReleaseSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +FissionEnergyReleasesAssign(ConstHandle2FissionEnergyReleases self, ConstHandle2ConstFissionEnergyReleases from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FissionEnergyReleasesDelete(ConstHandle2ConstFissionEnergyReleases self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FissionEnergyReleasesRead(ConstHandle2FissionEnergyReleases self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FissionEnergyReleasesWrite(ConstHandle2ConstFissionEnergyReleases self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FissionEnergyReleasesPrint(ConstHandle2ConstFissionEnergyReleases self); + +// +++ Print to standard output, as XML +extern_c int +FissionEnergyReleasesPrintXML(ConstHandle2ConstFissionEnergyReleases self); + +// +++ Print to standard output, as JSON +extern_c int +FissionEnergyReleasesPrintJSON(ConstHandle2ConstFissionEnergyReleases self); + + +// ----------------------------------------------------------------------------- +// Child: fissionEnergyRelease +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionEnergyReleasesFissionEnergyReleaseHas(ConstHandle2ConstFissionEnergyReleases self); + +// +++ Clear +extern_c void +FissionEnergyReleasesFissionEnergyReleaseClear(ConstHandle2FissionEnergyReleases self); + +// +++ Size +extern_c size_t +FissionEnergyReleasesFissionEnergyReleaseSize(ConstHandle2ConstFissionEnergyReleases self); + +// +++ Add +extern_c void +FissionEnergyReleasesFissionEnergyReleaseAdd(ConstHandle2FissionEnergyReleases self, ConstHandle2ConstFissionEnergyRelease fissionEnergyRelease); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstFissionEnergyRelease +FissionEnergyReleasesFissionEnergyReleaseGetConst(ConstHandle2ConstFissionEnergyReleases self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2FissionEnergyRelease +FissionEnergyReleasesFissionEnergyReleaseGet(ConstHandle2FissionEnergyReleases self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +FissionEnergyReleasesFissionEnergyReleaseSet( + ConstHandle2FissionEnergyReleases self, + const size_t index_, + ConstHandle2ConstFissionEnergyRelease fissionEnergyRelease +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +FissionEnergyReleasesFissionEnergyReleaseHasByLabel( + ConstHandle2ConstFissionEnergyReleases self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstFissionEnergyRelease +FissionEnergyReleasesFissionEnergyReleaseGetByLabelConst( + ConstHandle2ConstFissionEnergyReleases self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2FissionEnergyRelease +FissionEnergyReleasesFissionEnergyReleaseGetByLabel( + ConstHandle2FissionEnergyReleases self, + const char *const label +); + +// +++ Set, by label +extern_c void +FissionEnergyReleasesFissionEnergyReleaseSetByLabel( + ConstHandle2FissionEnergyReleases self, + const char *const label, + ConstHandle2ConstFissionEnergyRelease fissionEnergyRelease +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FissionEnergyReleases/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyReleases/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyReleases/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyReleases/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FissionEnergyReleases/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FormFactor.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FormFactor.cpp new file mode 100644 index 000000000..05b22fed7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FormFactor.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/FormFactor.hpp" +#include "FormFactor.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = FormFactorClass; +using CPP = multigroup::FormFactor; + +static const std::string CLASSNAME = "FormFactor"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFormFactor +FormFactorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2FormFactor +FormFactorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFormFactor +FormFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2FormFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2FormFactor +FormFactorCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2FormFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +FormFactorAssign(ConstHandle2FormFactor self, ConstHandle2ConstFormFactor from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FormFactorDelete(ConstHandle2ConstFormFactor self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FormFactorRead(ConstHandle2FormFactor self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FormFactorWrite(ConstHandle2ConstFormFactor self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FormFactorPrint(ConstHandle2ConstFormFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FormFactorPrintXML(ConstHandle2ConstFormFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FormFactorPrintJSON(ConstHandle2ConstFormFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +FormFactorXYs1dHas(ConstHandle2ConstFormFactor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +FormFactorXYs1dGetConst(ConstHandle2ConstFormFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +FormFactorXYs1dGet(ConstHandle2FormFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +FormFactorXYs1dSet(ConstHandle2FormFactor self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FormFactor/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FormFactor.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FormFactor.h new file mode 100644 index 000000000..8fa4afff4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FormFactor.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// FormFactor is the basic handle type in this file. Example: +// // Create a default FormFactor object: +// FormFactor handle = FormFactorDefault(); +// Functions involving FormFactor are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_FORMFACTOR +#define C_INTERFACE_GNDS_V2_0_GENERAL_FORMFACTOR + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FormFactorClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ FormFactor +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FormFactorClass *FormFactor; + +// --- Const-aware handles. +typedef const struct FormFactorClass *const ConstHandle2ConstFormFactor; +typedef struct FormFactorClass *const ConstHandle2FormFactor; +typedef const struct FormFactorClass * Handle2ConstFormFactor; +typedef struct FormFactorClass * Handle2FormFactor; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFormFactor +FormFactorDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2FormFactor +FormFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstFormFactor +FormFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2FormFactor +FormFactorCreate( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +FormFactorAssign(ConstHandle2FormFactor self, ConstHandle2ConstFormFactor from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FormFactorDelete(ConstHandle2ConstFormFactor self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FormFactorRead(ConstHandle2FormFactor self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FormFactorWrite(ConstHandle2ConstFormFactor self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FormFactorPrint(ConstHandle2ConstFormFactor self); + +// +++ Print to standard output, as XML +extern_c int +FormFactorPrintXML(ConstHandle2ConstFormFactor self); + +// +++ Print to standard output, as JSON +extern_c int +FormFactorPrintJSON(ConstHandle2ConstFormFactor self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FormFactorXYs1dHas(ConstHandle2ConstFormFactor self); + +// --- Get, const +extern_c Handle2ConstXYs1d +FormFactorXYs1dGetConst(ConstHandle2ConstFormFactor self); + +// +++ Get, non-const +extern_c Handle2XYs1d +FormFactorXYs1dGet(ConstHandle2FormFactor self); + +// +++ Set +extern_c void +FormFactorXYs1dSet(ConstHandle2FormFactor self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FormFactor/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FormFactor/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FormFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FormFactor/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FormFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Fraction.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Fraction.cpp new file mode 100644 index 000000000..fa97e60b9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Fraction.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Fraction.hpp" +#include "Fraction.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = FractionClass; +using CPP = multigroup::Fraction; + +static const std::string CLASSNAME = "Fraction"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFraction +FractionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Fraction +FractionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFraction +FractionCreateConst( + const char *const label, + const char *const value, + const char *const unit +) { + ConstHandle2Fraction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2Fraction +FractionCreate( + const char *const label, + const char *const value, + const char *const unit +) { + ConstHandle2Fraction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +FractionAssign(ConstHandle2Fraction self, ConstHandle2ConstFraction from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FractionDelete(ConstHandle2ConstFraction self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FractionRead(ConstHandle2Fraction self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FractionWrite(ConstHandle2ConstFraction self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FractionPrint(ConstHandle2ConstFraction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FractionPrintXML(ConstHandle2ConstFraction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FractionPrintJSON(ConstHandle2ConstFraction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +FractionLabelHas(ConstHandle2ConstFraction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +FractionLabelGet(ConstHandle2ConstFraction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +FractionLabelSet(ConstHandle2Fraction self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +FractionValueHas(ConstHandle2ConstFraction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +const char * +FractionValueGet(ConstHandle2ConstFraction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +FractionValueSet(ConstHandle2Fraction self, const char *const value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +FractionUnitHas(ConstHandle2ConstFraction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +FractionUnitGet(ConstHandle2ConstFraction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +FractionUnitSet(ConstHandle2Fraction self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Fraction/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Fraction.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Fraction.h new file mode 100644 index 000000000..12b1df86f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Fraction.h @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Fraction is the basic handle type in this file. Example: +// // Create a default Fraction object: +// Fraction handle = FractionDefault(); +// Functions involving Fraction are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_FRACTION +#define C_INTERFACE_GNDS_V2_0_GENERAL_FRACTION + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FractionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Fraction +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FractionClass *Fraction; + +// --- Const-aware handles. +typedef const struct FractionClass *const ConstHandle2ConstFraction; +typedef struct FractionClass *const ConstHandle2Fraction; +typedef const struct FractionClass * Handle2ConstFraction; +typedef struct FractionClass * Handle2Fraction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFraction +FractionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Fraction +FractionDefault(); + +// --- Create, general, const +extern_c Handle2ConstFraction +FractionCreateConst( + const char *const label, + const char *const value, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2Fraction +FractionCreate( + const char *const label, + const char *const value, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +FractionAssign(ConstHandle2Fraction self, ConstHandle2ConstFraction from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FractionDelete(ConstHandle2ConstFraction self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FractionRead(ConstHandle2Fraction self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FractionWrite(ConstHandle2ConstFraction self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FractionPrint(ConstHandle2ConstFraction self); + +// +++ Print to standard output, as XML +extern_c int +FractionPrintXML(ConstHandle2ConstFraction self); + +// +++ Print to standard output, as JSON +extern_c int +FractionPrintJSON(ConstHandle2ConstFraction self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FractionLabelHas(ConstHandle2ConstFraction self); + +// +++ Get +// +++ Returns by value +extern_c const char * +FractionLabelGet(ConstHandle2ConstFraction self); + +// +++ Set +extern_c void +FractionLabelSet(ConstHandle2Fraction self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FractionValueHas(ConstHandle2ConstFraction self); + +// +++ Get +// +++ Returns by value +extern_c const char * +FractionValueGet(ConstHandle2ConstFraction self); + +// +++ Set +extern_c void +FractionValueSet(ConstHandle2Fraction self, const char *const value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FractionUnitHas(ConstHandle2ConstFraction self); + +// +++ Get +// +++ Returns by value +extern_c const char * +FractionUnitGet(ConstHandle2ConstFraction self); + +// +++ Set +extern_c void +FractionUnitSet(ConstHandle2Fraction self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Fraction/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Fraction/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Fraction/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Fraction/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Fraction/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FreeGasApproximation.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FreeGasApproximation.cpp new file mode 100644 index 000000000..45d1b948e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FreeGasApproximation.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/FreeGasApproximation.hpp" +#include "FreeGasApproximation.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = FreeGasApproximationClass; +using CPP = multigroup::FreeGasApproximation; + +static const std::string CLASSNAME = "FreeGasApproximation"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFreeGasApproximation +FreeGasApproximationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2FreeGasApproximation +FreeGasApproximationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFreeGasApproximation +FreeGasApproximationCreateConst() +{ + ConstHandle2FreeGasApproximation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general, non-const +Handle2FreeGasApproximation +FreeGasApproximationCreate() +{ + ConstHandle2FreeGasApproximation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create" + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +FreeGasApproximationAssign(ConstHandle2FreeGasApproximation self, ConstHandle2ConstFreeGasApproximation from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FreeGasApproximationDelete(ConstHandle2ConstFreeGasApproximation self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FreeGasApproximationRead(ConstHandle2FreeGasApproximation self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FreeGasApproximationWrite(ConstHandle2ConstFreeGasApproximation self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FreeGasApproximationPrint(ConstHandle2ConstFreeGasApproximation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FreeGasApproximationPrintXML(ConstHandle2ConstFreeGasApproximation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FreeGasApproximationPrintJSON(ConstHandle2ConstFreeGasApproximation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FreeGasApproximation/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FreeGasApproximation.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FreeGasApproximation.h new file mode 100644 index 000000000..cfe812bfc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FreeGasApproximation.h @@ -0,0 +1,135 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// FreeGasApproximation is the basic handle type in this file. Example: +// // Create a default FreeGasApproximation object: +// FreeGasApproximation handle = FreeGasApproximationDefault(); +// Functions involving FreeGasApproximation are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_FREEGASAPPROXIMATION +#define C_INTERFACE_GNDS_V2_0_GENERAL_FREEGASAPPROXIMATION + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FreeGasApproximationClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ FreeGasApproximation +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FreeGasApproximationClass *FreeGasApproximation; + +// --- Const-aware handles. +typedef const struct FreeGasApproximationClass *const ConstHandle2ConstFreeGasApproximation; +typedef struct FreeGasApproximationClass *const ConstHandle2FreeGasApproximation; +typedef const struct FreeGasApproximationClass * Handle2ConstFreeGasApproximation; +typedef struct FreeGasApproximationClass * Handle2FreeGasApproximation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFreeGasApproximation +FreeGasApproximationDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2FreeGasApproximation +FreeGasApproximationDefault(); + +// --- Create, general, const +extern_c Handle2ConstFreeGasApproximation +FreeGasApproximationCreateConst(); + +// +++ Create, general, non-const +extern_c Handle2FreeGasApproximation +FreeGasApproximationCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +FreeGasApproximationAssign(ConstHandle2FreeGasApproximation self, ConstHandle2ConstFreeGasApproximation from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FreeGasApproximationDelete(ConstHandle2ConstFreeGasApproximation self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FreeGasApproximationRead(ConstHandle2FreeGasApproximation self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FreeGasApproximationWrite(ConstHandle2ConstFreeGasApproximation self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FreeGasApproximationPrint(ConstHandle2ConstFreeGasApproximation self); + +// +++ Print to standard output, as XML +extern_c int +FreeGasApproximationPrintXML(ConstHandle2ConstFreeGasApproximation self); + +// +++ Print to standard output, as JSON +extern_c int +FreeGasApproximationPrintJSON(ConstHandle2ConstFreeGasApproximation self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/FreeGasApproximation/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FreeGasApproximation/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FreeGasApproximation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FreeGasApproximation/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/FreeGasApproximation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function1ds.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function1ds.cpp new file mode 100644 index 000000000..23ea6c933 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function1ds.cpp @@ -0,0 +1,703 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Function1ds.hpp" +#include "Function1ds.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Function1dsClass; +using CPP = multigroup::Function1ds; + +static const std::string CLASSNAME = "Function1ds"; + +namespace extract { + static auto Legendre = [](auto &obj) { return &obj.Legendre; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPLegendre = general::Legendre; +using CPPXYs1d = general::XYs1d; +using CPPRegions1d = general::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFunction1ds +Function1dsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Function1ds +Function1dsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFunction1ds +Function1dsCreateConst( + ConstHandle2Legendre *const Legendre, const size_t LegendreSize, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize, + ConstHandle2Regions1d *const regions1d, const size_t regions1dSize +) { + ConstHandle2Function1ds handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{}, + std::vector{}, + std::vector{} + ); + for (size_t LegendreN = 0; LegendreN < LegendreSize; ++LegendreN) + Function1dsLegendreAdd(handle, Legendre[LegendreN]); + for (size_t XYs1dN = 0; XYs1dN < XYs1dSize; ++XYs1dN) + Function1dsXYs1dAdd(handle, XYs1d[XYs1dN]); + for (size_t Regions1dN = 0; Regions1dN < regions1dSize; ++Regions1dN) + Function1dsRegions1dAdd(handle, regions1d[Regions1dN]); + return handle; +} + +// Create, general, non-const +Handle2Function1ds +Function1dsCreate( + ConstHandle2Legendre *const Legendre, const size_t LegendreSize, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize, + ConstHandle2Regions1d *const regions1d, const size_t regions1dSize +) { + ConstHandle2Function1ds handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{}, + std::vector{}, + std::vector{} + ); + for (size_t LegendreN = 0; LegendreN < LegendreSize; ++LegendreN) + Function1dsLegendreAdd(handle, Legendre[LegendreN]); + for (size_t XYs1dN = 0; XYs1dN < XYs1dSize; ++XYs1dN) + Function1dsXYs1dAdd(handle, XYs1d[XYs1dN]); + for (size_t Regions1dN = 0; Regions1dN < regions1dSize; ++Regions1dN) + Function1dsRegions1dAdd(handle, regions1d[Regions1dN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Function1dsAssign(ConstHandle2Function1ds self, ConstHandle2ConstFunction1ds from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Function1dsDelete(ConstHandle2ConstFunction1ds self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Function1dsRead(ConstHandle2Function1ds self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Function1dsWrite(ConstHandle2ConstFunction1ds self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Function1dsPrint(ConstHandle2ConstFunction1ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Function1dsPrintXML(ConstHandle2ConstFunction1ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Function1dsPrintJSON(ConstHandle2ConstFunction1ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: Legendre +// ----------------------------------------------------------------------------- + +// Has +int +Function1dsLegendreHas(ConstHandle2ConstFunction1ds self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LegendreHas", self, extract::Legendre); +} + +// Clear +void +Function1dsLegendreClear(ConstHandle2Function1ds self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"LegendreClear", self, extract::Legendre); +} + +// Size +size_t +Function1dsLegendreSize(ConstHandle2ConstFunction1ds self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"LegendreSize", self, extract::Legendre); +} + +// Add +void +Function1dsLegendreAdd(ConstHandle2Function1ds self, ConstHandle2ConstLegendre Legendre) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"LegendreAdd", self, extract::Legendre, Legendre); +} + +// Get, by index \in [0,size), const +Handle2ConstLegendre +Function1dsLegendreGetConst(ConstHandle2ConstFunction1ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"LegendreGetConst", self, extract::Legendre, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Legendre +Function1dsLegendreGet(ConstHandle2Function1ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"LegendreGet", self, extract::Legendre, index_); +} + +// Set, by index \in [0,size) +void +Function1dsLegendreSet( + ConstHandle2Function1ds self, + const size_t index_, + ConstHandle2ConstLegendre Legendre +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"LegendreSet", self, extract::Legendre, index_, Legendre); +} + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// Has, by outerDomainValue +int +Function1dsLegendreHasByOuterDomainValue( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"LegendreHasByOuterDomainValue", + self, extract::Legendre, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, const +Handle2ConstLegendre +Function1dsLegendreGetByOuterDomainValueConst( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LegendreGetByOuterDomainValueConst", + self, extract::Legendre, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, non-const +Handle2Legendre +Function1dsLegendreGetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LegendreGetByOuterDomainValue", + self, extract::Legendre, meta::outerDomainValue, outerDomainValue); +} + +// Set, by outerDomainValue +void +Function1dsLegendreSetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue, + ConstHandle2ConstLegendre Legendre +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"LegendreSetByOuterDomainValue", + self, extract::Legendre, meta::outerDomainValue, outerDomainValue, Legendre); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +Function1dsXYs1dHas(ConstHandle2ConstFunction1ds self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Clear +void +Function1dsXYs1dClear(ConstHandle2Function1ds self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"XYs1dClear", self, extract::XYs1d); +} + +// Size +size_t +Function1dsXYs1dSize(ConstHandle2ConstFunction1ds self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"XYs1dSize", self, extract::XYs1d); +} + +// Add +void +Function1dsXYs1dAdd(ConstHandle2Function1ds self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"XYs1dAdd", self, extract::XYs1d, XYs1d); +} + +// Get, by index \in [0,size), const +Handle2ConstXYs1d +Function1dsXYs1dGetConst(ConstHandle2ConstFunction1ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d, index_); +} + +// Get, by index \in [0,size), non-const +Handle2XYs1d +Function1dsXYs1dGet(ConstHandle2Function1ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d, index_); +} + +// Set, by index \in [0,size) +void +Function1dsXYs1dSet( + ConstHandle2Function1ds self, + const size_t index_, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, index_, XYs1d); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +Function1dsXYs1dHasByLabel( + ConstHandle2ConstFunction1ds self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByLabel", + self, extract::XYs1d, meta::label, label); +} + +// Get, by label, const +Handle2ConstXYs1d +Function1dsXYs1dGetByLabelConst( + ConstHandle2ConstFunction1ds self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByLabelConst", + self, extract::XYs1d, meta::label, label); +} + +// Get, by label, non-const +Handle2XYs1d +Function1dsXYs1dGetByLabel( + ConstHandle2Function1ds self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByLabel", + self, extract::XYs1d, meta::label, label); +} + +// Set, by label +void +Function1dsXYs1dSetByLabel( + ConstHandle2Function1ds self, + const char *const label, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByLabel", + self, extract::XYs1d, meta::label, label, XYs1d); +} + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// Has, by index +int +Function1dsXYs1dHasByIndex( + ConstHandle2ConstFunction1ds self, + const int index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByIndex", + self, extract::XYs1d, meta::index, index); +} + +// Get, by index, const +Handle2ConstXYs1d +Function1dsXYs1dGetByIndexConst( + ConstHandle2ConstFunction1ds self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByIndexConst", + self, extract::XYs1d, meta::index, index); +} + +// Get, by index, non-const +Handle2XYs1d +Function1dsXYs1dGetByIndex( + ConstHandle2Function1ds self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByIndex", + self, extract::XYs1d, meta::index, index); +} + +// Set, by index +void +Function1dsXYs1dSetByIndex( + ConstHandle2Function1ds self, + const int index, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByIndex", + self, extract::XYs1d, meta::index, index, XYs1d); +} + +// ------------------------ +// Re: metadatum interpolation +// ------------------------ + +// Has, by interpolation +int +Function1dsXYs1dHasByInterpolation( + ConstHandle2ConstFunction1ds self, + const char *const interpolation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByInterpolation", + self, extract::XYs1d, meta::interpolation, interpolation); +} + +// Get, by interpolation, const +Handle2ConstXYs1d +Function1dsXYs1dGetByInterpolationConst( + ConstHandle2ConstFunction1ds self, + const char *const interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByInterpolationConst", + self, extract::XYs1d, meta::interpolation, interpolation); +} + +// Get, by interpolation, non-const +Handle2XYs1d +Function1dsXYs1dGetByInterpolation( + ConstHandle2Function1ds self, + const char *const interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByInterpolation", + self, extract::XYs1d, meta::interpolation, interpolation); +} + +// Set, by interpolation +void +Function1dsXYs1dSetByInterpolation( + ConstHandle2Function1ds self, + const char *const interpolation, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByInterpolation", + self, extract::XYs1d, meta::interpolation, interpolation, XYs1d); +} + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// Has, by outerDomainValue +int +Function1dsXYs1dHasByOuterDomainValue( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByOuterDomainValue", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, const +Handle2ConstXYs1d +Function1dsXYs1dGetByOuterDomainValueConst( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByOuterDomainValueConst", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, non-const +Handle2XYs1d +Function1dsXYs1dGetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByOuterDomainValue", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue); +} + +// Set, by outerDomainValue +void +Function1dsXYs1dSetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByOuterDomainValue", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +Function1dsRegions1dHas(ConstHandle2ConstFunction1ds self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Clear +void +Function1dsRegions1dClear(ConstHandle2Function1ds self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"Regions1dClear", self, extract::regions1d); +} + +// Size +size_t +Function1dsRegions1dSize(ConstHandle2ConstFunction1ds self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"Regions1dSize", self, extract::regions1d); +} + +// Add +void +Function1dsRegions1dAdd(ConstHandle2Function1ds self, ConstHandle2ConstRegions1d regions1d) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"Regions1dAdd", self, extract::regions1d, regions1d); +} + +// Get, by index \in [0,size), const +Handle2ConstRegions1d +Function1dsRegions1dGetConst(ConstHandle2ConstFunction1ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Regions1d +Function1dsRegions1dGet(ConstHandle2Function1ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d, index_); +} + +// Set, by index \in [0,size) +void +Function1dsRegions1dSet( + ConstHandle2Function1ds self, + const size_t index_, + ConstHandle2ConstRegions1d regions1d +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, index_, regions1d); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +Function1dsRegions1dHasByLabel( + ConstHandle2ConstFunction1ds self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"Regions1dHasByLabel", + self, extract::regions1d, meta::label, label); +} + +// Get, by label, const +Handle2ConstRegions1d +Function1dsRegions1dGetByLabelConst( + ConstHandle2ConstFunction1ds self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"Regions1dGetByLabelConst", + self, extract::regions1d, meta::label, label); +} + +// Get, by label, non-const +Handle2Regions1d +Function1dsRegions1dGetByLabel( + ConstHandle2Function1ds self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"Regions1dGetByLabel", + self, extract::regions1d, meta::label, label); +} + +// Set, by label +void +Function1dsRegions1dSetByLabel( + ConstHandle2Function1ds self, + const char *const label, + ConstHandle2ConstRegions1d regions1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"Regions1dSetByLabel", + self, extract::regions1d, meta::label, label, regions1d); +} + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// Has, by outerDomainValue +int +Function1dsRegions1dHasByOuterDomainValue( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"Regions1dHasByOuterDomainValue", + self, extract::regions1d, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, const +Handle2ConstRegions1d +Function1dsRegions1dGetByOuterDomainValueConst( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"Regions1dGetByOuterDomainValueConst", + self, extract::regions1d, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, non-const +Handle2Regions1d +Function1dsRegions1dGetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"Regions1dGetByOuterDomainValue", + self, extract::regions1d, meta::outerDomainValue, outerDomainValue); +} + +// Set, by outerDomainValue +void +Function1dsRegions1dSetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue, + ConstHandle2ConstRegions1d regions1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"Regions1dSetByOuterDomainValue", + self, extract::regions1d, meta::outerDomainValue, outerDomainValue, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Function1ds/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function1ds.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function1ds.h new file mode 100644 index 000000000..c5f697ce7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function1ds.h @@ -0,0 +1,488 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Function1ds is the basic handle type in this file. Example: +// // Create a default Function1ds object: +// Function1ds handle = Function1dsDefault(); +// Functions involving Function1ds are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_FUNCTION1DS +#define C_INTERFACE_GNDS_V2_0_GENERAL_FUNCTION1DS + +#include "GNDStk.h" +#include "v2.0/general/Legendre.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/Regions1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Function1dsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Function1ds +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Function1dsClass *Function1ds; + +// --- Const-aware handles. +typedef const struct Function1dsClass *const ConstHandle2ConstFunction1ds; +typedef struct Function1dsClass *const ConstHandle2Function1ds; +typedef const struct Function1dsClass * Handle2ConstFunction1ds; +typedef struct Function1dsClass * Handle2Function1ds; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFunction1ds +Function1dsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Function1ds +Function1dsDefault(); + +// --- Create, general, const +extern_c Handle2ConstFunction1ds +Function1dsCreateConst( + ConstHandle2Legendre *const Legendre, const size_t LegendreSize, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize, + ConstHandle2Regions1d *const regions1d, const size_t regions1dSize +); + +// +++ Create, general, non-const +extern_c Handle2Function1ds +Function1dsCreate( + ConstHandle2Legendre *const Legendre, const size_t LegendreSize, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize, + ConstHandle2Regions1d *const regions1d, const size_t regions1dSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Function1dsAssign(ConstHandle2Function1ds self, ConstHandle2ConstFunction1ds from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Function1dsDelete(ConstHandle2ConstFunction1ds self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Function1dsRead(ConstHandle2Function1ds self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Function1dsWrite(ConstHandle2ConstFunction1ds self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Function1dsPrint(ConstHandle2ConstFunction1ds self); + +// +++ Print to standard output, as XML +extern_c int +Function1dsPrintXML(ConstHandle2ConstFunction1ds self); + +// +++ Print to standard output, as JSON +extern_c int +Function1dsPrintJSON(ConstHandle2ConstFunction1ds self); + + +// ----------------------------------------------------------------------------- +// Child: Legendre +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Function1dsLegendreHas(ConstHandle2ConstFunction1ds self); + +// +++ Clear +extern_c void +Function1dsLegendreClear(ConstHandle2Function1ds self); + +// +++ Size +extern_c size_t +Function1dsLegendreSize(ConstHandle2ConstFunction1ds self); + +// +++ Add +extern_c void +Function1dsLegendreAdd(ConstHandle2Function1ds self, ConstHandle2ConstLegendre Legendre); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstLegendre +Function1dsLegendreGetConst(ConstHandle2ConstFunction1ds self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Legendre +Function1dsLegendreGet(ConstHandle2Function1ds self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +Function1dsLegendreSet( + ConstHandle2Function1ds self, + const size_t index_, + ConstHandle2ConstLegendre Legendre +); + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// +++ Has, by outerDomainValue +extern_c int +Function1dsLegendreHasByOuterDomainValue( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +); + +// --- Get, by outerDomainValue, const +extern_c Handle2ConstLegendre +Function1dsLegendreGetByOuterDomainValueConst( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +); + +// +++ Get, by outerDomainValue, non-const +extern_c Handle2Legendre +Function1dsLegendreGetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue +); + +// +++ Set, by outerDomainValue +extern_c void +Function1dsLegendreSetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue, + ConstHandle2ConstLegendre Legendre +); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Function1dsXYs1dHas(ConstHandle2ConstFunction1ds self); + +// +++ Clear +extern_c void +Function1dsXYs1dClear(ConstHandle2Function1ds self); + +// +++ Size +extern_c size_t +Function1dsXYs1dSize(ConstHandle2ConstFunction1ds self); + +// +++ Add +extern_c void +Function1dsXYs1dAdd(ConstHandle2Function1ds self, ConstHandle2ConstXYs1d XYs1d); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstXYs1d +Function1dsXYs1dGetConst(ConstHandle2ConstFunction1ds self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2XYs1d +Function1dsXYs1dGet(ConstHandle2Function1ds self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +Function1dsXYs1dSet( + ConstHandle2Function1ds self, + const size_t index_, + ConstHandle2ConstXYs1d XYs1d +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +Function1dsXYs1dHasByLabel( + ConstHandle2ConstFunction1ds self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstXYs1d +Function1dsXYs1dGetByLabelConst( + ConstHandle2ConstFunction1ds self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2XYs1d +Function1dsXYs1dGetByLabel( + ConstHandle2Function1ds self, + const char *const label +); + +// +++ Set, by label +extern_c void +Function1dsXYs1dSetByLabel( + ConstHandle2Function1ds self, + const char *const label, + ConstHandle2ConstXYs1d XYs1d +); + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// +++ Has, by index +extern_c int +Function1dsXYs1dHasByIndex( + ConstHandle2ConstFunction1ds self, + const int index +); + +// --- Get, by index, const +extern_c Handle2ConstXYs1d +Function1dsXYs1dGetByIndexConst( + ConstHandle2ConstFunction1ds self, + const int index +); + +// +++ Get, by index, non-const +extern_c Handle2XYs1d +Function1dsXYs1dGetByIndex( + ConstHandle2Function1ds self, + const int index +); + +// +++ Set, by index +extern_c void +Function1dsXYs1dSetByIndex( + ConstHandle2Function1ds self, + const int index, + ConstHandle2ConstXYs1d XYs1d +); + +// ------------------------ +// Re: metadatum interpolation +// ------------------------ + +// +++ Has, by interpolation +extern_c int +Function1dsXYs1dHasByInterpolation( + ConstHandle2ConstFunction1ds self, + const char *const interpolation +); + +// --- Get, by interpolation, const +extern_c Handle2ConstXYs1d +Function1dsXYs1dGetByInterpolationConst( + ConstHandle2ConstFunction1ds self, + const char *const interpolation +); + +// +++ Get, by interpolation, non-const +extern_c Handle2XYs1d +Function1dsXYs1dGetByInterpolation( + ConstHandle2Function1ds self, + const char *const interpolation +); + +// +++ Set, by interpolation +extern_c void +Function1dsXYs1dSetByInterpolation( + ConstHandle2Function1ds self, + const char *const interpolation, + ConstHandle2ConstXYs1d XYs1d +); + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// +++ Has, by outerDomainValue +extern_c int +Function1dsXYs1dHasByOuterDomainValue( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +); + +// --- Get, by outerDomainValue, const +extern_c Handle2ConstXYs1d +Function1dsXYs1dGetByOuterDomainValueConst( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +); + +// +++ Get, by outerDomainValue, non-const +extern_c Handle2XYs1d +Function1dsXYs1dGetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue +); + +// +++ Set, by outerDomainValue +extern_c void +Function1dsXYs1dSetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue, + ConstHandle2ConstXYs1d XYs1d +); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Function1dsRegions1dHas(ConstHandle2ConstFunction1ds self); + +// +++ Clear +extern_c void +Function1dsRegions1dClear(ConstHandle2Function1ds self); + +// +++ Size +extern_c size_t +Function1dsRegions1dSize(ConstHandle2ConstFunction1ds self); + +// +++ Add +extern_c void +Function1dsRegions1dAdd(ConstHandle2Function1ds self, ConstHandle2ConstRegions1d regions1d); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstRegions1d +Function1dsRegions1dGetConst(ConstHandle2ConstFunction1ds self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Regions1d +Function1dsRegions1dGet(ConstHandle2Function1ds self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +Function1dsRegions1dSet( + ConstHandle2Function1ds self, + const size_t index_, + ConstHandle2ConstRegions1d regions1d +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +Function1dsRegions1dHasByLabel( + ConstHandle2ConstFunction1ds self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstRegions1d +Function1dsRegions1dGetByLabelConst( + ConstHandle2ConstFunction1ds self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Regions1d +Function1dsRegions1dGetByLabel( + ConstHandle2Function1ds self, + const char *const label +); + +// +++ Set, by label +extern_c void +Function1dsRegions1dSetByLabel( + ConstHandle2Function1ds self, + const char *const label, + ConstHandle2ConstRegions1d regions1d +); + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// +++ Has, by outerDomainValue +extern_c int +Function1dsRegions1dHasByOuterDomainValue( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +); + +// --- Get, by outerDomainValue, const +extern_c Handle2ConstRegions1d +Function1dsRegions1dGetByOuterDomainValueConst( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +); + +// +++ Get, by outerDomainValue, non-const +extern_c Handle2Regions1d +Function1dsRegions1dGetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue +); + +// +++ Set, by outerDomainValue +extern_c void +Function1dsRegions1dSetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue, + ConstHandle2ConstRegions1d regions1d +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Function1ds/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function1ds/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function1ds/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function1ds/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function1ds/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function2ds.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function2ds.cpp new file mode 100644 index 000000000..bed396e81 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function2ds.cpp @@ -0,0 +1,408 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Function2ds.hpp" +#include "Function2ds.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Function2dsClass; +using CPP = multigroup::Function2ds; + +static const std::string CLASSNAME = "Function2ds"; + +namespace extract { + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; +} + +using CPPXYs2d = general::XYs2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFunction2ds +Function2dsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Function2ds +Function2dsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFunction2ds +Function2dsCreateConst( + ConstHandle2XYs2d *const XYs2d, const size_t XYs2dSize +) { + ConstHandle2Function2ds handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t XYs2dN = 0; XYs2dN < XYs2dSize; ++XYs2dN) + Function2dsXYs2dAdd(handle, XYs2d[XYs2dN]); + return handle; +} + +// Create, general, non-const +Handle2Function2ds +Function2dsCreate( + ConstHandle2XYs2d *const XYs2d, const size_t XYs2dSize +) { + ConstHandle2Function2ds handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t XYs2dN = 0; XYs2dN < XYs2dSize; ++XYs2dN) + Function2dsXYs2dAdd(handle, XYs2d[XYs2dN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Function2dsAssign(ConstHandle2Function2ds self, ConstHandle2ConstFunction2ds from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Function2dsDelete(ConstHandle2ConstFunction2ds self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Function2dsRead(ConstHandle2Function2ds self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Function2dsWrite(ConstHandle2ConstFunction2ds self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Function2dsPrint(ConstHandle2ConstFunction2ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Function2dsPrintXML(ConstHandle2ConstFunction2ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Function2dsPrintJSON(ConstHandle2ConstFunction2ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +Function2dsXYs2dHas(ConstHandle2ConstFunction2ds self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Clear +void +Function2dsXYs2dClear(ConstHandle2Function2ds self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"XYs2dClear", self, extract::XYs2d); +} + +// Size +size_t +Function2dsXYs2dSize(ConstHandle2ConstFunction2ds self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"XYs2dSize", self, extract::XYs2d); +} + +// Add +void +Function2dsXYs2dAdd(ConstHandle2Function2ds self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"XYs2dAdd", self, extract::XYs2d, XYs2d); +} + +// Get, by index \in [0,size), const +Handle2ConstXYs2d +Function2dsXYs2dGetConst(ConstHandle2ConstFunction2ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d, index_); +} + +// Get, by index \in [0,size), non-const +Handle2XYs2d +Function2dsXYs2dGet(ConstHandle2Function2ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d, index_); +} + +// Set, by index \in [0,size) +void +Function2dsXYs2dSet( + ConstHandle2Function2ds self, + const size_t index_, + ConstHandle2ConstXYs2d XYs2d +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, index_, XYs2d); +} + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// Has, by index +int +Function2dsXYs2dHasByIndex( + ConstHandle2ConstFunction2ds self, + const int index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dHasByIndex", + self, extract::XYs2d, meta::index, index); +} + +// Get, by index, const +Handle2ConstXYs2d +Function2dsXYs2dGetByIndexConst( + ConstHandle2ConstFunction2ds self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dGetByIndexConst", + self, extract::XYs2d, meta::index, index); +} + +// Get, by index, non-const +Handle2XYs2d +Function2dsXYs2dGetByIndex( + ConstHandle2Function2ds self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dGetByIndex", + self, extract::XYs2d, meta::index, index); +} + +// Set, by index +void +Function2dsXYs2dSetByIndex( + ConstHandle2Function2ds self, + const int index, + ConstHandle2ConstXYs2d XYs2d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dSetByIndex", + self, extract::XYs2d, meta::index, index, XYs2d); +} + +// ------------------------ +// Re: metadatum interpolation +// ------------------------ + +// Has, by interpolation +int +Function2dsXYs2dHasByInterpolation( + ConstHandle2ConstFunction2ds self, + const char *const interpolation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dHasByInterpolation", + self, extract::XYs2d, meta::interpolation, interpolation); +} + +// Get, by interpolation, const +Handle2ConstXYs2d +Function2dsXYs2dGetByInterpolationConst( + ConstHandle2ConstFunction2ds self, + const char *const interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dGetByInterpolationConst", + self, extract::XYs2d, meta::interpolation, interpolation); +} + +// Get, by interpolation, non-const +Handle2XYs2d +Function2dsXYs2dGetByInterpolation( + ConstHandle2Function2ds self, + const char *const interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dGetByInterpolation", + self, extract::XYs2d, meta::interpolation, interpolation); +} + +// Set, by interpolation +void +Function2dsXYs2dSetByInterpolation( + ConstHandle2Function2ds self, + const char *const interpolation, + ConstHandle2ConstXYs2d XYs2d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dSetByInterpolation", + self, extract::XYs2d, meta::interpolation, interpolation, XYs2d); +} + +// ------------------------ +// Re: metadatum interpolationQualifier +// ------------------------ + +// Has, by interpolationQualifier +int +Function2dsXYs2dHasByInterpolationQualifier( + ConstHandle2ConstFunction2ds self, + const char *const interpolationQualifier +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dHasByInterpolationQualifier", + self, extract::XYs2d, meta::interpolationQualifier, interpolationQualifier); +} + +// Get, by interpolationQualifier, const +Handle2ConstXYs2d +Function2dsXYs2dGetByInterpolationQualifierConst( + ConstHandle2ConstFunction2ds self, + const char *const interpolationQualifier +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dGetByInterpolationQualifierConst", + self, extract::XYs2d, meta::interpolationQualifier, interpolationQualifier); +} + +// Get, by interpolationQualifier, non-const +Handle2XYs2d +Function2dsXYs2dGetByInterpolationQualifier( + ConstHandle2Function2ds self, + const char *const interpolationQualifier +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dGetByInterpolationQualifier", + self, extract::XYs2d, meta::interpolationQualifier, interpolationQualifier); +} + +// Set, by interpolationQualifier +void +Function2dsXYs2dSetByInterpolationQualifier( + ConstHandle2Function2ds self, + const char *const interpolationQualifier, + ConstHandle2ConstXYs2d XYs2d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dSetByInterpolationQualifier", + self, extract::XYs2d, meta::interpolationQualifier, interpolationQualifier, XYs2d); +} + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// Has, by outerDomainValue +int +Function2dsXYs2dHasByOuterDomainValue( + ConstHandle2ConstFunction2ds self, + const double outerDomainValue +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dHasByOuterDomainValue", + self, extract::XYs2d, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, const +Handle2ConstXYs2d +Function2dsXYs2dGetByOuterDomainValueConst( + ConstHandle2ConstFunction2ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dGetByOuterDomainValueConst", + self, extract::XYs2d, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, non-const +Handle2XYs2d +Function2dsXYs2dGetByOuterDomainValue( + ConstHandle2Function2ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dGetByOuterDomainValue", + self, extract::XYs2d, meta::outerDomainValue, outerDomainValue); +} + +// Set, by outerDomainValue +void +Function2dsXYs2dSetByOuterDomainValue( + ConstHandle2Function2ds self, + const double outerDomainValue, + ConstHandle2ConstXYs2d XYs2d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs2dSetByOuterDomainValue", + self, extract::XYs2d, meta::outerDomainValue, outerDomainValue, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Function2ds/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function2ds.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function2ds.h new file mode 100644 index 000000000..32689fc98 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function2ds.h @@ -0,0 +1,309 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Function2ds is the basic handle type in this file. Example: +// // Create a default Function2ds object: +// Function2ds handle = Function2dsDefault(); +// Functions involving Function2ds are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_FUNCTION2DS +#define C_INTERFACE_GNDS_V2_0_GENERAL_FUNCTION2DS + +#include "GNDStk.h" +#include "v2.0/general/XYs2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Function2dsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Function2ds +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Function2dsClass *Function2ds; + +// --- Const-aware handles. +typedef const struct Function2dsClass *const ConstHandle2ConstFunction2ds; +typedef struct Function2dsClass *const ConstHandle2Function2ds; +typedef const struct Function2dsClass * Handle2ConstFunction2ds; +typedef struct Function2dsClass * Handle2Function2ds; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFunction2ds +Function2dsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Function2ds +Function2dsDefault(); + +// --- Create, general, const +extern_c Handle2ConstFunction2ds +Function2dsCreateConst( + ConstHandle2XYs2d *const XYs2d, const size_t XYs2dSize +); + +// +++ Create, general, non-const +extern_c Handle2Function2ds +Function2dsCreate( + ConstHandle2XYs2d *const XYs2d, const size_t XYs2dSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Function2dsAssign(ConstHandle2Function2ds self, ConstHandle2ConstFunction2ds from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Function2dsDelete(ConstHandle2ConstFunction2ds self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Function2dsRead(ConstHandle2Function2ds self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Function2dsWrite(ConstHandle2ConstFunction2ds self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Function2dsPrint(ConstHandle2ConstFunction2ds self); + +// +++ Print to standard output, as XML +extern_c int +Function2dsPrintXML(ConstHandle2ConstFunction2ds self); + +// +++ Print to standard output, as JSON +extern_c int +Function2dsPrintJSON(ConstHandle2ConstFunction2ds self); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Function2dsXYs2dHas(ConstHandle2ConstFunction2ds self); + +// +++ Clear +extern_c void +Function2dsXYs2dClear(ConstHandle2Function2ds self); + +// +++ Size +extern_c size_t +Function2dsXYs2dSize(ConstHandle2ConstFunction2ds self); + +// +++ Add +extern_c void +Function2dsXYs2dAdd(ConstHandle2Function2ds self, ConstHandle2ConstXYs2d XYs2d); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstXYs2d +Function2dsXYs2dGetConst(ConstHandle2ConstFunction2ds self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2XYs2d +Function2dsXYs2dGet(ConstHandle2Function2ds self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +Function2dsXYs2dSet( + ConstHandle2Function2ds self, + const size_t index_, + ConstHandle2ConstXYs2d XYs2d +); + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// +++ Has, by index +extern_c int +Function2dsXYs2dHasByIndex( + ConstHandle2ConstFunction2ds self, + const int index +); + +// --- Get, by index, const +extern_c Handle2ConstXYs2d +Function2dsXYs2dGetByIndexConst( + ConstHandle2ConstFunction2ds self, + const int index +); + +// +++ Get, by index, non-const +extern_c Handle2XYs2d +Function2dsXYs2dGetByIndex( + ConstHandle2Function2ds self, + const int index +); + +// +++ Set, by index +extern_c void +Function2dsXYs2dSetByIndex( + ConstHandle2Function2ds self, + const int index, + ConstHandle2ConstXYs2d XYs2d +); + +// ------------------------ +// Re: metadatum interpolation +// ------------------------ + +// +++ Has, by interpolation +extern_c int +Function2dsXYs2dHasByInterpolation( + ConstHandle2ConstFunction2ds self, + const char *const interpolation +); + +// --- Get, by interpolation, const +extern_c Handle2ConstXYs2d +Function2dsXYs2dGetByInterpolationConst( + ConstHandle2ConstFunction2ds self, + const char *const interpolation +); + +// +++ Get, by interpolation, non-const +extern_c Handle2XYs2d +Function2dsXYs2dGetByInterpolation( + ConstHandle2Function2ds self, + const char *const interpolation +); + +// +++ Set, by interpolation +extern_c void +Function2dsXYs2dSetByInterpolation( + ConstHandle2Function2ds self, + const char *const interpolation, + ConstHandle2ConstXYs2d XYs2d +); + +// ------------------------ +// Re: metadatum interpolationQualifier +// ------------------------ + +// +++ Has, by interpolationQualifier +extern_c int +Function2dsXYs2dHasByInterpolationQualifier( + ConstHandle2ConstFunction2ds self, + const char *const interpolationQualifier +); + +// --- Get, by interpolationQualifier, const +extern_c Handle2ConstXYs2d +Function2dsXYs2dGetByInterpolationQualifierConst( + ConstHandle2ConstFunction2ds self, + const char *const interpolationQualifier +); + +// +++ Get, by interpolationQualifier, non-const +extern_c Handle2XYs2d +Function2dsXYs2dGetByInterpolationQualifier( + ConstHandle2Function2ds self, + const char *const interpolationQualifier +); + +// +++ Set, by interpolationQualifier +extern_c void +Function2dsXYs2dSetByInterpolationQualifier( + ConstHandle2Function2ds self, + const char *const interpolationQualifier, + ConstHandle2ConstXYs2d XYs2d +); + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// +++ Has, by outerDomainValue +extern_c int +Function2dsXYs2dHasByOuterDomainValue( + ConstHandle2ConstFunction2ds self, + const double outerDomainValue +); + +// --- Get, by outerDomainValue, const +extern_c Handle2ConstXYs2d +Function2dsXYs2dGetByOuterDomainValueConst( + ConstHandle2ConstFunction2ds self, + const double outerDomainValue +); + +// +++ Get, by outerDomainValue, non-const +extern_c Handle2XYs2d +Function2dsXYs2dGetByOuterDomainValue( + ConstHandle2Function2ds self, + const double outerDomainValue +); + +// +++ Set, by outerDomainValue +extern_c void +Function2dsXYs2dSetByOuterDomainValue( + ConstHandle2Function2ds self, + const double outerDomainValue, + ConstHandle2ConstXYs2d XYs2d +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Function2ds/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function2ds/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function2ds/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function2ds/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Function2ds/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/G.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/G.cpp new file mode 100644 index 000000000..8ddfc6210 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/G.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/G.hpp" +#include "G.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = GClass; +using CPP = multigroup::G; + +static const std::string CLASSNAME = "G"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstG +GDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2G +GDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstG +GCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2G handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2G +GCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2G handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +GAssign(ConstHandle2G self, ConstHandle2ConstG from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +GDelete(ConstHandle2ConstG self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +GRead(ConstHandle2G self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +GWrite(ConstHandle2ConstG self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +GPrint(ConstHandle2ConstG self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +GPrintXML(ConstHandle2ConstG self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +GPrintJSON(ConstHandle2ConstG self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +GXYs1dHas(ConstHandle2ConstG self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +GXYs1dGetConst(ConstHandle2ConstG self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +GXYs1dGet(ConstHandle2G self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +GXYs1dSet(ConstHandle2G self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/G/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/G.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/G.h new file mode 100644 index 000000000..69cdd1909 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/G.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// G is the basic handle type in this file. Example: +// // Create a default G object: +// G handle = GDefault(); +// Functions involving G are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_G +#define C_INTERFACE_GNDS_V2_0_GENERAL_G + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct GClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ G +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct GClass *G; + +// --- Const-aware handles. +typedef const struct GClass *const ConstHandle2ConstG; +typedef struct GClass *const ConstHandle2G; +typedef const struct GClass * Handle2ConstG; +typedef struct GClass * Handle2G; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstG +GDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2G +GDefault(); + +// --- Create, general, const +extern_c Handle2ConstG +GCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2G +GCreate( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +GAssign(ConstHandle2G self, ConstHandle2ConstG from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +GDelete(ConstHandle2ConstG self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +GRead(ConstHandle2G self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +GWrite(ConstHandle2ConstG self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +GPrint(ConstHandle2ConstG self); + +// +++ Print to standard output, as XML +extern_c int +GPrintXML(ConstHandle2ConstG self); + +// +++ Print to standard output, as JSON +extern_c int +GPrintJSON(ConstHandle2ConstG self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GXYs1dHas(ConstHandle2ConstG self); + +// --- Get, const +extern_c Handle2ConstXYs1d +GXYs1dGetConst(ConstHandle2ConstG self); + +// +++ Get, non-const +extern_c Handle2XYs1d +GXYs1dGet(ConstHandle2G self); + +// +++ Set +extern_c void +GXYs1dSet(ConstHandle2G self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/G/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/G/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/G/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/G/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/G/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBoson.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBoson.cpp new file mode 100644 index 000000000..0ad1ceb21 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBoson.cpp @@ -0,0 +1,388 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/GaugeBoson.hpp" +#include "GaugeBoson.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = GaugeBosonClass; +using CPP = multigroup::GaugeBoson; + +static const std::string CLASSNAME = "GaugeBoson"; + +namespace extract { + static auto id = [](auto &obj) { return &obj.id; }; + static auto mass = [](auto &obj) { return &obj.mass; }; + static auto spin = [](auto &obj) { return &obj.spin; }; + static auto parity = [](auto &obj) { return &obj.parity; }; + static auto charge = [](auto &obj) { return &obj.charge; }; + static auto halflife = [](auto &obj) { return &obj.halflife; }; +} + +using CPPMass = general::Mass; +using CPPSpin = general::Spin; +using CPPParity = general::Parity; +using CPPCharge = general::Charge; +using CPPHalflife = general::Halflife; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGaugeBoson +GaugeBosonDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2GaugeBoson +GaugeBosonDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGaugeBoson +GaugeBosonCreateConst( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife +) { + ConstHandle2GaugeBoson handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(charge), + detail::tocpp(halflife) + ); + return handle; +} + +// Create, general, non-const +Handle2GaugeBoson +GaugeBosonCreate( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife +) { + ConstHandle2GaugeBoson handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(charge), + detail::tocpp(halflife) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +GaugeBosonAssign(ConstHandle2GaugeBoson self, ConstHandle2ConstGaugeBoson from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +GaugeBosonDelete(ConstHandle2ConstGaugeBoson self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +GaugeBosonRead(ConstHandle2GaugeBoson self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +GaugeBosonWrite(ConstHandle2ConstGaugeBoson self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +GaugeBosonPrint(ConstHandle2ConstGaugeBoson self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +GaugeBosonPrintXML(ConstHandle2ConstGaugeBoson self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +GaugeBosonPrintJSON(ConstHandle2ConstGaugeBoson self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// Has +int +GaugeBosonIdHas(ConstHandle2ConstGaugeBoson self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IdHas", self, extract::id); +} + +// Get +// Returns by value +const char * +GaugeBosonIdGet(ConstHandle2ConstGaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +GaugeBosonIdSet(ConstHandle2GaugeBoson self, const char *const id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// Has +int +GaugeBosonMassHas(ConstHandle2ConstGaugeBoson self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MassHas", self, extract::mass); +} + +// Get, const +Handle2ConstMass +GaugeBosonMassGetConst(ConstHandle2ConstGaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGetConst", self, extract::mass); +} + +// Get, non-const +Handle2Mass +GaugeBosonMassGet(ConstHandle2GaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGet", self, extract::mass); +} + +// Set +void +GaugeBosonMassSet(ConstHandle2GaugeBoson self, ConstHandle2ConstMass mass) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MassSet", self, extract::mass, mass); +} + + +// ----------------------------------------------------------------------------- +// Child: spin +// ----------------------------------------------------------------------------- + +// Has +int +GaugeBosonSpinHas(ConstHandle2ConstGaugeBoson self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SpinHas", self, extract::spin); +} + +// Get, const +Handle2ConstSpin +GaugeBosonSpinGetConst(ConstHandle2ConstGaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGetConst", self, extract::spin); +} + +// Get, non-const +Handle2Spin +GaugeBosonSpinGet(ConstHandle2GaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGet", self, extract::spin); +} + +// Set +void +GaugeBosonSpinSet(ConstHandle2GaugeBoson self, ConstHandle2ConstSpin spin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SpinSet", self, extract::spin, spin); +} + + +// ----------------------------------------------------------------------------- +// Child: parity +// ----------------------------------------------------------------------------- + +// Has +int +GaugeBosonParityHas(ConstHandle2ConstGaugeBoson self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ParityHas", self, extract::parity); +} + +// Get, const +Handle2ConstParity +GaugeBosonParityGetConst(ConstHandle2ConstGaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGetConst", self, extract::parity); +} + +// Get, non-const +Handle2Parity +GaugeBosonParityGet(ConstHandle2GaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGet", self, extract::parity); +} + +// Set +void +GaugeBosonParitySet(ConstHandle2GaugeBoson self, ConstHandle2ConstParity parity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ParitySet", self, extract::parity, parity); +} + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// Has +int +GaugeBosonChargeHas(ConstHandle2ConstGaugeBoson self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChargeHas", self, extract::charge); +} + +// Get, const +Handle2ConstCharge +GaugeBosonChargeGetConst(ConstHandle2ConstGaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGetConst", self, extract::charge); +} + +// Get, non-const +Handle2Charge +GaugeBosonChargeGet(ConstHandle2GaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGet", self, extract::charge); +} + +// Set +void +GaugeBosonChargeSet(ConstHandle2GaugeBoson self, ConstHandle2ConstCharge charge) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChargeSet", self, extract::charge, charge); +} + + +// ----------------------------------------------------------------------------- +// Child: halflife +// ----------------------------------------------------------------------------- + +// Has +int +GaugeBosonHalflifeHas(ConstHandle2ConstGaugeBoson self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HalflifeHas", self, extract::halflife); +} + +// Get, const +Handle2ConstHalflife +GaugeBosonHalflifeGetConst(ConstHandle2ConstGaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HalflifeGetConst", self, extract::halflife); +} + +// Get, non-const +Handle2Halflife +GaugeBosonHalflifeGet(ConstHandle2GaugeBoson self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HalflifeGet", self, extract::halflife); +} + +// Set +void +GaugeBosonHalflifeSet(ConstHandle2GaugeBoson self, ConstHandle2ConstHalflife halflife) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HalflifeSet", self, extract::halflife, halflife); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/GaugeBoson/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBoson.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBoson.h new file mode 100644 index 000000000..5b24d9d35 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBoson.h @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// GaugeBoson is the basic handle type in this file. Example: +// // Create a default GaugeBoson object: +// GaugeBoson handle = GaugeBosonDefault(); +// Functions involving GaugeBoson are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_GAUGEBOSON +#define C_INTERFACE_GNDS_V2_0_GENERAL_GAUGEBOSON + +#include "GNDStk.h" +#include "v2.0/general/Mass.h" +#include "v2.0/general/Spin.h" +#include "v2.0/general/Parity.h" +#include "v2.0/general/Charge.h" +#include "v2.0/general/Halflife.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct GaugeBosonClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ GaugeBoson +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct GaugeBosonClass *GaugeBoson; + +// --- Const-aware handles. +typedef const struct GaugeBosonClass *const ConstHandle2ConstGaugeBoson; +typedef struct GaugeBosonClass *const ConstHandle2GaugeBoson; +typedef const struct GaugeBosonClass * Handle2ConstGaugeBoson; +typedef struct GaugeBosonClass * Handle2GaugeBoson; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstGaugeBoson +GaugeBosonDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2GaugeBoson +GaugeBosonDefault(); + +// --- Create, general, const +extern_c Handle2ConstGaugeBoson +GaugeBosonCreateConst( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife +); + +// +++ Create, general, non-const +extern_c Handle2GaugeBoson +GaugeBosonCreate( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +GaugeBosonAssign(ConstHandle2GaugeBoson self, ConstHandle2ConstGaugeBoson from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +GaugeBosonDelete(ConstHandle2ConstGaugeBoson self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +GaugeBosonRead(ConstHandle2GaugeBoson self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +GaugeBosonWrite(ConstHandle2ConstGaugeBoson self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +GaugeBosonPrint(ConstHandle2ConstGaugeBoson self); + +// +++ Print to standard output, as XML +extern_c int +GaugeBosonPrintXML(ConstHandle2ConstGaugeBoson self); + +// +++ Print to standard output, as JSON +extern_c int +GaugeBosonPrintJSON(ConstHandle2ConstGaugeBoson self); + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GaugeBosonIdHas(ConstHandle2ConstGaugeBoson self); + +// +++ Get +// +++ Returns by value +extern_c const char * +GaugeBosonIdGet(ConstHandle2ConstGaugeBoson self); + +// +++ Set +extern_c void +GaugeBosonIdSet(ConstHandle2GaugeBoson self, const char *const id); + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GaugeBosonMassHas(ConstHandle2ConstGaugeBoson self); + +// --- Get, const +extern_c Handle2ConstMass +GaugeBosonMassGetConst(ConstHandle2ConstGaugeBoson self); + +// +++ Get, non-const +extern_c Handle2Mass +GaugeBosonMassGet(ConstHandle2GaugeBoson self); + +// +++ Set +extern_c void +GaugeBosonMassSet(ConstHandle2GaugeBoson self, ConstHandle2ConstMass mass); + + +// ----------------------------------------------------------------------------- +// Child: spin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GaugeBosonSpinHas(ConstHandle2ConstGaugeBoson self); + +// --- Get, const +extern_c Handle2ConstSpin +GaugeBosonSpinGetConst(ConstHandle2ConstGaugeBoson self); + +// +++ Get, non-const +extern_c Handle2Spin +GaugeBosonSpinGet(ConstHandle2GaugeBoson self); + +// +++ Set +extern_c void +GaugeBosonSpinSet(ConstHandle2GaugeBoson self, ConstHandle2ConstSpin spin); + + +// ----------------------------------------------------------------------------- +// Child: parity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GaugeBosonParityHas(ConstHandle2ConstGaugeBoson self); + +// --- Get, const +extern_c Handle2ConstParity +GaugeBosonParityGetConst(ConstHandle2ConstGaugeBoson self); + +// +++ Get, non-const +extern_c Handle2Parity +GaugeBosonParityGet(ConstHandle2GaugeBoson self); + +// +++ Set +extern_c void +GaugeBosonParitySet(ConstHandle2GaugeBoson self, ConstHandle2ConstParity parity); + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GaugeBosonChargeHas(ConstHandle2ConstGaugeBoson self); + +// --- Get, const +extern_c Handle2ConstCharge +GaugeBosonChargeGetConst(ConstHandle2ConstGaugeBoson self); + +// +++ Get, non-const +extern_c Handle2Charge +GaugeBosonChargeGet(ConstHandle2GaugeBoson self); + +// +++ Set +extern_c void +GaugeBosonChargeSet(ConstHandle2GaugeBoson self, ConstHandle2ConstCharge charge); + + +// ----------------------------------------------------------------------------- +// Child: halflife +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GaugeBosonHalflifeHas(ConstHandle2ConstGaugeBoson self); + +// --- Get, const +extern_c Handle2ConstHalflife +GaugeBosonHalflifeGetConst(ConstHandle2ConstGaugeBoson self); + +// +++ Get, non-const +extern_c Handle2Halflife +GaugeBosonHalflifeGet(ConstHandle2GaugeBoson self); + +// +++ Set +extern_c void +GaugeBosonHalflifeSet(ConstHandle2GaugeBoson self, ConstHandle2ConstHalflife halflife); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/GaugeBoson/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBoson/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBoson/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBoson/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBoson/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBosons.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBosons.cpp new file mode 100644 index 000000000..161d46545 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBosons.cpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/GaugeBosons.hpp" +#include "GaugeBosons.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = GaugeBosonsClass; +using CPP = multigroup::GaugeBosons; + +static const std::string CLASSNAME = "GaugeBosons"; + +namespace extract { + static auto gaugeBoson = [](auto &obj) { return &obj.gaugeBoson; }; +} + +using CPPGaugeBoson = general::GaugeBoson; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGaugeBosons +GaugeBosonsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2GaugeBosons +GaugeBosonsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGaugeBosons +GaugeBosonsCreateConst( + ConstHandle2GaugeBoson *const gaugeBoson, const size_t gaugeBosonSize +) { + ConstHandle2GaugeBosons handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t GaugeBosonN = 0; GaugeBosonN < gaugeBosonSize; ++GaugeBosonN) + GaugeBosonsGaugeBosonAdd(handle, gaugeBoson[GaugeBosonN]); + return handle; +} + +// Create, general, non-const +Handle2GaugeBosons +GaugeBosonsCreate( + ConstHandle2GaugeBoson *const gaugeBoson, const size_t gaugeBosonSize +) { + ConstHandle2GaugeBosons handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t GaugeBosonN = 0; GaugeBosonN < gaugeBosonSize; ++GaugeBosonN) + GaugeBosonsGaugeBosonAdd(handle, gaugeBoson[GaugeBosonN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +GaugeBosonsAssign(ConstHandle2GaugeBosons self, ConstHandle2ConstGaugeBosons from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +GaugeBosonsDelete(ConstHandle2ConstGaugeBosons self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +GaugeBosonsRead(ConstHandle2GaugeBosons self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +GaugeBosonsWrite(ConstHandle2ConstGaugeBosons self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +GaugeBosonsPrint(ConstHandle2ConstGaugeBosons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +GaugeBosonsPrintXML(ConstHandle2ConstGaugeBosons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +GaugeBosonsPrintJSON(ConstHandle2ConstGaugeBosons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: gaugeBoson +// ----------------------------------------------------------------------------- + +// Has +int +GaugeBosonsGaugeBosonHas(ConstHandle2ConstGaugeBosons self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GaugeBosonHas", self, extract::gaugeBoson); +} + +// Clear +void +GaugeBosonsGaugeBosonClear(ConstHandle2GaugeBosons self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"GaugeBosonClear", self, extract::gaugeBoson); +} + +// Size +size_t +GaugeBosonsGaugeBosonSize(ConstHandle2ConstGaugeBosons self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"GaugeBosonSize", self, extract::gaugeBoson); +} + +// Add +void +GaugeBosonsGaugeBosonAdd(ConstHandle2GaugeBosons self, ConstHandle2ConstGaugeBoson gaugeBoson) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"GaugeBosonAdd", self, extract::gaugeBoson, gaugeBoson); +} + +// Get, by index \in [0,size), const +Handle2ConstGaugeBoson +GaugeBosonsGaugeBosonGetConst(ConstHandle2ConstGaugeBosons self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"GaugeBosonGetConst", self, extract::gaugeBoson, index_); +} + +// Get, by index \in [0,size), non-const +Handle2GaugeBoson +GaugeBosonsGaugeBosonGet(ConstHandle2GaugeBosons self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"GaugeBosonGet", self, extract::gaugeBoson, index_); +} + +// Set, by index \in [0,size) +void +GaugeBosonsGaugeBosonSet( + ConstHandle2GaugeBosons self, + const size_t index_, + ConstHandle2ConstGaugeBoson gaugeBoson +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"GaugeBosonSet", self, extract::gaugeBoson, index_, gaugeBoson); +} + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// Has, by id +int +GaugeBosonsGaugeBosonHasById( + ConstHandle2ConstGaugeBosons self, + const char *const id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"GaugeBosonHasById", + self, extract::gaugeBoson, meta::id, id); +} + +// Get, by id, const +Handle2ConstGaugeBoson +GaugeBosonsGaugeBosonGetByIdConst( + ConstHandle2ConstGaugeBosons self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GaugeBosonGetByIdConst", + self, extract::gaugeBoson, meta::id, id); +} + +// Get, by id, non-const +Handle2GaugeBoson +GaugeBosonsGaugeBosonGetById( + ConstHandle2GaugeBosons self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"GaugeBosonGetById", + self, extract::gaugeBoson, meta::id, id); +} + +// Set, by id +void +GaugeBosonsGaugeBosonSetById( + ConstHandle2GaugeBosons self, + const char *const id, + ConstHandle2ConstGaugeBoson gaugeBoson +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"GaugeBosonSetById", + self, extract::gaugeBoson, meta::id, id, gaugeBoson); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/GaugeBosons/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBosons.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBosons.h new file mode 100644 index 000000000..0c662ad24 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBosons.h @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// GaugeBosons is the basic handle type in this file. Example: +// // Create a default GaugeBosons object: +// GaugeBosons handle = GaugeBosonsDefault(); +// Functions involving GaugeBosons are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_GAUGEBOSONS +#define C_INTERFACE_GNDS_V2_0_GENERAL_GAUGEBOSONS + +#include "GNDStk.h" +#include "v2.0/general/GaugeBoson.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct GaugeBosonsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ GaugeBosons +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct GaugeBosonsClass *GaugeBosons; + +// --- Const-aware handles. +typedef const struct GaugeBosonsClass *const ConstHandle2ConstGaugeBosons; +typedef struct GaugeBosonsClass *const ConstHandle2GaugeBosons; +typedef const struct GaugeBosonsClass * Handle2ConstGaugeBosons; +typedef struct GaugeBosonsClass * Handle2GaugeBosons; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstGaugeBosons +GaugeBosonsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2GaugeBosons +GaugeBosonsDefault(); + +// --- Create, general, const +extern_c Handle2ConstGaugeBosons +GaugeBosonsCreateConst( + ConstHandle2GaugeBoson *const gaugeBoson, const size_t gaugeBosonSize +); + +// +++ Create, general, non-const +extern_c Handle2GaugeBosons +GaugeBosonsCreate( + ConstHandle2GaugeBoson *const gaugeBoson, const size_t gaugeBosonSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +GaugeBosonsAssign(ConstHandle2GaugeBosons self, ConstHandle2ConstGaugeBosons from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +GaugeBosonsDelete(ConstHandle2ConstGaugeBosons self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +GaugeBosonsRead(ConstHandle2GaugeBosons self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +GaugeBosonsWrite(ConstHandle2ConstGaugeBosons self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +GaugeBosonsPrint(ConstHandle2ConstGaugeBosons self); + +// +++ Print to standard output, as XML +extern_c int +GaugeBosonsPrintXML(ConstHandle2ConstGaugeBosons self); + +// +++ Print to standard output, as JSON +extern_c int +GaugeBosonsPrintJSON(ConstHandle2ConstGaugeBosons self); + + +// ----------------------------------------------------------------------------- +// Child: gaugeBoson +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GaugeBosonsGaugeBosonHas(ConstHandle2ConstGaugeBosons self); + +// +++ Clear +extern_c void +GaugeBosonsGaugeBosonClear(ConstHandle2GaugeBosons self); + +// +++ Size +extern_c size_t +GaugeBosonsGaugeBosonSize(ConstHandle2ConstGaugeBosons self); + +// +++ Add +extern_c void +GaugeBosonsGaugeBosonAdd(ConstHandle2GaugeBosons self, ConstHandle2ConstGaugeBoson gaugeBoson); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstGaugeBoson +GaugeBosonsGaugeBosonGetConst(ConstHandle2ConstGaugeBosons self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2GaugeBoson +GaugeBosonsGaugeBosonGet(ConstHandle2GaugeBosons self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +GaugeBosonsGaugeBosonSet( + ConstHandle2GaugeBosons self, + const size_t index_, + ConstHandle2ConstGaugeBoson gaugeBoson +); + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// +++ Has, by id +extern_c int +GaugeBosonsGaugeBosonHasById( + ConstHandle2ConstGaugeBosons self, + const char *const id +); + +// --- Get, by id, const +extern_c Handle2ConstGaugeBoson +GaugeBosonsGaugeBosonGetByIdConst( + ConstHandle2ConstGaugeBosons self, + const char *const id +); + +// +++ Get, by id, non-const +extern_c Handle2GaugeBoson +GaugeBosonsGaugeBosonGetById( + ConstHandle2GaugeBosons self, + const char *const id +); + +// +++ Set, by id +extern_c void +GaugeBosonsGaugeBosonSetById( + ConstHandle2GaugeBosons self, + const char *const id, + ConstHandle2ConstGaugeBoson gaugeBoson +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/GaugeBosons/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBosons/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBosons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBosons/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GaugeBosons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GeneralEvaporation.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GeneralEvaporation.cpp new file mode 100644 index 000000000..f4ef2c139 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GeneralEvaporation.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/GeneralEvaporation.hpp" +#include "GeneralEvaporation.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = GeneralEvaporationClass; +using CPP = multigroup::GeneralEvaporation; + +static const std::string CLASSNAME = "GeneralEvaporation"; + +namespace extract { + static auto U = [](auto &obj) { return &obj.U; }; + static auto theta = [](auto &obj) { return &obj.theta; }; + static auto g = [](auto &obj) { return &obj.g; }; +} + +using CPPU = general::U; +using CPPTheta = general::Theta; +using CPPG = general::G; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGeneralEvaporation +GeneralEvaporationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2GeneralEvaporation +GeneralEvaporationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGeneralEvaporation +GeneralEvaporationCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta, + ConstHandle2ConstG g +) { + ConstHandle2GeneralEvaporation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(U), + detail::tocpp(theta), + detail::tocpp(g) + ); + return handle; +} + +// Create, general, non-const +Handle2GeneralEvaporation +GeneralEvaporationCreate( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta, + ConstHandle2ConstG g +) { + ConstHandle2GeneralEvaporation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(U), + detail::tocpp(theta), + detail::tocpp(g) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +GeneralEvaporationAssign(ConstHandle2GeneralEvaporation self, ConstHandle2ConstGeneralEvaporation from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +GeneralEvaporationDelete(ConstHandle2ConstGeneralEvaporation self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +GeneralEvaporationRead(ConstHandle2GeneralEvaporation self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +GeneralEvaporationWrite(ConstHandle2ConstGeneralEvaporation self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +GeneralEvaporationPrint(ConstHandle2ConstGeneralEvaporation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +GeneralEvaporationPrintXML(ConstHandle2ConstGeneralEvaporation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +GeneralEvaporationPrintJSON(ConstHandle2ConstGeneralEvaporation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: U +// ----------------------------------------------------------------------------- + +// Has +int +GeneralEvaporationUHas(ConstHandle2ConstGeneralEvaporation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UHas", self, extract::U); +} + +// Get, const +Handle2ConstU +GeneralEvaporationUGetConst(ConstHandle2ConstGeneralEvaporation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UGetConst", self, extract::U); +} + +// Get, non-const +Handle2U +GeneralEvaporationUGet(ConstHandle2GeneralEvaporation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UGet", self, extract::U); +} + +// Set +void +GeneralEvaporationUSet(ConstHandle2GeneralEvaporation self, ConstHandle2ConstU U) +{ + detail::setField + (CLASSNAME, CLASSNAME+"USet", self, extract::U, U); +} + + +// ----------------------------------------------------------------------------- +// Child: theta +// ----------------------------------------------------------------------------- + +// Has +int +GeneralEvaporationThetaHas(ConstHandle2ConstGeneralEvaporation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ThetaHas", self, extract::theta); +} + +// Get, const +Handle2ConstTheta +GeneralEvaporationThetaGetConst(ConstHandle2ConstGeneralEvaporation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThetaGetConst", self, extract::theta); +} + +// Get, non-const +Handle2Theta +GeneralEvaporationThetaGet(ConstHandle2GeneralEvaporation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThetaGet", self, extract::theta); +} + +// Set +void +GeneralEvaporationThetaSet(ConstHandle2GeneralEvaporation self, ConstHandle2ConstTheta theta) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ThetaSet", self, extract::theta, theta); +} + + +// ----------------------------------------------------------------------------- +// Child: g +// ----------------------------------------------------------------------------- + +// Has +int +GeneralEvaporationGHas(ConstHandle2ConstGeneralEvaporation self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GHas", self, extract::g); +} + +// Get, const +Handle2ConstG +GeneralEvaporationGGetConst(ConstHandle2ConstGeneralEvaporation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GGetConst", self, extract::g); +} + +// Get, non-const +Handle2G +GeneralEvaporationGGet(ConstHandle2GeneralEvaporation self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GGet", self, extract::g); +} + +// Set +void +GeneralEvaporationGSet(ConstHandle2GeneralEvaporation self, ConstHandle2ConstG g) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GSet", self, extract::g, g); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/GeneralEvaporation/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GeneralEvaporation.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GeneralEvaporation.h new file mode 100644 index 000000000..93a1a9a05 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GeneralEvaporation.h @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// GeneralEvaporation is the basic handle type in this file. Example: +// // Create a default GeneralEvaporation object: +// GeneralEvaporation handle = GeneralEvaporationDefault(); +// Functions involving GeneralEvaporation are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_GENERALEVAPORATION +#define C_INTERFACE_GNDS_V2_0_GENERAL_GENERALEVAPORATION + +#include "GNDStk.h" +#include "v2.0/general/U.h" +#include "v2.0/general/Theta.h" +#include "v2.0/general/G.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct GeneralEvaporationClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ GeneralEvaporation +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct GeneralEvaporationClass *GeneralEvaporation; + +// --- Const-aware handles. +typedef const struct GeneralEvaporationClass *const ConstHandle2ConstGeneralEvaporation; +typedef struct GeneralEvaporationClass *const ConstHandle2GeneralEvaporation; +typedef const struct GeneralEvaporationClass * Handle2ConstGeneralEvaporation; +typedef struct GeneralEvaporationClass * Handle2GeneralEvaporation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstGeneralEvaporation +GeneralEvaporationDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2GeneralEvaporation +GeneralEvaporationDefault(); + +// --- Create, general, const +extern_c Handle2ConstGeneralEvaporation +GeneralEvaporationCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta, + ConstHandle2ConstG g +); + +// +++ Create, general, non-const +extern_c Handle2GeneralEvaporation +GeneralEvaporationCreate( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta, + ConstHandle2ConstG g +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +GeneralEvaporationAssign(ConstHandle2GeneralEvaporation self, ConstHandle2ConstGeneralEvaporation from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +GeneralEvaporationDelete(ConstHandle2ConstGeneralEvaporation self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +GeneralEvaporationRead(ConstHandle2GeneralEvaporation self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +GeneralEvaporationWrite(ConstHandle2ConstGeneralEvaporation self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +GeneralEvaporationPrint(ConstHandle2ConstGeneralEvaporation self); + +// +++ Print to standard output, as XML +extern_c int +GeneralEvaporationPrintXML(ConstHandle2ConstGeneralEvaporation self); + +// +++ Print to standard output, as JSON +extern_c int +GeneralEvaporationPrintJSON(ConstHandle2ConstGeneralEvaporation self); + + +// ----------------------------------------------------------------------------- +// Child: U +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GeneralEvaporationUHas(ConstHandle2ConstGeneralEvaporation self); + +// --- Get, const +extern_c Handle2ConstU +GeneralEvaporationUGetConst(ConstHandle2ConstGeneralEvaporation self); + +// +++ Get, non-const +extern_c Handle2U +GeneralEvaporationUGet(ConstHandle2GeneralEvaporation self); + +// +++ Set +extern_c void +GeneralEvaporationUSet(ConstHandle2GeneralEvaporation self, ConstHandle2ConstU U); + + +// ----------------------------------------------------------------------------- +// Child: theta +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GeneralEvaporationThetaHas(ConstHandle2ConstGeneralEvaporation self); + +// --- Get, const +extern_c Handle2ConstTheta +GeneralEvaporationThetaGetConst(ConstHandle2ConstGeneralEvaporation self); + +// +++ Get, non-const +extern_c Handle2Theta +GeneralEvaporationThetaGet(ConstHandle2GeneralEvaporation self); + +// +++ Set +extern_c void +GeneralEvaporationThetaSet(ConstHandle2GeneralEvaporation self, ConstHandle2ConstTheta theta); + + +// ----------------------------------------------------------------------------- +// Child: g +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GeneralEvaporationGHas(ConstHandle2ConstGeneralEvaporation self); + +// --- Get, const +extern_c Handle2ConstG +GeneralEvaporationGGetConst(ConstHandle2ConstGeneralEvaporation self); + +// +++ Get, non-const +extern_c Handle2G +GeneralEvaporationGGet(ConstHandle2GeneralEvaporation self); + +// +++ Set +extern_c void +GeneralEvaporationGSet(ConstHandle2GeneralEvaporation self, ConstHandle2ConstG g); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/GeneralEvaporation/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GeneralEvaporation/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GeneralEvaporation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GeneralEvaporation/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/GeneralEvaporation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Grid.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Grid.cpp new file mode 100644 index 000000000..366e0ffc5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Grid.cpp @@ -0,0 +1,399 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Grid.hpp" +#include "Grid.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = GridClass; +using CPP = multigroup::Grid; + +static const std::string CLASSNAME = "Grid"; + +namespace extract { + static auto index = [](auto &obj) { return &obj.index; }; + static auto label = [](auto &obj) { return &obj.label; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto style = [](auto &obj) { return &obj.style; }; + static auto interpolation = [](auto &obj) { return &obj.interpolation; }; + static auto link = [](auto &obj) { return &obj.link; }; + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPLink = general::Link; +using CPPValues = general::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGrid +GridDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Grid +GridDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGrid +GridCreateConst( + const int index, + const char *const label, + const char *const unit, + const char *const style, + const char *const interpolation, + ConstHandle2ConstLink link, + ConstHandle2ConstValues values +) { + ConstHandle2Grid handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + label, + unit, + style, + interpolation, + detail::tocpp(link), + detail::tocpp(values) + ); + return handle; +} + +// Create, general, non-const +Handle2Grid +GridCreate( + const int index, + const char *const label, + const char *const unit, + const char *const style, + const char *const interpolation, + ConstHandle2ConstLink link, + ConstHandle2ConstValues values +) { + ConstHandle2Grid handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + index, + label, + unit, + style, + interpolation, + detail::tocpp(link), + detail::tocpp(values) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +GridAssign(ConstHandle2Grid self, ConstHandle2ConstGrid from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +GridDelete(ConstHandle2ConstGrid self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +GridRead(ConstHandle2Grid self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +GridWrite(ConstHandle2ConstGrid self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +GridPrint(ConstHandle2ConstGrid self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +GridPrintXML(ConstHandle2ConstGrid self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +GridPrintJSON(ConstHandle2ConstGrid self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// Has +int +GridIndexHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IndexHas", self, extract::index); +} + +// Get +// Returns by value +int +GridIndexGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +GridIndexSet(ConstHandle2Grid self, const int index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +GridLabelHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +GridLabelGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +GridLabelSet(ConstHandle2Grid self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +GridUnitHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +GridUnitGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +GridUnitSet(ConstHandle2Grid self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: style +// ----------------------------------------------------------------------------- + +// Has +int +GridStyleHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StyleHas", self, extract::style); +} + +// Get +// Returns by value +const char * +GridStyleGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StyleGet", self, extract::style); +} + +// Set +void +GridStyleSet(ConstHandle2Grid self, const char *const style) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StyleSet", self, extract::style, style); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// Has +int +GridInterpolationHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InterpolationHas", self, extract::interpolation); +} + +// Get +// Returns by value +const char * +GridInterpolationGet(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationGet", self, extract::interpolation); +} + +// Set +void +GridInterpolationSet(ConstHandle2Grid self, const char *const interpolation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InterpolationSet", self, extract::interpolation, interpolation); +} + + +// ----------------------------------------------------------------------------- +// Child: link +// ----------------------------------------------------------------------------- + +// Has +int +GridLinkHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LinkHas", self, extract::link); +} + +// Get, const +Handle2ConstLink +GridLinkGetConst(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LinkGetConst", self, extract::link); +} + +// Get, non-const +Handle2Link +GridLinkGet(ConstHandle2Grid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LinkGet", self, extract::link); +} + +// Set +void +GridLinkSet(ConstHandle2Grid self, ConstHandle2ConstLink link) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LinkSet", self, extract::link, link); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +GridValuesHas(ConstHandle2ConstGrid self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +GridValuesGetConst(ConstHandle2ConstGrid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +GridValuesGet(ConstHandle2Grid self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +GridValuesSet(ConstHandle2Grid self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Grid/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Grid.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Grid.h new file mode 100644 index 000000000..19f233311 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Grid.h @@ -0,0 +1,285 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Grid is the basic handle type in this file. Example: +// // Create a default Grid object: +// Grid handle = GridDefault(); +// Functions involving Grid are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_GRID +#define C_INTERFACE_GNDS_V2_0_GENERAL_GRID + +#include "GNDStk.h" +#include "v2.0/general/Link.h" +#include "v2.0/general/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct GridClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Grid +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct GridClass *Grid; + +// --- Const-aware handles. +typedef const struct GridClass *const ConstHandle2ConstGrid; +typedef struct GridClass *const ConstHandle2Grid; +typedef const struct GridClass * Handle2ConstGrid; +typedef struct GridClass * Handle2Grid; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstGrid +GridDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Grid +GridDefault(); + +// --- Create, general, const +extern_c Handle2ConstGrid +GridCreateConst( + const int index, + const char *const label, + const char *const unit, + const char *const style, + const char *const interpolation, + ConstHandle2ConstLink link, + ConstHandle2ConstValues values +); + +// +++ Create, general, non-const +extern_c Handle2Grid +GridCreate( + const int index, + const char *const label, + const char *const unit, + const char *const style, + const char *const interpolation, + ConstHandle2ConstLink link, + ConstHandle2ConstValues values +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +GridAssign(ConstHandle2Grid self, ConstHandle2ConstGrid from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +GridDelete(ConstHandle2ConstGrid self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +GridRead(ConstHandle2Grid self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +GridWrite(ConstHandle2ConstGrid self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +GridPrint(ConstHandle2ConstGrid self); + +// +++ Print to standard output, as XML +extern_c int +GridPrintXML(ConstHandle2ConstGrid self); + +// +++ Print to standard output, as JSON +extern_c int +GridPrintJSON(ConstHandle2ConstGrid self); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridIndexHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c int +GridIndexGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridIndexSet(ConstHandle2Grid self, const int index); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridLabelHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c const char * +GridLabelGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridLabelSet(ConstHandle2Grid self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridUnitHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c const char * +GridUnitGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridUnitSet(ConstHandle2Grid self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Metadatum: style +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridStyleHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c const char * +GridStyleGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridStyleSet(ConstHandle2Grid self, const char *const style); + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridInterpolationHas(ConstHandle2ConstGrid self); + +// +++ Get +// +++ Returns by value +extern_c const char * +GridInterpolationGet(ConstHandle2ConstGrid self); + +// +++ Set +extern_c void +GridInterpolationSet(ConstHandle2Grid self, const char *const interpolation); + + +// ----------------------------------------------------------------------------- +// Child: link +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridLinkHas(ConstHandle2ConstGrid self); + +// --- Get, const +extern_c Handle2ConstLink +GridLinkGetConst(ConstHandle2ConstGrid self); + +// +++ Get, non-const +extern_c Handle2Link +GridLinkGet(ConstHandle2Grid self); + +// +++ Set +extern_c void +GridLinkSet(ConstHandle2Grid self, ConstHandle2ConstLink link); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +GridValuesHas(ConstHandle2ConstGrid self); + +// --- Get, const +extern_c Handle2ConstValues +GridValuesGetConst(ConstHandle2ConstGrid self); + +// +++ Get, non-const +extern_c Handle2Values +GridValuesGet(ConstHandle2Grid self); + +// +++ Set +extern_c void +GridValuesSet(ConstHandle2Grid self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Grid/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Grid/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Grid/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Grid/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Grid/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded2d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded2d.cpp new file mode 100644 index 000000000..0c77e9ae4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded2d.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Gridded2d.hpp" +#include "Gridded2d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Gridded2dClass; +using CPP = multigroup::Gridded2d; + +static const std::string CLASSNAME = "Gridded2d"; + +namespace extract { + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto array = [](auto &obj) { return &obj.array; }; +} + +using CPPAxes = general::Axes; +using CPPArray = g2d::Array; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGridded2d +Gridded2dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Gridded2d +Gridded2dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGridded2d +Gridded2dCreateConst( + ConstHandle2ConstAxes axes, + ConstHandle2ConstArray array +) { + ConstHandle2Gridded2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(axes), + detail::tocpp(array) + ); + return handle; +} + +// Create, general, non-const +Handle2Gridded2d +Gridded2dCreate( + ConstHandle2ConstAxes axes, + ConstHandle2ConstArray array +) { + ConstHandle2Gridded2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(axes), + detail::tocpp(array) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Gridded2dAssign(ConstHandle2Gridded2d self, ConstHandle2ConstGridded2d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Gridded2dDelete(ConstHandle2ConstGridded2d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Gridded2dRead(ConstHandle2Gridded2d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Gridded2dWrite(ConstHandle2ConstGridded2d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Gridded2dPrint(ConstHandle2ConstGridded2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Gridded2dPrintXML(ConstHandle2ConstGridded2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Gridded2dPrintJSON(ConstHandle2ConstGridded2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +Gridded2dAxesHas(ConstHandle2ConstGridded2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +Gridded2dAxesGetConst(ConstHandle2ConstGridded2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +Gridded2dAxesGet(ConstHandle2Gridded2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +Gridded2dAxesSet(ConstHandle2Gridded2d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// Has +int +Gridded2dArrayHas(ConstHandle2ConstGridded2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ArrayHas", self, extract::array); +} + +// Get, const +Handle2ConstArray +Gridded2dArrayGetConst(ConstHandle2ConstGridded2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGetConst", self, extract::array); +} + +// Get, non-const +Handle2Array +Gridded2dArrayGet(ConstHandle2Gridded2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGet", self, extract::array); +} + +// Set +void +Gridded2dArraySet(ConstHandle2Gridded2d self, ConstHandle2ConstArray array) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ArraySet", self, extract::array, array); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Gridded2d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded2d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded2d.h new file mode 100644 index 000000000..a1dfa971c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded2d.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Gridded2d is the basic handle type in this file. Example: +// // Create a default Gridded2d object: +// Gridded2d handle = Gridded2dDefault(); +// Functions involving Gridded2d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_GRIDDED2D +#define C_INTERFACE_GNDS_V2_0_GENERAL_GRIDDED2D + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" +#include "v2.0/g2d/Array.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Gridded2dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Gridded2d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Gridded2dClass *Gridded2d; + +// --- Const-aware handles. +typedef const struct Gridded2dClass *const ConstHandle2ConstGridded2d; +typedef struct Gridded2dClass *const ConstHandle2Gridded2d; +typedef const struct Gridded2dClass * Handle2ConstGridded2d; +typedef struct Gridded2dClass * Handle2Gridded2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstGridded2d +Gridded2dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Gridded2d +Gridded2dDefault(); + +// --- Create, general, const +extern_c Handle2ConstGridded2d +Gridded2dCreateConst( + ConstHandle2ConstAxes axes, + ConstHandle2ConstArray array +); + +// +++ Create, general, non-const +extern_c Handle2Gridded2d +Gridded2dCreate( + ConstHandle2ConstAxes axes, + ConstHandle2ConstArray array +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Gridded2dAssign(ConstHandle2Gridded2d self, ConstHandle2ConstGridded2d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Gridded2dDelete(ConstHandle2ConstGridded2d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Gridded2dRead(ConstHandle2Gridded2d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Gridded2dWrite(ConstHandle2ConstGridded2d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Gridded2dPrint(ConstHandle2ConstGridded2d self); + +// +++ Print to standard output, as XML +extern_c int +Gridded2dPrintXML(ConstHandle2ConstGridded2d self); + +// +++ Print to standard output, as JSON +extern_c int +Gridded2dPrintJSON(ConstHandle2ConstGridded2d self); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Gridded2dAxesHas(ConstHandle2ConstGridded2d self); + +// --- Get, const +extern_c Handle2ConstAxes +Gridded2dAxesGetConst(ConstHandle2ConstGridded2d self); + +// +++ Get, non-const +extern_c Handle2Axes +Gridded2dAxesGet(ConstHandle2Gridded2d self); + +// +++ Set +extern_c void +Gridded2dAxesSet(ConstHandle2Gridded2d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Gridded2dArrayHas(ConstHandle2ConstGridded2d self); + +// --- Get, const +extern_c Handle2ConstArray +Gridded2dArrayGetConst(ConstHandle2ConstGridded2d self); + +// +++ Get, non-const +extern_c Handle2Array +Gridded2dArrayGet(ConstHandle2Gridded2d self); + +// +++ Set +extern_c void +Gridded2dArraySet(ConstHandle2Gridded2d self, ConstHandle2ConstArray array); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Gridded2d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded2d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded2d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded3d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded3d.cpp new file mode 100644 index 000000000..505f554d1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded3d.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Gridded3d.hpp" +#include "Gridded3d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Gridded3dClass; +using CPP = multigroup::Gridded3d; + +static const std::string CLASSNAME = "Gridded3d"; + +namespace extract { + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto array = [](auto &obj) { return &obj.array; }; +} + +using CPPAxes = general::Axes; +using CPPArray = g3d::Array; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstGridded3d +Gridded3dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Gridded3d +Gridded3dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstGridded3d +Gridded3dCreateConst( + ConstHandle2ConstAxes axes, + ConstHandle2ConstArray array +) { + ConstHandle2Gridded3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(axes), + detail::tocpp(array) + ); + return handle; +} + +// Create, general, non-const +Handle2Gridded3d +Gridded3dCreate( + ConstHandle2ConstAxes axes, + ConstHandle2ConstArray array +) { + ConstHandle2Gridded3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(axes), + detail::tocpp(array) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Gridded3dAssign(ConstHandle2Gridded3d self, ConstHandle2ConstGridded3d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Gridded3dDelete(ConstHandle2ConstGridded3d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Gridded3dRead(ConstHandle2Gridded3d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Gridded3dWrite(ConstHandle2ConstGridded3d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Gridded3dPrint(ConstHandle2ConstGridded3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Gridded3dPrintXML(ConstHandle2ConstGridded3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Gridded3dPrintJSON(ConstHandle2ConstGridded3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +Gridded3dAxesHas(ConstHandle2ConstGridded3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +Gridded3dAxesGetConst(ConstHandle2ConstGridded3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +Gridded3dAxesGet(ConstHandle2Gridded3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +Gridded3dAxesSet(ConstHandle2Gridded3d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// Has +int +Gridded3dArrayHas(ConstHandle2ConstGridded3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ArrayHas", self, extract::array); +} + +// Get, const +Handle2ConstArray +Gridded3dArrayGetConst(ConstHandle2ConstGridded3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGetConst", self, extract::array); +} + +// Get, non-const +Handle2Array +Gridded3dArrayGet(ConstHandle2Gridded3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGet", self, extract::array); +} + +// Set +void +Gridded3dArraySet(ConstHandle2Gridded3d self, ConstHandle2ConstArray array) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ArraySet", self, extract::array, array); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Gridded3d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded3d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded3d.h new file mode 100644 index 000000000..ad8311f89 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded3d.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Gridded3d is the basic handle type in this file. Example: +// // Create a default Gridded3d object: +// Gridded3d handle = Gridded3dDefault(); +// Functions involving Gridded3d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_GRIDDED3D +#define C_INTERFACE_GNDS_V2_0_GENERAL_GRIDDED3D + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" +#include "v2.0/g3d/Array.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Gridded3dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Gridded3d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Gridded3dClass *Gridded3d; + +// --- Const-aware handles. +typedef const struct Gridded3dClass *const ConstHandle2ConstGridded3d; +typedef struct Gridded3dClass *const ConstHandle2Gridded3d; +typedef const struct Gridded3dClass * Handle2ConstGridded3d; +typedef struct Gridded3dClass * Handle2Gridded3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstGridded3d +Gridded3dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Gridded3d +Gridded3dDefault(); + +// --- Create, general, const +extern_c Handle2ConstGridded3d +Gridded3dCreateConst( + ConstHandle2ConstAxes axes, + ConstHandle2ConstArray array +); + +// +++ Create, general, non-const +extern_c Handle2Gridded3d +Gridded3dCreate( + ConstHandle2ConstAxes axes, + ConstHandle2ConstArray array +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Gridded3dAssign(ConstHandle2Gridded3d self, ConstHandle2ConstGridded3d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Gridded3dDelete(ConstHandle2ConstGridded3d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Gridded3dRead(ConstHandle2Gridded3d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Gridded3dWrite(ConstHandle2ConstGridded3d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Gridded3dPrint(ConstHandle2ConstGridded3d self); + +// +++ Print to standard output, as XML +extern_c int +Gridded3dPrintXML(ConstHandle2ConstGridded3d self); + +// +++ Print to standard output, as JSON +extern_c int +Gridded3dPrintJSON(ConstHandle2ConstGridded3d self); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Gridded3dAxesHas(ConstHandle2ConstGridded3d self); + +// --- Get, const +extern_c Handle2ConstAxes +Gridded3dAxesGetConst(ConstHandle2ConstGridded3d self); + +// +++ Get, non-const +extern_c Handle2Axes +Gridded3dAxesGet(ConstHandle2Gridded3d self); + +// +++ Set +extern_c void +Gridded3dAxesSet(ConstHandle2Gridded3d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Gridded3dArrayHas(ConstHandle2ConstGridded3d self); + +// --- Get, const +extern_c Handle2ConstArray +Gridded3dArrayGetConst(ConstHandle2ConstGridded3d self); + +// +++ Get, non-const +extern_c Handle2Array +Gridded3dArrayGet(ConstHandle2Gridded3d self); + +// +++ Set +extern_c void +Gridded3dArraySet(ConstHandle2Gridded3d self, ConstHandle2ConstArray array); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Gridded3d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded3d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded3d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Gridded3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Halflife.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Halflife.cpp new file mode 100644 index 000000000..00cb3b22e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Halflife.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Halflife.hpp" +#include "Halflife.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = HalflifeClass; +using CPP = multigroup::Halflife; + +static const std::string CLASSNAME = "Halflife"; + +namespace extract { + static auto string = [](auto &obj) { return &obj.string; }; + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPString = general::String; +using CPPDouble = general::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstHalflife +HalflifeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Halflife +HalflifeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstHalflife +HalflifeCreateConst( + ConstHandle2ConstString string, + ConstHandle2ConstDouble Double +) { + ConstHandle2Halflife handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(string), + detail::tocpp(Double) + ); + return handle; +} + +// Create, general, non-const +Handle2Halflife +HalflifeCreate( + ConstHandle2ConstString string, + ConstHandle2ConstDouble Double +) { + ConstHandle2Halflife handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(string), + detail::tocpp(Double) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +HalflifeAssign(ConstHandle2Halflife self, ConstHandle2ConstHalflife from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +HalflifeDelete(ConstHandle2ConstHalflife self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +HalflifeRead(ConstHandle2Halflife self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +HalflifeWrite(ConstHandle2ConstHalflife self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +HalflifePrint(ConstHandle2ConstHalflife self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +HalflifePrintXML(ConstHandle2ConstHalflife self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +HalflifePrintJSON(ConstHandle2ConstHalflife self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: string +// ----------------------------------------------------------------------------- + +// Has +int +HalflifeStringHas(ConstHandle2ConstHalflife self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StringHas", self, extract::string); +} + +// Get, const +Handle2ConstString +HalflifeStringGetConst(ConstHandle2ConstHalflife self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StringGetConst", self, extract::string); +} + +// Get, non-const +Handle2String +HalflifeStringGet(ConstHandle2Halflife self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StringGet", self, extract::string); +} + +// Set +void +HalflifeStringSet(ConstHandle2Halflife self, ConstHandle2ConstString string) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StringSet", self, extract::string, string); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +HalflifeDoubleHas(ConstHandle2ConstHalflife self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Get, const +Handle2ConstDouble +HalflifeDoubleGetConst(ConstHandle2ConstHalflife self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double); +} + +// Get, non-const +Handle2Double +HalflifeDoubleGet(ConstHandle2Halflife self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double); +} + +// Set +void +HalflifeDoubleSet(ConstHandle2Halflife self, ConstHandle2ConstDouble Double) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Halflife/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Halflife.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Halflife.h new file mode 100644 index 000000000..43b9b1c6b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Halflife.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Halflife is the basic handle type in this file. Example: +// // Create a default Halflife object: +// Halflife handle = HalflifeDefault(); +// Functions involving Halflife are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_HALFLIFE +#define C_INTERFACE_GNDS_V2_0_GENERAL_HALFLIFE + +#include "GNDStk.h" +#include "v2.0/general/String.h" +#include "v2.0/general/Double.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct HalflifeClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Halflife +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct HalflifeClass *Halflife; + +// --- Const-aware handles. +typedef const struct HalflifeClass *const ConstHandle2ConstHalflife; +typedef struct HalflifeClass *const ConstHandle2Halflife; +typedef const struct HalflifeClass * Handle2ConstHalflife; +typedef struct HalflifeClass * Handle2Halflife; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstHalflife +HalflifeDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Halflife +HalflifeDefault(); + +// --- Create, general, const +extern_c Handle2ConstHalflife +HalflifeCreateConst( + ConstHandle2ConstString string, + ConstHandle2ConstDouble Double +); + +// +++ Create, general, non-const +extern_c Handle2Halflife +HalflifeCreate( + ConstHandle2ConstString string, + ConstHandle2ConstDouble Double +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +HalflifeAssign(ConstHandle2Halflife self, ConstHandle2ConstHalflife from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +HalflifeDelete(ConstHandle2ConstHalflife self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +HalflifeRead(ConstHandle2Halflife self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +HalflifeWrite(ConstHandle2ConstHalflife self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +HalflifePrint(ConstHandle2ConstHalflife self); + +// +++ Print to standard output, as XML +extern_c int +HalflifePrintXML(ConstHandle2ConstHalflife self); + +// +++ Print to standard output, as JSON +extern_c int +HalflifePrintJSON(ConstHandle2ConstHalflife self); + + +// ----------------------------------------------------------------------------- +// Child: string +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HalflifeStringHas(ConstHandle2ConstHalflife self); + +// --- Get, const +extern_c Handle2ConstString +HalflifeStringGetConst(ConstHandle2ConstHalflife self); + +// +++ Get, non-const +extern_c Handle2String +HalflifeStringGet(ConstHandle2Halflife self); + +// +++ Set +extern_c void +HalflifeStringSet(ConstHandle2Halflife self, ConstHandle2ConstString string); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HalflifeDoubleHas(ConstHandle2ConstHalflife self); + +// --- Get, const +extern_c Handle2ConstDouble +HalflifeDoubleGetConst(ConstHandle2ConstHalflife self); + +// +++ Get, non-const +extern_c Handle2Double +HalflifeDoubleGet(ConstHandle2Halflife self); + +// +++ Set +extern_c void +HalflifeDoubleSet(ConstHandle2Halflife self, ConstHandle2ConstDouble Double); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Halflife/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Halflife/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Halflife/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Halflife/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Halflife/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/HardSphereRadius.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/HardSphereRadius.cpp new file mode 100644 index 000000000..732d75b86 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/HardSphereRadius.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/HardSphereRadius.hpp" +#include "HardSphereRadius.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = HardSphereRadiusClass; +using CPP = multigroup::HardSphereRadius; + +static const std::string CLASSNAME = "HardSphereRadius"; + +namespace extract { + static auto constant1d = [](auto &obj) { return &obj.constant1d; }; +} + +using CPPConstant1d = general::Constant1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstHardSphereRadius +HardSphereRadiusDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2HardSphereRadius +HardSphereRadiusDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstHardSphereRadius +HardSphereRadiusCreateConst( + ConstHandle2ConstConstant1d constant1d +) { + ConstHandle2HardSphereRadius handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(constant1d) + ); + return handle; +} + +// Create, general, non-const +Handle2HardSphereRadius +HardSphereRadiusCreate( + ConstHandle2ConstConstant1d constant1d +) { + ConstHandle2HardSphereRadius handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(constant1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +HardSphereRadiusAssign(ConstHandle2HardSphereRadius self, ConstHandle2ConstHardSphereRadius from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +HardSphereRadiusDelete(ConstHandle2ConstHardSphereRadius self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +HardSphereRadiusRead(ConstHandle2HardSphereRadius self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +HardSphereRadiusWrite(ConstHandle2ConstHardSphereRadius self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +HardSphereRadiusPrint(ConstHandle2ConstHardSphereRadius self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +HardSphereRadiusPrintXML(ConstHandle2ConstHardSphereRadius self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +HardSphereRadiusPrintJSON(ConstHandle2ConstHardSphereRadius self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// Has +int +HardSphereRadiusConstant1dHas(ConstHandle2ConstHardSphereRadius self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Constant1dHas", self, extract::constant1d); +} + +// Get, const +Handle2ConstConstant1d +HardSphereRadiusConstant1dGetConst(ConstHandle2ConstHardSphereRadius self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGetConst", self, extract::constant1d); +} + +// Get, non-const +Handle2Constant1d +HardSphereRadiusConstant1dGet(ConstHandle2HardSphereRadius self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGet", self, extract::constant1d); +} + +// Set +void +HardSphereRadiusConstant1dSet(ConstHandle2HardSphereRadius self, ConstHandle2ConstConstant1d constant1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Constant1dSet", self, extract::constant1d, constant1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/HardSphereRadius/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/HardSphereRadius.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/HardSphereRadius.h new file mode 100644 index 000000000..e2b124eb7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/HardSphereRadius.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// HardSphereRadius is the basic handle type in this file. Example: +// // Create a default HardSphereRadius object: +// HardSphereRadius handle = HardSphereRadiusDefault(); +// Functions involving HardSphereRadius are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_HARDSPHERERADIUS +#define C_INTERFACE_GNDS_V2_0_GENERAL_HARDSPHERERADIUS + +#include "GNDStk.h" +#include "v2.0/general/Constant1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct HardSphereRadiusClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ HardSphereRadius +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct HardSphereRadiusClass *HardSphereRadius; + +// --- Const-aware handles. +typedef const struct HardSphereRadiusClass *const ConstHandle2ConstHardSphereRadius; +typedef struct HardSphereRadiusClass *const ConstHandle2HardSphereRadius; +typedef const struct HardSphereRadiusClass * Handle2ConstHardSphereRadius; +typedef struct HardSphereRadiusClass * Handle2HardSphereRadius; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstHardSphereRadius +HardSphereRadiusDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2HardSphereRadius +HardSphereRadiusDefault(); + +// --- Create, general, const +extern_c Handle2ConstHardSphereRadius +HardSphereRadiusCreateConst( + ConstHandle2ConstConstant1d constant1d +); + +// +++ Create, general, non-const +extern_c Handle2HardSphereRadius +HardSphereRadiusCreate( + ConstHandle2ConstConstant1d constant1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +HardSphereRadiusAssign(ConstHandle2HardSphereRadius self, ConstHandle2ConstHardSphereRadius from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +HardSphereRadiusDelete(ConstHandle2ConstHardSphereRadius self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +HardSphereRadiusRead(ConstHandle2HardSphereRadius self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +HardSphereRadiusWrite(ConstHandle2ConstHardSphereRadius self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +HardSphereRadiusPrint(ConstHandle2ConstHardSphereRadius self); + +// +++ Print to standard output, as XML +extern_c int +HardSphereRadiusPrintXML(ConstHandle2ConstHardSphereRadius self); + +// +++ Print to standard output, as JSON +extern_c int +HardSphereRadiusPrintJSON(ConstHandle2ConstHardSphereRadius self); + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +HardSphereRadiusConstant1dHas(ConstHandle2ConstHardSphereRadius self); + +// --- Get, const +extern_c Handle2ConstConstant1d +HardSphereRadiusConstant1dGetConst(ConstHandle2ConstHardSphereRadius self); + +// +++ Get, non-const +extern_c Handle2Constant1d +HardSphereRadiusConstant1dGet(ConstHandle2HardSphereRadius self); + +// +++ Set +extern_c void +HardSphereRadiusConstant1dSet(ConstHandle2HardSphereRadius self, ConstHandle2ConstConstant1d constant1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/HardSphereRadius/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/HardSphereRadius/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/HardSphereRadius/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/HardSphereRadius/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/HardSphereRadius/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryAnomalousFactor.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryAnomalousFactor.cpp new file mode 100644 index 000000000..535caec4e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryAnomalousFactor.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ImaginaryAnomalousFactor.hpp" +#include "ImaginaryAnomalousFactor.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ImaginaryAnomalousFactorClass; +using CPP = multigroup::ImaginaryAnomalousFactor; + +static const std::string CLASSNAME = "ImaginaryAnomalousFactor"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstImaginaryAnomalousFactor +ImaginaryAnomalousFactorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ImaginaryAnomalousFactor +ImaginaryAnomalousFactorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstImaginaryAnomalousFactor +ImaginaryAnomalousFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2ImaginaryAnomalousFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2ImaginaryAnomalousFactor +ImaginaryAnomalousFactorCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2ImaginaryAnomalousFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ImaginaryAnomalousFactorAssign(ConstHandle2ImaginaryAnomalousFactor self, ConstHandle2ConstImaginaryAnomalousFactor from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ImaginaryAnomalousFactorDelete(ConstHandle2ConstImaginaryAnomalousFactor self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ImaginaryAnomalousFactorRead(ConstHandle2ImaginaryAnomalousFactor self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ImaginaryAnomalousFactorWrite(ConstHandle2ConstImaginaryAnomalousFactor self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ImaginaryAnomalousFactorPrint(ConstHandle2ConstImaginaryAnomalousFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ImaginaryAnomalousFactorPrintXML(ConstHandle2ConstImaginaryAnomalousFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ImaginaryAnomalousFactorPrintJSON(ConstHandle2ConstImaginaryAnomalousFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +ImaginaryAnomalousFactorXYs1dHas(ConstHandle2ConstImaginaryAnomalousFactor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +ImaginaryAnomalousFactorXYs1dGetConst(ConstHandle2ConstImaginaryAnomalousFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +ImaginaryAnomalousFactorXYs1dGet(ConstHandle2ImaginaryAnomalousFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +ImaginaryAnomalousFactorXYs1dSet(ConstHandle2ImaginaryAnomalousFactor self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ImaginaryAnomalousFactor/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryAnomalousFactor.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryAnomalousFactor.h new file mode 100644 index 000000000..23e34f947 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryAnomalousFactor.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ImaginaryAnomalousFactor is the basic handle type in this file. Example: +// // Create a default ImaginaryAnomalousFactor object: +// ImaginaryAnomalousFactor handle = ImaginaryAnomalousFactorDefault(); +// Functions involving ImaginaryAnomalousFactor are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_IMAGINARYANOMALOUSFACTOR +#define C_INTERFACE_GNDS_V2_0_GENERAL_IMAGINARYANOMALOUSFACTOR + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ImaginaryAnomalousFactorClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ImaginaryAnomalousFactor +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ImaginaryAnomalousFactorClass *ImaginaryAnomalousFactor; + +// --- Const-aware handles. +typedef const struct ImaginaryAnomalousFactorClass *const ConstHandle2ConstImaginaryAnomalousFactor; +typedef struct ImaginaryAnomalousFactorClass *const ConstHandle2ImaginaryAnomalousFactor; +typedef const struct ImaginaryAnomalousFactorClass * Handle2ConstImaginaryAnomalousFactor; +typedef struct ImaginaryAnomalousFactorClass * Handle2ImaginaryAnomalousFactor; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstImaginaryAnomalousFactor +ImaginaryAnomalousFactorDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ImaginaryAnomalousFactor +ImaginaryAnomalousFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstImaginaryAnomalousFactor +ImaginaryAnomalousFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2ImaginaryAnomalousFactor +ImaginaryAnomalousFactorCreate( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ImaginaryAnomalousFactorAssign(ConstHandle2ImaginaryAnomalousFactor self, ConstHandle2ConstImaginaryAnomalousFactor from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ImaginaryAnomalousFactorDelete(ConstHandle2ConstImaginaryAnomalousFactor self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ImaginaryAnomalousFactorRead(ConstHandle2ImaginaryAnomalousFactor self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ImaginaryAnomalousFactorWrite(ConstHandle2ConstImaginaryAnomalousFactor self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ImaginaryAnomalousFactorPrint(ConstHandle2ConstImaginaryAnomalousFactor self); + +// +++ Print to standard output, as XML +extern_c int +ImaginaryAnomalousFactorPrintXML(ConstHandle2ConstImaginaryAnomalousFactor self); + +// +++ Print to standard output, as JSON +extern_c int +ImaginaryAnomalousFactorPrintJSON(ConstHandle2ConstImaginaryAnomalousFactor self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ImaginaryAnomalousFactorXYs1dHas(ConstHandle2ConstImaginaryAnomalousFactor self); + +// --- Get, const +extern_c Handle2ConstXYs1d +ImaginaryAnomalousFactorXYs1dGetConst(ConstHandle2ConstImaginaryAnomalousFactor self); + +// +++ Get, non-const +extern_c Handle2XYs1d +ImaginaryAnomalousFactorXYs1dGet(ConstHandle2ImaginaryAnomalousFactor self); + +// +++ Set +extern_c void +ImaginaryAnomalousFactorXYs1dSet(ConstHandle2ImaginaryAnomalousFactor self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ImaginaryAnomalousFactor/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryAnomalousFactor/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryAnomalousFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryAnomalousFactor/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryAnomalousFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryInterferenceTerm.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryInterferenceTerm.cpp new file mode 100644 index 000000000..0b7e052eb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryInterferenceTerm.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ImaginaryInterferenceTerm.hpp" +#include "ImaginaryInterferenceTerm.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ImaginaryInterferenceTermClass; +using CPP = multigroup::ImaginaryInterferenceTerm; + +static const std::string CLASSNAME = "ImaginaryInterferenceTerm"; + +namespace extract { + static auto regions2d = [](auto &obj) { return &obj.regions2d; }; + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; +} + +using CPPRegions2d = general::Regions2d; +using CPPXYs2d = general::XYs2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstImaginaryInterferenceTerm +ImaginaryInterferenceTermDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ImaginaryInterferenceTerm +ImaginaryInterferenceTermDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstImaginaryInterferenceTerm +ImaginaryInterferenceTermCreateConst( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2ImaginaryInterferenceTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(regions2d), + detail::tocpp(XYs2d) + ); + return handle; +} + +// Create, general, non-const +Handle2ImaginaryInterferenceTerm +ImaginaryInterferenceTermCreate( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2ImaginaryInterferenceTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(regions2d), + detail::tocpp(XYs2d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ImaginaryInterferenceTermAssign(ConstHandle2ImaginaryInterferenceTerm self, ConstHandle2ConstImaginaryInterferenceTerm from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ImaginaryInterferenceTermDelete(ConstHandle2ConstImaginaryInterferenceTerm self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ImaginaryInterferenceTermRead(ConstHandle2ImaginaryInterferenceTerm self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ImaginaryInterferenceTermWrite(ConstHandle2ConstImaginaryInterferenceTerm self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ImaginaryInterferenceTermPrint(ConstHandle2ConstImaginaryInterferenceTerm self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ImaginaryInterferenceTermPrintXML(ConstHandle2ConstImaginaryInterferenceTerm self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ImaginaryInterferenceTermPrintJSON(ConstHandle2ConstImaginaryInterferenceTerm self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: regions2d +// ----------------------------------------------------------------------------- + +// Has +int +ImaginaryInterferenceTermRegions2dHas(ConstHandle2ConstImaginaryInterferenceTerm self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions2dHas", self, extract::regions2d); +} + +// Get, const +Handle2ConstRegions2d +ImaginaryInterferenceTermRegions2dGetConst(ConstHandle2ConstImaginaryInterferenceTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions2dGetConst", self, extract::regions2d); +} + +// Get, non-const +Handle2Regions2d +ImaginaryInterferenceTermRegions2dGet(ConstHandle2ImaginaryInterferenceTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions2dGet", self, extract::regions2d); +} + +// Set +void +ImaginaryInterferenceTermRegions2dSet(ConstHandle2ImaginaryInterferenceTerm self, ConstHandle2ConstRegions2d regions2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions2dSet", self, extract::regions2d, regions2d); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +ImaginaryInterferenceTermXYs2dHas(ConstHandle2ConstImaginaryInterferenceTerm self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +ImaginaryInterferenceTermXYs2dGetConst(ConstHandle2ConstImaginaryInterferenceTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +ImaginaryInterferenceTermXYs2dGet(ConstHandle2ImaginaryInterferenceTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +ImaginaryInterferenceTermXYs2dSet(ConstHandle2ImaginaryInterferenceTerm self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ImaginaryInterferenceTerm/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryInterferenceTerm.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryInterferenceTerm.h new file mode 100644 index 000000000..7328c54b1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryInterferenceTerm.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ImaginaryInterferenceTerm is the basic handle type in this file. Example: +// // Create a default ImaginaryInterferenceTerm object: +// ImaginaryInterferenceTerm handle = ImaginaryInterferenceTermDefault(); +// Functions involving ImaginaryInterferenceTerm are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_IMAGINARYINTERFERENCETERM +#define C_INTERFACE_GNDS_V2_0_GENERAL_IMAGINARYINTERFERENCETERM + +#include "GNDStk.h" +#include "v2.0/general/Regions2d.h" +#include "v2.0/general/XYs2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ImaginaryInterferenceTermClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ImaginaryInterferenceTerm +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ImaginaryInterferenceTermClass *ImaginaryInterferenceTerm; + +// --- Const-aware handles. +typedef const struct ImaginaryInterferenceTermClass *const ConstHandle2ConstImaginaryInterferenceTerm; +typedef struct ImaginaryInterferenceTermClass *const ConstHandle2ImaginaryInterferenceTerm; +typedef const struct ImaginaryInterferenceTermClass * Handle2ConstImaginaryInterferenceTerm; +typedef struct ImaginaryInterferenceTermClass * Handle2ImaginaryInterferenceTerm; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstImaginaryInterferenceTerm +ImaginaryInterferenceTermDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ImaginaryInterferenceTerm +ImaginaryInterferenceTermDefault(); + +// --- Create, general, const +extern_c Handle2ConstImaginaryInterferenceTerm +ImaginaryInterferenceTermCreateConst( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general, non-const +extern_c Handle2ImaginaryInterferenceTerm +ImaginaryInterferenceTermCreate( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ImaginaryInterferenceTermAssign(ConstHandle2ImaginaryInterferenceTerm self, ConstHandle2ConstImaginaryInterferenceTerm from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ImaginaryInterferenceTermDelete(ConstHandle2ConstImaginaryInterferenceTerm self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ImaginaryInterferenceTermRead(ConstHandle2ImaginaryInterferenceTerm self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ImaginaryInterferenceTermWrite(ConstHandle2ConstImaginaryInterferenceTerm self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ImaginaryInterferenceTermPrint(ConstHandle2ConstImaginaryInterferenceTerm self); + +// +++ Print to standard output, as XML +extern_c int +ImaginaryInterferenceTermPrintXML(ConstHandle2ConstImaginaryInterferenceTerm self); + +// +++ Print to standard output, as JSON +extern_c int +ImaginaryInterferenceTermPrintJSON(ConstHandle2ConstImaginaryInterferenceTerm self); + + +// ----------------------------------------------------------------------------- +// Child: regions2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ImaginaryInterferenceTermRegions2dHas(ConstHandle2ConstImaginaryInterferenceTerm self); + +// --- Get, const +extern_c Handle2ConstRegions2d +ImaginaryInterferenceTermRegions2dGetConst(ConstHandle2ConstImaginaryInterferenceTerm self); + +// +++ Get, non-const +extern_c Handle2Regions2d +ImaginaryInterferenceTermRegions2dGet(ConstHandle2ImaginaryInterferenceTerm self); + +// +++ Set +extern_c void +ImaginaryInterferenceTermRegions2dSet(ConstHandle2ImaginaryInterferenceTerm self, ConstHandle2ConstRegions2d regions2d); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ImaginaryInterferenceTermXYs2dHas(ConstHandle2ConstImaginaryInterferenceTerm self); + +// --- Get, const +extern_c Handle2ConstXYs2d +ImaginaryInterferenceTermXYs2dGetConst(ConstHandle2ConstImaginaryInterferenceTerm self); + +// +++ Get, non-const +extern_c Handle2XYs2d +ImaginaryInterferenceTermXYs2dGet(ConstHandle2ImaginaryInterferenceTerm self); + +// +++ Set +extern_c void +ImaginaryInterferenceTermXYs2dSet(ConstHandle2ImaginaryInterferenceTerm self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ImaginaryInterferenceTerm/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryInterferenceTerm/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryInterferenceTerm/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryInterferenceTerm/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ImaginaryInterferenceTerm/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergies.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergies.cpp new file mode 100644 index 000000000..434b976d6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergies.cpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/IncidentEnergies.hpp" +#include "IncidentEnergies.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = IncidentEnergiesClass; +using CPP = multigroup::IncidentEnergies; + +static const std::string CLASSNAME = "IncidentEnergies"; + +namespace extract { + static auto incidentEnergy = [](auto &obj) { return &obj.incidentEnergy; }; +} + +using CPPIncidentEnergy = general::IncidentEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIncidentEnergies +IncidentEnergiesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2IncidentEnergies +IncidentEnergiesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIncidentEnergies +IncidentEnergiesCreateConst( + ConstHandle2IncidentEnergy *const incidentEnergy, const size_t incidentEnergySize +) { + ConstHandle2IncidentEnergies handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t IncidentEnergyN = 0; IncidentEnergyN < incidentEnergySize; ++IncidentEnergyN) + IncidentEnergiesIncidentEnergyAdd(handle, incidentEnergy[IncidentEnergyN]); + return handle; +} + +// Create, general, non-const +Handle2IncidentEnergies +IncidentEnergiesCreate( + ConstHandle2IncidentEnergy *const incidentEnergy, const size_t incidentEnergySize +) { + ConstHandle2IncidentEnergies handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t IncidentEnergyN = 0; IncidentEnergyN < incidentEnergySize; ++IncidentEnergyN) + IncidentEnergiesIncidentEnergyAdd(handle, incidentEnergy[IncidentEnergyN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +IncidentEnergiesAssign(ConstHandle2IncidentEnergies self, ConstHandle2ConstIncidentEnergies from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IncidentEnergiesDelete(ConstHandle2ConstIncidentEnergies self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IncidentEnergiesRead(ConstHandle2IncidentEnergies self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IncidentEnergiesWrite(ConstHandle2ConstIncidentEnergies self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IncidentEnergiesPrint(ConstHandle2ConstIncidentEnergies self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IncidentEnergiesPrintXML(ConstHandle2ConstIncidentEnergies self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IncidentEnergiesPrintJSON(ConstHandle2ConstIncidentEnergies self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: incidentEnergy +// ----------------------------------------------------------------------------- + +// Has +int +IncidentEnergiesIncidentEnergyHas(ConstHandle2ConstIncidentEnergies self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IncidentEnergyHas", self, extract::incidentEnergy); +} + +// Clear +void +IncidentEnergiesIncidentEnergyClear(ConstHandle2IncidentEnergies self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"IncidentEnergyClear", self, extract::incidentEnergy); +} + +// Size +size_t +IncidentEnergiesIncidentEnergySize(ConstHandle2ConstIncidentEnergies self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"IncidentEnergySize", self, extract::incidentEnergy); +} + +// Add +void +IncidentEnergiesIncidentEnergyAdd(ConstHandle2IncidentEnergies self, ConstHandle2ConstIncidentEnergy incidentEnergy) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"IncidentEnergyAdd", self, extract::incidentEnergy, incidentEnergy); +} + +// Get, by index \in [0,size), const +Handle2ConstIncidentEnergy +IncidentEnergiesIncidentEnergyGetConst(ConstHandle2ConstIncidentEnergies self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IncidentEnergyGetConst", self, extract::incidentEnergy, index_); +} + +// Get, by index \in [0,size), non-const +Handle2IncidentEnergy +IncidentEnergiesIncidentEnergyGet(ConstHandle2IncidentEnergies self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IncidentEnergyGet", self, extract::incidentEnergy, index_); +} + +// Set, by index \in [0,size) +void +IncidentEnergiesIncidentEnergySet( + ConstHandle2IncidentEnergies self, + const size_t index_, + ConstHandle2ConstIncidentEnergy incidentEnergy +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"IncidentEnergySet", self, extract::incidentEnergy, index_, incidentEnergy); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +IncidentEnergiesIncidentEnergyHasByLabel( + ConstHandle2ConstIncidentEnergies self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IncidentEnergyHasByLabel", + self, extract::incidentEnergy, meta::label, label); +} + +// Get, by label, const +Handle2ConstIncidentEnergy +IncidentEnergiesIncidentEnergyGetByLabelConst( + ConstHandle2ConstIncidentEnergies self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IncidentEnergyGetByLabelConst", + self, extract::incidentEnergy, meta::label, label); +} + +// Get, by label, non-const +Handle2IncidentEnergy +IncidentEnergiesIncidentEnergyGetByLabel( + ConstHandle2IncidentEnergies self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IncidentEnergyGetByLabel", + self, extract::incidentEnergy, meta::label, label); +} + +// Set, by label +void +IncidentEnergiesIncidentEnergySetByLabel( + ConstHandle2IncidentEnergies self, + const char *const label, + ConstHandle2ConstIncidentEnergy incidentEnergy +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IncidentEnergySetByLabel", + self, extract::incidentEnergy, meta::label, label, incidentEnergy); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/IncidentEnergies/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergies.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergies.h new file mode 100644 index 000000000..9f31172f8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergies.h @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// IncidentEnergies is the basic handle type in this file. Example: +// // Create a default IncidentEnergies object: +// IncidentEnergies handle = IncidentEnergiesDefault(); +// Functions involving IncidentEnergies are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_INCIDENTENERGIES +#define C_INTERFACE_GNDS_V2_0_GENERAL_INCIDENTENERGIES + +#include "GNDStk.h" +#include "v2.0/general/IncidentEnergy.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IncidentEnergiesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ IncidentEnergies +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IncidentEnergiesClass *IncidentEnergies; + +// --- Const-aware handles. +typedef const struct IncidentEnergiesClass *const ConstHandle2ConstIncidentEnergies; +typedef struct IncidentEnergiesClass *const ConstHandle2IncidentEnergies; +typedef const struct IncidentEnergiesClass * Handle2ConstIncidentEnergies; +typedef struct IncidentEnergiesClass * Handle2IncidentEnergies; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstIncidentEnergies +IncidentEnergiesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2IncidentEnergies +IncidentEnergiesDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncidentEnergies +IncidentEnergiesCreateConst( + ConstHandle2IncidentEnergy *const incidentEnergy, const size_t incidentEnergySize +); + +// +++ Create, general, non-const +extern_c Handle2IncidentEnergies +IncidentEnergiesCreate( + ConstHandle2IncidentEnergy *const incidentEnergy, const size_t incidentEnergySize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IncidentEnergiesAssign(ConstHandle2IncidentEnergies self, ConstHandle2ConstIncidentEnergies from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IncidentEnergiesDelete(ConstHandle2ConstIncidentEnergies self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IncidentEnergiesRead(ConstHandle2IncidentEnergies self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IncidentEnergiesWrite(ConstHandle2ConstIncidentEnergies self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IncidentEnergiesPrint(ConstHandle2ConstIncidentEnergies self); + +// +++ Print to standard output, as XML +extern_c int +IncidentEnergiesPrintXML(ConstHandle2ConstIncidentEnergies self); + +// +++ Print to standard output, as JSON +extern_c int +IncidentEnergiesPrintJSON(ConstHandle2ConstIncidentEnergies self); + + +// ----------------------------------------------------------------------------- +// Child: incidentEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncidentEnergiesIncidentEnergyHas(ConstHandle2ConstIncidentEnergies self); + +// +++ Clear +extern_c void +IncidentEnergiesIncidentEnergyClear(ConstHandle2IncidentEnergies self); + +// +++ Size +extern_c size_t +IncidentEnergiesIncidentEnergySize(ConstHandle2ConstIncidentEnergies self); + +// +++ Add +extern_c void +IncidentEnergiesIncidentEnergyAdd(ConstHandle2IncidentEnergies self, ConstHandle2ConstIncidentEnergy incidentEnergy); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstIncidentEnergy +IncidentEnergiesIncidentEnergyGetConst(ConstHandle2ConstIncidentEnergies self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2IncidentEnergy +IncidentEnergiesIncidentEnergyGet(ConstHandle2IncidentEnergies self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +IncidentEnergiesIncidentEnergySet( + ConstHandle2IncidentEnergies self, + const size_t index_, + ConstHandle2ConstIncidentEnergy incidentEnergy +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +IncidentEnergiesIncidentEnergyHasByLabel( + ConstHandle2ConstIncidentEnergies self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstIncidentEnergy +IncidentEnergiesIncidentEnergyGetByLabelConst( + ConstHandle2ConstIncidentEnergies self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2IncidentEnergy +IncidentEnergiesIncidentEnergyGetByLabel( + ConstHandle2IncidentEnergies self, + const char *const label +); + +// +++ Set, by label +extern_c void +IncidentEnergiesIncidentEnergySetByLabel( + ConstHandle2IncidentEnergies self, + const char *const label, + ConstHandle2ConstIncidentEnergy incidentEnergy +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/IncidentEnergies/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergies/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergies/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergies/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergies/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergy.cpp new file mode 100644 index 000000000..67bc5d7b1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergy.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/IncidentEnergy.hpp" +#include "IncidentEnergy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = IncidentEnergyClass; +using CPP = multigroup::IncidentEnergy; + +static const std::string CLASSNAME = "IncidentEnergy"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto energy = [](auto &obj) { return &obj.energy; }; + static auto yields = [](auto &obj) { return &obj.yields; }; +} + +using CPPEnergy = general::Energy; +using CPPYields = general::Yields; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIncidentEnergy +IncidentEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2IncidentEnergy +IncidentEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIncidentEnergy +IncidentEnergyCreateConst( + const char *const label, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstYields yields +) { + ConstHandle2IncidentEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(energy), + detail::tocpp(yields) + ); + return handle; +} + +// Create, general, non-const +Handle2IncidentEnergy +IncidentEnergyCreate( + const char *const label, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstYields yields +) { + ConstHandle2IncidentEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(energy), + detail::tocpp(yields) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +IncidentEnergyAssign(ConstHandle2IncidentEnergy self, ConstHandle2ConstIncidentEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IncidentEnergyDelete(ConstHandle2ConstIncidentEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IncidentEnergyRead(ConstHandle2IncidentEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IncidentEnergyWrite(ConstHandle2ConstIncidentEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IncidentEnergyPrint(ConstHandle2ConstIncidentEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IncidentEnergyPrintXML(ConstHandle2ConstIncidentEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IncidentEnergyPrintJSON(ConstHandle2ConstIncidentEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +IncidentEnergyLabelHas(ConstHandle2ConstIncidentEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +IncidentEnergyLabelGet(ConstHandle2ConstIncidentEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +IncidentEnergyLabelSet(ConstHandle2IncidentEnergy self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: energy +// ----------------------------------------------------------------------------- + +// Has +int +IncidentEnergyEnergyHas(ConstHandle2ConstIncidentEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EnergyHas", self, extract::energy); +} + +// Get, const +Handle2ConstEnergy +IncidentEnergyEnergyGetConst(ConstHandle2ConstIncidentEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyGetConst", self, extract::energy); +} + +// Get, non-const +Handle2Energy +IncidentEnergyEnergyGet(ConstHandle2IncidentEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyGet", self, extract::energy); +} + +// Set +void +IncidentEnergyEnergySet(ConstHandle2IncidentEnergy self, ConstHandle2ConstEnergy energy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EnergySet", self, extract::energy, energy); +} + + +// ----------------------------------------------------------------------------- +// Child: yields +// ----------------------------------------------------------------------------- + +// Has +int +IncidentEnergyYieldsHas(ConstHandle2ConstIncidentEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"YieldsHas", self, extract::yields); +} + +// Get, const +Handle2ConstYields +IncidentEnergyYieldsGetConst(ConstHandle2ConstIncidentEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"YieldsGetConst", self, extract::yields); +} + +// Get, non-const +Handle2Yields +IncidentEnergyYieldsGet(ConstHandle2IncidentEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"YieldsGet", self, extract::yields); +} + +// Set +void +IncidentEnergyYieldsSet(ConstHandle2IncidentEnergy self, ConstHandle2ConstYields yields) +{ + detail::setField + (CLASSNAME, CLASSNAME+"YieldsSet", self, extract::yields, yields); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/IncidentEnergy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergy.h new file mode 100644 index 000000000..49efb05e0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergy.h @@ -0,0 +1,205 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// IncidentEnergy is the basic handle type in this file. Example: +// // Create a default IncidentEnergy object: +// IncidentEnergy handle = IncidentEnergyDefault(); +// Functions involving IncidentEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_INCIDENTENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_INCIDENTENERGY + +#include "GNDStk.h" +#include "v2.0/general/Energy.h" +#include "v2.0/general/Yields.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IncidentEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ IncidentEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IncidentEnergyClass *IncidentEnergy; + +// --- Const-aware handles. +typedef const struct IncidentEnergyClass *const ConstHandle2ConstIncidentEnergy; +typedef struct IncidentEnergyClass *const ConstHandle2IncidentEnergy; +typedef const struct IncidentEnergyClass * Handle2ConstIncidentEnergy; +typedef struct IncidentEnergyClass * Handle2IncidentEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstIncidentEnergy +IncidentEnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2IncidentEnergy +IncidentEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncidentEnergy +IncidentEnergyCreateConst( + const char *const label, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstYields yields +); + +// +++ Create, general, non-const +extern_c Handle2IncidentEnergy +IncidentEnergyCreate( + const char *const label, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstYields yields +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IncidentEnergyAssign(ConstHandle2IncidentEnergy self, ConstHandle2ConstIncidentEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IncidentEnergyDelete(ConstHandle2ConstIncidentEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IncidentEnergyRead(ConstHandle2IncidentEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IncidentEnergyWrite(ConstHandle2ConstIncidentEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IncidentEnergyPrint(ConstHandle2ConstIncidentEnergy self); + +// +++ Print to standard output, as XML +extern_c int +IncidentEnergyPrintXML(ConstHandle2ConstIncidentEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +IncidentEnergyPrintJSON(ConstHandle2ConstIncidentEnergy self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncidentEnergyLabelHas(ConstHandle2ConstIncidentEnergy self); + +// +++ Get +// +++ Returns by value +extern_c const char * +IncidentEnergyLabelGet(ConstHandle2ConstIncidentEnergy self); + +// +++ Set +extern_c void +IncidentEnergyLabelSet(ConstHandle2IncidentEnergy self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Child: energy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncidentEnergyEnergyHas(ConstHandle2ConstIncidentEnergy self); + +// --- Get, const +extern_c Handle2ConstEnergy +IncidentEnergyEnergyGetConst(ConstHandle2ConstIncidentEnergy self); + +// +++ Get, non-const +extern_c Handle2Energy +IncidentEnergyEnergyGet(ConstHandle2IncidentEnergy self); + +// +++ Set +extern_c void +IncidentEnergyEnergySet(ConstHandle2IncidentEnergy self, ConstHandle2ConstEnergy energy); + + +// ----------------------------------------------------------------------------- +// Child: yields +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncidentEnergyYieldsHas(ConstHandle2ConstIncidentEnergy self); + +// --- Get, const +extern_c Handle2ConstYields +IncidentEnergyYieldsGetConst(ConstHandle2ConstIncidentEnergy self); + +// +++ Get, non-const +extern_c Handle2Yields +IncidentEnergyYieldsGet(ConstHandle2IncidentEnergy self); + +// +++ Set +extern_c void +IncidentEnergyYieldsSet(ConstHandle2IncidentEnergy self, ConstHandle2ConstYields yields); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/IncidentEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncidentEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncoherentPhotonScattering.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncoherentPhotonScattering.cpp new file mode 100644 index 000000000..d3ae50410 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncoherentPhotonScattering.cpp @@ -0,0 +1,321 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/IncoherentPhotonScattering.hpp" +#include "IncoherentPhotonScattering.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = IncoherentPhotonScatteringClass; +using CPP = multigroup::IncoherentPhotonScattering; + +static const std::string CLASSNAME = "IncoherentPhotonScattering"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto href = [](auto &obj) { return &obj.href; }; + static auto pid = [](auto &obj) { return &obj.pid; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto scatteringFactor = [](auto &obj) { return &obj.scatteringFactor; }; +} + +using CPPScatteringFactor = general::ScatteringFactor; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIncoherentPhotonScattering +IncoherentPhotonScatteringDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2IncoherentPhotonScattering +IncoherentPhotonScatteringDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIncoherentPhotonScattering +IncoherentPhotonScatteringCreateConst( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstScatteringFactor scatteringFactor +) { + ConstHandle2IncoherentPhotonScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href, + pid, + productFrame, + detail::tocpp(scatteringFactor) + ); + return handle; +} + +// Create, general, non-const +Handle2IncoherentPhotonScattering +IncoherentPhotonScatteringCreate( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstScatteringFactor scatteringFactor +) { + ConstHandle2IncoherentPhotonScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + href, + pid, + productFrame, + detail::tocpp(scatteringFactor) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +IncoherentPhotonScatteringAssign(ConstHandle2IncoherentPhotonScattering self, ConstHandle2ConstIncoherentPhotonScattering from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IncoherentPhotonScatteringDelete(ConstHandle2ConstIncoherentPhotonScattering self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IncoherentPhotonScatteringRead(ConstHandle2IncoherentPhotonScattering self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IncoherentPhotonScatteringWrite(ConstHandle2ConstIncoherentPhotonScattering self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IncoherentPhotonScatteringPrint(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IncoherentPhotonScatteringPrintXML(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IncoherentPhotonScatteringPrintJSON(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +IncoherentPhotonScatteringLabelHas(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +IncoherentPhotonScatteringLabelGet(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +IncoherentPhotonScatteringLabelSet(ConstHandle2IncoherentPhotonScattering self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +IncoherentPhotonScatteringHrefHas(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +IncoherentPhotonScatteringHrefGet(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +IncoherentPhotonScatteringHrefSet(ConstHandle2IncoherentPhotonScattering self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +IncoherentPhotonScatteringPidHas(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +IncoherentPhotonScatteringPidGet(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +IncoherentPhotonScatteringPidSet(ConstHandle2IncoherentPhotonScattering self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +IncoherentPhotonScatteringProductFrameHas(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +IncoherentPhotonScatteringProductFrameGet(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +IncoherentPhotonScatteringProductFrameSet(ConstHandle2IncoherentPhotonScattering self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: scatteringFactor +// ----------------------------------------------------------------------------- + +// Has +int +IncoherentPhotonScatteringScatteringFactorHas(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ScatteringFactorHas", self, extract::scatteringFactor); +} + +// Get, const +Handle2ConstScatteringFactor +IncoherentPhotonScatteringScatteringFactorGetConst(ConstHandle2ConstIncoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringFactorGetConst", self, extract::scatteringFactor); +} + +// Get, non-const +Handle2ScatteringFactor +IncoherentPhotonScatteringScatteringFactorGet(ConstHandle2IncoherentPhotonScattering self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringFactorGet", self, extract::scatteringFactor); +} + +// Set +void +IncoherentPhotonScatteringScatteringFactorSet(ConstHandle2IncoherentPhotonScattering self, ConstHandle2ConstScatteringFactor scatteringFactor) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ScatteringFactorSet", self, extract::scatteringFactor, scatteringFactor); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/IncoherentPhotonScattering/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncoherentPhotonScattering.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncoherentPhotonScattering.h new file mode 100644 index 000000000..3cb8bdc9b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncoherentPhotonScattering.h @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// IncoherentPhotonScattering is the basic handle type in this file. Example: +// // Create a default IncoherentPhotonScattering object: +// IncoherentPhotonScattering handle = IncoherentPhotonScatteringDefault(); +// Functions involving IncoherentPhotonScattering are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_INCOHERENTPHOTONSCATTERING +#define C_INTERFACE_GNDS_V2_0_GENERAL_INCOHERENTPHOTONSCATTERING + +#include "GNDStk.h" +#include "v2.0/general/ScatteringFactor.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IncoherentPhotonScatteringClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ IncoherentPhotonScattering +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IncoherentPhotonScatteringClass *IncoherentPhotonScattering; + +// --- Const-aware handles. +typedef const struct IncoherentPhotonScatteringClass *const ConstHandle2ConstIncoherentPhotonScattering; +typedef struct IncoherentPhotonScatteringClass *const ConstHandle2IncoherentPhotonScattering; +typedef const struct IncoherentPhotonScatteringClass * Handle2ConstIncoherentPhotonScattering; +typedef struct IncoherentPhotonScatteringClass * Handle2IncoherentPhotonScattering; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstIncoherentPhotonScattering +IncoherentPhotonScatteringDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2IncoherentPhotonScattering +IncoherentPhotonScatteringDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncoherentPhotonScattering +IncoherentPhotonScatteringCreateConst( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstScatteringFactor scatteringFactor +); + +// +++ Create, general, non-const +extern_c Handle2IncoherentPhotonScattering +IncoherentPhotonScatteringCreate( + const char *const label, + const char *const href, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstScatteringFactor scatteringFactor +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IncoherentPhotonScatteringAssign(ConstHandle2IncoherentPhotonScattering self, ConstHandle2ConstIncoherentPhotonScattering from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IncoherentPhotonScatteringDelete(ConstHandle2ConstIncoherentPhotonScattering self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IncoherentPhotonScatteringRead(ConstHandle2IncoherentPhotonScattering self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IncoherentPhotonScatteringWrite(ConstHandle2ConstIncoherentPhotonScattering self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IncoherentPhotonScatteringPrint(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Print to standard output, as XML +extern_c int +IncoherentPhotonScatteringPrintXML(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Print to standard output, as JSON +extern_c int +IncoherentPhotonScatteringPrintJSON(ConstHandle2ConstIncoherentPhotonScattering self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncoherentPhotonScatteringLabelHas(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c const char * +IncoherentPhotonScatteringLabelGet(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Set +extern_c void +IncoherentPhotonScatteringLabelSet(ConstHandle2IncoherentPhotonScattering self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncoherentPhotonScatteringHrefHas(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c const char * +IncoherentPhotonScatteringHrefGet(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Set +extern_c void +IncoherentPhotonScatteringHrefSet(ConstHandle2IncoherentPhotonScattering self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncoherentPhotonScatteringPidHas(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c const char * +IncoherentPhotonScatteringPidGet(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Set +extern_c void +IncoherentPhotonScatteringPidSet(ConstHandle2IncoherentPhotonScattering self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncoherentPhotonScatteringProductFrameHas(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Get +// +++ Returns by value +extern_c const char * +IncoherentPhotonScatteringProductFrameGet(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Set +extern_c void +IncoherentPhotonScatteringProductFrameSet(ConstHandle2IncoherentPhotonScattering self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Child: scatteringFactor +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncoherentPhotonScatteringScatteringFactorHas(ConstHandle2ConstIncoherentPhotonScattering self); + +// --- Get, const +extern_c Handle2ConstScatteringFactor +IncoherentPhotonScatteringScatteringFactorGetConst(ConstHandle2ConstIncoherentPhotonScattering self); + +// +++ Get, non-const +extern_c Handle2ScatteringFactor +IncoherentPhotonScatteringScatteringFactorGet(ConstHandle2IncoherentPhotonScattering self); + +// +++ Set +extern_c void +IncoherentPhotonScatteringScatteringFactorSet(ConstHandle2IncoherentPhotonScattering self, ConstHandle2ConstScatteringFactor scatteringFactor); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/IncoherentPhotonScattering/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncoherentPhotonScattering/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncoherentPhotonScattering/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncoherentPhotonScattering/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncoherentPhotonScattering/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncompleteReactions.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncompleteReactions.cpp new file mode 100644 index 000000000..419cc9fcc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncompleteReactions.cpp @@ -0,0 +1,359 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/IncompleteReactions.hpp" +#include "IncompleteReactions.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = IncompleteReactionsClass; +using CPP = multigroup::IncompleteReactions; + +static const std::string CLASSNAME = "IncompleteReactions"; + +namespace extract { + static auto reaction = [](auto &obj) { return &obj.reaction; }; +} + +using CPPReaction = general::Reaction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIncompleteReactions +IncompleteReactionsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2IncompleteReactions +IncompleteReactionsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIncompleteReactions +IncompleteReactionsCreateConst( + ConstHandle2Reaction *const reaction, const size_t reactionSize +) { + ConstHandle2IncompleteReactions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ReactionN = 0; ReactionN < reactionSize; ++ReactionN) + IncompleteReactionsReactionAdd(handle, reaction[ReactionN]); + return handle; +} + +// Create, general, non-const +Handle2IncompleteReactions +IncompleteReactionsCreate( + ConstHandle2Reaction *const reaction, const size_t reactionSize +) { + ConstHandle2IncompleteReactions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ReactionN = 0; ReactionN < reactionSize; ++ReactionN) + IncompleteReactionsReactionAdd(handle, reaction[ReactionN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +IncompleteReactionsAssign(ConstHandle2IncompleteReactions self, ConstHandle2ConstIncompleteReactions from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IncompleteReactionsDelete(ConstHandle2ConstIncompleteReactions self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IncompleteReactionsRead(ConstHandle2IncompleteReactions self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IncompleteReactionsWrite(ConstHandle2ConstIncompleteReactions self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IncompleteReactionsPrint(ConstHandle2ConstIncompleteReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IncompleteReactionsPrintXML(ConstHandle2ConstIncompleteReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IncompleteReactionsPrintJSON(ConstHandle2ConstIncompleteReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: reaction +// ----------------------------------------------------------------------------- + +// Has +int +IncompleteReactionsReactionHas(ConstHandle2ConstIncompleteReactions self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ReactionHas", self, extract::reaction); +} + +// Clear +void +IncompleteReactionsReactionClear(ConstHandle2IncompleteReactions self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ReactionClear", self, extract::reaction); +} + +// Size +size_t +IncompleteReactionsReactionSize(ConstHandle2ConstIncompleteReactions self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ReactionSize", self, extract::reaction); +} + +// Add +void +IncompleteReactionsReactionAdd(ConstHandle2IncompleteReactions self, ConstHandle2ConstReaction reaction) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ReactionAdd", self, extract::reaction, reaction); +} + +// Get, by index \in [0,size), const +Handle2ConstReaction +IncompleteReactionsReactionGetConst(ConstHandle2ConstIncompleteReactions self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ReactionGetConst", self, extract::reaction, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Reaction +IncompleteReactionsReactionGet(ConstHandle2IncompleteReactions self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ReactionGet", self, extract::reaction, index_); +} + +// Set, by index \in [0,size) +void +IncompleteReactionsReactionSet( + ConstHandle2IncompleteReactions self, + const size_t index_, + ConstHandle2ConstReaction reaction +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ReactionSet", self, extract::reaction, index_, reaction); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +IncompleteReactionsReactionHasByLabel( + ConstHandle2ConstIncompleteReactions self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ReactionHasByLabel", + self, extract::reaction, meta::label, label); +} + +// Get, by label, const +Handle2ConstReaction +IncompleteReactionsReactionGetByLabelConst( + ConstHandle2ConstIncompleteReactions self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByLabelConst", + self, extract::reaction, meta::label, label); +} + +// Get, by label, non-const +Handle2Reaction +IncompleteReactionsReactionGetByLabel( + ConstHandle2IncompleteReactions self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByLabel", + self, extract::reaction, meta::label, label); +} + +// Set, by label +void +IncompleteReactionsReactionSetByLabel( + ConstHandle2IncompleteReactions self, + const char *const label, + ConstHandle2ConstReaction reaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ReactionSetByLabel", + self, extract::reaction, meta::label, label, reaction); +} + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// Has, by ENDF_MT +int +IncompleteReactionsReactionHasByENDFMT( + ConstHandle2ConstIncompleteReactions self, + const int ENDF_MT +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ReactionHasByENDFMT", + self, extract::reaction, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, const +Handle2ConstReaction +IncompleteReactionsReactionGetByENDFMTConst( + ConstHandle2ConstIncompleteReactions self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByENDFMTConst", + self, extract::reaction, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, non-const +Handle2Reaction +IncompleteReactionsReactionGetByENDFMT( + ConstHandle2IncompleteReactions self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByENDFMT", + self, extract::reaction, meta::ENDF_MT, ENDF_MT); +} + +// Set, by ENDF_MT +void +IncompleteReactionsReactionSetByENDFMT( + ConstHandle2IncompleteReactions self, + const int ENDF_MT, + ConstHandle2ConstReaction reaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ReactionSetByENDFMT", + self, extract::reaction, meta::ENDF_MT, ENDF_MT, reaction); +} + +// ------------------------ +// Re: metadatum fissionGenre +// ------------------------ + +// Has, by fissionGenre +int +IncompleteReactionsReactionHasByFissionGenre( + ConstHandle2ConstIncompleteReactions self, + const char *const fissionGenre +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ReactionHasByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, const +Handle2ConstReaction +IncompleteReactionsReactionGetByFissionGenreConst( + ConstHandle2ConstIncompleteReactions self, + const char *const fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByFissionGenreConst", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, non-const +Handle2Reaction +IncompleteReactionsReactionGetByFissionGenre( + ConstHandle2IncompleteReactions self, + const char *const fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Set, by fissionGenre +void +IncompleteReactionsReactionSetByFissionGenre( + ConstHandle2IncompleteReactions self, + const char *const fissionGenre, + ConstHandle2ConstReaction reaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ReactionSetByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre, reaction); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/IncompleteReactions/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncompleteReactions.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncompleteReactions.h new file mode 100644 index 000000000..ddd568b41 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncompleteReactions.h @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// IncompleteReactions is the basic handle type in this file. Example: +// // Create a default IncompleteReactions object: +// IncompleteReactions handle = IncompleteReactionsDefault(); +// Functions involving IncompleteReactions are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_INCOMPLETEREACTIONS +#define C_INTERFACE_GNDS_V2_0_GENERAL_INCOMPLETEREACTIONS + +#include "GNDStk.h" +#include "v2.0/general/Reaction.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IncompleteReactionsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ IncompleteReactions +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IncompleteReactionsClass *IncompleteReactions; + +// --- Const-aware handles. +typedef const struct IncompleteReactionsClass *const ConstHandle2ConstIncompleteReactions; +typedef struct IncompleteReactionsClass *const ConstHandle2IncompleteReactions; +typedef const struct IncompleteReactionsClass * Handle2ConstIncompleteReactions; +typedef struct IncompleteReactionsClass * Handle2IncompleteReactions; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstIncompleteReactions +IncompleteReactionsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2IncompleteReactions +IncompleteReactionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstIncompleteReactions +IncompleteReactionsCreateConst( + ConstHandle2Reaction *const reaction, const size_t reactionSize +); + +// +++ Create, general, non-const +extern_c Handle2IncompleteReactions +IncompleteReactionsCreate( + ConstHandle2Reaction *const reaction, const size_t reactionSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IncompleteReactionsAssign(ConstHandle2IncompleteReactions self, ConstHandle2ConstIncompleteReactions from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IncompleteReactionsDelete(ConstHandle2ConstIncompleteReactions self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IncompleteReactionsRead(ConstHandle2IncompleteReactions self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IncompleteReactionsWrite(ConstHandle2ConstIncompleteReactions self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IncompleteReactionsPrint(ConstHandle2ConstIncompleteReactions self); + +// +++ Print to standard output, as XML +extern_c int +IncompleteReactionsPrintXML(ConstHandle2ConstIncompleteReactions self); + +// +++ Print to standard output, as JSON +extern_c int +IncompleteReactionsPrintJSON(ConstHandle2ConstIncompleteReactions self); + + +// ----------------------------------------------------------------------------- +// Child: reaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IncompleteReactionsReactionHas(ConstHandle2ConstIncompleteReactions self); + +// +++ Clear +extern_c void +IncompleteReactionsReactionClear(ConstHandle2IncompleteReactions self); + +// +++ Size +extern_c size_t +IncompleteReactionsReactionSize(ConstHandle2ConstIncompleteReactions self); + +// +++ Add +extern_c void +IncompleteReactionsReactionAdd(ConstHandle2IncompleteReactions self, ConstHandle2ConstReaction reaction); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstReaction +IncompleteReactionsReactionGetConst(ConstHandle2ConstIncompleteReactions self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Reaction +IncompleteReactionsReactionGet(ConstHandle2IncompleteReactions self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +IncompleteReactionsReactionSet( + ConstHandle2IncompleteReactions self, + const size_t index_, + ConstHandle2ConstReaction reaction +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +IncompleteReactionsReactionHasByLabel( + ConstHandle2ConstIncompleteReactions self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstReaction +IncompleteReactionsReactionGetByLabelConst( + ConstHandle2ConstIncompleteReactions self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Reaction +IncompleteReactionsReactionGetByLabel( + ConstHandle2IncompleteReactions self, + const char *const label +); + +// +++ Set, by label +extern_c void +IncompleteReactionsReactionSetByLabel( + ConstHandle2IncompleteReactions self, + const char *const label, + ConstHandle2ConstReaction reaction +); + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// +++ Has, by ENDF_MT +extern_c int +IncompleteReactionsReactionHasByENDFMT( + ConstHandle2ConstIncompleteReactions self, + const int ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstReaction +IncompleteReactionsReactionGetByENDFMTConst( + ConstHandle2ConstIncompleteReactions self, + const int ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2Reaction +IncompleteReactionsReactionGetByENDFMT( + ConstHandle2IncompleteReactions self, + const int ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +IncompleteReactionsReactionSetByENDFMT( + ConstHandle2IncompleteReactions self, + const int ENDF_MT, + ConstHandle2ConstReaction reaction +); + +// ------------------------ +// Re: metadatum fissionGenre +// ------------------------ + +// +++ Has, by fissionGenre +extern_c int +IncompleteReactionsReactionHasByFissionGenre( + ConstHandle2ConstIncompleteReactions self, + const char *const fissionGenre +); + +// --- Get, by fissionGenre, const +extern_c Handle2ConstReaction +IncompleteReactionsReactionGetByFissionGenreConst( + ConstHandle2ConstIncompleteReactions self, + const char *const fissionGenre +); + +// +++ Get, by fissionGenre, non-const +extern_c Handle2Reaction +IncompleteReactionsReactionGetByFissionGenre( + ConstHandle2IncompleteReactions self, + const char *const fissionGenre +); + +// +++ Set, by fissionGenre +extern_c void +IncompleteReactionsReactionSetByFissionGenre( + ConstHandle2IncompleteReactions self, + const char *const fissionGenre, + ConstHandle2ConstReaction reaction +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/IncompleteReactions/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncompleteReactions/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncompleteReactions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncompleteReactions/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/IncompleteReactions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Institution.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Institution.cpp new file mode 100644 index 000000000..9599f52f3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Institution.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Institution.hpp" +#include "Institution.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = InstitutionClass; +using CPP = multigroup::Institution; + +static const std::string CLASSNAME = "Institution"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto ENDFconversionFlags = [](auto &obj) { return &obj.ENDFconversionFlags; }; +} + +using CPPENDFconversionFlags = general::ENDFconversionFlags; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInstitution +InstitutionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Institution +InstitutionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstInstitution +InstitutionCreateConst( + const char *const label, + ConstHandle2ConstENDFconversionFlags ENDFconversionFlags +) { + ConstHandle2Institution handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(ENDFconversionFlags) + ); + return handle; +} + +// Create, general, non-const +Handle2Institution +InstitutionCreate( + const char *const label, + ConstHandle2ConstENDFconversionFlags ENDFconversionFlags +) { + ConstHandle2Institution handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(ENDFconversionFlags) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +InstitutionAssign(ConstHandle2Institution self, ConstHandle2ConstInstitution from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +InstitutionDelete(ConstHandle2ConstInstitution self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +InstitutionRead(ConstHandle2Institution self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +InstitutionWrite(ConstHandle2ConstInstitution self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +InstitutionPrint(ConstHandle2ConstInstitution self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +InstitutionPrintXML(ConstHandle2ConstInstitution self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +InstitutionPrintJSON(ConstHandle2ConstInstitution self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +InstitutionLabelHas(ConstHandle2ConstInstitution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +InstitutionLabelGet(ConstHandle2ConstInstitution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +InstitutionLabelSet(ConstHandle2Institution self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: ENDFconversionFlags +// ----------------------------------------------------------------------------- + +// Has +int +InstitutionENDFconversionFlagsHas(ConstHandle2ConstInstitution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFconversionFlagsHas", self, extract::ENDFconversionFlags); +} + +// Get, const +Handle2ConstENDFconversionFlags +InstitutionENDFconversionFlagsGetConst(ConstHandle2ConstInstitution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFconversionFlagsGetConst", self, extract::ENDFconversionFlags); +} + +// Get, non-const +Handle2ENDFconversionFlags +InstitutionENDFconversionFlagsGet(ConstHandle2Institution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFconversionFlagsGet", self, extract::ENDFconversionFlags); +} + +// Set +void +InstitutionENDFconversionFlagsSet(ConstHandle2Institution self, ConstHandle2ConstENDFconversionFlags ENDFconversionFlags) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFconversionFlagsSet", self, extract::ENDFconversionFlags, ENDFconversionFlags); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Institution/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Institution.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Institution.h new file mode 100644 index 000000000..7a0ad2663 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Institution.h @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Institution is the basic handle type in this file. Example: +// // Create a default Institution object: +// Institution handle = InstitutionDefault(); +// Functions involving Institution are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_INSTITUTION +#define C_INTERFACE_GNDS_V2_0_GENERAL_INSTITUTION + +#include "GNDStk.h" +#include "v2.0/general/ENDFconversionFlags.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct InstitutionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Institution +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct InstitutionClass *Institution; + +// --- Const-aware handles. +typedef const struct InstitutionClass *const ConstHandle2ConstInstitution; +typedef struct InstitutionClass *const ConstHandle2Institution; +typedef const struct InstitutionClass * Handle2ConstInstitution; +typedef struct InstitutionClass * Handle2Institution; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstInstitution +InstitutionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Institution +InstitutionDefault(); + +// --- Create, general, const +extern_c Handle2ConstInstitution +InstitutionCreateConst( + const char *const label, + ConstHandle2ConstENDFconversionFlags ENDFconversionFlags +); + +// +++ Create, general, non-const +extern_c Handle2Institution +InstitutionCreate( + const char *const label, + ConstHandle2ConstENDFconversionFlags ENDFconversionFlags +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +InstitutionAssign(ConstHandle2Institution self, ConstHandle2ConstInstitution from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +InstitutionDelete(ConstHandle2ConstInstitution self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +InstitutionRead(ConstHandle2Institution self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +InstitutionWrite(ConstHandle2ConstInstitution self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +InstitutionPrint(ConstHandle2ConstInstitution self); + +// +++ Print to standard output, as XML +extern_c int +InstitutionPrintXML(ConstHandle2ConstInstitution self); + +// +++ Print to standard output, as JSON +extern_c int +InstitutionPrintJSON(ConstHandle2ConstInstitution self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InstitutionLabelHas(ConstHandle2ConstInstitution self); + +// +++ Get +// +++ Returns by value +extern_c const char * +InstitutionLabelGet(ConstHandle2ConstInstitution self); + +// +++ Set +extern_c void +InstitutionLabelSet(ConstHandle2Institution self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Child: ENDFconversionFlags +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InstitutionENDFconversionFlagsHas(ConstHandle2ConstInstitution self); + +// --- Get, const +extern_c Handle2ConstENDFconversionFlags +InstitutionENDFconversionFlagsGetConst(ConstHandle2ConstInstitution self); + +// +++ Get, non-const +extern_c Handle2ENDFconversionFlags +InstitutionENDFconversionFlagsGet(ConstHandle2Institution self); + +// +++ Set +extern_c void +InstitutionENDFconversionFlagsSet(ConstHandle2Institution self, ConstHandle2ConstENDFconversionFlags ENDFconversionFlags); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Institution/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Institution/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Institution/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Institution/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Institution/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Integer.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Integer.cpp new file mode 100644 index 000000000..8e76454f0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Integer.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Integer.hpp" +#include "Integer.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = IntegerClass; +using CPP = multigroup::Integer; + +static const std::string CLASSNAME = "Integer"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInteger +IntegerDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Integer +IntegerDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstInteger +IntegerCreateConst( + const char *const label, + const int value, + const char *const unit +) { + ConstHandle2Integer handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2Integer +IntegerCreate( + const char *const label, + const int value, + const char *const unit +) { + ConstHandle2Integer handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +IntegerAssign(ConstHandle2Integer self, ConstHandle2ConstInteger from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IntegerDelete(ConstHandle2ConstInteger self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IntegerRead(ConstHandle2Integer self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IntegerWrite(ConstHandle2ConstInteger self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IntegerPrint(ConstHandle2ConstInteger self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IntegerPrintXML(ConstHandle2ConstInteger self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IntegerPrintJSON(ConstHandle2ConstInteger self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +IntegerLabelHas(ConstHandle2ConstInteger self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +IntegerLabelGet(ConstHandle2ConstInteger self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +IntegerLabelSet(ConstHandle2Integer self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +IntegerValueHas(ConstHandle2ConstInteger self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +int +IntegerValueGet(ConstHandle2ConstInteger self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +IntegerValueSet(ConstHandle2Integer self, const int value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +IntegerUnitHas(ConstHandle2ConstInteger self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +IntegerUnitGet(ConstHandle2ConstInteger self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +IntegerUnitSet(ConstHandle2Integer self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Integer/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Integer.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Integer.h new file mode 100644 index 000000000..89282bc40 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Integer.h @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Integer is the basic handle type in this file. Example: +// // Create a default Integer object: +// Integer handle = IntegerDefault(); +// Functions involving Integer are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_INTEGER +#define C_INTERFACE_GNDS_V2_0_GENERAL_INTEGER + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IntegerClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Integer +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IntegerClass *Integer; + +// --- Const-aware handles. +typedef const struct IntegerClass *const ConstHandle2ConstInteger; +typedef struct IntegerClass *const ConstHandle2Integer; +typedef const struct IntegerClass * Handle2ConstInteger; +typedef struct IntegerClass * Handle2Integer; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstInteger +IntegerDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Integer +IntegerDefault(); + +// --- Create, general, const +extern_c Handle2ConstInteger +IntegerCreateConst( + const char *const label, + const int value, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2Integer +IntegerCreate( + const char *const label, + const int value, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IntegerAssign(ConstHandle2Integer self, ConstHandle2ConstInteger from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IntegerDelete(ConstHandle2ConstInteger self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IntegerRead(ConstHandle2Integer self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IntegerWrite(ConstHandle2ConstInteger self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IntegerPrint(ConstHandle2ConstInteger self); + +// +++ Print to standard output, as XML +extern_c int +IntegerPrintXML(ConstHandle2ConstInteger self); + +// +++ Print to standard output, as JSON +extern_c int +IntegerPrintJSON(ConstHandle2ConstInteger self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntegerLabelHas(ConstHandle2ConstInteger self); + +// +++ Get +// +++ Returns by value +extern_c const char * +IntegerLabelGet(ConstHandle2ConstInteger self); + +// +++ Set +extern_c void +IntegerLabelSet(ConstHandle2Integer self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntegerValueHas(ConstHandle2ConstInteger self); + +// +++ Get +// +++ Returns by value +extern_c int +IntegerValueGet(ConstHandle2ConstInteger self); + +// +++ Set +extern_c void +IntegerValueSet(ConstHandle2Integer self, const int value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntegerUnitHas(ConstHandle2ConstInteger self); + +// +++ Get +// +++ Returns by value +extern_c const char * +IntegerUnitGet(ConstHandle2ConstInteger self); + +// +++ Set +extern_c void +IntegerUnitSet(ConstHandle2Integer self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Integer/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Integer/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Integer/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Integer/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Integer/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Intensity.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Intensity.cpp new file mode 100644 index 000000000..3279dccfd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Intensity.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Intensity.hpp" +#include "Intensity.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = IntensityClass; +using CPP = multigroup::Intensity; + +static const std::string CLASSNAME = "Intensity"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPUncertainty = general::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIntensity +IntensityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Intensity +IntensityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIntensity +IntensityCreateConst( + const double value, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Intensity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general, non-const +Handle2Intensity +IntensityCreate( + const double value, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Intensity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +IntensityAssign(ConstHandle2Intensity self, ConstHandle2ConstIntensity from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IntensityDelete(ConstHandle2ConstIntensity self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IntensityRead(ConstHandle2Intensity self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IntensityWrite(ConstHandle2ConstIntensity self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IntensityPrint(ConstHandle2ConstIntensity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IntensityPrintXML(ConstHandle2ConstIntensity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IntensityPrintJSON(ConstHandle2ConstIntensity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +IntensityValueHas(ConstHandle2ConstIntensity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +IntensityValueGet(ConstHandle2ConstIntensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +IntensityValueSet(ConstHandle2Intensity self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +IntensityUncertaintyHas(ConstHandle2ConstIntensity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +IntensityUncertaintyGetConst(ConstHandle2ConstIntensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +IntensityUncertaintyGet(ConstHandle2Intensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +IntensityUncertaintySet(ConstHandle2Intensity self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Intensity/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Intensity.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Intensity.h new file mode 100644 index 000000000..0941eaf8c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Intensity.h @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Intensity is the basic handle type in this file. Example: +// // Create a default Intensity object: +// Intensity handle = IntensityDefault(); +// Functions involving Intensity are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_INTENSITY +#define C_INTERFACE_GNDS_V2_0_GENERAL_INTENSITY + +#include "GNDStk.h" +#include "v2.0/general/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IntensityClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Intensity +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IntensityClass *Intensity; + +// --- Const-aware handles. +typedef const struct IntensityClass *const ConstHandle2ConstIntensity; +typedef struct IntensityClass *const ConstHandle2Intensity; +typedef const struct IntensityClass * Handle2ConstIntensity; +typedef struct IntensityClass * Handle2Intensity; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstIntensity +IntensityDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Intensity +IntensityDefault(); + +// --- Create, general, const +extern_c Handle2ConstIntensity +IntensityCreateConst( + const double value, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general, non-const +extern_c Handle2Intensity +IntensityCreate( + const double value, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IntensityAssign(ConstHandle2Intensity self, ConstHandle2ConstIntensity from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IntensityDelete(ConstHandle2ConstIntensity self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IntensityRead(ConstHandle2Intensity self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IntensityWrite(ConstHandle2ConstIntensity self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IntensityPrint(ConstHandle2ConstIntensity self); + +// +++ Print to standard output, as XML +extern_c int +IntensityPrintXML(ConstHandle2ConstIntensity self); + +// +++ Print to standard output, as JSON +extern_c int +IntensityPrintJSON(ConstHandle2ConstIntensity self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntensityValueHas(ConstHandle2ConstIntensity self); + +// +++ Get +// +++ Returns by value +extern_c double +IntensityValueGet(ConstHandle2ConstIntensity self); + +// +++ Set +extern_c void +IntensityValueSet(ConstHandle2Intensity self, const double value); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IntensityUncertaintyHas(ConstHandle2ConstIntensity self); + +// --- Get, const +extern_c Handle2ConstUncertainty +IntensityUncertaintyGetConst(ConstHandle2ConstIntensity self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +IntensityUncertaintyGet(ConstHandle2Intensity self); + +// +++ Set +extern_c void +IntensityUncertaintySet(ConstHandle2Intensity self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Intensity/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Intensity/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Intensity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Intensity/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Intensity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/InternalConversionCoefficients.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/InternalConversionCoefficients.cpp new file mode 100644 index 000000000..87a170f10 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/InternalConversionCoefficients.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/InternalConversionCoefficients.hpp" +#include "InternalConversionCoefficients.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = InternalConversionCoefficientsClass; +using CPP = multigroup::InternalConversionCoefficients; + +static const std::string CLASSNAME = "InternalConversionCoefficients"; + +namespace extract { + static auto shell = [](auto &obj) { return &obj.shell; }; +} + +using CPPShell = general::Shell; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstInternalConversionCoefficients +InternalConversionCoefficientsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2InternalConversionCoefficients +InternalConversionCoefficientsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstInternalConversionCoefficients +InternalConversionCoefficientsCreateConst( + ConstHandle2Shell *const shell, const size_t shellSize +) { + ConstHandle2InternalConversionCoefficients handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ShellN = 0; ShellN < shellSize; ++ShellN) + InternalConversionCoefficientsShellAdd(handle, shell[ShellN]); + return handle; +} + +// Create, general, non-const +Handle2InternalConversionCoefficients +InternalConversionCoefficientsCreate( + ConstHandle2Shell *const shell, const size_t shellSize +) { + ConstHandle2InternalConversionCoefficients handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ShellN = 0; ShellN < shellSize; ++ShellN) + InternalConversionCoefficientsShellAdd(handle, shell[ShellN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +InternalConversionCoefficientsAssign(ConstHandle2InternalConversionCoefficients self, ConstHandle2ConstInternalConversionCoefficients from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +InternalConversionCoefficientsDelete(ConstHandle2ConstInternalConversionCoefficients self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +InternalConversionCoefficientsRead(ConstHandle2InternalConversionCoefficients self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +InternalConversionCoefficientsWrite(ConstHandle2ConstInternalConversionCoefficients self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +InternalConversionCoefficientsPrint(ConstHandle2ConstInternalConversionCoefficients self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +InternalConversionCoefficientsPrintXML(ConstHandle2ConstInternalConversionCoefficients self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +InternalConversionCoefficientsPrintJSON(ConstHandle2ConstInternalConversionCoefficients self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: shell +// ----------------------------------------------------------------------------- + +// Has +int +InternalConversionCoefficientsShellHas(ConstHandle2ConstInternalConversionCoefficients self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ShellHas", self, extract::shell); +} + +// Clear +void +InternalConversionCoefficientsShellClear(ConstHandle2InternalConversionCoefficients self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ShellClear", self, extract::shell); +} + +// Size +size_t +InternalConversionCoefficientsShellSize(ConstHandle2ConstInternalConversionCoefficients self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ShellSize", self, extract::shell); +} + +// Add +void +InternalConversionCoefficientsShellAdd(ConstHandle2InternalConversionCoefficients self, ConstHandle2ConstShell shell) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ShellAdd", self, extract::shell, shell); +} + +// Get, by index \in [0,size), const +Handle2ConstShell +InternalConversionCoefficientsShellGetConst(ConstHandle2ConstInternalConversionCoefficients self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ShellGetConst", self, extract::shell, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Shell +InternalConversionCoefficientsShellGet(ConstHandle2InternalConversionCoefficients self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ShellGet", self, extract::shell, index_); +} + +// Set, by index \in [0,size) +void +InternalConversionCoefficientsShellSet( + ConstHandle2InternalConversionCoefficients self, + const size_t index_, + ConstHandle2ConstShell shell +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ShellSet", self, extract::shell, index_, shell); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +InternalConversionCoefficientsShellHasByLabel( + ConstHandle2ConstInternalConversionCoefficients self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ShellHasByLabel", + self, extract::shell, meta::label, label); +} + +// Get, by label, const +Handle2ConstShell +InternalConversionCoefficientsShellGetByLabelConst( + ConstHandle2ConstInternalConversionCoefficients self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByLabelConst", + self, extract::shell, meta::label, label); +} + +// Get, by label, non-const +Handle2Shell +InternalConversionCoefficientsShellGetByLabel( + ConstHandle2InternalConversionCoefficients self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByLabel", + self, extract::shell, meta::label, label); +} + +// Set, by label +void +InternalConversionCoefficientsShellSetByLabel( + ConstHandle2InternalConversionCoefficients self, + const char *const label, + ConstHandle2ConstShell shell +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ShellSetByLabel", + self, extract::shell, meta::label, label, shell); +} + +// ------------------------ +// Re: metadatum value +// ------------------------ + +// Has, by value +int +InternalConversionCoefficientsShellHasByValue( + ConstHandle2ConstInternalConversionCoefficients self, + const double value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ShellHasByValue", + self, extract::shell, meta::value, value); +} + +// Get, by value, const +Handle2ConstShell +InternalConversionCoefficientsShellGetByValueConst( + ConstHandle2ConstInternalConversionCoefficients self, + const double value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByValueConst", + self, extract::shell, meta::value, value); +} + +// Get, by value, non-const +Handle2Shell +InternalConversionCoefficientsShellGetByValue( + ConstHandle2InternalConversionCoefficients self, + const double value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ShellGetByValue", + self, extract::shell, meta::value, value); +} + +// Set, by value +void +InternalConversionCoefficientsShellSetByValue( + ConstHandle2InternalConversionCoefficients self, + const double value, + ConstHandle2ConstShell shell +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ShellSetByValue", + self, extract::shell, meta::value, value, shell); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/InternalConversionCoefficients/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/InternalConversionCoefficients.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/InternalConversionCoefficients.h new file mode 100644 index 000000000..1e371f5fb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/InternalConversionCoefficients.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// InternalConversionCoefficients is the basic handle type in this file. Example: +// // Create a default InternalConversionCoefficients object: +// InternalConversionCoefficients handle = InternalConversionCoefficientsDefault(); +// Functions involving InternalConversionCoefficients are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_INTERNALCONVERSIONCOEFFICIENTS +#define C_INTERFACE_GNDS_V2_0_GENERAL_INTERNALCONVERSIONCOEFFICIENTS + +#include "GNDStk.h" +#include "v2.0/general/Shell.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct InternalConversionCoefficientsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ InternalConversionCoefficients +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct InternalConversionCoefficientsClass *InternalConversionCoefficients; + +// --- Const-aware handles. +typedef const struct InternalConversionCoefficientsClass *const ConstHandle2ConstInternalConversionCoefficients; +typedef struct InternalConversionCoefficientsClass *const ConstHandle2InternalConversionCoefficients; +typedef const struct InternalConversionCoefficientsClass * Handle2ConstInternalConversionCoefficients; +typedef struct InternalConversionCoefficientsClass * Handle2InternalConversionCoefficients; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstInternalConversionCoefficients +InternalConversionCoefficientsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2InternalConversionCoefficients +InternalConversionCoefficientsDefault(); + +// --- Create, general, const +extern_c Handle2ConstInternalConversionCoefficients +InternalConversionCoefficientsCreateConst( + ConstHandle2Shell *const shell, const size_t shellSize +); + +// +++ Create, general, non-const +extern_c Handle2InternalConversionCoefficients +InternalConversionCoefficientsCreate( + ConstHandle2Shell *const shell, const size_t shellSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +InternalConversionCoefficientsAssign(ConstHandle2InternalConversionCoefficients self, ConstHandle2ConstInternalConversionCoefficients from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +InternalConversionCoefficientsDelete(ConstHandle2ConstInternalConversionCoefficients self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +InternalConversionCoefficientsRead(ConstHandle2InternalConversionCoefficients self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +InternalConversionCoefficientsWrite(ConstHandle2ConstInternalConversionCoefficients self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +InternalConversionCoefficientsPrint(ConstHandle2ConstInternalConversionCoefficients self); + +// +++ Print to standard output, as XML +extern_c int +InternalConversionCoefficientsPrintXML(ConstHandle2ConstInternalConversionCoefficients self); + +// +++ Print to standard output, as JSON +extern_c int +InternalConversionCoefficientsPrintJSON(ConstHandle2ConstInternalConversionCoefficients self); + + +// ----------------------------------------------------------------------------- +// Child: shell +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +InternalConversionCoefficientsShellHas(ConstHandle2ConstInternalConversionCoefficients self); + +// +++ Clear +extern_c void +InternalConversionCoefficientsShellClear(ConstHandle2InternalConversionCoefficients self); + +// +++ Size +extern_c size_t +InternalConversionCoefficientsShellSize(ConstHandle2ConstInternalConversionCoefficients self); + +// +++ Add +extern_c void +InternalConversionCoefficientsShellAdd(ConstHandle2InternalConversionCoefficients self, ConstHandle2ConstShell shell); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstShell +InternalConversionCoefficientsShellGetConst(ConstHandle2ConstInternalConversionCoefficients self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Shell +InternalConversionCoefficientsShellGet(ConstHandle2InternalConversionCoefficients self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +InternalConversionCoefficientsShellSet( + ConstHandle2InternalConversionCoefficients self, + const size_t index_, + ConstHandle2ConstShell shell +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +InternalConversionCoefficientsShellHasByLabel( + ConstHandle2ConstInternalConversionCoefficients self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstShell +InternalConversionCoefficientsShellGetByLabelConst( + ConstHandle2ConstInternalConversionCoefficients self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Shell +InternalConversionCoefficientsShellGetByLabel( + ConstHandle2InternalConversionCoefficients self, + const char *const label +); + +// +++ Set, by label +extern_c void +InternalConversionCoefficientsShellSetByLabel( + ConstHandle2InternalConversionCoefficients self, + const char *const label, + ConstHandle2ConstShell shell +); + +// ------------------------ +// Re: metadatum value +// ------------------------ + +// +++ Has, by value +extern_c int +InternalConversionCoefficientsShellHasByValue( + ConstHandle2ConstInternalConversionCoefficients self, + const double value +); + +// --- Get, by value, const +extern_c Handle2ConstShell +InternalConversionCoefficientsShellGetByValueConst( + ConstHandle2ConstInternalConversionCoefficients self, + const double value +); + +// +++ Get, by value, non-const +extern_c Handle2Shell +InternalConversionCoefficientsShellGetByValue( + ConstHandle2InternalConversionCoefficients self, + const double value +); + +// +++ Set, by value +extern_c void +InternalConversionCoefficientsShellSetByValue( + ConstHandle2InternalConversionCoefficients self, + const double value, + ConstHandle2ConstShell shell +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/InternalConversionCoefficients/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/InternalConversionCoefficients/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/InternalConversionCoefficients/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/InternalConversionCoefficients/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/InternalConversionCoefficients/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotope.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotope.cpp new file mode 100644 index 000000000..6268a8a3c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotope.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Isotope.hpp" +#include "Isotope.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = IsotopeClass; +using CPP = multigroup::Isotope; + +static const std::string CLASSNAME = "Isotope"; + +namespace extract { + static auto symbol = [](auto &obj) { return &obj.symbol; }; + static auto A = [](auto &obj) { return &obj.A; }; + static auto nuclides = [](auto &obj) { return &obj.nuclides; }; +} + +using CPPNuclides = general::Nuclides; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIsotope +IsotopeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Isotope +IsotopeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIsotope +IsotopeCreateConst( + const char *const symbol, + const int A, + ConstHandle2ConstNuclides nuclides +) { + ConstHandle2Isotope handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + symbol, + A, + detail::tocpp(nuclides) + ); + return handle; +} + +// Create, general, non-const +Handle2Isotope +IsotopeCreate( + const char *const symbol, + const int A, + ConstHandle2ConstNuclides nuclides +) { + ConstHandle2Isotope handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + symbol, + A, + detail::tocpp(nuclides) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +IsotopeAssign(ConstHandle2Isotope self, ConstHandle2ConstIsotope from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IsotopeDelete(ConstHandle2ConstIsotope self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IsotopeRead(ConstHandle2Isotope self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IsotopeWrite(ConstHandle2ConstIsotope self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IsotopePrint(ConstHandle2ConstIsotope self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IsotopePrintXML(ConstHandle2ConstIsotope self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IsotopePrintJSON(ConstHandle2ConstIsotope self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: symbol +// ----------------------------------------------------------------------------- + +// Has +int +IsotopeSymbolHas(ConstHandle2ConstIsotope self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SymbolHas", self, extract::symbol); +} + +// Get +// Returns by value +const char * +IsotopeSymbolGet(ConstHandle2ConstIsotope self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SymbolGet", self, extract::symbol); +} + +// Set +void +IsotopeSymbolSet(ConstHandle2Isotope self, const char *const symbol) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SymbolSet", self, extract::symbol, symbol); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: A +// ----------------------------------------------------------------------------- + +// Has +int +IsotopeAHas(ConstHandle2ConstIsotope self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AHas", self, extract::A); +} + +// Get +// Returns by value +int +IsotopeAGet(ConstHandle2ConstIsotope self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AGet", self, extract::A); +} + +// Set +void +IsotopeASet(ConstHandle2Isotope self, const int A) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ASet", self, extract::A, A); +} + + +// ----------------------------------------------------------------------------- +// Child: nuclides +// ----------------------------------------------------------------------------- + +// Has +int +IsotopeNuclidesHas(ConstHandle2ConstIsotope self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NuclidesHas", self, extract::nuclides); +} + +// Get, const +Handle2ConstNuclides +IsotopeNuclidesGetConst(ConstHandle2ConstIsotope self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclidesGetConst", self, extract::nuclides); +} + +// Get, non-const +Handle2Nuclides +IsotopeNuclidesGet(ConstHandle2Isotope self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclidesGet", self, extract::nuclides); +} + +// Set +void +IsotopeNuclidesSet(ConstHandle2Isotope self, ConstHandle2ConstNuclides nuclides) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NuclidesSet", self, extract::nuclides, nuclides); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Isotope/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotope.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotope.h new file mode 100644 index 000000000..890c15bfb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotope.h @@ -0,0 +1,201 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Isotope is the basic handle type in this file. Example: +// // Create a default Isotope object: +// Isotope handle = IsotopeDefault(); +// Functions involving Isotope are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ISOTOPE +#define C_INTERFACE_GNDS_V2_0_GENERAL_ISOTOPE + +#include "GNDStk.h" +#include "v2.0/general/Nuclides.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IsotopeClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Isotope +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IsotopeClass *Isotope; + +// --- Const-aware handles. +typedef const struct IsotopeClass *const ConstHandle2ConstIsotope; +typedef struct IsotopeClass *const ConstHandle2Isotope; +typedef const struct IsotopeClass * Handle2ConstIsotope; +typedef struct IsotopeClass * Handle2Isotope; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstIsotope +IsotopeDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Isotope +IsotopeDefault(); + +// --- Create, general, const +extern_c Handle2ConstIsotope +IsotopeCreateConst( + const char *const symbol, + const int A, + ConstHandle2ConstNuclides nuclides +); + +// +++ Create, general, non-const +extern_c Handle2Isotope +IsotopeCreate( + const char *const symbol, + const int A, + ConstHandle2ConstNuclides nuclides +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IsotopeAssign(ConstHandle2Isotope self, ConstHandle2ConstIsotope from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IsotopeDelete(ConstHandle2ConstIsotope self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IsotopeRead(ConstHandle2Isotope self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IsotopeWrite(ConstHandle2ConstIsotope self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IsotopePrint(ConstHandle2ConstIsotope self); + +// +++ Print to standard output, as XML +extern_c int +IsotopePrintXML(ConstHandle2ConstIsotope self); + +// +++ Print to standard output, as JSON +extern_c int +IsotopePrintJSON(ConstHandle2ConstIsotope self); + + +// ----------------------------------------------------------------------------- +// Metadatum: symbol +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IsotopeSymbolHas(ConstHandle2ConstIsotope self); + +// +++ Get +// +++ Returns by value +extern_c const char * +IsotopeSymbolGet(ConstHandle2ConstIsotope self); + +// +++ Set +extern_c void +IsotopeSymbolSet(ConstHandle2Isotope self, const char *const symbol); + + +// ----------------------------------------------------------------------------- +// Metadatum: A +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IsotopeAHas(ConstHandle2ConstIsotope self); + +// +++ Get +// +++ Returns by value +extern_c int +IsotopeAGet(ConstHandle2ConstIsotope self); + +// +++ Set +extern_c void +IsotopeASet(ConstHandle2Isotope self, const int A); + + +// ----------------------------------------------------------------------------- +// Child: nuclides +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IsotopeNuclidesHas(ConstHandle2ConstIsotope self); + +// --- Get, const +extern_c Handle2ConstNuclides +IsotopeNuclidesGetConst(ConstHandle2ConstIsotope self); + +// +++ Get, non-const +extern_c Handle2Nuclides +IsotopeNuclidesGet(ConstHandle2Isotope self); + +// +++ Set +extern_c void +IsotopeNuclidesSet(ConstHandle2Isotope self, ConstHandle2ConstNuclides nuclides); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Isotope/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotope/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotope/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotope/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotope/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotopes.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotopes.cpp new file mode 100644 index 000000000..9a888dc4c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotopes.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Isotopes.hpp" +#include "Isotopes.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = IsotopesClass; +using CPP = multigroup::Isotopes; + +static const std::string CLASSNAME = "Isotopes"; + +namespace extract { + static auto isotope = [](auto &obj) { return &obj.isotope; }; +} + +using CPPIsotope = general::Isotope; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIsotopes +IsotopesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Isotopes +IsotopesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIsotopes +IsotopesCreateConst( + ConstHandle2Isotope *const isotope, const size_t isotopeSize +) { + ConstHandle2Isotopes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t IsotopeN = 0; IsotopeN < isotopeSize; ++IsotopeN) + IsotopesIsotopeAdd(handle, isotope[IsotopeN]); + return handle; +} + +// Create, general, non-const +Handle2Isotopes +IsotopesCreate( + ConstHandle2Isotope *const isotope, const size_t isotopeSize +) { + ConstHandle2Isotopes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t IsotopeN = 0; IsotopeN < isotopeSize; ++IsotopeN) + IsotopesIsotopeAdd(handle, isotope[IsotopeN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +IsotopesAssign(ConstHandle2Isotopes self, ConstHandle2ConstIsotopes from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +IsotopesDelete(ConstHandle2ConstIsotopes self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +IsotopesRead(ConstHandle2Isotopes self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +IsotopesWrite(ConstHandle2ConstIsotopes self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +IsotopesPrint(ConstHandle2ConstIsotopes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +IsotopesPrintXML(ConstHandle2ConstIsotopes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +IsotopesPrintJSON(ConstHandle2ConstIsotopes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: isotope +// ----------------------------------------------------------------------------- + +// Has +int +IsotopesIsotopeHas(ConstHandle2ConstIsotopes self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IsotopeHas", self, extract::isotope); +} + +// Clear +void +IsotopesIsotopeClear(ConstHandle2Isotopes self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"IsotopeClear", self, extract::isotope); +} + +// Size +size_t +IsotopesIsotopeSize(ConstHandle2ConstIsotopes self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"IsotopeSize", self, extract::isotope); +} + +// Add +void +IsotopesIsotopeAdd(ConstHandle2Isotopes self, ConstHandle2ConstIsotope isotope) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"IsotopeAdd", self, extract::isotope, isotope); +} + +// Get, by index \in [0,size), const +Handle2ConstIsotope +IsotopesIsotopeGetConst(ConstHandle2ConstIsotopes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IsotopeGetConst", self, extract::isotope, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Isotope +IsotopesIsotopeGet(ConstHandle2Isotopes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"IsotopeGet", self, extract::isotope, index_); +} + +// Set, by index \in [0,size) +void +IsotopesIsotopeSet( + ConstHandle2Isotopes self, + const size_t index_, + ConstHandle2ConstIsotope isotope +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"IsotopeSet", self, extract::isotope, index_, isotope); +} + +// ------------------------ +// Re: metadatum symbol +// ------------------------ + +// Has, by symbol +int +IsotopesIsotopeHasBySymbol( + ConstHandle2ConstIsotopes self, + const char *const symbol +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeHasBySymbol", + self, extract::isotope, meta::symbol, symbol); +} + +// Get, by symbol, const +Handle2ConstIsotope +IsotopesIsotopeGetBySymbolConst( + ConstHandle2ConstIsotopes self, + const char *const symbol +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeGetBySymbolConst", + self, extract::isotope, meta::symbol, symbol); +} + +// Get, by symbol, non-const +Handle2Isotope +IsotopesIsotopeGetBySymbol( + ConstHandle2Isotopes self, + const char *const symbol +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeGetBySymbol", + self, extract::isotope, meta::symbol, symbol); +} + +// Set, by symbol +void +IsotopesIsotopeSetBySymbol( + ConstHandle2Isotopes self, + const char *const symbol, + ConstHandle2ConstIsotope isotope +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeSetBySymbol", + self, extract::isotope, meta::symbol, symbol, isotope); +} + +// ------------------------ +// Re: metadatum A +// ------------------------ + +// Has, by A +int +IsotopesIsotopeHasByA( + ConstHandle2ConstIsotopes self, + const int A +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeHasByA", + self, extract::isotope, meta::A, A); +} + +// Get, by A, const +Handle2ConstIsotope +IsotopesIsotopeGetByAConst( + ConstHandle2ConstIsotopes self, + const int A +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeGetByAConst", + self, extract::isotope, meta::A, A); +} + +// Get, by A, non-const +Handle2Isotope +IsotopesIsotopeGetByA( + ConstHandle2Isotopes self, + const int A +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeGetByA", + self, extract::isotope, meta::A, A); +} + +// Set, by A +void +IsotopesIsotopeSetByA( + ConstHandle2Isotopes self, + const int A, + ConstHandle2ConstIsotope isotope +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"IsotopeSetByA", + self, extract::isotope, meta::A, A, isotope); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Isotopes/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotopes.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotopes.h new file mode 100644 index 000000000..e5ad515e7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotopes.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Isotopes is the basic handle type in this file. Example: +// // Create a default Isotopes object: +// Isotopes handle = IsotopesDefault(); +// Functions involving Isotopes are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ISOTOPES +#define C_INTERFACE_GNDS_V2_0_GENERAL_ISOTOPES + +#include "GNDStk.h" +#include "v2.0/general/Isotope.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct IsotopesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Isotopes +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct IsotopesClass *Isotopes; + +// --- Const-aware handles. +typedef const struct IsotopesClass *const ConstHandle2ConstIsotopes; +typedef struct IsotopesClass *const ConstHandle2Isotopes; +typedef const struct IsotopesClass * Handle2ConstIsotopes; +typedef struct IsotopesClass * Handle2Isotopes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstIsotopes +IsotopesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Isotopes +IsotopesDefault(); + +// --- Create, general, const +extern_c Handle2ConstIsotopes +IsotopesCreateConst( + ConstHandle2Isotope *const isotope, const size_t isotopeSize +); + +// +++ Create, general, non-const +extern_c Handle2Isotopes +IsotopesCreate( + ConstHandle2Isotope *const isotope, const size_t isotopeSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +IsotopesAssign(ConstHandle2Isotopes self, ConstHandle2ConstIsotopes from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +IsotopesDelete(ConstHandle2ConstIsotopes self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +IsotopesRead(ConstHandle2Isotopes self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +IsotopesWrite(ConstHandle2ConstIsotopes self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +IsotopesPrint(ConstHandle2ConstIsotopes self); + +// +++ Print to standard output, as XML +extern_c int +IsotopesPrintXML(ConstHandle2ConstIsotopes self); + +// +++ Print to standard output, as JSON +extern_c int +IsotopesPrintJSON(ConstHandle2ConstIsotopes self); + + +// ----------------------------------------------------------------------------- +// Child: isotope +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +IsotopesIsotopeHas(ConstHandle2ConstIsotopes self); + +// +++ Clear +extern_c void +IsotopesIsotopeClear(ConstHandle2Isotopes self); + +// +++ Size +extern_c size_t +IsotopesIsotopeSize(ConstHandle2ConstIsotopes self); + +// +++ Add +extern_c void +IsotopesIsotopeAdd(ConstHandle2Isotopes self, ConstHandle2ConstIsotope isotope); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstIsotope +IsotopesIsotopeGetConst(ConstHandle2ConstIsotopes self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Isotope +IsotopesIsotopeGet(ConstHandle2Isotopes self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +IsotopesIsotopeSet( + ConstHandle2Isotopes self, + const size_t index_, + ConstHandle2ConstIsotope isotope +); + +// ------------------------ +// Re: metadatum symbol +// ------------------------ + +// +++ Has, by symbol +extern_c int +IsotopesIsotopeHasBySymbol( + ConstHandle2ConstIsotopes self, + const char *const symbol +); + +// --- Get, by symbol, const +extern_c Handle2ConstIsotope +IsotopesIsotopeGetBySymbolConst( + ConstHandle2ConstIsotopes self, + const char *const symbol +); + +// +++ Get, by symbol, non-const +extern_c Handle2Isotope +IsotopesIsotopeGetBySymbol( + ConstHandle2Isotopes self, + const char *const symbol +); + +// +++ Set, by symbol +extern_c void +IsotopesIsotopeSetBySymbol( + ConstHandle2Isotopes self, + const char *const symbol, + ConstHandle2ConstIsotope isotope +); + +// ------------------------ +// Re: metadatum A +// ------------------------ + +// +++ Has, by A +extern_c int +IsotopesIsotopeHasByA( + ConstHandle2ConstIsotopes self, + const int A +); + +// --- Get, by A, const +extern_c Handle2ConstIsotope +IsotopesIsotopeGetByAConst( + ConstHandle2ConstIsotopes self, + const int A +); + +// +++ Get, by A, non-const +extern_c Handle2Isotope +IsotopesIsotopeGetByA( + ConstHandle2Isotopes self, + const int A +); + +// +++ Set, by A +extern_c void +IsotopesIsotopeSetByA( + ConstHandle2Isotopes self, + const int A, + ConstHandle2ConstIsotope isotope +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Isotopes/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotopes/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotopes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotopes/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotopes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotropic2d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotropic2d.cpp new file mode 100644 index 000000000..73d63f56f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotropic2d.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Isotropic2d.hpp" +#include "Isotropic2d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Isotropic2dClass; +using CPP = multigroup::Isotropic2d; + +static const std::string CLASSNAME = "Isotropic2d"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstIsotropic2d +Isotropic2dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Isotropic2d +Isotropic2dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstIsotropic2d +Isotropic2dCreateConst() +{ + ConstHandle2Isotropic2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general, non-const +Handle2Isotropic2d +Isotropic2dCreate() +{ + ConstHandle2Isotropic2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create" + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Isotropic2dAssign(ConstHandle2Isotropic2d self, ConstHandle2ConstIsotropic2d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Isotropic2dDelete(ConstHandle2ConstIsotropic2d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Isotropic2dRead(ConstHandle2Isotropic2d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Isotropic2dWrite(ConstHandle2ConstIsotropic2d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Isotropic2dPrint(ConstHandle2ConstIsotropic2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Isotropic2dPrintXML(ConstHandle2ConstIsotropic2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Isotropic2dPrintJSON(ConstHandle2ConstIsotropic2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Isotropic2d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotropic2d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotropic2d.h new file mode 100644 index 000000000..4c00113a1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotropic2d.h @@ -0,0 +1,135 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Isotropic2d is the basic handle type in this file. Example: +// // Create a default Isotropic2d object: +// Isotropic2d handle = Isotropic2dDefault(); +// Functions involving Isotropic2d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ISOTROPIC2D +#define C_INTERFACE_GNDS_V2_0_GENERAL_ISOTROPIC2D + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Isotropic2dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Isotropic2d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Isotropic2dClass *Isotropic2d; + +// --- Const-aware handles. +typedef const struct Isotropic2dClass *const ConstHandle2ConstIsotropic2d; +typedef struct Isotropic2dClass *const ConstHandle2Isotropic2d; +typedef const struct Isotropic2dClass * Handle2ConstIsotropic2d; +typedef struct Isotropic2dClass * Handle2Isotropic2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstIsotropic2d +Isotropic2dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Isotropic2d +Isotropic2dDefault(); + +// --- Create, general, const +extern_c Handle2ConstIsotropic2d +Isotropic2dCreateConst(); + +// +++ Create, general, non-const +extern_c Handle2Isotropic2d +Isotropic2dCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Isotropic2dAssign(ConstHandle2Isotropic2d self, ConstHandle2ConstIsotropic2d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Isotropic2dDelete(ConstHandle2ConstIsotropic2d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Isotropic2dRead(ConstHandle2Isotropic2d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Isotropic2dWrite(ConstHandle2ConstIsotropic2d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Isotropic2dPrint(ConstHandle2ConstIsotropic2d self); + +// +++ Print to standard output, as XML +extern_c int +Isotropic2dPrintXML(ConstHandle2ConstIsotropic2d self); + +// +++ Print to standard output, as JSON +extern_c int +Isotropic2dPrintJSON(ConstHandle2ConstIsotropic2d self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Isotropic2d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotropic2d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotropic2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotropic2d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Isotropic2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/J.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/J.cpp new file mode 100644 index 000000000..d86e9447f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/J.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/J.hpp" +#include "J.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = JClass; +using CPP = multigroup::J; + +static const std::string CLASSNAME = "J"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto levelSpacing = [](auto &obj) { return &obj.levelSpacing; }; + static auto widths = [](auto &obj) { return &obj.widths; }; +} + +using CPPLevelSpacing = general::LevelSpacing; +using CPPWidths = general::Widths; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstJ +JDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2J +JDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstJ +JCreateConst( + const char *const label, + const int value, + ConstHandle2ConstLevelSpacing levelSpacing, + ConstHandle2ConstWidths widths +) { + ConstHandle2J handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + detail::tocpp(levelSpacing), + detail::tocpp(widths) + ); + return handle; +} + +// Create, general, non-const +Handle2J +JCreate( + const char *const label, + const int value, + ConstHandle2ConstLevelSpacing levelSpacing, + ConstHandle2ConstWidths widths +) { + ConstHandle2J handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + detail::tocpp(levelSpacing), + detail::tocpp(widths) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +JAssign(ConstHandle2J self, ConstHandle2ConstJ from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +JDelete(ConstHandle2ConstJ self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +JRead(ConstHandle2J self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +JWrite(ConstHandle2ConstJ self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +JPrint(ConstHandle2ConstJ self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +JPrintXML(ConstHandle2ConstJ self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +JPrintJSON(ConstHandle2ConstJ self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +JLabelHas(ConstHandle2ConstJ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +JLabelGet(ConstHandle2ConstJ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +JLabelSet(ConstHandle2J self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +JValueHas(ConstHandle2ConstJ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +int +JValueGet(ConstHandle2ConstJ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +JValueSet(ConstHandle2J self, const int value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: levelSpacing +// ----------------------------------------------------------------------------- + +// Has +int +JLevelSpacingHas(ConstHandle2ConstJ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LevelSpacingHas", self, extract::levelSpacing); +} + +// Get, const +Handle2ConstLevelSpacing +JLevelSpacingGetConst(ConstHandle2ConstJ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LevelSpacingGetConst", self, extract::levelSpacing); +} + +// Get, non-const +Handle2LevelSpacing +JLevelSpacingGet(ConstHandle2J self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LevelSpacingGet", self, extract::levelSpacing); +} + +// Set +void +JLevelSpacingSet(ConstHandle2J self, ConstHandle2ConstLevelSpacing levelSpacing) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LevelSpacingSet", self, extract::levelSpacing, levelSpacing); +} + + +// ----------------------------------------------------------------------------- +// Child: widths +// ----------------------------------------------------------------------------- + +// Has +int +JWidthsHas(ConstHandle2ConstJ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"WidthsHas", self, extract::widths); +} + +// Get, const +Handle2ConstWidths +JWidthsGetConst(ConstHandle2ConstJ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WidthsGetConst", self, extract::widths); +} + +// Get, non-const +Handle2Widths +JWidthsGet(ConstHandle2J self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"WidthsGet", self, extract::widths); +} + +// Set +void +JWidthsSet(ConstHandle2J self, ConstHandle2ConstWidths widths) +{ + detail::setField + (CLASSNAME, CLASSNAME+"WidthsSet", self, extract::widths, widths); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/J/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/J.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/J.h new file mode 100644 index 000000000..47ae010f3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/J.h @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// J is the basic handle type in this file. Example: +// // Create a default J object: +// J handle = JDefault(); +// Functions involving J are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_J +#define C_INTERFACE_GNDS_V2_0_GENERAL_J + +#include "GNDStk.h" +#include "v2.0/general/LevelSpacing.h" +#include "v2.0/general/Widths.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct JClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ J +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct JClass *J; + +// --- Const-aware handles. +typedef const struct JClass *const ConstHandle2ConstJ; +typedef struct JClass *const ConstHandle2J; +typedef const struct JClass * Handle2ConstJ; +typedef struct JClass * Handle2J; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstJ +JDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2J +JDefault(); + +// --- Create, general, const +extern_c Handle2ConstJ +JCreateConst( + const char *const label, + const int value, + ConstHandle2ConstLevelSpacing levelSpacing, + ConstHandle2ConstWidths widths +); + +// +++ Create, general, non-const +extern_c Handle2J +JCreate( + const char *const label, + const int value, + ConstHandle2ConstLevelSpacing levelSpacing, + ConstHandle2ConstWidths widths +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +JAssign(ConstHandle2J self, ConstHandle2ConstJ from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +JDelete(ConstHandle2ConstJ self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +JRead(ConstHandle2J self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +JWrite(ConstHandle2ConstJ self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +JPrint(ConstHandle2ConstJ self); + +// +++ Print to standard output, as XML +extern_c int +JPrintXML(ConstHandle2ConstJ self); + +// +++ Print to standard output, as JSON +extern_c int +JPrintJSON(ConstHandle2ConstJ self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +JLabelHas(ConstHandle2ConstJ self); + +// +++ Get +// +++ Returns by value +extern_c const char * +JLabelGet(ConstHandle2ConstJ self); + +// +++ Set +extern_c void +JLabelSet(ConstHandle2J self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +JValueHas(ConstHandle2ConstJ self); + +// +++ Get +// +++ Returns by value +extern_c int +JValueGet(ConstHandle2ConstJ self); + +// +++ Set +extern_c void +JValueSet(ConstHandle2J self, const int value); + + +// ----------------------------------------------------------------------------- +// Child: levelSpacing +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +JLevelSpacingHas(ConstHandle2ConstJ self); + +// --- Get, const +extern_c Handle2ConstLevelSpacing +JLevelSpacingGetConst(ConstHandle2ConstJ self); + +// +++ Get, non-const +extern_c Handle2LevelSpacing +JLevelSpacingGet(ConstHandle2J self); + +// +++ Set +extern_c void +JLevelSpacingSet(ConstHandle2J self, ConstHandle2ConstLevelSpacing levelSpacing); + + +// ----------------------------------------------------------------------------- +// Child: widths +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +JWidthsHas(ConstHandle2ConstJ self); + +// --- Get, const +extern_c Handle2ConstWidths +JWidthsGetConst(ConstHandle2ConstJ self); + +// +++ Get, non-const +extern_c Handle2Widths +JWidthsGet(ConstHandle2J self); + +// +++ Set +extern_c void +JWidthsSet(ConstHandle2J self, ConstHandle2ConstWidths widths); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/J/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/J/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/J/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/J/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/J/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Js.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Js.cpp new file mode 100644 index 000000000..3651ded47 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Js.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Js.hpp" +#include "Js.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = JsClass; +using CPP = multigroup::Js; + +static const std::string CLASSNAME = "Js"; + +namespace extract { + static auto J = [](auto &obj) { return &obj.J; }; +} + +using CPPJ = general::J; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstJs +JsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Js +JsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstJs +JsCreateConst( + ConstHandle2J *const J, const size_t JSize +) { + ConstHandle2Js handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t JN = 0; JN < JSize; ++JN) + JsJAdd(handle, J[JN]); + return handle; +} + +// Create, general, non-const +Handle2Js +JsCreate( + ConstHandle2J *const J, const size_t JSize +) { + ConstHandle2Js handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t JN = 0; JN < JSize; ++JN) + JsJAdd(handle, J[JN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +JsAssign(ConstHandle2Js self, ConstHandle2ConstJs from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +JsDelete(ConstHandle2ConstJs self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +JsRead(ConstHandle2Js self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +JsWrite(ConstHandle2ConstJs self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +JsPrint(ConstHandle2ConstJs self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +JsPrintXML(ConstHandle2ConstJs self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +JsPrintJSON(ConstHandle2ConstJs self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: J +// ----------------------------------------------------------------------------- + +// Has +int +JsJHas(ConstHandle2ConstJs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"JHas", self, extract::J); +} + +// Clear +void +JsJClear(ConstHandle2Js self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"JClear", self, extract::J); +} + +// Size +size_t +JsJSize(ConstHandle2ConstJs self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"JSize", self, extract::J); +} + +// Add +void +JsJAdd(ConstHandle2Js self, ConstHandle2ConstJ J) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"JAdd", self, extract::J, J); +} + +// Get, by index \in [0,size), const +Handle2ConstJ +JsJGetConst(ConstHandle2ConstJs self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"JGetConst", self, extract::J, index_); +} + +// Get, by index \in [0,size), non-const +Handle2J +JsJGet(ConstHandle2Js self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"JGet", self, extract::J, index_); +} + +// Set, by index \in [0,size) +void +JsJSet( + ConstHandle2Js self, + const size_t index_, + ConstHandle2ConstJ J +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"JSet", self, extract::J, index_, J); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +JsJHasByLabel( + ConstHandle2ConstJs self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"JHasByLabel", + self, extract::J, meta::label, label); +} + +// Get, by label, const +Handle2ConstJ +JsJGetByLabelConst( + ConstHandle2ConstJs self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"JGetByLabelConst", + self, extract::J, meta::label, label); +} + +// Get, by label, non-const +Handle2J +JsJGetByLabel( + ConstHandle2Js self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"JGetByLabel", + self, extract::J, meta::label, label); +} + +// Set, by label +void +JsJSetByLabel( + ConstHandle2Js self, + const char *const label, + ConstHandle2ConstJ J +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"JSetByLabel", + self, extract::J, meta::label, label, J); +} + +// ------------------------ +// Re: metadatum value +// ------------------------ + +// Has, by value +int +JsJHasByValue( + ConstHandle2ConstJs self, + const int value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"JHasByValue", + self, extract::J, meta::value, value); +} + +// Get, by value, const +Handle2ConstJ +JsJGetByValueConst( + ConstHandle2ConstJs self, + const int value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"JGetByValueConst", + self, extract::J, meta::value, value); +} + +// Get, by value, non-const +Handle2J +JsJGetByValue( + ConstHandle2Js self, + const int value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"JGetByValue", + self, extract::J, meta::value, value); +} + +// Set, by value +void +JsJSetByValue( + ConstHandle2Js self, + const int value, + ConstHandle2ConstJ J +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"JSetByValue", + self, extract::J, meta::value, value, J); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Js/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Js.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Js.h new file mode 100644 index 000000000..aefa383c6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Js.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Js is the basic handle type in this file. Example: +// // Create a default Js object: +// Js handle = JsDefault(); +// Functions involving Js are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_JS +#define C_INTERFACE_GNDS_V2_0_GENERAL_JS + +#include "GNDStk.h" +#include "v2.0/general/J.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct JsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Js +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct JsClass *Js; + +// --- Const-aware handles. +typedef const struct JsClass *const ConstHandle2ConstJs; +typedef struct JsClass *const ConstHandle2Js; +typedef const struct JsClass * Handle2ConstJs; +typedef struct JsClass * Handle2Js; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstJs +JsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Js +JsDefault(); + +// --- Create, general, const +extern_c Handle2ConstJs +JsCreateConst( + ConstHandle2J *const J, const size_t JSize +); + +// +++ Create, general, non-const +extern_c Handle2Js +JsCreate( + ConstHandle2J *const J, const size_t JSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +JsAssign(ConstHandle2Js self, ConstHandle2ConstJs from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +JsDelete(ConstHandle2ConstJs self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +JsRead(ConstHandle2Js self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +JsWrite(ConstHandle2ConstJs self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +JsPrint(ConstHandle2ConstJs self); + +// +++ Print to standard output, as XML +extern_c int +JsPrintXML(ConstHandle2ConstJs self); + +// +++ Print to standard output, as JSON +extern_c int +JsPrintJSON(ConstHandle2ConstJs self); + + +// ----------------------------------------------------------------------------- +// Child: J +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +JsJHas(ConstHandle2ConstJs self); + +// +++ Clear +extern_c void +JsJClear(ConstHandle2Js self); + +// +++ Size +extern_c size_t +JsJSize(ConstHandle2ConstJs self); + +// +++ Add +extern_c void +JsJAdd(ConstHandle2Js self, ConstHandle2ConstJ J); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstJ +JsJGetConst(ConstHandle2ConstJs self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2J +JsJGet(ConstHandle2Js self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +JsJSet( + ConstHandle2Js self, + const size_t index_, + ConstHandle2ConstJ J +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +JsJHasByLabel( + ConstHandle2ConstJs self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstJ +JsJGetByLabelConst( + ConstHandle2ConstJs self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2J +JsJGetByLabel( + ConstHandle2Js self, + const char *const label +); + +// +++ Set, by label +extern_c void +JsJSetByLabel( + ConstHandle2Js self, + const char *const label, + ConstHandle2ConstJ J +); + +// ------------------------ +// Re: metadatum value +// ------------------------ + +// +++ Has, by value +extern_c int +JsJHasByValue( + ConstHandle2ConstJs self, + const int value +); + +// --- Get, by value, const +extern_c Handle2ConstJ +JsJGetByValueConst( + ConstHandle2ConstJs self, + const int value +); + +// +++ Get, by value, non-const +extern_c Handle2J +JsJGetByValue( + ConstHandle2Js self, + const int value +); + +// +++ Set, by value +extern_c void +JsJSetByValue( + ConstHandle2Js self, + const int value, + ConstHandle2ConstJ J +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Js/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Js/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Js/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Js/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Js/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/KalbachMann.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/KalbachMann.cpp new file mode 100644 index 000000000..7581dec1b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/KalbachMann.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/KalbachMann.hpp" +#include "KalbachMann.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = KalbachMannClass; +using CPP = multigroup::KalbachMann; + +static const std::string CLASSNAME = "KalbachMann"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto f = [](auto &obj) { return &obj.f; }; + static auto r = [](auto &obj) { return &obj.r; }; +} + +using CPPF = general::F; +using CPPR = general::R; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstKalbachMann +KalbachMannDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2KalbachMann +KalbachMannDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstKalbachMann +KalbachMannCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstF f, + ConstHandle2ConstR r +) { + ConstHandle2KalbachMann handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(f), + detail::tocpp(r) + ); + return handle; +} + +// Create, general, non-const +Handle2KalbachMann +KalbachMannCreate( + const char *const label, + const char *const productFrame, + ConstHandle2ConstF f, + ConstHandle2ConstR r +) { + ConstHandle2KalbachMann handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(f), + detail::tocpp(r) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +KalbachMannAssign(ConstHandle2KalbachMann self, ConstHandle2ConstKalbachMann from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +KalbachMannDelete(ConstHandle2ConstKalbachMann self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +KalbachMannRead(ConstHandle2KalbachMann self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +KalbachMannWrite(ConstHandle2ConstKalbachMann self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +KalbachMannPrint(ConstHandle2ConstKalbachMann self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +KalbachMannPrintXML(ConstHandle2ConstKalbachMann self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +KalbachMannPrintJSON(ConstHandle2ConstKalbachMann self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +KalbachMannLabelHas(ConstHandle2ConstKalbachMann self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +KalbachMannLabelGet(ConstHandle2ConstKalbachMann self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +KalbachMannLabelSet(ConstHandle2KalbachMann self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +KalbachMannProductFrameHas(ConstHandle2ConstKalbachMann self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +KalbachMannProductFrameGet(ConstHandle2ConstKalbachMann self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +KalbachMannProductFrameSet(ConstHandle2KalbachMann self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: f +// ----------------------------------------------------------------------------- + +// Has +int +KalbachMannFHas(ConstHandle2ConstKalbachMann self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FHas", self, extract::f); +} + +// Get, const +Handle2ConstF +KalbachMannFGetConst(ConstHandle2ConstKalbachMann self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FGetConst", self, extract::f); +} + +// Get, non-const +Handle2F +KalbachMannFGet(ConstHandle2KalbachMann self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FGet", self, extract::f); +} + +// Set +void +KalbachMannFSet(ConstHandle2KalbachMann self, ConstHandle2ConstF f) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FSet", self, extract::f, f); +} + + +// ----------------------------------------------------------------------------- +// Child: r +// ----------------------------------------------------------------------------- + +// Has +int +KalbachMannRHas(ConstHandle2ConstKalbachMann self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RHas", self, extract::r); +} + +// Get, const +Handle2ConstR +KalbachMannRGetConst(ConstHandle2ConstKalbachMann self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RGetConst", self, extract::r); +} + +// Get, non-const +Handle2R +KalbachMannRGet(ConstHandle2KalbachMann self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RGet", self, extract::r); +} + +// Set +void +KalbachMannRSet(ConstHandle2KalbachMann self, ConstHandle2ConstR r) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RSet", self, extract::r, r); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/KalbachMann/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/KalbachMann.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/KalbachMann.h new file mode 100644 index 000000000..ffa2f3760 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/KalbachMann.h @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// KalbachMann is the basic handle type in this file. Example: +// // Create a default KalbachMann object: +// KalbachMann handle = KalbachMannDefault(); +// Functions involving KalbachMann are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_KALBACHMANN +#define C_INTERFACE_GNDS_V2_0_GENERAL_KALBACHMANN + +#include "GNDStk.h" +#include "v2.0/general/F.h" +#include "v2.0/general/R.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct KalbachMannClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ KalbachMann +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct KalbachMannClass *KalbachMann; + +// --- Const-aware handles. +typedef const struct KalbachMannClass *const ConstHandle2ConstKalbachMann; +typedef struct KalbachMannClass *const ConstHandle2KalbachMann; +typedef const struct KalbachMannClass * Handle2ConstKalbachMann; +typedef struct KalbachMannClass * Handle2KalbachMann; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstKalbachMann +KalbachMannDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2KalbachMann +KalbachMannDefault(); + +// --- Create, general, const +extern_c Handle2ConstKalbachMann +KalbachMannCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstF f, + ConstHandle2ConstR r +); + +// +++ Create, general, non-const +extern_c Handle2KalbachMann +KalbachMannCreate( + const char *const label, + const char *const productFrame, + ConstHandle2ConstF f, + ConstHandle2ConstR r +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +KalbachMannAssign(ConstHandle2KalbachMann self, ConstHandle2ConstKalbachMann from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +KalbachMannDelete(ConstHandle2ConstKalbachMann self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +KalbachMannRead(ConstHandle2KalbachMann self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +KalbachMannWrite(ConstHandle2ConstKalbachMann self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +KalbachMannPrint(ConstHandle2ConstKalbachMann self); + +// +++ Print to standard output, as XML +extern_c int +KalbachMannPrintXML(ConstHandle2ConstKalbachMann self); + +// +++ Print to standard output, as JSON +extern_c int +KalbachMannPrintJSON(ConstHandle2ConstKalbachMann self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +KalbachMannLabelHas(ConstHandle2ConstKalbachMann self); + +// +++ Get +// +++ Returns by value +extern_c const char * +KalbachMannLabelGet(ConstHandle2ConstKalbachMann self); + +// +++ Set +extern_c void +KalbachMannLabelSet(ConstHandle2KalbachMann self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +KalbachMannProductFrameHas(ConstHandle2ConstKalbachMann self); + +// +++ Get +// +++ Returns by value +extern_c const char * +KalbachMannProductFrameGet(ConstHandle2ConstKalbachMann self); + +// +++ Set +extern_c void +KalbachMannProductFrameSet(ConstHandle2KalbachMann self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Child: f +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +KalbachMannFHas(ConstHandle2ConstKalbachMann self); + +// --- Get, const +extern_c Handle2ConstF +KalbachMannFGetConst(ConstHandle2ConstKalbachMann self); + +// +++ Get, non-const +extern_c Handle2F +KalbachMannFGet(ConstHandle2KalbachMann self); + +// +++ Set +extern_c void +KalbachMannFSet(ConstHandle2KalbachMann self, ConstHandle2ConstF f); + + +// ----------------------------------------------------------------------------- +// Child: r +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +KalbachMannRHas(ConstHandle2ConstKalbachMann self); + +// --- Get, const +extern_c Handle2ConstR +KalbachMannRGetConst(ConstHandle2ConstKalbachMann self); + +// +++ Get, non-const +extern_c Handle2R +KalbachMannRGet(ConstHandle2KalbachMann self); + +// +++ Set +extern_c void +KalbachMannRSet(ConstHandle2KalbachMann self, ConstHandle2ConstR r); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/KalbachMann/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/KalbachMann/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/KalbachMann/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/KalbachMann/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/KalbachMann/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/L.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/L.cpp new file mode 100644 index 000000000..6f5ab2a7b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/L.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/L.hpp" +#include "L.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = LClass; +using CPP = multigroup::L; + +static const std::string CLASSNAME = "L"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto Js = [](auto &obj) { return &obj.Js; }; +} + +using CPPJs = general::Js; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstL +LDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2L +LDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstL +LCreateConst( + const char *const label, + const int value, + ConstHandle2ConstJs Js +) { + ConstHandle2L handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + detail::tocpp(Js) + ); + return handle; +} + +// Create, general, non-const +Handle2L +LCreate( + const char *const label, + const int value, + ConstHandle2ConstJs Js +) { + ConstHandle2L handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + detail::tocpp(Js) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +LAssign(ConstHandle2L self, ConstHandle2ConstL from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LDelete(ConstHandle2ConstL self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LRead(ConstHandle2L self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LWrite(ConstHandle2ConstL self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LPrint(ConstHandle2ConstL self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LPrintXML(ConstHandle2ConstL self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LPrintJSON(ConstHandle2ConstL self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +LLabelHas(ConstHandle2ConstL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +LLabelGet(ConstHandle2ConstL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +LLabelSet(ConstHandle2L self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +LValueHas(ConstHandle2ConstL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +int +LValueGet(ConstHandle2ConstL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +LValueSet(ConstHandle2L self, const int value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: Js +// ----------------------------------------------------------------------------- + +// Has +int +LJsHas(ConstHandle2ConstL self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"JsHas", self, extract::Js); +} + +// Get, const +Handle2ConstJs +LJsGetConst(ConstHandle2ConstL self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"JsGetConst", self, extract::Js); +} + +// Get, non-const +Handle2Js +LJsGet(ConstHandle2L self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"JsGet", self, extract::Js); +} + +// Set +void +LJsSet(ConstHandle2L self, ConstHandle2ConstJs Js) +{ + detail::setField + (CLASSNAME, CLASSNAME+"JsSet", self, extract::Js, Js); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/L/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/L.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/L.h new file mode 100644 index 000000000..e4dd559a6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/L.h @@ -0,0 +1,201 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// L is the basic handle type in this file. Example: +// // Create a default L object: +// L handle = LDefault(); +// Functions involving L are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_L +#define C_INTERFACE_GNDS_V2_0_GENERAL_L + +#include "GNDStk.h" +#include "v2.0/general/Js.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ L +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LClass *L; + +// --- Const-aware handles. +typedef const struct LClass *const ConstHandle2ConstL; +typedef struct LClass *const ConstHandle2L; +typedef const struct LClass * Handle2ConstL; +typedef struct LClass * Handle2L; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstL +LDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2L +LDefault(); + +// --- Create, general, const +extern_c Handle2ConstL +LCreateConst( + const char *const label, + const int value, + ConstHandle2ConstJs Js +); + +// +++ Create, general, non-const +extern_c Handle2L +LCreate( + const char *const label, + const int value, + ConstHandle2ConstJs Js +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +LAssign(ConstHandle2L self, ConstHandle2ConstL from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LDelete(ConstHandle2ConstL self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LRead(ConstHandle2L self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LWrite(ConstHandle2ConstL self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LPrint(ConstHandle2ConstL self); + +// +++ Print to standard output, as XML +extern_c int +LPrintXML(ConstHandle2ConstL self); + +// +++ Print to standard output, as JSON +extern_c int +LPrintJSON(ConstHandle2ConstL self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LLabelHas(ConstHandle2ConstL self); + +// +++ Get +// +++ Returns by value +extern_c const char * +LLabelGet(ConstHandle2ConstL self); + +// +++ Set +extern_c void +LLabelSet(ConstHandle2L self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LValueHas(ConstHandle2ConstL self); + +// +++ Get +// +++ Returns by value +extern_c int +LValueGet(ConstHandle2ConstL self); + +// +++ Set +extern_c void +LValueSet(ConstHandle2L self, const int value); + + +// ----------------------------------------------------------------------------- +// Child: Js +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LJsHas(ConstHandle2ConstL self); + +// --- Get, const +extern_c Handle2ConstJs +LJsGetConst(ConstHandle2ConstL self); + +// +++ Get, non-const +extern_c Handle2Js +LJsGet(ConstHandle2L self); + +// +++ Set +extern_c void +LJsSet(ConstHandle2L self, ConstHandle2ConstJs Js); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/L/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/L/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/L/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/L/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/L/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Legendre.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Legendre.cpp new file mode 100644 index 000000000..14a07fc9b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Legendre.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Legendre.hpp" +#include "Legendre.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = LegendreClass; +using CPP = multigroup::Legendre; + +static const std::string CLASSNAME = "Legendre"; + +namespace extract { + static auto outerDomainValue = [](auto &obj) { return &obj.outerDomainValue; }; + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPValues = general::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLegendre +LegendreDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Legendre +LegendreDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLegendre +LegendreCreateConst( + const double outerDomainValue, + ConstHandle2ConstValues values +) { + ConstHandle2Legendre handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + outerDomainValue, + detail::tocpp(values) + ); + return handle; +} + +// Create, general, non-const +Handle2Legendre +LegendreCreate( + const double outerDomainValue, + ConstHandle2ConstValues values +) { + ConstHandle2Legendre handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + outerDomainValue, + detail::tocpp(values) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +LegendreAssign(ConstHandle2Legendre self, ConstHandle2ConstLegendre from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LegendreDelete(ConstHandle2ConstLegendre self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LegendreRead(ConstHandle2Legendre self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LegendreWrite(ConstHandle2ConstLegendre self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LegendrePrint(ConstHandle2ConstLegendre self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LegendrePrintXML(ConstHandle2ConstLegendre self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LegendrePrintJSON(ConstHandle2ConstLegendre self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +LegendreOuterDomainValueHas(ConstHandle2ConstLegendre self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +double +LegendreOuterDomainValueGet(ConstHandle2ConstLegendre self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +LegendreOuterDomainValueSet(ConstHandle2Legendre self, const double outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +LegendreValuesHas(ConstHandle2ConstLegendre self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +LegendreValuesGetConst(ConstHandle2ConstLegendre self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +LegendreValuesGet(ConstHandle2Legendre self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +LegendreValuesSet(ConstHandle2Legendre self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Legendre/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Legendre.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Legendre.h new file mode 100644 index 000000000..68328cd5c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Legendre.h @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Legendre is the basic handle type in this file. Example: +// // Create a default Legendre object: +// Legendre handle = LegendreDefault(); +// Functions involving Legendre are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_LEGENDRE +#define C_INTERFACE_GNDS_V2_0_GENERAL_LEGENDRE + +#include "GNDStk.h" +#include "v2.0/general/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LegendreClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Legendre +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LegendreClass *Legendre; + +// --- Const-aware handles. +typedef const struct LegendreClass *const ConstHandle2ConstLegendre; +typedef struct LegendreClass *const ConstHandle2Legendre; +typedef const struct LegendreClass * Handle2ConstLegendre; +typedef struct LegendreClass * Handle2Legendre; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstLegendre +LegendreDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Legendre +LegendreDefault(); + +// --- Create, general, const +extern_c Handle2ConstLegendre +LegendreCreateConst( + const double outerDomainValue, + ConstHandle2ConstValues values +); + +// +++ Create, general, non-const +extern_c Handle2Legendre +LegendreCreate( + const double outerDomainValue, + ConstHandle2ConstValues values +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +LegendreAssign(ConstHandle2Legendre self, ConstHandle2ConstLegendre from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LegendreDelete(ConstHandle2ConstLegendre self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LegendreRead(ConstHandle2Legendre self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LegendreWrite(ConstHandle2ConstLegendre self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LegendrePrint(ConstHandle2ConstLegendre self); + +// +++ Print to standard output, as XML +extern_c int +LegendrePrintXML(ConstHandle2ConstLegendre self); + +// +++ Print to standard output, as JSON +extern_c int +LegendrePrintJSON(ConstHandle2ConstLegendre self); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LegendreOuterDomainValueHas(ConstHandle2ConstLegendre self); + +// +++ Get +// +++ Returns by value +extern_c double +LegendreOuterDomainValueGet(ConstHandle2ConstLegendre self); + +// +++ Set +extern_c void +LegendreOuterDomainValueSet(ConstHandle2Legendre self, const double outerDomainValue); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LegendreValuesHas(ConstHandle2ConstLegendre self); + +// --- Get, const +extern_c Handle2ConstValues +LegendreValuesGetConst(ConstHandle2ConstLegendre self); + +// +++ Get, non-const +extern_c Handle2Values +LegendreValuesGet(ConstHandle2Legendre self); + +// +++ Set +extern_c void +LegendreValuesSet(ConstHandle2Legendre self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Legendre/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Legendre/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Legendre/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Legendre/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Legendre/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Lepton.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Lepton.cpp new file mode 100644 index 000000000..93755e021 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Lepton.cpp @@ -0,0 +1,423 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Lepton.hpp" +#include "Lepton.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = LeptonClass; +using CPP = multigroup::Lepton; + +static const std::string CLASSNAME = "Lepton"; + +namespace extract { + static auto id = [](auto &obj) { return &obj.id; }; + static auto generation = [](auto &obj) { return &obj.generation; }; + static auto mass = [](auto &obj) { return &obj.mass; }; + static auto spin = [](auto &obj) { return &obj.spin; }; + static auto parity = [](auto &obj) { return &obj.parity; }; + static auto charge = [](auto &obj) { return &obj.charge; }; + static auto halflife = [](auto &obj) { return &obj.halflife; }; +} + +using CPPMass = general::Mass; +using CPPSpin = general::Spin; +using CPPParity = general::Parity; +using CPPCharge = general::Charge; +using CPPHalflife = general::Halflife; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLepton +LeptonDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Lepton +LeptonDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLepton +LeptonCreateConst( + const char *const id, + const char *const generation, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife +) { + ConstHandle2Lepton handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + generation, + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(charge), + detail::tocpp(halflife) + ); + return handle; +} + +// Create, general, non-const +Handle2Lepton +LeptonCreate( + const char *const id, + const char *const generation, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife +) { + ConstHandle2Lepton handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + generation, + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(charge), + detail::tocpp(halflife) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +LeptonAssign(ConstHandle2Lepton self, ConstHandle2ConstLepton from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LeptonDelete(ConstHandle2ConstLepton self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LeptonRead(ConstHandle2Lepton self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LeptonWrite(ConstHandle2ConstLepton self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LeptonPrint(ConstHandle2ConstLepton self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LeptonPrintXML(ConstHandle2ConstLepton self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LeptonPrintJSON(ConstHandle2ConstLepton self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// Has +int +LeptonIdHas(ConstHandle2ConstLepton self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IdHas", self, extract::id); +} + +// Get +// Returns by value +const char * +LeptonIdGet(ConstHandle2ConstLepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +LeptonIdSet(ConstHandle2Lepton self, const char *const id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: generation +// ----------------------------------------------------------------------------- + +// Has +int +LeptonGenerationHas(ConstHandle2ConstLepton self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GenerationHas", self, extract::generation); +} + +// Get +// Returns by value +const char * +LeptonGenerationGet(ConstHandle2ConstLepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GenerationGet", self, extract::generation); +} + +// Set +void +LeptonGenerationSet(ConstHandle2Lepton self, const char *const generation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GenerationSet", self, extract::generation, generation); +} + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// Has +int +LeptonMassHas(ConstHandle2ConstLepton self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MassHas", self, extract::mass); +} + +// Get, const +Handle2ConstMass +LeptonMassGetConst(ConstHandle2ConstLepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGetConst", self, extract::mass); +} + +// Get, non-const +Handle2Mass +LeptonMassGet(ConstHandle2Lepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGet", self, extract::mass); +} + +// Set +void +LeptonMassSet(ConstHandle2Lepton self, ConstHandle2ConstMass mass) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MassSet", self, extract::mass, mass); +} + + +// ----------------------------------------------------------------------------- +// Child: spin +// ----------------------------------------------------------------------------- + +// Has +int +LeptonSpinHas(ConstHandle2ConstLepton self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SpinHas", self, extract::spin); +} + +// Get, const +Handle2ConstSpin +LeptonSpinGetConst(ConstHandle2ConstLepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGetConst", self, extract::spin); +} + +// Get, non-const +Handle2Spin +LeptonSpinGet(ConstHandle2Lepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGet", self, extract::spin); +} + +// Set +void +LeptonSpinSet(ConstHandle2Lepton self, ConstHandle2ConstSpin spin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SpinSet", self, extract::spin, spin); +} + + +// ----------------------------------------------------------------------------- +// Child: parity +// ----------------------------------------------------------------------------- + +// Has +int +LeptonParityHas(ConstHandle2ConstLepton self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ParityHas", self, extract::parity); +} + +// Get, const +Handle2ConstParity +LeptonParityGetConst(ConstHandle2ConstLepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGetConst", self, extract::parity); +} + +// Get, non-const +Handle2Parity +LeptonParityGet(ConstHandle2Lepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGet", self, extract::parity); +} + +// Set +void +LeptonParitySet(ConstHandle2Lepton self, ConstHandle2ConstParity parity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ParitySet", self, extract::parity, parity); +} + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// Has +int +LeptonChargeHas(ConstHandle2ConstLepton self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChargeHas", self, extract::charge); +} + +// Get, const +Handle2ConstCharge +LeptonChargeGetConst(ConstHandle2ConstLepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGetConst", self, extract::charge); +} + +// Get, non-const +Handle2Charge +LeptonChargeGet(ConstHandle2Lepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGet", self, extract::charge); +} + +// Set +void +LeptonChargeSet(ConstHandle2Lepton self, ConstHandle2ConstCharge charge) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChargeSet", self, extract::charge, charge); +} + + +// ----------------------------------------------------------------------------- +// Child: halflife +// ----------------------------------------------------------------------------- + +// Has +int +LeptonHalflifeHas(ConstHandle2ConstLepton self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HalflifeHas", self, extract::halflife); +} + +// Get, const +Handle2ConstHalflife +LeptonHalflifeGetConst(ConstHandle2ConstLepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HalflifeGetConst", self, extract::halflife); +} + +// Get, non-const +Handle2Halflife +LeptonHalflifeGet(ConstHandle2Lepton self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HalflifeGet", self, extract::halflife); +} + +// Set +void +LeptonHalflifeSet(ConstHandle2Lepton self, ConstHandle2ConstHalflife halflife) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HalflifeSet", self, extract::halflife, halflife); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Lepton/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Lepton.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Lepton.h new file mode 100644 index 000000000..583a3ea94 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Lepton.h @@ -0,0 +1,297 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Lepton is the basic handle type in this file. Example: +// // Create a default Lepton object: +// Lepton handle = LeptonDefault(); +// Functions involving Lepton are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_LEPTON +#define C_INTERFACE_GNDS_V2_0_GENERAL_LEPTON + +#include "GNDStk.h" +#include "v2.0/general/Mass.h" +#include "v2.0/general/Spin.h" +#include "v2.0/general/Parity.h" +#include "v2.0/general/Charge.h" +#include "v2.0/general/Halflife.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LeptonClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Lepton +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LeptonClass *Lepton; + +// --- Const-aware handles. +typedef const struct LeptonClass *const ConstHandle2ConstLepton; +typedef struct LeptonClass *const ConstHandle2Lepton; +typedef const struct LeptonClass * Handle2ConstLepton; +typedef struct LeptonClass * Handle2Lepton; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstLepton +LeptonDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Lepton +LeptonDefault(); + +// --- Create, general, const +extern_c Handle2ConstLepton +LeptonCreateConst( + const char *const id, + const char *const generation, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife +); + +// +++ Create, general, non-const +extern_c Handle2Lepton +LeptonCreate( + const char *const id, + const char *const generation, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +LeptonAssign(ConstHandle2Lepton self, ConstHandle2ConstLepton from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LeptonDelete(ConstHandle2ConstLepton self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LeptonRead(ConstHandle2Lepton self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LeptonWrite(ConstHandle2ConstLepton self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LeptonPrint(ConstHandle2ConstLepton self); + +// +++ Print to standard output, as XML +extern_c int +LeptonPrintXML(ConstHandle2ConstLepton self); + +// +++ Print to standard output, as JSON +extern_c int +LeptonPrintJSON(ConstHandle2ConstLepton self); + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LeptonIdHas(ConstHandle2ConstLepton self); + +// +++ Get +// +++ Returns by value +extern_c const char * +LeptonIdGet(ConstHandle2ConstLepton self); + +// +++ Set +extern_c void +LeptonIdSet(ConstHandle2Lepton self, const char *const id); + + +// ----------------------------------------------------------------------------- +// Metadatum: generation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LeptonGenerationHas(ConstHandle2ConstLepton self); + +// +++ Get +// +++ Returns by value +extern_c const char * +LeptonGenerationGet(ConstHandle2ConstLepton self); + +// +++ Set +extern_c void +LeptonGenerationSet(ConstHandle2Lepton self, const char *const generation); + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LeptonMassHas(ConstHandle2ConstLepton self); + +// --- Get, const +extern_c Handle2ConstMass +LeptonMassGetConst(ConstHandle2ConstLepton self); + +// +++ Get, non-const +extern_c Handle2Mass +LeptonMassGet(ConstHandle2Lepton self); + +// +++ Set +extern_c void +LeptonMassSet(ConstHandle2Lepton self, ConstHandle2ConstMass mass); + + +// ----------------------------------------------------------------------------- +// Child: spin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LeptonSpinHas(ConstHandle2ConstLepton self); + +// --- Get, const +extern_c Handle2ConstSpin +LeptonSpinGetConst(ConstHandle2ConstLepton self); + +// +++ Get, non-const +extern_c Handle2Spin +LeptonSpinGet(ConstHandle2Lepton self); + +// +++ Set +extern_c void +LeptonSpinSet(ConstHandle2Lepton self, ConstHandle2ConstSpin spin); + + +// ----------------------------------------------------------------------------- +// Child: parity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LeptonParityHas(ConstHandle2ConstLepton self); + +// --- Get, const +extern_c Handle2ConstParity +LeptonParityGetConst(ConstHandle2ConstLepton self); + +// +++ Get, non-const +extern_c Handle2Parity +LeptonParityGet(ConstHandle2Lepton self); + +// +++ Set +extern_c void +LeptonParitySet(ConstHandle2Lepton self, ConstHandle2ConstParity parity); + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LeptonChargeHas(ConstHandle2ConstLepton self); + +// --- Get, const +extern_c Handle2ConstCharge +LeptonChargeGetConst(ConstHandle2ConstLepton self); + +// +++ Get, non-const +extern_c Handle2Charge +LeptonChargeGet(ConstHandle2Lepton self); + +// +++ Set +extern_c void +LeptonChargeSet(ConstHandle2Lepton self, ConstHandle2ConstCharge charge); + + +// ----------------------------------------------------------------------------- +// Child: halflife +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LeptonHalflifeHas(ConstHandle2ConstLepton self); + +// --- Get, const +extern_c Handle2ConstHalflife +LeptonHalflifeGetConst(ConstHandle2ConstLepton self); + +// +++ Get, non-const +extern_c Handle2Halflife +LeptonHalflifeGet(ConstHandle2Lepton self); + +// +++ Set +extern_c void +LeptonHalflifeSet(ConstHandle2Lepton self, ConstHandle2ConstHalflife halflife); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Lepton/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Lepton/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Lepton/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Lepton/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Lepton/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Leptons.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Leptons.cpp new file mode 100644 index 000000000..120e7eee9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Leptons.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Leptons.hpp" +#include "Leptons.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = LeptonsClass; +using CPP = multigroup::Leptons; + +static const std::string CLASSNAME = "Leptons"; + +namespace extract { + static auto lepton = [](auto &obj) { return &obj.lepton; }; +} + +using CPPLepton = general::Lepton; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLeptons +LeptonsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Leptons +LeptonsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLeptons +LeptonsCreateConst( + ConstHandle2Lepton *const lepton, const size_t leptonSize +) { + ConstHandle2Leptons handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t LeptonN = 0; LeptonN < leptonSize; ++LeptonN) + LeptonsLeptonAdd(handle, lepton[LeptonN]); + return handle; +} + +// Create, general, non-const +Handle2Leptons +LeptonsCreate( + ConstHandle2Lepton *const lepton, const size_t leptonSize +) { + ConstHandle2Leptons handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t LeptonN = 0; LeptonN < leptonSize; ++LeptonN) + LeptonsLeptonAdd(handle, lepton[LeptonN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +LeptonsAssign(ConstHandle2Leptons self, ConstHandle2ConstLeptons from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LeptonsDelete(ConstHandle2ConstLeptons self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LeptonsRead(ConstHandle2Leptons self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LeptonsWrite(ConstHandle2ConstLeptons self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LeptonsPrint(ConstHandle2ConstLeptons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LeptonsPrintXML(ConstHandle2ConstLeptons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LeptonsPrintJSON(ConstHandle2ConstLeptons self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: lepton +// ----------------------------------------------------------------------------- + +// Has +int +LeptonsLeptonHas(ConstHandle2ConstLeptons self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LeptonHas", self, extract::lepton); +} + +// Clear +void +LeptonsLeptonClear(ConstHandle2Leptons self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"LeptonClear", self, extract::lepton); +} + +// Size +size_t +LeptonsLeptonSize(ConstHandle2ConstLeptons self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"LeptonSize", self, extract::lepton); +} + +// Add +void +LeptonsLeptonAdd(ConstHandle2Leptons self, ConstHandle2ConstLepton lepton) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"LeptonAdd", self, extract::lepton, lepton); +} + +// Get, by index \in [0,size), const +Handle2ConstLepton +LeptonsLeptonGetConst(ConstHandle2ConstLeptons self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"LeptonGetConst", self, extract::lepton, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Lepton +LeptonsLeptonGet(ConstHandle2Leptons self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"LeptonGet", self, extract::lepton, index_); +} + +// Set, by index \in [0,size) +void +LeptonsLeptonSet( + ConstHandle2Leptons self, + const size_t index_, + ConstHandle2ConstLepton lepton +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"LeptonSet", self, extract::lepton, index_, lepton); +} + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// Has, by id +int +LeptonsLeptonHasById( + ConstHandle2ConstLeptons self, + const char *const id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"LeptonHasById", + self, extract::lepton, meta::id, id); +} + +// Get, by id, const +Handle2ConstLepton +LeptonsLeptonGetByIdConst( + ConstHandle2ConstLeptons self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LeptonGetByIdConst", + self, extract::lepton, meta::id, id); +} + +// Get, by id, non-const +Handle2Lepton +LeptonsLeptonGetById( + ConstHandle2Leptons self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LeptonGetById", + self, extract::lepton, meta::id, id); +} + +// Set, by id +void +LeptonsLeptonSetById( + ConstHandle2Leptons self, + const char *const id, + ConstHandle2ConstLepton lepton +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"LeptonSetById", + self, extract::lepton, meta::id, id, lepton); +} + +// ------------------------ +// Re: metadatum generation +// ------------------------ + +// Has, by generation +int +LeptonsLeptonHasByGeneration( + ConstHandle2ConstLeptons self, + const char *const generation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"LeptonHasByGeneration", + self, extract::lepton, meta::generation, generation); +} + +// Get, by generation, const +Handle2ConstLepton +LeptonsLeptonGetByGenerationConst( + ConstHandle2ConstLeptons self, + const char *const generation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LeptonGetByGenerationConst", + self, extract::lepton, meta::generation, generation); +} + +// Get, by generation, non-const +Handle2Lepton +LeptonsLeptonGetByGeneration( + ConstHandle2Leptons self, + const char *const generation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LeptonGetByGeneration", + self, extract::lepton, meta::generation, generation); +} + +// Set, by generation +void +LeptonsLeptonSetByGeneration( + ConstHandle2Leptons self, + const char *const generation, + ConstHandle2ConstLepton lepton +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"LeptonSetByGeneration", + self, extract::lepton, meta::generation, generation, lepton); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Leptons/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Leptons.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Leptons.h new file mode 100644 index 000000000..055d930a2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Leptons.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Leptons is the basic handle type in this file. Example: +// // Create a default Leptons object: +// Leptons handle = LeptonsDefault(); +// Functions involving Leptons are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_LEPTONS +#define C_INTERFACE_GNDS_V2_0_GENERAL_LEPTONS + +#include "GNDStk.h" +#include "v2.0/general/Lepton.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LeptonsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Leptons +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LeptonsClass *Leptons; + +// --- Const-aware handles. +typedef const struct LeptonsClass *const ConstHandle2ConstLeptons; +typedef struct LeptonsClass *const ConstHandle2Leptons; +typedef const struct LeptonsClass * Handle2ConstLeptons; +typedef struct LeptonsClass * Handle2Leptons; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstLeptons +LeptonsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Leptons +LeptonsDefault(); + +// --- Create, general, const +extern_c Handle2ConstLeptons +LeptonsCreateConst( + ConstHandle2Lepton *const lepton, const size_t leptonSize +); + +// +++ Create, general, non-const +extern_c Handle2Leptons +LeptonsCreate( + ConstHandle2Lepton *const lepton, const size_t leptonSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +LeptonsAssign(ConstHandle2Leptons self, ConstHandle2ConstLeptons from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LeptonsDelete(ConstHandle2ConstLeptons self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LeptonsRead(ConstHandle2Leptons self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LeptonsWrite(ConstHandle2ConstLeptons self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LeptonsPrint(ConstHandle2ConstLeptons self); + +// +++ Print to standard output, as XML +extern_c int +LeptonsPrintXML(ConstHandle2ConstLeptons self); + +// +++ Print to standard output, as JSON +extern_c int +LeptonsPrintJSON(ConstHandle2ConstLeptons self); + + +// ----------------------------------------------------------------------------- +// Child: lepton +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LeptonsLeptonHas(ConstHandle2ConstLeptons self); + +// +++ Clear +extern_c void +LeptonsLeptonClear(ConstHandle2Leptons self); + +// +++ Size +extern_c size_t +LeptonsLeptonSize(ConstHandle2ConstLeptons self); + +// +++ Add +extern_c void +LeptonsLeptonAdd(ConstHandle2Leptons self, ConstHandle2ConstLepton lepton); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstLepton +LeptonsLeptonGetConst(ConstHandle2ConstLeptons self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Lepton +LeptonsLeptonGet(ConstHandle2Leptons self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +LeptonsLeptonSet( + ConstHandle2Leptons self, + const size_t index_, + ConstHandle2ConstLepton lepton +); + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// +++ Has, by id +extern_c int +LeptonsLeptonHasById( + ConstHandle2ConstLeptons self, + const char *const id +); + +// --- Get, by id, const +extern_c Handle2ConstLepton +LeptonsLeptonGetByIdConst( + ConstHandle2ConstLeptons self, + const char *const id +); + +// +++ Get, by id, non-const +extern_c Handle2Lepton +LeptonsLeptonGetById( + ConstHandle2Leptons self, + const char *const id +); + +// +++ Set, by id +extern_c void +LeptonsLeptonSetById( + ConstHandle2Leptons self, + const char *const id, + ConstHandle2ConstLepton lepton +); + +// ------------------------ +// Re: metadatum generation +// ------------------------ + +// +++ Has, by generation +extern_c int +LeptonsLeptonHasByGeneration( + ConstHandle2ConstLeptons self, + const char *const generation +); + +// --- Get, by generation, const +extern_c Handle2ConstLepton +LeptonsLeptonGetByGenerationConst( + ConstHandle2ConstLeptons self, + const char *const generation +); + +// +++ Get, by generation, non-const +extern_c Handle2Lepton +LeptonsLeptonGetByGeneration( + ConstHandle2Leptons self, + const char *const generation +); + +// +++ Set, by generation +extern_c void +LeptonsLeptonSetByGeneration( + ConstHandle2Leptons self, + const char *const generation, + ConstHandle2ConstLepton lepton +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Leptons/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Leptons/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Leptons/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Leptons/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Leptons/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/LevelSpacing.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/LevelSpacing.cpp new file mode 100644 index 000000000..b2296c328 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/LevelSpacing.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/LevelSpacing.hpp" +#include "LevelSpacing.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = LevelSpacingClass; +using CPP = multigroup::LevelSpacing; + +static const std::string CLASSNAME = "LevelSpacing"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto constant1d = [](auto &obj) { return &obj.constant1d; }; +} + +using CPPXYs1d = general::XYs1d; +using CPPConstant1d = general::Constant1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLevelSpacing +LevelSpacingDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2LevelSpacing +LevelSpacingDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLevelSpacing +LevelSpacingCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstConstant1d constant1d +) { + ConstHandle2LevelSpacing handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(constant1d) + ); + return handle; +} + +// Create, general, non-const +Handle2LevelSpacing +LevelSpacingCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstConstant1d constant1d +) { + ConstHandle2LevelSpacing handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(constant1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +LevelSpacingAssign(ConstHandle2LevelSpacing self, ConstHandle2ConstLevelSpacing from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LevelSpacingDelete(ConstHandle2ConstLevelSpacing self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LevelSpacingRead(ConstHandle2LevelSpacing self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LevelSpacingWrite(ConstHandle2ConstLevelSpacing self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LevelSpacingPrint(ConstHandle2ConstLevelSpacing self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LevelSpacingPrintXML(ConstHandle2ConstLevelSpacing self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LevelSpacingPrintJSON(ConstHandle2ConstLevelSpacing self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +LevelSpacingXYs1dHas(ConstHandle2ConstLevelSpacing self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +LevelSpacingXYs1dGetConst(ConstHandle2ConstLevelSpacing self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +LevelSpacingXYs1dGet(ConstHandle2LevelSpacing self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +LevelSpacingXYs1dSet(ConstHandle2LevelSpacing self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// Has +int +LevelSpacingConstant1dHas(ConstHandle2ConstLevelSpacing self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Constant1dHas", self, extract::constant1d); +} + +// Get, const +Handle2ConstConstant1d +LevelSpacingConstant1dGetConst(ConstHandle2ConstLevelSpacing self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGetConst", self, extract::constant1d); +} + +// Get, non-const +Handle2Constant1d +LevelSpacingConstant1dGet(ConstHandle2LevelSpacing self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGet", self, extract::constant1d); +} + +// Set +void +LevelSpacingConstant1dSet(ConstHandle2LevelSpacing self, ConstHandle2ConstConstant1d constant1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Constant1dSet", self, extract::constant1d, constant1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/LevelSpacing/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/LevelSpacing.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/LevelSpacing.h new file mode 100644 index 000000000..82c2705d1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/LevelSpacing.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// LevelSpacing is the basic handle type in this file. Example: +// // Create a default LevelSpacing object: +// LevelSpacing handle = LevelSpacingDefault(); +// Functions involving LevelSpacing are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_LEVELSPACING +#define C_INTERFACE_GNDS_V2_0_GENERAL_LEVELSPACING + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/Constant1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LevelSpacingClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ LevelSpacing +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LevelSpacingClass *LevelSpacing; + +// --- Const-aware handles. +typedef const struct LevelSpacingClass *const ConstHandle2ConstLevelSpacing; +typedef struct LevelSpacingClass *const ConstHandle2LevelSpacing; +typedef const struct LevelSpacingClass * Handle2ConstLevelSpacing; +typedef struct LevelSpacingClass * Handle2LevelSpacing; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstLevelSpacing +LevelSpacingDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2LevelSpacing +LevelSpacingDefault(); + +// --- Create, general, const +extern_c Handle2ConstLevelSpacing +LevelSpacingCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstConstant1d constant1d +); + +// +++ Create, general, non-const +extern_c Handle2LevelSpacing +LevelSpacingCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstConstant1d constant1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +LevelSpacingAssign(ConstHandle2LevelSpacing self, ConstHandle2ConstLevelSpacing from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LevelSpacingDelete(ConstHandle2ConstLevelSpacing self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LevelSpacingRead(ConstHandle2LevelSpacing self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LevelSpacingWrite(ConstHandle2ConstLevelSpacing self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LevelSpacingPrint(ConstHandle2ConstLevelSpacing self); + +// +++ Print to standard output, as XML +extern_c int +LevelSpacingPrintXML(ConstHandle2ConstLevelSpacing self); + +// +++ Print to standard output, as JSON +extern_c int +LevelSpacingPrintJSON(ConstHandle2ConstLevelSpacing self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LevelSpacingXYs1dHas(ConstHandle2ConstLevelSpacing self); + +// --- Get, const +extern_c Handle2ConstXYs1d +LevelSpacingXYs1dGetConst(ConstHandle2ConstLevelSpacing self); + +// +++ Get, non-const +extern_c Handle2XYs1d +LevelSpacingXYs1dGet(ConstHandle2LevelSpacing self); + +// +++ Set +extern_c void +LevelSpacingXYs1dSet(ConstHandle2LevelSpacing self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LevelSpacingConstant1dHas(ConstHandle2ConstLevelSpacing self); + +// --- Get, const +extern_c Handle2ConstConstant1d +LevelSpacingConstant1dGetConst(ConstHandle2ConstLevelSpacing self); + +// +++ Get, non-const +extern_c Handle2Constant1d +LevelSpacingConstant1dGet(ConstHandle2LevelSpacing self); + +// +++ Set +extern_c void +LevelSpacingConstant1dSet(ConstHandle2LevelSpacing self, ConstHandle2ConstConstant1d constant1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/LevelSpacing/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/LevelSpacing/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/LevelSpacing/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/LevelSpacing/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/LevelSpacing/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Link.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Link.cpp new file mode 100644 index 000000000..f6623f81f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Link.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Link.hpp" +#include "Link.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = LinkClass; +using CPP = multigroup::Link; + +static const std::string CLASSNAME = "Link"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLink +LinkDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Link +LinkDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLink +LinkCreateConst( + const char *const href +) { + ConstHandle2Link handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href + ); + return handle; +} + +// Create, general, non-const +Handle2Link +LinkCreate( + const char *const href +) { + ConstHandle2Link handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +LinkAssign(ConstHandle2Link self, ConstHandle2ConstLink from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LinkDelete(ConstHandle2ConstLink self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LinkRead(ConstHandle2Link self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LinkWrite(ConstHandle2ConstLink self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LinkPrint(ConstHandle2ConstLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LinkPrintXML(ConstHandle2ConstLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LinkPrintJSON(ConstHandle2ConstLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +LinkHrefHas(ConstHandle2ConstLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +LinkHrefGet(ConstHandle2ConstLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +LinkHrefSet(ConstHandle2Link self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Link/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Link.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Link.h new file mode 100644 index 000000000..cd0db9dcd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Link.h @@ -0,0 +1,157 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Link is the basic handle type in this file. Example: +// // Create a default Link object: +// Link handle = LinkDefault(); +// Functions involving Link are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_LINK +#define C_INTERFACE_GNDS_V2_0_GENERAL_LINK + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LinkClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Link +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LinkClass *Link; + +// --- Const-aware handles. +typedef const struct LinkClass *const ConstHandle2ConstLink; +typedef struct LinkClass *const ConstHandle2Link; +typedef const struct LinkClass * Handle2ConstLink; +typedef struct LinkClass * Handle2Link; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstLink +LinkDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Link +LinkDefault(); + +// --- Create, general, const +extern_c Handle2ConstLink +LinkCreateConst( + const char *const href +); + +// +++ Create, general, non-const +extern_c Handle2Link +LinkCreate( + const char *const href +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +LinkAssign(ConstHandle2Link self, ConstHandle2ConstLink from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LinkDelete(ConstHandle2ConstLink self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LinkRead(ConstHandle2Link self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LinkWrite(ConstHandle2ConstLink self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LinkPrint(ConstHandle2ConstLink self); + +// +++ Print to standard output, as XML +extern_c int +LinkPrintXML(ConstHandle2ConstLink self); + +// +++ Print to standard output, as JSON +extern_c int +LinkPrintJSON(ConstHandle2ConstLink self); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LinkHrefHas(ConstHandle2ConstLink self); + +// +++ Get +// +++ Returns by value +extern_c const char * +LinkHrefGet(ConstHandle2ConstLink self); + +// +++ Set +extern_c void +LinkHrefSet(ConstHandle2Link self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Link/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Link/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Link/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Link/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Link/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ListOfCovariances.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ListOfCovariances.cpp new file mode 100644 index 000000000..42d3b48f9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ListOfCovariances.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ListOfCovariances.hpp" +#include "ListOfCovariances.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ListOfCovariancesClass; +using CPP = multigroup::ListOfCovariances; + +static const std::string CLASSNAME = "ListOfCovariances"; + +namespace extract { + static auto covariance = [](auto &obj) { return &obj.covariance; }; +} + +using CPPCovariance = general::Covariance; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstListOfCovariances +ListOfCovariancesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ListOfCovariances +ListOfCovariancesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstListOfCovariances +ListOfCovariancesCreateConst( + ConstHandle2Covariance *const covariance, const size_t covarianceSize +) { + ConstHandle2ListOfCovariances handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t CovarianceN = 0; CovarianceN < covarianceSize; ++CovarianceN) + ListOfCovariancesCovarianceAdd(handle, covariance[CovarianceN]); + return handle; +} + +// Create, general, non-const +Handle2ListOfCovariances +ListOfCovariancesCreate( + ConstHandle2Covariance *const covariance, const size_t covarianceSize +) { + ConstHandle2ListOfCovariances handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t CovarianceN = 0; CovarianceN < covarianceSize; ++CovarianceN) + ListOfCovariancesCovarianceAdd(handle, covariance[CovarianceN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ListOfCovariancesAssign(ConstHandle2ListOfCovariances self, ConstHandle2ConstListOfCovariances from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ListOfCovariancesDelete(ConstHandle2ConstListOfCovariances self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ListOfCovariancesRead(ConstHandle2ListOfCovariances self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ListOfCovariancesWrite(ConstHandle2ConstListOfCovariances self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ListOfCovariancesPrint(ConstHandle2ConstListOfCovariances self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ListOfCovariancesPrintXML(ConstHandle2ConstListOfCovariances self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ListOfCovariancesPrintJSON(ConstHandle2ConstListOfCovariances self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: covariance +// ----------------------------------------------------------------------------- + +// Has +int +ListOfCovariancesCovarianceHas(ConstHandle2ConstListOfCovariances self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CovarianceHas", self, extract::covariance); +} + +// Clear +void +ListOfCovariancesCovarianceClear(ConstHandle2ListOfCovariances self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"CovarianceClear", self, extract::covariance); +} + +// Size +size_t +ListOfCovariancesCovarianceSize(ConstHandle2ConstListOfCovariances self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"CovarianceSize", self, extract::covariance); +} + +// Add +void +ListOfCovariancesCovarianceAdd(ConstHandle2ListOfCovariances self, ConstHandle2ConstCovariance covariance) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"CovarianceAdd", self, extract::covariance, covariance); +} + +// Get, by index \in [0,size), const +Handle2ConstCovariance +ListOfCovariancesCovarianceGetConst(ConstHandle2ConstListOfCovariances self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CovarianceGetConst", self, extract::covariance, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Covariance +ListOfCovariancesCovarianceGet(ConstHandle2ListOfCovariances self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CovarianceGet", self, extract::covariance, index_); +} + +// Set, by index \in [0,size) +void +ListOfCovariancesCovarianceSet( + ConstHandle2ListOfCovariances self, + const size_t index_, + ConstHandle2ConstCovariance covariance +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"CovarianceSet", self, extract::covariance, index_, covariance); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ListOfCovariancesCovarianceHasByLabel( + ConstHandle2ConstListOfCovariances self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceHasByLabel", + self, extract::covariance, meta::label, label); +} + +// Get, by label, const +Handle2ConstCovariance +ListOfCovariancesCovarianceGetByLabelConst( + ConstHandle2ConstListOfCovariances self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceGetByLabelConst", + self, extract::covariance, meta::label, label); +} + +// Get, by label, non-const +Handle2Covariance +ListOfCovariancesCovarianceGetByLabel( + ConstHandle2ListOfCovariances self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceGetByLabel", + self, extract::covariance, meta::label, label); +} + +// Set, by label +void +ListOfCovariancesCovarianceSetByLabel( + ConstHandle2ListOfCovariances self, + const char *const label, + ConstHandle2ConstCovariance covariance +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSetByLabel", + self, extract::covariance, meta::label, label, covariance); +} + +// ------------------------ +// Re: metadatum href +// ------------------------ + +// Has, by href +int +ListOfCovariancesCovarianceHasByHref( + ConstHandle2ConstListOfCovariances self, + const char *const href +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceHasByHref", + self, extract::covariance, meta::href, href); +} + +// Get, by href, const +Handle2ConstCovariance +ListOfCovariancesCovarianceGetByHrefConst( + ConstHandle2ConstListOfCovariances self, + const char *const href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceGetByHrefConst", + self, extract::covariance, meta::href, href); +} + +// Get, by href, non-const +Handle2Covariance +ListOfCovariancesCovarianceGetByHref( + ConstHandle2ListOfCovariances self, + const char *const href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceGetByHref", + self, extract::covariance, meta::href, href); +} + +// Set, by href +void +ListOfCovariancesCovarianceSetByHref( + ConstHandle2ListOfCovariances self, + const char *const href, + ConstHandle2ConstCovariance covariance +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceSetByHref", + self, extract::covariance, meta::href, href, covariance); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ListOfCovariances/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ListOfCovariances.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ListOfCovariances.h new file mode 100644 index 000000000..bf109af3b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ListOfCovariances.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ListOfCovariances is the basic handle type in this file. Example: +// // Create a default ListOfCovariances object: +// ListOfCovariances handle = ListOfCovariancesDefault(); +// Functions involving ListOfCovariances are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_LISTOFCOVARIANCES +#define C_INTERFACE_GNDS_V2_0_GENERAL_LISTOFCOVARIANCES + +#include "GNDStk.h" +#include "v2.0/general/Covariance.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ListOfCovariancesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ListOfCovariances +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ListOfCovariancesClass *ListOfCovariances; + +// --- Const-aware handles. +typedef const struct ListOfCovariancesClass *const ConstHandle2ConstListOfCovariances; +typedef struct ListOfCovariancesClass *const ConstHandle2ListOfCovariances; +typedef const struct ListOfCovariancesClass * Handle2ConstListOfCovariances; +typedef struct ListOfCovariancesClass * Handle2ListOfCovariances; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstListOfCovariances +ListOfCovariancesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ListOfCovariances +ListOfCovariancesDefault(); + +// --- Create, general, const +extern_c Handle2ConstListOfCovariances +ListOfCovariancesCreateConst( + ConstHandle2Covariance *const covariance, const size_t covarianceSize +); + +// +++ Create, general, non-const +extern_c Handle2ListOfCovariances +ListOfCovariancesCreate( + ConstHandle2Covariance *const covariance, const size_t covarianceSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ListOfCovariancesAssign(ConstHandle2ListOfCovariances self, ConstHandle2ConstListOfCovariances from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ListOfCovariancesDelete(ConstHandle2ConstListOfCovariances self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ListOfCovariancesRead(ConstHandle2ListOfCovariances self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ListOfCovariancesWrite(ConstHandle2ConstListOfCovariances self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ListOfCovariancesPrint(ConstHandle2ConstListOfCovariances self); + +// +++ Print to standard output, as XML +extern_c int +ListOfCovariancesPrintXML(ConstHandle2ConstListOfCovariances self); + +// +++ Print to standard output, as JSON +extern_c int +ListOfCovariancesPrintJSON(ConstHandle2ConstListOfCovariances self); + + +// ----------------------------------------------------------------------------- +// Child: covariance +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ListOfCovariancesCovarianceHas(ConstHandle2ConstListOfCovariances self); + +// +++ Clear +extern_c void +ListOfCovariancesCovarianceClear(ConstHandle2ListOfCovariances self); + +// +++ Size +extern_c size_t +ListOfCovariancesCovarianceSize(ConstHandle2ConstListOfCovariances self); + +// +++ Add +extern_c void +ListOfCovariancesCovarianceAdd(ConstHandle2ListOfCovariances self, ConstHandle2ConstCovariance covariance); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstCovariance +ListOfCovariancesCovarianceGetConst(ConstHandle2ConstListOfCovariances self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Covariance +ListOfCovariancesCovarianceGet(ConstHandle2ListOfCovariances self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ListOfCovariancesCovarianceSet( + ConstHandle2ListOfCovariances self, + const size_t index_, + ConstHandle2ConstCovariance covariance +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ListOfCovariancesCovarianceHasByLabel( + ConstHandle2ConstListOfCovariances self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstCovariance +ListOfCovariancesCovarianceGetByLabelConst( + ConstHandle2ConstListOfCovariances self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Covariance +ListOfCovariancesCovarianceGetByLabel( + ConstHandle2ListOfCovariances self, + const char *const label +); + +// +++ Set, by label +extern_c void +ListOfCovariancesCovarianceSetByLabel( + ConstHandle2ListOfCovariances self, + const char *const label, + ConstHandle2ConstCovariance covariance +); + +// ------------------------ +// Re: metadatum href +// ------------------------ + +// +++ Has, by href +extern_c int +ListOfCovariancesCovarianceHasByHref( + ConstHandle2ConstListOfCovariances self, + const char *const href +); + +// --- Get, by href, const +extern_c Handle2ConstCovariance +ListOfCovariancesCovarianceGetByHrefConst( + ConstHandle2ConstListOfCovariances self, + const char *const href +); + +// +++ Get, by href, non-const +extern_c Handle2Covariance +ListOfCovariancesCovarianceGetByHref( + ConstHandle2ListOfCovariances self, + const char *const href +); + +// +++ Set, by href +extern_c void +ListOfCovariancesCovarianceSetByHref( + ConstHandle2ListOfCovariances self, + const char *const href, + ConstHandle2ConstCovariance covariance +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ListOfCovariances/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ListOfCovariances/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ListOfCovariances/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ListOfCovariances/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ListOfCovariances/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Ls.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Ls.cpp new file mode 100644 index 000000000..6168e8453 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Ls.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Ls.hpp" +#include "Ls.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = LsClass; +using CPP = multigroup::Ls; + +static const std::string CLASSNAME = "Ls"; + +namespace extract { + static auto L = [](auto &obj) { return &obj.L; }; +} + +using CPPL = general::L; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstLs +LsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Ls +LsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstLs +LsCreateConst( + ConstHandle2L *const L, const size_t LSize +) { + ConstHandle2Ls handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t LN = 0; LN < LSize; ++LN) + LsLAdd(handle, L[LN]); + return handle; +} + +// Create, general, non-const +Handle2Ls +LsCreate( + ConstHandle2L *const L, const size_t LSize +) { + ConstHandle2Ls handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t LN = 0; LN < LSize; ++LN) + LsLAdd(handle, L[LN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +LsAssign(ConstHandle2Ls self, ConstHandle2ConstLs from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +LsDelete(ConstHandle2ConstLs self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +LsRead(ConstHandle2Ls self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +LsWrite(ConstHandle2ConstLs self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +LsPrint(ConstHandle2ConstLs self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +LsPrintXML(ConstHandle2ConstLs self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +LsPrintJSON(ConstHandle2ConstLs self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: L +// ----------------------------------------------------------------------------- + +// Has +int +LsLHas(ConstHandle2ConstLs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LHas", self, extract::L); +} + +// Clear +void +LsLClear(ConstHandle2Ls self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"LClear", self, extract::L); +} + +// Size +size_t +LsLSize(ConstHandle2ConstLs self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"LSize", self, extract::L); +} + +// Add +void +LsLAdd(ConstHandle2Ls self, ConstHandle2ConstL L) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"LAdd", self, extract::L, L); +} + +// Get, by index \in [0,size), const +Handle2ConstL +LsLGetConst(ConstHandle2ConstLs self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"LGetConst", self, extract::L, index_); +} + +// Get, by index \in [0,size), non-const +Handle2L +LsLGet(ConstHandle2Ls self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"LGet", self, extract::L, index_); +} + +// Set, by index \in [0,size) +void +LsLSet( + ConstHandle2Ls self, + const size_t index_, + ConstHandle2ConstL L +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"LSet", self, extract::L, index_, L); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +LsLHasByLabel( + ConstHandle2ConstLs self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"LHasByLabel", + self, extract::L, meta::label, label); +} + +// Get, by label, const +Handle2ConstL +LsLGetByLabelConst( + ConstHandle2ConstLs self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LGetByLabelConst", + self, extract::L, meta::label, label); +} + +// Get, by label, non-const +Handle2L +LsLGetByLabel( + ConstHandle2Ls self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LGetByLabel", + self, extract::L, meta::label, label); +} + +// Set, by label +void +LsLSetByLabel( + ConstHandle2Ls self, + const char *const label, + ConstHandle2ConstL L +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"LSetByLabel", + self, extract::L, meta::label, label, L); +} + +// ------------------------ +// Re: metadatum value +// ------------------------ + +// Has, by value +int +LsLHasByValue( + ConstHandle2ConstLs self, + const int value +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"LHasByValue", + self, extract::L, meta::value, value); +} + +// Get, by value, const +Handle2ConstL +LsLGetByValueConst( + ConstHandle2ConstLs self, + const int value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LGetByValueConst", + self, extract::L, meta::value, value); +} + +// Get, by value, non-const +Handle2L +LsLGetByValue( + ConstHandle2Ls self, + const int value +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LGetByValue", + self, extract::L, meta::value, value); +} + +// Set, by value +void +LsLSetByValue( + ConstHandle2Ls self, + const int value, + ConstHandle2ConstL L +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"LSetByValue", + self, extract::L, meta::value, value, L); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Ls/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Ls.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Ls.h new file mode 100644 index 000000000..60c59644a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Ls.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Ls is the basic handle type in this file. Example: +// // Create a default Ls object: +// Ls handle = LsDefault(); +// Functions involving Ls are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_LS +#define C_INTERFACE_GNDS_V2_0_GENERAL_LS + +#include "GNDStk.h" +#include "v2.0/general/L.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct LsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Ls +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct LsClass *Ls; + +// --- Const-aware handles. +typedef const struct LsClass *const ConstHandle2ConstLs; +typedef struct LsClass *const ConstHandle2Ls; +typedef const struct LsClass * Handle2ConstLs; +typedef struct LsClass * Handle2Ls; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstLs +LsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Ls +LsDefault(); + +// --- Create, general, const +extern_c Handle2ConstLs +LsCreateConst( + ConstHandle2L *const L, const size_t LSize +); + +// +++ Create, general, non-const +extern_c Handle2Ls +LsCreate( + ConstHandle2L *const L, const size_t LSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +LsAssign(ConstHandle2Ls self, ConstHandle2ConstLs from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +LsDelete(ConstHandle2ConstLs self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +LsRead(ConstHandle2Ls self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +LsWrite(ConstHandle2ConstLs self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +LsPrint(ConstHandle2ConstLs self); + +// +++ Print to standard output, as XML +extern_c int +LsPrintXML(ConstHandle2ConstLs self); + +// +++ Print to standard output, as JSON +extern_c int +LsPrintJSON(ConstHandle2ConstLs self); + + +// ----------------------------------------------------------------------------- +// Child: L +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +LsLHas(ConstHandle2ConstLs self); + +// +++ Clear +extern_c void +LsLClear(ConstHandle2Ls self); + +// +++ Size +extern_c size_t +LsLSize(ConstHandle2ConstLs self); + +// +++ Add +extern_c void +LsLAdd(ConstHandle2Ls self, ConstHandle2ConstL L); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstL +LsLGetConst(ConstHandle2ConstLs self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2L +LsLGet(ConstHandle2Ls self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +LsLSet( + ConstHandle2Ls self, + const size_t index_, + ConstHandle2ConstL L +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +LsLHasByLabel( + ConstHandle2ConstLs self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstL +LsLGetByLabelConst( + ConstHandle2ConstLs self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2L +LsLGetByLabel( + ConstHandle2Ls self, + const char *const label +); + +// +++ Set, by label +extern_c void +LsLSetByLabel( + ConstHandle2Ls self, + const char *const label, + ConstHandle2ConstL L +); + +// ------------------------ +// Re: metadatum value +// ------------------------ + +// +++ Has, by value +extern_c int +LsLHasByValue( + ConstHandle2ConstLs self, + const int value +); + +// --- Get, by value, const +extern_c Handle2ConstL +LsLGetByValueConst( + ConstHandle2ConstLs self, + const int value +); + +// +++ Get, by value, non-const +extern_c Handle2L +LsLGetByValue( + ConstHandle2Ls self, + const int value +); + +// +++ Set, by value +extern_c void +LsLSetByValue( + ConstHandle2Ls self, + const int value, + ConstHandle2ConstL L +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Ls/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Ls/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Ls/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Ls/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Ls/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MadlandNix.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MadlandNix.cpp new file mode 100644 index 000000000..fc8da0897 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MadlandNix.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/MadlandNix.hpp" +#include "MadlandNix.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = MadlandNixClass; +using CPP = multigroup::MadlandNix; + +static const std::string CLASSNAME = "MadlandNix"; + +namespace extract { + static auto EFL = [](auto &obj) { return &obj.EFL; }; + static auto EFH = [](auto &obj) { return &obj.EFH; }; + static auto T_M = [](auto &obj) { return &obj.T_M; }; +} + +using CPPEFL = general::EFL; +using CPPEFH = general::EFH; +using CPPT_M = general::T_M; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMadlandNix +MadlandNixDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2MadlandNix +MadlandNixDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMadlandNix +MadlandNixCreateConst( + ConstHandle2ConstEFL EFL, + ConstHandle2ConstEFH EFH, + ConstHandle2ConstT_M T_M +) { + ConstHandle2MadlandNix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(EFL), + detail::tocpp(EFH), + detail::tocpp(T_M) + ); + return handle; +} + +// Create, general, non-const +Handle2MadlandNix +MadlandNixCreate( + ConstHandle2ConstEFL EFL, + ConstHandle2ConstEFH EFH, + ConstHandle2ConstT_M T_M +) { + ConstHandle2MadlandNix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(EFL), + detail::tocpp(EFH), + detail::tocpp(T_M) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MadlandNixAssign(ConstHandle2MadlandNix self, ConstHandle2ConstMadlandNix from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MadlandNixDelete(ConstHandle2ConstMadlandNix self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MadlandNixRead(ConstHandle2MadlandNix self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MadlandNixWrite(ConstHandle2ConstMadlandNix self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MadlandNixPrint(ConstHandle2ConstMadlandNix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MadlandNixPrintXML(ConstHandle2ConstMadlandNix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MadlandNixPrintJSON(ConstHandle2ConstMadlandNix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: EFL +// ----------------------------------------------------------------------------- + +// Has +int +MadlandNixEFLHas(ConstHandle2ConstMadlandNix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EFLHas", self, extract::EFL); +} + +// Get, const +Handle2ConstEFL +MadlandNixEFLGetConst(ConstHandle2ConstMadlandNix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EFLGetConst", self, extract::EFL); +} + +// Get, non-const +Handle2EFL +MadlandNixEFLGet(ConstHandle2MadlandNix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EFLGet", self, extract::EFL); +} + +// Set +void +MadlandNixEFLSet(ConstHandle2MadlandNix self, ConstHandle2ConstEFL EFL) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EFLSet", self, extract::EFL, EFL); +} + + +// ----------------------------------------------------------------------------- +// Child: EFH +// ----------------------------------------------------------------------------- + +// Has +int +MadlandNixEFHHas(ConstHandle2ConstMadlandNix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EFHHas", self, extract::EFH); +} + +// Get, const +Handle2ConstEFH +MadlandNixEFHGetConst(ConstHandle2ConstMadlandNix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EFHGetConst", self, extract::EFH); +} + +// Get, non-const +Handle2EFH +MadlandNixEFHGet(ConstHandle2MadlandNix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EFHGet", self, extract::EFH); +} + +// Set +void +MadlandNixEFHSet(ConstHandle2MadlandNix self, ConstHandle2ConstEFH EFH) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EFHSet", self, extract::EFH, EFH); +} + + +// ----------------------------------------------------------------------------- +// Child: T_M +// ----------------------------------------------------------------------------- + +// Has +int +MadlandNixT_MHas(ConstHandle2ConstMadlandNix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"T_MHas", self, extract::T_M); +} + +// Get, const +Handle2ConstT_M +MadlandNixT_MGetConst(ConstHandle2ConstMadlandNix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"T_MGetConst", self, extract::T_M); +} + +// Get, non-const +Handle2T_M +MadlandNixT_MGet(ConstHandle2MadlandNix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"T_MGet", self, extract::T_M); +} + +// Set +void +MadlandNixT_MSet(ConstHandle2MadlandNix self, ConstHandle2ConstT_M T_M) +{ + detail::setField + (CLASSNAME, CLASSNAME+"T_MSet", self, extract::T_M, T_M); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/MadlandNix/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MadlandNix.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MadlandNix.h new file mode 100644 index 000000000..923b36457 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MadlandNix.h @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// MadlandNix is the basic handle type in this file. Example: +// // Create a default MadlandNix object: +// MadlandNix handle = MadlandNixDefault(); +// Functions involving MadlandNix are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_MADLANDNIX +#define C_INTERFACE_GNDS_V2_0_GENERAL_MADLANDNIX + +#include "GNDStk.h" +#include "v2.0/general/EFL.h" +#include "v2.0/general/EFH.h" +#include "v2.0/general/T_M.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MadlandNixClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ MadlandNix +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MadlandNixClass *MadlandNix; + +// --- Const-aware handles. +typedef const struct MadlandNixClass *const ConstHandle2ConstMadlandNix; +typedef struct MadlandNixClass *const ConstHandle2MadlandNix; +typedef const struct MadlandNixClass * Handle2ConstMadlandNix; +typedef struct MadlandNixClass * Handle2MadlandNix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMadlandNix +MadlandNixDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2MadlandNix +MadlandNixDefault(); + +// --- Create, general, const +extern_c Handle2ConstMadlandNix +MadlandNixCreateConst( + ConstHandle2ConstEFL EFL, + ConstHandle2ConstEFH EFH, + ConstHandle2ConstT_M T_M +); + +// +++ Create, general, non-const +extern_c Handle2MadlandNix +MadlandNixCreate( + ConstHandle2ConstEFL EFL, + ConstHandle2ConstEFH EFH, + ConstHandle2ConstT_M T_M +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MadlandNixAssign(ConstHandle2MadlandNix self, ConstHandle2ConstMadlandNix from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MadlandNixDelete(ConstHandle2ConstMadlandNix self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MadlandNixRead(ConstHandle2MadlandNix self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MadlandNixWrite(ConstHandle2ConstMadlandNix self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MadlandNixPrint(ConstHandle2ConstMadlandNix self); + +// +++ Print to standard output, as XML +extern_c int +MadlandNixPrintXML(ConstHandle2ConstMadlandNix self); + +// +++ Print to standard output, as JSON +extern_c int +MadlandNixPrintJSON(ConstHandle2ConstMadlandNix self); + + +// ----------------------------------------------------------------------------- +// Child: EFL +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MadlandNixEFLHas(ConstHandle2ConstMadlandNix self); + +// --- Get, const +extern_c Handle2ConstEFL +MadlandNixEFLGetConst(ConstHandle2ConstMadlandNix self); + +// +++ Get, non-const +extern_c Handle2EFL +MadlandNixEFLGet(ConstHandle2MadlandNix self); + +// +++ Set +extern_c void +MadlandNixEFLSet(ConstHandle2MadlandNix self, ConstHandle2ConstEFL EFL); + + +// ----------------------------------------------------------------------------- +// Child: EFH +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MadlandNixEFHHas(ConstHandle2ConstMadlandNix self); + +// --- Get, const +extern_c Handle2ConstEFH +MadlandNixEFHGetConst(ConstHandle2ConstMadlandNix self); + +// +++ Get, non-const +extern_c Handle2EFH +MadlandNixEFHGet(ConstHandle2MadlandNix self); + +// +++ Set +extern_c void +MadlandNixEFHSet(ConstHandle2MadlandNix self, ConstHandle2ConstEFH EFH); + + +// ----------------------------------------------------------------------------- +// Child: T_M +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MadlandNixT_MHas(ConstHandle2ConstMadlandNix self); + +// --- Get, const +extern_c Handle2ConstT_M +MadlandNixT_MGetConst(ConstHandle2ConstMadlandNix self); + +// +++ Get, non-const +extern_c Handle2T_M +MadlandNixT_MGet(ConstHandle2MadlandNix self); + +// +++ Set +extern_c void +MadlandNixT_MSet(ConstHandle2MadlandNix self, ConstHandle2ConstT_M T_M); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/MadlandNix/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MadlandNix/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MadlandNix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MadlandNix/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MadlandNix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mass.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mass.cpp new file mode 100644 index 000000000..e41991486 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mass.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Mass.hpp" +#include "Mass.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = MassClass; +using CPP = multigroup::Mass; + +static const std::string CLASSNAME = "Mass"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDouble = general::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMass +MassDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Mass +MassDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMass +MassCreateConst( + const double value, + const char *const unit, + ConstHandle2ConstDouble Double +) { + ConstHandle2Mass handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + unit, + detail::tocpp(Double) + ); + return handle; +} + +// Create, general, non-const +Handle2Mass +MassCreate( + const double value, + const char *const unit, + ConstHandle2ConstDouble Double +) { + ConstHandle2Mass handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + unit, + detail::tocpp(Double) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MassAssign(ConstHandle2Mass self, ConstHandle2ConstMass from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MassDelete(ConstHandle2ConstMass self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MassRead(ConstHandle2Mass self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MassWrite(ConstHandle2ConstMass self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MassPrint(ConstHandle2ConstMass self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MassPrintXML(ConstHandle2ConstMass self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MassPrintJSON(ConstHandle2ConstMass self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +MassValueHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +MassValueGet(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +MassValueSet(ConstHandle2Mass self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +MassUnitHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +MassUnitGet(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +MassUnitSet(ConstHandle2Mass self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +MassDoubleHas(ConstHandle2ConstMass self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Get, const +Handle2ConstDouble +MassDoubleGetConst(ConstHandle2ConstMass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double); +} + +// Get, non-const +Handle2Double +MassDoubleGet(ConstHandle2Mass self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double); +} + +// Set +void +MassDoubleSet(ConstHandle2Mass self, ConstHandle2ConstDouble Double) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Mass/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mass.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mass.h new file mode 100644 index 000000000..8a5889fae --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mass.h @@ -0,0 +1,201 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Mass is the basic handle type in this file. Example: +// // Create a default Mass object: +// Mass handle = MassDefault(); +// Functions involving Mass are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_MASS +#define C_INTERFACE_GNDS_V2_0_GENERAL_MASS + +#include "GNDStk.h" +#include "v2.0/general/Double.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MassClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Mass +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MassClass *Mass; + +// --- Const-aware handles. +typedef const struct MassClass *const ConstHandle2ConstMass; +typedef struct MassClass *const ConstHandle2Mass; +typedef const struct MassClass * Handle2ConstMass; +typedef struct MassClass * Handle2Mass; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMass +MassDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Mass +MassDefault(); + +// --- Create, general, const +extern_c Handle2ConstMass +MassCreateConst( + const double value, + const char *const unit, + ConstHandle2ConstDouble Double +); + +// +++ Create, general, non-const +extern_c Handle2Mass +MassCreate( + const double value, + const char *const unit, + ConstHandle2ConstDouble Double +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MassAssign(ConstHandle2Mass self, ConstHandle2ConstMass from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MassDelete(ConstHandle2ConstMass self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MassRead(ConstHandle2Mass self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MassWrite(ConstHandle2ConstMass self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MassPrint(ConstHandle2ConstMass self); + +// +++ Print to standard output, as XML +extern_c int +MassPrintXML(ConstHandle2ConstMass self); + +// +++ Print to standard output, as JSON +extern_c int +MassPrintJSON(ConstHandle2ConstMass self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassValueHas(ConstHandle2ConstMass self); + +// +++ Get +// +++ Returns by value +extern_c double +MassValueGet(ConstHandle2ConstMass self); + +// +++ Set +extern_c void +MassValueSet(ConstHandle2Mass self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassUnitHas(ConstHandle2ConstMass self); + +// +++ Get +// +++ Returns by value +extern_c const char * +MassUnitGet(ConstHandle2ConstMass self); + +// +++ Set +extern_c void +MassUnitSet(ConstHandle2Mass self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MassDoubleHas(ConstHandle2ConstMass self); + +// --- Get, const +extern_c Handle2ConstDouble +MassDoubleGetConst(ConstHandle2ConstMass self); + +// +++ Get, non-const +extern_c Handle2Double +MassDoubleGet(ConstHandle2Mass self); + +// +++ Set +extern_c void +MassDoubleSet(ConstHandle2Mass self, ConstHandle2ConstDouble Double); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Mass/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mass/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mass/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mass/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mass/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MetaStable.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MetaStable.cpp new file mode 100644 index 000000000..8c4efdd3a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MetaStable.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/MetaStable.hpp" +#include "MetaStable.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = MetaStableClass; +using CPP = multigroup::MetaStable; + +static const std::string CLASSNAME = "MetaStable"; + +namespace extract { + static auto id = [](auto &obj) { return &obj.id; }; + static auto pid = [](auto &obj) { return &obj.pid; }; + static auto metaStableIndex = [](auto &obj) { return &obj.metaStableIndex; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMetaStable +MetaStableDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2MetaStable +MetaStableDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMetaStable +MetaStableCreateConst( + const char *const id, + const char *const pid, + const int metaStableIndex +) { + ConstHandle2MetaStable handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + pid, + metaStableIndex + ); + return handle; +} + +// Create, general, non-const +Handle2MetaStable +MetaStableCreate( + const char *const id, + const char *const pid, + const int metaStableIndex +) { + ConstHandle2MetaStable handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + pid, + metaStableIndex + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MetaStableAssign(ConstHandle2MetaStable self, ConstHandle2ConstMetaStable from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MetaStableDelete(ConstHandle2ConstMetaStable self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MetaStableRead(ConstHandle2MetaStable self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MetaStableWrite(ConstHandle2ConstMetaStable self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MetaStablePrint(ConstHandle2ConstMetaStable self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MetaStablePrintXML(ConstHandle2ConstMetaStable self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MetaStablePrintJSON(ConstHandle2ConstMetaStable self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// Has +int +MetaStableIdHas(ConstHandle2ConstMetaStable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IdHas", self, extract::id); +} + +// Get +// Returns by value +const char * +MetaStableIdGet(ConstHandle2ConstMetaStable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +MetaStableIdSet(ConstHandle2MetaStable self, const char *const id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +MetaStablePidHas(ConstHandle2ConstMetaStable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +MetaStablePidGet(ConstHandle2ConstMetaStable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +MetaStablePidSet(ConstHandle2MetaStable self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: metaStableIndex +// ----------------------------------------------------------------------------- + +// Has +int +MetaStableMetaStableIndexHas(ConstHandle2ConstMetaStable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MetaStableIndexHas", self, extract::metaStableIndex); +} + +// Get +// Returns by value +int +MetaStableMetaStableIndexGet(ConstHandle2ConstMetaStable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MetaStableIndexGet", self, extract::metaStableIndex); +} + +// Set +void +MetaStableMetaStableIndexSet(ConstHandle2MetaStable self, const int metaStableIndex) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MetaStableIndexSet", self, extract::metaStableIndex, metaStableIndex); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/MetaStable/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MetaStable.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MetaStable.h new file mode 100644 index 000000000..d6dbbc991 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MetaStable.h @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// MetaStable is the basic handle type in this file. Example: +// // Create a default MetaStable object: +// MetaStable handle = MetaStableDefault(); +// Functions involving MetaStable are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_METASTABLE +#define C_INTERFACE_GNDS_V2_0_GENERAL_METASTABLE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MetaStableClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ MetaStable +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MetaStableClass *MetaStable; + +// --- Const-aware handles. +typedef const struct MetaStableClass *const ConstHandle2ConstMetaStable; +typedef struct MetaStableClass *const ConstHandle2MetaStable; +typedef const struct MetaStableClass * Handle2ConstMetaStable; +typedef struct MetaStableClass * Handle2MetaStable; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMetaStable +MetaStableDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2MetaStable +MetaStableDefault(); + +// --- Create, general, const +extern_c Handle2ConstMetaStable +MetaStableCreateConst( + const char *const id, + const char *const pid, + const int metaStableIndex +); + +// +++ Create, general, non-const +extern_c Handle2MetaStable +MetaStableCreate( + const char *const id, + const char *const pid, + const int metaStableIndex +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MetaStableAssign(ConstHandle2MetaStable self, ConstHandle2ConstMetaStable from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MetaStableDelete(ConstHandle2ConstMetaStable self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MetaStableRead(ConstHandle2MetaStable self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MetaStableWrite(ConstHandle2ConstMetaStable self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MetaStablePrint(ConstHandle2ConstMetaStable self); + +// +++ Print to standard output, as XML +extern_c int +MetaStablePrintXML(ConstHandle2ConstMetaStable self); + +// +++ Print to standard output, as JSON +extern_c int +MetaStablePrintJSON(ConstHandle2ConstMetaStable self); + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MetaStableIdHas(ConstHandle2ConstMetaStable self); + +// +++ Get +// +++ Returns by value +extern_c const char * +MetaStableIdGet(ConstHandle2ConstMetaStable self); + +// +++ Set +extern_c void +MetaStableIdSet(ConstHandle2MetaStable self, const char *const id); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MetaStablePidHas(ConstHandle2ConstMetaStable self); + +// +++ Get +// +++ Returns by value +extern_c const char * +MetaStablePidGet(ConstHandle2ConstMetaStable self); + +// +++ Set +extern_c void +MetaStablePidSet(ConstHandle2MetaStable self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: metaStableIndex +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MetaStableMetaStableIndexHas(ConstHandle2ConstMetaStable self); + +// +++ Get +// +++ Returns by value +extern_c int +MetaStableMetaStableIndexGet(ConstHandle2ConstMetaStable self); + +// +++ Set +extern_c void +MetaStableMetaStableIndexSet(ConstHandle2MetaStable self, const int metaStableIndex); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/MetaStable/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MetaStable/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MetaStable/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MetaStable/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MetaStable/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mixed.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mixed.cpp new file mode 100644 index 000000000..d057eadf7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mixed.cpp @@ -0,0 +1,707 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Mixed.hpp" +#include "Mixed.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = MixedClass; +using CPP = multigroup::Mixed; + +static const std::string CLASSNAME = "Mixed"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto covarianceMatrix = [](auto &obj) { return &obj.covarianceMatrix; }; + static auto sum = [](auto &obj) { return &obj.sum; }; + static auto shortRangeSelfScalingVariance = [](auto &obj) { return &obj.shortRangeSelfScalingVariance; }; +} + +using CPPCovarianceMatrix = general::CovarianceMatrix; +using CPPSum = general::Sum; +using CPPShortRangeSelfScalingVariance = general::ShortRangeSelfScalingVariance; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMixed +MixedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Mixed +MixedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMixed +MixedCreateConst( + const char *const label, + ConstHandle2CovarianceMatrix *const covarianceMatrix, const size_t covarianceMatrixSize, + ConstHandle2Sum *const sum, const size_t sumSize, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +) { + ConstHandle2Mixed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + std::vector{}, + std::vector{}, + detail::tocpp(shortRangeSelfScalingVariance) + ); + for (size_t CovarianceMatrixN = 0; CovarianceMatrixN < covarianceMatrixSize; ++CovarianceMatrixN) + MixedCovarianceMatrixAdd(handle, covarianceMatrix[CovarianceMatrixN]); + for (size_t SumN = 0; SumN < sumSize; ++SumN) + MixedSumAdd(handle, sum[SumN]); + return handle; +} + +// Create, general, non-const +Handle2Mixed +MixedCreate( + const char *const label, + ConstHandle2CovarianceMatrix *const covarianceMatrix, const size_t covarianceMatrixSize, + ConstHandle2Sum *const sum, const size_t sumSize, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +) { + ConstHandle2Mixed handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + std::vector{}, + std::vector{}, + detail::tocpp(shortRangeSelfScalingVariance) + ); + for (size_t CovarianceMatrixN = 0; CovarianceMatrixN < covarianceMatrixSize; ++CovarianceMatrixN) + MixedCovarianceMatrixAdd(handle, covarianceMatrix[CovarianceMatrixN]); + for (size_t SumN = 0; SumN < sumSize; ++SumN) + MixedSumAdd(handle, sum[SumN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MixedAssign(ConstHandle2Mixed self, ConstHandle2ConstMixed from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MixedDelete(ConstHandle2ConstMixed self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MixedRead(ConstHandle2Mixed self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MixedWrite(ConstHandle2ConstMixed self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MixedPrint(ConstHandle2ConstMixed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MixedPrintXML(ConstHandle2ConstMixed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MixedPrintJSON(ConstHandle2ConstMixed self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +MixedLabelHas(ConstHandle2ConstMixed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +MixedLabelGet(ConstHandle2ConstMixed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +MixedLabelSet(ConstHandle2Mixed self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: covarianceMatrix +// ----------------------------------------------------------------------------- + +// Has +int +MixedCovarianceMatrixHas(ConstHandle2ConstMixed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CovarianceMatrixHas", self, extract::covarianceMatrix); +} + +// Clear +void +MixedCovarianceMatrixClear(ConstHandle2Mixed self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"CovarianceMatrixClear", self, extract::covarianceMatrix); +} + +// Size +size_t +MixedCovarianceMatrixSize(ConstHandle2ConstMixed self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"CovarianceMatrixSize", self, extract::covarianceMatrix); +} + +// Add +void +MixedCovarianceMatrixAdd(ConstHandle2Mixed self, ConstHandle2ConstCovarianceMatrix covarianceMatrix) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"CovarianceMatrixAdd", self, extract::covarianceMatrix, covarianceMatrix); +} + +// Get, by index \in [0,size), const +Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetConst(ConstHandle2ConstMixed self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetConst", self, extract::covarianceMatrix, index_); +} + +// Get, by index \in [0,size), non-const +Handle2CovarianceMatrix +MixedCovarianceMatrixGet(ConstHandle2Mixed self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"CovarianceMatrixGet", self, extract::covarianceMatrix, index_); +} + +// Set, by index \in [0,size) +void +MixedCovarianceMatrixSet( + ConstHandle2Mixed self, + const size_t index_, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"CovarianceMatrixSet", self, extract::covarianceMatrix, index_, covarianceMatrix); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +MixedCovarianceMatrixHasByLabel( + ConstHandle2ConstMixed self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixHasByLabel", + self, extract::covarianceMatrix, meta::label, label); +} + +// Get, by label, const +Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByLabelConst( + ConstHandle2ConstMixed self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByLabelConst", + self, extract::covarianceMatrix, meta::label, label); +} + +// Get, by label, non-const +Handle2CovarianceMatrix +MixedCovarianceMatrixGetByLabel( + ConstHandle2Mixed self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByLabel", + self, extract::covarianceMatrix, meta::label, label); +} + +// Set, by label +void +MixedCovarianceMatrixSetByLabel( + ConstHandle2Mixed self, + const char *const label, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixSetByLabel", + self, extract::covarianceMatrix, meta::label, label, covarianceMatrix); +} + +// ------------------------ +// Re: metadatum type +// ------------------------ + +// Has, by type +int +MixedCovarianceMatrixHasByType( + ConstHandle2ConstMixed self, + const char *const type +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixHasByType", + self, extract::covarianceMatrix, meta::type, type); +} + +// Get, by type, const +Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByTypeConst( + ConstHandle2ConstMixed self, + const char *const type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByTypeConst", + self, extract::covarianceMatrix, meta::type, type); +} + +// Get, by type, non-const +Handle2CovarianceMatrix +MixedCovarianceMatrixGetByType( + ConstHandle2Mixed self, + const char *const type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByType", + self, extract::covarianceMatrix, meta::type, type); +} + +// Set, by type +void +MixedCovarianceMatrixSetByType( + ConstHandle2Mixed self, + const char *const type, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixSetByType", + self, extract::covarianceMatrix, meta::type, type, covarianceMatrix); +} + +// ------------------------ +// Re: metadatum productFrame +// ------------------------ + +// Has, by productFrame +int +MixedCovarianceMatrixHasByProductFrame( + ConstHandle2ConstMixed self, + const char *const productFrame +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixHasByProductFrame", + self, extract::covarianceMatrix, meta::productFrame, productFrame); +} + +// Get, by productFrame, const +Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByProductFrameConst( + ConstHandle2ConstMixed self, + const char *const productFrame +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByProductFrameConst", + self, extract::covarianceMatrix, meta::productFrame, productFrame); +} + +// Get, by productFrame, non-const +Handle2CovarianceMatrix +MixedCovarianceMatrixGetByProductFrame( + ConstHandle2Mixed self, + const char *const productFrame +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixGetByProductFrame", + self, extract::covarianceMatrix, meta::productFrame, productFrame); +} + +// Set, by productFrame +void +MixedCovarianceMatrixSetByProductFrame( + ConstHandle2Mixed self, + const char *const productFrame, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"CovarianceMatrixSetByProductFrame", + self, extract::covarianceMatrix, meta::productFrame, productFrame, covarianceMatrix); +} + + +// ----------------------------------------------------------------------------- +// Child: sum +// ----------------------------------------------------------------------------- + +// Has +int +MixedSumHas(ConstHandle2ConstMixed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SumHas", self, extract::sum); +} + +// Clear +void +MixedSumClear(ConstHandle2Mixed self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"SumClear", self, extract::sum); +} + +// Size +size_t +MixedSumSize(ConstHandle2ConstMixed self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"SumSize", self, extract::sum); +} + +// Add +void +MixedSumAdd(ConstHandle2Mixed self, ConstHandle2ConstSum sum) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"SumAdd", self, extract::sum, sum); +} + +// Get, by index \in [0,size), const +Handle2ConstSum +MixedSumGetConst(ConstHandle2ConstMixed self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SumGetConst", self, extract::sum, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Sum +MixedSumGet(ConstHandle2Mixed self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SumGet", self, extract::sum, index_); +} + +// Set, by index \in [0,size) +void +MixedSumSet( + ConstHandle2Mixed self, + const size_t index_, + ConstHandle2ConstSum sum +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"SumSet", self, extract::sum, index_, sum); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +MixedSumHasByLabel( + ConstHandle2ConstMixed self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SumHasByLabel", + self, extract::sum, meta::label, label); +} + +// Get, by label, const +Handle2ConstSum +MixedSumGetByLabelConst( + ConstHandle2ConstMixed self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByLabelConst", + self, extract::sum, meta::label, label); +} + +// Get, by label, non-const +Handle2Sum +MixedSumGetByLabel( + ConstHandle2Mixed self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByLabel", + self, extract::sum, meta::label, label); +} + +// Set, by label +void +MixedSumSetByLabel( + ConstHandle2Mixed self, + const char *const label, + ConstHandle2ConstSum sum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SumSetByLabel", + self, extract::sum, meta::label, label, sum); +} + +// ------------------------ +// Re: metadatum domainMin +// ------------------------ + +// Has, by domainMin +int +MixedSumHasByDomainMin( + ConstHandle2ConstMixed self, + const double domainMin +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SumHasByDomainMin", + self, extract::sum, meta::domainMin, domainMin); +} + +// Get, by domainMin, const +Handle2ConstSum +MixedSumGetByDomainMinConst( + ConstHandle2ConstMixed self, + const double domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainMinConst", + self, extract::sum, meta::domainMin, domainMin); +} + +// Get, by domainMin, non-const +Handle2Sum +MixedSumGetByDomainMin( + ConstHandle2Mixed self, + const double domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainMin", + self, extract::sum, meta::domainMin, domainMin); +} + +// Set, by domainMin +void +MixedSumSetByDomainMin( + ConstHandle2Mixed self, + const double domainMin, + ConstHandle2ConstSum sum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SumSetByDomainMin", + self, extract::sum, meta::domainMin, domainMin, sum); +} + +// ------------------------ +// Re: metadatum domainMax +// ------------------------ + +// Has, by domainMax +int +MixedSumHasByDomainMax( + ConstHandle2ConstMixed self, + const double domainMax +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SumHasByDomainMax", + self, extract::sum, meta::domainMax, domainMax); +} + +// Get, by domainMax, const +Handle2ConstSum +MixedSumGetByDomainMaxConst( + ConstHandle2ConstMixed self, + const double domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainMaxConst", + self, extract::sum, meta::domainMax, domainMax); +} + +// Get, by domainMax, non-const +Handle2Sum +MixedSumGetByDomainMax( + ConstHandle2Mixed self, + const double domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainMax", + self, extract::sum, meta::domainMax, domainMax); +} + +// Set, by domainMax +void +MixedSumSetByDomainMax( + ConstHandle2Mixed self, + const double domainMax, + ConstHandle2ConstSum sum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SumSetByDomainMax", + self, extract::sum, meta::domainMax, domainMax, sum); +} + +// ------------------------ +// Re: metadatum domainUnit +// ------------------------ + +// Has, by domainUnit +int +MixedSumHasByDomainUnit( + ConstHandle2ConstMixed self, + const char *const domainUnit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SumHasByDomainUnit", + self, extract::sum, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, const +Handle2ConstSum +MixedSumGetByDomainUnitConst( + ConstHandle2ConstMixed self, + const char *const domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainUnitConst", + self, extract::sum, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, non-const +Handle2Sum +MixedSumGetByDomainUnit( + ConstHandle2Mixed self, + const char *const domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SumGetByDomainUnit", + self, extract::sum, meta::domainUnit, domainUnit); +} + +// Set, by domainUnit +void +MixedSumSetByDomainUnit( + ConstHandle2Mixed self, + const char *const domainUnit, + ConstHandle2ConstSum sum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SumSetByDomainUnit", + self, extract::sum, meta::domainUnit, domainUnit, sum); +} + + +// ----------------------------------------------------------------------------- +// Child: shortRangeSelfScalingVariance +// ----------------------------------------------------------------------------- + +// Has +int +MixedShortRangeSelfScalingVarianceHas(ConstHandle2ConstMixed self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceHas", self, extract::shortRangeSelfScalingVariance); +} + +// Get, const +Handle2ConstShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetConst(ConstHandle2ConstMixed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceGetConst", self, extract::shortRangeSelfScalingVariance); +} + +// Get, non-const +Handle2ShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGet(ConstHandle2Mixed self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceGet", self, extract::shortRangeSelfScalingVariance); +} + +// Set +void +MixedShortRangeSelfScalingVarianceSet(ConstHandle2Mixed self, ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ShortRangeSelfScalingVarianceSet", self, extract::shortRangeSelfScalingVariance, shortRangeSelfScalingVariance); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Mixed/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mixed.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mixed.h new file mode 100644 index 000000000..326e8cc56 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mixed.h @@ -0,0 +1,492 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Mixed is the basic handle type in this file. Example: +// // Create a default Mixed object: +// Mixed handle = MixedDefault(); +// Functions involving Mixed are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_MIXED +#define C_INTERFACE_GNDS_V2_0_GENERAL_MIXED + +#include "GNDStk.h" +#include "v2.0/general/CovarianceMatrix.h" +#include "v2.0/general/Sum.h" +#include "v2.0/general/ShortRangeSelfScalingVariance.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MixedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Mixed +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MixedClass *Mixed; + +// --- Const-aware handles. +typedef const struct MixedClass *const ConstHandle2ConstMixed; +typedef struct MixedClass *const ConstHandle2Mixed; +typedef const struct MixedClass * Handle2ConstMixed; +typedef struct MixedClass * Handle2Mixed; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMixed +MixedDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Mixed +MixedDefault(); + +// --- Create, general, const +extern_c Handle2ConstMixed +MixedCreateConst( + const char *const label, + ConstHandle2CovarianceMatrix *const covarianceMatrix, const size_t covarianceMatrixSize, + ConstHandle2Sum *const sum, const size_t sumSize, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +); + +// +++ Create, general, non-const +extern_c Handle2Mixed +MixedCreate( + const char *const label, + ConstHandle2CovarianceMatrix *const covarianceMatrix, const size_t covarianceMatrixSize, + ConstHandle2Sum *const sum, const size_t sumSize, + ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MixedAssign(ConstHandle2Mixed self, ConstHandle2ConstMixed from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MixedDelete(ConstHandle2ConstMixed self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MixedRead(ConstHandle2Mixed self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MixedWrite(ConstHandle2ConstMixed self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MixedPrint(ConstHandle2ConstMixed self); + +// +++ Print to standard output, as XML +extern_c int +MixedPrintXML(ConstHandle2ConstMixed self); + +// +++ Print to standard output, as JSON +extern_c int +MixedPrintJSON(ConstHandle2ConstMixed self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MixedLabelHas(ConstHandle2ConstMixed self); + +// +++ Get +// +++ Returns by value +extern_c const char * +MixedLabelGet(ConstHandle2ConstMixed self); + +// +++ Set +extern_c void +MixedLabelSet(ConstHandle2Mixed self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Child: covarianceMatrix +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MixedCovarianceMatrixHas(ConstHandle2ConstMixed self); + +// +++ Clear +extern_c void +MixedCovarianceMatrixClear(ConstHandle2Mixed self); + +// +++ Size +extern_c size_t +MixedCovarianceMatrixSize(ConstHandle2ConstMixed self); + +// +++ Add +extern_c void +MixedCovarianceMatrixAdd(ConstHandle2Mixed self, ConstHandle2ConstCovarianceMatrix covarianceMatrix); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetConst(ConstHandle2ConstMixed self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2CovarianceMatrix +MixedCovarianceMatrixGet(ConstHandle2Mixed self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +MixedCovarianceMatrixSet( + ConstHandle2Mixed self, + const size_t index_, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +MixedCovarianceMatrixHasByLabel( + ConstHandle2ConstMixed self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByLabelConst( + ConstHandle2ConstMixed self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2CovarianceMatrix +MixedCovarianceMatrixGetByLabel( + ConstHandle2Mixed self, + const char *const label +); + +// +++ Set, by label +extern_c void +MixedCovarianceMatrixSetByLabel( + ConstHandle2Mixed self, + const char *const label, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +); + +// ------------------------ +// Re: metadatum type +// ------------------------ + +// +++ Has, by type +extern_c int +MixedCovarianceMatrixHasByType( + ConstHandle2ConstMixed self, + const char *const type +); + +// --- Get, by type, const +extern_c Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByTypeConst( + ConstHandle2ConstMixed self, + const char *const type +); + +// +++ Get, by type, non-const +extern_c Handle2CovarianceMatrix +MixedCovarianceMatrixGetByType( + ConstHandle2Mixed self, + const char *const type +); + +// +++ Set, by type +extern_c void +MixedCovarianceMatrixSetByType( + ConstHandle2Mixed self, + const char *const type, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +); + +// ------------------------ +// Re: metadatum productFrame +// ------------------------ + +// +++ Has, by productFrame +extern_c int +MixedCovarianceMatrixHasByProductFrame( + ConstHandle2ConstMixed self, + const char *const productFrame +); + +// --- Get, by productFrame, const +extern_c Handle2ConstCovarianceMatrix +MixedCovarianceMatrixGetByProductFrameConst( + ConstHandle2ConstMixed self, + const char *const productFrame +); + +// +++ Get, by productFrame, non-const +extern_c Handle2CovarianceMatrix +MixedCovarianceMatrixGetByProductFrame( + ConstHandle2Mixed self, + const char *const productFrame +); + +// +++ Set, by productFrame +extern_c void +MixedCovarianceMatrixSetByProductFrame( + ConstHandle2Mixed self, + const char *const productFrame, + ConstHandle2ConstCovarianceMatrix covarianceMatrix +); + + +// ----------------------------------------------------------------------------- +// Child: sum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MixedSumHas(ConstHandle2ConstMixed self); + +// +++ Clear +extern_c void +MixedSumClear(ConstHandle2Mixed self); + +// +++ Size +extern_c size_t +MixedSumSize(ConstHandle2ConstMixed self); + +// +++ Add +extern_c void +MixedSumAdd(ConstHandle2Mixed self, ConstHandle2ConstSum sum); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstSum +MixedSumGetConst(ConstHandle2ConstMixed self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Sum +MixedSumGet(ConstHandle2Mixed self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +MixedSumSet( + ConstHandle2Mixed self, + const size_t index_, + ConstHandle2ConstSum sum +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +MixedSumHasByLabel( + ConstHandle2ConstMixed self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstSum +MixedSumGetByLabelConst( + ConstHandle2ConstMixed self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Sum +MixedSumGetByLabel( + ConstHandle2Mixed self, + const char *const label +); + +// +++ Set, by label +extern_c void +MixedSumSetByLabel( + ConstHandle2Mixed self, + const char *const label, + ConstHandle2ConstSum sum +); + +// ------------------------ +// Re: metadatum domainMin +// ------------------------ + +// +++ Has, by domainMin +extern_c int +MixedSumHasByDomainMin( + ConstHandle2ConstMixed self, + const double domainMin +); + +// --- Get, by domainMin, const +extern_c Handle2ConstSum +MixedSumGetByDomainMinConst( + ConstHandle2ConstMixed self, + const double domainMin +); + +// +++ Get, by domainMin, non-const +extern_c Handle2Sum +MixedSumGetByDomainMin( + ConstHandle2Mixed self, + const double domainMin +); + +// +++ Set, by domainMin +extern_c void +MixedSumSetByDomainMin( + ConstHandle2Mixed self, + const double domainMin, + ConstHandle2ConstSum sum +); + +// ------------------------ +// Re: metadatum domainMax +// ------------------------ + +// +++ Has, by domainMax +extern_c int +MixedSumHasByDomainMax( + ConstHandle2ConstMixed self, + const double domainMax +); + +// --- Get, by domainMax, const +extern_c Handle2ConstSum +MixedSumGetByDomainMaxConst( + ConstHandle2ConstMixed self, + const double domainMax +); + +// +++ Get, by domainMax, non-const +extern_c Handle2Sum +MixedSumGetByDomainMax( + ConstHandle2Mixed self, + const double domainMax +); + +// +++ Set, by domainMax +extern_c void +MixedSumSetByDomainMax( + ConstHandle2Mixed self, + const double domainMax, + ConstHandle2ConstSum sum +); + +// ------------------------ +// Re: metadatum domainUnit +// ------------------------ + +// +++ Has, by domainUnit +extern_c int +MixedSumHasByDomainUnit( + ConstHandle2ConstMixed self, + const char *const domainUnit +); + +// --- Get, by domainUnit, const +extern_c Handle2ConstSum +MixedSumGetByDomainUnitConst( + ConstHandle2ConstMixed self, + const char *const domainUnit +); + +// +++ Get, by domainUnit, non-const +extern_c Handle2Sum +MixedSumGetByDomainUnit( + ConstHandle2Mixed self, + const char *const domainUnit +); + +// +++ Set, by domainUnit +extern_c void +MixedSumSetByDomainUnit( + ConstHandle2Mixed self, + const char *const domainUnit, + ConstHandle2ConstSum sum +); + + +// ----------------------------------------------------------------------------- +// Child: shortRangeSelfScalingVariance +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MixedShortRangeSelfScalingVarianceHas(ConstHandle2ConstMixed self); + +// --- Get, const +extern_c Handle2ConstShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGetConst(ConstHandle2ConstMixed self); + +// +++ Get, non-const +extern_c Handle2ShortRangeSelfScalingVariance +MixedShortRangeSelfScalingVarianceGet(ConstHandle2Mixed self); + +// +++ Set +extern_c void +MixedShortRangeSelfScalingVarianceSet(ConstHandle2Mixed self, ConstHandle2ConstShortRangeSelfScalingVariance shortRangeSelfScalingVariance); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Mixed/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mixed/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mixed/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mixed/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Mixed/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Multiplicity.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Multiplicity.cpp new file mode 100644 index 000000000..f34dfcaa9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Multiplicity.cpp @@ -0,0 +1,482 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Multiplicity.hpp" +#include "Multiplicity.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = MultiplicityClass; +using CPP = multigroup::Multiplicity; + +static const std::string CLASSNAME = "Multiplicity"; + +namespace extract { + static auto constant1d = [](auto &obj) { return &obj.constant1d; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; + static auto reference = [](auto &obj) { return &obj.reference; }; + static auto branching1d = [](auto &obj) { return &obj.branching1d; }; + static auto branching3d = [](auto &obj) { return &obj.branching3d; }; + static auto unspecified = [](auto &obj) { return &obj.unspecified; }; +} + +using CPPConstant1d = general::Constant1d; +using CPPXYs1d = general::XYs1d; +using CPPRegions1d = general::Regions1d; +using CPPPolynomial1d = general::Polynomial1d; +using CPPReference = general::Reference; +using CPPBranching1d = general::Branching1d; +using CPPBranching3d = general::Branching3d; +using CPPUnspecified = general::Unspecified; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMultiplicity +MultiplicityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Multiplicity +MultiplicityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMultiplicity +MultiplicityCreateConst( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstReference reference, + ConstHandle2ConstBranching1d branching1d, + ConstHandle2ConstBranching3d branching3d, + ConstHandle2ConstUnspecified unspecified +) { + ConstHandle2Multiplicity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(constant1d), + detail::tocpp(XYs1d), + detail::tocpp(regions1d), + detail::tocpp(polynomial1d), + detail::tocpp(reference), + detail::tocpp(branching1d), + detail::tocpp(branching3d), + detail::tocpp(unspecified) + ); + return handle; +} + +// Create, general, non-const +Handle2Multiplicity +MultiplicityCreate( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstReference reference, + ConstHandle2ConstBranching1d branching1d, + ConstHandle2ConstBranching3d branching3d, + ConstHandle2ConstUnspecified unspecified +) { + ConstHandle2Multiplicity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(constant1d), + detail::tocpp(XYs1d), + detail::tocpp(regions1d), + detail::tocpp(polynomial1d), + detail::tocpp(reference), + detail::tocpp(branching1d), + detail::tocpp(branching3d), + detail::tocpp(unspecified) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MultiplicityAssign(ConstHandle2Multiplicity self, ConstHandle2ConstMultiplicity from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MultiplicityDelete(ConstHandle2ConstMultiplicity self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MultiplicityRead(ConstHandle2Multiplicity self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MultiplicityWrite(ConstHandle2ConstMultiplicity self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MultiplicityPrint(ConstHandle2ConstMultiplicity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MultiplicityPrintXML(ConstHandle2ConstMultiplicity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MultiplicityPrintJSON(ConstHandle2ConstMultiplicity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicityConstant1dHas(ConstHandle2ConstMultiplicity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Constant1dHas", self, extract::constant1d); +} + +// Get, const +Handle2ConstConstant1d +MultiplicityConstant1dGetConst(ConstHandle2ConstMultiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGetConst", self, extract::constant1d); +} + +// Get, non-const +Handle2Constant1d +MultiplicityConstant1dGet(ConstHandle2Multiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGet", self, extract::constant1d); +} + +// Set +void +MultiplicityConstant1dSet(ConstHandle2Multiplicity self, ConstHandle2ConstConstant1d constant1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Constant1dSet", self, extract::constant1d, constant1d); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicityXYs1dHas(ConstHandle2ConstMultiplicity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +MultiplicityXYs1dGetConst(ConstHandle2ConstMultiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +MultiplicityXYs1dGet(ConstHandle2Multiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +MultiplicityXYs1dSet(ConstHandle2Multiplicity self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicityRegions1dHas(ConstHandle2ConstMultiplicity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +MultiplicityRegions1dGetConst(ConstHandle2ConstMultiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +MultiplicityRegions1dGet(ConstHandle2Multiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +MultiplicityRegions1dSet(ConstHandle2Multiplicity self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicityPolynomial1dHas(ConstHandle2ConstMultiplicity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Polynomial1dHas", self, extract::polynomial1d); +} + +// Get, const +Handle2ConstPolynomial1d +MultiplicityPolynomial1dGetConst(ConstHandle2ConstMultiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGetConst", self, extract::polynomial1d); +} + +// Get, non-const +Handle2Polynomial1d +MultiplicityPolynomial1dGet(ConstHandle2Multiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGet", self, extract::polynomial1d); +} + +// Set +void +MultiplicityPolynomial1dSet(ConstHandle2Multiplicity self, ConstHandle2ConstPolynomial1d polynomial1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Polynomial1dSet", self, extract::polynomial1d, polynomial1d); +} + + +// ----------------------------------------------------------------------------- +// Child: reference +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicityReferenceHas(ConstHandle2ConstMultiplicity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ReferenceHas", self, extract::reference); +} + +// Get, const +Handle2ConstReference +MultiplicityReferenceGetConst(ConstHandle2ConstMultiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReferenceGetConst", self, extract::reference); +} + +// Get, non-const +Handle2Reference +MultiplicityReferenceGet(ConstHandle2Multiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReferenceGet", self, extract::reference); +} + +// Set +void +MultiplicityReferenceSet(ConstHandle2Multiplicity self, ConstHandle2ConstReference reference) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ReferenceSet", self, extract::reference, reference); +} + + +// ----------------------------------------------------------------------------- +// Child: branching1d +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicityBranching1dHas(ConstHandle2ConstMultiplicity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Branching1dHas", self, extract::branching1d); +} + +// Get, const +Handle2ConstBranching1d +MultiplicityBranching1dGetConst(ConstHandle2ConstMultiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Branching1dGetConst", self, extract::branching1d); +} + +// Get, non-const +Handle2Branching1d +MultiplicityBranching1dGet(ConstHandle2Multiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Branching1dGet", self, extract::branching1d); +} + +// Set +void +MultiplicityBranching1dSet(ConstHandle2Multiplicity self, ConstHandle2ConstBranching1d branching1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Branching1dSet", self, extract::branching1d, branching1d); +} + + +// ----------------------------------------------------------------------------- +// Child: branching3d +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicityBranching3dHas(ConstHandle2ConstMultiplicity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Branching3dHas", self, extract::branching3d); +} + +// Get, const +Handle2ConstBranching3d +MultiplicityBranching3dGetConst(ConstHandle2ConstMultiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Branching3dGetConst", self, extract::branching3d); +} + +// Get, non-const +Handle2Branching3d +MultiplicityBranching3dGet(ConstHandle2Multiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Branching3dGet", self, extract::branching3d); +} + +// Set +void +MultiplicityBranching3dSet(ConstHandle2Multiplicity self, ConstHandle2ConstBranching3d branching3d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Branching3dSet", self, extract::branching3d, branching3d); +} + + +// ----------------------------------------------------------------------------- +// Child: unspecified +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicityUnspecifiedHas(ConstHandle2ConstMultiplicity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnspecifiedHas", self, extract::unspecified); +} + +// Get, const +Handle2ConstUnspecified +MultiplicityUnspecifiedGetConst(ConstHandle2ConstMultiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnspecifiedGetConst", self, extract::unspecified); +} + +// Get, non-const +Handle2Unspecified +MultiplicityUnspecifiedGet(ConstHandle2Multiplicity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnspecifiedGet", self, extract::unspecified); +} + +// Set +void +MultiplicityUnspecifiedSet(ConstHandle2Multiplicity self, ConstHandle2ConstUnspecified unspecified) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnspecifiedSet", self, extract::unspecified, unspecified); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Multiplicity/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Multiplicity.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Multiplicity.h new file mode 100644 index 000000000..3d1141835 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Multiplicity.h @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Multiplicity is the basic handle type in this file. Example: +// // Create a default Multiplicity object: +// Multiplicity handle = MultiplicityDefault(); +// Functions involving Multiplicity are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_MULTIPLICITY +#define C_INTERFACE_GNDS_V2_0_GENERAL_MULTIPLICITY + +#include "GNDStk.h" +#include "v2.0/general/Constant1d.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/Regions1d.h" +#include "v2.0/general/Polynomial1d.h" +#include "v2.0/general/Reference.h" +#include "v2.0/general/Branching1d.h" +#include "v2.0/general/Branching3d.h" +#include "v2.0/general/Unspecified.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MultiplicityClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Multiplicity +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MultiplicityClass *Multiplicity; + +// --- Const-aware handles. +typedef const struct MultiplicityClass *const ConstHandle2ConstMultiplicity; +typedef struct MultiplicityClass *const ConstHandle2Multiplicity; +typedef const struct MultiplicityClass * Handle2ConstMultiplicity; +typedef struct MultiplicityClass * Handle2Multiplicity; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMultiplicity +MultiplicityDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Multiplicity +MultiplicityDefault(); + +// --- Create, general, const +extern_c Handle2ConstMultiplicity +MultiplicityCreateConst( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstReference reference, + ConstHandle2ConstBranching1d branching1d, + ConstHandle2ConstBranching3d branching3d, + ConstHandle2ConstUnspecified unspecified +); + +// +++ Create, general, non-const +extern_c Handle2Multiplicity +MultiplicityCreate( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstReference reference, + ConstHandle2ConstBranching1d branching1d, + ConstHandle2ConstBranching3d branching3d, + ConstHandle2ConstUnspecified unspecified +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MultiplicityAssign(ConstHandle2Multiplicity self, ConstHandle2ConstMultiplicity from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MultiplicityDelete(ConstHandle2ConstMultiplicity self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MultiplicityRead(ConstHandle2Multiplicity self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MultiplicityWrite(ConstHandle2ConstMultiplicity self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MultiplicityPrint(ConstHandle2ConstMultiplicity self); + +// +++ Print to standard output, as XML +extern_c int +MultiplicityPrintXML(ConstHandle2ConstMultiplicity self); + +// +++ Print to standard output, as JSON +extern_c int +MultiplicityPrintJSON(ConstHandle2ConstMultiplicity self); + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicityConstant1dHas(ConstHandle2ConstMultiplicity self); + +// --- Get, const +extern_c Handle2ConstConstant1d +MultiplicityConstant1dGetConst(ConstHandle2ConstMultiplicity self); + +// +++ Get, non-const +extern_c Handle2Constant1d +MultiplicityConstant1dGet(ConstHandle2Multiplicity self); + +// +++ Set +extern_c void +MultiplicityConstant1dSet(ConstHandle2Multiplicity self, ConstHandle2ConstConstant1d constant1d); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicityXYs1dHas(ConstHandle2ConstMultiplicity self); + +// --- Get, const +extern_c Handle2ConstXYs1d +MultiplicityXYs1dGetConst(ConstHandle2ConstMultiplicity self); + +// +++ Get, non-const +extern_c Handle2XYs1d +MultiplicityXYs1dGet(ConstHandle2Multiplicity self); + +// +++ Set +extern_c void +MultiplicityXYs1dSet(ConstHandle2Multiplicity self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicityRegions1dHas(ConstHandle2ConstMultiplicity self); + +// --- Get, const +extern_c Handle2ConstRegions1d +MultiplicityRegions1dGetConst(ConstHandle2ConstMultiplicity self); + +// +++ Get, non-const +extern_c Handle2Regions1d +MultiplicityRegions1dGet(ConstHandle2Multiplicity self); + +// +++ Set +extern_c void +MultiplicityRegions1dSet(ConstHandle2Multiplicity self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicityPolynomial1dHas(ConstHandle2ConstMultiplicity self); + +// --- Get, const +extern_c Handle2ConstPolynomial1d +MultiplicityPolynomial1dGetConst(ConstHandle2ConstMultiplicity self); + +// +++ Get, non-const +extern_c Handle2Polynomial1d +MultiplicityPolynomial1dGet(ConstHandle2Multiplicity self); + +// +++ Set +extern_c void +MultiplicityPolynomial1dSet(ConstHandle2Multiplicity self, ConstHandle2ConstPolynomial1d polynomial1d); + + +// ----------------------------------------------------------------------------- +// Child: reference +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicityReferenceHas(ConstHandle2ConstMultiplicity self); + +// --- Get, const +extern_c Handle2ConstReference +MultiplicityReferenceGetConst(ConstHandle2ConstMultiplicity self); + +// +++ Get, non-const +extern_c Handle2Reference +MultiplicityReferenceGet(ConstHandle2Multiplicity self); + +// +++ Set +extern_c void +MultiplicityReferenceSet(ConstHandle2Multiplicity self, ConstHandle2ConstReference reference); + + +// ----------------------------------------------------------------------------- +// Child: branching1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicityBranching1dHas(ConstHandle2ConstMultiplicity self); + +// --- Get, const +extern_c Handle2ConstBranching1d +MultiplicityBranching1dGetConst(ConstHandle2ConstMultiplicity self); + +// +++ Get, non-const +extern_c Handle2Branching1d +MultiplicityBranching1dGet(ConstHandle2Multiplicity self); + +// +++ Set +extern_c void +MultiplicityBranching1dSet(ConstHandle2Multiplicity self, ConstHandle2ConstBranching1d branching1d); + + +// ----------------------------------------------------------------------------- +// Child: branching3d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicityBranching3dHas(ConstHandle2ConstMultiplicity self); + +// --- Get, const +extern_c Handle2ConstBranching3d +MultiplicityBranching3dGetConst(ConstHandle2ConstMultiplicity self); + +// +++ Get, non-const +extern_c Handle2Branching3d +MultiplicityBranching3dGet(ConstHandle2Multiplicity self); + +// +++ Set +extern_c void +MultiplicityBranching3dSet(ConstHandle2Multiplicity self, ConstHandle2ConstBranching3d branching3d); + + +// ----------------------------------------------------------------------------- +// Child: unspecified +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicityUnspecifiedHas(ConstHandle2ConstMultiplicity self); + +// --- Get, const +extern_c Handle2ConstUnspecified +MultiplicityUnspecifiedGetConst(ConstHandle2ConstMultiplicity self); + +// +++ Get, non-const +extern_c Handle2Unspecified +MultiplicityUnspecifiedGet(ConstHandle2Multiplicity self); + +// +++ Set +extern_c void +MultiplicityUnspecifiedSet(ConstHandle2Multiplicity self, ConstHandle2ConstUnspecified unspecified); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Multiplicity/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Multiplicity/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Multiplicity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Multiplicity/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Multiplicity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySum.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySum.cpp new file mode 100644 index 000000000..3f77da519 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySum.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/MultiplicitySum.hpp" +#include "MultiplicitySum.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = MultiplicitySumClass; +using CPP = multigroup::MultiplicitySum; + +static const std::string CLASSNAME = "MultiplicitySum"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto ENDF_MT = [](auto &obj) { return &obj.ENDF_MT; }; + static auto multiplicity = [](auto &obj) { return &obj.multiplicity; }; + static auto summands = [](auto &obj) { return &obj.summands; }; +} + +using CPPMultiplicity = general::Multiplicity; +using CPPSummands = general::Summands; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMultiplicitySum +MultiplicitySumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2MultiplicitySum +MultiplicitySumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMultiplicitySum +MultiplicitySumCreateConst( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstSummands summands +) { + ConstHandle2MultiplicitySum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + ENDF_MT, + detail::tocpp(multiplicity), + detail::tocpp(summands) + ); + return handle; +} + +// Create, general, non-const +Handle2MultiplicitySum +MultiplicitySumCreate( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstSummands summands +) { + ConstHandle2MultiplicitySum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + ENDF_MT, + detail::tocpp(multiplicity), + detail::tocpp(summands) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MultiplicitySumAssign(ConstHandle2MultiplicitySum self, ConstHandle2ConstMultiplicitySum from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MultiplicitySumDelete(ConstHandle2ConstMultiplicitySum self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MultiplicitySumRead(ConstHandle2MultiplicitySum self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MultiplicitySumWrite(ConstHandle2ConstMultiplicitySum self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MultiplicitySumPrint(ConstHandle2ConstMultiplicitySum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MultiplicitySumPrintXML(ConstHandle2ConstMultiplicitySum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MultiplicitySumPrintJSON(ConstHandle2ConstMultiplicitySum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicitySumLabelHas(ConstHandle2ConstMultiplicitySum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +MultiplicitySumLabelGet(ConstHandle2ConstMultiplicitySum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +MultiplicitySumLabelSet(ConstHandle2MultiplicitySum self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicitySumENDFMTHas(ConstHandle2ConstMultiplicitySum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +int +MultiplicitySumENDFMTGet(ConstHandle2ConstMultiplicitySum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +MultiplicitySumENDFMTSet(ConstHandle2MultiplicitySum self, const int ENDF_MT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMTSet", self, extract::ENDF_MT, ENDF_MT); +} + + +// ----------------------------------------------------------------------------- +// Child: multiplicity +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicitySumMultiplicityHas(ConstHandle2ConstMultiplicitySum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MultiplicityHas", self, extract::multiplicity); +} + +// Get, const +Handle2ConstMultiplicity +MultiplicitySumMultiplicityGetConst(ConstHandle2ConstMultiplicitySum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MultiplicityGetConst", self, extract::multiplicity); +} + +// Get, non-const +Handle2Multiplicity +MultiplicitySumMultiplicityGet(ConstHandle2MultiplicitySum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MultiplicityGet", self, extract::multiplicity); +} + +// Set +void +MultiplicitySumMultiplicitySet(ConstHandle2MultiplicitySum self, ConstHandle2ConstMultiplicity multiplicity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MultiplicitySet", self, extract::multiplicity, multiplicity); +} + + +// ----------------------------------------------------------------------------- +// Child: summands +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicitySumSummandsHas(ConstHandle2ConstMultiplicitySum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SummandsHas", self, extract::summands); +} + +// Get, const +Handle2ConstSummands +MultiplicitySumSummandsGetConst(ConstHandle2ConstMultiplicitySum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SummandsGetConst", self, extract::summands); +} + +// Get, non-const +Handle2Summands +MultiplicitySumSummandsGet(ConstHandle2MultiplicitySum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SummandsGet", self, extract::summands); +} + +// Set +void +MultiplicitySumSummandsSet(ConstHandle2MultiplicitySum self, ConstHandle2ConstSummands summands) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SummandsSet", self, extract::summands, summands); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/MultiplicitySum/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySum.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySum.h new file mode 100644 index 000000000..e3ca4229a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySum.h @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// MultiplicitySum is the basic handle type in this file. Example: +// // Create a default MultiplicitySum object: +// MultiplicitySum handle = MultiplicitySumDefault(); +// Functions involving MultiplicitySum are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_MULTIPLICITYSUM +#define C_INTERFACE_GNDS_V2_0_GENERAL_MULTIPLICITYSUM + +#include "GNDStk.h" +#include "v2.0/general/Multiplicity.h" +#include "v2.0/general/Summands.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MultiplicitySumClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ MultiplicitySum +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MultiplicitySumClass *MultiplicitySum; + +// --- Const-aware handles. +typedef const struct MultiplicitySumClass *const ConstHandle2ConstMultiplicitySum; +typedef struct MultiplicitySumClass *const ConstHandle2MultiplicitySum; +typedef const struct MultiplicitySumClass * Handle2ConstMultiplicitySum; +typedef struct MultiplicitySumClass * Handle2MultiplicitySum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMultiplicitySum +MultiplicitySumDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2MultiplicitySum +MultiplicitySumDefault(); + +// --- Create, general, const +extern_c Handle2ConstMultiplicitySum +MultiplicitySumCreateConst( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstSummands summands +); + +// +++ Create, general, non-const +extern_c Handle2MultiplicitySum +MultiplicitySumCreate( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstSummands summands +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MultiplicitySumAssign(ConstHandle2MultiplicitySum self, ConstHandle2ConstMultiplicitySum from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MultiplicitySumDelete(ConstHandle2ConstMultiplicitySum self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MultiplicitySumRead(ConstHandle2MultiplicitySum self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MultiplicitySumWrite(ConstHandle2ConstMultiplicitySum self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MultiplicitySumPrint(ConstHandle2ConstMultiplicitySum self); + +// +++ Print to standard output, as XML +extern_c int +MultiplicitySumPrintXML(ConstHandle2ConstMultiplicitySum self); + +// +++ Print to standard output, as JSON +extern_c int +MultiplicitySumPrintJSON(ConstHandle2ConstMultiplicitySum self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicitySumLabelHas(ConstHandle2ConstMultiplicitySum self); + +// +++ Get +// +++ Returns by value +extern_c const char * +MultiplicitySumLabelGet(ConstHandle2ConstMultiplicitySum self); + +// +++ Set +extern_c void +MultiplicitySumLabelSet(ConstHandle2MultiplicitySum self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicitySumENDFMTHas(ConstHandle2ConstMultiplicitySum self); + +// +++ Get +// +++ Returns by value +extern_c int +MultiplicitySumENDFMTGet(ConstHandle2ConstMultiplicitySum self); + +// +++ Set +extern_c void +MultiplicitySumENDFMTSet(ConstHandle2MultiplicitySum self, const int ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Child: multiplicity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicitySumMultiplicityHas(ConstHandle2ConstMultiplicitySum self); + +// --- Get, const +extern_c Handle2ConstMultiplicity +MultiplicitySumMultiplicityGetConst(ConstHandle2ConstMultiplicitySum self); + +// +++ Get, non-const +extern_c Handle2Multiplicity +MultiplicitySumMultiplicityGet(ConstHandle2MultiplicitySum self); + +// +++ Set +extern_c void +MultiplicitySumMultiplicitySet(ConstHandle2MultiplicitySum self, ConstHandle2ConstMultiplicity multiplicity); + + +// ----------------------------------------------------------------------------- +// Child: summands +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicitySumSummandsHas(ConstHandle2ConstMultiplicitySum self); + +// --- Get, const +extern_c Handle2ConstSummands +MultiplicitySumSummandsGetConst(ConstHandle2ConstMultiplicitySum self); + +// +++ Get, non-const +extern_c Handle2Summands +MultiplicitySumSummandsGet(ConstHandle2MultiplicitySum self); + +// +++ Set +extern_c void +MultiplicitySumSummandsSet(ConstHandle2MultiplicitySum self, ConstHandle2ConstSummands summands); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/MultiplicitySum/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySum/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySum/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySums.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySums.cpp new file mode 100644 index 000000000..fd638839d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySums.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/MultiplicitySums.hpp" +#include "MultiplicitySums.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = MultiplicitySumsClass; +using CPP = multigroup::MultiplicitySums; + +static const std::string CLASSNAME = "MultiplicitySums"; + +namespace extract { + static auto multiplicitySum = [](auto &obj) { return &obj.multiplicitySum; }; +} + +using CPPMultiplicitySum = general::MultiplicitySum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstMultiplicitySums +MultiplicitySumsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2MultiplicitySums +MultiplicitySumsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstMultiplicitySums +MultiplicitySumsCreateConst( + ConstHandle2MultiplicitySum *const multiplicitySum, const size_t multiplicitySumSize +) { + ConstHandle2MultiplicitySums handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t MultiplicitySumN = 0; MultiplicitySumN < multiplicitySumSize; ++MultiplicitySumN) + MultiplicitySumsMultiplicitySumAdd(handle, multiplicitySum[MultiplicitySumN]); + return handle; +} + +// Create, general, non-const +Handle2MultiplicitySums +MultiplicitySumsCreate( + ConstHandle2MultiplicitySum *const multiplicitySum, const size_t multiplicitySumSize +) { + ConstHandle2MultiplicitySums handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t MultiplicitySumN = 0; MultiplicitySumN < multiplicitySumSize; ++MultiplicitySumN) + MultiplicitySumsMultiplicitySumAdd(handle, multiplicitySum[MultiplicitySumN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +MultiplicitySumsAssign(ConstHandle2MultiplicitySums self, ConstHandle2ConstMultiplicitySums from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +MultiplicitySumsDelete(ConstHandle2ConstMultiplicitySums self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +MultiplicitySumsRead(ConstHandle2MultiplicitySums self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +MultiplicitySumsWrite(ConstHandle2ConstMultiplicitySums self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +MultiplicitySumsPrint(ConstHandle2ConstMultiplicitySums self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +MultiplicitySumsPrintXML(ConstHandle2ConstMultiplicitySums self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +MultiplicitySumsPrintJSON(ConstHandle2ConstMultiplicitySums self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: multiplicitySum +// ----------------------------------------------------------------------------- + +// Has +int +MultiplicitySumsMultiplicitySumHas(ConstHandle2ConstMultiplicitySums self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MultiplicitySumHas", self, extract::multiplicitySum); +} + +// Clear +void +MultiplicitySumsMultiplicitySumClear(ConstHandle2MultiplicitySums self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"MultiplicitySumClear", self, extract::multiplicitySum); +} + +// Size +size_t +MultiplicitySumsMultiplicitySumSize(ConstHandle2ConstMultiplicitySums self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"MultiplicitySumSize", self, extract::multiplicitySum); +} + +// Add +void +MultiplicitySumsMultiplicitySumAdd(ConstHandle2MultiplicitySums self, ConstHandle2ConstMultiplicitySum multiplicitySum) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"MultiplicitySumAdd", self, extract::multiplicitySum, multiplicitySum); +} + +// Get, by index \in [0,size), const +Handle2ConstMultiplicitySum +MultiplicitySumsMultiplicitySumGetConst(ConstHandle2ConstMultiplicitySums self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"MultiplicitySumGetConst", self, extract::multiplicitySum, index_); +} + +// Get, by index \in [0,size), non-const +Handle2MultiplicitySum +MultiplicitySumsMultiplicitySumGet(ConstHandle2MultiplicitySums self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"MultiplicitySumGet", self, extract::multiplicitySum, index_); +} + +// Set, by index \in [0,size) +void +MultiplicitySumsMultiplicitySumSet( + ConstHandle2MultiplicitySums self, + const size_t index_, + ConstHandle2ConstMultiplicitySum multiplicitySum +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"MultiplicitySumSet", self, extract::multiplicitySum, index_, multiplicitySum); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +MultiplicitySumsMultiplicitySumHasByLabel( + ConstHandle2ConstMultiplicitySums self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumHasByLabel", + self, extract::multiplicitySum, meta::label, label); +} + +// Get, by label, const +Handle2ConstMultiplicitySum +MultiplicitySumsMultiplicitySumGetByLabelConst( + ConstHandle2ConstMultiplicitySums self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumGetByLabelConst", + self, extract::multiplicitySum, meta::label, label); +} + +// Get, by label, non-const +Handle2MultiplicitySum +MultiplicitySumsMultiplicitySumGetByLabel( + ConstHandle2MultiplicitySums self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumGetByLabel", + self, extract::multiplicitySum, meta::label, label); +} + +// Set, by label +void +MultiplicitySumsMultiplicitySumSetByLabel( + ConstHandle2MultiplicitySums self, + const char *const label, + ConstHandle2ConstMultiplicitySum multiplicitySum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumSetByLabel", + self, extract::multiplicitySum, meta::label, label, multiplicitySum); +} + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// Has, by ENDF_MT +int +MultiplicitySumsMultiplicitySumHasByENDFMT( + ConstHandle2ConstMultiplicitySums self, + const int ENDF_MT +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumHasByENDFMT", + self, extract::multiplicitySum, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, const +Handle2ConstMultiplicitySum +MultiplicitySumsMultiplicitySumGetByENDFMTConst( + ConstHandle2ConstMultiplicitySums self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumGetByENDFMTConst", + self, extract::multiplicitySum, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, non-const +Handle2MultiplicitySum +MultiplicitySumsMultiplicitySumGetByENDFMT( + ConstHandle2MultiplicitySums self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumGetByENDFMT", + self, extract::multiplicitySum, meta::ENDF_MT, ENDF_MT); +} + +// Set, by ENDF_MT +void +MultiplicitySumsMultiplicitySumSetByENDFMT( + ConstHandle2MultiplicitySums self, + const int ENDF_MT, + ConstHandle2ConstMultiplicitySum multiplicitySum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"MultiplicitySumSetByENDFMT", + self, extract::multiplicitySum, meta::ENDF_MT, ENDF_MT, multiplicitySum); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/MultiplicitySums/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySums.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySums.h new file mode 100644 index 000000000..740010558 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySums.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// MultiplicitySums is the basic handle type in this file. Example: +// // Create a default MultiplicitySums object: +// MultiplicitySums handle = MultiplicitySumsDefault(); +// Functions involving MultiplicitySums are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_MULTIPLICITYSUMS +#define C_INTERFACE_GNDS_V2_0_GENERAL_MULTIPLICITYSUMS + +#include "GNDStk.h" +#include "v2.0/general/MultiplicitySum.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct MultiplicitySumsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ MultiplicitySums +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct MultiplicitySumsClass *MultiplicitySums; + +// --- Const-aware handles. +typedef const struct MultiplicitySumsClass *const ConstHandle2ConstMultiplicitySums; +typedef struct MultiplicitySumsClass *const ConstHandle2MultiplicitySums; +typedef const struct MultiplicitySumsClass * Handle2ConstMultiplicitySums; +typedef struct MultiplicitySumsClass * Handle2MultiplicitySums; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstMultiplicitySums +MultiplicitySumsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2MultiplicitySums +MultiplicitySumsDefault(); + +// --- Create, general, const +extern_c Handle2ConstMultiplicitySums +MultiplicitySumsCreateConst( + ConstHandle2MultiplicitySum *const multiplicitySum, const size_t multiplicitySumSize +); + +// +++ Create, general, non-const +extern_c Handle2MultiplicitySums +MultiplicitySumsCreate( + ConstHandle2MultiplicitySum *const multiplicitySum, const size_t multiplicitySumSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +MultiplicitySumsAssign(ConstHandle2MultiplicitySums self, ConstHandle2ConstMultiplicitySums from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +MultiplicitySumsDelete(ConstHandle2ConstMultiplicitySums self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +MultiplicitySumsRead(ConstHandle2MultiplicitySums self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +MultiplicitySumsWrite(ConstHandle2ConstMultiplicitySums self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +MultiplicitySumsPrint(ConstHandle2ConstMultiplicitySums self); + +// +++ Print to standard output, as XML +extern_c int +MultiplicitySumsPrintXML(ConstHandle2ConstMultiplicitySums self); + +// +++ Print to standard output, as JSON +extern_c int +MultiplicitySumsPrintJSON(ConstHandle2ConstMultiplicitySums self); + + +// ----------------------------------------------------------------------------- +// Child: multiplicitySum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +MultiplicitySumsMultiplicitySumHas(ConstHandle2ConstMultiplicitySums self); + +// +++ Clear +extern_c void +MultiplicitySumsMultiplicitySumClear(ConstHandle2MultiplicitySums self); + +// +++ Size +extern_c size_t +MultiplicitySumsMultiplicitySumSize(ConstHandle2ConstMultiplicitySums self); + +// +++ Add +extern_c void +MultiplicitySumsMultiplicitySumAdd(ConstHandle2MultiplicitySums self, ConstHandle2ConstMultiplicitySum multiplicitySum); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstMultiplicitySum +MultiplicitySumsMultiplicitySumGetConst(ConstHandle2ConstMultiplicitySums self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2MultiplicitySum +MultiplicitySumsMultiplicitySumGet(ConstHandle2MultiplicitySums self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +MultiplicitySumsMultiplicitySumSet( + ConstHandle2MultiplicitySums self, + const size_t index_, + ConstHandle2ConstMultiplicitySum multiplicitySum +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +MultiplicitySumsMultiplicitySumHasByLabel( + ConstHandle2ConstMultiplicitySums self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstMultiplicitySum +MultiplicitySumsMultiplicitySumGetByLabelConst( + ConstHandle2ConstMultiplicitySums self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2MultiplicitySum +MultiplicitySumsMultiplicitySumGetByLabel( + ConstHandle2MultiplicitySums self, + const char *const label +); + +// +++ Set, by label +extern_c void +MultiplicitySumsMultiplicitySumSetByLabel( + ConstHandle2MultiplicitySums self, + const char *const label, + ConstHandle2ConstMultiplicitySum multiplicitySum +); + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// +++ Has, by ENDF_MT +extern_c int +MultiplicitySumsMultiplicitySumHasByENDFMT( + ConstHandle2ConstMultiplicitySums self, + const int ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstMultiplicitySum +MultiplicitySumsMultiplicitySumGetByENDFMTConst( + ConstHandle2ConstMultiplicitySums self, + const int ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2MultiplicitySum +MultiplicitySumsMultiplicitySumGetByENDFMT( + ConstHandle2MultiplicitySums self, + const int ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +MultiplicitySumsMultiplicitySumSetByENDFMT( + ConstHandle2MultiplicitySums self, + const int ENDF_MT, + ConstHandle2ConstMultiplicitySum multiplicitySum +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/MultiplicitySums/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySums/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySums/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySums/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/MultiplicitySums/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NBodyPhaseSpace.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NBodyPhaseSpace.cpp new file mode 100644 index 000000000..9874abf2b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NBodyPhaseSpace.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/NBodyPhaseSpace.hpp" +#include "NBodyPhaseSpace.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = NBodyPhaseSpaceClass; +using CPP = multigroup::NBodyPhaseSpace; + +static const std::string CLASSNAME = "NBodyPhaseSpace"; + +namespace extract { + static auto numberOfProducts = [](auto &obj) { return &obj.numberOfProducts; }; + static auto mass = [](auto &obj) { return &obj.mass; }; +} + +using CPPMass = general::Mass; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNBodyPhaseSpace +NBodyPhaseSpaceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2NBodyPhaseSpace +NBodyPhaseSpaceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNBodyPhaseSpace +NBodyPhaseSpaceCreateConst( + const int numberOfProducts, + ConstHandle2ConstMass mass +) { + ConstHandle2NBodyPhaseSpace handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + numberOfProducts, + detail::tocpp(mass) + ); + return handle; +} + +// Create, general, non-const +Handle2NBodyPhaseSpace +NBodyPhaseSpaceCreate( + const int numberOfProducts, + ConstHandle2ConstMass mass +) { + ConstHandle2NBodyPhaseSpace handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + numberOfProducts, + detail::tocpp(mass) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +NBodyPhaseSpaceAssign(ConstHandle2NBodyPhaseSpace self, ConstHandle2ConstNBodyPhaseSpace from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +NBodyPhaseSpaceDelete(ConstHandle2ConstNBodyPhaseSpace self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +NBodyPhaseSpaceRead(ConstHandle2NBodyPhaseSpace self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +NBodyPhaseSpaceWrite(ConstHandle2ConstNBodyPhaseSpace self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +NBodyPhaseSpacePrint(ConstHandle2ConstNBodyPhaseSpace self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +NBodyPhaseSpacePrintXML(ConstHandle2ConstNBodyPhaseSpace self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +NBodyPhaseSpacePrintJSON(ConstHandle2ConstNBodyPhaseSpace self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: numberOfProducts +// ----------------------------------------------------------------------------- + +// Has +int +NBodyPhaseSpaceNumberOfProductsHas(ConstHandle2ConstNBodyPhaseSpace self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NumberOfProductsHas", self, extract::numberOfProducts); +} + +// Get +// Returns by value +int +NBodyPhaseSpaceNumberOfProductsGet(ConstHandle2ConstNBodyPhaseSpace self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NumberOfProductsGet", self, extract::numberOfProducts); +} + +// Set +void +NBodyPhaseSpaceNumberOfProductsSet(ConstHandle2NBodyPhaseSpace self, const int numberOfProducts) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NumberOfProductsSet", self, extract::numberOfProducts, numberOfProducts); +} + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// Has +int +NBodyPhaseSpaceMassHas(ConstHandle2ConstNBodyPhaseSpace self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MassHas", self, extract::mass); +} + +// Get, const +Handle2ConstMass +NBodyPhaseSpaceMassGetConst(ConstHandle2ConstNBodyPhaseSpace self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGetConst", self, extract::mass); +} + +// Get, non-const +Handle2Mass +NBodyPhaseSpaceMassGet(ConstHandle2NBodyPhaseSpace self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGet", self, extract::mass); +} + +// Set +void +NBodyPhaseSpaceMassSet(ConstHandle2NBodyPhaseSpace self, ConstHandle2ConstMass mass) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MassSet", self, extract::mass, mass); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NBodyPhaseSpace/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NBodyPhaseSpace.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NBodyPhaseSpace.h new file mode 100644 index 000000000..e2fdc6b7d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NBodyPhaseSpace.h @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// NBodyPhaseSpace is the basic handle type in this file. Example: +// // Create a default NBodyPhaseSpace object: +// NBodyPhaseSpace handle = NBodyPhaseSpaceDefault(); +// Functions involving NBodyPhaseSpace are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_NBODYPHASESPACE +#define C_INTERFACE_GNDS_V2_0_GENERAL_NBODYPHASESPACE + +#include "GNDStk.h" +#include "v2.0/general/Mass.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct NBodyPhaseSpaceClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ NBodyPhaseSpace +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct NBodyPhaseSpaceClass *NBodyPhaseSpace; + +// --- Const-aware handles. +typedef const struct NBodyPhaseSpaceClass *const ConstHandle2ConstNBodyPhaseSpace; +typedef struct NBodyPhaseSpaceClass *const ConstHandle2NBodyPhaseSpace; +typedef const struct NBodyPhaseSpaceClass * Handle2ConstNBodyPhaseSpace; +typedef struct NBodyPhaseSpaceClass * Handle2NBodyPhaseSpace; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstNBodyPhaseSpace +NBodyPhaseSpaceDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2NBodyPhaseSpace +NBodyPhaseSpaceDefault(); + +// --- Create, general, const +extern_c Handle2ConstNBodyPhaseSpace +NBodyPhaseSpaceCreateConst( + const int numberOfProducts, + ConstHandle2ConstMass mass +); + +// +++ Create, general, non-const +extern_c Handle2NBodyPhaseSpace +NBodyPhaseSpaceCreate( + const int numberOfProducts, + ConstHandle2ConstMass mass +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +NBodyPhaseSpaceAssign(ConstHandle2NBodyPhaseSpace self, ConstHandle2ConstNBodyPhaseSpace from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +NBodyPhaseSpaceDelete(ConstHandle2ConstNBodyPhaseSpace self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +NBodyPhaseSpaceRead(ConstHandle2NBodyPhaseSpace self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +NBodyPhaseSpaceWrite(ConstHandle2ConstNBodyPhaseSpace self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +NBodyPhaseSpacePrint(ConstHandle2ConstNBodyPhaseSpace self); + +// +++ Print to standard output, as XML +extern_c int +NBodyPhaseSpacePrintXML(ConstHandle2ConstNBodyPhaseSpace self); + +// +++ Print to standard output, as JSON +extern_c int +NBodyPhaseSpacePrintJSON(ConstHandle2ConstNBodyPhaseSpace self); + + +// ----------------------------------------------------------------------------- +// Metadatum: numberOfProducts +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NBodyPhaseSpaceNumberOfProductsHas(ConstHandle2ConstNBodyPhaseSpace self); + +// +++ Get +// +++ Returns by value +extern_c int +NBodyPhaseSpaceNumberOfProductsGet(ConstHandle2ConstNBodyPhaseSpace self); + +// +++ Set +extern_c void +NBodyPhaseSpaceNumberOfProductsSet(ConstHandle2NBodyPhaseSpace self, const int numberOfProducts); + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NBodyPhaseSpaceMassHas(ConstHandle2ConstNBodyPhaseSpace self); + +// --- Get, const +extern_c Handle2ConstMass +NBodyPhaseSpaceMassGetConst(ConstHandle2ConstNBodyPhaseSpace self); + +// +++ Get, non-const +extern_c Handle2Mass +NBodyPhaseSpaceMassGet(ConstHandle2NBodyPhaseSpace self); + +// +++ Set +extern_c void +NBodyPhaseSpaceMassSet(ConstHandle2NBodyPhaseSpace self, ConstHandle2ConstMass mass); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NBodyPhaseSpace/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NBodyPhaseSpace/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NBodyPhaseSpace/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NBodyPhaseSpace/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NBodyPhaseSpace/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NeutrinoEnergy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NeutrinoEnergy.cpp new file mode 100644 index 000000000..7ca140d30 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NeutrinoEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/NeutrinoEnergy.hpp" +#include "NeutrinoEnergy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = NeutrinoEnergyClass; +using CPP = multigroup::NeutrinoEnergy; + +static const std::string CLASSNAME = "NeutrinoEnergy"; + +namespace extract { + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; +} + +using CPPPolynomial1d = general::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNeutrinoEnergy +NeutrinoEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2NeutrinoEnergy +NeutrinoEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNeutrinoEnergy +NeutrinoEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2NeutrinoEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Create, general, non-const +Handle2NeutrinoEnergy +NeutrinoEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2NeutrinoEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +NeutrinoEnergyAssign(ConstHandle2NeutrinoEnergy self, ConstHandle2ConstNeutrinoEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +NeutrinoEnergyDelete(ConstHandle2ConstNeutrinoEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +NeutrinoEnergyRead(ConstHandle2NeutrinoEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +NeutrinoEnergyWrite(ConstHandle2ConstNeutrinoEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +NeutrinoEnergyPrint(ConstHandle2ConstNeutrinoEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +NeutrinoEnergyPrintXML(ConstHandle2ConstNeutrinoEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +NeutrinoEnergyPrintJSON(ConstHandle2ConstNeutrinoEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// Has +int +NeutrinoEnergyPolynomial1dHas(ConstHandle2ConstNeutrinoEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Polynomial1dHas", self, extract::polynomial1d); +} + +// Get, const +Handle2ConstPolynomial1d +NeutrinoEnergyPolynomial1dGetConst(ConstHandle2ConstNeutrinoEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGetConst", self, extract::polynomial1d); +} + +// Get, non-const +Handle2Polynomial1d +NeutrinoEnergyPolynomial1dGet(ConstHandle2NeutrinoEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGet", self, extract::polynomial1d); +} + +// Set +void +NeutrinoEnergyPolynomial1dSet(ConstHandle2NeutrinoEnergy self, ConstHandle2ConstPolynomial1d polynomial1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Polynomial1dSet", self, extract::polynomial1d, polynomial1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NeutrinoEnergy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NeutrinoEnergy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NeutrinoEnergy.h new file mode 100644 index 000000000..4e5c28e4d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NeutrinoEnergy.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// NeutrinoEnergy is the basic handle type in this file. Example: +// // Create a default NeutrinoEnergy object: +// NeutrinoEnergy handle = NeutrinoEnergyDefault(); +// Functions involving NeutrinoEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_NEUTRINOENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_NEUTRINOENERGY + +#include "GNDStk.h" +#include "v2.0/general/Polynomial1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct NeutrinoEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ NeutrinoEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct NeutrinoEnergyClass *NeutrinoEnergy; + +// --- Const-aware handles. +typedef const struct NeutrinoEnergyClass *const ConstHandle2ConstNeutrinoEnergy; +typedef struct NeutrinoEnergyClass *const ConstHandle2NeutrinoEnergy; +typedef const struct NeutrinoEnergyClass * Handle2ConstNeutrinoEnergy; +typedef struct NeutrinoEnergyClass * Handle2NeutrinoEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstNeutrinoEnergy +NeutrinoEnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2NeutrinoEnergy +NeutrinoEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstNeutrinoEnergy +NeutrinoEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general, non-const +extern_c Handle2NeutrinoEnergy +NeutrinoEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +NeutrinoEnergyAssign(ConstHandle2NeutrinoEnergy self, ConstHandle2ConstNeutrinoEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +NeutrinoEnergyDelete(ConstHandle2ConstNeutrinoEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +NeutrinoEnergyRead(ConstHandle2NeutrinoEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +NeutrinoEnergyWrite(ConstHandle2ConstNeutrinoEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +NeutrinoEnergyPrint(ConstHandle2ConstNeutrinoEnergy self); + +// +++ Print to standard output, as XML +extern_c int +NeutrinoEnergyPrintXML(ConstHandle2ConstNeutrinoEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +NeutrinoEnergyPrintJSON(ConstHandle2ConstNeutrinoEnergy self); + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NeutrinoEnergyPolynomial1dHas(ConstHandle2ConstNeutrinoEnergy self); + +// --- Get, const +extern_c Handle2ConstPolynomial1d +NeutrinoEnergyPolynomial1dGetConst(ConstHandle2ConstNeutrinoEnergy self); + +// +++ Get, non-const +extern_c Handle2Polynomial1d +NeutrinoEnergyPolynomial1dGet(ConstHandle2NeutrinoEnergy self); + +// +++ Set +extern_c void +NeutrinoEnergyPolynomial1dSet(ConstHandle2NeutrinoEnergy self, ConstHandle2ConstPolynomial1d polynomial1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NeutrinoEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NeutrinoEnergy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NeutrinoEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NeutrinoEnergy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NeutrinoEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NonNeutrinoEnergy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NonNeutrinoEnergy.cpp new file mode 100644 index 000000000..79441d871 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NonNeutrinoEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/NonNeutrinoEnergy.hpp" +#include "NonNeutrinoEnergy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = NonNeutrinoEnergyClass; +using CPP = multigroup::NonNeutrinoEnergy; + +static const std::string CLASSNAME = "NonNeutrinoEnergy"; + +namespace extract { + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; +} + +using CPPPolynomial1d = general::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNonNeutrinoEnergy +NonNeutrinoEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2NonNeutrinoEnergy +NonNeutrinoEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNonNeutrinoEnergy +NonNeutrinoEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2NonNeutrinoEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Create, general, non-const +Handle2NonNeutrinoEnergy +NonNeutrinoEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2NonNeutrinoEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +NonNeutrinoEnergyAssign(ConstHandle2NonNeutrinoEnergy self, ConstHandle2ConstNonNeutrinoEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +NonNeutrinoEnergyDelete(ConstHandle2ConstNonNeutrinoEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +NonNeutrinoEnergyRead(ConstHandle2NonNeutrinoEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +NonNeutrinoEnergyWrite(ConstHandle2ConstNonNeutrinoEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +NonNeutrinoEnergyPrint(ConstHandle2ConstNonNeutrinoEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +NonNeutrinoEnergyPrintXML(ConstHandle2ConstNonNeutrinoEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +NonNeutrinoEnergyPrintJSON(ConstHandle2ConstNonNeutrinoEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// Has +int +NonNeutrinoEnergyPolynomial1dHas(ConstHandle2ConstNonNeutrinoEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Polynomial1dHas", self, extract::polynomial1d); +} + +// Get, const +Handle2ConstPolynomial1d +NonNeutrinoEnergyPolynomial1dGetConst(ConstHandle2ConstNonNeutrinoEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGetConst", self, extract::polynomial1d); +} + +// Get, non-const +Handle2Polynomial1d +NonNeutrinoEnergyPolynomial1dGet(ConstHandle2NonNeutrinoEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGet", self, extract::polynomial1d); +} + +// Set +void +NonNeutrinoEnergyPolynomial1dSet(ConstHandle2NonNeutrinoEnergy self, ConstHandle2ConstPolynomial1d polynomial1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Polynomial1dSet", self, extract::polynomial1d, polynomial1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NonNeutrinoEnergy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NonNeutrinoEnergy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NonNeutrinoEnergy.h new file mode 100644 index 000000000..a4bdf4561 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NonNeutrinoEnergy.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// NonNeutrinoEnergy is the basic handle type in this file. Example: +// // Create a default NonNeutrinoEnergy object: +// NonNeutrinoEnergy handle = NonNeutrinoEnergyDefault(); +// Functions involving NonNeutrinoEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_NONNEUTRINOENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_NONNEUTRINOENERGY + +#include "GNDStk.h" +#include "v2.0/general/Polynomial1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct NonNeutrinoEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ NonNeutrinoEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct NonNeutrinoEnergyClass *NonNeutrinoEnergy; + +// --- Const-aware handles. +typedef const struct NonNeutrinoEnergyClass *const ConstHandle2ConstNonNeutrinoEnergy; +typedef struct NonNeutrinoEnergyClass *const ConstHandle2NonNeutrinoEnergy; +typedef const struct NonNeutrinoEnergyClass * Handle2ConstNonNeutrinoEnergy; +typedef struct NonNeutrinoEnergyClass * Handle2NonNeutrinoEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstNonNeutrinoEnergy +NonNeutrinoEnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2NonNeutrinoEnergy +NonNeutrinoEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstNonNeutrinoEnergy +NonNeutrinoEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general, non-const +extern_c Handle2NonNeutrinoEnergy +NonNeutrinoEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +NonNeutrinoEnergyAssign(ConstHandle2NonNeutrinoEnergy self, ConstHandle2ConstNonNeutrinoEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +NonNeutrinoEnergyDelete(ConstHandle2ConstNonNeutrinoEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +NonNeutrinoEnergyRead(ConstHandle2NonNeutrinoEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +NonNeutrinoEnergyWrite(ConstHandle2ConstNonNeutrinoEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +NonNeutrinoEnergyPrint(ConstHandle2ConstNonNeutrinoEnergy self); + +// +++ Print to standard output, as XML +extern_c int +NonNeutrinoEnergyPrintXML(ConstHandle2ConstNonNeutrinoEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +NonNeutrinoEnergyPrintJSON(ConstHandle2ConstNonNeutrinoEnergy self); + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NonNeutrinoEnergyPolynomial1dHas(ConstHandle2ConstNonNeutrinoEnergy self); + +// --- Get, const +extern_c Handle2ConstPolynomial1d +NonNeutrinoEnergyPolynomial1dGetConst(ConstHandle2ConstNonNeutrinoEnergy self); + +// +++ Get, non-const +extern_c Handle2Polynomial1d +NonNeutrinoEnergyPolynomial1dGet(ConstHandle2NonNeutrinoEnergy self); + +// +++ Set +extern_c void +NonNeutrinoEnergyPolynomial1dSet(ConstHandle2NonNeutrinoEnergy self, ConstHandle2ConstPolynomial1d polynomial1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NonNeutrinoEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NonNeutrinoEnergy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NonNeutrinoEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NonNeutrinoEnergy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NonNeutrinoEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearAmplitudeExpansion.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearAmplitudeExpansion.cpp new file mode 100644 index 000000000..f81129a21 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearAmplitudeExpansion.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/NuclearAmplitudeExpansion.hpp" +#include "NuclearAmplitudeExpansion.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = NuclearAmplitudeExpansionClass; +using CPP = multigroup::NuclearAmplitudeExpansion; + +static const std::string CLASSNAME = "NuclearAmplitudeExpansion"; + +namespace extract { + static auto nuclearTerm = [](auto &obj) { return &obj.nuclearTerm; }; + static auto realInterferenceTerm = [](auto &obj) { return &obj.realInterferenceTerm; }; + static auto imaginaryInterferenceTerm = [](auto &obj) { return &obj.imaginaryInterferenceTerm; }; +} + +using CPPNuclearTerm = general::NuclearTerm; +using CPPRealInterferenceTerm = general::RealInterferenceTerm; +using CPPImaginaryInterferenceTerm = general::ImaginaryInterferenceTerm; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNuclearAmplitudeExpansion +NuclearAmplitudeExpansionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2NuclearAmplitudeExpansion +NuclearAmplitudeExpansionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNuclearAmplitudeExpansion +NuclearAmplitudeExpansionCreateConst( + ConstHandle2ConstNuclearTerm nuclearTerm, + ConstHandle2ConstRealInterferenceTerm realInterferenceTerm, + ConstHandle2ConstImaginaryInterferenceTerm imaginaryInterferenceTerm +) { + ConstHandle2NuclearAmplitudeExpansion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(nuclearTerm), + detail::tocpp(realInterferenceTerm), + detail::tocpp(imaginaryInterferenceTerm) + ); + return handle; +} + +// Create, general, non-const +Handle2NuclearAmplitudeExpansion +NuclearAmplitudeExpansionCreate( + ConstHandle2ConstNuclearTerm nuclearTerm, + ConstHandle2ConstRealInterferenceTerm realInterferenceTerm, + ConstHandle2ConstImaginaryInterferenceTerm imaginaryInterferenceTerm +) { + ConstHandle2NuclearAmplitudeExpansion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(nuclearTerm), + detail::tocpp(realInterferenceTerm), + detail::tocpp(imaginaryInterferenceTerm) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +NuclearAmplitudeExpansionAssign(ConstHandle2NuclearAmplitudeExpansion self, ConstHandle2ConstNuclearAmplitudeExpansion from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +NuclearAmplitudeExpansionDelete(ConstHandle2ConstNuclearAmplitudeExpansion self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +NuclearAmplitudeExpansionRead(ConstHandle2NuclearAmplitudeExpansion self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +NuclearAmplitudeExpansionWrite(ConstHandle2ConstNuclearAmplitudeExpansion self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +NuclearAmplitudeExpansionPrint(ConstHandle2ConstNuclearAmplitudeExpansion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +NuclearAmplitudeExpansionPrintXML(ConstHandle2ConstNuclearAmplitudeExpansion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +NuclearAmplitudeExpansionPrintJSON(ConstHandle2ConstNuclearAmplitudeExpansion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: nuclearTerm +// ----------------------------------------------------------------------------- + +// Has +int +NuclearAmplitudeExpansionNuclearTermHas(ConstHandle2ConstNuclearAmplitudeExpansion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NuclearTermHas", self, extract::nuclearTerm); +} + +// Get, const +Handle2ConstNuclearTerm +NuclearAmplitudeExpansionNuclearTermGetConst(ConstHandle2ConstNuclearAmplitudeExpansion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclearTermGetConst", self, extract::nuclearTerm); +} + +// Get, non-const +Handle2NuclearTerm +NuclearAmplitudeExpansionNuclearTermGet(ConstHandle2NuclearAmplitudeExpansion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclearTermGet", self, extract::nuclearTerm); +} + +// Set +void +NuclearAmplitudeExpansionNuclearTermSet(ConstHandle2NuclearAmplitudeExpansion self, ConstHandle2ConstNuclearTerm nuclearTerm) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NuclearTermSet", self, extract::nuclearTerm, nuclearTerm); +} + + +// ----------------------------------------------------------------------------- +// Child: realInterferenceTerm +// ----------------------------------------------------------------------------- + +// Has +int +NuclearAmplitudeExpansionRealInterferenceTermHas(ConstHandle2ConstNuclearAmplitudeExpansion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RealInterferenceTermHas", self, extract::realInterferenceTerm); +} + +// Get, const +Handle2ConstRealInterferenceTerm +NuclearAmplitudeExpansionRealInterferenceTermGetConst(ConstHandle2ConstNuclearAmplitudeExpansion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RealInterferenceTermGetConst", self, extract::realInterferenceTerm); +} + +// Get, non-const +Handle2RealInterferenceTerm +NuclearAmplitudeExpansionRealInterferenceTermGet(ConstHandle2NuclearAmplitudeExpansion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RealInterferenceTermGet", self, extract::realInterferenceTerm); +} + +// Set +void +NuclearAmplitudeExpansionRealInterferenceTermSet(ConstHandle2NuclearAmplitudeExpansion self, ConstHandle2ConstRealInterferenceTerm realInterferenceTerm) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RealInterferenceTermSet", self, extract::realInterferenceTerm, realInterferenceTerm); +} + + +// ----------------------------------------------------------------------------- +// Child: imaginaryInterferenceTerm +// ----------------------------------------------------------------------------- + +// Has +int +NuclearAmplitudeExpansionImaginaryInterferenceTermHas(ConstHandle2ConstNuclearAmplitudeExpansion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ImaginaryInterferenceTermHas", self, extract::imaginaryInterferenceTerm); +} + +// Get, const +Handle2ConstImaginaryInterferenceTerm +NuclearAmplitudeExpansionImaginaryInterferenceTermGetConst(ConstHandle2ConstNuclearAmplitudeExpansion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ImaginaryInterferenceTermGetConst", self, extract::imaginaryInterferenceTerm); +} + +// Get, non-const +Handle2ImaginaryInterferenceTerm +NuclearAmplitudeExpansionImaginaryInterferenceTermGet(ConstHandle2NuclearAmplitudeExpansion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ImaginaryInterferenceTermGet", self, extract::imaginaryInterferenceTerm); +} + +// Set +void +NuclearAmplitudeExpansionImaginaryInterferenceTermSet(ConstHandle2NuclearAmplitudeExpansion self, ConstHandle2ConstImaginaryInterferenceTerm imaginaryInterferenceTerm) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ImaginaryInterferenceTermSet", self, extract::imaginaryInterferenceTerm, imaginaryInterferenceTerm); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NuclearAmplitudeExpansion/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearAmplitudeExpansion.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearAmplitudeExpansion.h new file mode 100644 index 000000000..f99609b36 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearAmplitudeExpansion.h @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// NuclearAmplitudeExpansion is the basic handle type in this file. Example: +// // Create a default NuclearAmplitudeExpansion object: +// NuclearAmplitudeExpansion handle = NuclearAmplitudeExpansionDefault(); +// Functions involving NuclearAmplitudeExpansion are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_NUCLEARAMPLITUDEEXPANSION +#define C_INTERFACE_GNDS_V2_0_GENERAL_NUCLEARAMPLITUDEEXPANSION + +#include "GNDStk.h" +#include "v2.0/general/NuclearTerm.h" +#include "v2.0/general/RealInterferenceTerm.h" +#include "v2.0/general/ImaginaryInterferenceTerm.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct NuclearAmplitudeExpansionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ NuclearAmplitudeExpansion +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct NuclearAmplitudeExpansionClass *NuclearAmplitudeExpansion; + +// --- Const-aware handles. +typedef const struct NuclearAmplitudeExpansionClass *const ConstHandle2ConstNuclearAmplitudeExpansion; +typedef struct NuclearAmplitudeExpansionClass *const ConstHandle2NuclearAmplitudeExpansion; +typedef const struct NuclearAmplitudeExpansionClass * Handle2ConstNuclearAmplitudeExpansion; +typedef struct NuclearAmplitudeExpansionClass * Handle2NuclearAmplitudeExpansion; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstNuclearAmplitudeExpansion +NuclearAmplitudeExpansionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2NuclearAmplitudeExpansion +NuclearAmplitudeExpansionDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclearAmplitudeExpansion +NuclearAmplitudeExpansionCreateConst( + ConstHandle2ConstNuclearTerm nuclearTerm, + ConstHandle2ConstRealInterferenceTerm realInterferenceTerm, + ConstHandle2ConstImaginaryInterferenceTerm imaginaryInterferenceTerm +); + +// +++ Create, general, non-const +extern_c Handle2NuclearAmplitudeExpansion +NuclearAmplitudeExpansionCreate( + ConstHandle2ConstNuclearTerm nuclearTerm, + ConstHandle2ConstRealInterferenceTerm realInterferenceTerm, + ConstHandle2ConstImaginaryInterferenceTerm imaginaryInterferenceTerm +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +NuclearAmplitudeExpansionAssign(ConstHandle2NuclearAmplitudeExpansion self, ConstHandle2ConstNuclearAmplitudeExpansion from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +NuclearAmplitudeExpansionDelete(ConstHandle2ConstNuclearAmplitudeExpansion self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +NuclearAmplitudeExpansionRead(ConstHandle2NuclearAmplitudeExpansion self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +NuclearAmplitudeExpansionWrite(ConstHandle2ConstNuclearAmplitudeExpansion self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +NuclearAmplitudeExpansionPrint(ConstHandle2ConstNuclearAmplitudeExpansion self); + +// +++ Print to standard output, as XML +extern_c int +NuclearAmplitudeExpansionPrintXML(ConstHandle2ConstNuclearAmplitudeExpansion self); + +// +++ Print to standard output, as JSON +extern_c int +NuclearAmplitudeExpansionPrintJSON(ConstHandle2ConstNuclearAmplitudeExpansion self); + + +// ----------------------------------------------------------------------------- +// Child: nuclearTerm +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclearAmplitudeExpansionNuclearTermHas(ConstHandle2ConstNuclearAmplitudeExpansion self); + +// --- Get, const +extern_c Handle2ConstNuclearTerm +NuclearAmplitudeExpansionNuclearTermGetConst(ConstHandle2ConstNuclearAmplitudeExpansion self); + +// +++ Get, non-const +extern_c Handle2NuclearTerm +NuclearAmplitudeExpansionNuclearTermGet(ConstHandle2NuclearAmplitudeExpansion self); + +// +++ Set +extern_c void +NuclearAmplitudeExpansionNuclearTermSet(ConstHandle2NuclearAmplitudeExpansion self, ConstHandle2ConstNuclearTerm nuclearTerm); + + +// ----------------------------------------------------------------------------- +// Child: realInterferenceTerm +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclearAmplitudeExpansionRealInterferenceTermHas(ConstHandle2ConstNuclearAmplitudeExpansion self); + +// --- Get, const +extern_c Handle2ConstRealInterferenceTerm +NuclearAmplitudeExpansionRealInterferenceTermGetConst(ConstHandle2ConstNuclearAmplitudeExpansion self); + +// +++ Get, non-const +extern_c Handle2RealInterferenceTerm +NuclearAmplitudeExpansionRealInterferenceTermGet(ConstHandle2NuclearAmplitudeExpansion self); + +// +++ Set +extern_c void +NuclearAmplitudeExpansionRealInterferenceTermSet(ConstHandle2NuclearAmplitudeExpansion self, ConstHandle2ConstRealInterferenceTerm realInterferenceTerm); + + +// ----------------------------------------------------------------------------- +// Child: imaginaryInterferenceTerm +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclearAmplitudeExpansionImaginaryInterferenceTermHas(ConstHandle2ConstNuclearAmplitudeExpansion self); + +// --- Get, const +extern_c Handle2ConstImaginaryInterferenceTerm +NuclearAmplitudeExpansionImaginaryInterferenceTermGetConst(ConstHandle2ConstNuclearAmplitudeExpansion self); + +// +++ Get, non-const +extern_c Handle2ImaginaryInterferenceTerm +NuclearAmplitudeExpansionImaginaryInterferenceTermGet(ConstHandle2NuclearAmplitudeExpansion self); + +// +++ Set +extern_c void +NuclearAmplitudeExpansionImaginaryInterferenceTermSet(ConstHandle2NuclearAmplitudeExpansion self, ConstHandle2ConstImaginaryInterferenceTerm imaginaryInterferenceTerm); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NuclearAmplitudeExpansion/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearAmplitudeExpansion/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearAmplitudeExpansion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearAmplitudeExpansion/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearAmplitudeExpansion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearPlusInterference.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearPlusInterference.cpp new file mode 100644 index 000000000..09324b9e7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearPlusInterference.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/NuclearPlusInterference.hpp" +#include "NuclearPlusInterference.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = NuclearPlusInterferenceClass; +using CPP = multigroup::NuclearPlusInterference; + +static const std::string CLASSNAME = "NuclearPlusInterference"; + +namespace extract { + static auto muCutoff = [](auto &obj) { return &obj.muCutoff; }; + static auto crossSection = [](auto &obj) { return &obj.crossSection; }; + static auto distribution = [](auto &obj) { return &obj.distribution; }; +} + +using CPPCrossSection = reduced::CrossSection; +using CPPDistribution = reduced::Distribution; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNuclearPlusInterference +NuclearPlusInterferenceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2NuclearPlusInterference +NuclearPlusInterferenceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNuclearPlusInterference +NuclearPlusInterferenceCreateConst( + const double muCutoff, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstDistribution distribution +) { + ConstHandle2NuclearPlusInterference handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + muCutoff, + detail::tocpp(crossSection), + detail::tocpp(distribution) + ); + return handle; +} + +// Create, general, non-const +Handle2NuclearPlusInterference +NuclearPlusInterferenceCreate( + const double muCutoff, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstDistribution distribution +) { + ConstHandle2NuclearPlusInterference handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + muCutoff, + detail::tocpp(crossSection), + detail::tocpp(distribution) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +NuclearPlusInterferenceAssign(ConstHandle2NuclearPlusInterference self, ConstHandle2ConstNuclearPlusInterference from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +NuclearPlusInterferenceDelete(ConstHandle2ConstNuclearPlusInterference self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +NuclearPlusInterferenceRead(ConstHandle2NuclearPlusInterference self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +NuclearPlusInterferenceWrite(ConstHandle2ConstNuclearPlusInterference self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +NuclearPlusInterferencePrint(ConstHandle2ConstNuclearPlusInterference self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +NuclearPlusInterferencePrintXML(ConstHandle2ConstNuclearPlusInterference self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +NuclearPlusInterferencePrintJSON(ConstHandle2ConstNuclearPlusInterference self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: muCutoff +// ----------------------------------------------------------------------------- + +// Has +int +NuclearPlusInterferenceMuCutoffHas(ConstHandle2ConstNuclearPlusInterference self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MuCutoffHas", self, extract::muCutoff); +} + +// Get +// Returns by value +double +NuclearPlusInterferenceMuCutoffGet(ConstHandle2ConstNuclearPlusInterference self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MuCutoffGet", self, extract::muCutoff); +} + +// Set +void +NuclearPlusInterferenceMuCutoffSet(ConstHandle2NuclearPlusInterference self, const double muCutoff) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MuCutoffSet", self, extract::muCutoff, muCutoff); +} + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// Has +int +NuclearPlusInterferenceCrossSectionHas(ConstHandle2ConstNuclearPlusInterference self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossSectionHas", self, extract::crossSection); +} + +// Get, const +Handle2ConstCrossSection +NuclearPlusInterferenceCrossSectionGetConst(ConstHandle2ConstNuclearPlusInterference self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGetConst", self, extract::crossSection); +} + +// Get, non-const +Handle2CrossSection +NuclearPlusInterferenceCrossSectionGet(ConstHandle2NuclearPlusInterference self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGet", self, extract::crossSection); +} + +// Set +void +NuclearPlusInterferenceCrossSectionSet(ConstHandle2NuclearPlusInterference self, ConstHandle2ConstCrossSection crossSection) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CrossSectionSet", self, extract::crossSection, crossSection); +} + + +// ----------------------------------------------------------------------------- +// Child: distribution +// ----------------------------------------------------------------------------- + +// Has +int +NuclearPlusInterferenceDistributionHas(ConstHandle2ConstNuclearPlusInterference self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DistributionHas", self, extract::distribution); +} + +// Get, const +Handle2ConstDistribution +NuclearPlusInterferenceDistributionGetConst(ConstHandle2ConstNuclearPlusInterference self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DistributionGetConst", self, extract::distribution); +} + +// Get, non-const +Handle2Distribution +NuclearPlusInterferenceDistributionGet(ConstHandle2NuclearPlusInterference self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DistributionGet", self, extract::distribution); +} + +// Set +void +NuclearPlusInterferenceDistributionSet(ConstHandle2NuclearPlusInterference self, ConstHandle2ConstDistribution distribution) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DistributionSet", self, extract::distribution, distribution); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NuclearPlusInterference/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearPlusInterference.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearPlusInterference.h new file mode 100644 index 000000000..e05ca0be6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearPlusInterference.h @@ -0,0 +1,205 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// NuclearPlusInterference is the basic handle type in this file. Example: +// // Create a default NuclearPlusInterference object: +// NuclearPlusInterference handle = NuclearPlusInterferenceDefault(); +// Functions involving NuclearPlusInterference are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_NUCLEARPLUSINTERFERENCE +#define C_INTERFACE_GNDS_V2_0_GENERAL_NUCLEARPLUSINTERFERENCE + +#include "GNDStk.h" +#include "v2.0/reduced/CrossSection.h" +#include "v2.0/reduced/Distribution.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct NuclearPlusInterferenceClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ NuclearPlusInterference +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct NuclearPlusInterferenceClass *NuclearPlusInterference; + +// --- Const-aware handles. +typedef const struct NuclearPlusInterferenceClass *const ConstHandle2ConstNuclearPlusInterference; +typedef struct NuclearPlusInterferenceClass *const ConstHandle2NuclearPlusInterference; +typedef const struct NuclearPlusInterferenceClass * Handle2ConstNuclearPlusInterference; +typedef struct NuclearPlusInterferenceClass * Handle2NuclearPlusInterference; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstNuclearPlusInterference +NuclearPlusInterferenceDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2NuclearPlusInterference +NuclearPlusInterferenceDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclearPlusInterference +NuclearPlusInterferenceCreateConst( + const double muCutoff, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstDistribution distribution +); + +// +++ Create, general, non-const +extern_c Handle2NuclearPlusInterference +NuclearPlusInterferenceCreate( + const double muCutoff, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstDistribution distribution +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +NuclearPlusInterferenceAssign(ConstHandle2NuclearPlusInterference self, ConstHandle2ConstNuclearPlusInterference from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +NuclearPlusInterferenceDelete(ConstHandle2ConstNuclearPlusInterference self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +NuclearPlusInterferenceRead(ConstHandle2NuclearPlusInterference self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +NuclearPlusInterferenceWrite(ConstHandle2ConstNuclearPlusInterference self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +NuclearPlusInterferencePrint(ConstHandle2ConstNuclearPlusInterference self); + +// +++ Print to standard output, as XML +extern_c int +NuclearPlusInterferencePrintXML(ConstHandle2ConstNuclearPlusInterference self); + +// +++ Print to standard output, as JSON +extern_c int +NuclearPlusInterferencePrintJSON(ConstHandle2ConstNuclearPlusInterference self); + + +// ----------------------------------------------------------------------------- +// Metadatum: muCutoff +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclearPlusInterferenceMuCutoffHas(ConstHandle2ConstNuclearPlusInterference self); + +// +++ Get +// +++ Returns by value +extern_c double +NuclearPlusInterferenceMuCutoffGet(ConstHandle2ConstNuclearPlusInterference self); + +// +++ Set +extern_c void +NuclearPlusInterferenceMuCutoffSet(ConstHandle2NuclearPlusInterference self, const double muCutoff); + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclearPlusInterferenceCrossSectionHas(ConstHandle2ConstNuclearPlusInterference self); + +// --- Get, const +extern_c Handle2ConstCrossSection +NuclearPlusInterferenceCrossSectionGetConst(ConstHandle2ConstNuclearPlusInterference self); + +// +++ Get, non-const +extern_c Handle2CrossSection +NuclearPlusInterferenceCrossSectionGet(ConstHandle2NuclearPlusInterference self); + +// +++ Set +extern_c void +NuclearPlusInterferenceCrossSectionSet(ConstHandle2NuclearPlusInterference self, ConstHandle2ConstCrossSection crossSection); + + +// ----------------------------------------------------------------------------- +// Child: distribution +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclearPlusInterferenceDistributionHas(ConstHandle2ConstNuclearPlusInterference self); + +// --- Get, const +extern_c Handle2ConstDistribution +NuclearPlusInterferenceDistributionGetConst(ConstHandle2ConstNuclearPlusInterference self); + +// +++ Get, non-const +extern_c Handle2Distribution +NuclearPlusInterferenceDistributionGet(ConstHandle2NuclearPlusInterference self); + +// +++ Set +extern_c void +NuclearPlusInterferenceDistributionSet(ConstHandle2NuclearPlusInterference self, ConstHandle2ConstDistribution distribution); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NuclearPlusInterference/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearPlusInterference/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearPlusInterference/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearPlusInterference/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearPlusInterference/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearTerm.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearTerm.cpp new file mode 100644 index 000000000..1f6374e64 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearTerm.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/NuclearTerm.hpp" +#include "NuclearTerm.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = NuclearTermClass; +using CPP = multigroup::NuclearTerm; + +static const std::string CLASSNAME = "NuclearTerm"; + +namespace extract { + static auto regions2d = [](auto &obj) { return &obj.regions2d; }; + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; +} + +using CPPRegions2d = general::Regions2d; +using CPPXYs2d = general::XYs2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNuclearTerm +NuclearTermDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2NuclearTerm +NuclearTermDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNuclearTerm +NuclearTermCreateConst( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2NuclearTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(regions2d), + detail::tocpp(XYs2d) + ); + return handle; +} + +// Create, general, non-const +Handle2NuclearTerm +NuclearTermCreate( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2NuclearTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(regions2d), + detail::tocpp(XYs2d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +NuclearTermAssign(ConstHandle2NuclearTerm self, ConstHandle2ConstNuclearTerm from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +NuclearTermDelete(ConstHandle2ConstNuclearTerm self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +NuclearTermRead(ConstHandle2NuclearTerm self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +NuclearTermWrite(ConstHandle2ConstNuclearTerm self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +NuclearTermPrint(ConstHandle2ConstNuclearTerm self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +NuclearTermPrintXML(ConstHandle2ConstNuclearTerm self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +NuclearTermPrintJSON(ConstHandle2ConstNuclearTerm self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: regions2d +// ----------------------------------------------------------------------------- + +// Has +int +NuclearTermRegions2dHas(ConstHandle2ConstNuclearTerm self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions2dHas", self, extract::regions2d); +} + +// Get, const +Handle2ConstRegions2d +NuclearTermRegions2dGetConst(ConstHandle2ConstNuclearTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions2dGetConst", self, extract::regions2d); +} + +// Get, non-const +Handle2Regions2d +NuclearTermRegions2dGet(ConstHandle2NuclearTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions2dGet", self, extract::regions2d); +} + +// Set +void +NuclearTermRegions2dSet(ConstHandle2NuclearTerm self, ConstHandle2ConstRegions2d regions2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions2dSet", self, extract::regions2d, regions2d); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +NuclearTermXYs2dHas(ConstHandle2ConstNuclearTerm self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +NuclearTermXYs2dGetConst(ConstHandle2ConstNuclearTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +NuclearTermXYs2dGet(ConstHandle2NuclearTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +NuclearTermXYs2dSet(ConstHandle2NuclearTerm self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NuclearTerm/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearTerm.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearTerm.h new file mode 100644 index 000000000..102a96270 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearTerm.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// NuclearTerm is the basic handle type in this file. Example: +// // Create a default NuclearTerm object: +// NuclearTerm handle = NuclearTermDefault(); +// Functions involving NuclearTerm are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_NUCLEARTERM +#define C_INTERFACE_GNDS_V2_0_GENERAL_NUCLEARTERM + +#include "GNDStk.h" +#include "v2.0/general/Regions2d.h" +#include "v2.0/general/XYs2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct NuclearTermClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ NuclearTerm +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct NuclearTermClass *NuclearTerm; + +// --- Const-aware handles. +typedef const struct NuclearTermClass *const ConstHandle2ConstNuclearTerm; +typedef struct NuclearTermClass *const ConstHandle2NuclearTerm; +typedef const struct NuclearTermClass * Handle2ConstNuclearTerm; +typedef struct NuclearTermClass * Handle2NuclearTerm; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstNuclearTerm +NuclearTermDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2NuclearTerm +NuclearTermDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclearTerm +NuclearTermCreateConst( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general, non-const +extern_c Handle2NuclearTerm +NuclearTermCreate( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +NuclearTermAssign(ConstHandle2NuclearTerm self, ConstHandle2ConstNuclearTerm from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +NuclearTermDelete(ConstHandle2ConstNuclearTerm self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +NuclearTermRead(ConstHandle2NuclearTerm self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +NuclearTermWrite(ConstHandle2ConstNuclearTerm self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +NuclearTermPrint(ConstHandle2ConstNuclearTerm self); + +// +++ Print to standard output, as XML +extern_c int +NuclearTermPrintXML(ConstHandle2ConstNuclearTerm self); + +// +++ Print to standard output, as JSON +extern_c int +NuclearTermPrintJSON(ConstHandle2ConstNuclearTerm self); + + +// ----------------------------------------------------------------------------- +// Child: regions2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclearTermRegions2dHas(ConstHandle2ConstNuclearTerm self); + +// --- Get, const +extern_c Handle2ConstRegions2d +NuclearTermRegions2dGetConst(ConstHandle2ConstNuclearTerm self); + +// +++ Get, non-const +extern_c Handle2Regions2d +NuclearTermRegions2dGet(ConstHandle2NuclearTerm self); + +// +++ Set +extern_c void +NuclearTermRegions2dSet(ConstHandle2NuclearTerm self, ConstHandle2ConstRegions2d regions2d); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclearTermXYs2dHas(ConstHandle2ConstNuclearTerm self); + +// --- Get, const +extern_c Handle2ConstXYs2d +NuclearTermXYs2dGetConst(ConstHandle2ConstNuclearTerm self); + +// +++ Get, non-const +extern_c Handle2XYs2d +NuclearTermXYs2dGet(ConstHandle2NuclearTerm self); + +// +++ Set +extern_c void +NuclearTermXYs2dSet(ConstHandle2NuclearTerm self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/NuclearTerm/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearTerm/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearTerm/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearTerm/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/NuclearTerm/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nucleus.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nucleus.cpp new file mode 100644 index 000000000..fe459cce3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nucleus.cpp @@ -0,0 +1,509 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Nucleus.hpp" +#include "Nucleus.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = NucleusClass; +using CPP = multigroup::Nucleus; + +static const std::string CLASSNAME = "Nucleus"; + +namespace extract { + static auto id = [](auto &obj) { return &obj.id; }; + static auto index = [](auto &obj) { return &obj.index; }; + static auto mass = [](auto &obj) { return &obj.mass; }; + static auto spin = [](auto &obj) { return &obj.spin; }; + static auto parity = [](auto &obj) { return &obj.parity; }; + static auto charge = [](auto &obj) { return &obj.charge; }; + static auto halflife = [](auto &obj) { return &obj.halflife; }; + static auto energy = [](auto &obj) { return &obj.energy; }; + static auto decayData = [](auto &obj) { return &obj.decayData; }; +} + +using CPPMass = general::Mass; +using CPPSpin = general::Spin; +using CPPParity = general::Parity; +using CPPCharge = general::Charge; +using CPPHalflife = general::Halflife; +using CPPEnergy = general::Energy; +using CPPDecayData = general::DecayData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNucleus +NucleusDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Nucleus +NucleusDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNucleus +NucleusCreateConst( + const char *const id, + const int index, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2Nucleus handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + index, + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(charge), + detail::tocpp(halflife), + detail::tocpp(energy), + detail::tocpp(decayData) + ); + return handle; +} + +// Create, general, non-const +Handle2Nucleus +NucleusCreate( + const char *const id, + const int index, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstDecayData decayData +) { + ConstHandle2Nucleus handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + index, + detail::tocpp(mass), + detail::tocpp(spin), + detail::tocpp(parity), + detail::tocpp(charge), + detail::tocpp(halflife), + detail::tocpp(energy), + detail::tocpp(decayData) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +NucleusAssign(ConstHandle2Nucleus self, ConstHandle2ConstNucleus from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +NucleusDelete(ConstHandle2ConstNucleus self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +NucleusRead(ConstHandle2Nucleus self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +NucleusWrite(ConstHandle2ConstNucleus self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +NucleusPrint(ConstHandle2ConstNucleus self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +NucleusPrintXML(ConstHandle2ConstNucleus self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +NucleusPrintJSON(ConstHandle2ConstNucleus self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// Has +int +NucleusIdHas(ConstHandle2ConstNucleus self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IdHas", self, extract::id); +} + +// Get +// Returns by value +const char * +NucleusIdGet(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +NucleusIdSet(ConstHandle2Nucleus self, const char *const id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// Has +int +NucleusIndexHas(ConstHandle2ConstNucleus self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IndexHas", self, extract::index); +} + +// Get +// Returns by value +int +NucleusIndexGet(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +NucleusIndexSet(ConstHandle2Nucleus self, const int index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// Has +int +NucleusMassHas(ConstHandle2ConstNucleus self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MassHas", self, extract::mass); +} + +// Get, const +Handle2ConstMass +NucleusMassGetConst(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGetConst", self, extract::mass); +} + +// Get, non-const +Handle2Mass +NucleusMassGet(ConstHandle2Nucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGet", self, extract::mass); +} + +// Set +void +NucleusMassSet(ConstHandle2Nucleus self, ConstHandle2ConstMass mass) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MassSet", self, extract::mass, mass); +} + + +// ----------------------------------------------------------------------------- +// Child: spin +// ----------------------------------------------------------------------------- + +// Has +int +NucleusSpinHas(ConstHandle2ConstNucleus self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SpinHas", self, extract::spin); +} + +// Get, const +Handle2ConstSpin +NucleusSpinGetConst(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGetConst", self, extract::spin); +} + +// Get, non-const +Handle2Spin +NucleusSpinGet(ConstHandle2Nucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGet", self, extract::spin); +} + +// Set +void +NucleusSpinSet(ConstHandle2Nucleus self, ConstHandle2ConstSpin spin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SpinSet", self, extract::spin, spin); +} + + +// ----------------------------------------------------------------------------- +// Child: parity +// ----------------------------------------------------------------------------- + +// Has +int +NucleusParityHas(ConstHandle2ConstNucleus self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ParityHas", self, extract::parity); +} + +// Get, const +Handle2ConstParity +NucleusParityGetConst(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGetConst", self, extract::parity); +} + +// Get, non-const +Handle2Parity +NucleusParityGet(ConstHandle2Nucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGet", self, extract::parity); +} + +// Set +void +NucleusParitySet(ConstHandle2Nucleus self, ConstHandle2ConstParity parity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ParitySet", self, extract::parity, parity); +} + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// Has +int +NucleusChargeHas(ConstHandle2ConstNucleus self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChargeHas", self, extract::charge); +} + +// Get, const +Handle2ConstCharge +NucleusChargeGetConst(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGetConst", self, extract::charge); +} + +// Get, non-const +Handle2Charge +NucleusChargeGet(ConstHandle2Nucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGet", self, extract::charge); +} + +// Set +void +NucleusChargeSet(ConstHandle2Nucleus self, ConstHandle2ConstCharge charge) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChargeSet", self, extract::charge, charge); +} + + +// ----------------------------------------------------------------------------- +// Child: halflife +// ----------------------------------------------------------------------------- + +// Has +int +NucleusHalflifeHas(ConstHandle2ConstNucleus self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HalflifeHas", self, extract::halflife); +} + +// Get, const +Handle2ConstHalflife +NucleusHalflifeGetConst(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HalflifeGetConst", self, extract::halflife); +} + +// Get, non-const +Handle2Halflife +NucleusHalflifeGet(ConstHandle2Nucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HalflifeGet", self, extract::halflife); +} + +// Set +void +NucleusHalflifeSet(ConstHandle2Nucleus self, ConstHandle2ConstHalflife halflife) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HalflifeSet", self, extract::halflife, halflife); +} + + +// ----------------------------------------------------------------------------- +// Child: energy +// ----------------------------------------------------------------------------- + +// Has +int +NucleusEnergyHas(ConstHandle2ConstNucleus self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EnergyHas", self, extract::energy); +} + +// Get, const +Handle2ConstEnergy +NucleusEnergyGetConst(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyGetConst", self, extract::energy); +} + +// Get, non-const +Handle2Energy +NucleusEnergyGet(ConstHandle2Nucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyGet", self, extract::energy); +} + +// Set +void +NucleusEnergySet(ConstHandle2Nucleus self, ConstHandle2ConstEnergy energy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EnergySet", self, extract::energy, energy); +} + + +// ----------------------------------------------------------------------------- +// Child: decayData +// ----------------------------------------------------------------------------- + +// Has +int +NucleusDecayDataHas(ConstHandle2ConstNucleus self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DecayDataHas", self, extract::decayData); +} + +// Get, const +Handle2ConstDecayData +NucleusDecayDataGetConst(ConstHandle2ConstNucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGetConst", self, extract::decayData); +} + +// Get, non-const +Handle2DecayData +NucleusDecayDataGet(ConstHandle2Nucleus self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGet", self, extract::decayData); +} + +// Set +void +NucleusDecayDataSet(ConstHandle2Nucleus self, ConstHandle2ConstDecayData decayData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DecayDataSet", self, extract::decayData, decayData); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Nucleus/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nucleus.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nucleus.h new file mode 100644 index 000000000..d13209f91 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nucleus.h @@ -0,0 +1,345 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Nucleus is the basic handle type in this file. Example: +// // Create a default Nucleus object: +// Nucleus handle = NucleusDefault(); +// Functions involving Nucleus are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_NUCLEUS +#define C_INTERFACE_GNDS_V2_0_GENERAL_NUCLEUS + +#include "GNDStk.h" +#include "v2.0/general/Mass.h" +#include "v2.0/general/Spin.h" +#include "v2.0/general/Parity.h" +#include "v2.0/general/Charge.h" +#include "v2.0/general/Halflife.h" +#include "v2.0/general/Energy.h" +#include "v2.0/general/DecayData.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct NucleusClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Nucleus +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct NucleusClass *Nucleus; + +// --- Const-aware handles. +typedef const struct NucleusClass *const ConstHandle2ConstNucleus; +typedef struct NucleusClass *const ConstHandle2Nucleus; +typedef const struct NucleusClass * Handle2ConstNucleus; +typedef struct NucleusClass * Handle2Nucleus; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstNucleus +NucleusDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Nucleus +NucleusDefault(); + +// --- Create, general, const +extern_c Handle2ConstNucleus +NucleusCreateConst( + const char *const id, + const int index, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstDecayData decayData +); + +// +++ Create, general, non-const +extern_c Handle2Nucleus +NucleusCreate( + const char *const id, + const int index, + ConstHandle2ConstMass mass, + ConstHandle2ConstSpin spin, + ConstHandle2ConstParity parity, + ConstHandle2ConstCharge charge, + ConstHandle2ConstHalflife halflife, + ConstHandle2ConstEnergy energy, + ConstHandle2ConstDecayData decayData +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +NucleusAssign(ConstHandle2Nucleus self, ConstHandle2ConstNucleus from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +NucleusDelete(ConstHandle2ConstNucleus self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +NucleusRead(ConstHandle2Nucleus self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +NucleusWrite(ConstHandle2ConstNucleus self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +NucleusPrint(ConstHandle2ConstNucleus self); + +// +++ Print to standard output, as XML +extern_c int +NucleusPrintXML(ConstHandle2ConstNucleus self); + +// +++ Print to standard output, as JSON +extern_c int +NucleusPrintJSON(ConstHandle2ConstNucleus self); + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NucleusIdHas(ConstHandle2ConstNucleus self); + +// +++ Get +// +++ Returns by value +extern_c const char * +NucleusIdGet(ConstHandle2ConstNucleus self); + +// +++ Set +extern_c void +NucleusIdSet(ConstHandle2Nucleus self, const char *const id); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NucleusIndexHas(ConstHandle2ConstNucleus self); + +// +++ Get +// +++ Returns by value +extern_c int +NucleusIndexGet(ConstHandle2ConstNucleus self); + +// +++ Set +extern_c void +NucleusIndexSet(ConstHandle2Nucleus self, const int index); + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NucleusMassHas(ConstHandle2ConstNucleus self); + +// --- Get, const +extern_c Handle2ConstMass +NucleusMassGetConst(ConstHandle2ConstNucleus self); + +// +++ Get, non-const +extern_c Handle2Mass +NucleusMassGet(ConstHandle2Nucleus self); + +// +++ Set +extern_c void +NucleusMassSet(ConstHandle2Nucleus self, ConstHandle2ConstMass mass); + + +// ----------------------------------------------------------------------------- +// Child: spin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NucleusSpinHas(ConstHandle2ConstNucleus self); + +// --- Get, const +extern_c Handle2ConstSpin +NucleusSpinGetConst(ConstHandle2ConstNucleus self); + +// +++ Get, non-const +extern_c Handle2Spin +NucleusSpinGet(ConstHandle2Nucleus self); + +// +++ Set +extern_c void +NucleusSpinSet(ConstHandle2Nucleus self, ConstHandle2ConstSpin spin); + + +// ----------------------------------------------------------------------------- +// Child: parity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NucleusParityHas(ConstHandle2ConstNucleus self); + +// --- Get, const +extern_c Handle2ConstParity +NucleusParityGetConst(ConstHandle2ConstNucleus self); + +// +++ Get, non-const +extern_c Handle2Parity +NucleusParityGet(ConstHandle2Nucleus self); + +// +++ Set +extern_c void +NucleusParitySet(ConstHandle2Nucleus self, ConstHandle2ConstParity parity); + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NucleusChargeHas(ConstHandle2ConstNucleus self); + +// --- Get, const +extern_c Handle2ConstCharge +NucleusChargeGetConst(ConstHandle2ConstNucleus self); + +// +++ Get, non-const +extern_c Handle2Charge +NucleusChargeGet(ConstHandle2Nucleus self); + +// +++ Set +extern_c void +NucleusChargeSet(ConstHandle2Nucleus self, ConstHandle2ConstCharge charge); + + +// ----------------------------------------------------------------------------- +// Child: halflife +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NucleusHalflifeHas(ConstHandle2ConstNucleus self); + +// --- Get, const +extern_c Handle2ConstHalflife +NucleusHalflifeGetConst(ConstHandle2ConstNucleus self); + +// +++ Get, non-const +extern_c Handle2Halflife +NucleusHalflifeGet(ConstHandle2Nucleus self); + +// +++ Set +extern_c void +NucleusHalflifeSet(ConstHandle2Nucleus self, ConstHandle2ConstHalflife halflife); + + +// ----------------------------------------------------------------------------- +// Child: energy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NucleusEnergyHas(ConstHandle2ConstNucleus self); + +// --- Get, const +extern_c Handle2ConstEnergy +NucleusEnergyGetConst(ConstHandle2ConstNucleus self); + +// +++ Get, non-const +extern_c Handle2Energy +NucleusEnergyGet(ConstHandle2Nucleus self); + +// +++ Set +extern_c void +NucleusEnergySet(ConstHandle2Nucleus self, ConstHandle2ConstEnergy energy); + + +// ----------------------------------------------------------------------------- +// Child: decayData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NucleusDecayDataHas(ConstHandle2ConstNucleus self); + +// --- Get, const +extern_c Handle2ConstDecayData +NucleusDecayDataGetConst(ConstHandle2ConstNucleus self); + +// +++ Get, non-const +extern_c Handle2DecayData +NucleusDecayDataGet(ConstHandle2Nucleus self); + +// +++ Set +extern_c void +NucleusDecayDataSet(ConstHandle2Nucleus self, ConstHandle2ConstDecayData decayData); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Nucleus/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nucleus/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nucleus/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nucleus/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nucleus/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclide.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclide.cpp new file mode 100644 index 000000000..36d11eef6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclide.cpp @@ -0,0 +1,388 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Nuclide.hpp" +#include "Nuclide.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = NuclideClass; +using CPP = multigroup::Nuclide; + +static const std::string CLASSNAME = "Nuclide"; + +namespace extract { + static auto id = [](auto &obj) { return &obj.id; }; + static auto mass = [](auto &obj) { return &obj.mass; }; + static auto charge = [](auto &obj) { return &obj.charge; }; + static auto nucleus = [](auto &obj) { return &obj.nucleus; }; + static auto decayData = [](auto &obj) { return &obj.decayData; }; + static auto fissionFragmentData = [](auto &obj) { return &obj.fissionFragmentData; }; +} + +using CPPMass = general::Mass; +using CPPCharge = general::Charge; +using CPPNucleus = general::Nucleus; +using CPPDecayData = general::DecayData; +using CPPFissionFragmentData = top::FissionFragmentData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNuclide +NuclideDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Nuclide +NuclideDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNuclide +NuclideCreateConst( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstCharge charge, + ConstHandle2ConstNucleus nucleus, + ConstHandle2ConstDecayData decayData, + ConstHandle2ConstFissionFragmentData fissionFragmentData +) { + ConstHandle2Nuclide handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + detail::tocpp(mass), + detail::tocpp(charge), + detail::tocpp(nucleus), + detail::tocpp(decayData), + detail::tocpp(fissionFragmentData) + ); + return handle; +} + +// Create, general, non-const +Handle2Nuclide +NuclideCreate( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstCharge charge, + ConstHandle2ConstNucleus nucleus, + ConstHandle2ConstDecayData decayData, + ConstHandle2ConstFissionFragmentData fissionFragmentData +) { + ConstHandle2Nuclide handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + detail::tocpp(mass), + detail::tocpp(charge), + detail::tocpp(nucleus), + detail::tocpp(decayData), + detail::tocpp(fissionFragmentData) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +NuclideAssign(ConstHandle2Nuclide self, ConstHandle2ConstNuclide from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +NuclideDelete(ConstHandle2ConstNuclide self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +NuclideRead(ConstHandle2Nuclide self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +NuclideWrite(ConstHandle2ConstNuclide self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +NuclidePrint(ConstHandle2ConstNuclide self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +NuclidePrintXML(ConstHandle2ConstNuclide self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +NuclidePrintJSON(ConstHandle2ConstNuclide self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// Has +int +NuclideIdHas(ConstHandle2ConstNuclide self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IdHas", self, extract::id); +} + +// Get +// Returns by value +const char * +NuclideIdGet(ConstHandle2ConstNuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +NuclideIdSet(ConstHandle2Nuclide self, const char *const id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// Has +int +NuclideMassHas(ConstHandle2ConstNuclide self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MassHas", self, extract::mass); +} + +// Get, const +Handle2ConstMass +NuclideMassGetConst(ConstHandle2ConstNuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGetConst", self, extract::mass); +} + +// Get, non-const +Handle2Mass +NuclideMassGet(ConstHandle2Nuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGet", self, extract::mass); +} + +// Set +void +NuclideMassSet(ConstHandle2Nuclide self, ConstHandle2ConstMass mass) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MassSet", self, extract::mass, mass); +} + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// Has +int +NuclideChargeHas(ConstHandle2ConstNuclide self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChargeHas", self, extract::charge); +} + +// Get, const +Handle2ConstCharge +NuclideChargeGetConst(ConstHandle2ConstNuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGetConst", self, extract::charge); +} + +// Get, non-const +Handle2Charge +NuclideChargeGet(ConstHandle2Nuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChargeGet", self, extract::charge); +} + +// Set +void +NuclideChargeSet(ConstHandle2Nuclide self, ConstHandle2ConstCharge charge) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChargeSet", self, extract::charge, charge); +} + + +// ----------------------------------------------------------------------------- +// Child: nucleus +// ----------------------------------------------------------------------------- + +// Has +int +NuclideNucleusHas(ConstHandle2ConstNuclide self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NucleusHas", self, extract::nucleus); +} + +// Get, const +Handle2ConstNucleus +NuclideNucleusGetConst(ConstHandle2ConstNuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NucleusGetConst", self, extract::nucleus); +} + +// Get, non-const +Handle2Nucleus +NuclideNucleusGet(ConstHandle2Nuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NucleusGet", self, extract::nucleus); +} + +// Set +void +NuclideNucleusSet(ConstHandle2Nuclide self, ConstHandle2ConstNucleus nucleus) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NucleusSet", self, extract::nucleus, nucleus); +} + + +// ----------------------------------------------------------------------------- +// Child: decayData +// ----------------------------------------------------------------------------- + +// Has +int +NuclideDecayDataHas(ConstHandle2ConstNuclide self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DecayDataHas", self, extract::decayData); +} + +// Get, const +Handle2ConstDecayData +NuclideDecayDataGetConst(ConstHandle2ConstNuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGetConst", self, extract::decayData); +} + +// Get, non-const +Handle2DecayData +NuclideDecayDataGet(ConstHandle2Nuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DecayDataGet", self, extract::decayData); +} + +// Set +void +NuclideDecayDataSet(ConstHandle2Nuclide self, ConstHandle2ConstDecayData decayData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DecayDataSet", self, extract::decayData, decayData); +} + + +// ----------------------------------------------------------------------------- +// Child: fissionFragmentData +// ----------------------------------------------------------------------------- + +// Has +int +NuclideFissionFragmentDataHas(ConstHandle2ConstNuclide self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FissionFragmentDataHas", self, extract::fissionFragmentData); +} + +// Get, const +Handle2ConstFissionFragmentData +NuclideFissionFragmentDataGetConst(ConstHandle2ConstNuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionFragmentDataGetConst", self, extract::fissionFragmentData); +} + +// Get, non-const +Handle2FissionFragmentData +NuclideFissionFragmentDataGet(ConstHandle2Nuclide self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionFragmentDataGet", self, extract::fissionFragmentData); +} + +// Set +void +NuclideFissionFragmentDataSet(ConstHandle2Nuclide self, ConstHandle2ConstFissionFragmentData fissionFragmentData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FissionFragmentDataSet", self, extract::fissionFragmentData, fissionFragmentData); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Nuclide/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclide.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclide.h new file mode 100644 index 000000000..4c5d87b69 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclide.h @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Nuclide is the basic handle type in this file. Example: +// // Create a default Nuclide object: +// Nuclide handle = NuclideDefault(); +// Functions involving Nuclide are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_NUCLIDE +#define C_INTERFACE_GNDS_V2_0_GENERAL_NUCLIDE + +#include "GNDStk.h" +#include "v2.0/general/Mass.h" +#include "v2.0/general/Charge.h" +#include "v2.0/general/Nucleus.h" +#include "v2.0/general/DecayData.h" +#include "v2.0/top/FissionFragmentData.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct NuclideClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Nuclide +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct NuclideClass *Nuclide; + +// --- Const-aware handles. +typedef const struct NuclideClass *const ConstHandle2ConstNuclide; +typedef struct NuclideClass *const ConstHandle2Nuclide; +typedef const struct NuclideClass * Handle2ConstNuclide; +typedef struct NuclideClass * Handle2Nuclide; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstNuclide +NuclideDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Nuclide +NuclideDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclide +NuclideCreateConst( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstCharge charge, + ConstHandle2ConstNucleus nucleus, + ConstHandle2ConstDecayData decayData, + ConstHandle2ConstFissionFragmentData fissionFragmentData +); + +// +++ Create, general, non-const +extern_c Handle2Nuclide +NuclideCreate( + const char *const id, + ConstHandle2ConstMass mass, + ConstHandle2ConstCharge charge, + ConstHandle2ConstNucleus nucleus, + ConstHandle2ConstDecayData decayData, + ConstHandle2ConstFissionFragmentData fissionFragmentData +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +NuclideAssign(ConstHandle2Nuclide self, ConstHandle2ConstNuclide from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +NuclideDelete(ConstHandle2ConstNuclide self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +NuclideRead(ConstHandle2Nuclide self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +NuclideWrite(ConstHandle2ConstNuclide self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +NuclidePrint(ConstHandle2ConstNuclide self); + +// +++ Print to standard output, as XML +extern_c int +NuclidePrintXML(ConstHandle2ConstNuclide self); + +// +++ Print to standard output, as JSON +extern_c int +NuclidePrintJSON(ConstHandle2ConstNuclide self); + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclideIdHas(ConstHandle2ConstNuclide self); + +// +++ Get +// +++ Returns by value +extern_c const char * +NuclideIdGet(ConstHandle2ConstNuclide self); + +// +++ Set +extern_c void +NuclideIdSet(ConstHandle2Nuclide self, const char *const id); + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclideMassHas(ConstHandle2ConstNuclide self); + +// --- Get, const +extern_c Handle2ConstMass +NuclideMassGetConst(ConstHandle2ConstNuclide self); + +// +++ Get, non-const +extern_c Handle2Mass +NuclideMassGet(ConstHandle2Nuclide self); + +// +++ Set +extern_c void +NuclideMassSet(ConstHandle2Nuclide self, ConstHandle2ConstMass mass); + + +// ----------------------------------------------------------------------------- +// Child: charge +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclideChargeHas(ConstHandle2ConstNuclide self); + +// --- Get, const +extern_c Handle2ConstCharge +NuclideChargeGetConst(ConstHandle2ConstNuclide self); + +// +++ Get, non-const +extern_c Handle2Charge +NuclideChargeGet(ConstHandle2Nuclide self); + +// +++ Set +extern_c void +NuclideChargeSet(ConstHandle2Nuclide self, ConstHandle2ConstCharge charge); + + +// ----------------------------------------------------------------------------- +// Child: nucleus +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclideNucleusHas(ConstHandle2ConstNuclide self); + +// --- Get, const +extern_c Handle2ConstNucleus +NuclideNucleusGetConst(ConstHandle2ConstNuclide self); + +// +++ Get, non-const +extern_c Handle2Nucleus +NuclideNucleusGet(ConstHandle2Nuclide self); + +// +++ Set +extern_c void +NuclideNucleusSet(ConstHandle2Nuclide self, ConstHandle2ConstNucleus nucleus); + + +// ----------------------------------------------------------------------------- +// Child: decayData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclideDecayDataHas(ConstHandle2ConstNuclide self); + +// --- Get, const +extern_c Handle2ConstDecayData +NuclideDecayDataGetConst(ConstHandle2ConstNuclide self); + +// +++ Get, non-const +extern_c Handle2DecayData +NuclideDecayDataGet(ConstHandle2Nuclide self); + +// +++ Set +extern_c void +NuclideDecayDataSet(ConstHandle2Nuclide self, ConstHandle2ConstDecayData decayData); + + +// ----------------------------------------------------------------------------- +// Child: fissionFragmentData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclideFissionFragmentDataHas(ConstHandle2ConstNuclide self); + +// --- Get, const +extern_c Handle2ConstFissionFragmentData +NuclideFissionFragmentDataGetConst(ConstHandle2ConstNuclide self); + +// +++ Get, non-const +extern_c Handle2FissionFragmentData +NuclideFissionFragmentDataGet(ConstHandle2Nuclide self); + +// +++ Set +extern_c void +NuclideFissionFragmentDataSet(ConstHandle2Nuclide self, ConstHandle2ConstFissionFragmentData fissionFragmentData); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Nuclide/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclide/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclide/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclide/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclide/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclides.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclides.cpp new file mode 100644 index 000000000..98b6f55ab --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclides.cpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Nuclides.hpp" +#include "Nuclides.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = NuclidesClass; +using CPP = multigroup::Nuclides; + +static const std::string CLASSNAME = "Nuclides"; + +namespace extract { + static auto nuclide = [](auto &obj) { return &obj.nuclide; }; +} + +using CPPNuclide = general::Nuclide; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNuclides +NuclidesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Nuclides +NuclidesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNuclides +NuclidesCreateConst( + ConstHandle2Nuclide *const nuclide, const size_t nuclideSize +) { + ConstHandle2Nuclides handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t NuclideN = 0; NuclideN < nuclideSize; ++NuclideN) + NuclidesNuclideAdd(handle, nuclide[NuclideN]); + return handle; +} + +// Create, general, non-const +Handle2Nuclides +NuclidesCreate( + ConstHandle2Nuclide *const nuclide, const size_t nuclideSize +) { + ConstHandle2Nuclides handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t NuclideN = 0; NuclideN < nuclideSize; ++NuclideN) + NuclidesNuclideAdd(handle, nuclide[NuclideN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +NuclidesAssign(ConstHandle2Nuclides self, ConstHandle2ConstNuclides from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +NuclidesDelete(ConstHandle2ConstNuclides self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +NuclidesRead(ConstHandle2Nuclides self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +NuclidesWrite(ConstHandle2ConstNuclides self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +NuclidesPrint(ConstHandle2ConstNuclides self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +NuclidesPrintXML(ConstHandle2ConstNuclides self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +NuclidesPrintJSON(ConstHandle2ConstNuclides self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: nuclide +// ----------------------------------------------------------------------------- + +// Has +int +NuclidesNuclideHas(ConstHandle2ConstNuclides self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NuclideHas", self, extract::nuclide); +} + +// Clear +void +NuclidesNuclideClear(ConstHandle2Nuclides self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"NuclideClear", self, extract::nuclide); +} + +// Size +size_t +NuclidesNuclideSize(ConstHandle2ConstNuclides self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"NuclideSize", self, extract::nuclide); +} + +// Add +void +NuclidesNuclideAdd(ConstHandle2Nuclides self, ConstHandle2ConstNuclide nuclide) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"NuclideAdd", self, extract::nuclide, nuclide); +} + +// Get, by index \in [0,size), const +Handle2ConstNuclide +NuclidesNuclideGetConst(ConstHandle2ConstNuclides self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"NuclideGetConst", self, extract::nuclide, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Nuclide +NuclidesNuclideGet(ConstHandle2Nuclides self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"NuclideGet", self, extract::nuclide, index_); +} + +// Set, by index \in [0,size) +void +NuclidesNuclideSet( + ConstHandle2Nuclides self, + const size_t index_, + ConstHandle2ConstNuclide nuclide +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"NuclideSet", self, extract::nuclide, index_, nuclide); +} + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// Has, by id +int +NuclidesNuclideHasById( + ConstHandle2ConstNuclides self, + const char *const id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"NuclideHasById", + self, extract::nuclide, meta::id, id); +} + +// Get, by id, const +Handle2ConstNuclide +NuclidesNuclideGetByIdConst( + ConstHandle2ConstNuclides self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"NuclideGetByIdConst", + self, extract::nuclide, meta::id, id); +} + +// Get, by id, non-const +Handle2Nuclide +NuclidesNuclideGetById( + ConstHandle2Nuclides self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"NuclideGetById", + self, extract::nuclide, meta::id, id); +} + +// Set, by id +void +NuclidesNuclideSetById( + ConstHandle2Nuclides self, + const char *const id, + ConstHandle2ConstNuclide nuclide +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"NuclideSetById", + self, extract::nuclide, meta::id, id, nuclide); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Nuclides/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclides.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclides.h new file mode 100644 index 000000000..10b309ff4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclides.h @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Nuclides is the basic handle type in this file. Example: +// // Create a default Nuclides object: +// Nuclides handle = NuclidesDefault(); +// Functions involving Nuclides are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_NUCLIDES +#define C_INTERFACE_GNDS_V2_0_GENERAL_NUCLIDES + +#include "GNDStk.h" +#include "v2.0/general/Nuclide.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct NuclidesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Nuclides +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct NuclidesClass *Nuclides; + +// --- Const-aware handles. +typedef const struct NuclidesClass *const ConstHandle2ConstNuclides; +typedef struct NuclidesClass *const ConstHandle2Nuclides; +typedef const struct NuclidesClass * Handle2ConstNuclides; +typedef struct NuclidesClass * Handle2Nuclides; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstNuclides +NuclidesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Nuclides +NuclidesDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclides +NuclidesCreateConst( + ConstHandle2Nuclide *const nuclide, const size_t nuclideSize +); + +// +++ Create, general, non-const +extern_c Handle2Nuclides +NuclidesCreate( + ConstHandle2Nuclide *const nuclide, const size_t nuclideSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +NuclidesAssign(ConstHandle2Nuclides self, ConstHandle2ConstNuclides from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +NuclidesDelete(ConstHandle2ConstNuclides self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +NuclidesRead(ConstHandle2Nuclides self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +NuclidesWrite(ConstHandle2ConstNuclides self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +NuclidesPrint(ConstHandle2ConstNuclides self); + +// +++ Print to standard output, as XML +extern_c int +NuclidesPrintXML(ConstHandle2ConstNuclides self); + +// +++ Print to standard output, as JSON +extern_c int +NuclidesPrintJSON(ConstHandle2ConstNuclides self); + + +// ----------------------------------------------------------------------------- +// Child: nuclide +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclidesNuclideHas(ConstHandle2ConstNuclides self); + +// +++ Clear +extern_c void +NuclidesNuclideClear(ConstHandle2Nuclides self); + +// +++ Size +extern_c size_t +NuclidesNuclideSize(ConstHandle2ConstNuclides self); + +// +++ Add +extern_c void +NuclidesNuclideAdd(ConstHandle2Nuclides self, ConstHandle2ConstNuclide nuclide); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstNuclide +NuclidesNuclideGetConst(ConstHandle2ConstNuclides self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Nuclide +NuclidesNuclideGet(ConstHandle2Nuclides self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +NuclidesNuclideSet( + ConstHandle2Nuclides self, + const size_t index_, + ConstHandle2ConstNuclide nuclide +); + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// +++ Has, by id +extern_c int +NuclidesNuclideHasById( + ConstHandle2ConstNuclides self, + const char *const id +); + +// --- Get, by id, const +extern_c Handle2ConstNuclide +NuclidesNuclideGetByIdConst( + ConstHandle2ConstNuclides self, + const char *const id +); + +// +++ Get, by id, non-const +extern_c Handle2Nuclide +NuclidesNuclideGetById( + ConstHandle2Nuclides self, + const char *const id +); + +// +++ Set, by id +extern_c void +NuclidesNuclideSetById( + ConstHandle2Nuclides self, + const char *const id, + ConstHandle2ConstNuclide nuclide +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Nuclides/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclides/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclides/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclides/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Nuclides/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProduct.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProduct.cpp new file mode 100644 index 000000000..7c4e47b76 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProduct.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/OrphanProduct.hpp" +#include "OrphanProduct.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = OrphanProductClass; +using CPP = multigroup::OrphanProduct; + +static const std::string CLASSNAME = "OrphanProduct"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto ENDF_MT = [](auto &obj) { return &obj.ENDF_MT; }; + static auto crossSection = [](auto &obj) { return &obj.crossSection; }; + static auto outputChannel = [](auto &obj) { return &obj.outputChannel; }; +} + +using CPPCrossSection = general::CrossSection; +using CPPOutputChannel = general::OutputChannel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstOrphanProduct +OrphanProductDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2OrphanProduct +OrphanProductDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstOrphanProduct +OrphanProductCreateConst( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2OrphanProduct handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + ENDF_MT, + detail::tocpp(crossSection), + detail::tocpp(outputChannel) + ); + return handle; +} + +// Create, general, non-const +Handle2OrphanProduct +OrphanProductCreate( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2OrphanProduct handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + ENDF_MT, + detail::tocpp(crossSection), + detail::tocpp(outputChannel) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +OrphanProductAssign(ConstHandle2OrphanProduct self, ConstHandle2ConstOrphanProduct from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +OrphanProductDelete(ConstHandle2ConstOrphanProduct self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +OrphanProductRead(ConstHandle2OrphanProduct self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +OrphanProductWrite(ConstHandle2ConstOrphanProduct self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +OrphanProductPrint(ConstHandle2ConstOrphanProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +OrphanProductPrintXML(ConstHandle2ConstOrphanProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +OrphanProductPrintJSON(ConstHandle2ConstOrphanProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +OrphanProductLabelHas(ConstHandle2ConstOrphanProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +OrphanProductLabelGet(ConstHandle2ConstOrphanProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +OrphanProductLabelSet(ConstHandle2OrphanProduct self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +OrphanProductENDFMTHas(ConstHandle2ConstOrphanProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +int +OrphanProductENDFMTGet(ConstHandle2ConstOrphanProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +OrphanProductENDFMTSet(ConstHandle2OrphanProduct self, const int ENDF_MT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMTSet", self, extract::ENDF_MT, ENDF_MT); +} + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// Has +int +OrphanProductCrossSectionHas(ConstHandle2ConstOrphanProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossSectionHas", self, extract::crossSection); +} + +// Get, const +Handle2ConstCrossSection +OrphanProductCrossSectionGetConst(ConstHandle2ConstOrphanProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGetConst", self, extract::crossSection); +} + +// Get, non-const +Handle2CrossSection +OrphanProductCrossSectionGet(ConstHandle2OrphanProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGet", self, extract::crossSection); +} + +// Set +void +OrphanProductCrossSectionSet(ConstHandle2OrphanProduct self, ConstHandle2ConstCrossSection crossSection) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CrossSectionSet", self, extract::crossSection, crossSection); +} + + +// ----------------------------------------------------------------------------- +// Child: outputChannel +// ----------------------------------------------------------------------------- + +// Has +int +OrphanProductOutputChannelHas(ConstHandle2ConstOrphanProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OutputChannelHas", self, extract::outputChannel); +} + +// Get, const +Handle2ConstOutputChannel +OrphanProductOutputChannelGetConst(ConstHandle2ConstOrphanProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputChannelGetConst", self, extract::outputChannel); +} + +// Get, non-const +Handle2OutputChannel +OrphanProductOutputChannelGet(ConstHandle2OrphanProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputChannelGet", self, extract::outputChannel); +} + +// Set +void +OrphanProductOutputChannelSet(ConstHandle2OrphanProduct self, ConstHandle2ConstOutputChannel outputChannel) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OutputChannelSet", self, extract::outputChannel, outputChannel); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/OrphanProduct/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProduct.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProduct.h new file mode 100644 index 000000000..726d026b7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProduct.h @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// OrphanProduct is the basic handle type in this file. Example: +// // Create a default OrphanProduct object: +// OrphanProduct handle = OrphanProductDefault(); +// Functions involving OrphanProduct are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ORPHANPRODUCT +#define C_INTERFACE_GNDS_V2_0_GENERAL_ORPHANPRODUCT + +#include "GNDStk.h" +#include "v2.0/general/CrossSection.h" +#include "v2.0/general/OutputChannel.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct OrphanProductClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ OrphanProduct +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct OrphanProductClass *OrphanProduct; + +// --- Const-aware handles. +typedef const struct OrphanProductClass *const ConstHandle2ConstOrphanProduct; +typedef struct OrphanProductClass *const ConstHandle2OrphanProduct; +typedef const struct OrphanProductClass * Handle2ConstOrphanProduct; +typedef struct OrphanProductClass * Handle2OrphanProduct; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstOrphanProduct +OrphanProductDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2OrphanProduct +OrphanProductDefault(); + +// --- Create, general, const +extern_c Handle2ConstOrphanProduct +OrphanProductCreateConst( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +); + +// +++ Create, general, non-const +extern_c Handle2OrphanProduct +OrphanProductCreate( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +OrphanProductAssign(ConstHandle2OrphanProduct self, ConstHandle2ConstOrphanProduct from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +OrphanProductDelete(ConstHandle2ConstOrphanProduct self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +OrphanProductRead(ConstHandle2OrphanProduct self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +OrphanProductWrite(ConstHandle2ConstOrphanProduct self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +OrphanProductPrint(ConstHandle2ConstOrphanProduct self); + +// +++ Print to standard output, as XML +extern_c int +OrphanProductPrintXML(ConstHandle2ConstOrphanProduct self); + +// +++ Print to standard output, as JSON +extern_c int +OrphanProductPrintJSON(ConstHandle2ConstOrphanProduct self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OrphanProductLabelHas(ConstHandle2ConstOrphanProduct self); + +// +++ Get +// +++ Returns by value +extern_c const char * +OrphanProductLabelGet(ConstHandle2ConstOrphanProduct self); + +// +++ Set +extern_c void +OrphanProductLabelSet(ConstHandle2OrphanProduct self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OrphanProductENDFMTHas(ConstHandle2ConstOrphanProduct self); + +// +++ Get +// +++ Returns by value +extern_c int +OrphanProductENDFMTGet(ConstHandle2ConstOrphanProduct self); + +// +++ Set +extern_c void +OrphanProductENDFMTSet(ConstHandle2OrphanProduct self, const int ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OrphanProductCrossSectionHas(ConstHandle2ConstOrphanProduct self); + +// --- Get, const +extern_c Handle2ConstCrossSection +OrphanProductCrossSectionGetConst(ConstHandle2ConstOrphanProduct self); + +// +++ Get, non-const +extern_c Handle2CrossSection +OrphanProductCrossSectionGet(ConstHandle2OrphanProduct self); + +// +++ Set +extern_c void +OrphanProductCrossSectionSet(ConstHandle2OrphanProduct self, ConstHandle2ConstCrossSection crossSection); + + +// ----------------------------------------------------------------------------- +// Child: outputChannel +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OrphanProductOutputChannelHas(ConstHandle2ConstOrphanProduct self); + +// --- Get, const +extern_c Handle2ConstOutputChannel +OrphanProductOutputChannelGetConst(ConstHandle2ConstOrphanProduct self); + +// +++ Get, non-const +extern_c Handle2OutputChannel +OrphanProductOutputChannelGet(ConstHandle2OrphanProduct self); + +// +++ Set +extern_c void +OrphanProductOutputChannelSet(ConstHandle2OrphanProduct self, ConstHandle2ConstOutputChannel outputChannel); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/OrphanProduct/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProduct/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProduct/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProduct/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProduct/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProducts.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProducts.cpp new file mode 100644 index 000000000..ded7c9419 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProducts.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/OrphanProducts.hpp" +#include "OrphanProducts.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = OrphanProductsClass; +using CPP = multigroup::OrphanProducts; + +static const std::string CLASSNAME = "OrphanProducts"; + +namespace extract { + static auto orphanProduct = [](auto &obj) { return &obj.orphanProduct; }; +} + +using CPPOrphanProduct = general::OrphanProduct; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstOrphanProducts +OrphanProductsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2OrphanProducts +OrphanProductsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstOrphanProducts +OrphanProductsCreateConst( + ConstHandle2OrphanProduct *const orphanProduct, const size_t orphanProductSize +) { + ConstHandle2OrphanProducts handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t OrphanProductN = 0; OrphanProductN < orphanProductSize; ++OrphanProductN) + OrphanProductsOrphanProductAdd(handle, orphanProduct[OrphanProductN]); + return handle; +} + +// Create, general, non-const +Handle2OrphanProducts +OrphanProductsCreate( + ConstHandle2OrphanProduct *const orphanProduct, const size_t orphanProductSize +) { + ConstHandle2OrphanProducts handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t OrphanProductN = 0; OrphanProductN < orphanProductSize; ++OrphanProductN) + OrphanProductsOrphanProductAdd(handle, orphanProduct[OrphanProductN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +OrphanProductsAssign(ConstHandle2OrphanProducts self, ConstHandle2ConstOrphanProducts from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +OrphanProductsDelete(ConstHandle2ConstOrphanProducts self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +OrphanProductsRead(ConstHandle2OrphanProducts self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +OrphanProductsWrite(ConstHandle2ConstOrphanProducts self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +OrphanProductsPrint(ConstHandle2ConstOrphanProducts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +OrphanProductsPrintXML(ConstHandle2ConstOrphanProducts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +OrphanProductsPrintJSON(ConstHandle2ConstOrphanProducts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: orphanProduct +// ----------------------------------------------------------------------------- + +// Has +int +OrphanProductsOrphanProductHas(ConstHandle2ConstOrphanProducts self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OrphanProductHas", self, extract::orphanProduct); +} + +// Clear +void +OrphanProductsOrphanProductClear(ConstHandle2OrphanProducts self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"OrphanProductClear", self, extract::orphanProduct); +} + +// Size +size_t +OrphanProductsOrphanProductSize(ConstHandle2ConstOrphanProducts self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"OrphanProductSize", self, extract::orphanProduct); +} + +// Add +void +OrphanProductsOrphanProductAdd(ConstHandle2OrphanProducts self, ConstHandle2ConstOrphanProduct orphanProduct) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"OrphanProductAdd", self, extract::orphanProduct, orphanProduct); +} + +// Get, by index \in [0,size), const +Handle2ConstOrphanProduct +OrphanProductsOrphanProductGetConst(ConstHandle2ConstOrphanProducts self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"OrphanProductGetConst", self, extract::orphanProduct, index_); +} + +// Get, by index \in [0,size), non-const +Handle2OrphanProduct +OrphanProductsOrphanProductGet(ConstHandle2OrphanProducts self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"OrphanProductGet", self, extract::orphanProduct, index_); +} + +// Set, by index \in [0,size) +void +OrphanProductsOrphanProductSet( + ConstHandle2OrphanProducts self, + const size_t index_, + ConstHandle2ConstOrphanProduct orphanProduct +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"OrphanProductSet", self, extract::orphanProduct, index_, orphanProduct); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +OrphanProductsOrphanProductHasByLabel( + ConstHandle2ConstOrphanProducts self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductHasByLabel", + self, extract::orphanProduct, meta::label, label); +} + +// Get, by label, const +Handle2ConstOrphanProduct +OrphanProductsOrphanProductGetByLabelConst( + ConstHandle2ConstOrphanProducts self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductGetByLabelConst", + self, extract::orphanProduct, meta::label, label); +} + +// Get, by label, non-const +Handle2OrphanProduct +OrphanProductsOrphanProductGetByLabel( + ConstHandle2OrphanProducts self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductGetByLabel", + self, extract::orphanProduct, meta::label, label); +} + +// Set, by label +void +OrphanProductsOrphanProductSetByLabel( + ConstHandle2OrphanProducts self, + const char *const label, + ConstHandle2ConstOrphanProduct orphanProduct +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductSetByLabel", + self, extract::orphanProduct, meta::label, label, orphanProduct); +} + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// Has, by ENDF_MT +int +OrphanProductsOrphanProductHasByENDFMT( + ConstHandle2ConstOrphanProducts self, + const int ENDF_MT +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductHasByENDFMT", + self, extract::orphanProduct, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, const +Handle2ConstOrphanProduct +OrphanProductsOrphanProductGetByENDFMTConst( + ConstHandle2ConstOrphanProducts self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductGetByENDFMTConst", + self, extract::orphanProduct, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, non-const +Handle2OrphanProduct +OrphanProductsOrphanProductGetByENDFMT( + ConstHandle2OrphanProducts self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductGetByENDFMT", + self, extract::orphanProduct, meta::ENDF_MT, ENDF_MT); +} + +// Set, by ENDF_MT +void +OrphanProductsOrphanProductSetByENDFMT( + ConstHandle2OrphanProducts self, + const int ENDF_MT, + ConstHandle2ConstOrphanProduct orphanProduct +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"OrphanProductSetByENDFMT", + self, extract::orphanProduct, meta::ENDF_MT, ENDF_MT, orphanProduct); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/OrphanProducts/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProducts.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProducts.h new file mode 100644 index 000000000..8a59937a0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProducts.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// OrphanProducts is the basic handle type in this file. Example: +// // Create a default OrphanProducts object: +// OrphanProducts handle = OrphanProductsDefault(); +// Functions involving OrphanProducts are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ORPHANPRODUCTS +#define C_INTERFACE_GNDS_V2_0_GENERAL_ORPHANPRODUCTS + +#include "GNDStk.h" +#include "v2.0/general/OrphanProduct.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct OrphanProductsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ OrphanProducts +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct OrphanProductsClass *OrphanProducts; + +// --- Const-aware handles. +typedef const struct OrphanProductsClass *const ConstHandle2ConstOrphanProducts; +typedef struct OrphanProductsClass *const ConstHandle2OrphanProducts; +typedef const struct OrphanProductsClass * Handle2ConstOrphanProducts; +typedef struct OrphanProductsClass * Handle2OrphanProducts; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstOrphanProducts +OrphanProductsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2OrphanProducts +OrphanProductsDefault(); + +// --- Create, general, const +extern_c Handle2ConstOrphanProducts +OrphanProductsCreateConst( + ConstHandle2OrphanProduct *const orphanProduct, const size_t orphanProductSize +); + +// +++ Create, general, non-const +extern_c Handle2OrphanProducts +OrphanProductsCreate( + ConstHandle2OrphanProduct *const orphanProduct, const size_t orphanProductSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +OrphanProductsAssign(ConstHandle2OrphanProducts self, ConstHandle2ConstOrphanProducts from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +OrphanProductsDelete(ConstHandle2ConstOrphanProducts self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +OrphanProductsRead(ConstHandle2OrphanProducts self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +OrphanProductsWrite(ConstHandle2ConstOrphanProducts self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +OrphanProductsPrint(ConstHandle2ConstOrphanProducts self); + +// +++ Print to standard output, as XML +extern_c int +OrphanProductsPrintXML(ConstHandle2ConstOrphanProducts self); + +// +++ Print to standard output, as JSON +extern_c int +OrphanProductsPrintJSON(ConstHandle2ConstOrphanProducts self); + + +// ----------------------------------------------------------------------------- +// Child: orphanProduct +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OrphanProductsOrphanProductHas(ConstHandle2ConstOrphanProducts self); + +// +++ Clear +extern_c void +OrphanProductsOrphanProductClear(ConstHandle2OrphanProducts self); + +// +++ Size +extern_c size_t +OrphanProductsOrphanProductSize(ConstHandle2ConstOrphanProducts self); + +// +++ Add +extern_c void +OrphanProductsOrphanProductAdd(ConstHandle2OrphanProducts self, ConstHandle2ConstOrphanProduct orphanProduct); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstOrphanProduct +OrphanProductsOrphanProductGetConst(ConstHandle2ConstOrphanProducts self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2OrphanProduct +OrphanProductsOrphanProductGet(ConstHandle2OrphanProducts self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +OrphanProductsOrphanProductSet( + ConstHandle2OrphanProducts self, + const size_t index_, + ConstHandle2ConstOrphanProduct orphanProduct +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +OrphanProductsOrphanProductHasByLabel( + ConstHandle2ConstOrphanProducts self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstOrphanProduct +OrphanProductsOrphanProductGetByLabelConst( + ConstHandle2ConstOrphanProducts self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2OrphanProduct +OrphanProductsOrphanProductGetByLabel( + ConstHandle2OrphanProducts self, + const char *const label +); + +// +++ Set, by label +extern_c void +OrphanProductsOrphanProductSetByLabel( + ConstHandle2OrphanProducts self, + const char *const label, + ConstHandle2ConstOrphanProduct orphanProduct +); + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// +++ Has, by ENDF_MT +extern_c int +OrphanProductsOrphanProductHasByENDFMT( + ConstHandle2ConstOrphanProducts self, + const int ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstOrphanProduct +OrphanProductsOrphanProductGetByENDFMTConst( + ConstHandle2ConstOrphanProducts self, + const int ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2OrphanProduct +OrphanProductsOrphanProductGetByENDFMT( + ConstHandle2OrphanProducts self, + const int ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +OrphanProductsOrphanProductSetByENDFMT( + ConstHandle2OrphanProducts self, + const int ENDF_MT, + ConstHandle2ConstOrphanProduct orphanProduct +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/OrphanProducts/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProducts/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProducts/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProducts/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OrphanProducts/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OutputChannel.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OutputChannel.cpp new file mode 100644 index 000000000..050630d0a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OutputChannel.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/OutputChannel.hpp" +#include "OutputChannel.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = OutputChannelClass; +using CPP = multigroup::OutputChannel; + +static const std::string CLASSNAME = "OutputChannel"; + +namespace extract { + static auto genre = [](auto &obj) { return &obj.genre; }; + static auto process = [](auto &obj) { return &obj.process; }; + static auto Q = [](auto &obj) { return &obj.Q; }; + static auto products = [](auto &obj) { return &obj.products; }; + static auto fissionFragmentData = [](auto &obj) { return &obj.fissionFragmentData; }; +} + +using CPPQ = general::Q; +using CPPProducts = general::Products; +using CPPFissionFragmentData = top::FissionFragmentData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstOutputChannel +OutputChannelDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2OutputChannel +OutputChannelDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstOutputChannel +OutputChannelCreateConst( + const char *const genre, + const char *const process, + ConstHandle2ConstQ Q, + ConstHandle2ConstProducts products, + ConstHandle2ConstFissionFragmentData fissionFragmentData +) { + ConstHandle2OutputChannel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + genre, + process, + detail::tocpp(Q), + detail::tocpp(products), + detail::tocpp(fissionFragmentData) + ); + return handle; +} + +// Create, general, non-const +Handle2OutputChannel +OutputChannelCreate( + const char *const genre, + const char *const process, + ConstHandle2ConstQ Q, + ConstHandle2ConstProducts products, + ConstHandle2ConstFissionFragmentData fissionFragmentData +) { + ConstHandle2OutputChannel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + genre, + process, + detail::tocpp(Q), + detail::tocpp(products), + detail::tocpp(fissionFragmentData) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +OutputChannelAssign(ConstHandle2OutputChannel self, ConstHandle2ConstOutputChannel from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +OutputChannelDelete(ConstHandle2ConstOutputChannel self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +OutputChannelRead(ConstHandle2OutputChannel self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +OutputChannelWrite(ConstHandle2ConstOutputChannel self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +OutputChannelPrint(ConstHandle2ConstOutputChannel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +OutputChannelPrintXML(ConstHandle2ConstOutputChannel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +OutputChannelPrintJSON(ConstHandle2ConstOutputChannel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: genre +// ----------------------------------------------------------------------------- + +// Has +int +OutputChannelGenreHas(ConstHandle2ConstOutputChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GenreHas", self, extract::genre); +} + +// Get +// Returns by value +const char * +OutputChannelGenreGet(ConstHandle2ConstOutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GenreGet", self, extract::genre); +} + +// Set +void +OutputChannelGenreSet(ConstHandle2OutputChannel self, const char *const genre) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GenreSet", self, extract::genre, genre); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: process +// ----------------------------------------------------------------------------- + +// Has +int +OutputChannelProcessHas(ConstHandle2ConstOutputChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProcessHas", self, extract::process); +} + +// Get +// Returns by value +const char * +OutputChannelProcessGet(ConstHandle2ConstOutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProcessGet", self, extract::process); +} + +// Set +void +OutputChannelProcessSet(ConstHandle2OutputChannel self, const char *const process) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProcessSet", self, extract::process, process); +} + + +// ----------------------------------------------------------------------------- +// Child: Q +// ----------------------------------------------------------------------------- + +// Has +int +OutputChannelQHas(ConstHandle2ConstOutputChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"QHas", self, extract::Q); +} + +// Get, const +Handle2ConstQ +OutputChannelQGetConst(ConstHandle2ConstOutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"QGetConst", self, extract::Q); +} + +// Get, non-const +Handle2Q +OutputChannelQGet(ConstHandle2OutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"QGet", self, extract::Q); +} + +// Set +void +OutputChannelQSet(ConstHandle2OutputChannel self, ConstHandle2ConstQ Q) +{ + detail::setField + (CLASSNAME, CLASSNAME+"QSet", self, extract::Q, Q); +} + + +// ----------------------------------------------------------------------------- +// Child: products +// ----------------------------------------------------------------------------- + +// Has +int +OutputChannelProductsHas(ConstHandle2ConstOutputChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductsHas", self, extract::products); +} + +// Get, const +Handle2ConstProducts +OutputChannelProductsGetConst(ConstHandle2ConstOutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductsGetConst", self, extract::products); +} + +// Get, non-const +Handle2Products +OutputChannelProductsGet(ConstHandle2OutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductsGet", self, extract::products); +} + +// Set +void +OutputChannelProductsSet(ConstHandle2OutputChannel self, ConstHandle2ConstProducts products) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductsSet", self, extract::products, products); +} + + +// ----------------------------------------------------------------------------- +// Child: fissionFragmentData +// ----------------------------------------------------------------------------- + +// Has +int +OutputChannelFissionFragmentDataHas(ConstHandle2ConstOutputChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FissionFragmentDataHas", self, extract::fissionFragmentData); +} + +// Get, const +Handle2ConstFissionFragmentData +OutputChannelFissionFragmentDataGetConst(ConstHandle2ConstOutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionFragmentDataGetConst", self, extract::fissionFragmentData); +} + +// Get, non-const +Handle2FissionFragmentData +OutputChannelFissionFragmentDataGet(ConstHandle2OutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionFragmentDataGet", self, extract::fissionFragmentData); +} + +// Set +void +OutputChannelFissionFragmentDataSet(ConstHandle2OutputChannel self, ConstHandle2ConstFissionFragmentData fissionFragmentData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FissionFragmentDataSet", self, extract::fissionFragmentData, fissionFragmentData); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/OutputChannel/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OutputChannel.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OutputChannel.h new file mode 100644 index 000000000..0878f900b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OutputChannel.h @@ -0,0 +1,249 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// OutputChannel is the basic handle type in this file. Example: +// // Create a default OutputChannel object: +// OutputChannel handle = OutputChannelDefault(); +// Functions involving OutputChannel are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_OUTPUTCHANNEL +#define C_INTERFACE_GNDS_V2_0_GENERAL_OUTPUTCHANNEL + +#include "GNDStk.h" +#include "v2.0/general/Q.h" +#include "v2.0/general/Products.h" +#include "v2.0/top/FissionFragmentData.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct OutputChannelClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ OutputChannel +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct OutputChannelClass *OutputChannel; + +// --- Const-aware handles. +typedef const struct OutputChannelClass *const ConstHandle2ConstOutputChannel; +typedef struct OutputChannelClass *const ConstHandle2OutputChannel; +typedef const struct OutputChannelClass * Handle2ConstOutputChannel; +typedef struct OutputChannelClass * Handle2OutputChannel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstOutputChannel +OutputChannelDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2OutputChannel +OutputChannelDefault(); + +// --- Create, general, const +extern_c Handle2ConstOutputChannel +OutputChannelCreateConst( + const char *const genre, + const char *const process, + ConstHandle2ConstQ Q, + ConstHandle2ConstProducts products, + ConstHandle2ConstFissionFragmentData fissionFragmentData +); + +// +++ Create, general, non-const +extern_c Handle2OutputChannel +OutputChannelCreate( + const char *const genre, + const char *const process, + ConstHandle2ConstQ Q, + ConstHandle2ConstProducts products, + ConstHandle2ConstFissionFragmentData fissionFragmentData +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +OutputChannelAssign(ConstHandle2OutputChannel self, ConstHandle2ConstOutputChannel from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +OutputChannelDelete(ConstHandle2ConstOutputChannel self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +OutputChannelRead(ConstHandle2OutputChannel self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +OutputChannelWrite(ConstHandle2ConstOutputChannel self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +OutputChannelPrint(ConstHandle2ConstOutputChannel self); + +// +++ Print to standard output, as XML +extern_c int +OutputChannelPrintXML(ConstHandle2ConstOutputChannel self); + +// +++ Print to standard output, as JSON +extern_c int +OutputChannelPrintJSON(ConstHandle2ConstOutputChannel self); + + +// ----------------------------------------------------------------------------- +// Metadatum: genre +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputChannelGenreHas(ConstHandle2ConstOutputChannel self); + +// +++ Get +// +++ Returns by value +extern_c const char * +OutputChannelGenreGet(ConstHandle2ConstOutputChannel self); + +// +++ Set +extern_c void +OutputChannelGenreSet(ConstHandle2OutputChannel self, const char *const genre); + + +// ----------------------------------------------------------------------------- +// Metadatum: process +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputChannelProcessHas(ConstHandle2ConstOutputChannel self); + +// +++ Get +// +++ Returns by value +extern_c const char * +OutputChannelProcessGet(ConstHandle2ConstOutputChannel self); + +// +++ Set +extern_c void +OutputChannelProcessSet(ConstHandle2OutputChannel self, const char *const process); + + +// ----------------------------------------------------------------------------- +// Child: Q +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputChannelQHas(ConstHandle2ConstOutputChannel self); + +// --- Get, const +extern_c Handle2ConstQ +OutputChannelQGetConst(ConstHandle2ConstOutputChannel self); + +// +++ Get, non-const +extern_c Handle2Q +OutputChannelQGet(ConstHandle2OutputChannel self); + +// +++ Set +extern_c void +OutputChannelQSet(ConstHandle2OutputChannel self, ConstHandle2ConstQ Q); + + +// ----------------------------------------------------------------------------- +// Child: products +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputChannelProductsHas(ConstHandle2ConstOutputChannel self); + +// --- Get, const +extern_c Handle2ConstProducts +OutputChannelProductsGetConst(ConstHandle2ConstOutputChannel self); + +// +++ Get, non-const +extern_c Handle2Products +OutputChannelProductsGet(ConstHandle2OutputChannel self); + +// +++ Set +extern_c void +OutputChannelProductsSet(ConstHandle2OutputChannel self, ConstHandle2ConstProducts products); + + +// ----------------------------------------------------------------------------- +// Child: fissionFragmentData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputChannelFissionFragmentDataHas(ConstHandle2ConstOutputChannel self); + +// --- Get, const +extern_c Handle2ConstFissionFragmentData +OutputChannelFissionFragmentDataGetConst(ConstHandle2ConstOutputChannel self); + +// +++ Get, non-const +extern_c Handle2FissionFragmentData +OutputChannelFissionFragmentDataGet(ConstHandle2OutputChannel self); + +// +++ Set +extern_c void +OutputChannelFissionFragmentDataSet(ConstHandle2OutputChannel self, ConstHandle2ConstFissionFragmentData fissionFragmentData); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/OutputChannel/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OutputChannel/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OutputChannel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OutputChannel/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/OutputChannel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariance.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariance.cpp new file mode 100644 index 000000000..f85303603 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariance.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ParameterCovariance.hpp" +#include "ParameterCovariance.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ParameterCovarianceClass; +using CPP = multigroup::ParameterCovariance; + +static const std::string CLASSNAME = "ParameterCovariance"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto rowData = [](auto &obj) { return &obj.rowData; }; + static auto parameterCovarianceMatrix = [](auto &obj) { return &obj.parameterCovarianceMatrix; }; +} + +using CPPRowData = general::RowData; +using CPPParameterCovarianceMatrix = general::ParameterCovarianceMatrix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParameterCovariance +ParameterCovarianceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ParameterCovariance +ParameterCovarianceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstParameterCovariance +ParameterCovarianceCreateConst( + const char *const label, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix +) { + ConstHandle2ParameterCovariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(rowData), + detail::tocpp(parameterCovarianceMatrix) + ); + return handle; +} + +// Create, general, non-const +Handle2ParameterCovariance +ParameterCovarianceCreate( + const char *const label, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix +) { + ConstHandle2ParameterCovariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(rowData), + detail::tocpp(parameterCovarianceMatrix) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ParameterCovarianceAssign(ConstHandle2ParameterCovariance self, ConstHandle2ConstParameterCovariance from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ParameterCovarianceDelete(ConstHandle2ConstParameterCovariance self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ParameterCovarianceRead(ConstHandle2ParameterCovariance self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ParameterCovarianceWrite(ConstHandle2ConstParameterCovariance self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ParameterCovariancePrint(ConstHandle2ConstParameterCovariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ParameterCovariancePrintXML(ConstHandle2ConstParameterCovariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ParameterCovariancePrintJSON(ConstHandle2ConstParameterCovariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ParameterCovarianceLabelHas(ConstHandle2ConstParameterCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ParameterCovarianceLabelGet(ConstHandle2ConstParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ParameterCovarianceLabelSet(ConstHandle2ParameterCovariance self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: rowData +// ----------------------------------------------------------------------------- + +// Has +int +ParameterCovarianceRowDataHas(ConstHandle2ConstParameterCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RowDataHas", self, extract::rowData); +} + +// Get, const +Handle2ConstRowData +ParameterCovarianceRowDataGetConst(ConstHandle2ConstParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RowDataGetConst", self, extract::rowData); +} + +// Get, non-const +Handle2RowData +ParameterCovarianceRowDataGet(ConstHandle2ParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RowDataGet", self, extract::rowData); +} + +// Set +void +ParameterCovarianceRowDataSet(ConstHandle2ParameterCovariance self, ConstHandle2ConstRowData rowData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RowDataSet", self, extract::rowData, rowData); +} + + +// ----------------------------------------------------------------------------- +// Child: parameterCovarianceMatrix +// ----------------------------------------------------------------------------- + +// Has +int +ParameterCovarianceParameterCovarianceMatrixHas(ConstHandle2ConstParameterCovariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixHas", self, extract::parameterCovarianceMatrix); +} + +// Get, const +Handle2ConstParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetConst(ConstHandle2ConstParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixGetConst", self, extract::parameterCovarianceMatrix); +} + +// Get, non-const +Handle2ParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGet(ConstHandle2ParameterCovariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixGet", self, extract::parameterCovarianceMatrix); +} + +// Set +void +ParameterCovarianceParameterCovarianceMatrixSet(ConstHandle2ParameterCovariance self, ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ParameterCovarianceMatrixSet", self, extract::parameterCovarianceMatrix, parameterCovarianceMatrix); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ParameterCovariance/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariance.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariance.h new file mode 100644 index 000000000..2acd63a0e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariance.h @@ -0,0 +1,205 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ParameterCovariance is the basic handle type in this file. Example: +// // Create a default ParameterCovariance object: +// ParameterCovariance handle = ParameterCovarianceDefault(); +// Functions involving ParameterCovariance are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PARAMETERCOVARIANCE +#define C_INTERFACE_GNDS_V2_0_GENERAL_PARAMETERCOVARIANCE + +#include "GNDStk.h" +#include "v2.0/general/RowData.h" +#include "v2.0/general/ParameterCovarianceMatrix.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ParameterCovarianceClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ParameterCovariance +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ParameterCovarianceClass *ParameterCovariance; + +// --- Const-aware handles. +typedef const struct ParameterCovarianceClass *const ConstHandle2ConstParameterCovariance; +typedef struct ParameterCovarianceClass *const ConstHandle2ParameterCovariance; +typedef const struct ParameterCovarianceClass * Handle2ConstParameterCovariance; +typedef struct ParameterCovarianceClass * Handle2ParameterCovariance; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstParameterCovariance +ParameterCovarianceDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ParameterCovariance +ParameterCovarianceDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameterCovariance +ParameterCovarianceCreateConst( + const char *const label, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix +); + +// +++ Create, general, non-const +extern_c Handle2ParameterCovariance +ParameterCovarianceCreate( + const char *const label, + ConstHandle2ConstRowData rowData, + ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ParameterCovarianceAssign(ConstHandle2ParameterCovariance self, ConstHandle2ConstParameterCovariance from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ParameterCovarianceDelete(ConstHandle2ConstParameterCovariance self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ParameterCovarianceRead(ConstHandle2ParameterCovariance self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ParameterCovarianceWrite(ConstHandle2ConstParameterCovariance self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ParameterCovariancePrint(ConstHandle2ConstParameterCovariance self); + +// +++ Print to standard output, as XML +extern_c int +ParameterCovariancePrintXML(ConstHandle2ConstParameterCovariance self); + +// +++ Print to standard output, as JSON +extern_c int +ParameterCovariancePrintJSON(ConstHandle2ConstParameterCovariance self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterCovarianceLabelHas(ConstHandle2ConstParameterCovariance self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ParameterCovarianceLabelGet(ConstHandle2ConstParameterCovariance self); + +// +++ Set +extern_c void +ParameterCovarianceLabelSet(ConstHandle2ParameterCovariance self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Child: rowData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterCovarianceRowDataHas(ConstHandle2ConstParameterCovariance self); + +// --- Get, const +extern_c Handle2ConstRowData +ParameterCovarianceRowDataGetConst(ConstHandle2ConstParameterCovariance self); + +// +++ Get, non-const +extern_c Handle2RowData +ParameterCovarianceRowDataGet(ConstHandle2ParameterCovariance self); + +// +++ Set +extern_c void +ParameterCovarianceRowDataSet(ConstHandle2ParameterCovariance self, ConstHandle2ConstRowData rowData); + + +// ----------------------------------------------------------------------------- +// Child: parameterCovarianceMatrix +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterCovarianceParameterCovarianceMatrixHas(ConstHandle2ConstParameterCovariance self); + +// --- Get, const +extern_c Handle2ConstParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGetConst(ConstHandle2ConstParameterCovariance self); + +// +++ Get, non-const +extern_c Handle2ParameterCovarianceMatrix +ParameterCovarianceParameterCovarianceMatrixGet(ConstHandle2ParameterCovariance self); + +// +++ Set +extern_c void +ParameterCovarianceParameterCovarianceMatrixSet(ConstHandle2ParameterCovariance self, ConstHandle2ConstParameterCovarianceMatrix parameterCovarianceMatrix); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ParameterCovariance/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariance/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariance/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovarianceMatrix.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovarianceMatrix.cpp new file mode 100644 index 000000000..850bc4ce5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovarianceMatrix.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ParameterCovarianceMatrix.hpp" +#include "ParameterCovarianceMatrix.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ParameterCovarianceMatrixClass; +using CPP = multigroup::ParameterCovarianceMatrix; + +static const std::string CLASSNAME = "ParameterCovarianceMatrix"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto type = [](auto &obj) { return &obj.type; }; + static auto array = [](auto &obj) { return &obj.array; }; + static auto parameters = [](auto &obj) { return &obj.parameters; }; +} + +using CPPArray = g3d::Array; +using CPPParameters = general::Parameters; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParameterCovarianceMatrix +ParameterCovarianceMatrixDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ParameterCovarianceMatrix +ParameterCovarianceMatrixDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstParameterCovarianceMatrix +ParameterCovarianceMatrixCreateConst( + const char *const label, + const char *const type, + ConstHandle2ConstArray array, + ConstHandle2ConstParameters parameters +) { + ConstHandle2ParameterCovarianceMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + type, + detail::tocpp(array), + detail::tocpp(parameters) + ); + return handle; +} + +// Create, general, non-const +Handle2ParameterCovarianceMatrix +ParameterCovarianceMatrixCreate( + const char *const label, + const char *const type, + ConstHandle2ConstArray array, + ConstHandle2ConstParameters parameters +) { + ConstHandle2ParameterCovarianceMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + type, + detail::tocpp(array), + detail::tocpp(parameters) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ParameterCovarianceMatrixAssign(ConstHandle2ParameterCovarianceMatrix self, ConstHandle2ConstParameterCovarianceMatrix from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ParameterCovarianceMatrixDelete(ConstHandle2ConstParameterCovarianceMatrix self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ParameterCovarianceMatrixRead(ConstHandle2ParameterCovarianceMatrix self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ParameterCovarianceMatrixWrite(ConstHandle2ConstParameterCovarianceMatrix self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ParameterCovarianceMatrixPrint(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ParameterCovarianceMatrixPrintXML(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ParameterCovarianceMatrixPrintJSON(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ParameterCovarianceMatrixLabelHas(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ParameterCovarianceMatrixLabelGet(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ParameterCovarianceMatrixLabelSet(ConstHandle2ParameterCovarianceMatrix self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// Has +int +ParameterCovarianceMatrixTypeHas(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TypeHas", self, extract::type); +} + +// Get +// Returns by value +const char * +ParameterCovarianceMatrixTypeGet(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypeGet", self, extract::type); +} + +// Set +void +ParameterCovarianceMatrixTypeSet(ConstHandle2ParameterCovarianceMatrix self, const char *const type) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypeSet", self, extract::type, type); +} + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// Has +int +ParameterCovarianceMatrixArrayHas(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ArrayHas", self, extract::array); +} + +// Get, const +Handle2ConstArray +ParameterCovarianceMatrixArrayGetConst(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGetConst", self, extract::array); +} + +// Get, non-const +Handle2Array +ParameterCovarianceMatrixArrayGet(ConstHandle2ParameterCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ArrayGet", self, extract::array); +} + +// Set +void +ParameterCovarianceMatrixArraySet(ConstHandle2ParameterCovarianceMatrix self, ConstHandle2ConstArray array) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ArraySet", self, extract::array, array); +} + + +// ----------------------------------------------------------------------------- +// Child: parameters +// ----------------------------------------------------------------------------- + +// Has +int +ParameterCovarianceMatrixParametersHas(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ParametersHas", self, extract::parameters); +} + +// Get, const +Handle2ConstParameters +ParameterCovarianceMatrixParametersGetConst(ConstHandle2ConstParameterCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParametersGetConst", self, extract::parameters); +} + +// Get, non-const +Handle2Parameters +ParameterCovarianceMatrixParametersGet(ConstHandle2ParameterCovarianceMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParametersGet", self, extract::parameters); +} + +// Set +void +ParameterCovarianceMatrixParametersSet(ConstHandle2ParameterCovarianceMatrix self, ConstHandle2ConstParameters parameters) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ParametersSet", self, extract::parameters, parameters); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ParameterCovarianceMatrix/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovarianceMatrix.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovarianceMatrix.h new file mode 100644 index 000000000..12fe5e5fd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovarianceMatrix.h @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ParameterCovarianceMatrix is the basic handle type in this file. Example: +// // Create a default ParameterCovarianceMatrix object: +// ParameterCovarianceMatrix handle = ParameterCovarianceMatrixDefault(); +// Functions involving ParameterCovarianceMatrix are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PARAMETERCOVARIANCEMATRIX +#define C_INTERFACE_GNDS_V2_0_GENERAL_PARAMETERCOVARIANCEMATRIX + +#include "GNDStk.h" +#include "v2.0/g3d/Array.h" +#include "v2.0/general/Parameters.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ParameterCovarianceMatrixClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ParameterCovarianceMatrix +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ParameterCovarianceMatrixClass *ParameterCovarianceMatrix; + +// --- Const-aware handles. +typedef const struct ParameterCovarianceMatrixClass *const ConstHandle2ConstParameterCovarianceMatrix; +typedef struct ParameterCovarianceMatrixClass *const ConstHandle2ParameterCovarianceMatrix; +typedef const struct ParameterCovarianceMatrixClass * Handle2ConstParameterCovarianceMatrix; +typedef struct ParameterCovarianceMatrixClass * Handle2ParameterCovarianceMatrix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstParameterCovarianceMatrix +ParameterCovarianceMatrixDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ParameterCovarianceMatrix +ParameterCovarianceMatrixDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameterCovarianceMatrix +ParameterCovarianceMatrixCreateConst( + const char *const label, + const char *const type, + ConstHandle2ConstArray array, + ConstHandle2ConstParameters parameters +); + +// +++ Create, general, non-const +extern_c Handle2ParameterCovarianceMatrix +ParameterCovarianceMatrixCreate( + const char *const label, + const char *const type, + ConstHandle2ConstArray array, + ConstHandle2ConstParameters parameters +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ParameterCovarianceMatrixAssign(ConstHandle2ParameterCovarianceMatrix self, ConstHandle2ConstParameterCovarianceMatrix from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ParameterCovarianceMatrixDelete(ConstHandle2ConstParameterCovarianceMatrix self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ParameterCovarianceMatrixRead(ConstHandle2ParameterCovarianceMatrix self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ParameterCovarianceMatrixWrite(ConstHandle2ConstParameterCovarianceMatrix self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ParameterCovarianceMatrixPrint(ConstHandle2ConstParameterCovarianceMatrix self); + +// +++ Print to standard output, as XML +extern_c int +ParameterCovarianceMatrixPrintXML(ConstHandle2ConstParameterCovarianceMatrix self); + +// +++ Print to standard output, as JSON +extern_c int +ParameterCovarianceMatrixPrintJSON(ConstHandle2ConstParameterCovarianceMatrix self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterCovarianceMatrixLabelHas(ConstHandle2ConstParameterCovarianceMatrix self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ParameterCovarianceMatrixLabelGet(ConstHandle2ConstParameterCovarianceMatrix self); + +// +++ Set +extern_c void +ParameterCovarianceMatrixLabelSet(ConstHandle2ParameterCovarianceMatrix self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterCovarianceMatrixTypeHas(ConstHandle2ConstParameterCovarianceMatrix self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ParameterCovarianceMatrixTypeGet(ConstHandle2ConstParameterCovarianceMatrix self); + +// +++ Set +extern_c void +ParameterCovarianceMatrixTypeSet(ConstHandle2ParameterCovarianceMatrix self, const char *const type); + + +// ----------------------------------------------------------------------------- +// Child: array +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterCovarianceMatrixArrayHas(ConstHandle2ConstParameterCovarianceMatrix self); + +// --- Get, const +extern_c Handle2ConstArray +ParameterCovarianceMatrixArrayGetConst(ConstHandle2ConstParameterCovarianceMatrix self); + +// +++ Get, non-const +extern_c Handle2Array +ParameterCovarianceMatrixArrayGet(ConstHandle2ParameterCovarianceMatrix self); + +// +++ Set +extern_c void +ParameterCovarianceMatrixArraySet(ConstHandle2ParameterCovarianceMatrix self, ConstHandle2ConstArray array); + + +// ----------------------------------------------------------------------------- +// Child: parameters +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterCovarianceMatrixParametersHas(ConstHandle2ConstParameterCovarianceMatrix self); + +// --- Get, const +extern_c Handle2ConstParameters +ParameterCovarianceMatrixParametersGetConst(ConstHandle2ConstParameterCovarianceMatrix self); + +// +++ Get, non-const +extern_c Handle2Parameters +ParameterCovarianceMatrixParametersGet(ConstHandle2ParameterCovarianceMatrix self); + +// +++ Set +extern_c void +ParameterCovarianceMatrixParametersSet(ConstHandle2ParameterCovarianceMatrix self, ConstHandle2ConstParameters parameters); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ParameterCovarianceMatrix/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovarianceMatrix/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovarianceMatrix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovarianceMatrix/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovarianceMatrix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariances.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariances.cpp new file mode 100644 index 000000000..f443addf5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariances.cpp @@ -0,0 +1,433 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ParameterCovariances.hpp" +#include "ParameterCovariances.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ParameterCovariancesClass; +using CPP = multigroup::ParameterCovariances; + +static const std::string CLASSNAME = "ParameterCovariances"; + +namespace extract { + static auto parameterCovariance = [](auto &obj) { return &obj.parameterCovariance; }; + static auto averageParameterCovariance = [](auto &obj) { return &obj.averageParameterCovariance; }; +} + +using CPPParameterCovariance = general::ParameterCovariance; +using CPPAverageParameterCovariance = general::AverageParameterCovariance; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParameterCovariances +ParameterCovariancesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ParameterCovariances +ParameterCovariancesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstParameterCovariances +ParameterCovariancesCreateConst( + ConstHandle2ParameterCovariance *const parameterCovariance, const size_t parameterCovarianceSize, + ConstHandle2AverageParameterCovariance *const averageParameterCovariance, const size_t averageParameterCovarianceSize +) { + ConstHandle2ParameterCovariances handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{}, + std::vector{} + ); + for (size_t ParameterCovarianceN = 0; ParameterCovarianceN < parameterCovarianceSize; ++ParameterCovarianceN) + ParameterCovariancesParameterCovarianceAdd(handle, parameterCovariance[ParameterCovarianceN]); + for (size_t AverageParameterCovarianceN = 0; AverageParameterCovarianceN < averageParameterCovarianceSize; ++AverageParameterCovarianceN) + ParameterCovariancesAverageParameterCovarianceAdd(handle, averageParameterCovariance[AverageParameterCovarianceN]); + return handle; +} + +// Create, general, non-const +Handle2ParameterCovariances +ParameterCovariancesCreate( + ConstHandle2ParameterCovariance *const parameterCovariance, const size_t parameterCovarianceSize, + ConstHandle2AverageParameterCovariance *const averageParameterCovariance, const size_t averageParameterCovarianceSize +) { + ConstHandle2ParameterCovariances handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{}, + std::vector{} + ); + for (size_t ParameterCovarianceN = 0; ParameterCovarianceN < parameterCovarianceSize; ++ParameterCovarianceN) + ParameterCovariancesParameterCovarianceAdd(handle, parameterCovariance[ParameterCovarianceN]); + for (size_t AverageParameterCovarianceN = 0; AverageParameterCovarianceN < averageParameterCovarianceSize; ++AverageParameterCovarianceN) + ParameterCovariancesAverageParameterCovarianceAdd(handle, averageParameterCovariance[AverageParameterCovarianceN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ParameterCovariancesAssign(ConstHandle2ParameterCovariances self, ConstHandle2ConstParameterCovariances from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ParameterCovariancesDelete(ConstHandle2ConstParameterCovariances self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ParameterCovariancesRead(ConstHandle2ParameterCovariances self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ParameterCovariancesWrite(ConstHandle2ConstParameterCovariances self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ParameterCovariancesPrint(ConstHandle2ConstParameterCovariances self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ParameterCovariancesPrintXML(ConstHandle2ConstParameterCovariances self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ParameterCovariancesPrintJSON(ConstHandle2ConstParameterCovariances self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: parameterCovariance +// ----------------------------------------------------------------------------- + +// Has +int +ParameterCovariancesParameterCovarianceHas(ConstHandle2ConstParameterCovariances self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ParameterCovarianceHas", self, extract::parameterCovariance); +} + +// Clear +void +ParameterCovariancesParameterCovarianceClear(ConstHandle2ParameterCovariances self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ParameterCovarianceClear", self, extract::parameterCovariance); +} + +// Size +size_t +ParameterCovariancesParameterCovarianceSize(ConstHandle2ConstParameterCovariances self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ParameterCovarianceSize", self, extract::parameterCovariance); +} + +// Add +void +ParameterCovariancesParameterCovarianceAdd(ConstHandle2ParameterCovariances self, ConstHandle2ConstParameterCovariance parameterCovariance) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ParameterCovarianceAdd", self, extract::parameterCovariance, parameterCovariance); +} + +// Get, by index \in [0,size), const +Handle2ConstParameterCovariance +ParameterCovariancesParameterCovarianceGetConst(ConstHandle2ConstParameterCovariances self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ParameterCovarianceGetConst", self, extract::parameterCovariance, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ParameterCovariance +ParameterCovariancesParameterCovarianceGet(ConstHandle2ParameterCovariances self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ParameterCovarianceGet", self, extract::parameterCovariance, index_); +} + +// Set, by index \in [0,size) +void +ParameterCovariancesParameterCovarianceSet( + ConstHandle2ParameterCovariances self, + const size_t index_, + ConstHandle2ConstParameterCovariance parameterCovariance +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ParameterCovarianceSet", self, extract::parameterCovariance, index_, parameterCovariance); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ParameterCovariancesParameterCovarianceHasByLabel( + ConstHandle2ConstParameterCovariances self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceHasByLabel", + self, extract::parameterCovariance, meta::label, label); +} + +// Get, by label, const +Handle2ConstParameterCovariance +ParameterCovariancesParameterCovarianceGetByLabelConst( + ConstHandle2ConstParameterCovariances self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceGetByLabelConst", + self, extract::parameterCovariance, meta::label, label); +} + +// Get, by label, non-const +Handle2ParameterCovariance +ParameterCovariancesParameterCovarianceGetByLabel( + ConstHandle2ParameterCovariances self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceGetByLabel", + self, extract::parameterCovariance, meta::label, label); +} + +// Set, by label +void +ParameterCovariancesParameterCovarianceSetByLabel( + ConstHandle2ParameterCovariances self, + const char *const label, + ConstHandle2ConstParameterCovariance parameterCovariance +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterCovarianceSetByLabel", + self, extract::parameterCovariance, meta::label, label, parameterCovariance); +} + + +// ----------------------------------------------------------------------------- +// Child: averageParameterCovariance +// ----------------------------------------------------------------------------- + +// Has +int +ParameterCovariancesAverageParameterCovarianceHas(ConstHandle2ConstParameterCovariances self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceHas", self, extract::averageParameterCovariance); +} + +// Clear +void +ParameterCovariancesAverageParameterCovarianceClear(ConstHandle2ParameterCovariances self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceClear", self, extract::averageParameterCovariance); +} + +// Size +size_t +ParameterCovariancesAverageParameterCovarianceSize(ConstHandle2ConstParameterCovariances self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceSize", self, extract::averageParameterCovariance); +} + +// Add +void +ParameterCovariancesAverageParameterCovarianceAdd(ConstHandle2ParameterCovariances self, ConstHandle2ConstAverageParameterCovariance averageParameterCovariance) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceAdd", self, extract::averageParameterCovariance, averageParameterCovariance); +} + +// Get, by index \in [0,size), const +Handle2ConstAverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetConst(ConstHandle2ConstParameterCovariances self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceGetConst", self, extract::averageParameterCovariance, index_); +} + +// Get, by index \in [0,size), non-const +Handle2AverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGet(ConstHandle2ParameterCovariances self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceGet", self, extract::averageParameterCovariance, index_); +} + +// Set, by index \in [0,size) +void +ParameterCovariancesAverageParameterCovarianceSet( + ConstHandle2ParameterCovariances self, + const size_t index_, + ConstHandle2ConstAverageParameterCovariance averageParameterCovariance +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceSet", self, extract::averageParameterCovariance, index_, averageParameterCovariance); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ParameterCovariancesAverageParameterCovarianceHasByLabel( + ConstHandle2ConstParameterCovariances self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceHasByLabel", + self, extract::averageParameterCovariance, meta::label, label); +} + +// Get, by label, const +Handle2ConstAverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByLabelConst( + ConstHandle2ConstParameterCovariances self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceGetByLabelConst", + self, extract::averageParameterCovariance, meta::label, label); +} + +// Get, by label, non-const +Handle2AverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByLabel( + ConstHandle2ParameterCovariances self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceGetByLabel", + self, extract::averageParameterCovariance, meta::label, label); +} + +// Set, by label +void +ParameterCovariancesAverageParameterCovarianceSetByLabel( + ConstHandle2ParameterCovariances self, + const char *const label, + ConstHandle2ConstAverageParameterCovariance averageParameterCovariance +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceSetByLabel", + self, extract::averageParameterCovariance, meta::label, label, averageParameterCovariance); +} + +// ------------------------ +// Re: metadatum crossTerm +// ------------------------ + +// Has, by crossTerm +int +ParameterCovariancesAverageParameterCovarianceHasByCrossTerm( + ConstHandle2ConstParameterCovariances self, + const bool crossTerm +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceHasByCrossTerm", + self, extract::averageParameterCovariance, meta::crossTerm, crossTerm); +} + +// Get, by crossTerm, const +Handle2ConstAverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByCrossTermConst( + ConstHandle2ConstParameterCovariances self, + const bool crossTerm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceGetByCrossTermConst", + self, extract::averageParameterCovariance, meta::crossTerm, crossTerm); +} + +// Get, by crossTerm, non-const +Handle2AverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByCrossTerm( + ConstHandle2ParameterCovariances self, + const bool crossTerm +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceGetByCrossTerm", + self, extract::averageParameterCovariance, meta::crossTerm, crossTerm); +} + +// Set, by crossTerm +void +ParameterCovariancesAverageParameterCovarianceSetByCrossTerm( + ConstHandle2ParameterCovariances self, + const bool crossTerm, + ConstHandle2ConstAverageParameterCovariance averageParameterCovariance +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AverageParameterCovarianceSetByCrossTerm", + self, extract::averageParameterCovariance, meta::crossTerm, crossTerm, averageParameterCovariance); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ParameterCovariances/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariances.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariances.h new file mode 100644 index 000000000..a0a7a8e9b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariances.h @@ -0,0 +1,316 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ParameterCovariances is the basic handle type in this file. Example: +// // Create a default ParameterCovariances object: +// ParameterCovariances handle = ParameterCovariancesDefault(); +// Functions involving ParameterCovariances are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PARAMETERCOVARIANCES +#define C_INTERFACE_GNDS_V2_0_GENERAL_PARAMETERCOVARIANCES + +#include "GNDStk.h" +#include "v2.0/general/ParameterCovariance.h" +#include "v2.0/general/AverageParameterCovariance.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ParameterCovariancesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ParameterCovariances +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ParameterCovariancesClass *ParameterCovariances; + +// --- Const-aware handles. +typedef const struct ParameterCovariancesClass *const ConstHandle2ConstParameterCovariances; +typedef struct ParameterCovariancesClass *const ConstHandle2ParameterCovariances; +typedef const struct ParameterCovariancesClass * Handle2ConstParameterCovariances; +typedef struct ParameterCovariancesClass * Handle2ParameterCovariances; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstParameterCovariances +ParameterCovariancesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ParameterCovariances +ParameterCovariancesDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameterCovariances +ParameterCovariancesCreateConst( + ConstHandle2ParameterCovariance *const parameterCovariance, const size_t parameterCovarianceSize, + ConstHandle2AverageParameterCovariance *const averageParameterCovariance, const size_t averageParameterCovarianceSize +); + +// +++ Create, general, non-const +extern_c Handle2ParameterCovariances +ParameterCovariancesCreate( + ConstHandle2ParameterCovariance *const parameterCovariance, const size_t parameterCovarianceSize, + ConstHandle2AverageParameterCovariance *const averageParameterCovariance, const size_t averageParameterCovarianceSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ParameterCovariancesAssign(ConstHandle2ParameterCovariances self, ConstHandle2ConstParameterCovariances from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ParameterCovariancesDelete(ConstHandle2ConstParameterCovariances self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ParameterCovariancesRead(ConstHandle2ParameterCovariances self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ParameterCovariancesWrite(ConstHandle2ConstParameterCovariances self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ParameterCovariancesPrint(ConstHandle2ConstParameterCovariances self); + +// +++ Print to standard output, as XML +extern_c int +ParameterCovariancesPrintXML(ConstHandle2ConstParameterCovariances self); + +// +++ Print to standard output, as JSON +extern_c int +ParameterCovariancesPrintJSON(ConstHandle2ConstParameterCovariances self); + + +// ----------------------------------------------------------------------------- +// Child: parameterCovariance +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterCovariancesParameterCovarianceHas(ConstHandle2ConstParameterCovariances self); + +// +++ Clear +extern_c void +ParameterCovariancesParameterCovarianceClear(ConstHandle2ParameterCovariances self); + +// +++ Size +extern_c size_t +ParameterCovariancesParameterCovarianceSize(ConstHandle2ConstParameterCovariances self); + +// +++ Add +extern_c void +ParameterCovariancesParameterCovarianceAdd(ConstHandle2ParameterCovariances self, ConstHandle2ConstParameterCovariance parameterCovariance); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstParameterCovariance +ParameterCovariancesParameterCovarianceGetConst(ConstHandle2ConstParameterCovariances self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ParameterCovariance +ParameterCovariancesParameterCovarianceGet(ConstHandle2ParameterCovariances self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ParameterCovariancesParameterCovarianceSet( + ConstHandle2ParameterCovariances self, + const size_t index_, + ConstHandle2ConstParameterCovariance parameterCovariance +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ParameterCovariancesParameterCovarianceHasByLabel( + ConstHandle2ConstParameterCovariances self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstParameterCovariance +ParameterCovariancesParameterCovarianceGetByLabelConst( + ConstHandle2ConstParameterCovariances self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2ParameterCovariance +ParameterCovariancesParameterCovarianceGetByLabel( + ConstHandle2ParameterCovariances self, + const char *const label +); + +// +++ Set, by label +extern_c void +ParameterCovariancesParameterCovarianceSetByLabel( + ConstHandle2ParameterCovariances self, + const char *const label, + ConstHandle2ConstParameterCovariance parameterCovariance +); + + +// ----------------------------------------------------------------------------- +// Child: averageParameterCovariance +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterCovariancesAverageParameterCovarianceHas(ConstHandle2ConstParameterCovariances self); + +// +++ Clear +extern_c void +ParameterCovariancesAverageParameterCovarianceClear(ConstHandle2ParameterCovariances self); + +// +++ Size +extern_c size_t +ParameterCovariancesAverageParameterCovarianceSize(ConstHandle2ConstParameterCovariances self); + +// +++ Add +extern_c void +ParameterCovariancesAverageParameterCovarianceAdd(ConstHandle2ParameterCovariances self, ConstHandle2ConstAverageParameterCovariance averageParameterCovariance); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstAverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetConst(ConstHandle2ConstParameterCovariances self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2AverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGet(ConstHandle2ParameterCovariances self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ParameterCovariancesAverageParameterCovarianceSet( + ConstHandle2ParameterCovariances self, + const size_t index_, + ConstHandle2ConstAverageParameterCovariance averageParameterCovariance +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ParameterCovariancesAverageParameterCovarianceHasByLabel( + ConstHandle2ConstParameterCovariances self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstAverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByLabelConst( + ConstHandle2ConstParameterCovariances self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2AverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByLabel( + ConstHandle2ParameterCovariances self, + const char *const label +); + +// +++ Set, by label +extern_c void +ParameterCovariancesAverageParameterCovarianceSetByLabel( + ConstHandle2ParameterCovariances self, + const char *const label, + ConstHandle2ConstAverageParameterCovariance averageParameterCovariance +); + +// ------------------------ +// Re: metadatum crossTerm +// ------------------------ + +// +++ Has, by crossTerm +extern_c int +ParameterCovariancesAverageParameterCovarianceHasByCrossTerm( + ConstHandle2ConstParameterCovariances self, + const bool crossTerm +); + +// --- Get, by crossTerm, const +extern_c Handle2ConstAverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByCrossTermConst( + ConstHandle2ConstParameterCovariances self, + const bool crossTerm +); + +// +++ Get, by crossTerm, non-const +extern_c Handle2AverageParameterCovariance +ParameterCovariancesAverageParameterCovarianceGetByCrossTerm( + ConstHandle2ParameterCovariances self, + const bool crossTerm +); + +// +++ Set, by crossTerm +extern_c void +ParameterCovariancesAverageParameterCovarianceSetByCrossTerm( + ConstHandle2ParameterCovariances self, + const bool crossTerm, + ConstHandle2ConstAverageParameterCovariance averageParameterCovariance +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ParameterCovariances/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariances/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariances/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariances/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterCovariances/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterLink.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterLink.cpp new file mode 100644 index 000000000..a53d272ce --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterLink.cpp @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ParameterLink.hpp" +#include "ParameterLink.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ParameterLinkClass; +using CPP = multigroup::ParameterLink; + +static const std::string CLASSNAME = "ParameterLink"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto href = [](auto &obj) { return &obj.href; }; + static auto nParameters = [](auto &obj) { return &obj.nParameters; }; + static auto matrixStartIndex = [](auto &obj) { return &obj.matrixStartIndex; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParameterLink +ParameterLinkDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ParameterLink +ParameterLinkDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstParameterLink +ParameterLinkCreateConst( + const char *const label, + const char *const href, + const int nParameters, + const int matrixStartIndex +) { + ConstHandle2ParameterLink handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href, + nParameters, + matrixStartIndex + ); + return handle; +} + +// Create, general, non-const +Handle2ParameterLink +ParameterLinkCreate( + const char *const label, + const char *const href, + const int nParameters, + const int matrixStartIndex +) { + ConstHandle2ParameterLink handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + href, + nParameters, + matrixStartIndex + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ParameterLinkAssign(ConstHandle2ParameterLink self, ConstHandle2ConstParameterLink from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ParameterLinkDelete(ConstHandle2ConstParameterLink self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ParameterLinkRead(ConstHandle2ParameterLink self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ParameterLinkWrite(ConstHandle2ConstParameterLink self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ParameterLinkPrint(ConstHandle2ConstParameterLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ParameterLinkPrintXML(ConstHandle2ConstParameterLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ParameterLinkPrintJSON(ConstHandle2ConstParameterLink self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ParameterLinkLabelHas(ConstHandle2ConstParameterLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ParameterLinkLabelGet(ConstHandle2ConstParameterLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ParameterLinkLabelSet(ConstHandle2ParameterLink self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +ParameterLinkHrefHas(ConstHandle2ConstParameterLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +ParameterLinkHrefGet(ConstHandle2ConstParameterLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ParameterLinkHrefSet(ConstHandle2ParameterLink self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: nParameters +// ----------------------------------------------------------------------------- + +// Has +int +ParameterLinkNParametersHas(ConstHandle2ConstParameterLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NParametersHas", self, extract::nParameters); +} + +// Get +// Returns by value +int +ParameterLinkNParametersGet(ConstHandle2ConstParameterLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NParametersGet", self, extract::nParameters); +} + +// Set +void +ParameterLinkNParametersSet(ConstHandle2ParameterLink self, const int nParameters) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NParametersSet", self, extract::nParameters, nParameters); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: matrixStartIndex +// ----------------------------------------------------------------------------- + +// Has +int +ParameterLinkMatrixStartIndexHas(ConstHandle2ConstParameterLink self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MatrixStartIndexHas", self, extract::matrixStartIndex); +} + +// Get +// Returns by value +int +ParameterLinkMatrixStartIndexGet(ConstHandle2ConstParameterLink self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MatrixStartIndexGet", self, extract::matrixStartIndex); +} + +// Set +void +ParameterLinkMatrixStartIndexSet(ConstHandle2ParameterLink self, const int matrixStartIndex) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MatrixStartIndexSet", self, extract::matrixStartIndex, matrixStartIndex); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ParameterLink/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterLink.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterLink.h new file mode 100644 index 000000000..a659a3af4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterLink.h @@ -0,0 +1,217 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ParameterLink is the basic handle type in this file. Example: +// // Create a default ParameterLink object: +// ParameterLink handle = ParameterLinkDefault(); +// Functions involving ParameterLink are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PARAMETERLINK +#define C_INTERFACE_GNDS_V2_0_GENERAL_PARAMETERLINK + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ParameterLinkClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ParameterLink +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ParameterLinkClass *ParameterLink; + +// --- Const-aware handles. +typedef const struct ParameterLinkClass *const ConstHandle2ConstParameterLink; +typedef struct ParameterLinkClass *const ConstHandle2ParameterLink; +typedef const struct ParameterLinkClass * Handle2ConstParameterLink; +typedef struct ParameterLinkClass * Handle2ParameterLink; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstParameterLink +ParameterLinkDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ParameterLink +ParameterLinkDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameterLink +ParameterLinkCreateConst( + const char *const label, + const char *const href, + const int nParameters, + const int matrixStartIndex +); + +// +++ Create, general, non-const +extern_c Handle2ParameterLink +ParameterLinkCreate( + const char *const label, + const char *const href, + const int nParameters, + const int matrixStartIndex +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ParameterLinkAssign(ConstHandle2ParameterLink self, ConstHandle2ConstParameterLink from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ParameterLinkDelete(ConstHandle2ConstParameterLink self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ParameterLinkRead(ConstHandle2ParameterLink self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ParameterLinkWrite(ConstHandle2ConstParameterLink self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ParameterLinkPrint(ConstHandle2ConstParameterLink self); + +// +++ Print to standard output, as XML +extern_c int +ParameterLinkPrintXML(ConstHandle2ConstParameterLink self); + +// +++ Print to standard output, as JSON +extern_c int +ParameterLinkPrintJSON(ConstHandle2ConstParameterLink self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterLinkLabelHas(ConstHandle2ConstParameterLink self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ParameterLinkLabelGet(ConstHandle2ConstParameterLink self); + +// +++ Set +extern_c void +ParameterLinkLabelSet(ConstHandle2ParameterLink self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterLinkHrefHas(ConstHandle2ConstParameterLink self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ParameterLinkHrefGet(ConstHandle2ConstParameterLink self); + +// +++ Set +extern_c void +ParameterLinkHrefSet(ConstHandle2ParameterLink self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Metadatum: nParameters +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterLinkNParametersHas(ConstHandle2ConstParameterLink self); + +// +++ Get +// +++ Returns by value +extern_c int +ParameterLinkNParametersGet(ConstHandle2ConstParameterLink self); + +// +++ Set +extern_c void +ParameterLinkNParametersSet(ConstHandle2ParameterLink self, const int nParameters); + + +// ----------------------------------------------------------------------------- +// Metadatum: matrixStartIndex +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParameterLinkMatrixStartIndexHas(ConstHandle2ConstParameterLink self); + +// +++ Get +// +++ Returns by value +extern_c int +ParameterLinkMatrixStartIndexGet(ConstHandle2ConstParameterLink self); + +// +++ Set +extern_c void +ParameterLinkMatrixStartIndexSet(ConstHandle2ParameterLink self, const int matrixStartIndex); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ParameterLink/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterLink/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterLink/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterLink/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ParameterLink/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parameters.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parameters.cpp new file mode 100644 index 000000000..637adfd35 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parameters.cpp @@ -0,0 +1,408 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Parameters.hpp" +#include "Parameters.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ParametersClass; +using CPP = multigroup::Parameters; + +static const std::string CLASSNAME = "Parameters"; + +namespace extract { + static auto parameterLink = [](auto &obj) { return &obj.parameterLink; }; +} + +using CPPParameterLink = general::ParameterLink; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParameters +ParametersDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Parameters +ParametersDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstParameters +ParametersCreateConst( + ConstHandle2ParameterLink *const parameterLink, const size_t parameterLinkSize +) { + ConstHandle2Parameters handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ParameterLinkN = 0; ParameterLinkN < parameterLinkSize; ++ParameterLinkN) + ParametersParameterLinkAdd(handle, parameterLink[ParameterLinkN]); + return handle; +} + +// Create, general, non-const +Handle2Parameters +ParametersCreate( + ConstHandle2ParameterLink *const parameterLink, const size_t parameterLinkSize +) { + ConstHandle2Parameters handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ParameterLinkN = 0; ParameterLinkN < parameterLinkSize; ++ParameterLinkN) + ParametersParameterLinkAdd(handle, parameterLink[ParameterLinkN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ParametersAssign(ConstHandle2Parameters self, ConstHandle2ConstParameters from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ParametersDelete(ConstHandle2ConstParameters self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ParametersRead(ConstHandle2Parameters self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ParametersWrite(ConstHandle2ConstParameters self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ParametersPrint(ConstHandle2ConstParameters self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ParametersPrintXML(ConstHandle2ConstParameters self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ParametersPrintJSON(ConstHandle2ConstParameters self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: parameterLink +// ----------------------------------------------------------------------------- + +// Has +int +ParametersParameterLinkHas(ConstHandle2ConstParameters self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ParameterLinkHas", self, extract::parameterLink); +} + +// Clear +void +ParametersParameterLinkClear(ConstHandle2Parameters self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ParameterLinkClear", self, extract::parameterLink); +} + +// Size +size_t +ParametersParameterLinkSize(ConstHandle2ConstParameters self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ParameterLinkSize", self, extract::parameterLink); +} + +// Add +void +ParametersParameterLinkAdd(ConstHandle2Parameters self, ConstHandle2ConstParameterLink parameterLink) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ParameterLinkAdd", self, extract::parameterLink, parameterLink); +} + +// Get, by index \in [0,size), const +Handle2ConstParameterLink +ParametersParameterLinkGetConst(ConstHandle2ConstParameters self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ParameterLinkGetConst", self, extract::parameterLink, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ParameterLink +ParametersParameterLinkGet(ConstHandle2Parameters self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ParameterLinkGet", self, extract::parameterLink, index_); +} + +// Set, by index \in [0,size) +void +ParametersParameterLinkSet( + ConstHandle2Parameters self, + const size_t index_, + ConstHandle2ConstParameterLink parameterLink +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ParameterLinkSet", self, extract::parameterLink, index_, parameterLink); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ParametersParameterLinkHasByLabel( + ConstHandle2ConstParameters self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkHasByLabel", + self, extract::parameterLink, meta::label, label); +} + +// Get, by label, const +Handle2ConstParameterLink +ParametersParameterLinkGetByLabelConst( + ConstHandle2ConstParameters self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByLabelConst", + self, extract::parameterLink, meta::label, label); +} + +// Get, by label, non-const +Handle2ParameterLink +ParametersParameterLinkGetByLabel( + ConstHandle2Parameters self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByLabel", + self, extract::parameterLink, meta::label, label); +} + +// Set, by label +void +ParametersParameterLinkSetByLabel( + ConstHandle2Parameters self, + const char *const label, + ConstHandle2ConstParameterLink parameterLink +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkSetByLabel", + self, extract::parameterLink, meta::label, label, parameterLink); +} + +// ------------------------ +// Re: metadatum href +// ------------------------ + +// Has, by href +int +ParametersParameterLinkHasByHref( + ConstHandle2ConstParameters self, + const char *const href +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkHasByHref", + self, extract::parameterLink, meta::href, href); +} + +// Get, by href, const +Handle2ConstParameterLink +ParametersParameterLinkGetByHrefConst( + ConstHandle2ConstParameters self, + const char *const href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByHrefConst", + self, extract::parameterLink, meta::href, href); +} + +// Get, by href, non-const +Handle2ParameterLink +ParametersParameterLinkGetByHref( + ConstHandle2Parameters self, + const char *const href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByHref", + self, extract::parameterLink, meta::href, href); +} + +// Set, by href +void +ParametersParameterLinkSetByHref( + ConstHandle2Parameters self, + const char *const href, + ConstHandle2ConstParameterLink parameterLink +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkSetByHref", + self, extract::parameterLink, meta::href, href, parameterLink); +} + +// ------------------------ +// Re: metadatum nParameters +// ------------------------ + +// Has, by nParameters +int +ParametersParameterLinkHasByNParameters( + ConstHandle2ConstParameters self, + const int nParameters +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkHasByNParameters", + self, extract::parameterLink, meta::nParameters, nParameters); +} + +// Get, by nParameters, const +Handle2ConstParameterLink +ParametersParameterLinkGetByNParametersConst( + ConstHandle2ConstParameters self, + const int nParameters +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByNParametersConst", + self, extract::parameterLink, meta::nParameters, nParameters); +} + +// Get, by nParameters, non-const +Handle2ParameterLink +ParametersParameterLinkGetByNParameters( + ConstHandle2Parameters self, + const int nParameters +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByNParameters", + self, extract::parameterLink, meta::nParameters, nParameters); +} + +// Set, by nParameters +void +ParametersParameterLinkSetByNParameters( + ConstHandle2Parameters self, + const int nParameters, + ConstHandle2ConstParameterLink parameterLink +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkSetByNParameters", + self, extract::parameterLink, meta::nParameters, nParameters, parameterLink); +} + +// ------------------------ +// Re: metadatum matrixStartIndex +// ------------------------ + +// Has, by matrixStartIndex +int +ParametersParameterLinkHasByMatrixStartIndex( + ConstHandle2ConstParameters self, + const int matrixStartIndex +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkHasByMatrixStartIndex", + self, extract::parameterLink, meta::matrixStartIndex, matrixStartIndex); +} + +// Get, by matrixStartIndex, const +Handle2ConstParameterLink +ParametersParameterLinkGetByMatrixStartIndexConst( + ConstHandle2ConstParameters self, + const int matrixStartIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByMatrixStartIndexConst", + self, extract::parameterLink, meta::matrixStartIndex, matrixStartIndex); +} + +// Get, by matrixStartIndex, non-const +Handle2ParameterLink +ParametersParameterLinkGetByMatrixStartIndex( + ConstHandle2Parameters self, + const int matrixStartIndex +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkGetByMatrixStartIndex", + self, extract::parameterLink, meta::matrixStartIndex, matrixStartIndex); +} + +// Set, by matrixStartIndex +void +ParametersParameterLinkSetByMatrixStartIndex( + ConstHandle2Parameters self, + const int matrixStartIndex, + ConstHandle2ConstParameterLink parameterLink +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ParameterLinkSetByMatrixStartIndex", + self, extract::parameterLink, meta::matrixStartIndex, matrixStartIndex, parameterLink); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Parameters/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parameters.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parameters.h new file mode 100644 index 000000000..f007dc3a6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parameters.h @@ -0,0 +1,309 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Parameters is the basic handle type in this file. Example: +// // Create a default Parameters object: +// Parameters handle = ParametersDefault(); +// Functions involving Parameters are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PARAMETERS +#define C_INTERFACE_GNDS_V2_0_GENERAL_PARAMETERS + +#include "GNDStk.h" +#include "v2.0/general/ParameterLink.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ParametersClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Parameters +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ParametersClass *Parameters; + +// --- Const-aware handles. +typedef const struct ParametersClass *const ConstHandle2ConstParameters; +typedef struct ParametersClass *const ConstHandle2Parameters; +typedef const struct ParametersClass * Handle2ConstParameters; +typedef struct ParametersClass * Handle2Parameters; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstParameters +ParametersDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Parameters +ParametersDefault(); + +// --- Create, general, const +extern_c Handle2ConstParameters +ParametersCreateConst( + ConstHandle2ParameterLink *const parameterLink, const size_t parameterLinkSize +); + +// +++ Create, general, non-const +extern_c Handle2Parameters +ParametersCreate( + ConstHandle2ParameterLink *const parameterLink, const size_t parameterLinkSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ParametersAssign(ConstHandle2Parameters self, ConstHandle2ConstParameters from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ParametersDelete(ConstHandle2ConstParameters self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ParametersRead(ConstHandle2Parameters self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ParametersWrite(ConstHandle2ConstParameters self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ParametersPrint(ConstHandle2ConstParameters self); + +// +++ Print to standard output, as XML +extern_c int +ParametersPrintXML(ConstHandle2ConstParameters self); + +// +++ Print to standard output, as JSON +extern_c int +ParametersPrintJSON(ConstHandle2ConstParameters self); + + +// ----------------------------------------------------------------------------- +// Child: parameterLink +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParametersParameterLinkHas(ConstHandle2ConstParameters self); + +// +++ Clear +extern_c void +ParametersParameterLinkClear(ConstHandle2Parameters self); + +// +++ Size +extern_c size_t +ParametersParameterLinkSize(ConstHandle2ConstParameters self); + +// +++ Add +extern_c void +ParametersParameterLinkAdd(ConstHandle2Parameters self, ConstHandle2ConstParameterLink parameterLink); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstParameterLink +ParametersParameterLinkGetConst(ConstHandle2ConstParameters self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ParameterLink +ParametersParameterLinkGet(ConstHandle2Parameters self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ParametersParameterLinkSet( + ConstHandle2Parameters self, + const size_t index_, + ConstHandle2ConstParameterLink parameterLink +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ParametersParameterLinkHasByLabel( + ConstHandle2ConstParameters self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstParameterLink +ParametersParameterLinkGetByLabelConst( + ConstHandle2ConstParameters self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2ParameterLink +ParametersParameterLinkGetByLabel( + ConstHandle2Parameters self, + const char *const label +); + +// +++ Set, by label +extern_c void +ParametersParameterLinkSetByLabel( + ConstHandle2Parameters self, + const char *const label, + ConstHandle2ConstParameterLink parameterLink +); + +// ------------------------ +// Re: metadatum href +// ------------------------ + +// +++ Has, by href +extern_c int +ParametersParameterLinkHasByHref( + ConstHandle2ConstParameters self, + const char *const href +); + +// --- Get, by href, const +extern_c Handle2ConstParameterLink +ParametersParameterLinkGetByHrefConst( + ConstHandle2ConstParameters self, + const char *const href +); + +// +++ Get, by href, non-const +extern_c Handle2ParameterLink +ParametersParameterLinkGetByHref( + ConstHandle2Parameters self, + const char *const href +); + +// +++ Set, by href +extern_c void +ParametersParameterLinkSetByHref( + ConstHandle2Parameters self, + const char *const href, + ConstHandle2ConstParameterLink parameterLink +); + +// ------------------------ +// Re: metadatum nParameters +// ------------------------ + +// +++ Has, by nParameters +extern_c int +ParametersParameterLinkHasByNParameters( + ConstHandle2ConstParameters self, + const int nParameters +); + +// --- Get, by nParameters, const +extern_c Handle2ConstParameterLink +ParametersParameterLinkGetByNParametersConst( + ConstHandle2ConstParameters self, + const int nParameters +); + +// +++ Get, by nParameters, non-const +extern_c Handle2ParameterLink +ParametersParameterLinkGetByNParameters( + ConstHandle2Parameters self, + const int nParameters +); + +// +++ Set, by nParameters +extern_c void +ParametersParameterLinkSetByNParameters( + ConstHandle2Parameters self, + const int nParameters, + ConstHandle2ConstParameterLink parameterLink +); + +// ------------------------ +// Re: metadatum matrixStartIndex +// ------------------------ + +// +++ Has, by matrixStartIndex +extern_c int +ParametersParameterLinkHasByMatrixStartIndex( + ConstHandle2ConstParameters self, + const int matrixStartIndex +); + +// --- Get, by matrixStartIndex, const +extern_c Handle2ConstParameterLink +ParametersParameterLinkGetByMatrixStartIndexConst( + ConstHandle2ConstParameters self, + const int matrixStartIndex +); + +// +++ Get, by matrixStartIndex, non-const +extern_c Handle2ParameterLink +ParametersParameterLinkGetByMatrixStartIndex( + ConstHandle2Parameters self, + const int matrixStartIndex +); + +// +++ Set, by matrixStartIndex +extern_c void +ParametersParameterLinkSetByMatrixStartIndex( + ConstHandle2Parameters self, + const int matrixStartIndex, + ConstHandle2ConstParameterLink parameterLink +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Parameters/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parameters/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parameters/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parameters/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parameters/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parity.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parity.cpp new file mode 100644 index 000000000..28ba56f2f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parity.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Parity.hpp" +#include "Parity.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ParityClass; +using CPP = multigroup::Parity; + +static const std::string CLASSNAME = "Parity"; + +namespace extract { + static auto integer = [](auto &obj) { return &obj.integer; }; +} + +using CPPInteger = general::Integer; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstParity +ParityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Parity +ParityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstParity +ParityCreateConst( + ConstHandle2ConstInteger integer +) { + ConstHandle2Parity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(integer) + ); + return handle; +} + +// Create, general, non-const +Handle2Parity +ParityCreate( + ConstHandle2ConstInteger integer +) { + ConstHandle2Parity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(integer) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ParityAssign(ConstHandle2Parity self, ConstHandle2ConstParity from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ParityDelete(ConstHandle2ConstParity self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ParityRead(ConstHandle2Parity self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ParityWrite(ConstHandle2ConstParity self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ParityPrint(ConstHandle2ConstParity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ParityPrintXML(ConstHandle2ConstParity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ParityPrintJSON(ConstHandle2ConstParity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: integer +// ----------------------------------------------------------------------------- + +// Has +int +ParityIntegerHas(ConstHandle2ConstParity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IntegerHas", self, extract::integer); +} + +// Get, const +Handle2ConstInteger +ParityIntegerGetConst(ConstHandle2ConstParity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IntegerGetConst", self, extract::integer); +} + +// Get, non-const +Handle2Integer +ParityIntegerGet(ConstHandle2Parity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IntegerGet", self, extract::integer); +} + +// Set +void +ParityIntegerSet(ConstHandle2Parity self, ConstHandle2ConstInteger integer) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IntegerSet", self, extract::integer, integer); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Parity/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parity.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parity.h new file mode 100644 index 000000000..bf4bfde14 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parity.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Parity is the basic handle type in this file. Example: +// // Create a default Parity object: +// Parity handle = ParityDefault(); +// Functions involving Parity are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PARITY +#define C_INTERFACE_GNDS_V2_0_GENERAL_PARITY + +#include "GNDStk.h" +#include "v2.0/general/Integer.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ParityClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Parity +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ParityClass *Parity; + +// --- Const-aware handles. +typedef const struct ParityClass *const ConstHandle2ConstParity; +typedef struct ParityClass *const ConstHandle2Parity; +typedef const struct ParityClass * Handle2ConstParity; +typedef struct ParityClass * Handle2Parity; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstParity +ParityDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Parity +ParityDefault(); + +// --- Create, general, const +extern_c Handle2ConstParity +ParityCreateConst( + ConstHandle2ConstInteger integer +); + +// +++ Create, general, non-const +extern_c Handle2Parity +ParityCreate( + ConstHandle2ConstInteger integer +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ParityAssign(ConstHandle2Parity self, ConstHandle2ConstParity from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ParityDelete(ConstHandle2ConstParity self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ParityRead(ConstHandle2Parity self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ParityWrite(ConstHandle2ConstParity self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ParityPrint(ConstHandle2ConstParity self); + +// +++ Print to standard output, as XML +extern_c int +ParityPrintXML(ConstHandle2ConstParity self); + +// +++ Print to standard output, as JSON +extern_c int +ParityPrintJSON(ConstHandle2ConstParity self); + + +// ----------------------------------------------------------------------------- +// Child: integer +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ParityIntegerHas(ConstHandle2ConstParity self); + +// --- Get, const +extern_c Handle2ConstInteger +ParityIntegerGetConst(ConstHandle2ConstParity self); + +// +++ Get, non-const +extern_c Handle2Integer +ParityIntegerGet(ConstHandle2Parity self); + +// +++ Set +extern_c void +ParityIntegerSet(ConstHandle2Parity self, ConstHandle2ConstInteger integer); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Parity/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parity/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parity/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Parity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PhotonEmissionProbabilities.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PhotonEmissionProbabilities.cpp new file mode 100644 index 000000000..a3c673b70 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PhotonEmissionProbabilities.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/PhotonEmissionProbabilities.hpp" +#include "PhotonEmissionProbabilities.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = PhotonEmissionProbabilitiesClass; +using CPP = multigroup::PhotonEmissionProbabilities; + +static const std::string CLASSNAME = "PhotonEmissionProbabilities"; + +namespace extract { + static auto shell = [](auto &obj) { return &obj.shell; }; +} + +using CPPShell = general::Shell; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPhotonEmissionProbabilities +PhotonEmissionProbabilitiesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2PhotonEmissionProbabilities +PhotonEmissionProbabilitiesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPhotonEmissionProbabilities +PhotonEmissionProbabilitiesCreateConst( + ConstHandle2ConstShell shell +) { + ConstHandle2PhotonEmissionProbabilities handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(shell) + ); + return handle; +} + +// Create, general, non-const +Handle2PhotonEmissionProbabilities +PhotonEmissionProbabilitiesCreate( + ConstHandle2ConstShell shell +) { + ConstHandle2PhotonEmissionProbabilities handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(shell) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +PhotonEmissionProbabilitiesAssign(ConstHandle2PhotonEmissionProbabilities self, ConstHandle2ConstPhotonEmissionProbabilities from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +PhotonEmissionProbabilitiesDelete(ConstHandle2ConstPhotonEmissionProbabilities self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +PhotonEmissionProbabilitiesRead(ConstHandle2PhotonEmissionProbabilities self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +PhotonEmissionProbabilitiesWrite(ConstHandle2ConstPhotonEmissionProbabilities self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +PhotonEmissionProbabilitiesPrint(ConstHandle2ConstPhotonEmissionProbabilities self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +PhotonEmissionProbabilitiesPrintXML(ConstHandle2ConstPhotonEmissionProbabilities self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +PhotonEmissionProbabilitiesPrintJSON(ConstHandle2ConstPhotonEmissionProbabilities self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: shell +// ----------------------------------------------------------------------------- + +// Has +int +PhotonEmissionProbabilitiesShellHas(ConstHandle2ConstPhotonEmissionProbabilities self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ShellHas", self, extract::shell); +} + +// Get, const +Handle2ConstShell +PhotonEmissionProbabilitiesShellGetConst(ConstHandle2ConstPhotonEmissionProbabilities self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ShellGetConst", self, extract::shell); +} + +// Get, non-const +Handle2Shell +PhotonEmissionProbabilitiesShellGet(ConstHandle2PhotonEmissionProbabilities self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ShellGet", self, extract::shell); +} + +// Set +void +PhotonEmissionProbabilitiesShellSet(ConstHandle2PhotonEmissionProbabilities self, ConstHandle2ConstShell shell) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ShellSet", self, extract::shell, shell); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PhotonEmissionProbabilities/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PhotonEmissionProbabilities.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PhotonEmissionProbabilities.h new file mode 100644 index 000000000..b7e15982d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PhotonEmissionProbabilities.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// PhotonEmissionProbabilities is the basic handle type in this file. Example: +// // Create a default PhotonEmissionProbabilities object: +// PhotonEmissionProbabilities handle = PhotonEmissionProbabilitiesDefault(); +// Functions involving PhotonEmissionProbabilities are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PHOTONEMISSIONPROBABILITIES +#define C_INTERFACE_GNDS_V2_0_GENERAL_PHOTONEMISSIONPROBABILITIES + +#include "GNDStk.h" +#include "v2.0/general/Shell.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct PhotonEmissionProbabilitiesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ PhotonEmissionProbabilities +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct PhotonEmissionProbabilitiesClass *PhotonEmissionProbabilities; + +// --- Const-aware handles. +typedef const struct PhotonEmissionProbabilitiesClass *const ConstHandle2ConstPhotonEmissionProbabilities; +typedef struct PhotonEmissionProbabilitiesClass *const ConstHandle2PhotonEmissionProbabilities; +typedef const struct PhotonEmissionProbabilitiesClass * Handle2ConstPhotonEmissionProbabilities; +typedef struct PhotonEmissionProbabilitiesClass * Handle2PhotonEmissionProbabilities; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPhotonEmissionProbabilities +PhotonEmissionProbabilitiesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2PhotonEmissionProbabilities +PhotonEmissionProbabilitiesDefault(); + +// --- Create, general, const +extern_c Handle2ConstPhotonEmissionProbabilities +PhotonEmissionProbabilitiesCreateConst( + ConstHandle2ConstShell shell +); + +// +++ Create, general, non-const +extern_c Handle2PhotonEmissionProbabilities +PhotonEmissionProbabilitiesCreate( + ConstHandle2ConstShell shell +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +PhotonEmissionProbabilitiesAssign(ConstHandle2PhotonEmissionProbabilities self, ConstHandle2ConstPhotonEmissionProbabilities from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +PhotonEmissionProbabilitiesDelete(ConstHandle2ConstPhotonEmissionProbabilities self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +PhotonEmissionProbabilitiesRead(ConstHandle2PhotonEmissionProbabilities self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +PhotonEmissionProbabilitiesWrite(ConstHandle2ConstPhotonEmissionProbabilities self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +PhotonEmissionProbabilitiesPrint(ConstHandle2ConstPhotonEmissionProbabilities self); + +// +++ Print to standard output, as XML +extern_c int +PhotonEmissionProbabilitiesPrintXML(ConstHandle2ConstPhotonEmissionProbabilities self); + +// +++ Print to standard output, as JSON +extern_c int +PhotonEmissionProbabilitiesPrintJSON(ConstHandle2ConstPhotonEmissionProbabilities self); + + +// ----------------------------------------------------------------------------- +// Child: shell +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PhotonEmissionProbabilitiesShellHas(ConstHandle2ConstPhotonEmissionProbabilities self); + +// --- Get, const +extern_c Handle2ConstShell +PhotonEmissionProbabilitiesShellGetConst(ConstHandle2ConstPhotonEmissionProbabilities self); + +// +++ Get, non-const +extern_c Handle2Shell +PhotonEmissionProbabilitiesShellGet(ConstHandle2PhotonEmissionProbabilities self); + +// +++ Set +extern_c void +PhotonEmissionProbabilitiesShellSet(ConstHandle2PhotonEmissionProbabilities self, ConstHandle2ConstShell shell); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PhotonEmissionProbabilities/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PhotonEmissionProbabilities/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PhotonEmissionProbabilities/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PhotonEmissionProbabilities/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PhotonEmissionProbabilities/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Polynomial1d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Polynomial1d.cpp new file mode 100644 index 000000000..3f6134289 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Polynomial1d.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Polynomial1d.hpp" +#include "Polynomial1d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Polynomial1dClass; +using CPP = multigroup::Polynomial1d; + +static const std::string CLASSNAME = "Polynomial1d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto values = [](auto &obj) { return &obj.values; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPAxes = general::Axes; +using CPPValues = general::Values; +using CPPUncertainty = general::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPolynomial1d +Polynomial1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Polynomial1d +Polynomial1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPolynomial1d +Polynomial1dCreateConst( + const char *const label, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Polynomial1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + domainMin, + domainMax, + detail::tocpp(axes), + detail::tocpp(values), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general, non-const +Handle2Polynomial1d +Polynomial1dCreate( + const char *const label, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Polynomial1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + domainMin, + domainMax, + detail::tocpp(axes), + detail::tocpp(values), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Polynomial1dAssign(ConstHandle2Polynomial1d self, ConstHandle2ConstPolynomial1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Polynomial1dDelete(ConstHandle2ConstPolynomial1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Polynomial1dRead(ConstHandle2Polynomial1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Polynomial1dWrite(ConstHandle2ConstPolynomial1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Polynomial1dPrint(ConstHandle2ConstPolynomial1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Polynomial1dPrintXML(ConstHandle2ConstPolynomial1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Polynomial1dPrintJSON(ConstHandle2ConstPolynomial1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dLabelHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +Polynomial1dLabelGet(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Polynomial1dLabelSet(ConstHandle2Polynomial1d self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dDomainMinHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +double +Polynomial1dDomainMinGet(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +Polynomial1dDomainMinSet(ConstHandle2Polynomial1d self, const double domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dDomainMaxHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +double +Polynomial1dDomainMaxGet(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +Polynomial1dDomainMaxSet(ConstHandle2Polynomial1d self, const double domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dAxesHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +Polynomial1dAxesGetConst(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +Polynomial1dAxesGet(ConstHandle2Polynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +Polynomial1dAxesSet(ConstHandle2Polynomial1d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dValuesHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +Polynomial1dValuesGetConst(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +Polynomial1dValuesGet(ConstHandle2Polynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +Polynomial1dValuesSet(ConstHandle2Polynomial1d self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dUncertaintyHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +Polynomial1dUncertaintyGetConst(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +Polynomial1dUncertaintyGet(ConstHandle2Polynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +Polynomial1dUncertaintySet(ConstHandle2Polynomial1d self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Polynomial1d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Polynomial1d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Polynomial1d.h new file mode 100644 index 000000000..20347f2a6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Polynomial1d.h @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Polynomial1d is the basic handle type in this file. Example: +// // Create a default Polynomial1d object: +// Polynomial1d handle = Polynomial1dDefault(); +// Functions involving Polynomial1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_POLYNOMIAL1D +#define C_INTERFACE_GNDS_V2_0_GENERAL_POLYNOMIAL1D + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" +#include "v2.0/general/Values.h" +#include "v2.0/general/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Polynomial1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Polynomial1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Polynomial1dClass *Polynomial1d; + +// --- Const-aware handles. +typedef const struct Polynomial1dClass *const ConstHandle2ConstPolynomial1d; +typedef struct Polynomial1dClass *const ConstHandle2Polynomial1d; +typedef const struct Polynomial1dClass * Handle2ConstPolynomial1d; +typedef struct Polynomial1dClass * Handle2Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPolynomial1d +Polynomial1dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Polynomial1d +Polynomial1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstPolynomial1d +Polynomial1dCreateConst( + const char *const label, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general, non-const +extern_c Handle2Polynomial1d +Polynomial1dCreate( + const char *const label, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Polynomial1dAssign(ConstHandle2Polynomial1d self, ConstHandle2ConstPolynomial1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Polynomial1dDelete(ConstHandle2ConstPolynomial1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Polynomial1dRead(ConstHandle2Polynomial1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Polynomial1dWrite(ConstHandle2ConstPolynomial1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Polynomial1dPrint(ConstHandle2ConstPolynomial1d self); + +// +++ Print to standard output, as XML +extern_c int +Polynomial1dPrintXML(ConstHandle2ConstPolynomial1d self); + +// +++ Print to standard output, as JSON +extern_c int +Polynomial1dPrintJSON(ConstHandle2ConstPolynomial1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dLabelHas(ConstHandle2ConstPolynomial1d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +Polynomial1dLabelGet(ConstHandle2ConstPolynomial1d self); + +// +++ Set +extern_c void +Polynomial1dLabelSet(ConstHandle2Polynomial1d self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dDomainMinHas(ConstHandle2ConstPolynomial1d self); + +// +++ Get +// +++ Returns by value +extern_c double +Polynomial1dDomainMinGet(ConstHandle2ConstPolynomial1d self); + +// +++ Set +extern_c void +Polynomial1dDomainMinSet(ConstHandle2Polynomial1d self, const double domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dDomainMaxHas(ConstHandle2ConstPolynomial1d self); + +// +++ Get +// +++ Returns by value +extern_c double +Polynomial1dDomainMaxGet(ConstHandle2ConstPolynomial1d self); + +// +++ Set +extern_c void +Polynomial1dDomainMaxSet(ConstHandle2Polynomial1d self, const double domainMax); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dAxesHas(ConstHandle2ConstPolynomial1d self); + +// --- Get, const +extern_c Handle2ConstAxes +Polynomial1dAxesGetConst(ConstHandle2ConstPolynomial1d self); + +// +++ Get, non-const +extern_c Handle2Axes +Polynomial1dAxesGet(ConstHandle2Polynomial1d self); + +// +++ Set +extern_c void +Polynomial1dAxesSet(ConstHandle2Polynomial1d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dValuesHas(ConstHandle2ConstPolynomial1d self); + +// --- Get, const +extern_c Handle2ConstValues +Polynomial1dValuesGetConst(ConstHandle2ConstPolynomial1d self); + +// +++ Get, non-const +extern_c Handle2Values +Polynomial1dValuesGet(ConstHandle2Polynomial1d self); + +// +++ Set +extern_c void +Polynomial1dValuesSet(ConstHandle2Polynomial1d self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dUncertaintyHas(ConstHandle2ConstPolynomial1d self); + +// --- Get, const +extern_c Handle2ConstUncertainty +Polynomial1dUncertaintyGetConst(ConstHandle2ConstPolynomial1d self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +Polynomial1dUncertaintyGet(ConstHandle2Polynomial1d self); + +// +++ Set +extern_c void +Polynomial1dUncertaintySet(ConstHandle2Polynomial1d self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Polynomial1d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Polynomial1d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Polynomial1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Polynomial1d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Polynomial1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PositronEmissionIntensity.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PositronEmissionIntensity.cpp new file mode 100644 index 000000000..f1c56b62a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PositronEmissionIntensity.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/PositronEmissionIntensity.hpp" +#include "PositronEmissionIntensity.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = PositronEmissionIntensityClass; +using CPP = multigroup::PositronEmissionIntensity; + +static const std::string CLASSNAME = "PositronEmissionIntensity"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPUncertainty = general::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPositronEmissionIntensity +PositronEmissionIntensityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2PositronEmissionIntensity +PositronEmissionIntensityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPositronEmissionIntensity +PositronEmissionIntensityCreateConst( + const double value, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2PositronEmissionIntensity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general, non-const +Handle2PositronEmissionIntensity +PositronEmissionIntensityCreate( + const double value, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2PositronEmissionIntensity handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +PositronEmissionIntensityAssign(ConstHandle2PositronEmissionIntensity self, ConstHandle2ConstPositronEmissionIntensity from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +PositronEmissionIntensityDelete(ConstHandle2ConstPositronEmissionIntensity self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +PositronEmissionIntensityRead(ConstHandle2PositronEmissionIntensity self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +PositronEmissionIntensityWrite(ConstHandle2ConstPositronEmissionIntensity self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +PositronEmissionIntensityPrint(ConstHandle2ConstPositronEmissionIntensity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +PositronEmissionIntensityPrintXML(ConstHandle2ConstPositronEmissionIntensity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +PositronEmissionIntensityPrintJSON(ConstHandle2ConstPositronEmissionIntensity self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +PositronEmissionIntensityValueHas(ConstHandle2ConstPositronEmissionIntensity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +PositronEmissionIntensityValueGet(ConstHandle2ConstPositronEmissionIntensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +PositronEmissionIntensityValueSet(ConstHandle2PositronEmissionIntensity self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +PositronEmissionIntensityUncertaintyHas(ConstHandle2ConstPositronEmissionIntensity self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +PositronEmissionIntensityUncertaintyGetConst(ConstHandle2ConstPositronEmissionIntensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +PositronEmissionIntensityUncertaintyGet(ConstHandle2PositronEmissionIntensity self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +PositronEmissionIntensityUncertaintySet(ConstHandle2PositronEmissionIntensity self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PositronEmissionIntensity/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PositronEmissionIntensity.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PositronEmissionIntensity.h new file mode 100644 index 000000000..420c348da --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PositronEmissionIntensity.h @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// PositronEmissionIntensity is the basic handle type in this file. Example: +// // Create a default PositronEmissionIntensity object: +// PositronEmissionIntensity handle = PositronEmissionIntensityDefault(); +// Functions involving PositronEmissionIntensity are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_POSITRONEMISSIONINTENSITY +#define C_INTERFACE_GNDS_V2_0_GENERAL_POSITRONEMISSIONINTENSITY + +#include "GNDStk.h" +#include "v2.0/general/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct PositronEmissionIntensityClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ PositronEmissionIntensity +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct PositronEmissionIntensityClass *PositronEmissionIntensity; + +// --- Const-aware handles. +typedef const struct PositronEmissionIntensityClass *const ConstHandle2ConstPositronEmissionIntensity; +typedef struct PositronEmissionIntensityClass *const ConstHandle2PositronEmissionIntensity; +typedef const struct PositronEmissionIntensityClass * Handle2ConstPositronEmissionIntensity; +typedef struct PositronEmissionIntensityClass * Handle2PositronEmissionIntensity; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPositronEmissionIntensity +PositronEmissionIntensityDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2PositronEmissionIntensity +PositronEmissionIntensityDefault(); + +// --- Create, general, const +extern_c Handle2ConstPositronEmissionIntensity +PositronEmissionIntensityCreateConst( + const double value, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general, non-const +extern_c Handle2PositronEmissionIntensity +PositronEmissionIntensityCreate( + const double value, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +PositronEmissionIntensityAssign(ConstHandle2PositronEmissionIntensity self, ConstHandle2ConstPositronEmissionIntensity from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +PositronEmissionIntensityDelete(ConstHandle2ConstPositronEmissionIntensity self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +PositronEmissionIntensityRead(ConstHandle2PositronEmissionIntensity self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +PositronEmissionIntensityWrite(ConstHandle2ConstPositronEmissionIntensity self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +PositronEmissionIntensityPrint(ConstHandle2ConstPositronEmissionIntensity self); + +// +++ Print to standard output, as XML +extern_c int +PositronEmissionIntensityPrintXML(ConstHandle2ConstPositronEmissionIntensity self); + +// +++ Print to standard output, as JSON +extern_c int +PositronEmissionIntensityPrintJSON(ConstHandle2ConstPositronEmissionIntensity self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PositronEmissionIntensityValueHas(ConstHandle2ConstPositronEmissionIntensity self); + +// +++ Get +// +++ Returns by value +extern_c double +PositronEmissionIntensityValueGet(ConstHandle2ConstPositronEmissionIntensity self); + +// +++ Set +extern_c void +PositronEmissionIntensityValueSet(ConstHandle2PositronEmissionIntensity self, const double value); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PositronEmissionIntensityUncertaintyHas(ConstHandle2ConstPositronEmissionIntensity self); + +// --- Get, const +extern_c Handle2ConstUncertainty +PositronEmissionIntensityUncertaintyGetConst(ConstHandle2ConstPositronEmissionIntensity self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +PositronEmissionIntensityUncertaintyGet(ConstHandle2PositronEmissionIntensity self); + +// +++ Set +extern_c void +PositronEmissionIntensityUncertaintySet(ConstHandle2PositronEmissionIntensity self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PositronEmissionIntensity/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PositronEmissionIntensity/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PositronEmissionIntensity/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PositronEmissionIntensity/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PositronEmissionIntensity/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PrimaryGamma.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PrimaryGamma.cpp new file mode 100644 index 000000000..444443ee1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PrimaryGamma.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/PrimaryGamma.hpp" +#include "PrimaryGamma.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = PrimaryGammaClass; +using CPP = multigroup::PrimaryGamma; + +static const std::string CLASSNAME = "PrimaryGamma"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto axes = [](auto &obj) { return &obj.axes; }; +} + +using CPPAxes = general::Axes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPrimaryGamma +PrimaryGammaDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2PrimaryGamma +PrimaryGammaDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPrimaryGamma +PrimaryGammaCreateConst( + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +) { + ConstHandle2PrimaryGamma handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + domainMin, + domainMax, + detail::tocpp(axes) + ); + return handle; +} + +// Create, general, non-const +Handle2PrimaryGamma +PrimaryGammaCreate( + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +) { + ConstHandle2PrimaryGamma handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + domainMin, + domainMax, + detail::tocpp(axes) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +PrimaryGammaAssign(ConstHandle2PrimaryGamma self, ConstHandle2ConstPrimaryGamma from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +PrimaryGammaDelete(ConstHandle2ConstPrimaryGamma self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +PrimaryGammaRead(ConstHandle2PrimaryGamma self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +PrimaryGammaWrite(ConstHandle2ConstPrimaryGamma self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +PrimaryGammaPrint(ConstHandle2ConstPrimaryGamma self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +PrimaryGammaPrintXML(ConstHandle2ConstPrimaryGamma self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +PrimaryGammaPrintJSON(ConstHandle2ConstPrimaryGamma self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +PrimaryGammaValueHas(ConstHandle2ConstPrimaryGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +PrimaryGammaValueGet(ConstHandle2ConstPrimaryGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +PrimaryGammaValueSet(ConstHandle2PrimaryGamma self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +PrimaryGammaDomainMinHas(ConstHandle2ConstPrimaryGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +double +PrimaryGammaDomainMinGet(ConstHandle2ConstPrimaryGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +PrimaryGammaDomainMinSet(ConstHandle2PrimaryGamma self, const double domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +PrimaryGammaDomainMaxHas(ConstHandle2ConstPrimaryGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +double +PrimaryGammaDomainMaxGet(ConstHandle2ConstPrimaryGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +PrimaryGammaDomainMaxSet(ConstHandle2PrimaryGamma self, const double domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +PrimaryGammaAxesHas(ConstHandle2ConstPrimaryGamma self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +PrimaryGammaAxesGetConst(ConstHandle2ConstPrimaryGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +PrimaryGammaAxesGet(ConstHandle2PrimaryGamma self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +PrimaryGammaAxesSet(ConstHandle2PrimaryGamma self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PrimaryGamma/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PrimaryGamma.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PrimaryGamma.h new file mode 100644 index 000000000..31e1b0596 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PrimaryGamma.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// PrimaryGamma is the basic handle type in this file. Example: +// // Create a default PrimaryGamma object: +// PrimaryGamma handle = PrimaryGammaDefault(); +// Functions involving PrimaryGamma are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PRIMARYGAMMA +#define C_INTERFACE_GNDS_V2_0_GENERAL_PRIMARYGAMMA + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct PrimaryGammaClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ PrimaryGamma +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct PrimaryGammaClass *PrimaryGamma; + +// --- Const-aware handles. +typedef const struct PrimaryGammaClass *const ConstHandle2ConstPrimaryGamma; +typedef struct PrimaryGammaClass *const ConstHandle2PrimaryGamma; +typedef const struct PrimaryGammaClass * Handle2ConstPrimaryGamma; +typedef struct PrimaryGammaClass * Handle2PrimaryGamma; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPrimaryGamma +PrimaryGammaDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2PrimaryGamma +PrimaryGammaDefault(); + +// --- Create, general, const +extern_c Handle2ConstPrimaryGamma +PrimaryGammaCreateConst( + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +); + +// +++ Create, general, non-const +extern_c Handle2PrimaryGamma +PrimaryGammaCreate( + const double value, + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +PrimaryGammaAssign(ConstHandle2PrimaryGamma self, ConstHandle2ConstPrimaryGamma from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +PrimaryGammaDelete(ConstHandle2ConstPrimaryGamma self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +PrimaryGammaRead(ConstHandle2PrimaryGamma self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +PrimaryGammaWrite(ConstHandle2ConstPrimaryGamma self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +PrimaryGammaPrint(ConstHandle2ConstPrimaryGamma self); + +// +++ Print to standard output, as XML +extern_c int +PrimaryGammaPrintXML(ConstHandle2ConstPrimaryGamma self); + +// +++ Print to standard output, as JSON +extern_c int +PrimaryGammaPrintJSON(ConstHandle2ConstPrimaryGamma self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PrimaryGammaValueHas(ConstHandle2ConstPrimaryGamma self); + +// +++ Get +// +++ Returns by value +extern_c double +PrimaryGammaValueGet(ConstHandle2ConstPrimaryGamma self); + +// +++ Set +extern_c void +PrimaryGammaValueSet(ConstHandle2PrimaryGamma self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PrimaryGammaDomainMinHas(ConstHandle2ConstPrimaryGamma self); + +// +++ Get +// +++ Returns by value +extern_c double +PrimaryGammaDomainMinGet(ConstHandle2ConstPrimaryGamma self); + +// +++ Set +extern_c void +PrimaryGammaDomainMinSet(ConstHandle2PrimaryGamma self, const double domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PrimaryGammaDomainMaxHas(ConstHandle2ConstPrimaryGamma self); + +// +++ Get +// +++ Returns by value +extern_c double +PrimaryGammaDomainMaxGet(ConstHandle2ConstPrimaryGamma self); + +// +++ Set +extern_c void +PrimaryGammaDomainMaxSet(ConstHandle2PrimaryGamma self, const double domainMax); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PrimaryGammaAxesHas(ConstHandle2ConstPrimaryGamma self); + +// --- Get, const +extern_c Handle2ConstAxes +PrimaryGammaAxesGetConst(ConstHandle2ConstPrimaryGamma self); + +// +++ Get, non-const +extern_c Handle2Axes +PrimaryGammaAxesGet(ConstHandle2PrimaryGamma self); + +// +++ Set +extern_c void +PrimaryGammaAxesSet(ConstHandle2PrimaryGamma self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PrimaryGamma/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PrimaryGamma/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PrimaryGamma/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PrimaryGamma/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PrimaryGamma/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Probability.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Probability.cpp new file mode 100644 index 000000000..bd5c61f7d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Probability.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Probability.hpp" +#include "Probability.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ProbabilityClass; +using CPP = multigroup::Probability; + +static const std::string CLASSNAME = "Probability"; + +namespace extract { + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDouble = general::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProbability +ProbabilityDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Probability +ProbabilityDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProbability +ProbabilityCreateConst( + ConstHandle2ConstDouble Double +) { + ConstHandle2Probability handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(Double) + ); + return handle; +} + +// Create, general, non-const +Handle2Probability +ProbabilityCreate( + ConstHandle2ConstDouble Double +) { + ConstHandle2Probability handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(Double) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ProbabilityAssign(ConstHandle2Probability self, ConstHandle2ConstProbability from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ProbabilityDelete(ConstHandle2ConstProbability self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ProbabilityRead(ConstHandle2Probability self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ProbabilityWrite(ConstHandle2ConstProbability self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ProbabilityPrint(ConstHandle2ConstProbability self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ProbabilityPrintXML(ConstHandle2ConstProbability self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ProbabilityPrintJSON(ConstHandle2ConstProbability self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +ProbabilityDoubleHas(ConstHandle2ConstProbability self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Get, const +Handle2ConstDouble +ProbabilityDoubleGetConst(ConstHandle2ConstProbability self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double); +} + +// Get, non-const +Handle2Double +ProbabilityDoubleGet(ConstHandle2Probability self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double); +} + +// Set +void +ProbabilityDoubleSet(ConstHandle2Probability self, ConstHandle2ConstDouble Double) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Probability/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Probability.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Probability.h new file mode 100644 index 000000000..f69240485 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Probability.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Probability is the basic handle type in this file. Example: +// // Create a default Probability object: +// Probability handle = ProbabilityDefault(); +// Functions involving Probability are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PROBABILITY +#define C_INTERFACE_GNDS_V2_0_GENERAL_PROBABILITY + +#include "GNDStk.h" +#include "v2.0/general/Double.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ProbabilityClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Probability +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ProbabilityClass *Probability; + +// --- Const-aware handles. +typedef const struct ProbabilityClass *const ConstHandle2ConstProbability; +typedef struct ProbabilityClass *const ConstHandle2Probability; +typedef const struct ProbabilityClass * Handle2ConstProbability; +typedef struct ProbabilityClass * Handle2Probability; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstProbability +ProbabilityDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Probability +ProbabilityDefault(); + +// --- Create, general, const +extern_c Handle2ConstProbability +ProbabilityCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general, non-const +extern_c Handle2Probability +ProbabilityCreate( + ConstHandle2ConstDouble Double +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ProbabilityAssign(ConstHandle2Probability self, ConstHandle2ConstProbability from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ProbabilityDelete(ConstHandle2ConstProbability self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ProbabilityRead(ConstHandle2Probability self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ProbabilityWrite(ConstHandle2ConstProbability self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ProbabilityPrint(ConstHandle2ConstProbability self); + +// +++ Print to standard output, as XML +extern_c int +ProbabilityPrintXML(ConstHandle2ConstProbability self); + +// +++ Print to standard output, as JSON +extern_c int +ProbabilityPrintJSON(ConstHandle2ConstProbability self); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProbabilityDoubleHas(ConstHandle2ConstProbability self); + +// --- Get, const +extern_c Handle2ConstDouble +ProbabilityDoubleGetConst(ConstHandle2ConstProbability self); + +// +++ Get, non-const +extern_c Handle2Double +ProbabilityDoubleGet(ConstHandle2Probability self); + +// +++ Set +extern_c void +ProbabilityDoubleSet(ConstHandle2Probability self, ConstHandle2ConstDouble Double); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Probability/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Probability/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Probability/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Probability/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Probability/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Product.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Product.cpp new file mode 100644 index 000000000..0311d32e1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Product.cpp @@ -0,0 +1,380 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Product.hpp" +#include "Product.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ProductClass; +using CPP = multigroup::Product; + +static const std::string CLASSNAME = "Product"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto pid = [](auto &obj) { return &obj.pid; }; + static auto multiplicity = [](auto &obj) { return &obj.multiplicity; }; + static auto distribution = [](auto &obj) { return &obj.distribution; }; + static auto outputChannel = [](auto &obj) { return &obj.outputChannel; }; + static auto averageProductEnergy = [](auto &obj) { return &obj.averageProductEnergy; }; +} + +using CPPMultiplicity = general::Multiplicity; +using CPPDistribution = general::Distribution; +using CPPOutputChannel = reduced::OutputChannel; +using CPPAverageProductEnergy = general::AverageProductEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProduct +ProductDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Product +ProductDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProduct +ProductCreateConst( + const char *const label, + const char *const pid, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstDistribution distribution, + ConstHandle2ConstOutputChannel outputChannel, + ConstHandle2ConstAverageProductEnergy averageProductEnergy +) { + ConstHandle2Product handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + pid, + detail::tocpp(multiplicity), + detail::tocpp(distribution), + detail::tocpp(outputChannel), + detail::tocpp(averageProductEnergy) + ); + return handle; +} + +// Create, general, non-const +Handle2Product +ProductCreate( + const char *const label, + const char *const pid, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstDistribution distribution, + ConstHandle2ConstOutputChannel outputChannel, + ConstHandle2ConstAverageProductEnergy averageProductEnergy +) { + ConstHandle2Product handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + pid, + detail::tocpp(multiplicity), + detail::tocpp(distribution), + detail::tocpp(outputChannel), + detail::tocpp(averageProductEnergy) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ProductAssign(ConstHandle2Product self, ConstHandle2ConstProduct from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ProductDelete(ConstHandle2ConstProduct self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ProductRead(ConstHandle2Product self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ProductWrite(ConstHandle2ConstProduct self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ProductPrint(ConstHandle2ConstProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ProductPrintXML(ConstHandle2ConstProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ProductPrintJSON(ConstHandle2ConstProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ProductLabelHas(ConstHandle2ConstProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ProductLabelGet(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ProductLabelSet(ConstHandle2Product self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +ProductPidHas(ConstHandle2ConstProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +ProductPidGet(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ProductPidSet(ConstHandle2Product self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Child: multiplicity +// ----------------------------------------------------------------------------- + +// Has +int +ProductMultiplicityHas(ConstHandle2ConstProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MultiplicityHas", self, extract::multiplicity); +} + +// Get, const +Handle2ConstMultiplicity +ProductMultiplicityGetConst(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MultiplicityGetConst", self, extract::multiplicity); +} + +// Get, non-const +Handle2Multiplicity +ProductMultiplicityGet(ConstHandle2Product self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MultiplicityGet", self, extract::multiplicity); +} + +// Set +void +ProductMultiplicitySet(ConstHandle2Product self, ConstHandle2ConstMultiplicity multiplicity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MultiplicitySet", self, extract::multiplicity, multiplicity); +} + + +// ----------------------------------------------------------------------------- +// Child: distribution +// ----------------------------------------------------------------------------- + +// Has +int +ProductDistributionHas(ConstHandle2ConstProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DistributionHas", self, extract::distribution); +} + +// Get, const +Handle2ConstDistribution +ProductDistributionGetConst(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DistributionGetConst", self, extract::distribution); +} + +// Get, non-const +Handle2Distribution +ProductDistributionGet(ConstHandle2Product self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DistributionGet", self, extract::distribution); +} + +// Set +void +ProductDistributionSet(ConstHandle2Product self, ConstHandle2ConstDistribution distribution) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DistributionSet", self, extract::distribution, distribution); +} + + +// ----------------------------------------------------------------------------- +// Child: outputChannel +// ----------------------------------------------------------------------------- + +// Has +int +ProductOutputChannelHas(ConstHandle2ConstProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OutputChannelHas", self, extract::outputChannel); +} + +// Get, const +Handle2ConstOutputChannel +ProductOutputChannelGetConst(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputChannelGetConst", self, extract::outputChannel); +} + +// Get, non-const +Handle2OutputChannel +ProductOutputChannelGet(ConstHandle2Product self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputChannelGet", self, extract::outputChannel); +} + +// Set +void +ProductOutputChannelSet(ConstHandle2Product self, ConstHandle2ConstOutputChannel outputChannel) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OutputChannelSet", self, extract::outputChannel, outputChannel); +} + + +// ----------------------------------------------------------------------------- +// Child: averageProductEnergy +// ----------------------------------------------------------------------------- + +// Has +int +ProductAverageProductEnergyHas(ConstHandle2ConstProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AverageProductEnergyHas", self, extract::averageProductEnergy); +} + +// Get, const +Handle2ConstAverageProductEnergy +ProductAverageProductEnergyGetConst(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AverageProductEnergyGetConst", self, extract::averageProductEnergy); +} + +// Get, non-const +Handle2AverageProductEnergy +ProductAverageProductEnergyGet(ConstHandle2Product self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AverageProductEnergyGet", self, extract::averageProductEnergy); +} + +// Set +void +ProductAverageProductEnergySet(ConstHandle2Product self, ConstHandle2ConstAverageProductEnergy averageProductEnergy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AverageProductEnergySet", self, extract::averageProductEnergy, averageProductEnergy); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Product/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Product.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Product.h new file mode 100644 index 000000000..0a1f4d4e3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Product.h @@ -0,0 +1,273 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Product is the basic handle type in this file. Example: +// // Create a default Product object: +// Product handle = ProductDefault(); +// Functions involving Product are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCT +#define C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCT + +#include "GNDStk.h" +#include "v2.0/general/Multiplicity.h" +#include "v2.0/general/Distribution.h" +#include "v2.0/reduced/OutputChannel.h" +#include "v2.0/general/AverageProductEnergy.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ProductClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Product +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ProductClass *Product; + +// --- Const-aware handles. +typedef const struct ProductClass *const ConstHandle2ConstProduct; +typedef struct ProductClass *const ConstHandle2Product; +typedef const struct ProductClass * Handle2ConstProduct; +typedef struct ProductClass * Handle2Product; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstProduct +ProductDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Product +ProductDefault(); + +// --- Create, general, const +extern_c Handle2ConstProduct +ProductCreateConst( + const char *const label, + const char *const pid, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstDistribution distribution, + ConstHandle2ConstOutputChannel outputChannel, + ConstHandle2ConstAverageProductEnergy averageProductEnergy +); + +// +++ Create, general, non-const +extern_c Handle2Product +ProductCreate( + const char *const label, + const char *const pid, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstDistribution distribution, + ConstHandle2ConstOutputChannel outputChannel, + ConstHandle2ConstAverageProductEnergy averageProductEnergy +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ProductAssign(ConstHandle2Product self, ConstHandle2ConstProduct from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ProductDelete(ConstHandle2ConstProduct self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ProductRead(ConstHandle2Product self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ProductWrite(ConstHandle2ConstProduct self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ProductPrint(ConstHandle2ConstProduct self); + +// +++ Print to standard output, as XML +extern_c int +ProductPrintXML(ConstHandle2ConstProduct self); + +// +++ Print to standard output, as JSON +extern_c int +ProductPrintJSON(ConstHandle2ConstProduct self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductLabelHas(ConstHandle2ConstProduct self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ProductLabelGet(ConstHandle2ConstProduct self); + +// +++ Set +extern_c void +ProductLabelSet(ConstHandle2Product self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductPidHas(ConstHandle2ConstProduct self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ProductPidGet(ConstHandle2ConstProduct self); + +// +++ Set +extern_c void +ProductPidSet(ConstHandle2Product self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Child: multiplicity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductMultiplicityHas(ConstHandle2ConstProduct self); + +// --- Get, const +extern_c Handle2ConstMultiplicity +ProductMultiplicityGetConst(ConstHandle2ConstProduct self); + +// +++ Get, non-const +extern_c Handle2Multiplicity +ProductMultiplicityGet(ConstHandle2Product self); + +// +++ Set +extern_c void +ProductMultiplicitySet(ConstHandle2Product self, ConstHandle2ConstMultiplicity multiplicity); + + +// ----------------------------------------------------------------------------- +// Child: distribution +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductDistributionHas(ConstHandle2ConstProduct self); + +// --- Get, const +extern_c Handle2ConstDistribution +ProductDistributionGetConst(ConstHandle2ConstProduct self); + +// +++ Get, non-const +extern_c Handle2Distribution +ProductDistributionGet(ConstHandle2Product self); + +// +++ Set +extern_c void +ProductDistributionSet(ConstHandle2Product self, ConstHandle2ConstDistribution distribution); + + +// ----------------------------------------------------------------------------- +// Child: outputChannel +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductOutputChannelHas(ConstHandle2ConstProduct self); + +// --- Get, const +extern_c Handle2ConstOutputChannel +ProductOutputChannelGetConst(ConstHandle2ConstProduct self); + +// +++ Get, non-const +extern_c Handle2OutputChannel +ProductOutputChannelGet(ConstHandle2Product self); + +// +++ Set +extern_c void +ProductOutputChannelSet(ConstHandle2Product self, ConstHandle2ConstOutputChannel outputChannel); + + +// ----------------------------------------------------------------------------- +// Child: averageProductEnergy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductAverageProductEnergyHas(ConstHandle2ConstProduct self); + +// --- Get, const +extern_c Handle2ConstAverageProductEnergy +ProductAverageProductEnergyGetConst(ConstHandle2ConstProduct self); + +// +++ Get, non-const +extern_c Handle2AverageProductEnergy +ProductAverageProductEnergyGet(ConstHandle2Product self); + +// +++ Set +extern_c void +ProductAverageProductEnergySet(ConstHandle2Product self, ConstHandle2ConstAverageProductEnergy averageProductEnergy); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Product/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Product/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Product/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Product/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Product/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYield.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYield.cpp new file mode 100644 index 000000000..0c10c17fa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYield.cpp @@ -0,0 +1,259 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ProductYield.hpp" +#include "ProductYield.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ProductYieldClass; +using CPP = multigroup::ProductYield; + +static const std::string CLASSNAME = "ProductYield"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto nuclides = [](auto &obj) { return &obj.nuclides; }; + static auto elapsedTimes = [](auto &obj) { return &obj.elapsedTimes; }; +} + +using CPPNuclides = reduced::Nuclides; +using CPPElapsedTimes = general::ElapsedTimes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProductYield +ProductYieldDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ProductYield +ProductYieldDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProductYield +ProductYieldCreateConst( + const char *const label, + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstElapsedTimes elapsedTimes +) { + ConstHandle2ProductYield handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(nuclides), + detail::tocpp(elapsedTimes) + ); + return handle; +} + +// Create, general, non-const +Handle2ProductYield +ProductYieldCreate( + const char *const label, + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstElapsedTimes elapsedTimes +) { + ConstHandle2ProductYield handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(nuclides), + detail::tocpp(elapsedTimes) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ProductYieldAssign(ConstHandle2ProductYield self, ConstHandle2ConstProductYield from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ProductYieldDelete(ConstHandle2ConstProductYield self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ProductYieldRead(ConstHandle2ProductYield self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ProductYieldWrite(ConstHandle2ConstProductYield self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ProductYieldPrint(ConstHandle2ConstProductYield self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ProductYieldPrintXML(ConstHandle2ConstProductYield self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ProductYieldPrintJSON(ConstHandle2ConstProductYield self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ProductYieldLabelHas(ConstHandle2ConstProductYield self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ProductYieldLabelGet(ConstHandle2ConstProductYield self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ProductYieldLabelSet(ConstHandle2ProductYield self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: nuclides +// ----------------------------------------------------------------------------- + +// Has +int +ProductYieldNuclidesHas(ConstHandle2ConstProductYield self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NuclidesHas", self, extract::nuclides); +} + +// Get, const +Handle2ConstNuclides +ProductYieldNuclidesGetConst(ConstHandle2ConstProductYield self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclidesGetConst", self, extract::nuclides); +} + +// Get, non-const +Handle2Nuclides +ProductYieldNuclidesGet(ConstHandle2ProductYield self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclidesGet", self, extract::nuclides); +} + +// Set +void +ProductYieldNuclidesSet(ConstHandle2ProductYield self, ConstHandle2ConstNuclides nuclides) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NuclidesSet", self, extract::nuclides, nuclides); +} + + +// ----------------------------------------------------------------------------- +// Child: elapsedTimes +// ----------------------------------------------------------------------------- + +// Has +int +ProductYieldElapsedTimesHas(ConstHandle2ConstProductYield self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ElapsedTimesHas", self, extract::elapsedTimes); +} + +// Get, const +Handle2ConstElapsedTimes +ProductYieldElapsedTimesGetConst(ConstHandle2ConstProductYield self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ElapsedTimesGetConst", self, extract::elapsedTimes); +} + +// Get, non-const +Handle2ElapsedTimes +ProductYieldElapsedTimesGet(ConstHandle2ProductYield self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ElapsedTimesGet", self, extract::elapsedTimes); +} + +// Set +void +ProductYieldElapsedTimesSet(ConstHandle2ProductYield self, ConstHandle2ConstElapsedTimes elapsedTimes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ElapsedTimesSet", self, extract::elapsedTimes, elapsedTimes); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ProductYield/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYield.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYield.h new file mode 100644 index 000000000..0ed756cfe --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYield.h @@ -0,0 +1,205 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ProductYield is the basic handle type in this file. Example: +// // Create a default ProductYield object: +// ProductYield handle = ProductYieldDefault(); +// Functions involving ProductYield are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCTYIELD +#define C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCTYIELD + +#include "GNDStk.h" +#include "v2.0/reduced/Nuclides.h" +#include "v2.0/general/ElapsedTimes.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ProductYieldClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ProductYield +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ProductYieldClass *ProductYield; + +// --- Const-aware handles. +typedef const struct ProductYieldClass *const ConstHandle2ConstProductYield; +typedef struct ProductYieldClass *const ConstHandle2ProductYield; +typedef const struct ProductYieldClass * Handle2ConstProductYield; +typedef struct ProductYieldClass * Handle2ProductYield; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstProductYield +ProductYieldDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ProductYield +ProductYieldDefault(); + +// --- Create, general, const +extern_c Handle2ConstProductYield +ProductYieldCreateConst( + const char *const label, + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstElapsedTimes elapsedTimes +); + +// +++ Create, general, non-const +extern_c Handle2ProductYield +ProductYieldCreate( + const char *const label, + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstElapsedTimes elapsedTimes +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ProductYieldAssign(ConstHandle2ProductYield self, ConstHandle2ConstProductYield from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ProductYieldDelete(ConstHandle2ConstProductYield self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ProductYieldRead(ConstHandle2ProductYield self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ProductYieldWrite(ConstHandle2ConstProductYield self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ProductYieldPrint(ConstHandle2ConstProductYield self); + +// +++ Print to standard output, as XML +extern_c int +ProductYieldPrintXML(ConstHandle2ConstProductYield self); + +// +++ Print to standard output, as JSON +extern_c int +ProductYieldPrintJSON(ConstHandle2ConstProductYield self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductYieldLabelHas(ConstHandle2ConstProductYield self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ProductYieldLabelGet(ConstHandle2ConstProductYield self); + +// +++ Set +extern_c void +ProductYieldLabelSet(ConstHandle2ProductYield self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Child: nuclides +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductYieldNuclidesHas(ConstHandle2ConstProductYield self); + +// --- Get, const +extern_c Handle2ConstNuclides +ProductYieldNuclidesGetConst(ConstHandle2ConstProductYield self); + +// +++ Get, non-const +extern_c Handle2Nuclides +ProductYieldNuclidesGet(ConstHandle2ProductYield self); + +// +++ Set +extern_c void +ProductYieldNuclidesSet(ConstHandle2ProductYield self, ConstHandle2ConstNuclides nuclides); + + +// ----------------------------------------------------------------------------- +// Child: elapsedTimes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductYieldElapsedTimesHas(ConstHandle2ConstProductYield self); + +// --- Get, const +extern_c Handle2ConstElapsedTimes +ProductYieldElapsedTimesGetConst(ConstHandle2ConstProductYield self); + +// +++ Get, non-const +extern_c Handle2ElapsedTimes +ProductYieldElapsedTimesGet(ConstHandle2ProductYield self); + +// +++ Set +extern_c void +ProductYieldElapsedTimesSet(ConstHandle2ProductYield self, ConstHandle2ConstElapsedTimes elapsedTimes); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ProductYield/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYield/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYield/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYield/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYield/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYields.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYields.cpp new file mode 100644 index 000000000..90a59a467 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYields.cpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ProductYields.hpp" +#include "ProductYields.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ProductYieldsClass; +using CPP = multigroup::ProductYields; + +static const std::string CLASSNAME = "ProductYields"; + +namespace extract { + static auto productYield = [](auto &obj) { return &obj.productYield; }; +} + +using CPPProductYield = general::ProductYield; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProductYields +ProductYieldsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ProductYields +ProductYieldsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProductYields +ProductYieldsCreateConst( + ConstHandle2ProductYield *const productYield, const size_t productYieldSize +) { + ConstHandle2ProductYields handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ProductYieldN = 0; ProductYieldN < productYieldSize; ++ProductYieldN) + ProductYieldsProductYieldAdd(handle, productYield[ProductYieldN]); + return handle; +} + +// Create, general, non-const +Handle2ProductYields +ProductYieldsCreate( + ConstHandle2ProductYield *const productYield, const size_t productYieldSize +) { + ConstHandle2ProductYields handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ProductYieldN = 0; ProductYieldN < productYieldSize; ++ProductYieldN) + ProductYieldsProductYieldAdd(handle, productYield[ProductYieldN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ProductYieldsAssign(ConstHandle2ProductYields self, ConstHandle2ConstProductYields from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ProductYieldsDelete(ConstHandle2ConstProductYields self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ProductYieldsRead(ConstHandle2ProductYields self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ProductYieldsWrite(ConstHandle2ConstProductYields self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ProductYieldsPrint(ConstHandle2ConstProductYields self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ProductYieldsPrintXML(ConstHandle2ConstProductYields self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ProductYieldsPrintJSON(ConstHandle2ConstProductYields self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: productYield +// ----------------------------------------------------------------------------- + +// Has +int +ProductYieldsProductYieldHas(ConstHandle2ConstProductYields self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductYieldHas", self, extract::productYield); +} + +// Clear +void +ProductYieldsProductYieldClear(ConstHandle2ProductYields self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ProductYieldClear", self, extract::productYield); +} + +// Size +size_t +ProductYieldsProductYieldSize(ConstHandle2ConstProductYields self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ProductYieldSize", self, extract::productYield); +} + +// Add +void +ProductYieldsProductYieldAdd(ConstHandle2ProductYields self, ConstHandle2ConstProductYield productYield) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ProductYieldAdd", self, extract::productYield, productYield); +} + +// Get, by index \in [0,size), const +Handle2ConstProductYield +ProductYieldsProductYieldGetConst(ConstHandle2ConstProductYields self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ProductYieldGetConst", self, extract::productYield, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ProductYield +ProductYieldsProductYieldGet(ConstHandle2ProductYields self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ProductYieldGet", self, extract::productYield, index_); +} + +// Set, by index \in [0,size) +void +ProductYieldsProductYieldSet( + ConstHandle2ProductYields self, + const size_t index_, + ConstHandle2ConstProductYield productYield +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ProductYieldSet", self, extract::productYield, index_, productYield); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ProductYieldsProductYieldHasByLabel( + ConstHandle2ConstProductYields self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductYieldHasByLabel", + self, extract::productYield, meta::label, label); +} + +// Get, by label, const +Handle2ConstProductYield +ProductYieldsProductYieldGetByLabelConst( + ConstHandle2ConstProductYields self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductYieldGetByLabelConst", + self, extract::productYield, meta::label, label); +} + +// Get, by label, non-const +Handle2ProductYield +ProductYieldsProductYieldGetByLabel( + ConstHandle2ProductYields self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductYieldGetByLabel", + self, extract::productYield, meta::label, label); +} + +// Set, by label +void +ProductYieldsProductYieldSetByLabel( + ConstHandle2ProductYields self, + const char *const label, + ConstHandle2ConstProductYield productYield +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductYieldSetByLabel", + self, extract::productYield, meta::label, label, productYield); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ProductYields/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYields.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYields.h new file mode 100644 index 000000000..bcbee7bf1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYields.h @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ProductYields is the basic handle type in this file. Example: +// // Create a default ProductYields object: +// ProductYields handle = ProductYieldsDefault(); +// Functions involving ProductYields are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCTYIELDS +#define C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCTYIELDS + +#include "GNDStk.h" +#include "v2.0/general/ProductYield.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ProductYieldsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ProductYields +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ProductYieldsClass *ProductYields; + +// --- Const-aware handles. +typedef const struct ProductYieldsClass *const ConstHandle2ConstProductYields; +typedef struct ProductYieldsClass *const ConstHandle2ProductYields; +typedef const struct ProductYieldsClass * Handle2ConstProductYields; +typedef struct ProductYieldsClass * Handle2ProductYields; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstProductYields +ProductYieldsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ProductYields +ProductYieldsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProductYields +ProductYieldsCreateConst( + ConstHandle2ProductYield *const productYield, const size_t productYieldSize +); + +// +++ Create, general, non-const +extern_c Handle2ProductYields +ProductYieldsCreate( + ConstHandle2ProductYield *const productYield, const size_t productYieldSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ProductYieldsAssign(ConstHandle2ProductYields self, ConstHandle2ConstProductYields from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ProductYieldsDelete(ConstHandle2ConstProductYields self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ProductYieldsRead(ConstHandle2ProductYields self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ProductYieldsWrite(ConstHandle2ConstProductYields self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ProductYieldsPrint(ConstHandle2ConstProductYields self); + +// +++ Print to standard output, as XML +extern_c int +ProductYieldsPrintXML(ConstHandle2ConstProductYields self); + +// +++ Print to standard output, as JSON +extern_c int +ProductYieldsPrintJSON(ConstHandle2ConstProductYields self); + + +// ----------------------------------------------------------------------------- +// Child: productYield +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductYieldsProductYieldHas(ConstHandle2ConstProductYields self); + +// +++ Clear +extern_c void +ProductYieldsProductYieldClear(ConstHandle2ProductYields self); + +// +++ Size +extern_c size_t +ProductYieldsProductYieldSize(ConstHandle2ConstProductYields self); + +// +++ Add +extern_c void +ProductYieldsProductYieldAdd(ConstHandle2ProductYields self, ConstHandle2ConstProductYield productYield); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstProductYield +ProductYieldsProductYieldGetConst(ConstHandle2ConstProductYields self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ProductYield +ProductYieldsProductYieldGet(ConstHandle2ProductYields self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ProductYieldsProductYieldSet( + ConstHandle2ProductYields self, + const size_t index_, + ConstHandle2ConstProductYield productYield +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ProductYieldsProductYieldHasByLabel( + ConstHandle2ConstProductYields self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstProductYield +ProductYieldsProductYieldGetByLabelConst( + ConstHandle2ConstProductYields self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2ProductYield +ProductYieldsProductYieldGetByLabel( + ConstHandle2ProductYields self, + const char *const label +); + +// +++ Set, by label +extern_c void +ProductYieldsProductYieldSetByLabel( + ConstHandle2ProductYields self, + const char *const label, + ConstHandle2ConstProductYield productYield +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ProductYields/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYields/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYields/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYields/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProductYields/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Production.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Production.cpp new file mode 100644 index 000000000..ea199ed91 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Production.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Production.hpp" +#include "Production.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ProductionClass; +using CPP = multigroup::Production; + +static const std::string CLASSNAME = "Production"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto ENDF_MT = [](auto &obj) { return &obj.ENDF_MT; }; + static auto crossSection = [](auto &obj) { return &obj.crossSection; }; + static auto outputChannel = [](auto &obj) { return &obj.outputChannel; }; +} + +using CPPCrossSection = general::CrossSection; +using CPPOutputChannel = general::OutputChannel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProduction +ProductionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Production +ProductionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProduction +ProductionCreateConst( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2Production handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + ENDF_MT, + detail::tocpp(crossSection), + detail::tocpp(outputChannel) + ); + return handle; +} + +// Create, general, non-const +Handle2Production +ProductionCreate( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +) { + ConstHandle2Production handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + ENDF_MT, + detail::tocpp(crossSection), + detail::tocpp(outputChannel) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ProductionAssign(ConstHandle2Production self, ConstHandle2ConstProduction from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ProductionDelete(ConstHandle2ConstProduction self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ProductionRead(ConstHandle2Production self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ProductionWrite(ConstHandle2ConstProduction self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ProductionPrint(ConstHandle2ConstProduction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ProductionPrintXML(ConstHandle2ConstProduction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ProductionPrintJSON(ConstHandle2ConstProduction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ProductionLabelHas(ConstHandle2ConstProduction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ProductionLabelGet(ConstHandle2ConstProduction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ProductionLabelSet(ConstHandle2Production self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +ProductionENDFMTHas(ConstHandle2ConstProduction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +int +ProductionENDFMTGet(ConstHandle2ConstProduction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +ProductionENDFMTSet(ConstHandle2Production self, const int ENDF_MT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMTSet", self, extract::ENDF_MT, ENDF_MT); +} + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// Has +int +ProductionCrossSectionHas(ConstHandle2ConstProduction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossSectionHas", self, extract::crossSection); +} + +// Get, const +Handle2ConstCrossSection +ProductionCrossSectionGetConst(ConstHandle2ConstProduction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGetConst", self, extract::crossSection); +} + +// Get, non-const +Handle2CrossSection +ProductionCrossSectionGet(ConstHandle2Production self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGet", self, extract::crossSection); +} + +// Set +void +ProductionCrossSectionSet(ConstHandle2Production self, ConstHandle2ConstCrossSection crossSection) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CrossSectionSet", self, extract::crossSection, crossSection); +} + + +// ----------------------------------------------------------------------------- +// Child: outputChannel +// ----------------------------------------------------------------------------- + +// Has +int +ProductionOutputChannelHas(ConstHandle2ConstProduction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OutputChannelHas", self, extract::outputChannel); +} + +// Get, const +Handle2ConstOutputChannel +ProductionOutputChannelGetConst(ConstHandle2ConstProduction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputChannelGetConst", self, extract::outputChannel); +} + +// Get, non-const +Handle2OutputChannel +ProductionOutputChannelGet(ConstHandle2Production self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputChannelGet", self, extract::outputChannel); +} + +// Set +void +ProductionOutputChannelSet(ConstHandle2Production self, ConstHandle2ConstOutputChannel outputChannel) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OutputChannelSet", self, extract::outputChannel, outputChannel); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Production/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Production.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Production.h new file mode 100644 index 000000000..0cb839dde --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Production.h @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Production is the basic handle type in this file. Example: +// // Create a default Production object: +// Production handle = ProductionDefault(); +// Functions involving Production are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCTION +#define C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCTION + +#include "GNDStk.h" +#include "v2.0/general/CrossSection.h" +#include "v2.0/general/OutputChannel.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ProductionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Production +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ProductionClass *Production; + +// --- Const-aware handles. +typedef const struct ProductionClass *const ConstHandle2ConstProduction; +typedef struct ProductionClass *const ConstHandle2Production; +typedef const struct ProductionClass * Handle2ConstProduction; +typedef struct ProductionClass * Handle2Production; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstProduction +ProductionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Production +ProductionDefault(); + +// --- Create, general, const +extern_c Handle2ConstProduction +ProductionCreateConst( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +); + +// +++ Create, general, non-const +extern_c Handle2Production +ProductionCreate( + const char *const label, + const int ENDF_MT, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ProductionAssign(ConstHandle2Production self, ConstHandle2ConstProduction from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ProductionDelete(ConstHandle2ConstProduction self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ProductionRead(ConstHandle2Production self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ProductionWrite(ConstHandle2ConstProduction self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ProductionPrint(ConstHandle2ConstProduction self); + +// +++ Print to standard output, as XML +extern_c int +ProductionPrintXML(ConstHandle2ConstProduction self); + +// +++ Print to standard output, as JSON +extern_c int +ProductionPrintJSON(ConstHandle2ConstProduction self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductionLabelHas(ConstHandle2ConstProduction self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ProductionLabelGet(ConstHandle2ConstProduction self); + +// +++ Set +extern_c void +ProductionLabelSet(ConstHandle2Production self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductionENDFMTHas(ConstHandle2ConstProduction self); + +// +++ Get +// +++ Returns by value +extern_c int +ProductionENDFMTGet(ConstHandle2ConstProduction self); + +// +++ Set +extern_c void +ProductionENDFMTSet(ConstHandle2Production self, const int ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductionCrossSectionHas(ConstHandle2ConstProduction self); + +// --- Get, const +extern_c Handle2ConstCrossSection +ProductionCrossSectionGetConst(ConstHandle2ConstProduction self); + +// +++ Get, non-const +extern_c Handle2CrossSection +ProductionCrossSectionGet(ConstHandle2Production self); + +// +++ Set +extern_c void +ProductionCrossSectionSet(ConstHandle2Production self, ConstHandle2ConstCrossSection crossSection); + + +// ----------------------------------------------------------------------------- +// Child: outputChannel +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductionOutputChannelHas(ConstHandle2ConstProduction self); + +// --- Get, const +extern_c Handle2ConstOutputChannel +ProductionOutputChannelGetConst(ConstHandle2ConstProduction self); + +// +++ Get, non-const +extern_c Handle2OutputChannel +ProductionOutputChannelGet(ConstHandle2Production self); + +// +++ Set +extern_c void +ProductionOutputChannelSet(ConstHandle2Production self, ConstHandle2ConstOutputChannel outputChannel); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Production/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Production/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Production/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Production/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Production/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Productions.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Productions.cpp new file mode 100644 index 000000000..d5740fdcc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Productions.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Productions.hpp" +#include "Productions.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ProductionsClass; +using CPP = multigroup::Productions; + +static const std::string CLASSNAME = "Productions"; + +namespace extract { + static auto production = [](auto &obj) { return &obj.production; }; +} + +using CPPProduction = general::Production; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProductions +ProductionsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Productions +ProductionsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProductions +ProductionsCreateConst( + ConstHandle2Production *const production, const size_t productionSize +) { + ConstHandle2Productions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ProductionN = 0; ProductionN < productionSize; ++ProductionN) + ProductionsProductionAdd(handle, production[ProductionN]); + return handle; +} + +// Create, general, non-const +Handle2Productions +ProductionsCreate( + ConstHandle2Production *const production, const size_t productionSize +) { + ConstHandle2Productions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ProductionN = 0; ProductionN < productionSize; ++ProductionN) + ProductionsProductionAdd(handle, production[ProductionN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ProductionsAssign(ConstHandle2Productions self, ConstHandle2ConstProductions from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ProductionsDelete(ConstHandle2ConstProductions self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ProductionsRead(ConstHandle2Productions self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ProductionsWrite(ConstHandle2ConstProductions self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ProductionsPrint(ConstHandle2ConstProductions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ProductionsPrintXML(ConstHandle2ConstProductions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ProductionsPrintJSON(ConstHandle2ConstProductions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: production +// ----------------------------------------------------------------------------- + +// Has +int +ProductionsProductionHas(ConstHandle2ConstProductions self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductionHas", self, extract::production); +} + +// Clear +void +ProductionsProductionClear(ConstHandle2Productions self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ProductionClear", self, extract::production); +} + +// Size +size_t +ProductionsProductionSize(ConstHandle2ConstProductions self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ProductionSize", self, extract::production); +} + +// Add +void +ProductionsProductionAdd(ConstHandle2Productions self, ConstHandle2ConstProduction production) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ProductionAdd", self, extract::production, production); +} + +// Get, by index \in [0,size), const +Handle2ConstProduction +ProductionsProductionGetConst(ConstHandle2ConstProductions self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ProductionGetConst", self, extract::production, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Production +ProductionsProductionGet(ConstHandle2Productions self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ProductionGet", self, extract::production, index_); +} + +// Set, by index \in [0,size) +void +ProductionsProductionSet( + ConstHandle2Productions self, + const size_t index_, + ConstHandle2ConstProduction production +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ProductionSet", self, extract::production, index_, production); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ProductionsProductionHasByLabel( + ConstHandle2ConstProductions self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductionHasByLabel", + self, extract::production, meta::label, label); +} + +// Get, by label, const +Handle2ConstProduction +ProductionsProductionGetByLabelConst( + ConstHandle2ConstProductions self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductionGetByLabelConst", + self, extract::production, meta::label, label); +} + +// Get, by label, non-const +Handle2Production +ProductionsProductionGetByLabel( + ConstHandle2Productions self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductionGetByLabel", + self, extract::production, meta::label, label); +} + +// Set, by label +void +ProductionsProductionSetByLabel( + ConstHandle2Productions self, + const char *const label, + ConstHandle2ConstProduction production +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductionSetByLabel", + self, extract::production, meta::label, label, production); +} + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// Has, by ENDF_MT +int +ProductionsProductionHasByENDFMT( + ConstHandle2ConstProductions self, + const int ENDF_MT +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductionHasByENDFMT", + self, extract::production, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, const +Handle2ConstProduction +ProductionsProductionGetByENDFMTConst( + ConstHandle2ConstProductions self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductionGetByENDFMTConst", + self, extract::production, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, non-const +Handle2Production +ProductionsProductionGetByENDFMT( + ConstHandle2Productions self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductionGetByENDFMT", + self, extract::production, meta::ENDF_MT, ENDF_MT); +} + +// Set, by ENDF_MT +void +ProductionsProductionSetByENDFMT( + ConstHandle2Productions self, + const int ENDF_MT, + ConstHandle2ConstProduction production +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductionSetByENDFMT", + self, extract::production, meta::ENDF_MT, ENDF_MT, production); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Productions/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Productions.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Productions.h new file mode 100644 index 000000000..2eead57b7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Productions.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Productions is the basic handle type in this file. Example: +// // Create a default Productions object: +// Productions handle = ProductionsDefault(); +// Functions involving Productions are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCTIONS +#define C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCTIONS + +#include "GNDStk.h" +#include "v2.0/general/Production.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ProductionsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Productions +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ProductionsClass *Productions; + +// --- Const-aware handles. +typedef const struct ProductionsClass *const ConstHandle2ConstProductions; +typedef struct ProductionsClass *const ConstHandle2Productions; +typedef const struct ProductionsClass * Handle2ConstProductions; +typedef struct ProductionsClass * Handle2Productions; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstProductions +ProductionsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Productions +ProductionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProductions +ProductionsCreateConst( + ConstHandle2Production *const production, const size_t productionSize +); + +// +++ Create, general, non-const +extern_c Handle2Productions +ProductionsCreate( + ConstHandle2Production *const production, const size_t productionSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ProductionsAssign(ConstHandle2Productions self, ConstHandle2ConstProductions from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ProductionsDelete(ConstHandle2ConstProductions self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ProductionsRead(ConstHandle2Productions self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ProductionsWrite(ConstHandle2ConstProductions self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ProductionsPrint(ConstHandle2ConstProductions self); + +// +++ Print to standard output, as XML +extern_c int +ProductionsPrintXML(ConstHandle2ConstProductions self); + +// +++ Print to standard output, as JSON +extern_c int +ProductionsPrintJSON(ConstHandle2ConstProductions self); + + +// ----------------------------------------------------------------------------- +// Child: production +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductionsProductionHas(ConstHandle2ConstProductions self); + +// +++ Clear +extern_c void +ProductionsProductionClear(ConstHandle2Productions self); + +// +++ Size +extern_c size_t +ProductionsProductionSize(ConstHandle2ConstProductions self); + +// +++ Add +extern_c void +ProductionsProductionAdd(ConstHandle2Productions self, ConstHandle2ConstProduction production); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstProduction +ProductionsProductionGetConst(ConstHandle2ConstProductions self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Production +ProductionsProductionGet(ConstHandle2Productions self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ProductionsProductionSet( + ConstHandle2Productions self, + const size_t index_, + ConstHandle2ConstProduction production +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ProductionsProductionHasByLabel( + ConstHandle2ConstProductions self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstProduction +ProductionsProductionGetByLabelConst( + ConstHandle2ConstProductions self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Production +ProductionsProductionGetByLabel( + ConstHandle2Productions self, + const char *const label +); + +// +++ Set, by label +extern_c void +ProductionsProductionSetByLabel( + ConstHandle2Productions self, + const char *const label, + ConstHandle2ConstProduction production +); + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// +++ Has, by ENDF_MT +extern_c int +ProductionsProductionHasByENDFMT( + ConstHandle2ConstProductions self, + const int ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstProduction +ProductionsProductionGetByENDFMTConst( + ConstHandle2ConstProductions self, + const int ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2Production +ProductionsProductionGetByENDFMT( + ConstHandle2Productions self, + const int ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +ProductionsProductionSetByENDFMT( + ConstHandle2Productions self, + const int ENDF_MT, + ConstHandle2ConstProduction production +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Productions/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Productions/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Productions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Productions/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Productions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Products.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Products.cpp new file mode 100644 index 000000000..f9e230ea4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Products.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Products.hpp" +#include "Products.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ProductsClass; +using CPP = multigroup::Products; + +static const std::string CLASSNAME = "Products"; + +namespace extract { + static auto product = [](auto &obj) { return &obj.product; }; +} + +using CPPProduct = general::Product; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProducts +ProductsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Products +ProductsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProducts +ProductsCreateConst( + ConstHandle2Product *const product, const size_t productSize +) { + ConstHandle2Products handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ProductN = 0; ProductN < productSize; ++ProductN) + ProductsProductAdd(handle, product[ProductN]); + return handle; +} + +// Create, general, non-const +Handle2Products +ProductsCreate( + ConstHandle2Product *const product, const size_t productSize +) { + ConstHandle2Products handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ProductN = 0; ProductN < productSize; ++ProductN) + ProductsProductAdd(handle, product[ProductN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ProductsAssign(ConstHandle2Products self, ConstHandle2ConstProducts from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ProductsDelete(ConstHandle2ConstProducts self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ProductsRead(ConstHandle2Products self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ProductsWrite(ConstHandle2ConstProducts self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ProductsPrint(ConstHandle2ConstProducts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ProductsPrintXML(ConstHandle2ConstProducts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ProductsPrintJSON(ConstHandle2ConstProducts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: product +// ----------------------------------------------------------------------------- + +// Has +int +ProductsProductHas(ConstHandle2ConstProducts self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductHas", self, extract::product); +} + +// Clear +void +ProductsProductClear(ConstHandle2Products self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ProductClear", self, extract::product); +} + +// Size +size_t +ProductsProductSize(ConstHandle2ConstProducts self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ProductSize", self, extract::product); +} + +// Add +void +ProductsProductAdd(ConstHandle2Products self, ConstHandle2ConstProduct product) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ProductAdd", self, extract::product, product); +} + +// Get, by index \in [0,size), const +Handle2ConstProduct +ProductsProductGetConst(ConstHandle2ConstProducts self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ProductGetConst", self, extract::product, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Product +ProductsProductGet(ConstHandle2Products self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ProductGet", self, extract::product, index_); +} + +// Set, by index \in [0,size) +void +ProductsProductSet( + ConstHandle2Products self, + const size_t index_, + ConstHandle2ConstProduct product +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ProductSet", self, extract::product, index_, product); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ProductsProductHasByLabel( + ConstHandle2ConstProducts self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductHasByLabel", + self, extract::product, meta::label, label); +} + +// Get, by label, const +Handle2ConstProduct +ProductsProductGetByLabelConst( + ConstHandle2ConstProducts self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByLabelConst", + self, extract::product, meta::label, label); +} + +// Get, by label, non-const +Handle2Product +ProductsProductGetByLabel( + ConstHandle2Products self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByLabel", + self, extract::product, meta::label, label); +} + +// Set, by label +void +ProductsProductSetByLabel( + ConstHandle2Products self, + const char *const label, + ConstHandle2ConstProduct product +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductSetByLabel", + self, extract::product, meta::label, label, product); +} + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// Has, by pid +int +ProductsProductHasByPid( + ConstHandle2ConstProducts self, + const char *const pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductHasByPid", + self, extract::product, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstProduct +ProductsProductGetByPidConst( + ConstHandle2ConstProducts self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByPidConst", + self, extract::product, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2Product +ProductsProductGetByPid( + ConstHandle2Products self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByPid", + self, extract::product, meta::pid, pid); +} + +// Set, by pid +void +ProductsProductSetByPid( + ConstHandle2Products self, + const char *const pid, + ConstHandle2ConstProduct product +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductSetByPid", + self, extract::product, meta::pid, pid, product); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Products/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Products.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Products.h new file mode 100644 index 000000000..6aa4c37f5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Products.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Products is the basic handle type in this file. Example: +// // Create a default Products object: +// Products handle = ProductsDefault(); +// Functions involving Products are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCTS +#define C_INTERFACE_GNDS_V2_0_GENERAL_PRODUCTS + +#include "GNDStk.h" +#include "v2.0/general/Product.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ProductsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Products +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ProductsClass *Products; + +// --- Const-aware handles. +typedef const struct ProductsClass *const ConstHandle2ConstProducts; +typedef struct ProductsClass *const ConstHandle2Products; +typedef const struct ProductsClass * Handle2ConstProducts; +typedef struct ProductsClass * Handle2Products; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstProducts +ProductsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Products +ProductsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProducts +ProductsCreateConst( + ConstHandle2Product *const product, const size_t productSize +); + +// +++ Create, general, non-const +extern_c Handle2Products +ProductsCreate( + ConstHandle2Product *const product, const size_t productSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ProductsAssign(ConstHandle2Products self, ConstHandle2ConstProducts from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ProductsDelete(ConstHandle2ConstProducts self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ProductsRead(ConstHandle2Products self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ProductsWrite(ConstHandle2ConstProducts self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ProductsPrint(ConstHandle2ConstProducts self); + +// +++ Print to standard output, as XML +extern_c int +ProductsPrintXML(ConstHandle2ConstProducts self); + +// +++ Print to standard output, as JSON +extern_c int +ProductsPrintJSON(ConstHandle2ConstProducts self); + + +// ----------------------------------------------------------------------------- +// Child: product +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductsProductHas(ConstHandle2ConstProducts self); + +// +++ Clear +extern_c void +ProductsProductClear(ConstHandle2Products self); + +// +++ Size +extern_c size_t +ProductsProductSize(ConstHandle2ConstProducts self); + +// +++ Add +extern_c void +ProductsProductAdd(ConstHandle2Products self, ConstHandle2ConstProduct product); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstProduct +ProductsProductGetConst(ConstHandle2ConstProducts self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Product +ProductsProductGet(ConstHandle2Products self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ProductsProductSet( + ConstHandle2Products self, + const size_t index_, + ConstHandle2ConstProduct product +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ProductsProductHasByLabel( + ConstHandle2ConstProducts self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstProduct +ProductsProductGetByLabelConst( + ConstHandle2ConstProducts self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Product +ProductsProductGetByLabel( + ConstHandle2Products self, + const char *const label +); + +// +++ Set, by label +extern_c void +ProductsProductSetByLabel( + ConstHandle2Products self, + const char *const label, + ConstHandle2ConstProduct product +); + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// +++ Has, by pid +extern_c int +ProductsProductHasByPid( + ConstHandle2ConstProducts self, + const char *const pid +); + +// --- Get, by pid, const +extern_c Handle2ConstProduct +ProductsProductGetByPidConst( + ConstHandle2ConstProducts self, + const char *const pid +); + +// +++ Get, by pid, non-const +extern_c Handle2Product +ProductsProductGetByPid( + ConstHandle2Products self, + const char *const pid +); + +// +++ Set, by pid +extern_c void +ProductsProductSetByPid( + ConstHandle2Products self, + const char *const pid, + ConstHandle2ConstProduct product +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Products/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Products/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Products/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Products/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Products/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProjectileEnergyDomain.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProjectileEnergyDomain.cpp new file mode 100644 index 000000000..4e333d867 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProjectileEnergyDomain.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ProjectileEnergyDomain.hpp" +#include "ProjectileEnergyDomain.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ProjectileEnergyDomainClass; +using CPP = multigroup::ProjectileEnergyDomain; + +static const std::string CLASSNAME = "ProjectileEnergyDomain"; + +namespace extract { + static auto min = [](auto &obj) { return &obj.min; }; + static auto max = [](auto &obj) { return &obj.max; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProjectileEnergyDomain +ProjectileEnergyDomainDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ProjectileEnergyDomain +ProjectileEnergyDomainDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProjectileEnergyDomain +ProjectileEnergyDomainCreateConst( + const double min, + const double max, + const char *const unit +) { + ConstHandle2ProjectileEnergyDomain handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + min, + max, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2ProjectileEnergyDomain +ProjectileEnergyDomainCreate( + const double min, + const double max, + const char *const unit +) { + ConstHandle2ProjectileEnergyDomain handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + min, + max, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ProjectileEnergyDomainAssign(ConstHandle2ProjectileEnergyDomain self, ConstHandle2ConstProjectileEnergyDomain from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ProjectileEnergyDomainDelete(ConstHandle2ConstProjectileEnergyDomain self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ProjectileEnergyDomainRead(ConstHandle2ProjectileEnergyDomain self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ProjectileEnergyDomainWrite(ConstHandle2ConstProjectileEnergyDomain self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ProjectileEnergyDomainPrint(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ProjectileEnergyDomainPrintXML(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ProjectileEnergyDomainPrintJSON(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: min +// ----------------------------------------------------------------------------- + +// Has +int +ProjectileEnergyDomainMinHas(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MinHas", self, extract::min); +} + +// Get +// Returns by value +double +ProjectileEnergyDomainMinGet(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MinGet", self, extract::min); +} + +// Set +void +ProjectileEnergyDomainMinSet(ConstHandle2ProjectileEnergyDomain self, const double min) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MinSet", self, extract::min, min); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: max +// ----------------------------------------------------------------------------- + +// Has +int +ProjectileEnergyDomainMaxHas(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MaxHas", self, extract::max); +} + +// Get +// Returns by value +double +ProjectileEnergyDomainMaxGet(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MaxGet", self, extract::max); +} + +// Set +void +ProjectileEnergyDomainMaxSet(ConstHandle2ProjectileEnergyDomain self, const double max) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MaxSet", self, extract::max, max); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +ProjectileEnergyDomainUnitHas(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +ProjectileEnergyDomainUnitGet(ConstHandle2ConstProjectileEnergyDomain self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +ProjectileEnergyDomainUnitSet(ConstHandle2ProjectileEnergyDomain self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ProjectileEnergyDomain/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProjectileEnergyDomain.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProjectileEnergyDomain.h new file mode 100644 index 000000000..838d872f0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProjectileEnergyDomain.h @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ProjectileEnergyDomain is the basic handle type in this file. Example: +// // Create a default ProjectileEnergyDomain object: +// ProjectileEnergyDomain handle = ProjectileEnergyDomainDefault(); +// Functions involving ProjectileEnergyDomain are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PROJECTILEENERGYDOMAIN +#define C_INTERFACE_GNDS_V2_0_GENERAL_PROJECTILEENERGYDOMAIN + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ProjectileEnergyDomainClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ProjectileEnergyDomain +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ProjectileEnergyDomainClass *ProjectileEnergyDomain; + +// --- Const-aware handles. +typedef const struct ProjectileEnergyDomainClass *const ConstHandle2ConstProjectileEnergyDomain; +typedef struct ProjectileEnergyDomainClass *const ConstHandle2ProjectileEnergyDomain; +typedef const struct ProjectileEnergyDomainClass * Handle2ConstProjectileEnergyDomain; +typedef struct ProjectileEnergyDomainClass * Handle2ProjectileEnergyDomain; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstProjectileEnergyDomain +ProjectileEnergyDomainDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ProjectileEnergyDomain +ProjectileEnergyDomainDefault(); + +// --- Create, general, const +extern_c Handle2ConstProjectileEnergyDomain +ProjectileEnergyDomainCreateConst( + const double min, + const double max, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2ProjectileEnergyDomain +ProjectileEnergyDomainCreate( + const double min, + const double max, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ProjectileEnergyDomainAssign(ConstHandle2ProjectileEnergyDomain self, ConstHandle2ConstProjectileEnergyDomain from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ProjectileEnergyDomainDelete(ConstHandle2ConstProjectileEnergyDomain self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ProjectileEnergyDomainRead(ConstHandle2ProjectileEnergyDomain self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ProjectileEnergyDomainWrite(ConstHandle2ConstProjectileEnergyDomain self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ProjectileEnergyDomainPrint(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Print to standard output, as XML +extern_c int +ProjectileEnergyDomainPrintXML(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Print to standard output, as JSON +extern_c int +ProjectileEnergyDomainPrintJSON(ConstHandle2ConstProjectileEnergyDomain self); + + +// ----------------------------------------------------------------------------- +// Metadatum: min +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProjectileEnergyDomainMinHas(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Get +// +++ Returns by value +extern_c double +ProjectileEnergyDomainMinGet(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Set +extern_c void +ProjectileEnergyDomainMinSet(ConstHandle2ProjectileEnergyDomain self, const double min); + + +// ----------------------------------------------------------------------------- +// Metadatum: max +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProjectileEnergyDomainMaxHas(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Get +// +++ Returns by value +extern_c double +ProjectileEnergyDomainMaxGet(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Set +extern_c void +ProjectileEnergyDomainMaxSet(ConstHandle2ProjectileEnergyDomain self, const double max); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProjectileEnergyDomainUnitHas(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ProjectileEnergyDomainUnitGet(ConstHandle2ConstProjectileEnergyDomain self); + +// +++ Set +extern_c void +ProjectileEnergyDomainUnitSet(ConstHandle2ProjectileEnergyDomain self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ProjectileEnergyDomain/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProjectileEnergyDomain/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProjectileEnergyDomain/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProjectileEnergyDomain/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ProjectileEnergyDomain/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptGammaEnergy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptGammaEnergy.cpp new file mode 100644 index 000000000..e6f991ff5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptGammaEnergy.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/PromptGammaEnergy.hpp" +#include "PromptGammaEnergy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = PromptGammaEnergyClass; +using CPP = multigroup::PromptGammaEnergy; + +static const std::string CLASSNAME = "PromptGammaEnergy"; + +namespace extract { + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPPolynomial1d = general::Polynomial1d; +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPromptGammaEnergy +PromptGammaEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2PromptGammaEnergy +PromptGammaEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPromptGammaEnergy +PromptGammaEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2PromptGammaEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(polynomial1d), + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2PromptGammaEnergy +PromptGammaEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2PromptGammaEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(polynomial1d), + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +PromptGammaEnergyAssign(ConstHandle2PromptGammaEnergy self, ConstHandle2ConstPromptGammaEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +PromptGammaEnergyDelete(ConstHandle2ConstPromptGammaEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +PromptGammaEnergyRead(ConstHandle2PromptGammaEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +PromptGammaEnergyWrite(ConstHandle2ConstPromptGammaEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +PromptGammaEnergyPrint(ConstHandle2ConstPromptGammaEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +PromptGammaEnergyPrintXML(ConstHandle2ConstPromptGammaEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +PromptGammaEnergyPrintJSON(ConstHandle2ConstPromptGammaEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// Has +int +PromptGammaEnergyPolynomial1dHas(ConstHandle2ConstPromptGammaEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Polynomial1dHas", self, extract::polynomial1d); +} + +// Get, const +Handle2ConstPolynomial1d +PromptGammaEnergyPolynomial1dGetConst(ConstHandle2ConstPromptGammaEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGetConst", self, extract::polynomial1d); +} + +// Get, non-const +Handle2Polynomial1d +PromptGammaEnergyPolynomial1dGet(ConstHandle2PromptGammaEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGet", self, extract::polynomial1d); +} + +// Set +void +PromptGammaEnergyPolynomial1dSet(ConstHandle2PromptGammaEnergy self, ConstHandle2ConstPolynomial1d polynomial1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Polynomial1dSet", self, extract::polynomial1d, polynomial1d); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +PromptGammaEnergyXYs1dHas(ConstHandle2ConstPromptGammaEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +PromptGammaEnergyXYs1dGetConst(ConstHandle2ConstPromptGammaEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +PromptGammaEnergyXYs1dGet(ConstHandle2PromptGammaEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +PromptGammaEnergyXYs1dSet(ConstHandle2PromptGammaEnergy self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PromptGammaEnergy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptGammaEnergy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptGammaEnergy.h new file mode 100644 index 000000000..5151b6492 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptGammaEnergy.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// PromptGammaEnergy is the basic handle type in this file. Example: +// // Create a default PromptGammaEnergy object: +// PromptGammaEnergy handle = PromptGammaEnergyDefault(); +// Functions involving PromptGammaEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PROMPTGAMMAENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_PROMPTGAMMAENERGY + +#include "GNDStk.h" +#include "v2.0/general/Polynomial1d.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct PromptGammaEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ PromptGammaEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct PromptGammaEnergyClass *PromptGammaEnergy; + +// --- Const-aware handles. +typedef const struct PromptGammaEnergyClass *const ConstHandle2ConstPromptGammaEnergy; +typedef struct PromptGammaEnergyClass *const ConstHandle2PromptGammaEnergy; +typedef const struct PromptGammaEnergyClass * Handle2ConstPromptGammaEnergy; +typedef struct PromptGammaEnergyClass * Handle2PromptGammaEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPromptGammaEnergy +PromptGammaEnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2PromptGammaEnergy +PromptGammaEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstPromptGammaEnergy +PromptGammaEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2PromptGammaEnergy +PromptGammaEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +PromptGammaEnergyAssign(ConstHandle2PromptGammaEnergy self, ConstHandle2ConstPromptGammaEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +PromptGammaEnergyDelete(ConstHandle2ConstPromptGammaEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +PromptGammaEnergyRead(ConstHandle2PromptGammaEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +PromptGammaEnergyWrite(ConstHandle2ConstPromptGammaEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +PromptGammaEnergyPrint(ConstHandle2ConstPromptGammaEnergy self); + +// +++ Print to standard output, as XML +extern_c int +PromptGammaEnergyPrintXML(ConstHandle2ConstPromptGammaEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +PromptGammaEnergyPrintJSON(ConstHandle2ConstPromptGammaEnergy self); + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PromptGammaEnergyPolynomial1dHas(ConstHandle2ConstPromptGammaEnergy self); + +// --- Get, const +extern_c Handle2ConstPolynomial1d +PromptGammaEnergyPolynomial1dGetConst(ConstHandle2ConstPromptGammaEnergy self); + +// +++ Get, non-const +extern_c Handle2Polynomial1d +PromptGammaEnergyPolynomial1dGet(ConstHandle2PromptGammaEnergy self); + +// +++ Set +extern_c void +PromptGammaEnergyPolynomial1dSet(ConstHandle2PromptGammaEnergy self, ConstHandle2ConstPolynomial1d polynomial1d); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PromptGammaEnergyXYs1dHas(ConstHandle2ConstPromptGammaEnergy self); + +// --- Get, const +extern_c Handle2ConstXYs1d +PromptGammaEnergyXYs1dGetConst(ConstHandle2ConstPromptGammaEnergy self); + +// +++ Get, non-const +extern_c Handle2XYs1d +PromptGammaEnergyXYs1dGet(ConstHandle2PromptGammaEnergy self); + +// +++ Set +extern_c void +PromptGammaEnergyXYs1dSet(ConstHandle2PromptGammaEnergy self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PromptGammaEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptGammaEnergy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptGammaEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptGammaEnergy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptGammaEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptNeutronKE.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptNeutronKE.cpp new file mode 100644 index 000000000..1e58f15be --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptNeutronKE.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/PromptNeutronKE.hpp" +#include "PromptNeutronKE.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = PromptNeutronKEClass; +using CPP = multigroup::PromptNeutronKE; + +static const std::string CLASSNAME = "PromptNeutronKE"; + +namespace extract { + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPPolynomial1d = general::Polynomial1d; +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPromptNeutronKE +PromptNeutronKEDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2PromptNeutronKE +PromptNeutronKEDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPromptNeutronKE +PromptNeutronKECreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2PromptNeutronKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(polynomial1d), + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2PromptNeutronKE +PromptNeutronKECreate( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2PromptNeutronKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(polynomial1d), + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +PromptNeutronKEAssign(ConstHandle2PromptNeutronKE self, ConstHandle2ConstPromptNeutronKE from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +PromptNeutronKEDelete(ConstHandle2ConstPromptNeutronKE self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +PromptNeutronKERead(ConstHandle2PromptNeutronKE self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +PromptNeutronKEWrite(ConstHandle2ConstPromptNeutronKE self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +PromptNeutronKEPrint(ConstHandle2ConstPromptNeutronKE self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +PromptNeutronKEPrintXML(ConstHandle2ConstPromptNeutronKE self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +PromptNeutronKEPrintJSON(ConstHandle2ConstPromptNeutronKE self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// Has +int +PromptNeutronKEPolynomial1dHas(ConstHandle2ConstPromptNeutronKE self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Polynomial1dHas", self, extract::polynomial1d); +} + +// Get, const +Handle2ConstPolynomial1d +PromptNeutronKEPolynomial1dGetConst(ConstHandle2ConstPromptNeutronKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGetConst", self, extract::polynomial1d); +} + +// Get, non-const +Handle2Polynomial1d +PromptNeutronKEPolynomial1dGet(ConstHandle2PromptNeutronKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGet", self, extract::polynomial1d); +} + +// Set +void +PromptNeutronKEPolynomial1dSet(ConstHandle2PromptNeutronKE self, ConstHandle2ConstPolynomial1d polynomial1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Polynomial1dSet", self, extract::polynomial1d, polynomial1d); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +PromptNeutronKEXYs1dHas(ConstHandle2ConstPromptNeutronKE self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +PromptNeutronKEXYs1dGetConst(ConstHandle2ConstPromptNeutronKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +PromptNeutronKEXYs1dGet(ConstHandle2PromptNeutronKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +PromptNeutronKEXYs1dSet(ConstHandle2PromptNeutronKE self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PromptNeutronKE/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptNeutronKE.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptNeutronKE.h new file mode 100644 index 000000000..95ad247a4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptNeutronKE.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// PromptNeutronKE is the basic handle type in this file. Example: +// // Create a default PromptNeutronKE object: +// PromptNeutronKE handle = PromptNeutronKEDefault(); +// Functions involving PromptNeutronKE are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PROMPTNEUTRONKE +#define C_INTERFACE_GNDS_V2_0_GENERAL_PROMPTNEUTRONKE + +#include "GNDStk.h" +#include "v2.0/general/Polynomial1d.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct PromptNeutronKEClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ PromptNeutronKE +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct PromptNeutronKEClass *PromptNeutronKE; + +// --- Const-aware handles. +typedef const struct PromptNeutronKEClass *const ConstHandle2ConstPromptNeutronKE; +typedef struct PromptNeutronKEClass *const ConstHandle2PromptNeutronKE; +typedef const struct PromptNeutronKEClass * Handle2ConstPromptNeutronKE; +typedef struct PromptNeutronKEClass * Handle2PromptNeutronKE; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPromptNeutronKE +PromptNeutronKEDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2PromptNeutronKE +PromptNeutronKEDefault(); + +// --- Create, general, const +extern_c Handle2ConstPromptNeutronKE +PromptNeutronKECreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2PromptNeutronKE +PromptNeutronKECreate( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +PromptNeutronKEAssign(ConstHandle2PromptNeutronKE self, ConstHandle2ConstPromptNeutronKE from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +PromptNeutronKEDelete(ConstHandle2ConstPromptNeutronKE self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +PromptNeutronKERead(ConstHandle2PromptNeutronKE self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +PromptNeutronKEWrite(ConstHandle2ConstPromptNeutronKE self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +PromptNeutronKEPrint(ConstHandle2ConstPromptNeutronKE self); + +// +++ Print to standard output, as XML +extern_c int +PromptNeutronKEPrintXML(ConstHandle2ConstPromptNeutronKE self); + +// +++ Print to standard output, as JSON +extern_c int +PromptNeutronKEPrintJSON(ConstHandle2ConstPromptNeutronKE self); + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PromptNeutronKEPolynomial1dHas(ConstHandle2ConstPromptNeutronKE self); + +// --- Get, const +extern_c Handle2ConstPolynomial1d +PromptNeutronKEPolynomial1dGetConst(ConstHandle2ConstPromptNeutronKE self); + +// +++ Get, non-const +extern_c Handle2Polynomial1d +PromptNeutronKEPolynomial1dGet(ConstHandle2PromptNeutronKE self); + +// +++ Set +extern_c void +PromptNeutronKEPolynomial1dSet(ConstHandle2PromptNeutronKE self, ConstHandle2ConstPolynomial1d polynomial1d); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PromptNeutronKEXYs1dHas(ConstHandle2ConstPromptNeutronKE self); + +// --- Get, const +extern_c Handle2ConstXYs1d +PromptNeutronKEXYs1dGetConst(ConstHandle2ConstPromptNeutronKE self); + +// +++ Get, non-const +extern_c Handle2XYs1d +PromptNeutronKEXYs1dGet(ConstHandle2PromptNeutronKE self); + +// +++ Set +extern_c void +PromptNeutronKEXYs1dSet(ConstHandle2PromptNeutronKE self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PromptNeutronKE/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptNeutronKE/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptNeutronKE/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptNeutronKE/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptNeutronKE/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptProductKE.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptProductKE.cpp new file mode 100644 index 000000000..573ef9a42 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptProductKE.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/PromptProductKE.hpp" +#include "PromptProductKE.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = PromptProductKEClass; +using CPP = multigroup::PromptProductKE; + +static const std::string CLASSNAME = "PromptProductKE"; + +namespace extract { + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPPolynomial1d = general::Polynomial1d; +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPromptProductKE +PromptProductKEDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2PromptProductKE +PromptProductKEDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPromptProductKE +PromptProductKECreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2PromptProductKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(polynomial1d), + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2PromptProductKE +PromptProductKECreate( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2PromptProductKE handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(polynomial1d), + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +PromptProductKEAssign(ConstHandle2PromptProductKE self, ConstHandle2ConstPromptProductKE from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +PromptProductKEDelete(ConstHandle2ConstPromptProductKE self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +PromptProductKERead(ConstHandle2PromptProductKE self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +PromptProductKEWrite(ConstHandle2ConstPromptProductKE self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +PromptProductKEPrint(ConstHandle2ConstPromptProductKE self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +PromptProductKEPrintXML(ConstHandle2ConstPromptProductKE self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +PromptProductKEPrintJSON(ConstHandle2ConstPromptProductKE self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// Has +int +PromptProductKEPolynomial1dHas(ConstHandle2ConstPromptProductKE self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Polynomial1dHas", self, extract::polynomial1d); +} + +// Get, const +Handle2ConstPolynomial1d +PromptProductKEPolynomial1dGetConst(ConstHandle2ConstPromptProductKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGetConst", self, extract::polynomial1d); +} + +// Get, non-const +Handle2Polynomial1d +PromptProductKEPolynomial1dGet(ConstHandle2PromptProductKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGet", self, extract::polynomial1d); +} + +// Set +void +PromptProductKEPolynomial1dSet(ConstHandle2PromptProductKE self, ConstHandle2ConstPolynomial1d polynomial1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Polynomial1dSet", self, extract::polynomial1d, polynomial1d); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +PromptProductKEXYs1dHas(ConstHandle2ConstPromptProductKE self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +PromptProductKEXYs1dGetConst(ConstHandle2ConstPromptProductKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +PromptProductKEXYs1dGet(ConstHandle2PromptProductKE self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +PromptProductKEXYs1dSet(ConstHandle2PromptProductKE self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PromptProductKE/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptProductKE.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptProductKE.h new file mode 100644 index 000000000..61fe06e2c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptProductKE.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// PromptProductKE is the basic handle type in this file. Example: +// // Create a default PromptProductKE object: +// PromptProductKE handle = PromptProductKEDefault(); +// Functions involving PromptProductKE are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_PROMPTPRODUCTKE +#define C_INTERFACE_GNDS_V2_0_GENERAL_PROMPTPRODUCTKE + +#include "GNDStk.h" +#include "v2.0/general/Polynomial1d.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct PromptProductKEClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ PromptProductKE +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct PromptProductKEClass *PromptProductKE; + +// --- Const-aware handles. +typedef const struct PromptProductKEClass *const ConstHandle2ConstPromptProductKE; +typedef struct PromptProductKEClass *const ConstHandle2PromptProductKE; +typedef const struct PromptProductKEClass * Handle2ConstPromptProductKE; +typedef struct PromptProductKEClass * Handle2PromptProductKE; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPromptProductKE +PromptProductKEDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2PromptProductKE +PromptProductKEDefault(); + +// --- Create, general, const +extern_c Handle2ConstPromptProductKE +PromptProductKECreateConst( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2PromptProductKE +PromptProductKECreate( + ConstHandle2ConstPolynomial1d polynomial1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +PromptProductKEAssign(ConstHandle2PromptProductKE self, ConstHandle2ConstPromptProductKE from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +PromptProductKEDelete(ConstHandle2ConstPromptProductKE self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +PromptProductKERead(ConstHandle2PromptProductKE self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +PromptProductKEWrite(ConstHandle2ConstPromptProductKE self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +PromptProductKEPrint(ConstHandle2ConstPromptProductKE self); + +// +++ Print to standard output, as XML +extern_c int +PromptProductKEPrintXML(ConstHandle2ConstPromptProductKE self); + +// +++ Print to standard output, as JSON +extern_c int +PromptProductKEPrintJSON(ConstHandle2ConstPromptProductKE self); + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PromptProductKEPolynomial1dHas(ConstHandle2ConstPromptProductKE self); + +// --- Get, const +extern_c Handle2ConstPolynomial1d +PromptProductKEPolynomial1dGetConst(ConstHandle2ConstPromptProductKE self); + +// +++ Get, non-const +extern_c Handle2Polynomial1d +PromptProductKEPolynomial1dGet(ConstHandle2PromptProductKE self); + +// +++ Set +extern_c void +PromptProductKEPolynomial1dSet(ConstHandle2PromptProductKE self, ConstHandle2ConstPolynomial1d polynomial1d); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PromptProductKEXYs1dHas(ConstHandle2ConstPromptProductKE self); + +// --- Get, const +extern_c Handle2ConstXYs1d +PromptProductKEXYs1dGetConst(ConstHandle2ConstPromptProductKE self); + +// +++ Get, non-const +extern_c Handle2XYs1d +PromptProductKEXYs1dGet(ConstHandle2PromptProductKE self); + +// +++ Set +extern_c void +PromptProductKEXYs1dSet(ConstHandle2PromptProductKE self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/PromptProductKE/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptProductKE/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptProductKE/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptProductKE/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/PromptProductKE/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Q.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Q.cpp new file mode 100644 index 000000000..a9a4ec0ac --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Q.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Q.hpp" +#include "Q.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = QClass; +using CPP = multigroup::Q; + +static const std::string CLASSNAME = "Q"; + +namespace extract { + static auto Double = [](auto &obj) { return &obj.Double; }; + static auto constant1d = [](auto &obj) { return &obj.constant1d; }; +} + +using CPPDouble = general::Double; +using CPPConstant1d = general::Constant1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstQ +QDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Q +QDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstQ +QCreateConst( + ConstHandle2ConstDouble Double, + ConstHandle2ConstConstant1d constant1d +) { + ConstHandle2Q handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(Double), + detail::tocpp(constant1d) + ); + return handle; +} + +// Create, general, non-const +Handle2Q +QCreate( + ConstHandle2ConstDouble Double, + ConstHandle2ConstConstant1d constant1d +) { + ConstHandle2Q handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(Double), + detail::tocpp(constant1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +QAssign(ConstHandle2Q self, ConstHandle2ConstQ from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +QDelete(ConstHandle2ConstQ self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +QRead(ConstHandle2Q self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +QWrite(ConstHandle2ConstQ self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +QPrint(ConstHandle2ConstQ self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +QPrintXML(ConstHandle2ConstQ self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +QPrintJSON(ConstHandle2ConstQ self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +QDoubleHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Get, const +Handle2ConstDouble +QDoubleGetConst(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double); +} + +// Get, non-const +Handle2Double +QDoubleGet(ConstHandle2Q self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double); +} + +// Set +void +QDoubleSet(ConstHandle2Q self, ConstHandle2ConstDouble Double) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, Double); +} + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// Has +int +QConstant1dHas(ConstHandle2ConstQ self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Constant1dHas", self, extract::constant1d); +} + +// Get, const +Handle2ConstConstant1d +QConstant1dGetConst(ConstHandle2ConstQ self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGetConst", self, extract::constant1d); +} + +// Get, non-const +Handle2Constant1d +QConstant1dGet(ConstHandle2Q self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGet", self, extract::constant1d); +} + +// Set +void +QConstant1dSet(ConstHandle2Q self, ConstHandle2ConstConstant1d constant1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Constant1dSet", self, extract::constant1d, constant1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Q/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Q.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Q.h new file mode 100644 index 000000000..95bef6079 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Q.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Q is the basic handle type in this file. Example: +// // Create a default Q object: +// Q handle = QDefault(); +// Functions involving Q are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_Q +#define C_INTERFACE_GNDS_V2_0_GENERAL_Q + +#include "GNDStk.h" +#include "v2.0/general/Double.h" +#include "v2.0/general/Constant1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct QClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Q +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct QClass *Q; + +// --- Const-aware handles. +typedef const struct QClass *const ConstHandle2ConstQ; +typedef struct QClass *const ConstHandle2Q; +typedef const struct QClass * Handle2ConstQ; +typedef struct QClass * Handle2Q; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstQ +QDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Q +QDefault(); + +// --- Create, general, const +extern_c Handle2ConstQ +QCreateConst( + ConstHandle2ConstDouble Double, + ConstHandle2ConstConstant1d constant1d +); + +// +++ Create, general, non-const +extern_c Handle2Q +QCreate( + ConstHandle2ConstDouble Double, + ConstHandle2ConstConstant1d constant1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +QAssign(ConstHandle2Q self, ConstHandle2ConstQ from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +QDelete(ConstHandle2ConstQ self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +QRead(ConstHandle2Q self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +QWrite(ConstHandle2ConstQ self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +QPrint(ConstHandle2ConstQ self); + +// +++ Print to standard output, as XML +extern_c int +QPrintXML(ConstHandle2ConstQ self); + +// +++ Print to standard output, as JSON +extern_c int +QPrintJSON(ConstHandle2ConstQ self); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QDoubleHas(ConstHandle2ConstQ self); + +// --- Get, const +extern_c Handle2ConstDouble +QDoubleGetConst(ConstHandle2ConstQ self); + +// +++ Get, non-const +extern_c Handle2Double +QDoubleGet(ConstHandle2Q self); + +// +++ Set +extern_c void +QDoubleSet(ConstHandle2Q self, ConstHandle2ConstDouble Double); + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +QConstant1dHas(ConstHandle2ConstQ self); + +// --- Get, const +extern_c Handle2ConstConstant1d +QConstant1dGetConst(ConstHandle2ConstQ self); + +// +++ Get, non-const +extern_c Handle2Constant1d +QConstant1dGet(ConstHandle2Q self); + +// +++ Set +extern_c void +QConstant1dSet(ConstHandle2Q self, ConstHandle2ConstConstant1d constant1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Q/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Q/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Q/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Q/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Q/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/R.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/R.cpp new file mode 100644 index 000000000..5eec8b259 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/R.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/R.hpp" +#include "R.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = RClass; +using CPP = multigroup::R; + +static const std::string CLASSNAME = "R"; + +namespace extract { + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; +} + +using CPPXYs2d = general::XYs2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstR +RDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2R +RDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstR +RCreateConst( + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2R handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs2d) + ); + return handle; +} + +// Create, general, non-const +Handle2R +RCreate( + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2R handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs2d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +RAssign(ConstHandle2R self, ConstHandle2ConstR from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RDelete(ConstHandle2ConstR self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RRead(ConstHandle2R self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RWrite(ConstHandle2ConstR self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RPrint(ConstHandle2ConstR self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RPrintXML(ConstHandle2ConstR self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RPrintJSON(ConstHandle2ConstR self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +RXYs2dHas(ConstHandle2ConstR self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +RXYs2dGetConst(ConstHandle2ConstR self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +RXYs2dGet(ConstHandle2R self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +RXYs2dSet(ConstHandle2R self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/R/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/R.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/R.h new file mode 100644 index 000000000..6dd61f709 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/R.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// R is the basic handle type in this file. Example: +// // Create a default R object: +// R handle = RDefault(); +// Functions involving R are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_R +#define C_INTERFACE_GNDS_V2_0_GENERAL_R + +#include "GNDStk.h" +#include "v2.0/general/XYs2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ R +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RClass *R; + +// --- Const-aware handles. +typedef const struct RClass *const ConstHandle2ConstR; +typedef struct RClass *const ConstHandle2R; +typedef const struct RClass * Handle2ConstR; +typedef struct RClass * Handle2R; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstR +RDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2R +RDefault(); + +// --- Create, general, const +extern_c Handle2ConstR +RCreateConst( + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general, non-const +extern_c Handle2R +RCreate( + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +RAssign(ConstHandle2R self, ConstHandle2ConstR from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RDelete(ConstHandle2ConstR self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RRead(ConstHandle2R self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RWrite(ConstHandle2ConstR self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RPrint(ConstHandle2ConstR self); + +// +++ Print to standard output, as XML +extern_c int +RPrintXML(ConstHandle2ConstR self); + +// +++ Print to standard output, as JSON +extern_c int +RPrintJSON(ConstHandle2ConstR self); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RXYs2dHas(ConstHandle2ConstR self); + +// --- Get, const +extern_c Handle2ConstXYs2d +RXYs2dGetConst(ConstHandle2ConstR self); + +// +++ Get, non-const +extern_c Handle2XYs2d +RXYs2dGet(ConstHandle2R self); + +// +++ Set +extern_c void +RXYs2dSet(ConstHandle2R self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/R/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/R/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/R/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/R/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/R/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RMatrix.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RMatrix.cpp new file mode 100644 index 000000000..0fbc1591b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RMatrix.cpp @@ -0,0 +1,442 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/RMatrix.hpp" +#include "RMatrix.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = RMatrixClass; +using CPP = multigroup::RMatrix; + +static const std::string CLASSNAME = "RMatrix"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto approximation = [](auto &obj) { return &obj.approximation; }; + static auto boundaryCondition = [](auto &obj) { return &obj.boundaryCondition; }; + static auto calculateChannelRadius = [](auto &obj) { return &obj.calculateChannelRadius; }; + static auto supportsAngularReconstruction = [](auto &obj) { return &obj.supportsAngularReconstruction; }; + static auto PoPs = [](auto &obj) { return &obj.PoPs; }; + static auto resonanceReactions = [](auto &obj) { return &obj.resonanceReactions; }; + static auto spinGroups = [](auto &obj) { return &obj.spinGroups; }; +} + +using CPPPoPs = top::PoPs; +using CPPResonanceReactions = general::ResonanceReactions; +using CPPSpinGroups = general::SpinGroups; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRMatrix +RMatrixDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2RMatrix +RMatrixDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRMatrix +RMatrixCreateConst( + const char *const label, + const char *const approximation, + const char *const boundaryCondition, + const bool calculateChannelRadius, + const bool supportsAngularReconstruction, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstSpinGroups spinGroups +) { + ConstHandle2RMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + approximation, + boundaryCondition, + calculateChannelRadius, + supportsAngularReconstruction, + detail::tocpp(PoPs), + detail::tocpp(resonanceReactions), + detail::tocpp(spinGroups) + ); + return handle; +} + +// Create, general, non-const +Handle2RMatrix +RMatrixCreate( + const char *const label, + const char *const approximation, + const char *const boundaryCondition, + const bool calculateChannelRadius, + const bool supportsAngularReconstruction, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstSpinGroups spinGroups +) { + ConstHandle2RMatrix handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + approximation, + boundaryCondition, + calculateChannelRadius, + supportsAngularReconstruction, + detail::tocpp(PoPs), + detail::tocpp(resonanceReactions), + detail::tocpp(spinGroups) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +RMatrixAssign(ConstHandle2RMatrix self, ConstHandle2ConstRMatrix from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RMatrixDelete(ConstHandle2ConstRMatrix self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RMatrixRead(ConstHandle2RMatrix self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RMatrixWrite(ConstHandle2ConstRMatrix self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RMatrixPrint(ConstHandle2ConstRMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RMatrixPrintXML(ConstHandle2ConstRMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RMatrixPrintJSON(ConstHandle2ConstRMatrix self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixLabelHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +RMatrixLabelGet(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +RMatrixLabelSet(ConstHandle2RMatrix self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: approximation +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixApproximationHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ApproximationHas", self, extract::approximation); +} + +// Get +// Returns by value +const char * +RMatrixApproximationGet(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ApproximationGet", self, extract::approximation); +} + +// Set +void +RMatrixApproximationSet(ConstHandle2RMatrix self, const char *const approximation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ApproximationSet", self, extract::approximation, approximation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: boundaryCondition +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixBoundaryConditionHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BoundaryConditionHas", self, extract::boundaryCondition); +} + +// Get +// Returns by value +const char * +RMatrixBoundaryConditionGet(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BoundaryConditionGet", self, extract::boundaryCondition); +} + +// Set +void +RMatrixBoundaryConditionSet(ConstHandle2RMatrix self, const char *const boundaryCondition) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BoundaryConditionSet", self, extract::boundaryCondition, boundaryCondition); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: calculateChannelRadius +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixCalculateChannelRadiusHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CalculateChannelRadiusHas", self, extract::calculateChannelRadius); +} + +// Get +// Returns by value +bool +RMatrixCalculateChannelRadiusGet(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CalculateChannelRadiusGet", self, extract::calculateChannelRadius); +} + +// Set +void +RMatrixCalculateChannelRadiusSet(ConstHandle2RMatrix self, const bool calculateChannelRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CalculateChannelRadiusSet", self, extract::calculateChannelRadius, calculateChannelRadius); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: supportsAngularReconstruction +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixSupportsAngularReconstructionHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SupportsAngularReconstructionHas", self, extract::supportsAngularReconstruction); +} + +// Get +// Returns by value +bool +RMatrixSupportsAngularReconstructionGet(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SupportsAngularReconstructionGet", self, extract::supportsAngularReconstruction); +} + +// Set +void +RMatrixSupportsAngularReconstructionSet(ConstHandle2RMatrix self, const bool supportsAngularReconstruction) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SupportsAngularReconstructionSet", self, extract::supportsAngularReconstruction, supportsAngularReconstruction); +} + + +// ----------------------------------------------------------------------------- +// Child: PoPs +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixPoPsHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PoPsHas", self, extract::PoPs); +} + +// Get, const +Handle2ConstPoPs +RMatrixPoPsGetConst(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPsGetConst", self, extract::PoPs); +} + +// Get, non-const +Handle2PoPs +RMatrixPoPsGet(ConstHandle2RMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPsGet", self, extract::PoPs); +} + +// Set +void +RMatrixPoPsSet(ConstHandle2RMatrix self, ConstHandle2ConstPoPs PoPs) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PoPsSet", self, extract::PoPs, PoPs); +} + + +// ----------------------------------------------------------------------------- +// Child: resonanceReactions +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixResonanceReactionsHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResonanceReactionsHas", self, extract::resonanceReactions); +} + +// Get, const +Handle2ConstResonanceReactions +RMatrixResonanceReactionsGetConst(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonanceReactionsGetConst", self, extract::resonanceReactions); +} + +// Get, non-const +Handle2ResonanceReactions +RMatrixResonanceReactionsGet(ConstHandle2RMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonanceReactionsGet", self, extract::resonanceReactions); +} + +// Set +void +RMatrixResonanceReactionsSet(ConstHandle2RMatrix self, ConstHandle2ConstResonanceReactions resonanceReactions) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResonanceReactionsSet", self, extract::resonanceReactions, resonanceReactions); +} + + +// ----------------------------------------------------------------------------- +// Child: spinGroups +// ----------------------------------------------------------------------------- + +// Has +int +RMatrixSpinGroupsHas(ConstHandle2ConstRMatrix self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SpinGroupsHas", self, extract::spinGroups); +} + +// Get, const +Handle2ConstSpinGroups +RMatrixSpinGroupsGetConst(ConstHandle2ConstRMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGroupsGetConst", self, extract::spinGroups); +} + +// Get, non-const +Handle2SpinGroups +RMatrixSpinGroupsGet(ConstHandle2RMatrix self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGroupsGet", self, extract::spinGroups); +} + +// Set +void +RMatrixSpinGroupsSet(ConstHandle2RMatrix self, ConstHandle2ConstSpinGroups spinGroups) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SpinGroupsSet", self, extract::spinGroups, spinGroups); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/RMatrix/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RMatrix.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RMatrix.h new file mode 100644 index 000000000..67eae6793 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RMatrix.h @@ -0,0 +1,309 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// RMatrix is the basic handle type in this file. Example: +// // Create a default RMatrix object: +// RMatrix handle = RMatrixDefault(); +// Functions involving RMatrix are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_RMATRIX +#define C_INTERFACE_GNDS_V2_0_GENERAL_RMATRIX + +#include "GNDStk.h" +#include "v2.0/top/PoPs.h" +#include "v2.0/general/ResonanceReactions.h" +#include "v2.0/general/SpinGroups.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RMatrixClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ RMatrix +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RMatrixClass *RMatrix; + +// --- Const-aware handles. +typedef const struct RMatrixClass *const ConstHandle2ConstRMatrix; +typedef struct RMatrixClass *const ConstHandle2RMatrix; +typedef const struct RMatrixClass * Handle2ConstRMatrix; +typedef struct RMatrixClass * Handle2RMatrix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRMatrix +RMatrixDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2RMatrix +RMatrixDefault(); + +// --- Create, general, const +extern_c Handle2ConstRMatrix +RMatrixCreateConst( + const char *const label, + const char *const approximation, + const char *const boundaryCondition, + const bool calculateChannelRadius, + const bool supportsAngularReconstruction, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstSpinGroups spinGroups +); + +// +++ Create, general, non-const +extern_c Handle2RMatrix +RMatrixCreate( + const char *const label, + const char *const approximation, + const char *const boundaryCondition, + const bool calculateChannelRadius, + const bool supportsAngularReconstruction, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstSpinGroups spinGroups +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +RMatrixAssign(ConstHandle2RMatrix self, ConstHandle2ConstRMatrix from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RMatrixDelete(ConstHandle2ConstRMatrix self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RMatrixRead(ConstHandle2RMatrix self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RMatrixWrite(ConstHandle2ConstRMatrix self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RMatrixPrint(ConstHandle2ConstRMatrix self); + +// +++ Print to standard output, as XML +extern_c int +RMatrixPrintXML(ConstHandle2ConstRMatrix self); + +// +++ Print to standard output, as JSON +extern_c int +RMatrixPrintJSON(ConstHandle2ConstRMatrix self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixLabelHas(ConstHandle2ConstRMatrix self); + +// +++ Get +// +++ Returns by value +extern_c const char * +RMatrixLabelGet(ConstHandle2ConstRMatrix self); + +// +++ Set +extern_c void +RMatrixLabelSet(ConstHandle2RMatrix self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: approximation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixApproximationHas(ConstHandle2ConstRMatrix self); + +// +++ Get +// +++ Returns by value +extern_c const char * +RMatrixApproximationGet(ConstHandle2ConstRMatrix self); + +// +++ Set +extern_c void +RMatrixApproximationSet(ConstHandle2RMatrix self, const char *const approximation); + + +// ----------------------------------------------------------------------------- +// Metadatum: boundaryCondition +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixBoundaryConditionHas(ConstHandle2ConstRMatrix self); + +// +++ Get +// +++ Returns by value +extern_c const char * +RMatrixBoundaryConditionGet(ConstHandle2ConstRMatrix self); + +// +++ Set +extern_c void +RMatrixBoundaryConditionSet(ConstHandle2RMatrix self, const char *const boundaryCondition); + + +// ----------------------------------------------------------------------------- +// Metadatum: calculateChannelRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixCalculateChannelRadiusHas(ConstHandle2ConstRMatrix self); + +// +++ Get +// +++ Returns by value +extern_c bool +RMatrixCalculateChannelRadiusGet(ConstHandle2ConstRMatrix self); + +// +++ Set +extern_c void +RMatrixCalculateChannelRadiusSet(ConstHandle2RMatrix self, const bool calculateChannelRadius); + + +// ----------------------------------------------------------------------------- +// Metadatum: supportsAngularReconstruction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixSupportsAngularReconstructionHas(ConstHandle2ConstRMatrix self); + +// +++ Get +// +++ Returns by value +extern_c bool +RMatrixSupportsAngularReconstructionGet(ConstHandle2ConstRMatrix self); + +// +++ Set +extern_c void +RMatrixSupportsAngularReconstructionSet(ConstHandle2RMatrix self, const bool supportsAngularReconstruction); + + +// ----------------------------------------------------------------------------- +// Child: PoPs +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixPoPsHas(ConstHandle2ConstRMatrix self); + +// --- Get, const +extern_c Handle2ConstPoPs +RMatrixPoPsGetConst(ConstHandle2ConstRMatrix self); + +// +++ Get, non-const +extern_c Handle2PoPs +RMatrixPoPsGet(ConstHandle2RMatrix self); + +// +++ Set +extern_c void +RMatrixPoPsSet(ConstHandle2RMatrix self, ConstHandle2ConstPoPs PoPs); + + +// ----------------------------------------------------------------------------- +// Child: resonanceReactions +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixResonanceReactionsHas(ConstHandle2ConstRMatrix self); + +// --- Get, const +extern_c Handle2ConstResonanceReactions +RMatrixResonanceReactionsGetConst(ConstHandle2ConstRMatrix self); + +// +++ Get, non-const +extern_c Handle2ResonanceReactions +RMatrixResonanceReactionsGet(ConstHandle2RMatrix self); + +// +++ Set +extern_c void +RMatrixResonanceReactionsSet(ConstHandle2RMatrix self, ConstHandle2ConstResonanceReactions resonanceReactions); + + +// ----------------------------------------------------------------------------- +// Child: spinGroups +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RMatrixSpinGroupsHas(ConstHandle2ConstRMatrix self); + +// --- Get, const +extern_c Handle2ConstSpinGroups +RMatrixSpinGroupsGetConst(ConstHandle2ConstRMatrix self); + +// +++ Get, non-const +extern_c Handle2SpinGroups +RMatrixSpinGroupsGet(ConstHandle2RMatrix self); + +// +++ Set +extern_c void +RMatrixSpinGroupsSet(ConstHandle2RMatrix self, ConstHandle2ConstSpinGroups spinGroups); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/RMatrix/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RMatrix/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RMatrix/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RMatrix/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RMatrix/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Rate.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Rate.cpp new file mode 100644 index 000000000..4f440e48d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Rate.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Rate.hpp" +#include "Rate.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = RateClass; +using CPP = multigroup::Rate; + +static const std::string CLASSNAME = "Rate"; + +namespace extract { + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDouble = general::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRate +RateDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Rate +RateDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRate +RateCreateConst( + ConstHandle2ConstDouble Double +) { + ConstHandle2Rate handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(Double) + ); + return handle; +} + +// Create, general, non-const +Handle2Rate +RateCreate( + ConstHandle2ConstDouble Double +) { + ConstHandle2Rate handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(Double) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +RateAssign(ConstHandle2Rate self, ConstHandle2ConstRate from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RateDelete(ConstHandle2ConstRate self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RateRead(ConstHandle2Rate self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RateWrite(ConstHandle2ConstRate self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RatePrint(ConstHandle2ConstRate self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RatePrintXML(ConstHandle2ConstRate self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RatePrintJSON(ConstHandle2ConstRate self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +RateDoubleHas(ConstHandle2ConstRate self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Get, const +Handle2ConstDouble +RateDoubleGetConst(ConstHandle2ConstRate self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double); +} + +// Get, non-const +Handle2Double +RateDoubleGet(ConstHandle2Rate self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double); +} + +// Set +void +RateDoubleSet(ConstHandle2Rate self, ConstHandle2ConstDouble Double) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Rate/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Rate.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Rate.h new file mode 100644 index 000000000..f88827a4d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Rate.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Rate is the basic handle type in this file. Example: +// // Create a default Rate object: +// Rate handle = RateDefault(); +// Functions involving Rate are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_RATE +#define C_INTERFACE_GNDS_V2_0_GENERAL_RATE + +#include "GNDStk.h" +#include "v2.0/general/Double.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RateClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Rate +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RateClass *Rate; + +// --- Const-aware handles. +typedef const struct RateClass *const ConstHandle2ConstRate; +typedef struct RateClass *const ConstHandle2Rate; +typedef const struct RateClass * Handle2ConstRate; +typedef struct RateClass * Handle2Rate; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRate +RateDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Rate +RateDefault(); + +// --- Create, general, const +extern_c Handle2ConstRate +RateCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general, non-const +extern_c Handle2Rate +RateCreate( + ConstHandle2ConstDouble Double +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +RateAssign(ConstHandle2Rate self, ConstHandle2ConstRate from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RateDelete(ConstHandle2ConstRate self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RateRead(ConstHandle2Rate self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RateWrite(ConstHandle2ConstRate self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RatePrint(ConstHandle2ConstRate self); + +// +++ Print to standard output, as XML +extern_c int +RatePrintXML(ConstHandle2ConstRate self); + +// +++ Print to standard output, as JSON +extern_c int +RatePrintJSON(ConstHandle2ConstRate self); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RateDoubleHas(ConstHandle2ConstRate self); + +// --- Get, const +extern_c Handle2ConstDouble +RateDoubleGetConst(ConstHandle2ConstRate self); + +// +++ Get, non-const +extern_c Handle2Double +RateDoubleGet(ConstHandle2Rate self); + +// +++ Set +extern_c void +RateDoubleSet(ConstHandle2Rate self, ConstHandle2ConstDouble Double); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Rate/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Rate/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Rate/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Rate/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Rate/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reaction.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reaction.cpp new file mode 100644 index 000000000..adac495ac --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reaction.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Reaction.hpp" +#include "Reaction.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ReactionClass; +using CPP = multigroup::Reaction; + +static const std::string CLASSNAME = "Reaction"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto ENDF_MT = [](auto &obj) { return &obj.ENDF_MT; }; + static auto fissionGenre = [](auto &obj) { return &obj.fissionGenre; }; + static auto crossSection = [](auto &obj) { return &obj.crossSection; }; + static auto outputChannel = [](auto &obj) { return &obj.outputChannel; }; + static auto doubleDifferentialCrossSection = [](auto &obj) { return &obj.doubleDifferentialCrossSection; }; +} + +using CPPCrossSection = general::CrossSection; +using CPPOutputChannel = general::OutputChannel; +using CPPDoubleDifferentialCrossSection = general::DoubleDifferentialCrossSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstReaction +ReactionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Reaction +ReactionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstReaction +ReactionCreateConst( + const char *const label, + const int ENDF_MT, + const char *const fissionGenre, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel, + ConstHandle2ConstDoubleDifferentialCrossSection doubleDifferentialCrossSection +) { + ConstHandle2Reaction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + ENDF_MT, + fissionGenre, + detail::tocpp(crossSection), + detail::tocpp(outputChannel), + detail::tocpp(doubleDifferentialCrossSection) + ); + return handle; +} + +// Create, general, non-const +Handle2Reaction +ReactionCreate( + const char *const label, + const int ENDF_MT, + const char *const fissionGenre, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel, + ConstHandle2ConstDoubleDifferentialCrossSection doubleDifferentialCrossSection +) { + ConstHandle2Reaction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + ENDF_MT, + fissionGenre, + detail::tocpp(crossSection), + detail::tocpp(outputChannel), + detail::tocpp(doubleDifferentialCrossSection) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ReactionAssign(ConstHandle2Reaction self, ConstHandle2ConstReaction from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ReactionDelete(ConstHandle2ConstReaction self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ReactionRead(ConstHandle2Reaction self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ReactionWrite(ConstHandle2ConstReaction self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ReactionPrint(ConstHandle2ConstReaction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ReactionPrintXML(ConstHandle2ConstReaction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ReactionPrintJSON(ConstHandle2ConstReaction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ReactionLabelHas(ConstHandle2ConstReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ReactionLabelGet(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ReactionLabelSet(ConstHandle2Reaction self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// Has +int +ReactionENDFMTHas(ConstHandle2ConstReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMTHas", self, extract::ENDF_MT); +} + +// Get +// Returns by value +int +ReactionENDFMTGet(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMTGet", self, extract::ENDF_MT); +} + +// Set +void +ReactionENDFMTSet(ConstHandle2Reaction self, const int ENDF_MT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMTSet", self, extract::ENDF_MT, ENDF_MT); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: fissionGenre +// ----------------------------------------------------------------------------- + +// Has +int +ReactionFissionGenreHas(ConstHandle2ConstReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FissionGenreHas", self, extract::fissionGenre); +} + +// Get +// Returns by value +const char * +ReactionFissionGenreGet(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionGenreGet", self, extract::fissionGenre); +} + +// Set +void +ReactionFissionGenreSet(ConstHandle2Reaction self, const char *const fissionGenre) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FissionGenreSet", self, extract::fissionGenre, fissionGenre); +} + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// Has +int +ReactionCrossSectionHas(ConstHandle2ConstReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossSectionHas", self, extract::crossSection); +} + +// Get, const +Handle2ConstCrossSection +ReactionCrossSectionGetConst(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGetConst", self, extract::crossSection); +} + +// Get, non-const +Handle2CrossSection +ReactionCrossSectionGet(ConstHandle2Reaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionGet", self, extract::crossSection); +} + +// Set +void +ReactionCrossSectionSet(ConstHandle2Reaction self, ConstHandle2ConstCrossSection crossSection) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CrossSectionSet", self, extract::crossSection, crossSection); +} + + +// ----------------------------------------------------------------------------- +// Child: outputChannel +// ----------------------------------------------------------------------------- + +// Has +int +ReactionOutputChannelHas(ConstHandle2ConstReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OutputChannelHas", self, extract::outputChannel); +} + +// Get, const +Handle2ConstOutputChannel +ReactionOutputChannelGetConst(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputChannelGetConst", self, extract::outputChannel); +} + +// Get, non-const +Handle2OutputChannel +ReactionOutputChannelGet(ConstHandle2Reaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OutputChannelGet", self, extract::outputChannel); +} + +// Set +void +ReactionOutputChannelSet(ConstHandle2Reaction self, ConstHandle2ConstOutputChannel outputChannel) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OutputChannelSet", self, extract::outputChannel, outputChannel); +} + + +// ----------------------------------------------------------------------------- +// Child: doubleDifferentialCrossSection +// ----------------------------------------------------------------------------- + +// Has +int +ReactionDoubleDifferentialCrossSectionHas(ConstHandle2ConstReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleDifferentialCrossSectionHas", self, extract::doubleDifferentialCrossSection); +} + +// Get, const +Handle2ConstDoubleDifferentialCrossSection +ReactionDoubleDifferentialCrossSectionGetConst(ConstHandle2ConstReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleDifferentialCrossSectionGetConst", self, extract::doubleDifferentialCrossSection); +} + +// Get, non-const +Handle2DoubleDifferentialCrossSection +ReactionDoubleDifferentialCrossSectionGet(ConstHandle2Reaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleDifferentialCrossSectionGet", self, extract::doubleDifferentialCrossSection); +} + +// Set +void +ReactionDoubleDifferentialCrossSectionSet(ConstHandle2Reaction self, ConstHandle2ConstDoubleDifferentialCrossSection doubleDifferentialCrossSection) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleDifferentialCrossSectionSet", self, extract::doubleDifferentialCrossSection, doubleDifferentialCrossSection); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Reaction/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reaction.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reaction.h new file mode 100644 index 000000000..6ab0354ca --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reaction.h @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Reaction is the basic handle type in this file. Example: +// // Create a default Reaction object: +// Reaction handle = ReactionDefault(); +// Functions involving Reaction are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_REACTION +#define C_INTERFACE_GNDS_V2_0_GENERAL_REACTION + +#include "GNDStk.h" +#include "v2.0/general/CrossSection.h" +#include "v2.0/general/OutputChannel.h" +#include "v2.0/general/DoubleDifferentialCrossSection.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ReactionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Reaction +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ReactionClass *Reaction; + +// --- Const-aware handles. +typedef const struct ReactionClass *const ConstHandle2ConstReaction; +typedef struct ReactionClass *const ConstHandle2Reaction; +typedef const struct ReactionClass * Handle2ConstReaction; +typedef struct ReactionClass * Handle2Reaction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstReaction +ReactionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Reaction +ReactionDefault(); + +// --- Create, general, const +extern_c Handle2ConstReaction +ReactionCreateConst( + const char *const label, + const int ENDF_MT, + const char *const fissionGenre, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel, + ConstHandle2ConstDoubleDifferentialCrossSection doubleDifferentialCrossSection +); + +// +++ Create, general, non-const +extern_c Handle2Reaction +ReactionCreate( + const char *const label, + const int ENDF_MT, + const char *const fissionGenre, + ConstHandle2ConstCrossSection crossSection, + ConstHandle2ConstOutputChannel outputChannel, + ConstHandle2ConstDoubleDifferentialCrossSection doubleDifferentialCrossSection +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ReactionAssign(ConstHandle2Reaction self, ConstHandle2ConstReaction from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ReactionDelete(ConstHandle2ConstReaction self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ReactionRead(ConstHandle2Reaction self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ReactionWrite(ConstHandle2ConstReaction self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ReactionPrint(ConstHandle2ConstReaction self); + +// +++ Print to standard output, as XML +extern_c int +ReactionPrintXML(ConstHandle2ConstReaction self); + +// +++ Print to standard output, as JSON +extern_c int +ReactionPrintJSON(ConstHandle2ConstReaction self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionLabelHas(ConstHandle2ConstReaction self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionLabelGet(ConstHandle2ConstReaction self); + +// +++ Set +extern_c void +ReactionLabelSet(ConstHandle2Reaction self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionENDFMTHas(ConstHandle2ConstReaction self); + +// +++ Get +// +++ Returns by value +extern_c int +ReactionENDFMTGet(ConstHandle2ConstReaction self); + +// +++ Set +extern_c void +ReactionENDFMTSet(ConstHandle2Reaction self, const int ENDF_MT); + + +// ----------------------------------------------------------------------------- +// Metadatum: fissionGenre +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionFissionGenreHas(ConstHandle2ConstReaction self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionFissionGenreGet(ConstHandle2ConstReaction self); + +// +++ Set +extern_c void +ReactionFissionGenreSet(ConstHandle2Reaction self, const char *const fissionGenre); + + +// ----------------------------------------------------------------------------- +// Child: crossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionCrossSectionHas(ConstHandle2ConstReaction self); + +// --- Get, const +extern_c Handle2ConstCrossSection +ReactionCrossSectionGetConst(ConstHandle2ConstReaction self); + +// +++ Get, non-const +extern_c Handle2CrossSection +ReactionCrossSectionGet(ConstHandle2Reaction self); + +// +++ Set +extern_c void +ReactionCrossSectionSet(ConstHandle2Reaction self, ConstHandle2ConstCrossSection crossSection); + + +// ----------------------------------------------------------------------------- +// Child: outputChannel +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionOutputChannelHas(ConstHandle2ConstReaction self); + +// --- Get, const +extern_c Handle2ConstOutputChannel +ReactionOutputChannelGetConst(ConstHandle2ConstReaction self); + +// +++ Get, non-const +extern_c Handle2OutputChannel +ReactionOutputChannelGet(ConstHandle2Reaction self); + +// +++ Set +extern_c void +ReactionOutputChannelSet(ConstHandle2Reaction self, ConstHandle2ConstOutputChannel outputChannel); + + +// ----------------------------------------------------------------------------- +// Child: doubleDifferentialCrossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionDoubleDifferentialCrossSectionHas(ConstHandle2ConstReaction self); + +// --- Get, const +extern_c Handle2ConstDoubleDifferentialCrossSection +ReactionDoubleDifferentialCrossSectionGetConst(ConstHandle2ConstReaction self); + +// +++ Get, non-const +extern_c Handle2DoubleDifferentialCrossSection +ReactionDoubleDifferentialCrossSectionGet(ConstHandle2Reaction self); + +// +++ Set +extern_c void +ReactionDoubleDifferentialCrossSectionSet(ConstHandle2Reaction self, ConstHandle2ConstDoubleDifferentialCrossSection doubleDifferentialCrossSection); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Reaction/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reaction/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reaction/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reaction/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reaction/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reactions.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reactions.cpp new file mode 100644 index 000000000..19481fe2a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reactions.cpp @@ -0,0 +1,359 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Reactions.hpp" +#include "Reactions.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ReactionsClass; +using CPP = multigroup::Reactions; + +static const std::string CLASSNAME = "Reactions"; + +namespace extract { + static auto reaction = [](auto &obj) { return &obj.reaction; }; +} + +using CPPReaction = general::Reaction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstReactions +ReactionsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Reactions +ReactionsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstReactions +ReactionsCreateConst( + ConstHandle2Reaction *const reaction, const size_t reactionSize +) { + ConstHandle2Reactions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ReactionN = 0; ReactionN < reactionSize; ++ReactionN) + ReactionsReactionAdd(handle, reaction[ReactionN]); + return handle; +} + +// Create, general, non-const +Handle2Reactions +ReactionsCreate( + ConstHandle2Reaction *const reaction, const size_t reactionSize +) { + ConstHandle2Reactions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ReactionN = 0; ReactionN < reactionSize; ++ReactionN) + ReactionsReactionAdd(handle, reaction[ReactionN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ReactionsAssign(ConstHandle2Reactions self, ConstHandle2ConstReactions from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ReactionsDelete(ConstHandle2ConstReactions self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ReactionsRead(ConstHandle2Reactions self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ReactionsWrite(ConstHandle2ConstReactions self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ReactionsPrint(ConstHandle2ConstReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ReactionsPrintXML(ConstHandle2ConstReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ReactionsPrintJSON(ConstHandle2ConstReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: reaction +// ----------------------------------------------------------------------------- + +// Has +int +ReactionsReactionHas(ConstHandle2ConstReactions self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ReactionHas", self, extract::reaction); +} + +// Clear +void +ReactionsReactionClear(ConstHandle2Reactions self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ReactionClear", self, extract::reaction); +} + +// Size +size_t +ReactionsReactionSize(ConstHandle2ConstReactions self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ReactionSize", self, extract::reaction); +} + +// Add +void +ReactionsReactionAdd(ConstHandle2Reactions self, ConstHandle2ConstReaction reaction) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ReactionAdd", self, extract::reaction, reaction); +} + +// Get, by index \in [0,size), const +Handle2ConstReaction +ReactionsReactionGetConst(ConstHandle2ConstReactions self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ReactionGetConst", self, extract::reaction, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Reaction +ReactionsReactionGet(ConstHandle2Reactions self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ReactionGet", self, extract::reaction, index_); +} + +// Set, by index \in [0,size) +void +ReactionsReactionSet( + ConstHandle2Reactions self, + const size_t index_, + ConstHandle2ConstReaction reaction +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ReactionSet", self, extract::reaction, index_, reaction); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ReactionsReactionHasByLabel( + ConstHandle2ConstReactions self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ReactionHasByLabel", + self, extract::reaction, meta::label, label); +} + +// Get, by label, const +Handle2ConstReaction +ReactionsReactionGetByLabelConst( + ConstHandle2ConstReactions self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByLabelConst", + self, extract::reaction, meta::label, label); +} + +// Get, by label, non-const +Handle2Reaction +ReactionsReactionGetByLabel( + ConstHandle2Reactions self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByLabel", + self, extract::reaction, meta::label, label); +} + +// Set, by label +void +ReactionsReactionSetByLabel( + ConstHandle2Reactions self, + const char *const label, + ConstHandle2ConstReaction reaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ReactionSetByLabel", + self, extract::reaction, meta::label, label, reaction); +} + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// Has, by ENDF_MT +int +ReactionsReactionHasByENDFMT( + ConstHandle2ConstReactions self, + const int ENDF_MT +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ReactionHasByENDFMT", + self, extract::reaction, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, const +Handle2ConstReaction +ReactionsReactionGetByENDFMTConst( + ConstHandle2ConstReactions self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByENDFMTConst", + self, extract::reaction, meta::ENDF_MT, ENDF_MT); +} + +// Get, by ENDF_MT, non-const +Handle2Reaction +ReactionsReactionGetByENDFMT( + ConstHandle2Reactions self, + const int ENDF_MT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByENDFMT", + self, extract::reaction, meta::ENDF_MT, ENDF_MT); +} + +// Set, by ENDF_MT +void +ReactionsReactionSetByENDFMT( + ConstHandle2Reactions self, + const int ENDF_MT, + ConstHandle2ConstReaction reaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ReactionSetByENDFMT", + self, extract::reaction, meta::ENDF_MT, ENDF_MT, reaction); +} + +// ------------------------ +// Re: metadatum fissionGenre +// ------------------------ + +// Has, by fissionGenre +int +ReactionsReactionHasByFissionGenre( + ConstHandle2ConstReactions self, + const char *const fissionGenre +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ReactionHasByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, const +Handle2ConstReaction +ReactionsReactionGetByFissionGenreConst( + ConstHandle2ConstReactions self, + const char *const fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByFissionGenreConst", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Get, by fissionGenre, non-const +Handle2Reaction +ReactionsReactionGetByFissionGenre( + ConstHandle2Reactions self, + const char *const fissionGenre +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ReactionGetByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre); +} + +// Set, by fissionGenre +void +ReactionsReactionSetByFissionGenre( + ConstHandle2Reactions self, + const char *const fissionGenre, + ConstHandle2ConstReaction reaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ReactionSetByFissionGenre", + self, extract::reaction, meta::fissionGenre, fissionGenre, reaction); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Reactions/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reactions.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reactions.h new file mode 100644 index 000000000..e6a6ce37a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reactions.h @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Reactions is the basic handle type in this file. Example: +// // Create a default Reactions object: +// Reactions handle = ReactionsDefault(); +// Functions involving Reactions are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_REACTIONS +#define C_INTERFACE_GNDS_V2_0_GENERAL_REACTIONS + +#include "GNDStk.h" +#include "v2.0/general/Reaction.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ReactionsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Reactions +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ReactionsClass *Reactions; + +// --- Const-aware handles. +typedef const struct ReactionsClass *const ConstHandle2ConstReactions; +typedef struct ReactionsClass *const ConstHandle2Reactions; +typedef const struct ReactionsClass * Handle2ConstReactions; +typedef struct ReactionsClass * Handle2Reactions; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstReactions +ReactionsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Reactions +ReactionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstReactions +ReactionsCreateConst( + ConstHandle2Reaction *const reaction, const size_t reactionSize +); + +// +++ Create, general, non-const +extern_c Handle2Reactions +ReactionsCreate( + ConstHandle2Reaction *const reaction, const size_t reactionSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ReactionsAssign(ConstHandle2Reactions self, ConstHandle2ConstReactions from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ReactionsDelete(ConstHandle2ConstReactions self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ReactionsRead(ConstHandle2Reactions self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ReactionsWrite(ConstHandle2ConstReactions self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ReactionsPrint(ConstHandle2ConstReactions self); + +// +++ Print to standard output, as XML +extern_c int +ReactionsPrintXML(ConstHandle2ConstReactions self); + +// +++ Print to standard output, as JSON +extern_c int +ReactionsPrintJSON(ConstHandle2ConstReactions self); + + +// ----------------------------------------------------------------------------- +// Child: reaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionsReactionHas(ConstHandle2ConstReactions self); + +// +++ Clear +extern_c void +ReactionsReactionClear(ConstHandle2Reactions self); + +// +++ Size +extern_c size_t +ReactionsReactionSize(ConstHandle2ConstReactions self); + +// +++ Add +extern_c void +ReactionsReactionAdd(ConstHandle2Reactions self, ConstHandle2ConstReaction reaction); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstReaction +ReactionsReactionGetConst(ConstHandle2ConstReactions self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Reaction +ReactionsReactionGet(ConstHandle2Reactions self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ReactionsReactionSet( + ConstHandle2Reactions self, + const size_t index_, + ConstHandle2ConstReaction reaction +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ReactionsReactionHasByLabel( + ConstHandle2ConstReactions self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstReaction +ReactionsReactionGetByLabelConst( + ConstHandle2ConstReactions self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Reaction +ReactionsReactionGetByLabel( + ConstHandle2Reactions self, + const char *const label +); + +// +++ Set, by label +extern_c void +ReactionsReactionSetByLabel( + ConstHandle2Reactions self, + const char *const label, + ConstHandle2ConstReaction reaction +); + +// ------------------------ +// Re: metadatum ENDF_MT +// ------------------------ + +// +++ Has, by ENDF_MT +extern_c int +ReactionsReactionHasByENDFMT( + ConstHandle2ConstReactions self, + const int ENDF_MT +); + +// --- Get, by ENDF_MT, const +extern_c Handle2ConstReaction +ReactionsReactionGetByENDFMTConst( + ConstHandle2ConstReactions self, + const int ENDF_MT +); + +// +++ Get, by ENDF_MT, non-const +extern_c Handle2Reaction +ReactionsReactionGetByENDFMT( + ConstHandle2Reactions self, + const int ENDF_MT +); + +// +++ Set, by ENDF_MT +extern_c void +ReactionsReactionSetByENDFMT( + ConstHandle2Reactions self, + const int ENDF_MT, + ConstHandle2ConstReaction reaction +); + +// ------------------------ +// Re: metadatum fissionGenre +// ------------------------ + +// +++ Has, by fissionGenre +extern_c int +ReactionsReactionHasByFissionGenre( + ConstHandle2ConstReactions self, + const char *const fissionGenre +); + +// --- Get, by fissionGenre, const +extern_c Handle2ConstReaction +ReactionsReactionGetByFissionGenreConst( + ConstHandle2ConstReactions self, + const char *const fissionGenre +); + +// +++ Get, by fissionGenre, non-const +extern_c Handle2Reaction +ReactionsReactionGetByFissionGenre( + ConstHandle2Reactions self, + const char *const fissionGenre +); + +// +++ Set, by fissionGenre +extern_c void +ReactionsReactionSetByFissionGenre( + ConstHandle2Reactions self, + const char *const fissionGenre, + ConstHandle2ConstReaction reaction +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Reactions/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reactions/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reactions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reactions/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reactions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealAnomalousFactor.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealAnomalousFactor.cpp new file mode 100644 index 000000000..9dbc89220 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealAnomalousFactor.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/RealAnomalousFactor.hpp" +#include "RealAnomalousFactor.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = RealAnomalousFactorClass; +using CPP = multigroup::RealAnomalousFactor; + +static const std::string CLASSNAME = "RealAnomalousFactor"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRealAnomalousFactor +RealAnomalousFactorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2RealAnomalousFactor +RealAnomalousFactorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRealAnomalousFactor +RealAnomalousFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2RealAnomalousFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2RealAnomalousFactor +RealAnomalousFactorCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2RealAnomalousFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +RealAnomalousFactorAssign(ConstHandle2RealAnomalousFactor self, ConstHandle2ConstRealAnomalousFactor from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RealAnomalousFactorDelete(ConstHandle2ConstRealAnomalousFactor self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RealAnomalousFactorRead(ConstHandle2RealAnomalousFactor self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RealAnomalousFactorWrite(ConstHandle2ConstRealAnomalousFactor self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RealAnomalousFactorPrint(ConstHandle2ConstRealAnomalousFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RealAnomalousFactorPrintXML(ConstHandle2ConstRealAnomalousFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RealAnomalousFactorPrintJSON(ConstHandle2ConstRealAnomalousFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +RealAnomalousFactorXYs1dHas(ConstHandle2ConstRealAnomalousFactor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +RealAnomalousFactorXYs1dGetConst(ConstHandle2ConstRealAnomalousFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +RealAnomalousFactorXYs1dGet(ConstHandle2RealAnomalousFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +RealAnomalousFactorXYs1dSet(ConstHandle2RealAnomalousFactor self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/RealAnomalousFactor/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealAnomalousFactor.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealAnomalousFactor.h new file mode 100644 index 000000000..36a1bc7d3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealAnomalousFactor.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// RealAnomalousFactor is the basic handle type in this file. Example: +// // Create a default RealAnomalousFactor object: +// RealAnomalousFactor handle = RealAnomalousFactorDefault(); +// Functions involving RealAnomalousFactor are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_REALANOMALOUSFACTOR +#define C_INTERFACE_GNDS_V2_0_GENERAL_REALANOMALOUSFACTOR + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RealAnomalousFactorClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ RealAnomalousFactor +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RealAnomalousFactorClass *RealAnomalousFactor; + +// --- Const-aware handles. +typedef const struct RealAnomalousFactorClass *const ConstHandle2ConstRealAnomalousFactor; +typedef struct RealAnomalousFactorClass *const ConstHandle2RealAnomalousFactor; +typedef const struct RealAnomalousFactorClass * Handle2ConstRealAnomalousFactor; +typedef struct RealAnomalousFactorClass * Handle2RealAnomalousFactor; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRealAnomalousFactor +RealAnomalousFactorDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2RealAnomalousFactor +RealAnomalousFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstRealAnomalousFactor +RealAnomalousFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2RealAnomalousFactor +RealAnomalousFactorCreate( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +RealAnomalousFactorAssign(ConstHandle2RealAnomalousFactor self, ConstHandle2ConstRealAnomalousFactor from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RealAnomalousFactorDelete(ConstHandle2ConstRealAnomalousFactor self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RealAnomalousFactorRead(ConstHandle2RealAnomalousFactor self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RealAnomalousFactorWrite(ConstHandle2ConstRealAnomalousFactor self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RealAnomalousFactorPrint(ConstHandle2ConstRealAnomalousFactor self); + +// +++ Print to standard output, as XML +extern_c int +RealAnomalousFactorPrintXML(ConstHandle2ConstRealAnomalousFactor self); + +// +++ Print to standard output, as JSON +extern_c int +RealAnomalousFactorPrintJSON(ConstHandle2ConstRealAnomalousFactor self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RealAnomalousFactorXYs1dHas(ConstHandle2ConstRealAnomalousFactor self); + +// --- Get, const +extern_c Handle2ConstXYs1d +RealAnomalousFactorXYs1dGetConst(ConstHandle2ConstRealAnomalousFactor self); + +// +++ Get, non-const +extern_c Handle2XYs1d +RealAnomalousFactorXYs1dGet(ConstHandle2RealAnomalousFactor self); + +// +++ Set +extern_c void +RealAnomalousFactorXYs1dSet(ConstHandle2RealAnomalousFactor self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/RealAnomalousFactor/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealAnomalousFactor/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealAnomalousFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealAnomalousFactor/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealAnomalousFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealInterferenceTerm.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealInterferenceTerm.cpp new file mode 100644 index 000000000..6e3e02798 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealInterferenceTerm.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/RealInterferenceTerm.hpp" +#include "RealInterferenceTerm.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = RealInterferenceTermClass; +using CPP = multigroup::RealInterferenceTerm; + +static const std::string CLASSNAME = "RealInterferenceTerm"; + +namespace extract { + static auto regions2d = [](auto &obj) { return &obj.regions2d; }; + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; +} + +using CPPRegions2d = general::Regions2d; +using CPPXYs2d = general::XYs2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRealInterferenceTerm +RealInterferenceTermDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2RealInterferenceTerm +RealInterferenceTermDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRealInterferenceTerm +RealInterferenceTermCreateConst( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2RealInterferenceTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(regions2d), + detail::tocpp(XYs2d) + ); + return handle; +} + +// Create, general, non-const +Handle2RealInterferenceTerm +RealInterferenceTermCreate( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +) { + ConstHandle2RealInterferenceTerm handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(regions2d), + detail::tocpp(XYs2d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +RealInterferenceTermAssign(ConstHandle2RealInterferenceTerm self, ConstHandle2ConstRealInterferenceTerm from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RealInterferenceTermDelete(ConstHandle2ConstRealInterferenceTerm self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RealInterferenceTermRead(ConstHandle2RealInterferenceTerm self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RealInterferenceTermWrite(ConstHandle2ConstRealInterferenceTerm self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RealInterferenceTermPrint(ConstHandle2ConstRealInterferenceTerm self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RealInterferenceTermPrintXML(ConstHandle2ConstRealInterferenceTerm self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RealInterferenceTermPrintJSON(ConstHandle2ConstRealInterferenceTerm self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: regions2d +// ----------------------------------------------------------------------------- + +// Has +int +RealInterferenceTermRegions2dHas(ConstHandle2ConstRealInterferenceTerm self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions2dHas", self, extract::regions2d); +} + +// Get, const +Handle2ConstRegions2d +RealInterferenceTermRegions2dGetConst(ConstHandle2ConstRealInterferenceTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions2dGetConst", self, extract::regions2d); +} + +// Get, non-const +Handle2Regions2d +RealInterferenceTermRegions2dGet(ConstHandle2RealInterferenceTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions2dGet", self, extract::regions2d); +} + +// Set +void +RealInterferenceTermRegions2dSet(ConstHandle2RealInterferenceTerm self, ConstHandle2ConstRegions2d regions2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions2dSet", self, extract::regions2d, regions2d); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +RealInterferenceTermXYs2dHas(ConstHandle2ConstRealInterferenceTerm self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +RealInterferenceTermXYs2dGetConst(ConstHandle2ConstRealInterferenceTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +RealInterferenceTermXYs2dGet(ConstHandle2RealInterferenceTerm self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +RealInterferenceTermXYs2dSet(ConstHandle2RealInterferenceTerm self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/RealInterferenceTerm/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealInterferenceTerm.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealInterferenceTerm.h new file mode 100644 index 000000000..424346dea --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealInterferenceTerm.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// RealInterferenceTerm is the basic handle type in this file. Example: +// // Create a default RealInterferenceTerm object: +// RealInterferenceTerm handle = RealInterferenceTermDefault(); +// Functions involving RealInterferenceTerm are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_REALINTERFERENCETERM +#define C_INTERFACE_GNDS_V2_0_GENERAL_REALINTERFERENCETERM + +#include "GNDStk.h" +#include "v2.0/general/Regions2d.h" +#include "v2.0/general/XYs2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RealInterferenceTermClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ RealInterferenceTerm +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RealInterferenceTermClass *RealInterferenceTerm; + +// --- Const-aware handles. +typedef const struct RealInterferenceTermClass *const ConstHandle2ConstRealInterferenceTerm; +typedef struct RealInterferenceTermClass *const ConstHandle2RealInterferenceTerm; +typedef const struct RealInterferenceTermClass * Handle2ConstRealInterferenceTerm; +typedef struct RealInterferenceTermClass * Handle2RealInterferenceTerm; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRealInterferenceTerm +RealInterferenceTermDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2RealInterferenceTerm +RealInterferenceTermDefault(); + +// --- Create, general, const +extern_c Handle2ConstRealInterferenceTerm +RealInterferenceTermCreateConst( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Create, general, non-const +extern_c Handle2RealInterferenceTerm +RealInterferenceTermCreate( + ConstHandle2ConstRegions2d regions2d, + ConstHandle2ConstXYs2d XYs2d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +RealInterferenceTermAssign(ConstHandle2RealInterferenceTerm self, ConstHandle2ConstRealInterferenceTerm from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RealInterferenceTermDelete(ConstHandle2ConstRealInterferenceTerm self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RealInterferenceTermRead(ConstHandle2RealInterferenceTerm self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RealInterferenceTermWrite(ConstHandle2ConstRealInterferenceTerm self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RealInterferenceTermPrint(ConstHandle2ConstRealInterferenceTerm self); + +// +++ Print to standard output, as XML +extern_c int +RealInterferenceTermPrintXML(ConstHandle2ConstRealInterferenceTerm self); + +// +++ Print to standard output, as JSON +extern_c int +RealInterferenceTermPrintJSON(ConstHandle2ConstRealInterferenceTerm self); + + +// ----------------------------------------------------------------------------- +// Child: regions2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RealInterferenceTermRegions2dHas(ConstHandle2ConstRealInterferenceTerm self); + +// --- Get, const +extern_c Handle2ConstRegions2d +RealInterferenceTermRegions2dGetConst(ConstHandle2ConstRealInterferenceTerm self); + +// +++ Get, non-const +extern_c Handle2Regions2d +RealInterferenceTermRegions2dGet(ConstHandle2RealInterferenceTerm self); + +// +++ Set +extern_c void +RealInterferenceTermRegions2dSet(ConstHandle2RealInterferenceTerm self, ConstHandle2ConstRegions2d regions2d); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RealInterferenceTermXYs2dHas(ConstHandle2ConstRealInterferenceTerm self); + +// --- Get, const +extern_c Handle2ConstXYs2d +RealInterferenceTermXYs2dGetConst(ConstHandle2ConstRealInterferenceTerm self); + +// +++ Get, non-const +extern_c Handle2XYs2d +RealInterferenceTermXYs2dGet(ConstHandle2RealInterferenceTerm self); + +// +++ Set +extern_c void +RealInterferenceTermXYs2dSet(ConstHandle2RealInterferenceTerm self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/RealInterferenceTerm/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealInterferenceTerm/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealInterferenceTerm/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealInterferenceTerm/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RealInterferenceTerm/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Recoil.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Recoil.cpp new file mode 100644 index 000000000..96e4398c2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Recoil.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Recoil.hpp" +#include "Recoil.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = RecoilClass; +using CPP = multigroup::Recoil; + +static const std::string CLASSNAME = "Recoil"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRecoil +RecoilDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Recoil +RecoilDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRecoil +RecoilCreateConst( + const char *const href +) { + ConstHandle2Recoil handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href + ); + return handle; +} + +// Create, general, non-const +Handle2Recoil +RecoilCreate( + const char *const href +) { + ConstHandle2Recoil handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +RecoilAssign(ConstHandle2Recoil self, ConstHandle2ConstRecoil from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RecoilDelete(ConstHandle2ConstRecoil self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RecoilRead(ConstHandle2Recoil self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RecoilWrite(ConstHandle2ConstRecoil self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RecoilPrint(ConstHandle2ConstRecoil self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RecoilPrintXML(ConstHandle2ConstRecoil self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RecoilPrintJSON(ConstHandle2ConstRecoil self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +RecoilHrefHas(ConstHandle2ConstRecoil self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +RecoilHrefGet(ConstHandle2ConstRecoil self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +RecoilHrefSet(ConstHandle2Recoil self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Recoil/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Recoil.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Recoil.h new file mode 100644 index 000000000..6233e9f42 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Recoil.h @@ -0,0 +1,157 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Recoil is the basic handle type in this file. Example: +// // Create a default Recoil object: +// Recoil handle = RecoilDefault(); +// Functions involving Recoil are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_RECOIL +#define C_INTERFACE_GNDS_V2_0_GENERAL_RECOIL + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RecoilClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Recoil +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RecoilClass *Recoil; + +// --- Const-aware handles. +typedef const struct RecoilClass *const ConstHandle2ConstRecoil; +typedef struct RecoilClass *const ConstHandle2Recoil; +typedef const struct RecoilClass * Handle2ConstRecoil; +typedef struct RecoilClass * Handle2Recoil; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRecoil +RecoilDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Recoil +RecoilDefault(); + +// --- Create, general, const +extern_c Handle2ConstRecoil +RecoilCreateConst( + const char *const href +); + +// +++ Create, general, non-const +extern_c Handle2Recoil +RecoilCreate( + const char *const href +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +RecoilAssign(ConstHandle2Recoil self, ConstHandle2ConstRecoil from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RecoilDelete(ConstHandle2ConstRecoil self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RecoilRead(ConstHandle2Recoil self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RecoilWrite(ConstHandle2ConstRecoil self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RecoilPrint(ConstHandle2ConstRecoil self); + +// +++ Print to standard output, as XML +extern_c int +RecoilPrintXML(ConstHandle2ConstRecoil self); + +// +++ Print to standard output, as JSON +extern_c int +RecoilPrintJSON(ConstHandle2ConstRecoil self); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RecoilHrefHas(ConstHandle2ConstRecoil self); + +// +++ Get +// +++ Returns by value +extern_c const char * +RecoilHrefGet(ConstHandle2ConstRecoil self); + +// +++ Set +extern_c void +RecoilHrefSet(ConstHandle2Recoil self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Recoil/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Recoil/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Recoil/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Recoil/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Recoil/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reference.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reference.cpp new file mode 100644 index 000000000..fc26e6365 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reference.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Reference.hpp" +#include "Reference.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ReferenceClass; +using CPP = multigroup::Reference; + +static const std::string CLASSNAME = "Reference"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstReference +ReferenceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Reference +ReferenceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstReference +ReferenceCreateConst( + const char *const label, + const char *const href +) { + ConstHandle2Reference handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href + ); + return handle; +} + +// Create, general, non-const +Handle2Reference +ReferenceCreate( + const char *const label, + const char *const href +) { + ConstHandle2Reference handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + href + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ReferenceAssign(ConstHandle2Reference self, ConstHandle2ConstReference from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ReferenceDelete(ConstHandle2ConstReference self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ReferenceRead(ConstHandle2Reference self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ReferenceWrite(ConstHandle2ConstReference self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ReferencePrint(ConstHandle2ConstReference self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ReferencePrintXML(ConstHandle2ConstReference self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ReferencePrintJSON(ConstHandle2ConstReference self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ReferenceLabelHas(ConstHandle2ConstReference self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ReferenceLabelGet(ConstHandle2ConstReference self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ReferenceLabelSet(ConstHandle2Reference self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +ReferenceHrefHas(ConstHandle2ConstReference self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +ReferenceHrefGet(ConstHandle2ConstReference self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ReferenceHrefSet(ConstHandle2Reference self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Reference/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reference.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reference.h new file mode 100644 index 000000000..983eea654 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reference.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Reference is the basic handle type in this file. Example: +// // Create a default Reference object: +// Reference handle = ReferenceDefault(); +// Functions involving Reference are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_REFERENCE +#define C_INTERFACE_GNDS_V2_0_GENERAL_REFERENCE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ReferenceClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Reference +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ReferenceClass *Reference; + +// --- Const-aware handles. +typedef const struct ReferenceClass *const ConstHandle2ConstReference; +typedef struct ReferenceClass *const ConstHandle2Reference; +typedef const struct ReferenceClass * Handle2ConstReference; +typedef struct ReferenceClass * Handle2Reference; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstReference +ReferenceDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Reference +ReferenceDefault(); + +// --- Create, general, const +extern_c Handle2ConstReference +ReferenceCreateConst( + const char *const label, + const char *const href +); + +// +++ Create, general, non-const +extern_c Handle2Reference +ReferenceCreate( + const char *const label, + const char *const href +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ReferenceAssign(ConstHandle2Reference self, ConstHandle2ConstReference from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ReferenceDelete(ConstHandle2ConstReference self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ReferenceRead(ConstHandle2Reference self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ReferenceWrite(ConstHandle2ConstReference self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ReferencePrint(ConstHandle2ConstReference self); + +// +++ Print to standard output, as XML +extern_c int +ReferencePrintXML(ConstHandle2ConstReference self); + +// +++ Print to standard output, as JSON +extern_c int +ReferencePrintJSON(ConstHandle2ConstReference self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReferenceLabelHas(ConstHandle2ConstReference self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReferenceLabelGet(ConstHandle2ConstReference self); + +// +++ Set +extern_c void +ReferenceLabelSet(ConstHandle2Reference self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReferenceHrefHas(ConstHandle2ConstReference self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReferenceHrefGet(ConstHandle2ConstReference self); + +// +++ Set +extern_c void +ReferenceHrefSet(ConstHandle2Reference self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Reference/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reference/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reference/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reference/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Reference/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions1d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions1d.cpp new file mode 100644 index 000000000..2a75a6837 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions1d.cpp @@ -0,0 +1,337 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Regions1d.hpp" +#include "Regions1d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Regions1dClass; +using CPP = multigroup::Regions1d; + +static const std::string CLASSNAME = "Regions1d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto outerDomainValue = [](auto &obj) { return &obj.outerDomainValue; }; + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; + static auto function1ds = [](auto &obj) { return &obj.function1ds; }; +} + +using CPPAxes = general::Axes; +using CPPUncertainty = general::Uncertainty; +using CPPFunction1ds = reduced::Function1ds; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRegions1d +Regions1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Regions1d +Regions1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRegions1d +Regions1dCreateConst( + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstFunction1ds function1ds +) { + ConstHandle2Regions1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(uncertainty), + detail::tocpp(function1ds) + ); + return handle; +} + +// Create, general, non-const +Handle2Regions1d +Regions1dCreate( + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstFunction1ds function1ds +) { + ConstHandle2Regions1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(uncertainty), + detail::tocpp(function1ds) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Regions1dAssign(ConstHandle2Regions1d self, ConstHandle2ConstRegions1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Regions1dDelete(ConstHandle2ConstRegions1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Regions1dRead(ConstHandle2Regions1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Regions1dWrite(ConstHandle2ConstRegions1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Regions1dPrint(ConstHandle2ConstRegions1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Regions1dPrintXML(ConstHandle2ConstRegions1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Regions1dPrintJSON(ConstHandle2ConstRegions1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +Regions1dLabelHas(ConstHandle2ConstRegions1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +Regions1dLabelGet(ConstHandle2ConstRegions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +Regions1dLabelSet(ConstHandle2Regions1d self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +Regions1dOuterDomainValueHas(ConstHandle2ConstRegions1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +double +Regions1dOuterDomainValueGet(ConstHandle2ConstRegions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +Regions1dOuterDomainValueSet(ConstHandle2Regions1d self, const double outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +Regions1dAxesHas(ConstHandle2ConstRegions1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +Regions1dAxesGetConst(ConstHandle2ConstRegions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +Regions1dAxesGet(ConstHandle2Regions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +Regions1dAxesSet(ConstHandle2Regions1d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +Regions1dUncertaintyHas(ConstHandle2ConstRegions1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +Regions1dUncertaintyGetConst(ConstHandle2ConstRegions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +Regions1dUncertaintyGet(ConstHandle2Regions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +Regions1dUncertaintySet(ConstHandle2Regions1d self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Child: function1ds +// ----------------------------------------------------------------------------- + +// Has +int +Regions1dFunction1dsHas(ConstHandle2ConstRegions1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Function1dsHas", self, extract::function1ds); +} + +// Get, const +Handle2ConstFunction1ds +Regions1dFunction1dsGetConst(ConstHandle2ConstRegions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Function1dsGetConst", self, extract::function1ds); +} + +// Get, non-const +Handle2Function1ds +Regions1dFunction1dsGet(ConstHandle2Regions1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Function1dsGet", self, extract::function1ds); +} + +// Set +void +Regions1dFunction1dsSet(ConstHandle2Regions1d self, ConstHandle2ConstFunction1ds function1ds) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Function1dsSet", self, extract::function1ds, function1ds); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Regions1d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions1d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions1d.h new file mode 100644 index 000000000..7e53210fa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions1d.h @@ -0,0 +1,249 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Regions1d is the basic handle type in this file. Example: +// // Create a default Regions1d object: +// Regions1d handle = Regions1dDefault(); +// Functions involving Regions1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_REGIONS1D +#define C_INTERFACE_GNDS_V2_0_GENERAL_REGIONS1D + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" +#include "v2.0/general/Uncertainty.h" +#include "v2.0/reduced/Function1ds.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Regions1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Regions1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Regions1dClass *Regions1d; + +// --- Const-aware handles. +typedef const struct Regions1dClass *const ConstHandle2ConstRegions1d; +typedef struct Regions1dClass *const ConstHandle2Regions1d; +typedef const struct Regions1dClass * Handle2ConstRegions1d; +typedef struct Regions1dClass * Handle2Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRegions1d +Regions1dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Regions1d +Regions1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstRegions1d +Regions1dCreateConst( + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstFunction1ds function1ds +); + +// +++ Create, general, non-const +extern_c Handle2Regions1d +Regions1dCreate( + const char *const label, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstUncertainty uncertainty, + ConstHandle2ConstFunction1ds function1ds +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Regions1dAssign(ConstHandle2Regions1d self, ConstHandle2ConstRegions1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Regions1dDelete(ConstHandle2ConstRegions1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Regions1dRead(ConstHandle2Regions1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Regions1dWrite(ConstHandle2ConstRegions1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Regions1dPrint(ConstHandle2ConstRegions1d self); + +// +++ Print to standard output, as XML +extern_c int +Regions1dPrintXML(ConstHandle2ConstRegions1d self); + +// +++ Print to standard output, as JSON +extern_c int +Regions1dPrintJSON(ConstHandle2ConstRegions1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions1dLabelHas(ConstHandle2ConstRegions1d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +Regions1dLabelGet(ConstHandle2ConstRegions1d self); + +// +++ Set +extern_c void +Regions1dLabelSet(ConstHandle2Regions1d self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions1dOuterDomainValueHas(ConstHandle2ConstRegions1d self); + +// +++ Get +// +++ Returns by value +extern_c double +Regions1dOuterDomainValueGet(ConstHandle2ConstRegions1d self); + +// +++ Set +extern_c void +Regions1dOuterDomainValueSet(ConstHandle2Regions1d self, const double outerDomainValue); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions1dAxesHas(ConstHandle2ConstRegions1d self); + +// --- Get, const +extern_c Handle2ConstAxes +Regions1dAxesGetConst(ConstHandle2ConstRegions1d self); + +// +++ Get, non-const +extern_c Handle2Axes +Regions1dAxesGet(ConstHandle2Regions1d self); + +// +++ Set +extern_c void +Regions1dAxesSet(ConstHandle2Regions1d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions1dUncertaintyHas(ConstHandle2ConstRegions1d self); + +// --- Get, const +extern_c Handle2ConstUncertainty +Regions1dUncertaintyGetConst(ConstHandle2ConstRegions1d self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +Regions1dUncertaintyGet(ConstHandle2Regions1d self); + +// +++ Set +extern_c void +Regions1dUncertaintySet(ConstHandle2Regions1d self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Child: function1ds +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions1dFunction1dsHas(ConstHandle2ConstRegions1d self); + +// --- Get, const +extern_c Handle2ConstFunction1ds +Regions1dFunction1dsGetConst(ConstHandle2ConstRegions1d self); + +// +++ Get, non-const +extern_c Handle2Function1ds +Regions1dFunction1dsGet(ConstHandle2Regions1d self); + +// +++ Set +extern_c void +Regions1dFunction1dsSet(ConstHandle2Regions1d self, ConstHandle2ConstFunction1ds function1ds); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Regions1d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions1d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions1d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions2d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions2d.cpp new file mode 100644 index 000000000..a53e786d5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions2d.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Regions2d.hpp" +#include "Regions2d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Regions2dClass; +using CPP = multigroup::Regions2d; + +static const std::string CLASSNAME = "Regions2d"; + +namespace extract { + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto function2ds = [](auto &obj) { return &obj.function2ds; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPAxes = general::Axes; +using CPPFunction2ds = general::Function2ds; +using CPPUncertainty = general::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRegions2d +Regions2dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Regions2d +Regions2dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRegions2d +Regions2dCreateConst( + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction2ds function2ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Regions2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(axes), + detail::tocpp(function2ds), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general, non-const +Handle2Regions2d +Regions2dCreate( + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction2ds function2ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Regions2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(axes), + detail::tocpp(function2ds), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Regions2dAssign(ConstHandle2Regions2d self, ConstHandle2ConstRegions2d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Regions2dDelete(ConstHandle2ConstRegions2d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Regions2dRead(ConstHandle2Regions2d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Regions2dWrite(ConstHandle2ConstRegions2d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Regions2dPrint(ConstHandle2ConstRegions2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Regions2dPrintXML(ConstHandle2ConstRegions2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Regions2dPrintJSON(ConstHandle2ConstRegions2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +Regions2dAxesHas(ConstHandle2ConstRegions2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +Regions2dAxesGetConst(ConstHandle2ConstRegions2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +Regions2dAxesGet(ConstHandle2Regions2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +Regions2dAxesSet(ConstHandle2Regions2d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: function2ds +// ----------------------------------------------------------------------------- + +// Has +int +Regions2dFunction2dsHas(ConstHandle2ConstRegions2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Function2dsHas", self, extract::function2ds); +} + +// Get, const +Handle2ConstFunction2ds +Regions2dFunction2dsGetConst(ConstHandle2ConstRegions2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Function2dsGetConst", self, extract::function2ds); +} + +// Get, non-const +Handle2Function2ds +Regions2dFunction2dsGet(ConstHandle2Regions2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Function2dsGet", self, extract::function2ds); +} + +// Set +void +Regions2dFunction2dsSet(ConstHandle2Regions2d self, ConstHandle2ConstFunction2ds function2ds) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Function2dsSet", self, extract::function2ds, function2ds); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +Regions2dUncertaintyHas(ConstHandle2ConstRegions2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +Regions2dUncertaintyGetConst(ConstHandle2ConstRegions2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +Regions2dUncertaintyGet(ConstHandle2Regions2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +Regions2dUncertaintySet(ConstHandle2Regions2d self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Regions2d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions2d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions2d.h new file mode 100644 index 000000000..4fe62f97b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions2d.h @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Regions2d is the basic handle type in this file. Example: +// // Create a default Regions2d object: +// Regions2d handle = Regions2dDefault(); +// Functions involving Regions2d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_REGIONS2D +#define C_INTERFACE_GNDS_V2_0_GENERAL_REGIONS2D + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" +#include "v2.0/general/Function2ds.h" +#include "v2.0/general/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Regions2dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Regions2d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Regions2dClass *Regions2d; + +// --- Const-aware handles. +typedef const struct Regions2dClass *const ConstHandle2ConstRegions2d; +typedef struct Regions2dClass *const ConstHandle2Regions2d; +typedef const struct Regions2dClass * Handle2ConstRegions2d; +typedef struct Regions2dClass * Handle2Regions2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRegions2d +Regions2dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Regions2d +Regions2dDefault(); + +// --- Create, general, const +extern_c Handle2ConstRegions2d +Regions2dCreateConst( + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction2ds function2ds, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general, non-const +extern_c Handle2Regions2d +Regions2dCreate( + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction2ds function2ds, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Regions2dAssign(ConstHandle2Regions2d self, ConstHandle2ConstRegions2d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Regions2dDelete(ConstHandle2ConstRegions2d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Regions2dRead(ConstHandle2Regions2d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Regions2dWrite(ConstHandle2ConstRegions2d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Regions2dPrint(ConstHandle2ConstRegions2d self); + +// +++ Print to standard output, as XML +extern_c int +Regions2dPrintXML(ConstHandle2ConstRegions2d self); + +// +++ Print to standard output, as JSON +extern_c int +Regions2dPrintJSON(ConstHandle2ConstRegions2d self); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions2dAxesHas(ConstHandle2ConstRegions2d self); + +// --- Get, const +extern_c Handle2ConstAxes +Regions2dAxesGetConst(ConstHandle2ConstRegions2d self); + +// +++ Get, non-const +extern_c Handle2Axes +Regions2dAxesGet(ConstHandle2Regions2d self); + +// +++ Set +extern_c void +Regions2dAxesSet(ConstHandle2Regions2d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: function2ds +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions2dFunction2dsHas(ConstHandle2ConstRegions2d self); + +// --- Get, const +extern_c Handle2ConstFunction2ds +Regions2dFunction2dsGetConst(ConstHandle2ConstRegions2d self); + +// +++ Get, non-const +extern_c Handle2Function2ds +Regions2dFunction2dsGet(ConstHandle2Regions2d self); + +// +++ Set +extern_c void +Regions2dFunction2dsSet(ConstHandle2Regions2d self, ConstHandle2ConstFunction2ds function2ds); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Regions2dUncertaintyHas(ConstHandle2ConstRegions2d self); + +// --- Get, const +extern_c Handle2ConstUncertainty +Regions2dUncertaintyGetConst(ConstHandle2ConstRegions2d self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +Regions2dUncertaintyGet(ConstHandle2Regions2d self); + +// +++ Set +extern_c void +Regions2dUncertaintySet(ConstHandle2Regions2d self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Regions2d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions2d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions2d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Regions2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resolved.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resolved.cpp new file mode 100644 index 000000000..1ff4a53df --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resolved.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Resolved.hpp" +#include "Resolved.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ResolvedClass; +using CPP = multigroup::Resolved; + +static const std::string CLASSNAME = "Resolved"; + +namespace extract { + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto domainUnit = [](auto &obj) { return &obj.domainUnit; }; + static auto BreitWigner = [](auto &obj) { return &obj.BreitWigner; }; + static auto RMatrix = [](auto &obj) { return &obj.RMatrix; }; +} + +using CPPBreitWigner = general::BreitWigner; +using CPPRMatrix = general::RMatrix; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResolved +ResolvedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Resolved +ResolvedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResolved +ResolvedCreateConst( + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2ConstBreitWigner BreitWigner, + ConstHandle2ConstRMatrix RMatrix +) { + ConstHandle2Resolved handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + domainMin, + domainMax, + domainUnit, + detail::tocpp(BreitWigner), + detail::tocpp(RMatrix) + ); + return handle; +} + +// Create, general, non-const +Handle2Resolved +ResolvedCreate( + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2ConstBreitWigner BreitWigner, + ConstHandle2ConstRMatrix RMatrix +) { + ConstHandle2Resolved handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + domainMin, + domainMax, + domainUnit, + detail::tocpp(BreitWigner), + detail::tocpp(RMatrix) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ResolvedAssign(ConstHandle2Resolved self, ConstHandle2ConstResolved from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ResolvedDelete(ConstHandle2ConstResolved self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ResolvedRead(ConstHandle2Resolved self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ResolvedWrite(ConstHandle2ConstResolved self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ResolvedPrint(ConstHandle2ConstResolved self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ResolvedPrintXML(ConstHandle2ConstResolved self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ResolvedPrintJSON(ConstHandle2ConstResolved self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +ResolvedDomainMinHas(ConstHandle2ConstResolved self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +double +ResolvedDomainMinGet(ConstHandle2ConstResolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +ResolvedDomainMinSet(ConstHandle2Resolved self, const double domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +ResolvedDomainMaxHas(ConstHandle2ConstResolved self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +double +ResolvedDomainMaxGet(ConstHandle2ConstResolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +ResolvedDomainMaxSet(ConstHandle2Resolved self, const double domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// Has +int +ResolvedDomainUnitHas(ConstHandle2ConstResolved self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainUnitHas", self, extract::domainUnit); +} + +// Get +// Returns by value +const char * +ResolvedDomainUnitGet(ConstHandle2ConstResolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainUnitGet", self, extract::domainUnit); +} + +// Set +void +ResolvedDomainUnitSet(ConstHandle2Resolved self, const char *const domainUnit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainUnitSet", self, extract::domainUnit, domainUnit); +} + + +// ----------------------------------------------------------------------------- +// Child: BreitWigner +// ----------------------------------------------------------------------------- + +// Has +int +ResolvedBreitWignerHas(ConstHandle2ConstResolved self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BreitWignerHas", self, extract::BreitWigner); +} + +// Get, const +Handle2ConstBreitWigner +ResolvedBreitWignerGetConst(ConstHandle2ConstResolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BreitWignerGetConst", self, extract::BreitWigner); +} + +// Get, non-const +Handle2BreitWigner +ResolvedBreitWignerGet(ConstHandle2Resolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BreitWignerGet", self, extract::BreitWigner); +} + +// Set +void +ResolvedBreitWignerSet(ConstHandle2Resolved self, ConstHandle2ConstBreitWigner BreitWigner) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BreitWignerSet", self, extract::BreitWigner, BreitWigner); +} + + +// ----------------------------------------------------------------------------- +// Child: RMatrix +// ----------------------------------------------------------------------------- + +// Has +int +ResolvedRMatrixHas(ConstHandle2ConstResolved self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RMatrixHas", self, extract::RMatrix); +} + +// Get, const +Handle2ConstRMatrix +ResolvedRMatrixGetConst(ConstHandle2ConstResolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RMatrixGetConst", self, extract::RMatrix); +} + +// Get, non-const +Handle2RMatrix +ResolvedRMatrixGet(ConstHandle2Resolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RMatrixGet", self, extract::RMatrix); +} + +// Set +void +ResolvedRMatrixSet(ConstHandle2Resolved self, ConstHandle2ConstRMatrix RMatrix) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RMatrixSet", self, extract::RMatrix, RMatrix); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Resolved/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resolved.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resolved.h new file mode 100644 index 000000000..c8c14ef9e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resolved.h @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Resolved is the basic handle type in this file. Example: +// // Create a default Resolved object: +// Resolved handle = ResolvedDefault(); +// Functions involving Resolved are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_RESOLVED +#define C_INTERFACE_GNDS_V2_0_GENERAL_RESOLVED + +#include "GNDStk.h" +#include "v2.0/general/BreitWigner.h" +#include "v2.0/general/RMatrix.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ResolvedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Resolved +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ResolvedClass *Resolved; + +// --- Const-aware handles. +typedef const struct ResolvedClass *const ConstHandle2ConstResolved; +typedef struct ResolvedClass *const ConstHandle2Resolved; +typedef const struct ResolvedClass * Handle2ConstResolved; +typedef struct ResolvedClass * Handle2Resolved; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstResolved +ResolvedDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Resolved +ResolvedDefault(); + +// --- Create, general, const +extern_c Handle2ConstResolved +ResolvedCreateConst( + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2ConstBreitWigner BreitWigner, + ConstHandle2ConstRMatrix RMatrix +); + +// +++ Create, general, non-const +extern_c Handle2Resolved +ResolvedCreate( + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2ConstBreitWigner BreitWigner, + ConstHandle2ConstRMatrix RMatrix +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ResolvedAssign(ConstHandle2Resolved self, ConstHandle2ConstResolved from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ResolvedDelete(ConstHandle2ConstResolved self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ResolvedRead(ConstHandle2Resolved self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ResolvedWrite(ConstHandle2ConstResolved self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ResolvedPrint(ConstHandle2ConstResolved self); + +// +++ Print to standard output, as XML +extern_c int +ResolvedPrintXML(ConstHandle2ConstResolved self); + +// +++ Print to standard output, as JSON +extern_c int +ResolvedPrintJSON(ConstHandle2ConstResolved self); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResolvedDomainMinHas(ConstHandle2ConstResolved self); + +// +++ Get +// +++ Returns by value +extern_c double +ResolvedDomainMinGet(ConstHandle2ConstResolved self); + +// +++ Set +extern_c void +ResolvedDomainMinSet(ConstHandle2Resolved self, const double domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResolvedDomainMaxHas(ConstHandle2ConstResolved self); + +// +++ Get +// +++ Returns by value +extern_c double +ResolvedDomainMaxGet(ConstHandle2ConstResolved self); + +// +++ Set +extern_c void +ResolvedDomainMaxSet(ConstHandle2Resolved self, const double domainMax); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResolvedDomainUnitHas(ConstHandle2ConstResolved self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ResolvedDomainUnitGet(ConstHandle2ConstResolved self); + +// +++ Set +extern_c void +ResolvedDomainUnitSet(ConstHandle2Resolved self, const char *const domainUnit); + + +// ----------------------------------------------------------------------------- +// Child: BreitWigner +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResolvedBreitWignerHas(ConstHandle2ConstResolved self); + +// --- Get, const +extern_c Handle2ConstBreitWigner +ResolvedBreitWignerGetConst(ConstHandle2ConstResolved self); + +// +++ Get, non-const +extern_c Handle2BreitWigner +ResolvedBreitWignerGet(ConstHandle2Resolved self); + +// +++ Set +extern_c void +ResolvedBreitWignerSet(ConstHandle2Resolved self, ConstHandle2ConstBreitWigner BreitWigner); + + +// ----------------------------------------------------------------------------- +// Child: RMatrix +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResolvedRMatrixHas(ConstHandle2ConstResolved self); + +// --- Get, const +extern_c Handle2ConstRMatrix +ResolvedRMatrixGetConst(ConstHandle2ConstResolved self); + +// +++ Get, non-const +extern_c Handle2RMatrix +ResolvedRMatrixGet(ConstHandle2Resolved self); + +// +++ Set +extern_c void +ResolvedRMatrixSet(ConstHandle2Resolved self, ConstHandle2ConstRMatrix RMatrix); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Resolved/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resolved/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resolved/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resolved/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resolved/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResolvedRegion.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResolvedRegion.cpp new file mode 100644 index 000000000..aea072fa0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResolvedRegion.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ResolvedRegion.hpp" +#include "ResolvedRegion.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ResolvedRegionClass; +using CPP = multigroup::ResolvedRegion; + +static const std::string CLASSNAME = "ResolvedRegion"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = general::XYs1d; +using CPPRegions1d = general::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResolvedRegion +ResolvedRegionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ResolvedRegion +ResolvedRegionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResolvedRegion +ResolvedRegionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2ResolvedRegion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general, non-const +Handle2ResolvedRegion +ResolvedRegionCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2ResolvedRegion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ResolvedRegionAssign(ConstHandle2ResolvedRegion self, ConstHandle2ConstResolvedRegion from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ResolvedRegionDelete(ConstHandle2ConstResolvedRegion self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ResolvedRegionRead(ConstHandle2ResolvedRegion self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ResolvedRegionWrite(ConstHandle2ConstResolvedRegion self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ResolvedRegionPrint(ConstHandle2ConstResolvedRegion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ResolvedRegionPrintXML(ConstHandle2ConstResolvedRegion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ResolvedRegionPrintJSON(ConstHandle2ConstResolvedRegion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +ResolvedRegionXYs1dHas(ConstHandle2ConstResolvedRegion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +ResolvedRegionXYs1dGetConst(ConstHandle2ConstResolvedRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +ResolvedRegionXYs1dGet(ConstHandle2ResolvedRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +ResolvedRegionXYs1dSet(ConstHandle2ResolvedRegion self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +ResolvedRegionRegions1dHas(ConstHandle2ConstResolvedRegion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +ResolvedRegionRegions1dGetConst(ConstHandle2ConstResolvedRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +ResolvedRegionRegions1dGet(ConstHandle2ResolvedRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +ResolvedRegionRegions1dSet(ConstHandle2ResolvedRegion self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ResolvedRegion/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResolvedRegion.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResolvedRegion.h new file mode 100644 index 000000000..178aab30a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResolvedRegion.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ResolvedRegion is the basic handle type in this file. Example: +// // Create a default ResolvedRegion object: +// ResolvedRegion handle = ResolvedRegionDefault(); +// Functions involving ResolvedRegion are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_RESOLVEDREGION +#define C_INTERFACE_GNDS_V2_0_GENERAL_RESOLVEDREGION + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/Regions1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ResolvedRegionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ResolvedRegion +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ResolvedRegionClass *ResolvedRegion; + +// --- Const-aware handles. +typedef const struct ResolvedRegionClass *const ConstHandle2ConstResolvedRegion; +typedef struct ResolvedRegionClass *const ConstHandle2ResolvedRegion; +typedef const struct ResolvedRegionClass * Handle2ConstResolvedRegion; +typedef struct ResolvedRegionClass * Handle2ResolvedRegion; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstResolvedRegion +ResolvedRegionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ResolvedRegion +ResolvedRegionDefault(); + +// --- Create, general, const +extern_c Handle2ConstResolvedRegion +ResolvedRegionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general, non-const +extern_c Handle2ResolvedRegion +ResolvedRegionCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ResolvedRegionAssign(ConstHandle2ResolvedRegion self, ConstHandle2ConstResolvedRegion from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ResolvedRegionDelete(ConstHandle2ConstResolvedRegion self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ResolvedRegionRead(ConstHandle2ResolvedRegion self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ResolvedRegionWrite(ConstHandle2ConstResolvedRegion self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ResolvedRegionPrint(ConstHandle2ConstResolvedRegion self); + +// +++ Print to standard output, as XML +extern_c int +ResolvedRegionPrintXML(ConstHandle2ConstResolvedRegion self); + +// +++ Print to standard output, as JSON +extern_c int +ResolvedRegionPrintJSON(ConstHandle2ConstResolvedRegion self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResolvedRegionXYs1dHas(ConstHandle2ConstResolvedRegion self); + +// --- Get, const +extern_c Handle2ConstXYs1d +ResolvedRegionXYs1dGetConst(ConstHandle2ConstResolvedRegion self); + +// +++ Get, non-const +extern_c Handle2XYs1d +ResolvedRegionXYs1dGet(ConstHandle2ResolvedRegion self); + +// +++ Set +extern_c void +ResolvedRegionXYs1dSet(ConstHandle2ResolvedRegion self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResolvedRegionRegions1dHas(ConstHandle2ConstResolvedRegion self); + +// --- Get, const +extern_c Handle2ConstRegions1d +ResolvedRegionRegions1dGetConst(ConstHandle2ConstResolvedRegion self); + +// +++ Get, non-const +extern_c Handle2Regions1d +ResolvedRegionRegions1dGet(ConstHandle2ResolvedRegion self); + +// +++ Set +extern_c void +ResolvedRegionRegions1dSet(ConstHandle2ResolvedRegion self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ResolvedRegion/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResolvedRegion/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResolvedRegion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResolvedRegion/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResolvedRegion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceParameters.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceParameters.cpp new file mode 100644 index 000000000..ed60d77ef --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceParameters.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ResonanceParameters.hpp" +#include "ResonanceParameters.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ResonanceParametersClass; +using CPP = multigroup::ResonanceParameters; + +static const std::string CLASSNAME = "ResonanceParameters"; + +namespace extract { + static auto table = [](auto &obj) { return &obj.table; }; +} + +using CPPTable = general::Table; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResonanceParameters +ResonanceParametersDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ResonanceParameters +ResonanceParametersDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResonanceParameters +ResonanceParametersCreateConst( + ConstHandle2ConstTable table +) { + ConstHandle2ResonanceParameters handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(table) + ); + return handle; +} + +// Create, general, non-const +Handle2ResonanceParameters +ResonanceParametersCreate( + ConstHandle2ConstTable table +) { + ConstHandle2ResonanceParameters handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(table) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ResonanceParametersAssign(ConstHandle2ResonanceParameters self, ConstHandle2ConstResonanceParameters from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ResonanceParametersDelete(ConstHandle2ConstResonanceParameters self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ResonanceParametersRead(ConstHandle2ResonanceParameters self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ResonanceParametersWrite(ConstHandle2ConstResonanceParameters self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ResonanceParametersPrint(ConstHandle2ConstResonanceParameters self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ResonanceParametersPrintXML(ConstHandle2ConstResonanceParameters self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ResonanceParametersPrintJSON(ConstHandle2ConstResonanceParameters self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: table +// ----------------------------------------------------------------------------- + +// Has +int +ResonanceParametersTableHas(ConstHandle2ConstResonanceParameters self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TableHas", self, extract::table); +} + +// Get, const +Handle2ConstTable +ResonanceParametersTableGetConst(ConstHandle2ConstResonanceParameters self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TableGetConst", self, extract::table); +} + +// Get, non-const +Handle2Table +ResonanceParametersTableGet(ConstHandle2ResonanceParameters self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TableGet", self, extract::table); +} + +// Set +void +ResonanceParametersTableSet(ConstHandle2ResonanceParameters self, ConstHandle2ConstTable table) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TableSet", self, extract::table, table); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ResonanceParameters/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceParameters.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceParameters.h new file mode 100644 index 000000000..c6e5dcecd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceParameters.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ResonanceParameters is the basic handle type in this file. Example: +// // Create a default ResonanceParameters object: +// ResonanceParameters handle = ResonanceParametersDefault(); +// Functions involving ResonanceParameters are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_RESONANCEPARAMETERS +#define C_INTERFACE_GNDS_V2_0_GENERAL_RESONANCEPARAMETERS + +#include "GNDStk.h" +#include "v2.0/general/Table.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ResonanceParametersClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ResonanceParameters +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ResonanceParametersClass *ResonanceParameters; + +// --- Const-aware handles. +typedef const struct ResonanceParametersClass *const ConstHandle2ConstResonanceParameters; +typedef struct ResonanceParametersClass *const ConstHandle2ResonanceParameters; +typedef const struct ResonanceParametersClass * Handle2ConstResonanceParameters; +typedef struct ResonanceParametersClass * Handle2ResonanceParameters; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstResonanceParameters +ResonanceParametersDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ResonanceParameters +ResonanceParametersDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonanceParameters +ResonanceParametersCreateConst( + ConstHandle2ConstTable table +); + +// +++ Create, general, non-const +extern_c Handle2ResonanceParameters +ResonanceParametersCreate( + ConstHandle2ConstTable table +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ResonanceParametersAssign(ConstHandle2ResonanceParameters self, ConstHandle2ConstResonanceParameters from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ResonanceParametersDelete(ConstHandle2ConstResonanceParameters self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ResonanceParametersRead(ConstHandle2ResonanceParameters self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ResonanceParametersWrite(ConstHandle2ConstResonanceParameters self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ResonanceParametersPrint(ConstHandle2ConstResonanceParameters self); + +// +++ Print to standard output, as XML +extern_c int +ResonanceParametersPrintXML(ConstHandle2ConstResonanceParameters self); + +// +++ Print to standard output, as JSON +extern_c int +ResonanceParametersPrintJSON(ConstHandle2ConstResonanceParameters self); + + +// ----------------------------------------------------------------------------- +// Child: table +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonanceParametersTableHas(ConstHandle2ConstResonanceParameters self); + +// --- Get, const +extern_c Handle2ConstTable +ResonanceParametersTableGetConst(ConstHandle2ConstResonanceParameters self); + +// +++ Get, non-const +extern_c Handle2Table +ResonanceParametersTableGet(ConstHandle2ResonanceParameters self); + +// +++ Set +extern_c void +ResonanceParametersTableSet(ConstHandle2ResonanceParameters self, ConstHandle2ConstTable table); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ResonanceParameters/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceParameters/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceParameters/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceParameters/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceParameters/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReaction.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReaction.cpp new file mode 100644 index 000000000..4b9eee124 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReaction.cpp @@ -0,0 +1,415 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ResonanceReaction.hpp" +#include "ResonanceReaction.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ResonanceReactionClass; +using CPP = multigroup::ResonanceReaction; + +static const std::string CLASSNAME = "ResonanceReaction"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto ejectile = [](auto &obj) { return &obj.ejectile; }; + static auto eliminated = [](auto &obj) { return &obj.eliminated; }; + static auto link = [](auto &obj) { return &obj.link; }; + static auto hardSphereRadius = [](auto &obj) { return &obj.hardSphereRadius; }; + static auto Q = [](auto &obj) { return &obj.Q; }; + static auto scatteringRadius = [](auto &obj) { return &obj.scatteringRadius; }; +} + +using CPPLink = general::Link; +using CPPHardSphereRadius = general::HardSphereRadius; +using CPPQ = general::Q; +using CPPScatteringRadius = general::ScatteringRadius; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResonanceReaction +ResonanceReactionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ResonanceReaction +ResonanceReactionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResonanceReaction +ResonanceReactionCreateConst( + const char *const label, + const char *const ejectile, + const bool eliminated, + ConstHandle2ConstLink link, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstQ Q, + ConstHandle2ConstScatteringRadius scatteringRadius +) { + ConstHandle2ResonanceReaction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + ejectile, + eliminated, + detail::tocpp(link), + detail::tocpp(hardSphereRadius), + detail::tocpp(Q), + detail::tocpp(scatteringRadius) + ); + return handle; +} + +// Create, general, non-const +Handle2ResonanceReaction +ResonanceReactionCreate( + const char *const label, + const char *const ejectile, + const bool eliminated, + ConstHandle2ConstLink link, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstQ Q, + ConstHandle2ConstScatteringRadius scatteringRadius +) { + ConstHandle2ResonanceReaction handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + ejectile, + eliminated, + detail::tocpp(link), + detail::tocpp(hardSphereRadius), + detail::tocpp(Q), + detail::tocpp(scatteringRadius) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ResonanceReactionAssign(ConstHandle2ResonanceReaction self, ConstHandle2ConstResonanceReaction from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ResonanceReactionDelete(ConstHandle2ConstResonanceReaction self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ResonanceReactionRead(ConstHandle2ResonanceReaction self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ResonanceReactionWrite(ConstHandle2ConstResonanceReaction self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ResonanceReactionPrint(ConstHandle2ConstResonanceReaction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ResonanceReactionPrintXML(ConstHandle2ConstResonanceReaction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ResonanceReactionPrintJSON(ConstHandle2ConstResonanceReaction self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ResonanceReactionLabelHas(ConstHandle2ConstResonanceReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ResonanceReactionLabelGet(ConstHandle2ConstResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ResonanceReactionLabelSet(ConstHandle2ResonanceReaction self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: ejectile +// ----------------------------------------------------------------------------- + +// Has +int +ResonanceReactionEjectileHas(ConstHandle2ConstResonanceReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EjectileHas", self, extract::ejectile); +} + +// Get +// Returns by value +const char * +ResonanceReactionEjectileGet(ConstHandle2ConstResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EjectileGet", self, extract::ejectile); +} + +// Set +void +ResonanceReactionEjectileSet(ConstHandle2ResonanceReaction self, const char *const ejectile) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EjectileSet", self, extract::ejectile, ejectile); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: eliminated +// ----------------------------------------------------------------------------- + +// Has +int +ResonanceReactionEliminatedHas(ConstHandle2ConstResonanceReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EliminatedHas", self, extract::eliminated); +} + +// Get +// Returns by value +bool +ResonanceReactionEliminatedGet(ConstHandle2ConstResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EliminatedGet", self, extract::eliminated); +} + +// Set +void +ResonanceReactionEliminatedSet(ConstHandle2ResonanceReaction self, const bool eliminated) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EliminatedSet", self, extract::eliminated, eliminated); +} + + +// ----------------------------------------------------------------------------- +// Child: link +// ----------------------------------------------------------------------------- + +// Has +int +ResonanceReactionLinkHas(ConstHandle2ConstResonanceReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LinkHas", self, extract::link); +} + +// Get, const +Handle2ConstLink +ResonanceReactionLinkGetConst(ConstHandle2ConstResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LinkGetConst", self, extract::link); +} + +// Get, non-const +Handle2Link +ResonanceReactionLinkGet(ConstHandle2ResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LinkGet", self, extract::link); +} + +// Set +void +ResonanceReactionLinkSet(ConstHandle2ResonanceReaction self, ConstHandle2ConstLink link) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LinkSet", self, extract::link, link); +} + + +// ----------------------------------------------------------------------------- +// Child: hardSphereRadius +// ----------------------------------------------------------------------------- + +// Has +int +ResonanceReactionHardSphereRadiusHas(ConstHandle2ConstResonanceReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HardSphereRadiusHas", self, extract::hardSphereRadius); +} + +// Get, const +Handle2ConstHardSphereRadius +ResonanceReactionHardSphereRadiusGetConst(ConstHandle2ConstResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HardSphereRadiusGetConst", self, extract::hardSphereRadius); +} + +// Get, non-const +Handle2HardSphereRadius +ResonanceReactionHardSphereRadiusGet(ConstHandle2ResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HardSphereRadiusGet", self, extract::hardSphereRadius); +} + +// Set +void +ResonanceReactionHardSphereRadiusSet(ConstHandle2ResonanceReaction self, ConstHandle2ConstHardSphereRadius hardSphereRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HardSphereRadiusSet", self, extract::hardSphereRadius, hardSphereRadius); +} + + +// ----------------------------------------------------------------------------- +// Child: Q +// ----------------------------------------------------------------------------- + +// Has +int +ResonanceReactionQHas(ConstHandle2ConstResonanceReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"QHas", self, extract::Q); +} + +// Get, const +Handle2ConstQ +ResonanceReactionQGetConst(ConstHandle2ConstResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"QGetConst", self, extract::Q); +} + +// Get, non-const +Handle2Q +ResonanceReactionQGet(ConstHandle2ResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"QGet", self, extract::Q); +} + +// Set +void +ResonanceReactionQSet(ConstHandle2ResonanceReaction self, ConstHandle2ConstQ Q) +{ + detail::setField + (CLASSNAME, CLASSNAME+"QSet", self, extract::Q, Q); +} + + +// ----------------------------------------------------------------------------- +// Child: scatteringRadius +// ----------------------------------------------------------------------------- + +// Has +int +ResonanceReactionScatteringRadiusHas(ConstHandle2ConstResonanceReaction self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ScatteringRadiusHas", self, extract::scatteringRadius); +} + +// Get, const +Handle2ConstScatteringRadius +ResonanceReactionScatteringRadiusGetConst(ConstHandle2ConstResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringRadiusGetConst", self, extract::scatteringRadius); +} + +// Get, non-const +Handle2ScatteringRadius +ResonanceReactionScatteringRadiusGet(ConstHandle2ResonanceReaction self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringRadiusGet", self, extract::scatteringRadius); +} + +// Set +void +ResonanceReactionScatteringRadiusSet(ConstHandle2ResonanceReaction self, ConstHandle2ConstScatteringRadius scatteringRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ScatteringRadiusSet", self, extract::scatteringRadius, scatteringRadius); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ResonanceReaction/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReaction.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReaction.h new file mode 100644 index 000000000..e91a702b8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReaction.h @@ -0,0 +1,293 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ResonanceReaction is the basic handle type in this file. Example: +// // Create a default ResonanceReaction object: +// ResonanceReaction handle = ResonanceReactionDefault(); +// Functions involving ResonanceReaction are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_RESONANCEREACTION +#define C_INTERFACE_GNDS_V2_0_GENERAL_RESONANCEREACTION + +#include "GNDStk.h" +#include "v2.0/general/Link.h" +#include "v2.0/general/HardSphereRadius.h" +#include "v2.0/general/Q.h" +#include "v2.0/general/ScatteringRadius.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ResonanceReactionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ResonanceReaction +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ResonanceReactionClass *ResonanceReaction; + +// --- Const-aware handles. +typedef const struct ResonanceReactionClass *const ConstHandle2ConstResonanceReaction; +typedef struct ResonanceReactionClass *const ConstHandle2ResonanceReaction; +typedef const struct ResonanceReactionClass * Handle2ConstResonanceReaction; +typedef struct ResonanceReactionClass * Handle2ResonanceReaction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstResonanceReaction +ResonanceReactionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ResonanceReaction +ResonanceReactionDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonanceReaction +ResonanceReactionCreateConst( + const char *const label, + const char *const ejectile, + const bool eliminated, + ConstHandle2ConstLink link, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstQ Q, + ConstHandle2ConstScatteringRadius scatteringRadius +); + +// +++ Create, general, non-const +extern_c Handle2ResonanceReaction +ResonanceReactionCreate( + const char *const label, + const char *const ejectile, + const bool eliminated, + ConstHandle2ConstLink link, + ConstHandle2ConstHardSphereRadius hardSphereRadius, + ConstHandle2ConstQ Q, + ConstHandle2ConstScatteringRadius scatteringRadius +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ResonanceReactionAssign(ConstHandle2ResonanceReaction self, ConstHandle2ConstResonanceReaction from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ResonanceReactionDelete(ConstHandle2ConstResonanceReaction self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ResonanceReactionRead(ConstHandle2ResonanceReaction self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ResonanceReactionWrite(ConstHandle2ConstResonanceReaction self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ResonanceReactionPrint(ConstHandle2ConstResonanceReaction self); + +// +++ Print to standard output, as XML +extern_c int +ResonanceReactionPrintXML(ConstHandle2ConstResonanceReaction self); + +// +++ Print to standard output, as JSON +extern_c int +ResonanceReactionPrintJSON(ConstHandle2ConstResonanceReaction self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonanceReactionLabelHas(ConstHandle2ConstResonanceReaction self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ResonanceReactionLabelGet(ConstHandle2ConstResonanceReaction self); + +// +++ Set +extern_c void +ResonanceReactionLabelSet(ConstHandle2ResonanceReaction self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: ejectile +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonanceReactionEjectileHas(ConstHandle2ConstResonanceReaction self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ResonanceReactionEjectileGet(ConstHandle2ConstResonanceReaction self); + +// +++ Set +extern_c void +ResonanceReactionEjectileSet(ConstHandle2ResonanceReaction self, const char *const ejectile); + + +// ----------------------------------------------------------------------------- +// Metadatum: eliminated +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonanceReactionEliminatedHas(ConstHandle2ConstResonanceReaction self); + +// +++ Get +// +++ Returns by value +extern_c bool +ResonanceReactionEliminatedGet(ConstHandle2ConstResonanceReaction self); + +// +++ Set +extern_c void +ResonanceReactionEliminatedSet(ConstHandle2ResonanceReaction self, const bool eliminated); + + +// ----------------------------------------------------------------------------- +// Child: link +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonanceReactionLinkHas(ConstHandle2ConstResonanceReaction self); + +// --- Get, const +extern_c Handle2ConstLink +ResonanceReactionLinkGetConst(ConstHandle2ConstResonanceReaction self); + +// +++ Get, non-const +extern_c Handle2Link +ResonanceReactionLinkGet(ConstHandle2ResonanceReaction self); + +// +++ Set +extern_c void +ResonanceReactionLinkSet(ConstHandle2ResonanceReaction self, ConstHandle2ConstLink link); + + +// ----------------------------------------------------------------------------- +// Child: hardSphereRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonanceReactionHardSphereRadiusHas(ConstHandle2ConstResonanceReaction self); + +// --- Get, const +extern_c Handle2ConstHardSphereRadius +ResonanceReactionHardSphereRadiusGetConst(ConstHandle2ConstResonanceReaction self); + +// +++ Get, non-const +extern_c Handle2HardSphereRadius +ResonanceReactionHardSphereRadiusGet(ConstHandle2ResonanceReaction self); + +// +++ Set +extern_c void +ResonanceReactionHardSphereRadiusSet(ConstHandle2ResonanceReaction self, ConstHandle2ConstHardSphereRadius hardSphereRadius); + + +// ----------------------------------------------------------------------------- +// Child: Q +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonanceReactionQHas(ConstHandle2ConstResonanceReaction self); + +// --- Get, const +extern_c Handle2ConstQ +ResonanceReactionQGetConst(ConstHandle2ConstResonanceReaction self); + +// +++ Get, non-const +extern_c Handle2Q +ResonanceReactionQGet(ConstHandle2ResonanceReaction self); + +// +++ Set +extern_c void +ResonanceReactionQSet(ConstHandle2ResonanceReaction self, ConstHandle2ConstQ Q); + + +// ----------------------------------------------------------------------------- +// Child: scatteringRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonanceReactionScatteringRadiusHas(ConstHandle2ConstResonanceReaction self); + +// --- Get, const +extern_c Handle2ConstScatteringRadius +ResonanceReactionScatteringRadiusGetConst(ConstHandle2ConstResonanceReaction self); + +// +++ Get, non-const +extern_c Handle2ScatteringRadius +ResonanceReactionScatteringRadiusGet(ConstHandle2ResonanceReaction self); + +// +++ Set +extern_c void +ResonanceReactionScatteringRadiusSet(ConstHandle2ResonanceReaction self, ConstHandle2ConstScatteringRadius scatteringRadius); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ResonanceReaction/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReaction/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReaction/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReaction/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReaction/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReactions.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReactions.cpp new file mode 100644 index 000000000..0753aa67d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReactions.cpp @@ -0,0 +1,359 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ResonanceReactions.hpp" +#include "ResonanceReactions.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ResonanceReactionsClass; +using CPP = multigroup::ResonanceReactions; + +static const std::string CLASSNAME = "ResonanceReactions"; + +namespace extract { + static auto resonanceReaction = [](auto &obj) { return &obj.resonanceReaction; }; +} + +using CPPResonanceReaction = general::ResonanceReaction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResonanceReactions +ResonanceReactionsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ResonanceReactions +ResonanceReactionsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResonanceReactions +ResonanceReactionsCreateConst( + ConstHandle2ResonanceReaction *const resonanceReaction, const size_t resonanceReactionSize +) { + ConstHandle2ResonanceReactions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ResonanceReactionN = 0; ResonanceReactionN < resonanceReactionSize; ++ResonanceReactionN) + ResonanceReactionsResonanceReactionAdd(handle, resonanceReaction[ResonanceReactionN]); + return handle; +} + +// Create, general, non-const +Handle2ResonanceReactions +ResonanceReactionsCreate( + ConstHandle2ResonanceReaction *const resonanceReaction, const size_t resonanceReactionSize +) { + ConstHandle2ResonanceReactions handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ResonanceReactionN = 0; ResonanceReactionN < resonanceReactionSize; ++ResonanceReactionN) + ResonanceReactionsResonanceReactionAdd(handle, resonanceReaction[ResonanceReactionN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ResonanceReactionsAssign(ConstHandle2ResonanceReactions self, ConstHandle2ConstResonanceReactions from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ResonanceReactionsDelete(ConstHandle2ConstResonanceReactions self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ResonanceReactionsRead(ConstHandle2ResonanceReactions self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ResonanceReactionsWrite(ConstHandle2ConstResonanceReactions self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ResonanceReactionsPrint(ConstHandle2ConstResonanceReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ResonanceReactionsPrintXML(ConstHandle2ConstResonanceReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ResonanceReactionsPrintJSON(ConstHandle2ConstResonanceReactions self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: resonanceReaction +// ----------------------------------------------------------------------------- + +// Has +int +ResonanceReactionsResonanceReactionHas(ConstHandle2ConstResonanceReactions self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResonanceReactionHas", self, extract::resonanceReaction); +} + +// Clear +void +ResonanceReactionsResonanceReactionClear(ConstHandle2ResonanceReactions self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ResonanceReactionClear", self, extract::resonanceReaction); +} + +// Size +size_t +ResonanceReactionsResonanceReactionSize(ConstHandle2ConstResonanceReactions self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ResonanceReactionSize", self, extract::resonanceReaction); +} + +// Add +void +ResonanceReactionsResonanceReactionAdd(ConstHandle2ResonanceReactions self, ConstHandle2ConstResonanceReaction resonanceReaction) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ResonanceReactionAdd", self, extract::resonanceReaction, resonanceReaction); +} + +// Get, by index \in [0,size), const +Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetConst(ConstHandle2ConstResonanceReactions self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ResonanceReactionGetConst", self, extract::resonanceReaction, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGet(ConstHandle2ResonanceReactions self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ResonanceReactionGet", self, extract::resonanceReaction, index_); +} + +// Set, by index \in [0,size) +void +ResonanceReactionsResonanceReactionSet( + ConstHandle2ResonanceReactions self, + const size_t index_, + ConstHandle2ConstResonanceReaction resonanceReaction +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ResonanceReactionSet", self, extract::resonanceReaction, index_, resonanceReaction); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ResonanceReactionsResonanceReactionHasByLabel( + ConstHandle2ConstResonanceReactions self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionHasByLabel", + self, extract::resonanceReaction, meta::label, label); +} + +// Get, by label, const +Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByLabelConst( + ConstHandle2ConstResonanceReactions self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByLabelConst", + self, extract::resonanceReaction, meta::label, label); +} + +// Get, by label, non-const +Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByLabel( + ConstHandle2ResonanceReactions self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByLabel", + self, extract::resonanceReaction, meta::label, label); +} + +// Set, by label +void +ResonanceReactionsResonanceReactionSetByLabel( + ConstHandle2ResonanceReactions self, + const char *const label, + ConstHandle2ConstResonanceReaction resonanceReaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionSetByLabel", + self, extract::resonanceReaction, meta::label, label, resonanceReaction); +} + +// ------------------------ +// Re: metadatum ejectile +// ------------------------ + +// Has, by ejectile +int +ResonanceReactionsResonanceReactionHasByEjectile( + ConstHandle2ConstResonanceReactions self, + const char *const ejectile +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionHasByEjectile", + self, extract::resonanceReaction, meta::ejectile, ejectile); +} + +// Get, by ejectile, const +Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByEjectileConst( + ConstHandle2ConstResonanceReactions self, + const char *const ejectile +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByEjectileConst", + self, extract::resonanceReaction, meta::ejectile, ejectile); +} + +// Get, by ejectile, non-const +Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByEjectile( + ConstHandle2ResonanceReactions self, + const char *const ejectile +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByEjectile", + self, extract::resonanceReaction, meta::ejectile, ejectile); +} + +// Set, by ejectile +void +ResonanceReactionsResonanceReactionSetByEjectile( + ConstHandle2ResonanceReactions self, + const char *const ejectile, + ConstHandle2ConstResonanceReaction resonanceReaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionSetByEjectile", + self, extract::resonanceReaction, meta::ejectile, ejectile, resonanceReaction); +} + +// ------------------------ +// Re: metadatum eliminated +// ------------------------ + +// Has, by eliminated +int +ResonanceReactionsResonanceReactionHasByEliminated( + ConstHandle2ConstResonanceReactions self, + const bool eliminated +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionHasByEliminated", + self, extract::resonanceReaction, meta::eliminated, eliminated); +} + +// Get, by eliminated, const +Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByEliminatedConst( + ConstHandle2ConstResonanceReactions self, + const bool eliminated +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByEliminatedConst", + self, extract::resonanceReaction, meta::eliminated, eliminated); +} + +// Get, by eliminated, non-const +Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByEliminated( + ConstHandle2ResonanceReactions self, + const bool eliminated +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionGetByEliminated", + self, extract::resonanceReaction, meta::eliminated, eliminated); +} + +// Set, by eliminated +void +ResonanceReactionsResonanceReactionSetByEliminated( + ConstHandle2ResonanceReactions self, + const bool eliminated, + ConstHandle2ConstResonanceReaction resonanceReaction +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ResonanceReactionSetByEliminated", + self, extract::resonanceReaction, meta::eliminated, eliminated, resonanceReaction); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ResonanceReactions/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReactions.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReactions.h new file mode 100644 index 000000000..7098944da --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReactions.h @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ResonanceReactions is the basic handle type in this file. Example: +// // Create a default ResonanceReactions object: +// ResonanceReactions handle = ResonanceReactionsDefault(); +// Functions involving ResonanceReactions are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_RESONANCEREACTIONS +#define C_INTERFACE_GNDS_V2_0_GENERAL_RESONANCEREACTIONS + +#include "GNDStk.h" +#include "v2.0/general/ResonanceReaction.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ResonanceReactionsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ResonanceReactions +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ResonanceReactionsClass *ResonanceReactions; + +// --- Const-aware handles. +typedef const struct ResonanceReactionsClass *const ConstHandle2ConstResonanceReactions; +typedef struct ResonanceReactionsClass *const ConstHandle2ResonanceReactions; +typedef const struct ResonanceReactionsClass * Handle2ConstResonanceReactions; +typedef struct ResonanceReactionsClass * Handle2ResonanceReactions; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstResonanceReactions +ResonanceReactionsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ResonanceReactions +ResonanceReactionsDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonanceReactions +ResonanceReactionsCreateConst( + ConstHandle2ResonanceReaction *const resonanceReaction, const size_t resonanceReactionSize +); + +// +++ Create, general, non-const +extern_c Handle2ResonanceReactions +ResonanceReactionsCreate( + ConstHandle2ResonanceReaction *const resonanceReaction, const size_t resonanceReactionSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ResonanceReactionsAssign(ConstHandle2ResonanceReactions self, ConstHandle2ConstResonanceReactions from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ResonanceReactionsDelete(ConstHandle2ConstResonanceReactions self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ResonanceReactionsRead(ConstHandle2ResonanceReactions self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ResonanceReactionsWrite(ConstHandle2ConstResonanceReactions self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ResonanceReactionsPrint(ConstHandle2ConstResonanceReactions self); + +// +++ Print to standard output, as XML +extern_c int +ResonanceReactionsPrintXML(ConstHandle2ConstResonanceReactions self); + +// +++ Print to standard output, as JSON +extern_c int +ResonanceReactionsPrintJSON(ConstHandle2ConstResonanceReactions self); + + +// ----------------------------------------------------------------------------- +// Child: resonanceReaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonanceReactionsResonanceReactionHas(ConstHandle2ConstResonanceReactions self); + +// +++ Clear +extern_c void +ResonanceReactionsResonanceReactionClear(ConstHandle2ResonanceReactions self); + +// +++ Size +extern_c size_t +ResonanceReactionsResonanceReactionSize(ConstHandle2ConstResonanceReactions self); + +// +++ Add +extern_c void +ResonanceReactionsResonanceReactionAdd(ConstHandle2ResonanceReactions self, ConstHandle2ConstResonanceReaction resonanceReaction); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetConst(ConstHandle2ConstResonanceReactions self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGet(ConstHandle2ResonanceReactions self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ResonanceReactionsResonanceReactionSet( + ConstHandle2ResonanceReactions self, + const size_t index_, + ConstHandle2ConstResonanceReaction resonanceReaction +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ResonanceReactionsResonanceReactionHasByLabel( + ConstHandle2ConstResonanceReactions self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByLabelConst( + ConstHandle2ConstResonanceReactions self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByLabel( + ConstHandle2ResonanceReactions self, + const char *const label +); + +// +++ Set, by label +extern_c void +ResonanceReactionsResonanceReactionSetByLabel( + ConstHandle2ResonanceReactions self, + const char *const label, + ConstHandle2ConstResonanceReaction resonanceReaction +); + +// ------------------------ +// Re: metadatum ejectile +// ------------------------ + +// +++ Has, by ejectile +extern_c int +ResonanceReactionsResonanceReactionHasByEjectile( + ConstHandle2ConstResonanceReactions self, + const char *const ejectile +); + +// --- Get, by ejectile, const +extern_c Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByEjectileConst( + ConstHandle2ConstResonanceReactions self, + const char *const ejectile +); + +// +++ Get, by ejectile, non-const +extern_c Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByEjectile( + ConstHandle2ResonanceReactions self, + const char *const ejectile +); + +// +++ Set, by ejectile +extern_c void +ResonanceReactionsResonanceReactionSetByEjectile( + ConstHandle2ResonanceReactions self, + const char *const ejectile, + ConstHandle2ConstResonanceReaction resonanceReaction +); + +// ------------------------ +// Re: metadatum eliminated +// ------------------------ + +// +++ Has, by eliminated +extern_c int +ResonanceReactionsResonanceReactionHasByEliminated( + ConstHandle2ConstResonanceReactions self, + const bool eliminated +); + +// --- Get, by eliminated, const +extern_c Handle2ConstResonanceReaction +ResonanceReactionsResonanceReactionGetByEliminatedConst( + ConstHandle2ConstResonanceReactions self, + const bool eliminated +); + +// +++ Get, by eliminated, non-const +extern_c Handle2ResonanceReaction +ResonanceReactionsResonanceReactionGetByEliminated( + ConstHandle2ResonanceReactions self, + const bool eliminated +); + +// +++ Set, by eliminated +extern_c void +ResonanceReactionsResonanceReactionSetByEliminated( + ConstHandle2ResonanceReactions self, + const bool eliminated, + ConstHandle2ConstResonanceReaction resonanceReaction +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ResonanceReactions/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReactions/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReactions/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReactions/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonanceReactions/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resonances.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resonances.cpp new file mode 100644 index 000000000..f8eba71c4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resonances.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Resonances.hpp" +#include "Resonances.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ResonancesClass; +using CPP = multigroup::Resonances; + +static const std::string CLASSNAME = "Resonances"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; + static auto scatteringRadius = [](auto &obj) { return &obj.scatteringRadius; }; + static auto resolved = [](auto &obj) { return &obj.resolved; }; + static auto unresolved = [](auto &obj) { return &obj.unresolved; }; +} + +using CPPScatteringRadius = general::ScatteringRadius; +using CPPResolved = general::Resolved; +using CPPUnresolved = general::Unresolved; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResonances +ResonancesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Resonances +ResonancesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResonances +ResonancesCreateConst( + const char *const href, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstResolved resolved, + ConstHandle2ConstUnresolved unresolved +) { + ConstHandle2Resonances handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href, + detail::tocpp(scatteringRadius), + detail::tocpp(resolved), + detail::tocpp(unresolved) + ); + return handle; +} + +// Create, general, non-const +Handle2Resonances +ResonancesCreate( + const char *const href, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstResolved resolved, + ConstHandle2ConstUnresolved unresolved +) { + ConstHandle2Resonances handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href, + detail::tocpp(scatteringRadius), + detail::tocpp(resolved), + detail::tocpp(unresolved) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ResonancesAssign(ConstHandle2Resonances self, ConstHandle2ConstResonances from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ResonancesDelete(ConstHandle2ConstResonances self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ResonancesRead(ConstHandle2Resonances self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ResonancesWrite(ConstHandle2ConstResonances self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ResonancesPrint(ConstHandle2ConstResonances self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ResonancesPrintXML(ConstHandle2ConstResonances self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ResonancesPrintJSON(ConstHandle2ConstResonances self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesHrefHas(ConstHandle2ConstResonances self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +ResonancesHrefGet(ConstHandle2ConstResonances self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ResonancesHrefSet(ConstHandle2Resonances self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Child: scatteringRadius +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesScatteringRadiusHas(ConstHandle2ConstResonances self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ScatteringRadiusHas", self, extract::scatteringRadius); +} + +// Get, const +Handle2ConstScatteringRadius +ResonancesScatteringRadiusGetConst(ConstHandle2ConstResonances self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringRadiusGetConst", self, extract::scatteringRadius); +} + +// Get, non-const +Handle2ScatteringRadius +ResonancesScatteringRadiusGet(ConstHandle2Resonances self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringRadiusGet", self, extract::scatteringRadius); +} + +// Set +void +ResonancesScatteringRadiusSet(ConstHandle2Resonances self, ConstHandle2ConstScatteringRadius scatteringRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ScatteringRadiusSet", self, extract::scatteringRadius, scatteringRadius); +} + + +// ----------------------------------------------------------------------------- +// Child: resolved +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesResolvedHas(ConstHandle2ConstResonances self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResolvedHas", self, extract::resolved); +} + +// Get, const +Handle2ConstResolved +ResonancesResolvedGetConst(ConstHandle2ConstResonances self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResolvedGetConst", self, extract::resolved); +} + +// Get, non-const +Handle2Resolved +ResonancesResolvedGet(ConstHandle2Resonances self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResolvedGet", self, extract::resolved); +} + +// Set +void +ResonancesResolvedSet(ConstHandle2Resonances self, ConstHandle2ConstResolved resolved) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResolvedSet", self, extract::resolved, resolved); +} + + +// ----------------------------------------------------------------------------- +// Child: unresolved +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesUnresolvedHas(ConstHandle2ConstResonances self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnresolvedHas", self, extract::unresolved); +} + +// Get, const +Handle2ConstUnresolved +ResonancesUnresolvedGetConst(ConstHandle2ConstResonances self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnresolvedGetConst", self, extract::unresolved); +} + +// Get, non-const +Handle2Unresolved +ResonancesUnresolvedGet(ConstHandle2Resonances self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnresolvedGet", self, extract::unresolved); +} + +// Set +void +ResonancesUnresolvedSet(ConstHandle2Resonances self, ConstHandle2ConstUnresolved unresolved) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnresolvedSet", self, extract::unresolved, unresolved); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Resonances/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resonances.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resonances.h new file mode 100644 index 000000000..6c44597b8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resonances.h @@ -0,0 +1,229 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Resonances is the basic handle type in this file. Example: +// // Create a default Resonances object: +// Resonances handle = ResonancesDefault(); +// Functions involving Resonances are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_RESONANCES +#define C_INTERFACE_GNDS_V2_0_GENERAL_RESONANCES + +#include "GNDStk.h" +#include "v2.0/general/ScatteringRadius.h" +#include "v2.0/general/Resolved.h" +#include "v2.0/general/Unresolved.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ResonancesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Resonances +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ResonancesClass *Resonances; + +// --- Const-aware handles. +typedef const struct ResonancesClass *const ConstHandle2ConstResonances; +typedef struct ResonancesClass *const ConstHandle2Resonances; +typedef const struct ResonancesClass * Handle2ConstResonances; +typedef struct ResonancesClass * Handle2Resonances; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstResonances +ResonancesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Resonances +ResonancesDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonances +ResonancesCreateConst( + const char *const href, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstResolved resolved, + ConstHandle2ConstUnresolved unresolved +); + +// +++ Create, general, non-const +extern_c Handle2Resonances +ResonancesCreate( + const char *const href, + ConstHandle2ConstScatteringRadius scatteringRadius, + ConstHandle2ConstResolved resolved, + ConstHandle2ConstUnresolved unresolved +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ResonancesAssign(ConstHandle2Resonances self, ConstHandle2ConstResonances from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ResonancesDelete(ConstHandle2ConstResonances self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ResonancesRead(ConstHandle2Resonances self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ResonancesWrite(ConstHandle2ConstResonances self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ResonancesPrint(ConstHandle2ConstResonances self); + +// +++ Print to standard output, as XML +extern_c int +ResonancesPrintXML(ConstHandle2ConstResonances self); + +// +++ Print to standard output, as JSON +extern_c int +ResonancesPrintJSON(ConstHandle2ConstResonances self); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesHrefHas(ConstHandle2ConstResonances self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ResonancesHrefGet(ConstHandle2ConstResonances self); + +// +++ Set +extern_c void +ResonancesHrefSet(ConstHandle2Resonances self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Child: scatteringRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesScatteringRadiusHas(ConstHandle2ConstResonances self); + +// --- Get, const +extern_c Handle2ConstScatteringRadius +ResonancesScatteringRadiusGetConst(ConstHandle2ConstResonances self); + +// +++ Get, non-const +extern_c Handle2ScatteringRadius +ResonancesScatteringRadiusGet(ConstHandle2Resonances self); + +// +++ Set +extern_c void +ResonancesScatteringRadiusSet(ConstHandle2Resonances self, ConstHandle2ConstScatteringRadius scatteringRadius); + + +// ----------------------------------------------------------------------------- +// Child: resolved +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesResolvedHas(ConstHandle2ConstResonances self); + +// --- Get, const +extern_c Handle2ConstResolved +ResonancesResolvedGetConst(ConstHandle2ConstResonances self); + +// +++ Get, non-const +extern_c Handle2Resolved +ResonancesResolvedGet(ConstHandle2Resonances self); + +// +++ Set +extern_c void +ResonancesResolvedSet(ConstHandle2Resonances self, ConstHandle2ConstResolved resolved); + + +// ----------------------------------------------------------------------------- +// Child: unresolved +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesUnresolvedHas(ConstHandle2ConstResonances self); + +// --- Get, const +extern_c Handle2ConstUnresolved +ResonancesUnresolvedGetConst(ConstHandle2ConstResonances self); + +// +++ Get, non-const +extern_c Handle2Unresolved +ResonancesUnresolvedGet(ConstHandle2Resonances self); + +// +++ Set +extern_c void +ResonancesUnresolvedSet(ConstHandle2Resonances self, ConstHandle2ConstUnresolved unresolved); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Resonances/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resonances/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resonances/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resonances/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Resonances/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonancesWithBackground.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonancesWithBackground.cpp new file mode 100644 index 000000000..1a4405396 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonancesWithBackground.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ResonancesWithBackground.hpp" +#include "ResonancesWithBackground.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ResonancesWithBackgroundClass; +using CPP = multigroup::ResonancesWithBackground; + +static const std::string CLASSNAME = "ResonancesWithBackground"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto resonances = [](auto &obj) { return &obj.resonances; }; + static auto background = [](auto &obj) { return &obj.background; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPResonances = general::Resonances; +using CPPBackground = general::Background; +using CPPUncertainty = general::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstResonancesWithBackground +ResonancesWithBackgroundDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ResonancesWithBackground +ResonancesWithBackgroundDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstResonancesWithBackground +ResonancesWithBackgroundCreateConst( + const char *const label, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstBackground background, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2ResonancesWithBackground handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + detail::tocpp(resonances), + detail::tocpp(background), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general, non-const +Handle2ResonancesWithBackground +ResonancesWithBackgroundCreate( + const char *const label, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstBackground background, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2ResonancesWithBackground handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + detail::tocpp(resonances), + detail::tocpp(background), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ResonancesWithBackgroundAssign(ConstHandle2ResonancesWithBackground self, ConstHandle2ConstResonancesWithBackground from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ResonancesWithBackgroundDelete(ConstHandle2ConstResonancesWithBackground self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ResonancesWithBackgroundRead(ConstHandle2ResonancesWithBackground self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ResonancesWithBackgroundWrite(ConstHandle2ConstResonancesWithBackground self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ResonancesWithBackgroundPrint(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ResonancesWithBackgroundPrintXML(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ResonancesWithBackgroundPrintJSON(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesWithBackgroundLabelHas(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ResonancesWithBackgroundLabelGet(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ResonancesWithBackgroundLabelSet(ConstHandle2ResonancesWithBackground self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Child: resonances +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesWithBackgroundResonancesHas(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResonancesHas", self, extract::resonances); +} + +// Get, const +Handle2ConstResonances +ResonancesWithBackgroundResonancesGetConst(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonancesGetConst", self, extract::resonances); +} + +// Get, non-const +Handle2Resonances +ResonancesWithBackgroundResonancesGet(ConstHandle2ResonancesWithBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonancesGet", self, extract::resonances); +} + +// Set +void +ResonancesWithBackgroundResonancesSet(ConstHandle2ResonancesWithBackground self, ConstHandle2ConstResonances resonances) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResonancesSet", self, extract::resonances, resonances); +} + + +// ----------------------------------------------------------------------------- +// Child: background +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesWithBackgroundBackgroundHas(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BackgroundHas", self, extract::background); +} + +// Get, const +Handle2ConstBackground +ResonancesWithBackgroundBackgroundGetConst(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BackgroundGetConst", self, extract::background); +} + +// Get, non-const +Handle2Background +ResonancesWithBackgroundBackgroundGet(ConstHandle2ResonancesWithBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BackgroundGet", self, extract::background); +} + +// Set +void +ResonancesWithBackgroundBackgroundSet(ConstHandle2ResonancesWithBackground self, ConstHandle2ConstBackground background) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BackgroundSet", self, extract::background, background); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +ResonancesWithBackgroundUncertaintyHas(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +ResonancesWithBackgroundUncertaintyGetConst(ConstHandle2ConstResonancesWithBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +ResonancesWithBackgroundUncertaintyGet(ConstHandle2ResonancesWithBackground self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +ResonancesWithBackgroundUncertaintySet(ConstHandle2ResonancesWithBackground self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ResonancesWithBackground/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonancesWithBackground.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonancesWithBackground.h new file mode 100644 index 000000000..e96ffa935 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonancesWithBackground.h @@ -0,0 +1,229 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ResonancesWithBackground is the basic handle type in this file. Example: +// // Create a default ResonancesWithBackground object: +// ResonancesWithBackground handle = ResonancesWithBackgroundDefault(); +// Functions involving ResonancesWithBackground are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_RESONANCESWITHBACKGROUND +#define C_INTERFACE_GNDS_V2_0_GENERAL_RESONANCESWITHBACKGROUND + +#include "GNDStk.h" +#include "v2.0/general/Resonances.h" +#include "v2.0/general/Background.h" +#include "v2.0/general/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ResonancesWithBackgroundClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ResonancesWithBackground +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ResonancesWithBackgroundClass *ResonancesWithBackground; + +// --- Const-aware handles. +typedef const struct ResonancesWithBackgroundClass *const ConstHandle2ConstResonancesWithBackground; +typedef struct ResonancesWithBackgroundClass *const ConstHandle2ResonancesWithBackground; +typedef const struct ResonancesWithBackgroundClass * Handle2ConstResonancesWithBackground; +typedef struct ResonancesWithBackgroundClass * Handle2ResonancesWithBackground; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstResonancesWithBackground +ResonancesWithBackgroundDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ResonancesWithBackground +ResonancesWithBackgroundDefault(); + +// --- Create, general, const +extern_c Handle2ConstResonancesWithBackground +ResonancesWithBackgroundCreateConst( + const char *const label, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstBackground background, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general, non-const +extern_c Handle2ResonancesWithBackground +ResonancesWithBackgroundCreate( + const char *const label, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstBackground background, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ResonancesWithBackgroundAssign(ConstHandle2ResonancesWithBackground self, ConstHandle2ConstResonancesWithBackground from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ResonancesWithBackgroundDelete(ConstHandle2ConstResonancesWithBackground self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ResonancesWithBackgroundRead(ConstHandle2ResonancesWithBackground self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ResonancesWithBackgroundWrite(ConstHandle2ConstResonancesWithBackground self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ResonancesWithBackgroundPrint(ConstHandle2ConstResonancesWithBackground self); + +// +++ Print to standard output, as XML +extern_c int +ResonancesWithBackgroundPrintXML(ConstHandle2ConstResonancesWithBackground self); + +// +++ Print to standard output, as JSON +extern_c int +ResonancesWithBackgroundPrintJSON(ConstHandle2ConstResonancesWithBackground self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesWithBackgroundLabelHas(ConstHandle2ConstResonancesWithBackground self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ResonancesWithBackgroundLabelGet(ConstHandle2ConstResonancesWithBackground self); + +// +++ Set +extern_c void +ResonancesWithBackgroundLabelSet(ConstHandle2ResonancesWithBackground self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Child: resonances +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesWithBackgroundResonancesHas(ConstHandle2ConstResonancesWithBackground self); + +// --- Get, const +extern_c Handle2ConstResonances +ResonancesWithBackgroundResonancesGetConst(ConstHandle2ConstResonancesWithBackground self); + +// +++ Get, non-const +extern_c Handle2Resonances +ResonancesWithBackgroundResonancesGet(ConstHandle2ResonancesWithBackground self); + +// +++ Set +extern_c void +ResonancesWithBackgroundResonancesSet(ConstHandle2ResonancesWithBackground self, ConstHandle2ConstResonances resonances); + + +// ----------------------------------------------------------------------------- +// Child: background +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesWithBackgroundBackgroundHas(ConstHandle2ConstResonancesWithBackground self); + +// --- Get, const +extern_c Handle2ConstBackground +ResonancesWithBackgroundBackgroundGetConst(ConstHandle2ConstResonancesWithBackground self); + +// +++ Get, non-const +extern_c Handle2Background +ResonancesWithBackgroundBackgroundGet(ConstHandle2ResonancesWithBackground self); + +// +++ Set +extern_c void +ResonancesWithBackgroundBackgroundSet(ConstHandle2ResonancesWithBackground self, ConstHandle2ConstBackground background); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ResonancesWithBackgroundUncertaintyHas(ConstHandle2ConstResonancesWithBackground self); + +// --- Get, const +extern_c Handle2ConstUncertainty +ResonancesWithBackgroundUncertaintyGetConst(ConstHandle2ConstResonancesWithBackground self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +ResonancesWithBackgroundUncertaintyGet(ConstHandle2ResonancesWithBackground self); + +// +++ Set +extern_c void +ResonancesWithBackgroundUncertaintySet(ConstHandle2ResonancesWithBackground self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ResonancesWithBackground/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonancesWithBackground/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonancesWithBackground/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonancesWithBackground/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ResonancesWithBackground/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RowData.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RowData.cpp new file mode 100644 index 000000000..246e4c7d1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RowData.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/RowData.hpp" +#include "RowData.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = RowDataClass; +using CPP = multigroup::RowData; + +static const std::string CLASSNAME = "RowData"; + +namespace extract { + static auto ENDF_MFMT = [](auto &obj) { return &obj.ENDF_MFMT; }; + static auto dimension = [](auto &obj) { return &obj.dimension; }; + static auto href = [](auto &obj) { return &obj.href; }; + static auto slices = [](auto &obj) { return &obj.slices; }; +} + +using CPPSlices = general::Slices; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRowData +RowDataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2RowData +RowDataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRowData +RowDataCreateConst( + const char *const ENDF_MFMT, + const int dimension, + const char *const href, + ConstHandle2ConstSlices slices +) { + ConstHandle2RowData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MFMT, + dimension, + href, + detail::tocpp(slices) + ); + return handle; +} + +// Create, general, non-const +Handle2RowData +RowDataCreate( + const char *const ENDF_MFMT, + const int dimension, + const char *const href, + ConstHandle2ConstSlices slices +) { + ConstHandle2RowData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MFMT, + dimension, + href, + detail::tocpp(slices) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +RowDataAssign(ConstHandle2RowData self, ConstHandle2ConstRowData from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RowDataDelete(ConstHandle2ConstRowData self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RowDataRead(ConstHandle2RowData self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RowDataWrite(ConstHandle2ConstRowData self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RowDataPrint(ConstHandle2ConstRowData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RowDataPrintXML(ConstHandle2ConstRowData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RowDataPrintJSON(ConstHandle2ConstRowData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MFMT +// ----------------------------------------------------------------------------- + +// Has +int +RowDataENDFMFMTHas(ConstHandle2ConstRowData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMFMTHas", self, extract::ENDF_MFMT); +} + +// Get +// Returns by value +const char * +RowDataENDFMFMTGet(ConstHandle2ConstRowData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMFMTGet", self, extract::ENDF_MFMT); +} + +// Set +void +RowDataENDFMFMTSet(ConstHandle2RowData self, const char *const ENDF_MFMT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMFMTSet", self, extract::ENDF_MFMT, ENDF_MFMT); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: dimension +// ----------------------------------------------------------------------------- + +// Has +int +RowDataDimensionHas(ConstHandle2ConstRowData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DimensionHas", self, extract::dimension); +} + +// Get +// Returns by value +int +RowDataDimensionGet(ConstHandle2ConstRowData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DimensionGet", self, extract::dimension); +} + +// Set +void +RowDataDimensionSet(ConstHandle2RowData self, const int dimension) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DimensionSet", self, extract::dimension, dimension); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +RowDataHrefHas(ConstHandle2ConstRowData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +RowDataHrefGet(ConstHandle2ConstRowData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +RowDataHrefSet(ConstHandle2RowData self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Child: slices +// ----------------------------------------------------------------------------- + +// Has +int +RowDataSlicesHas(ConstHandle2ConstRowData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SlicesHas", self, extract::slices); +} + +// Get, const +Handle2ConstSlices +RowDataSlicesGetConst(ConstHandle2ConstRowData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SlicesGetConst", self, extract::slices); +} + +// Get, non-const +Handle2Slices +RowDataSlicesGet(ConstHandle2RowData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SlicesGet", self, extract::slices); +} + +// Set +void +RowDataSlicesSet(ConstHandle2RowData self, ConstHandle2ConstSlices slices) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SlicesSet", self, extract::slices, slices); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/RowData/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RowData.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RowData.h new file mode 100644 index 000000000..86afbcf70 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RowData.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// RowData is the basic handle type in this file. Example: +// // Create a default RowData object: +// RowData handle = RowDataDefault(); +// Functions involving RowData are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_ROWDATA +#define C_INTERFACE_GNDS_V2_0_GENERAL_ROWDATA + +#include "GNDStk.h" +#include "v2.0/general/Slices.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RowDataClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ RowData +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RowDataClass *RowData; + +// --- Const-aware handles. +typedef const struct RowDataClass *const ConstHandle2ConstRowData; +typedef struct RowDataClass *const ConstHandle2RowData; +typedef const struct RowDataClass * Handle2ConstRowData; +typedef struct RowDataClass * Handle2RowData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRowData +RowDataDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2RowData +RowDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstRowData +RowDataCreateConst( + const char *const ENDF_MFMT, + const int dimension, + const char *const href, + ConstHandle2ConstSlices slices +); + +// +++ Create, general, non-const +extern_c Handle2RowData +RowDataCreate( + const char *const ENDF_MFMT, + const int dimension, + const char *const href, + ConstHandle2ConstSlices slices +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +RowDataAssign(ConstHandle2RowData self, ConstHandle2ConstRowData from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RowDataDelete(ConstHandle2ConstRowData self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RowDataRead(ConstHandle2RowData self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RowDataWrite(ConstHandle2ConstRowData self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RowDataPrint(ConstHandle2ConstRowData self); + +// +++ Print to standard output, as XML +extern_c int +RowDataPrintXML(ConstHandle2ConstRowData self); + +// +++ Print to standard output, as JSON +extern_c int +RowDataPrintJSON(ConstHandle2ConstRowData self); + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MFMT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RowDataENDFMFMTHas(ConstHandle2ConstRowData self); + +// +++ Get +// +++ Returns by value +extern_c const char * +RowDataENDFMFMTGet(ConstHandle2ConstRowData self); + +// +++ Set +extern_c void +RowDataENDFMFMTSet(ConstHandle2RowData self, const char *const ENDF_MFMT); + + +// ----------------------------------------------------------------------------- +// Metadatum: dimension +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RowDataDimensionHas(ConstHandle2ConstRowData self); + +// +++ Get +// +++ Returns by value +extern_c int +RowDataDimensionGet(ConstHandle2ConstRowData self); + +// +++ Set +extern_c void +RowDataDimensionSet(ConstHandle2RowData self, const int dimension); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RowDataHrefHas(ConstHandle2ConstRowData self); + +// +++ Get +// +++ Returns by value +extern_c const char * +RowDataHrefGet(ConstHandle2ConstRowData self); + +// +++ Set +extern_c void +RowDataHrefSet(ConstHandle2RowData self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Child: slices +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +RowDataSlicesHas(ConstHandle2ConstRowData self); + +// --- Get, const +extern_c Handle2ConstSlices +RowDataSlicesGetConst(ConstHandle2ConstRowData self); + +// +++ Get, non-const +extern_c Handle2Slices +RowDataSlicesGet(ConstHandle2RowData self); + +// +++ Set +extern_c void +RowDataSlicesSet(ConstHandle2RowData self, ConstHandle2ConstSlices slices); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/RowData/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RowData/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RowData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RowData/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RowData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RutherfordScattering.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RutherfordScattering.cpp new file mode 100644 index 000000000..c81e23233 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RutherfordScattering.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/RutherfordScattering.hpp" +#include "RutherfordScattering.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = RutherfordScatteringClass; +using CPP = multigroup::RutherfordScattering; + +static const std::string CLASSNAME = "RutherfordScattering"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstRutherfordScattering +RutherfordScatteringDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2RutherfordScattering +RutherfordScatteringDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstRutherfordScattering +RutherfordScatteringCreateConst() +{ + ConstHandle2RutherfordScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general, non-const +Handle2RutherfordScattering +RutherfordScatteringCreate() +{ + ConstHandle2RutherfordScattering handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create" + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +RutherfordScatteringAssign(ConstHandle2RutherfordScattering self, ConstHandle2ConstRutherfordScattering from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +RutherfordScatteringDelete(ConstHandle2ConstRutherfordScattering self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +RutherfordScatteringRead(ConstHandle2RutherfordScattering self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +RutherfordScatteringWrite(ConstHandle2ConstRutherfordScattering self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +RutherfordScatteringPrint(ConstHandle2ConstRutherfordScattering self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +RutherfordScatteringPrintXML(ConstHandle2ConstRutherfordScattering self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +RutherfordScatteringPrintJSON(ConstHandle2ConstRutherfordScattering self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/RutherfordScattering/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RutherfordScattering.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RutherfordScattering.h new file mode 100644 index 000000000..cf41ae9b8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RutherfordScattering.h @@ -0,0 +1,135 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// RutherfordScattering is the basic handle type in this file. Example: +// // Create a default RutherfordScattering object: +// RutherfordScattering handle = RutherfordScatteringDefault(); +// Functions involving RutherfordScattering are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_RUTHERFORDSCATTERING +#define C_INTERFACE_GNDS_V2_0_GENERAL_RUTHERFORDSCATTERING + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct RutherfordScatteringClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ RutherfordScattering +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct RutherfordScatteringClass *RutherfordScattering; + +// --- Const-aware handles. +typedef const struct RutherfordScatteringClass *const ConstHandle2ConstRutherfordScattering; +typedef struct RutherfordScatteringClass *const ConstHandle2RutherfordScattering; +typedef const struct RutherfordScatteringClass * Handle2ConstRutherfordScattering; +typedef struct RutherfordScatteringClass * Handle2RutherfordScattering; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstRutherfordScattering +RutherfordScatteringDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2RutherfordScattering +RutherfordScatteringDefault(); + +// --- Create, general, const +extern_c Handle2ConstRutherfordScattering +RutherfordScatteringCreateConst(); + +// +++ Create, general, non-const +extern_c Handle2RutherfordScattering +RutherfordScatteringCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +RutherfordScatteringAssign(ConstHandle2RutherfordScattering self, ConstHandle2ConstRutherfordScattering from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +RutherfordScatteringDelete(ConstHandle2ConstRutherfordScattering self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +RutherfordScatteringRead(ConstHandle2RutherfordScattering self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +RutherfordScatteringWrite(ConstHandle2ConstRutherfordScattering self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +RutherfordScatteringPrint(ConstHandle2ConstRutherfordScattering self); + +// +++ Print to standard output, as XML +extern_c int +RutherfordScatteringPrintXML(ConstHandle2ConstRutherfordScattering self); + +// +++ Print to standard output, as JSON +extern_c int +RutherfordScatteringPrintJSON(ConstHandle2ConstRutherfordScattering self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/RutherfordScattering/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RutherfordScattering/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RutherfordScattering/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RutherfordScattering/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/RutherfordScattering/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SCTApproximation.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SCTApproximation.cpp new file mode 100644 index 000000000..fed1af8af --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SCTApproximation.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/SCTApproximation.hpp" +#include "SCTApproximation.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SCTApproximationClass; +using CPP = multigroup::SCTApproximation; + +static const std::string CLASSNAME = "SCTApproximation"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSCTApproximation +SCTApproximationDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2SCTApproximation +SCTApproximationDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSCTApproximation +SCTApproximationCreateConst() +{ + ConstHandle2SCTApproximation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general, non-const +Handle2SCTApproximation +SCTApproximationCreate() +{ + ConstHandle2SCTApproximation handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create" + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SCTApproximationAssign(ConstHandle2SCTApproximation self, ConstHandle2ConstSCTApproximation from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SCTApproximationDelete(ConstHandle2ConstSCTApproximation self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SCTApproximationRead(ConstHandle2SCTApproximation self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SCTApproximationWrite(ConstHandle2ConstSCTApproximation self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SCTApproximationPrint(ConstHandle2ConstSCTApproximation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SCTApproximationPrintXML(ConstHandle2ConstSCTApproximation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SCTApproximationPrintJSON(ConstHandle2ConstSCTApproximation self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/SCTApproximation/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SCTApproximation.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SCTApproximation.h new file mode 100644 index 000000000..dc8706529 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SCTApproximation.h @@ -0,0 +1,135 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// SCTApproximation is the basic handle type in this file. Example: +// // Create a default SCTApproximation object: +// SCTApproximation handle = SCTApproximationDefault(); +// Functions involving SCTApproximation are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SCTAPPROXIMATION +#define C_INTERFACE_GNDS_V2_0_GENERAL_SCTAPPROXIMATION + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SCTApproximationClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ SCTApproximation +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SCTApproximationClass *SCTApproximation; + +// --- Const-aware handles. +typedef const struct SCTApproximationClass *const ConstHandle2ConstSCTApproximation; +typedef struct SCTApproximationClass *const ConstHandle2SCTApproximation; +typedef const struct SCTApproximationClass * Handle2ConstSCTApproximation; +typedef struct SCTApproximationClass * Handle2SCTApproximation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSCTApproximation +SCTApproximationDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2SCTApproximation +SCTApproximationDefault(); + +// --- Create, general, const +extern_c Handle2ConstSCTApproximation +SCTApproximationCreateConst(); + +// +++ Create, general, non-const +extern_c Handle2SCTApproximation +SCTApproximationCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SCTApproximationAssign(ConstHandle2SCTApproximation self, ConstHandle2ConstSCTApproximation from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SCTApproximationDelete(ConstHandle2ConstSCTApproximation self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SCTApproximationRead(ConstHandle2SCTApproximation self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SCTApproximationWrite(ConstHandle2ConstSCTApproximation self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SCTApproximationPrint(ConstHandle2ConstSCTApproximation self); + +// +++ Print to standard output, as XML +extern_c int +SCTApproximationPrintXML(ConstHandle2ConstSCTApproximation self); + +// +++ Print to standard output, as JSON +extern_c int +SCTApproximationPrintJSON(ConstHandle2ConstSCTApproximation self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/SCTApproximation/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SCTApproximation/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SCTApproximation/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SCTApproximation/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SCTApproximation/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/S_table.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/S_table.cpp new file mode 100644 index 000000000..e98598fba --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/S_table.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/S_table.hpp" +#include "S_table.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = S_tableClass; +using CPP = multigroup::S_table; + +static const std::string CLASSNAME = "S_table"; + +namespace extract { + static auto gridded2d = [](auto &obj) { return &obj.gridded2d; }; +} + +using CPPGridded2d = general::Gridded2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstS_table +S_tableDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2S_table +S_tableDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstS_table +S_tableCreateConst( + ConstHandle2ConstGridded2d gridded2d +) { + ConstHandle2S_table handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(gridded2d) + ); + return handle; +} + +// Create, general, non-const +Handle2S_table +S_tableCreate( + ConstHandle2ConstGridded2d gridded2d +) { + ConstHandle2S_table handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(gridded2d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +S_tableAssign(ConstHandle2S_table self, ConstHandle2ConstS_table from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +S_tableDelete(ConstHandle2ConstS_table self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +S_tableRead(ConstHandle2S_table self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +S_tableWrite(ConstHandle2ConstS_table self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +S_tablePrint(ConstHandle2ConstS_table self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +S_tablePrintXML(ConstHandle2ConstS_table self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +S_tablePrintJSON(ConstHandle2ConstS_table self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded2d +// ----------------------------------------------------------------------------- + +// Has +int +S_tableGridded2dHas(ConstHandle2ConstS_table self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded2dHas", self, extract::gridded2d); +} + +// Get, const +Handle2ConstGridded2d +S_tableGridded2dGetConst(ConstHandle2ConstS_table self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded2dGetConst", self, extract::gridded2d); +} + +// Get, non-const +Handle2Gridded2d +S_tableGridded2dGet(ConstHandle2S_table self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded2dGet", self, extract::gridded2d); +} + +// Set +void +S_tableGridded2dSet(ConstHandle2S_table self, ConstHandle2ConstGridded2d gridded2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded2dSet", self, extract::gridded2d, gridded2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/S_table/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/S_table.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/S_table.h new file mode 100644 index 000000000..78d8ef21e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/S_table.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// S_table is the basic handle type in this file. Example: +// // Create a default S_table object: +// S_table handle = S_tableDefault(); +// Functions involving S_table are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_S_TABLE +#define C_INTERFACE_GNDS_V2_0_GENERAL_S_TABLE + +#include "GNDStk.h" +#include "v2.0/general/Gridded2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct S_tableClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ S_table +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct S_tableClass *S_table; + +// --- Const-aware handles. +typedef const struct S_tableClass *const ConstHandle2ConstS_table; +typedef struct S_tableClass *const ConstHandle2S_table; +typedef const struct S_tableClass * Handle2ConstS_table; +typedef struct S_tableClass * Handle2S_table; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstS_table +S_tableDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2S_table +S_tableDefault(); + +// --- Create, general, const +extern_c Handle2ConstS_table +S_tableCreateConst( + ConstHandle2ConstGridded2d gridded2d +); + +// +++ Create, general, non-const +extern_c Handle2S_table +S_tableCreate( + ConstHandle2ConstGridded2d gridded2d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +S_tableAssign(ConstHandle2S_table self, ConstHandle2ConstS_table from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +S_tableDelete(ConstHandle2ConstS_table self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +S_tableRead(ConstHandle2S_table self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +S_tableWrite(ConstHandle2ConstS_table self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +S_tablePrint(ConstHandle2ConstS_table self); + +// +++ Print to standard output, as XML +extern_c int +S_tablePrintXML(ConstHandle2ConstS_table self); + +// +++ Print to standard output, as JSON +extern_c int +S_tablePrintJSON(ConstHandle2ConstS_table self); + + +// ----------------------------------------------------------------------------- +// Child: gridded2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +S_tableGridded2dHas(ConstHandle2ConstS_table self); + +// --- Get, const +extern_c Handle2ConstGridded2d +S_tableGridded2dGetConst(ConstHandle2ConstS_table self); + +// +++ Get, non-const +extern_c Handle2Gridded2d +S_tableGridded2dGet(ConstHandle2S_table self); + +// +++ Set +extern_c void +S_tableGridded2dSet(ConstHandle2S_table self, ConstHandle2ConstGridded2d gridded2d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/S_table/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/S_table/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/S_table/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/S_table/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/S_table/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtom.cpp new file mode 100644 index 000000000..f14abb52c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtom.cpp @@ -0,0 +1,501 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ScatteringAtom.hpp" +#include "ScatteringAtom.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ScatteringAtomClass; +using CPP = multigroup::ScatteringAtom; + +static const std::string CLASSNAME = "ScatteringAtom"; + +namespace extract { + static auto pid = [](auto &obj) { return &obj.pid; }; + static auto numberPerMolecule = [](auto &obj) { return &obj.numberPerMolecule; }; + static auto primaryScatterer = [](auto &obj) { return &obj.primaryScatterer; }; + static auto mass = [](auto &obj) { return &obj.mass; }; + static auto e_critical = [](auto &obj) { return &obj.e_critical; }; + static auto e_max = [](auto &obj) { return &obj.e_max; }; + static auto boundAtomCrossSection = [](auto &obj) { return &obj.boundAtomCrossSection; }; + static auto selfScatteringKernel = [](auto &obj) { return &obj.selfScatteringKernel; }; + static auto T_effective = [](auto &obj) { return &obj.T_effective; }; +} + +using CPPMass = general::Mass; +using CPPE_critical = general::E_critical; +using CPPE_max = general::E_max; +using CPPBoundAtomCrossSection = general::BoundAtomCrossSection; +using CPPSelfScatteringKernel = general::SelfScatteringKernel; +using CPPT_effective = general::T_effective; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstScatteringAtom +ScatteringAtomDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ScatteringAtom +ScatteringAtomDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstScatteringAtom +ScatteringAtomCreateConst( + const char *const pid, + const int numberPerMolecule, + const bool primaryScatterer, + ConstHandle2ConstMass mass, + ConstHandle2ConstE_critical e_critical, + ConstHandle2ConstE_max e_max, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstSelfScatteringKernel selfScatteringKernel, + ConstHandle2ConstT_effective T_effective +) { + ConstHandle2ScatteringAtom handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + pid, + numberPerMolecule, + primaryScatterer, + detail::tocpp(mass), + detail::tocpp(e_critical), + detail::tocpp(e_max), + detail::tocpp(boundAtomCrossSection), + detail::tocpp(selfScatteringKernel), + detail::tocpp(T_effective) + ); + return handle; +} + +// Create, general, non-const +Handle2ScatteringAtom +ScatteringAtomCreate( + const char *const pid, + const int numberPerMolecule, + const bool primaryScatterer, + ConstHandle2ConstMass mass, + ConstHandle2ConstE_critical e_critical, + ConstHandle2ConstE_max e_max, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstSelfScatteringKernel selfScatteringKernel, + ConstHandle2ConstT_effective T_effective +) { + ConstHandle2ScatteringAtom handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + pid, + numberPerMolecule, + primaryScatterer, + detail::tocpp(mass), + detail::tocpp(e_critical), + detail::tocpp(e_max), + detail::tocpp(boundAtomCrossSection), + detail::tocpp(selfScatteringKernel), + detail::tocpp(T_effective) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ScatteringAtomAssign(ConstHandle2ScatteringAtom self, ConstHandle2ConstScatteringAtom from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ScatteringAtomDelete(ConstHandle2ConstScatteringAtom self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ScatteringAtomRead(ConstHandle2ScatteringAtom self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ScatteringAtomWrite(ConstHandle2ConstScatteringAtom self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ScatteringAtomPrint(ConstHandle2ConstScatteringAtom self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ScatteringAtomPrintXML(ConstHandle2ConstScatteringAtom self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ScatteringAtomPrintJSON(ConstHandle2ConstScatteringAtom self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomPidHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +ScatteringAtomPidGet(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ScatteringAtomPidSet(ConstHandle2ScatteringAtom self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: numberPerMolecule +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomNumberPerMoleculeHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NumberPerMoleculeHas", self, extract::numberPerMolecule); +} + +// Get +// Returns by value +int +ScatteringAtomNumberPerMoleculeGet(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NumberPerMoleculeGet", self, extract::numberPerMolecule); +} + +// Set +void +ScatteringAtomNumberPerMoleculeSet(ConstHandle2ScatteringAtom self, const int numberPerMolecule) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NumberPerMoleculeSet", self, extract::numberPerMolecule, numberPerMolecule); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: primaryScatterer +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomPrimaryScattererHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PrimaryScattererHas", self, extract::primaryScatterer); +} + +// Get +// Returns by value +bool +ScatteringAtomPrimaryScattererGet(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PrimaryScattererGet", self, extract::primaryScatterer); +} + +// Set +void +ScatteringAtomPrimaryScattererSet(ConstHandle2ScatteringAtom self, const bool primaryScatterer) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PrimaryScattererSet", self, extract::primaryScatterer, primaryScatterer); +} + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomMassHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MassHas", self, extract::mass); +} + +// Get, const +Handle2ConstMass +ScatteringAtomMassGetConst(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGetConst", self, extract::mass); +} + +// Get, non-const +Handle2Mass +ScatteringAtomMassGet(ConstHandle2ScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGet", self, extract::mass); +} + +// Set +void +ScatteringAtomMassSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstMass mass) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MassSet", self, extract::mass, mass); +} + + +// ----------------------------------------------------------------------------- +// Child: e_critical +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomE_criticalHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"E_criticalHas", self, extract::e_critical); +} + +// Get, const +Handle2ConstE_critical +ScatteringAtomE_criticalGetConst(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"E_criticalGetConst", self, extract::e_critical); +} + +// Get, non-const +Handle2E_critical +ScatteringAtomE_criticalGet(ConstHandle2ScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"E_criticalGet", self, extract::e_critical); +} + +// Set +void +ScatteringAtomE_criticalSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstE_critical e_critical) +{ + detail::setField + (CLASSNAME, CLASSNAME+"E_criticalSet", self, extract::e_critical, e_critical); +} + + +// ----------------------------------------------------------------------------- +// Child: e_max +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomE_maxHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"E_maxHas", self, extract::e_max); +} + +// Get, const +Handle2ConstE_max +ScatteringAtomE_maxGetConst(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"E_maxGetConst", self, extract::e_max); +} + +// Get, non-const +Handle2E_max +ScatteringAtomE_maxGet(ConstHandle2ScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"E_maxGet", self, extract::e_max); +} + +// Set +void +ScatteringAtomE_maxSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstE_max e_max) +{ + detail::setField + (CLASSNAME, CLASSNAME+"E_maxSet", self, extract::e_max, e_max); +} + + +// ----------------------------------------------------------------------------- +// Child: boundAtomCrossSection +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomBoundAtomCrossSectionHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BoundAtomCrossSectionHas", self, extract::boundAtomCrossSection); +} + +// Get, const +Handle2ConstBoundAtomCrossSection +ScatteringAtomBoundAtomCrossSectionGetConst(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BoundAtomCrossSectionGetConst", self, extract::boundAtomCrossSection); +} + +// Get, non-const +Handle2BoundAtomCrossSection +ScatteringAtomBoundAtomCrossSectionGet(ConstHandle2ScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BoundAtomCrossSectionGet", self, extract::boundAtomCrossSection); +} + +// Set +void +ScatteringAtomBoundAtomCrossSectionSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BoundAtomCrossSectionSet", self, extract::boundAtomCrossSection, boundAtomCrossSection); +} + + +// ----------------------------------------------------------------------------- +// Child: selfScatteringKernel +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomSelfScatteringKernelHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SelfScatteringKernelHas", self, extract::selfScatteringKernel); +} + +// Get, const +Handle2ConstSelfScatteringKernel +ScatteringAtomSelfScatteringKernelGetConst(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SelfScatteringKernelGetConst", self, extract::selfScatteringKernel); +} + +// Get, non-const +Handle2SelfScatteringKernel +ScatteringAtomSelfScatteringKernelGet(ConstHandle2ScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SelfScatteringKernelGet", self, extract::selfScatteringKernel); +} + +// Set +void +ScatteringAtomSelfScatteringKernelSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstSelfScatteringKernel selfScatteringKernel) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SelfScatteringKernelSet", self, extract::selfScatteringKernel, selfScatteringKernel); +} + + +// ----------------------------------------------------------------------------- +// Child: T_effective +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomT_effectiveHas(ConstHandle2ConstScatteringAtom self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"T_effectiveHas", self, extract::T_effective); +} + +// Get, const +Handle2ConstT_effective +ScatteringAtomT_effectiveGetConst(ConstHandle2ConstScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"T_effectiveGetConst", self, extract::T_effective); +} + +// Get, non-const +Handle2T_effective +ScatteringAtomT_effectiveGet(ConstHandle2ScatteringAtom self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"T_effectiveGet", self, extract::T_effective); +} + +// Set +void +ScatteringAtomT_effectiveSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstT_effective T_effective) +{ + detail::setField + (CLASSNAME, CLASSNAME+"T_effectiveSet", self, extract::T_effective, T_effective); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ScatteringAtom/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtom.h new file mode 100644 index 000000000..09f543a7e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtom.h @@ -0,0 +1,341 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ScatteringAtom is the basic handle type in this file. Example: +// // Create a default ScatteringAtom object: +// ScatteringAtom handle = ScatteringAtomDefault(); +// Functions involving ScatteringAtom are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SCATTERINGATOM +#define C_INTERFACE_GNDS_V2_0_GENERAL_SCATTERINGATOM + +#include "GNDStk.h" +#include "v2.0/general/Mass.h" +#include "v2.0/general/E_critical.h" +#include "v2.0/general/E_max.h" +#include "v2.0/general/BoundAtomCrossSection.h" +#include "v2.0/general/SelfScatteringKernel.h" +#include "v2.0/general/T_effective.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ScatteringAtomClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ScatteringAtom +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ScatteringAtomClass *ScatteringAtom; + +// --- Const-aware handles. +typedef const struct ScatteringAtomClass *const ConstHandle2ConstScatteringAtom; +typedef struct ScatteringAtomClass *const ConstHandle2ScatteringAtom; +typedef const struct ScatteringAtomClass * Handle2ConstScatteringAtom; +typedef struct ScatteringAtomClass * Handle2ScatteringAtom; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstScatteringAtom +ScatteringAtomDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ScatteringAtom +ScatteringAtomDefault(); + +// --- Create, general, const +extern_c Handle2ConstScatteringAtom +ScatteringAtomCreateConst( + const char *const pid, + const int numberPerMolecule, + const bool primaryScatterer, + ConstHandle2ConstMass mass, + ConstHandle2ConstE_critical e_critical, + ConstHandle2ConstE_max e_max, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstSelfScatteringKernel selfScatteringKernel, + ConstHandle2ConstT_effective T_effective +); + +// +++ Create, general, non-const +extern_c Handle2ScatteringAtom +ScatteringAtomCreate( + const char *const pid, + const int numberPerMolecule, + const bool primaryScatterer, + ConstHandle2ConstMass mass, + ConstHandle2ConstE_critical e_critical, + ConstHandle2ConstE_max e_max, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstSelfScatteringKernel selfScatteringKernel, + ConstHandle2ConstT_effective T_effective +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ScatteringAtomAssign(ConstHandle2ScatteringAtom self, ConstHandle2ConstScatteringAtom from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ScatteringAtomDelete(ConstHandle2ConstScatteringAtom self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ScatteringAtomRead(ConstHandle2ScatteringAtom self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ScatteringAtomWrite(ConstHandle2ConstScatteringAtom self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ScatteringAtomPrint(ConstHandle2ConstScatteringAtom self); + +// +++ Print to standard output, as XML +extern_c int +ScatteringAtomPrintXML(ConstHandle2ConstScatteringAtom self); + +// +++ Print to standard output, as JSON +extern_c int +ScatteringAtomPrintJSON(ConstHandle2ConstScatteringAtom self); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomPidHas(ConstHandle2ConstScatteringAtom self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ScatteringAtomPidGet(ConstHandle2ConstScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomPidSet(ConstHandle2ScatteringAtom self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: numberPerMolecule +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomNumberPerMoleculeHas(ConstHandle2ConstScatteringAtom self); + +// +++ Get +// +++ Returns by value +extern_c int +ScatteringAtomNumberPerMoleculeGet(ConstHandle2ConstScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomNumberPerMoleculeSet(ConstHandle2ScatteringAtom self, const int numberPerMolecule); + + +// ----------------------------------------------------------------------------- +// Metadatum: primaryScatterer +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomPrimaryScattererHas(ConstHandle2ConstScatteringAtom self); + +// +++ Get +// +++ Returns by value +extern_c bool +ScatteringAtomPrimaryScattererGet(ConstHandle2ConstScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomPrimaryScattererSet(ConstHandle2ScatteringAtom self, const bool primaryScatterer); + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomMassHas(ConstHandle2ConstScatteringAtom self); + +// --- Get, const +extern_c Handle2ConstMass +ScatteringAtomMassGetConst(ConstHandle2ConstScatteringAtom self); + +// +++ Get, non-const +extern_c Handle2Mass +ScatteringAtomMassGet(ConstHandle2ScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomMassSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstMass mass); + + +// ----------------------------------------------------------------------------- +// Child: e_critical +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomE_criticalHas(ConstHandle2ConstScatteringAtom self); + +// --- Get, const +extern_c Handle2ConstE_critical +ScatteringAtomE_criticalGetConst(ConstHandle2ConstScatteringAtom self); + +// +++ Get, non-const +extern_c Handle2E_critical +ScatteringAtomE_criticalGet(ConstHandle2ScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomE_criticalSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstE_critical e_critical); + + +// ----------------------------------------------------------------------------- +// Child: e_max +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomE_maxHas(ConstHandle2ConstScatteringAtom self); + +// --- Get, const +extern_c Handle2ConstE_max +ScatteringAtomE_maxGetConst(ConstHandle2ConstScatteringAtom self); + +// +++ Get, non-const +extern_c Handle2E_max +ScatteringAtomE_maxGet(ConstHandle2ScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomE_maxSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstE_max e_max); + + +// ----------------------------------------------------------------------------- +// Child: boundAtomCrossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomBoundAtomCrossSectionHas(ConstHandle2ConstScatteringAtom self); + +// --- Get, const +extern_c Handle2ConstBoundAtomCrossSection +ScatteringAtomBoundAtomCrossSectionGetConst(ConstHandle2ConstScatteringAtom self); + +// +++ Get, non-const +extern_c Handle2BoundAtomCrossSection +ScatteringAtomBoundAtomCrossSectionGet(ConstHandle2ScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomBoundAtomCrossSectionSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection); + + +// ----------------------------------------------------------------------------- +// Child: selfScatteringKernel +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomSelfScatteringKernelHas(ConstHandle2ConstScatteringAtom self); + +// --- Get, const +extern_c Handle2ConstSelfScatteringKernel +ScatteringAtomSelfScatteringKernelGetConst(ConstHandle2ConstScatteringAtom self); + +// +++ Get, non-const +extern_c Handle2SelfScatteringKernel +ScatteringAtomSelfScatteringKernelGet(ConstHandle2ScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomSelfScatteringKernelSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstSelfScatteringKernel selfScatteringKernel); + + +// ----------------------------------------------------------------------------- +// Child: T_effective +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomT_effectiveHas(ConstHandle2ConstScatteringAtom self); + +// --- Get, const +extern_c Handle2ConstT_effective +ScatteringAtomT_effectiveGetConst(ConstHandle2ConstScatteringAtom self); + +// +++ Get, non-const +extern_c Handle2T_effective +ScatteringAtomT_effectiveGet(ConstHandle2ScatteringAtom self); + +// +++ Set +extern_c void +ScatteringAtomT_effectiveSet(ConstHandle2ScatteringAtom self, ConstHandle2ConstT_effective T_effective); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ScatteringAtom/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtom/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtom/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtom/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtom/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtoms.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtoms.cpp new file mode 100644 index 000000000..096f7d9bf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtoms.cpp @@ -0,0 +1,359 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ScatteringAtoms.hpp" +#include "ScatteringAtoms.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ScatteringAtomsClass; +using CPP = multigroup::ScatteringAtoms; + +static const std::string CLASSNAME = "ScatteringAtoms"; + +namespace extract { + static auto scatteringAtom = [](auto &obj) { return &obj.scatteringAtom; }; +} + +using CPPScatteringAtom = general::ScatteringAtom; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstScatteringAtoms +ScatteringAtomsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ScatteringAtoms +ScatteringAtomsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstScatteringAtoms +ScatteringAtomsCreateConst( + ConstHandle2ScatteringAtom *const scatteringAtom, const size_t scatteringAtomSize +) { + ConstHandle2ScatteringAtoms handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ScatteringAtomN = 0; ScatteringAtomN < scatteringAtomSize; ++ScatteringAtomN) + ScatteringAtomsScatteringAtomAdd(handle, scatteringAtom[ScatteringAtomN]); + return handle; +} + +// Create, general, non-const +Handle2ScatteringAtoms +ScatteringAtomsCreate( + ConstHandle2ScatteringAtom *const scatteringAtom, const size_t scatteringAtomSize +) { + ConstHandle2ScatteringAtoms handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ScatteringAtomN = 0; ScatteringAtomN < scatteringAtomSize; ++ScatteringAtomN) + ScatteringAtomsScatteringAtomAdd(handle, scatteringAtom[ScatteringAtomN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ScatteringAtomsAssign(ConstHandle2ScatteringAtoms self, ConstHandle2ConstScatteringAtoms from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ScatteringAtomsDelete(ConstHandle2ConstScatteringAtoms self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ScatteringAtomsRead(ConstHandle2ScatteringAtoms self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ScatteringAtomsWrite(ConstHandle2ConstScatteringAtoms self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ScatteringAtomsPrint(ConstHandle2ConstScatteringAtoms self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ScatteringAtomsPrintXML(ConstHandle2ConstScatteringAtoms self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ScatteringAtomsPrintJSON(ConstHandle2ConstScatteringAtoms self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: scatteringAtom +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringAtomsScatteringAtomHas(ConstHandle2ConstScatteringAtoms self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ScatteringAtomHas", self, extract::scatteringAtom); +} + +// Clear +void +ScatteringAtomsScatteringAtomClear(ConstHandle2ScatteringAtoms self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ScatteringAtomClear", self, extract::scatteringAtom); +} + +// Size +size_t +ScatteringAtomsScatteringAtomSize(ConstHandle2ConstScatteringAtoms self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ScatteringAtomSize", self, extract::scatteringAtom); +} + +// Add +void +ScatteringAtomsScatteringAtomAdd(ConstHandle2ScatteringAtoms self, ConstHandle2ConstScatteringAtom scatteringAtom) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ScatteringAtomAdd", self, extract::scatteringAtom, scatteringAtom); +} + +// Get, by index \in [0,size), const +Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetConst(ConstHandle2ConstScatteringAtoms self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ScatteringAtomGetConst", self, extract::scatteringAtom, index_); +} + +// Get, by index \in [0,size), non-const +Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGet(ConstHandle2ScatteringAtoms self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ScatteringAtomGet", self, extract::scatteringAtom, index_); +} + +// Set, by index \in [0,size) +void +ScatteringAtomsScatteringAtomSet( + ConstHandle2ScatteringAtoms self, + const size_t index_, + ConstHandle2ConstScatteringAtom scatteringAtom +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ScatteringAtomSet", self, extract::scatteringAtom, index_, scatteringAtom); +} + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// Has, by pid +int +ScatteringAtomsScatteringAtomHasByPid( + ConstHandle2ConstScatteringAtoms self, + const char *const pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomHasByPid", + self, extract::scatteringAtom, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetByPidConst( + ConstHandle2ConstScatteringAtoms self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomGetByPidConst", + self, extract::scatteringAtom, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGetByPid( + ConstHandle2ScatteringAtoms self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomGetByPid", + self, extract::scatteringAtom, meta::pid, pid); +} + +// Set, by pid +void +ScatteringAtomsScatteringAtomSetByPid( + ConstHandle2ScatteringAtoms self, + const char *const pid, + ConstHandle2ConstScatteringAtom scatteringAtom +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomSetByPid", + self, extract::scatteringAtom, meta::pid, pid, scatteringAtom); +} + +// ------------------------ +// Re: metadatum numberPerMolecule +// ------------------------ + +// Has, by numberPerMolecule +int +ScatteringAtomsScatteringAtomHasByNumberPerMolecule( + ConstHandle2ConstScatteringAtoms self, + const int numberPerMolecule +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomHasByNumberPerMolecule", + self, extract::scatteringAtom, meta::numberPerMolecule, numberPerMolecule); +} + +// Get, by numberPerMolecule, const +Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetByNumberPerMoleculeConst( + ConstHandle2ConstScatteringAtoms self, + const int numberPerMolecule +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomGetByNumberPerMoleculeConst", + self, extract::scatteringAtom, meta::numberPerMolecule, numberPerMolecule); +} + +// Get, by numberPerMolecule, non-const +Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGetByNumberPerMolecule( + ConstHandle2ScatteringAtoms self, + const int numberPerMolecule +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomGetByNumberPerMolecule", + self, extract::scatteringAtom, meta::numberPerMolecule, numberPerMolecule); +} + +// Set, by numberPerMolecule +void +ScatteringAtomsScatteringAtomSetByNumberPerMolecule( + ConstHandle2ScatteringAtoms self, + const int numberPerMolecule, + ConstHandle2ConstScatteringAtom scatteringAtom +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomSetByNumberPerMolecule", + self, extract::scatteringAtom, meta::numberPerMolecule, numberPerMolecule, scatteringAtom); +} + +// ------------------------ +// Re: metadatum primaryScatterer +// ------------------------ + +// Has, by primaryScatterer +int +ScatteringAtomsScatteringAtomHasByPrimaryScatterer( + ConstHandle2ConstScatteringAtoms self, + const bool primaryScatterer +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomHasByPrimaryScatterer", + self, extract::scatteringAtom, meta::primaryScatterer, primaryScatterer); +} + +// Get, by primaryScatterer, const +Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetByPrimaryScattererConst( + ConstHandle2ConstScatteringAtoms self, + const bool primaryScatterer +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomGetByPrimaryScattererConst", + self, extract::scatteringAtom, meta::primaryScatterer, primaryScatterer); +} + +// Get, by primaryScatterer, non-const +Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGetByPrimaryScatterer( + ConstHandle2ScatteringAtoms self, + const bool primaryScatterer +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomGetByPrimaryScatterer", + self, extract::scatteringAtom, meta::primaryScatterer, primaryScatterer); +} + +// Set, by primaryScatterer +void +ScatteringAtomsScatteringAtomSetByPrimaryScatterer( + ConstHandle2ScatteringAtoms self, + const bool primaryScatterer, + ConstHandle2ConstScatteringAtom scatteringAtom +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ScatteringAtomSetByPrimaryScatterer", + self, extract::scatteringAtom, meta::primaryScatterer, primaryScatterer, scatteringAtom); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ScatteringAtoms/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtoms.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtoms.h new file mode 100644 index 000000000..0c7f387c3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtoms.h @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ScatteringAtoms is the basic handle type in this file. Example: +// // Create a default ScatteringAtoms object: +// ScatteringAtoms handle = ScatteringAtomsDefault(); +// Functions involving ScatteringAtoms are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SCATTERINGATOMS +#define C_INTERFACE_GNDS_V2_0_GENERAL_SCATTERINGATOMS + +#include "GNDStk.h" +#include "v2.0/general/ScatteringAtom.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ScatteringAtomsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ScatteringAtoms +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ScatteringAtomsClass *ScatteringAtoms; + +// --- Const-aware handles. +typedef const struct ScatteringAtomsClass *const ConstHandle2ConstScatteringAtoms; +typedef struct ScatteringAtomsClass *const ConstHandle2ScatteringAtoms; +typedef const struct ScatteringAtomsClass * Handle2ConstScatteringAtoms; +typedef struct ScatteringAtomsClass * Handle2ScatteringAtoms; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstScatteringAtoms +ScatteringAtomsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ScatteringAtoms +ScatteringAtomsDefault(); + +// --- Create, general, const +extern_c Handle2ConstScatteringAtoms +ScatteringAtomsCreateConst( + ConstHandle2ScatteringAtom *const scatteringAtom, const size_t scatteringAtomSize +); + +// +++ Create, general, non-const +extern_c Handle2ScatteringAtoms +ScatteringAtomsCreate( + ConstHandle2ScatteringAtom *const scatteringAtom, const size_t scatteringAtomSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ScatteringAtomsAssign(ConstHandle2ScatteringAtoms self, ConstHandle2ConstScatteringAtoms from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ScatteringAtomsDelete(ConstHandle2ConstScatteringAtoms self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ScatteringAtomsRead(ConstHandle2ScatteringAtoms self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ScatteringAtomsWrite(ConstHandle2ConstScatteringAtoms self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ScatteringAtomsPrint(ConstHandle2ConstScatteringAtoms self); + +// +++ Print to standard output, as XML +extern_c int +ScatteringAtomsPrintXML(ConstHandle2ConstScatteringAtoms self); + +// +++ Print to standard output, as JSON +extern_c int +ScatteringAtomsPrintJSON(ConstHandle2ConstScatteringAtoms self); + + +// ----------------------------------------------------------------------------- +// Child: scatteringAtom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringAtomsScatteringAtomHas(ConstHandle2ConstScatteringAtoms self); + +// +++ Clear +extern_c void +ScatteringAtomsScatteringAtomClear(ConstHandle2ScatteringAtoms self); + +// +++ Size +extern_c size_t +ScatteringAtomsScatteringAtomSize(ConstHandle2ConstScatteringAtoms self); + +// +++ Add +extern_c void +ScatteringAtomsScatteringAtomAdd(ConstHandle2ScatteringAtoms self, ConstHandle2ConstScatteringAtom scatteringAtom); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetConst(ConstHandle2ConstScatteringAtoms self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGet(ConstHandle2ScatteringAtoms self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ScatteringAtomsScatteringAtomSet( + ConstHandle2ScatteringAtoms self, + const size_t index_, + ConstHandle2ConstScatteringAtom scatteringAtom +); + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// +++ Has, by pid +extern_c int +ScatteringAtomsScatteringAtomHasByPid( + ConstHandle2ConstScatteringAtoms self, + const char *const pid +); + +// --- Get, by pid, const +extern_c Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetByPidConst( + ConstHandle2ConstScatteringAtoms self, + const char *const pid +); + +// +++ Get, by pid, non-const +extern_c Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGetByPid( + ConstHandle2ScatteringAtoms self, + const char *const pid +); + +// +++ Set, by pid +extern_c void +ScatteringAtomsScatteringAtomSetByPid( + ConstHandle2ScatteringAtoms self, + const char *const pid, + ConstHandle2ConstScatteringAtom scatteringAtom +); + +// ------------------------ +// Re: metadatum numberPerMolecule +// ------------------------ + +// +++ Has, by numberPerMolecule +extern_c int +ScatteringAtomsScatteringAtomHasByNumberPerMolecule( + ConstHandle2ConstScatteringAtoms self, + const int numberPerMolecule +); + +// --- Get, by numberPerMolecule, const +extern_c Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetByNumberPerMoleculeConst( + ConstHandle2ConstScatteringAtoms self, + const int numberPerMolecule +); + +// +++ Get, by numberPerMolecule, non-const +extern_c Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGetByNumberPerMolecule( + ConstHandle2ScatteringAtoms self, + const int numberPerMolecule +); + +// +++ Set, by numberPerMolecule +extern_c void +ScatteringAtomsScatteringAtomSetByNumberPerMolecule( + ConstHandle2ScatteringAtoms self, + const int numberPerMolecule, + ConstHandle2ConstScatteringAtom scatteringAtom +); + +// ------------------------ +// Re: metadatum primaryScatterer +// ------------------------ + +// +++ Has, by primaryScatterer +extern_c int +ScatteringAtomsScatteringAtomHasByPrimaryScatterer( + ConstHandle2ConstScatteringAtoms self, + const bool primaryScatterer +); + +// --- Get, by primaryScatterer, const +extern_c Handle2ConstScatteringAtom +ScatteringAtomsScatteringAtomGetByPrimaryScattererConst( + ConstHandle2ConstScatteringAtoms self, + const bool primaryScatterer +); + +// +++ Get, by primaryScatterer, non-const +extern_c Handle2ScatteringAtom +ScatteringAtomsScatteringAtomGetByPrimaryScatterer( + ConstHandle2ScatteringAtoms self, + const bool primaryScatterer +); + +// +++ Set, by primaryScatterer +extern_c void +ScatteringAtomsScatteringAtomSetByPrimaryScatterer( + ConstHandle2ScatteringAtoms self, + const bool primaryScatterer, + ConstHandle2ConstScatteringAtom scatteringAtom +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ScatteringAtoms/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtoms/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtoms/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtoms/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringAtoms/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringFactor.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringFactor.cpp new file mode 100644 index 000000000..4154a3792 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringFactor.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ScatteringFactor.hpp" +#include "ScatteringFactor.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ScatteringFactorClass; +using CPP = multigroup::ScatteringFactor; + +static const std::string CLASSNAME = "ScatteringFactor"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstScatteringFactor +ScatteringFactorDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ScatteringFactor +ScatteringFactorDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstScatteringFactor +ScatteringFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2ScatteringFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2ScatteringFactor +ScatteringFactorCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2ScatteringFactor handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ScatteringFactorAssign(ConstHandle2ScatteringFactor self, ConstHandle2ConstScatteringFactor from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ScatteringFactorDelete(ConstHandle2ConstScatteringFactor self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ScatteringFactorRead(ConstHandle2ScatteringFactor self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ScatteringFactorWrite(ConstHandle2ConstScatteringFactor self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ScatteringFactorPrint(ConstHandle2ConstScatteringFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ScatteringFactorPrintXML(ConstHandle2ConstScatteringFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ScatteringFactorPrintJSON(ConstHandle2ConstScatteringFactor self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringFactorXYs1dHas(ConstHandle2ConstScatteringFactor self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +ScatteringFactorXYs1dGetConst(ConstHandle2ConstScatteringFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +ScatteringFactorXYs1dGet(ConstHandle2ScatteringFactor self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +ScatteringFactorXYs1dSet(ConstHandle2ScatteringFactor self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ScatteringFactor/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringFactor.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringFactor.h new file mode 100644 index 000000000..b443d698f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringFactor.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ScatteringFactor is the basic handle type in this file. Example: +// // Create a default ScatteringFactor object: +// ScatteringFactor handle = ScatteringFactorDefault(); +// Functions involving ScatteringFactor are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SCATTERINGFACTOR +#define C_INTERFACE_GNDS_V2_0_GENERAL_SCATTERINGFACTOR + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ScatteringFactorClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ScatteringFactor +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ScatteringFactorClass *ScatteringFactor; + +// --- Const-aware handles. +typedef const struct ScatteringFactorClass *const ConstHandle2ConstScatteringFactor; +typedef struct ScatteringFactorClass *const ConstHandle2ScatteringFactor; +typedef const struct ScatteringFactorClass * Handle2ConstScatteringFactor; +typedef struct ScatteringFactorClass * Handle2ScatteringFactor; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstScatteringFactor +ScatteringFactorDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ScatteringFactor +ScatteringFactorDefault(); + +// --- Create, general, const +extern_c Handle2ConstScatteringFactor +ScatteringFactorCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2ScatteringFactor +ScatteringFactorCreate( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ScatteringFactorAssign(ConstHandle2ScatteringFactor self, ConstHandle2ConstScatteringFactor from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ScatteringFactorDelete(ConstHandle2ConstScatteringFactor self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ScatteringFactorRead(ConstHandle2ScatteringFactor self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ScatteringFactorWrite(ConstHandle2ConstScatteringFactor self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ScatteringFactorPrint(ConstHandle2ConstScatteringFactor self); + +// +++ Print to standard output, as XML +extern_c int +ScatteringFactorPrintXML(ConstHandle2ConstScatteringFactor self); + +// +++ Print to standard output, as JSON +extern_c int +ScatteringFactorPrintJSON(ConstHandle2ConstScatteringFactor self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringFactorXYs1dHas(ConstHandle2ConstScatteringFactor self); + +// --- Get, const +extern_c Handle2ConstXYs1d +ScatteringFactorXYs1dGetConst(ConstHandle2ConstScatteringFactor self); + +// +++ Get, non-const +extern_c Handle2XYs1d +ScatteringFactorXYs1dGet(ConstHandle2ScatteringFactor self); + +// +++ Set +extern_c void +ScatteringFactorXYs1dSet(ConstHandle2ScatteringFactor self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ScatteringFactor/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringFactor/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringFactor/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringFactor/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringFactor/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringRadius.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringRadius.cpp new file mode 100644 index 000000000..56f3408f7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringRadius.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ScatteringRadius.hpp" +#include "ScatteringRadius.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ScatteringRadiusClass; +using CPP = multigroup::ScatteringRadius; + +static const std::string CLASSNAME = "ScatteringRadius"; + +namespace extract { + static auto constant1d = [](auto &obj) { return &obj.constant1d; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPConstant1d = general::Constant1d; +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstScatteringRadius +ScatteringRadiusDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ScatteringRadius +ScatteringRadiusDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstScatteringRadius +ScatteringRadiusCreateConst( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2ScatteringRadius handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(constant1d), + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2ScatteringRadius +ScatteringRadiusCreate( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2ScatteringRadius handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(constant1d), + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ScatteringRadiusAssign(ConstHandle2ScatteringRadius self, ConstHandle2ConstScatteringRadius from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ScatteringRadiusDelete(ConstHandle2ConstScatteringRadius self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ScatteringRadiusRead(ConstHandle2ScatteringRadius self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ScatteringRadiusWrite(ConstHandle2ConstScatteringRadius self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ScatteringRadiusPrint(ConstHandle2ConstScatteringRadius self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ScatteringRadiusPrintXML(ConstHandle2ConstScatteringRadius self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ScatteringRadiusPrintJSON(ConstHandle2ConstScatteringRadius self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringRadiusConstant1dHas(ConstHandle2ConstScatteringRadius self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Constant1dHas", self, extract::constant1d); +} + +// Get, const +Handle2ConstConstant1d +ScatteringRadiusConstant1dGetConst(ConstHandle2ConstScatteringRadius self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGetConst", self, extract::constant1d); +} + +// Get, non-const +Handle2Constant1d +ScatteringRadiusConstant1dGet(ConstHandle2ScatteringRadius self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGet", self, extract::constant1d); +} + +// Set +void +ScatteringRadiusConstant1dSet(ConstHandle2ScatteringRadius self, ConstHandle2ConstConstant1d constant1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Constant1dSet", self, extract::constant1d, constant1d); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +ScatteringRadiusXYs1dHas(ConstHandle2ConstScatteringRadius self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +ScatteringRadiusXYs1dGetConst(ConstHandle2ConstScatteringRadius self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +ScatteringRadiusXYs1dGet(ConstHandle2ScatteringRadius self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +ScatteringRadiusXYs1dSet(ConstHandle2ScatteringRadius self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ScatteringRadius/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringRadius.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringRadius.h new file mode 100644 index 000000000..1ab1197c8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringRadius.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ScatteringRadius is the basic handle type in this file. Example: +// // Create a default ScatteringRadius object: +// ScatteringRadius handle = ScatteringRadiusDefault(); +// Functions involving ScatteringRadius are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SCATTERINGRADIUS +#define C_INTERFACE_GNDS_V2_0_GENERAL_SCATTERINGRADIUS + +#include "GNDStk.h" +#include "v2.0/general/Constant1d.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ScatteringRadiusClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ScatteringRadius +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ScatteringRadiusClass *ScatteringRadius; + +// --- Const-aware handles. +typedef const struct ScatteringRadiusClass *const ConstHandle2ConstScatteringRadius; +typedef struct ScatteringRadiusClass *const ConstHandle2ScatteringRadius; +typedef const struct ScatteringRadiusClass * Handle2ConstScatteringRadius; +typedef struct ScatteringRadiusClass * Handle2ScatteringRadius; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstScatteringRadius +ScatteringRadiusDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ScatteringRadius +ScatteringRadiusDefault(); + +// --- Create, general, const +extern_c Handle2ConstScatteringRadius +ScatteringRadiusCreateConst( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2ScatteringRadius +ScatteringRadiusCreate( + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ScatteringRadiusAssign(ConstHandle2ScatteringRadius self, ConstHandle2ConstScatteringRadius from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ScatteringRadiusDelete(ConstHandle2ConstScatteringRadius self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ScatteringRadiusRead(ConstHandle2ScatteringRadius self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ScatteringRadiusWrite(ConstHandle2ConstScatteringRadius self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ScatteringRadiusPrint(ConstHandle2ConstScatteringRadius self); + +// +++ Print to standard output, as XML +extern_c int +ScatteringRadiusPrintXML(ConstHandle2ConstScatteringRadius self); + +// +++ Print to standard output, as JSON +extern_c int +ScatteringRadiusPrintJSON(ConstHandle2ConstScatteringRadius self); + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringRadiusConstant1dHas(ConstHandle2ConstScatteringRadius self); + +// --- Get, const +extern_c Handle2ConstConstant1d +ScatteringRadiusConstant1dGetConst(ConstHandle2ConstScatteringRadius self); + +// +++ Get, non-const +extern_c Handle2Constant1d +ScatteringRadiusConstant1dGet(ConstHandle2ScatteringRadius self); + +// +++ Set +extern_c void +ScatteringRadiusConstant1dSet(ConstHandle2ScatteringRadius self, ConstHandle2ConstConstant1d constant1d); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ScatteringRadiusXYs1dHas(ConstHandle2ConstScatteringRadius self); + +// --- Get, const +extern_c Handle2ConstXYs1d +ScatteringRadiusXYs1dGetConst(ConstHandle2ConstScatteringRadius self); + +// +++ Get, non-const +extern_c Handle2XYs1d +ScatteringRadiusXYs1dGet(ConstHandle2ScatteringRadius self); + +// +++ Set +extern_c void +ScatteringRadiusXYs1dSet(ConstHandle2ScatteringRadius self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ScatteringRadius/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringRadius/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringRadius/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringRadius/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ScatteringRadius/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SelfScatteringKernel.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SelfScatteringKernel.cpp new file mode 100644 index 000000000..5313d8ad2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SelfScatteringKernel.cpp @@ -0,0 +1,302 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/SelfScatteringKernel.hpp" +#include "SelfScatteringKernel.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SelfScatteringKernelClass; +using CPP = multigroup::SelfScatteringKernel; + +static const std::string CLASSNAME = "SelfScatteringKernel"; + +namespace extract { + static auto symmetric = [](auto &obj) { return &obj.symmetric; }; + static auto gridded3d = [](auto &obj) { return &obj.gridded3d; }; + static auto SCTApproximation = [](auto &obj) { return &obj.SCTApproximation; }; + static auto freeGasApproximation = [](auto &obj) { return &obj.freeGasApproximation; }; +} + +using CPPGridded3d = general::Gridded3d; +using CPPSCTApproximation = general::SCTApproximation; +using CPPFreeGasApproximation = general::FreeGasApproximation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSelfScatteringKernel +SelfScatteringKernelDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2SelfScatteringKernel +SelfScatteringKernelDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSelfScatteringKernel +SelfScatteringKernelCreateConst( + const bool symmetric, + ConstHandle2ConstGridded3d gridded3d, + ConstHandle2ConstSCTApproximation SCTApproximation, + ConstHandle2ConstFreeGasApproximation freeGasApproximation +) { + ConstHandle2SelfScatteringKernel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + symmetric, + detail::tocpp(gridded3d), + detail::tocpp(SCTApproximation), + detail::tocpp(freeGasApproximation) + ); + return handle; +} + +// Create, general, non-const +Handle2SelfScatteringKernel +SelfScatteringKernelCreate( + const bool symmetric, + ConstHandle2ConstGridded3d gridded3d, + ConstHandle2ConstSCTApproximation SCTApproximation, + ConstHandle2ConstFreeGasApproximation freeGasApproximation +) { + ConstHandle2SelfScatteringKernel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + symmetric, + detail::tocpp(gridded3d), + detail::tocpp(SCTApproximation), + detail::tocpp(freeGasApproximation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SelfScatteringKernelAssign(ConstHandle2SelfScatteringKernel self, ConstHandle2ConstSelfScatteringKernel from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SelfScatteringKernelDelete(ConstHandle2ConstSelfScatteringKernel self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SelfScatteringKernelRead(ConstHandle2SelfScatteringKernel self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SelfScatteringKernelWrite(ConstHandle2ConstSelfScatteringKernel self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SelfScatteringKernelPrint(ConstHandle2ConstSelfScatteringKernel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SelfScatteringKernelPrintXML(ConstHandle2ConstSelfScatteringKernel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SelfScatteringKernelPrintJSON(ConstHandle2ConstSelfScatteringKernel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: symmetric +// ----------------------------------------------------------------------------- + +// Has +int +SelfScatteringKernelSymmetricHas(ConstHandle2ConstSelfScatteringKernel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SymmetricHas", self, extract::symmetric); +} + +// Get +// Returns by value +bool +SelfScatteringKernelSymmetricGet(ConstHandle2ConstSelfScatteringKernel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SymmetricGet", self, extract::symmetric); +} + +// Set +void +SelfScatteringKernelSymmetricSet(ConstHandle2SelfScatteringKernel self, const bool symmetric) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SymmetricSet", self, extract::symmetric, symmetric); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded3d +// ----------------------------------------------------------------------------- + +// Has +int +SelfScatteringKernelGridded3dHas(ConstHandle2ConstSelfScatteringKernel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded3dHas", self, extract::gridded3d); +} + +// Get, const +Handle2ConstGridded3d +SelfScatteringKernelGridded3dGetConst(ConstHandle2ConstSelfScatteringKernel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded3dGetConst", self, extract::gridded3d); +} + +// Get, non-const +Handle2Gridded3d +SelfScatteringKernelGridded3dGet(ConstHandle2SelfScatteringKernel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded3dGet", self, extract::gridded3d); +} + +// Set +void +SelfScatteringKernelGridded3dSet(ConstHandle2SelfScatteringKernel self, ConstHandle2ConstGridded3d gridded3d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded3dSet", self, extract::gridded3d, gridded3d); +} + + +// ----------------------------------------------------------------------------- +// Child: SCTApproximation +// ----------------------------------------------------------------------------- + +// Has +int +SelfScatteringKernelSCTApproximationHas(ConstHandle2ConstSelfScatteringKernel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SCTApproximationHas", self, extract::SCTApproximation); +} + +// Get, const +Handle2ConstSCTApproximation +SelfScatteringKernelSCTApproximationGetConst(ConstHandle2ConstSelfScatteringKernel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SCTApproximationGetConst", self, extract::SCTApproximation); +} + +// Get, non-const +Handle2SCTApproximation +SelfScatteringKernelSCTApproximationGet(ConstHandle2SelfScatteringKernel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SCTApproximationGet", self, extract::SCTApproximation); +} + +// Set +void +SelfScatteringKernelSCTApproximationSet(ConstHandle2SelfScatteringKernel self, ConstHandle2ConstSCTApproximation SCTApproximation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SCTApproximationSet", self, extract::SCTApproximation, SCTApproximation); +} + + +// ----------------------------------------------------------------------------- +// Child: freeGasApproximation +// ----------------------------------------------------------------------------- + +// Has +int +SelfScatteringKernelFreeGasApproximationHas(ConstHandle2ConstSelfScatteringKernel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FreeGasApproximationHas", self, extract::freeGasApproximation); +} + +// Get, const +Handle2ConstFreeGasApproximation +SelfScatteringKernelFreeGasApproximationGetConst(ConstHandle2ConstSelfScatteringKernel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FreeGasApproximationGetConst", self, extract::freeGasApproximation); +} + +// Get, non-const +Handle2FreeGasApproximation +SelfScatteringKernelFreeGasApproximationGet(ConstHandle2SelfScatteringKernel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FreeGasApproximationGet", self, extract::freeGasApproximation); +} + +// Set +void +SelfScatteringKernelFreeGasApproximationSet(ConstHandle2SelfScatteringKernel self, ConstHandle2ConstFreeGasApproximation freeGasApproximation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FreeGasApproximationSet", self, extract::freeGasApproximation, freeGasApproximation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/SelfScatteringKernel/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SelfScatteringKernel.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SelfScatteringKernel.h new file mode 100644 index 000000000..7a7c194b3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SelfScatteringKernel.h @@ -0,0 +1,229 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// SelfScatteringKernel is the basic handle type in this file. Example: +// // Create a default SelfScatteringKernel object: +// SelfScatteringKernel handle = SelfScatteringKernelDefault(); +// Functions involving SelfScatteringKernel are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SELFSCATTERINGKERNEL +#define C_INTERFACE_GNDS_V2_0_GENERAL_SELFSCATTERINGKERNEL + +#include "GNDStk.h" +#include "v2.0/general/Gridded3d.h" +#include "v2.0/general/SCTApproximation.h" +#include "v2.0/general/FreeGasApproximation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SelfScatteringKernelClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ SelfScatteringKernel +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SelfScatteringKernelClass *SelfScatteringKernel; + +// --- Const-aware handles. +typedef const struct SelfScatteringKernelClass *const ConstHandle2ConstSelfScatteringKernel; +typedef struct SelfScatteringKernelClass *const ConstHandle2SelfScatteringKernel; +typedef const struct SelfScatteringKernelClass * Handle2ConstSelfScatteringKernel; +typedef struct SelfScatteringKernelClass * Handle2SelfScatteringKernel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSelfScatteringKernel +SelfScatteringKernelDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2SelfScatteringKernel +SelfScatteringKernelDefault(); + +// --- Create, general, const +extern_c Handle2ConstSelfScatteringKernel +SelfScatteringKernelCreateConst( + const bool symmetric, + ConstHandle2ConstGridded3d gridded3d, + ConstHandle2ConstSCTApproximation SCTApproximation, + ConstHandle2ConstFreeGasApproximation freeGasApproximation +); + +// +++ Create, general, non-const +extern_c Handle2SelfScatteringKernel +SelfScatteringKernelCreate( + const bool symmetric, + ConstHandle2ConstGridded3d gridded3d, + ConstHandle2ConstSCTApproximation SCTApproximation, + ConstHandle2ConstFreeGasApproximation freeGasApproximation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SelfScatteringKernelAssign(ConstHandle2SelfScatteringKernel self, ConstHandle2ConstSelfScatteringKernel from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SelfScatteringKernelDelete(ConstHandle2ConstSelfScatteringKernel self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SelfScatteringKernelRead(ConstHandle2SelfScatteringKernel self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SelfScatteringKernelWrite(ConstHandle2ConstSelfScatteringKernel self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SelfScatteringKernelPrint(ConstHandle2ConstSelfScatteringKernel self); + +// +++ Print to standard output, as XML +extern_c int +SelfScatteringKernelPrintXML(ConstHandle2ConstSelfScatteringKernel self); + +// +++ Print to standard output, as JSON +extern_c int +SelfScatteringKernelPrintJSON(ConstHandle2ConstSelfScatteringKernel self); + + +// ----------------------------------------------------------------------------- +// Metadatum: symmetric +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SelfScatteringKernelSymmetricHas(ConstHandle2ConstSelfScatteringKernel self); + +// +++ Get +// +++ Returns by value +extern_c bool +SelfScatteringKernelSymmetricGet(ConstHandle2ConstSelfScatteringKernel self); + +// +++ Set +extern_c void +SelfScatteringKernelSymmetricSet(ConstHandle2SelfScatteringKernel self, const bool symmetric); + + +// ----------------------------------------------------------------------------- +// Child: gridded3d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SelfScatteringKernelGridded3dHas(ConstHandle2ConstSelfScatteringKernel self); + +// --- Get, const +extern_c Handle2ConstGridded3d +SelfScatteringKernelGridded3dGetConst(ConstHandle2ConstSelfScatteringKernel self); + +// +++ Get, non-const +extern_c Handle2Gridded3d +SelfScatteringKernelGridded3dGet(ConstHandle2SelfScatteringKernel self); + +// +++ Set +extern_c void +SelfScatteringKernelGridded3dSet(ConstHandle2SelfScatteringKernel self, ConstHandle2ConstGridded3d gridded3d); + + +// ----------------------------------------------------------------------------- +// Child: SCTApproximation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SelfScatteringKernelSCTApproximationHas(ConstHandle2ConstSelfScatteringKernel self); + +// --- Get, const +extern_c Handle2ConstSCTApproximation +SelfScatteringKernelSCTApproximationGetConst(ConstHandle2ConstSelfScatteringKernel self); + +// +++ Get, non-const +extern_c Handle2SCTApproximation +SelfScatteringKernelSCTApproximationGet(ConstHandle2SelfScatteringKernel self); + +// +++ Set +extern_c void +SelfScatteringKernelSCTApproximationSet(ConstHandle2SelfScatteringKernel self, ConstHandle2ConstSCTApproximation SCTApproximation); + + +// ----------------------------------------------------------------------------- +// Child: freeGasApproximation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SelfScatteringKernelFreeGasApproximationHas(ConstHandle2ConstSelfScatteringKernel self); + +// --- Get, const +extern_c Handle2ConstFreeGasApproximation +SelfScatteringKernelFreeGasApproximationGetConst(ConstHandle2ConstSelfScatteringKernel self); + +// +++ Get, non-const +extern_c Handle2FreeGasApproximation +SelfScatteringKernelFreeGasApproximationGet(ConstHandle2SelfScatteringKernel self); + +// +++ Set +extern_c void +SelfScatteringKernelFreeGasApproximationSet(ConstHandle2SelfScatteringKernel self, ConstHandle2ConstFreeGasApproximation freeGasApproximation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/SelfScatteringKernel/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SelfScatteringKernel/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SelfScatteringKernel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SelfScatteringKernel/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SelfScatteringKernel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Shell.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Shell.cpp new file mode 100644 index 000000000..976e1fc11 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Shell.cpp @@ -0,0 +1,251 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Shell.hpp" +#include "Shell.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ShellClass; +using CPP = multigroup::Shell; + +static const std::string CLASSNAME = "Shell"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPUncertainty = general::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstShell +ShellDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Shell +ShellDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstShell +ShellCreateConst( + const char *const label, + const double value, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Shell handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general, non-const +Handle2Shell +ShellCreate( + const char *const label, + const double value, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Shell handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + detail::tocpp(uncertainty) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ShellAssign(ConstHandle2Shell self, ConstHandle2ConstShell from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ShellDelete(ConstHandle2ConstShell self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ShellRead(ConstHandle2Shell self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ShellWrite(ConstHandle2ConstShell self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ShellPrint(ConstHandle2ConstShell self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ShellPrintXML(ConstHandle2ConstShell self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ShellPrintJSON(ConstHandle2ConstShell self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ShellLabelHas(ConstHandle2ConstShell self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ShellLabelGet(ConstHandle2ConstShell self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ShellLabelSet(ConstHandle2Shell self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +ShellValueHas(ConstHandle2ConstShell self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +ShellValueGet(ConstHandle2ConstShell self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +ShellValueSet(ConstHandle2Shell self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +ShellUncertaintyHas(ConstHandle2ConstShell self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +ShellUncertaintyGetConst(ConstHandle2ConstShell self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +ShellUncertaintyGet(ConstHandle2Shell self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +ShellUncertaintySet(ConstHandle2Shell self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Shell/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Shell.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Shell.h new file mode 100644 index 000000000..3d56489f6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Shell.h @@ -0,0 +1,201 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Shell is the basic handle type in this file. Example: +// // Create a default Shell object: +// Shell handle = ShellDefault(); +// Functions involving Shell are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SHELL +#define C_INTERFACE_GNDS_V2_0_GENERAL_SHELL + +#include "GNDStk.h" +#include "v2.0/general/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ShellClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Shell +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ShellClass *Shell; + +// --- Const-aware handles. +typedef const struct ShellClass *const ConstHandle2ConstShell; +typedef struct ShellClass *const ConstHandle2Shell; +typedef const struct ShellClass * Handle2ConstShell; +typedef struct ShellClass * Handle2Shell; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstShell +ShellDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Shell +ShellDefault(); + +// --- Create, general, const +extern_c Handle2ConstShell +ShellCreateConst( + const char *const label, + const double value, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general, non-const +extern_c Handle2Shell +ShellCreate( + const char *const label, + const double value, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ShellAssign(ConstHandle2Shell self, ConstHandle2ConstShell from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ShellDelete(ConstHandle2ConstShell self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ShellRead(ConstHandle2Shell self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ShellWrite(ConstHandle2ConstShell self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ShellPrint(ConstHandle2ConstShell self); + +// +++ Print to standard output, as XML +extern_c int +ShellPrintXML(ConstHandle2ConstShell self); + +// +++ Print to standard output, as JSON +extern_c int +ShellPrintJSON(ConstHandle2ConstShell self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShellLabelHas(ConstHandle2ConstShell self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ShellLabelGet(ConstHandle2ConstShell self); + +// +++ Set +extern_c void +ShellLabelSet(ConstHandle2Shell self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShellValueHas(ConstHandle2ConstShell self); + +// +++ Get +// +++ Returns by value +extern_c double +ShellValueGet(ConstHandle2ConstShell self); + +// +++ Set +extern_c void +ShellValueSet(ConstHandle2Shell self, const double value); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShellUncertaintyHas(ConstHandle2ConstShell self); + +// --- Get, const +extern_c Handle2ConstUncertainty +ShellUncertaintyGetConst(ConstHandle2ConstShell self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +ShellUncertaintyGet(ConstHandle2Shell self); + +// +++ Set +extern_c void +ShellUncertaintySet(ConstHandle2Shell self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Shell/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Shell/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Shell/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Shell/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Shell/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ShortRangeSelfScalingVariance.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ShortRangeSelfScalingVariance.cpp new file mode 100644 index 000000000..9a08feca1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ShortRangeSelfScalingVariance.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ShortRangeSelfScalingVariance.hpp" +#include "ShortRangeSelfScalingVariance.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ShortRangeSelfScalingVarianceClass; +using CPP = multigroup::ShortRangeSelfScalingVariance; + +static const std::string CLASSNAME = "ShortRangeSelfScalingVariance"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto type = [](auto &obj) { return &obj.type; }; + static auto dependenceOnProcessedGroupWidth = [](auto &obj) { return &obj.dependenceOnProcessedGroupWidth; }; + static auto gridded2d = [](auto &obj) { return &obj.gridded2d; }; +} + +using CPPGridded2d = general::Gridded2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceCreateConst( + const char *const label, + const char *const type, + const char *const dependenceOnProcessedGroupWidth, + ConstHandle2ConstGridded2d gridded2d +) { + ConstHandle2ShortRangeSelfScalingVariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + type, + dependenceOnProcessedGroupWidth, + detail::tocpp(gridded2d) + ); + return handle; +} + +// Create, general, non-const +Handle2ShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceCreate( + const char *const label, + const char *const type, + const char *const dependenceOnProcessedGroupWidth, + ConstHandle2ConstGridded2d gridded2d +) { + ConstHandle2ShortRangeSelfScalingVariance handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + type, + dependenceOnProcessedGroupWidth, + detail::tocpp(gridded2d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ShortRangeSelfScalingVarianceAssign(ConstHandle2ShortRangeSelfScalingVariance self, ConstHandle2ConstShortRangeSelfScalingVariance from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ShortRangeSelfScalingVarianceDelete(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ShortRangeSelfScalingVarianceRead(ConstHandle2ShortRangeSelfScalingVariance self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ShortRangeSelfScalingVarianceWrite(ConstHandle2ConstShortRangeSelfScalingVariance self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ShortRangeSelfScalingVariancePrint(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ShortRangeSelfScalingVariancePrintXML(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ShortRangeSelfScalingVariancePrintJSON(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ShortRangeSelfScalingVarianceLabelHas(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ShortRangeSelfScalingVarianceLabelGet(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ShortRangeSelfScalingVarianceLabelSet(ConstHandle2ShortRangeSelfScalingVariance self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// Has +int +ShortRangeSelfScalingVarianceTypeHas(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TypeHas", self, extract::type); +} + +// Get +// Returns by value +const char * +ShortRangeSelfScalingVarianceTypeGet(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TypeGet", self, extract::type); +} + +// Set +void +ShortRangeSelfScalingVarianceTypeSet(ConstHandle2ShortRangeSelfScalingVariance self, const char *const type) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TypeSet", self, extract::type, type); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: dependenceOnProcessedGroupWidth +// ----------------------------------------------------------------------------- + +// Has +int +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthHas(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DependenceOnProcessedGroupWidthHas", self, extract::dependenceOnProcessedGroupWidth); +} + +// Get +// Returns by value +const char * +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthGet(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DependenceOnProcessedGroupWidthGet", self, extract::dependenceOnProcessedGroupWidth); +} + +// Set +void +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthSet(ConstHandle2ShortRangeSelfScalingVariance self, const char *const dependenceOnProcessedGroupWidth) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DependenceOnProcessedGroupWidthSet", self, extract::dependenceOnProcessedGroupWidth, dependenceOnProcessedGroupWidth); +} + + +// ----------------------------------------------------------------------------- +// Child: gridded2d +// ----------------------------------------------------------------------------- + +// Has +int +ShortRangeSelfScalingVarianceGridded2dHas(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Gridded2dHas", self, extract::gridded2d); +} + +// Get, const +Handle2ConstGridded2d +ShortRangeSelfScalingVarianceGridded2dGetConst(ConstHandle2ConstShortRangeSelfScalingVariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded2dGetConst", self, extract::gridded2d); +} + +// Get, non-const +Handle2Gridded2d +ShortRangeSelfScalingVarianceGridded2dGet(ConstHandle2ShortRangeSelfScalingVariance self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Gridded2dGet", self, extract::gridded2d); +} + +// Set +void +ShortRangeSelfScalingVarianceGridded2dSet(ConstHandle2ShortRangeSelfScalingVariance self, ConstHandle2ConstGridded2d gridded2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Gridded2dSet", self, extract::gridded2d, gridded2d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ShortRangeSelfScalingVariance/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ShortRangeSelfScalingVariance.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ShortRangeSelfScalingVariance.h new file mode 100644 index 000000000..06002d891 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ShortRangeSelfScalingVariance.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ShortRangeSelfScalingVariance is the basic handle type in this file. Example: +// // Create a default ShortRangeSelfScalingVariance object: +// ShortRangeSelfScalingVariance handle = ShortRangeSelfScalingVarianceDefault(); +// Functions involving ShortRangeSelfScalingVariance are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SHORTRANGESELFSCALINGVARIANCE +#define C_INTERFACE_GNDS_V2_0_GENERAL_SHORTRANGESELFSCALINGVARIANCE + +#include "GNDStk.h" +#include "v2.0/general/Gridded2d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ShortRangeSelfScalingVarianceClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ShortRangeSelfScalingVariance +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ShortRangeSelfScalingVarianceClass *ShortRangeSelfScalingVariance; + +// --- Const-aware handles. +typedef const struct ShortRangeSelfScalingVarianceClass *const ConstHandle2ConstShortRangeSelfScalingVariance; +typedef struct ShortRangeSelfScalingVarianceClass *const ConstHandle2ShortRangeSelfScalingVariance; +typedef const struct ShortRangeSelfScalingVarianceClass * Handle2ConstShortRangeSelfScalingVariance; +typedef struct ShortRangeSelfScalingVarianceClass * Handle2ShortRangeSelfScalingVariance; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceDefault(); + +// --- Create, general, const +extern_c Handle2ConstShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceCreateConst( + const char *const label, + const char *const type, + const char *const dependenceOnProcessedGroupWidth, + ConstHandle2ConstGridded2d gridded2d +); + +// +++ Create, general, non-const +extern_c Handle2ShortRangeSelfScalingVariance +ShortRangeSelfScalingVarianceCreate( + const char *const label, + const char *const type, + const char *const dependenceOnProcessedGroupWidth, + ConstHandle2ConstGridded2d gridded2d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ShortRangeSelfScalingVarianceAssign(ConstHandle2ShortRangeSelfScalingVariance self, ConstHandle2ConstShortRangeSelfScalingVariance from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ShortRangeSelfScalingVarianceDelete(ConstHandle2ConstShortRangeSelfScalingVariance self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ShortRangeSelfScalingVarianceRead(ConstHandle2ShortRangeSelfScalingVariance self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ShortRangeSelfScalingVarianceWrite(ConstHandle2ConstShortRangeSelfScalingVariance self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ShortRangeSelfScalingVariancePrint(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Print to standard output, as XML +extern_c int +ShortRangeSelfScalingVariancePrintXML(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Print to standard output, as JSON +extern_c int +ShortRangeSelfScalingVariancePrintJSON(ConstHandle2ConstShortRangeSelfScalingVariance self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShortRangeSelfScalingVarianceLabelHas(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ShortRangeSelfScalingVarianceLabelGet(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Set +extern_c void +ShortRangeSelfScalingVarianceLabelSet(ConstHandle2ShortRangeSelfScalingVariance self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: type +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShortRangeSelfScalingVarianceTypeHas(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ShortRangeSelfScalingVarianceTypeGet(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Set +extern_c void +ShortRangeSelfScalingVarianceTypeSet(ConstHandle2ShortRangeSelfScalingVariance self, const char *const type); + + +// ----------------------------------------------------------------------------- +// Metadatum: dependenceOnProcessedGroupWidth +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthHas(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthGet(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Set +extern_c void +ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthSet(ConstHandle2ShortRangeSelfScalingVariance self, const char *const dependenceOnProcessedGroupWidth); + + +// ----------------------------------------------------------------------------- +// Child: gridded2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ShortRangeSelfScalingVarianceGridded2dHas(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// --- Get, const +extern_c Handle2ConstGridded2d +ShortRangeSelfScalingVarianceGridded2dGetConst(ConstHandle2ConstShortRangeSelfScalingVariance self); + +// +++ Get, non-const +extern_c Handle2Gridded2d +ShortRangeSelfScalingVarianceGridded2dGet(ConstHandle2ShortRangeSelfScalingVariance self); + +// +++ Set +extern_c void +ShortRangeSelfScalingVarianceGridded2dSet(ConstHandle2ShortRangeSelfScalingVariance self, ConstHandle2ConstGridded2d gridded2d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ShortRangeSelfScalingVariance/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ShortRangeSelfScalingVariance/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ShortRangeSelfScalingVariance/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ShortRangeSelfScalingVariance/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ShortRangeSelfScalingVariance/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SimpleMaxwellianFission.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SimpleMaxwellianFission.cpp new file mode 100644 index 000000000..2b54dd209 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SimpleMaxwellianFission.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/SimpleMaxwellianFission.hpp" +#include "SimpleMaxwellianFission.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SimpleMaxwellianFissionClass; +using CPP = multigroup::SimpleMaxwellianFission; + +static const std::string CLASSNAME = "SimpleMaxwellianFission"; + +namespace extract { + static auto U = [](auto &obj) { return &obj.U; }; + static auto theta = [](auto &obj) { return &obj.theta; }; +} + +using CPPU = general::U; +using CPPTheta = general::Theta; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSimpleMaxwellianFission +SimpleMaxwellianFissionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2SimpleMaxwellianFission +SimpleMaxwellianFissionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSimpleMaxwellianFission +SimpleMaxwellianFissionCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +) { + ConstHandle2SimpleMaxwellianFission handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(U), + detail::tocpp(theta) + ); + return handle; +} + +// Create, general, non-const +Handle2SimpleMaxwellianFission +SimpleMaxwellianFissionCreate( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +) { + ConstHandle2SimpleMaxwellianFission handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(U), + detail::tocpp(theta) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SimpleMaxwellianFissionAssign(ConstHandle2SimpleMaxwellianFission self, ConstHandle2ConstSimpleMaxwellianFission from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SimpleMaxwellianFissionDelete(ConstHandle2ConstSimpleMaxwellianFission self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SimpleMaxwellianFissionRead(ConstHandle2SimpleMaxwellianFission self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SimpleMaxwellianFissionWrite(ConstHandle2ConstSimpleMaxwellianFission self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SimpleMaxwellianFissionPrint(ConstHandle2ConstSimpleMaxwellianFission self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SimpleMaxwellianFissionPrintXML(ConstHandle2ConstSimpleMaxwellianFission self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SimpleMaxwellianFissionPrintJSON(ConstHandle2ConstSimpleMaxwellianFission self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: U +// ----------------------------------------------------------------------------- + +// Has +int +SimpleMaxwellianFissionUHas(ConstHandle2ConstSimpleMaxwellianFission self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UHas", self, extract::U); +} + +// Get, const +Handle2ConstU +SimpleMaxwellianFissionUGetConst(ConstHandle2ConstSimpleMaxwellianFission self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UGetConst", self, extract::U); +} + +// Get, non-const +Handle2U +SimpleMaxwellianFissionUGet(ConstHandle2SimpleMaxwellianFission self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UGet", self, extract::U); +} + +// Set +void +SimpleMaxwellianFissionUSet(ConstHandle2SimpleMaxwellianFission self, ConstHandle2ConstU U) +{ + detail::setField + (CLASSNAME, CLASSNAME+"USet", self, extract::U, U); +} + + +// ----------------------------------------------------------------------------- +// Child: theta +// ----------------------------------------------------------------------------- + +// Has +int +SimpleMaxwellianFissionThetaHas(ConstHandle2ConstSimpleMaxwellianFission self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ThetaHas", self, extract::theta); +} + +// Get, const +Handle2ConstTheta +SimpleMaxwellianFissionThetaGetConst(ConstHandle2ConstSimpleMaxwellianFission self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThetaGetConst", self, extract::theta); +} + +// Get, non-const +Handle2Theta +SimpleMaxwellianFissionThetaGet(ConstHandle2SimpleMaxwellianFission self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThetaGet", self, extract::theta); +} + +// Set +void +SimpleMaxwellianFissionThetaSet(ConstHandle2SimpleMaxwellianFission self, ConstHandle2ConstTheta theta) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ThetaSet", self, extract::theta, theta); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/SimpleMaxwellianFission/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SimpleMaxwellianFission.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SimpleMaxwellianFission.h new file mode 100644 index 000000000..5bdde8b69 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SimpleMaxwellianFission.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// SimpleMaxwellianFission is the basic handle type in this file. Example: +// // Create a default SimpleMaxwellianFission object: +// SimpleMaxwellianFission handle = SimpleMaxwellianFissionDefault(); +// Functions involving SimpleMaxwellianFission are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SIMPLEMAXWELLIANFISSION +#define C_INTERFACE_GNDS_V2_0_GENERAL_SIMPLEMAXWELLIANFISSION + +#include "GNDStk.h" +#include "v2.0/general/U.h" +#include "v2.0/general/Theta.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SimpleMaxwellianFissionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ SimpleMaxwellianFission +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SimpleMaxwellianFissionClass *SimpleMaxwellianFission; + +// --- Const-aware handles. +typedef const struct SimpleMaxwellianFissionClass *const ConstHandle2ConstSimpleMaxwellianFission; +typedef struct SimpleMaxwellianFissionClass *const ConstHandle2SimpleMaxwellianFission; +typedef const struct SimpleMaxwellianFissionClass * Handle2ConstSimpleMaxwellianFission; +typedef struct SimpleMaxwellianFissionClass * Handle2SimpleMaxwellianFission; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSimpleMaxwellianFission +SimpleMaxwellianFissionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2SimpleMaxwellianFission +SimpleMaxwellianFissionDefault(); + +// --- Create, general, const +extern_c Handle2ConstSimpleMaxwellianFission +SimpleMaxwellianFissionCreateConst( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +); + +// +++ Create, general, non-const +extern_c Handle2SimpleMaxwellianFission +SimpleMaxwellianFissionCreate( + ConstHandle2ConstU U, + ConstHandle2ConstTheta theta +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SimpleMaxwellianFissionAssign(ConstHandle2SimpleMaxwellianFission self, ConstHandle2ConstSimpleMaxwellianFission from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SimpleMaxwellianFissionDelete(ConstHandle2ConstSimpleMaxwellianFission self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SimpleMaxwellianFissionRead(ConstHandle2SimpleMaxwellianFission self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SimpleMaxwellianFissionWrite(ConstHandle2ConstSimpleMaxwellianFission self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SimpleMaxwellianFissionPrint(ConstHandle2ConstSimpleMaxwellianFission self); + +// +++ Print to standard output, as XML +extern_c int +SimpleMaxwellianFissionPrintXML(ConstHandle2ConstSimpleMaxwellianFission self); + +// +++ Print to standard output, as JSON +extern_c int +SimpleMaxwellianFissionPrintJSON(ConstHandle2ConstSimpleMaxwellianFission self); + + +// ----------------------------------------------------------------------------- +// Child: U +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SimpleMaxwellianFissionUHas(ConstHandle2ConstSimpleMaxwellianFission self); + +// --- Get, const +extern_c Handle2ConstU +SimpleMaxwellianFissionUGetConst(ConstHandle2ConstSimpleMaxwellianFission self); + +// +++ Get, non-const +extern_c Handle2U +SimpleMaxwellianFissionUGet(ConstHandle2SimpleMaxwellianFission self); + +// +++ Set +extern_c void +SimpleMaxwellianFissionUSet(ConstHandle2SimpleMaxwellianFission self, ConstHandle2ConstU U); + + +// ----------------------------------------------------------------------------- +// Child: theta +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SimpleMaxwellianFissionThetaHas(ConstHandle2ConstSimpleMaxwellianFission self); + +// --- Get, const +extern_c Handle2ConstTheta +SimpleMaxwellianFissionThetaGetConst(ConstHandle2ConstSimpleMaxwellianFission self); + +// +++ Get, non-const +extern_c Handle2Theta +SimpleMaxwellianFissionThetaGet(ConstHandle2SimpleMaxwellianFission self); + +// +++ Set +extern_c void +SimpleMaxwellianFissionThetaSet(ConstHandle2SimpleMaxwellianFission self, ConstHandle2ConstTheta theta); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/SimpleMaxwellianFission/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SimpleMaxwellianFission/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SimpleMaxwellianFission/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SimpleMaxwellianFission/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SimpleMaxwellianFission/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slice.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slice.cpp new file mode 100644 index 000000000..456423c3f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slice.cpp @@ -0,0 +1,312 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Slice.hpp" +#include "Slice.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SliceClass; +using CPP = multigroup::Slice; + +static const std::string CLASSNAME = "Slice"; + +namespace extract { + static auto dimension = [](auto &obj) { return &obj.dimension; }; + static auto domainValue = [](auto &obj) { return &obj.domainValue; }; + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto domainUnit = [](auto &obj) { return &obj.domainUnit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSlice +SliceDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Slice +SliceDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSlice +SliceCreateConst( + const int dimension, + const int domainValue, + const double domainMin, + const double domainMax, + const char *const domainUnit +) { + ConstHandle2Slice handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + dimension, + domainValue, + domainMin, + domainMax, + domainUnit + ); + return handle; +} + +// Create, general, non-const +Handle2Slice +SliceCreate( + const int dimension, + const int domainValue, + const double domainMin, + const double domainMax, + const char *const domainUnit +) { + ConstHandle2Slice handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + dimension, + domainValue, + domainMin, + domainMax, + domainUnit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SliceAssign(ConstHandle2Slice self, ConstHandle2ConstSlice from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SliceDelete(ConstHandle2ConstSlice self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SliceRead(ConstHandle2Slice self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SliceWrite(ConstHandle2ConstSlice self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SlicePrint(ConstHandle2ConstSlice self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SlicePrintXML(ConstHandle2ConstSlice self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SlicePrintJSON(ConstHandle2ConstSlice self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: dimension +// ----------------------------------------------------------------------------- + +// Has +int +SliceDimensionHas(ConstHandle2ConstSlice self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DimensionHas", self, extract::dimension); +} + +// Get +// Returns by value +int +SliceDimensionGet(ConstHandle2ConstSlice self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DimensionGet", self, extract::dimension); +} + +// Set +void +SliceDimensionSet(ConstHandle2Slice self, const int dimension) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DimensionSet", self, extract::dimension, dimension); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainValue +// ----------------------------------------------------------------------------- + +// Has +int +SliceDomainValueHas(ConstHandle2ConstSlice self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainValueHas", self, extract::domainValue); +} + +// Get +// Returns by value +int +SliceDomainValueGet(ConstHandle2ConstSlice self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainValueGet", self, extract::domainValue); +} + +// Set +void +SliceDomainValueSet(ConstHandle2Slice self, const int domainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainValueSet", self, extract::domainValue, domainValue); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +SliceDomainMinHas(ConstHandle2ConstSlice self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +double +SliceDomainMinGet(ConstHandle2ConstSlice self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +SliceDomainMinSet(ConstHandle2Slice self, const double domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +SliceDomainMaxHas(ConstHandle2ConstSlice self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +double +SliceDomainMaxGet(ConstHandle2ConstSlice self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +SliceDomainMaxSet(ConstHandle2Slice self, const double domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// Has +int +SliceDomainUnitHas(ConstHandle2ConstSlice self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainUnitHas", self, extract::domainUnit); +} + +// Get +// Returns by value +const char * +SliceDomainUnitGet(ConstHandle2ConstSlice self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainUnitGet", self, extract::domainUnit); +} + +// Set +void +SliceDomainUnitSet(ConstHandle2Slice self, const char *const domainUnit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainUnitSet", self, extract::domainUnit, domainUnit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Slice/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slice.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slice.h new file mode 100644 index 000000000..728b881b3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slice.h @@ -0,0 +1,237 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Slice is the basic handle type in this file. Example: +// // Create a default Slice object: +// Slice handle = SliceDefault(); +// Functions involving Slice are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SLICE +#define C_INTERFACE_GNDS_V2_0_GENERAL_SLICE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SliceClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Slice +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SliceClass *Slice; + +// --- Const-aware handles. +typedef const struct SliceClass *const ConstHandle2ConstSlice; +typedef struct SliceClass *const ConstHandle2Slice; +typedef const struct SliceClass * Handle2ConstSlice; +typedef struct SliceClass * Handle2Slice; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSlice +SliceDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Slice +SliceDefault(); + +// --- Create, general, const +extern_c Handle2ConstSlice +SliceCreateConst( + const int dimension, + const int domainValue, + const double domainMin, + const double domainMax, + const char *const domainUnit +); + +// +++ Create, general, non-const +extern_c Handle2Slice +SliceCreate( + const int dimension, + const int domainValue, + const double domainMin, + const double domainMax, + const char *const domainUnit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SliceAssign(ConstHandle2Slice self, ConstHandle2ConstSlice from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SliceDelete(ConstHandle2ConstSlice self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SliceRead(ConstHandle2Slice self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SliceWrite(ConstHandle2ConstSlice self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SlicePrint(ConstHandle2ConstSlice self); + +// +++ Print to standard output, as XML +extern_c int +SlicePrintXML(ConstHandle2ConstSlice self); + +// +++ Print to standard output, as JSON +extern_c int +SlicePrintJSON(ConstHandle2ConstSlice self); + + +// ----------------------------------------------------------------------------- +// Metadatum: dimension +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SliceDimensionHas(ConstHandle2ConstSlice self); + +// +++ Get +// +++ Returns by value +extern_c int +SliceDimensionGet(ConstHandle2ConstSlice self); + +// +++ Set +extern_c void +SliceDimensionSet(ConstHandle2Slice self, const int dimension); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SliceDomainValueHas(ConstHandle2ConstSlice self); + +// +++ Get +// +++ Returns by value +extern_c int +SliceDomainValueGet(ConstHandle2ConstSlice self); + +// +++ Set +extern_c void +SliceDomainValueSet(ConstHandle2Slice self, const int domainValue); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SliceDomainMinHas(ConstHandle2ConstSlice self); + +// +++ Get +// +++ Returns by value +extern_c double +SliceDomainMinGet(ConstHandle2ConstSlice self); + +// +++ Set +extern_c void +SliceDomainMinSet(ConstHandle2Slice self, const double domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SliceDomainMaxHas(ConstHandle2ConstSlice self); + +// +++ Get +// +++ Returns by value +extern_c double +SliceDomainMaxGet(ConstHandle2ConstSlice self); + +// +++ Set +extern_c void +SliceDomainMaxSet(ConstHandle2Slice self, const double domainMax); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SliceDomainUnitHas(ConstHandle2ConstSlice self); + +// +++ Get +// +++ Returns by value +extern_c const char * +SliceDomainUnitGet(ConstHandle2ConstSlice self); + +// +++ Set +extern_c void +SliceDomainUnitSet(ConstHandle2Slice self, const char *const domainUnit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Slice/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slice/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slice/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slice/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slice/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slices.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slices.cpp new file mode 100644 index 000000000..15542e5fa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slices.cpp @@ -0,0 +1,457 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Slices.hpp" +#include "Slices.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SlicesClass; +using CPP = multigroup::Slices; + +static const std::string CLASSNAME = "Slices"; + +namespace extract { + static auto slice = [](auto &obj) { return &obj.slice; }; +} + +using CPPSlice = general::Slice; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSlices +SlicesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Slices +SlicesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSlices +SlicesCreateConst( + ConstHandle2Slice *const slice, const size_t sliceSize +) { + ConstHandle2Slices handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t SliceN = 0; SliceN < sliceSize; ++SliceN) + SlicesSliceAdd(handle, slice[SliceN]); + return handle; +} + +// Create, general, non-const +Handle2Slices +SlicesCreate( + ConstHandle2Slice *const slice, const size_t sliceSize +) { + ConstHandle2Slices handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t SliceN = 0; SliceN < sliceSize; ++SliceN) + SlicesSliceAdd(handle, slice[SliceN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SlicesAssign(ConstHandle2Slices self, ConstHandle2ConstSlices from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SlicesDelete(ConstHandle2ConstSlices self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SlicesRead(ConstHandle2Slices self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SlicesWrite(ConstHandle2ConstSlices self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SlicesPrint(ConstHandle2ConstSlices self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SlicesPrintXML(ConstHandle2ConstSlices self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SlicesPrintJSON(ConstHandle2ConstSlices self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: slice +// ----------------------------------------------------------------------------- + +// Has +int +SlicesSliceHas(ConstHandle2ConstSlices self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SliceHas", self, extract::slice); +} + +// Clear +void +SlicesSliceClear(ConstHandle2Slices self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"SliceClear", self, extract::slice); +} + +// Size +size_t +SlicesSliceSize(ConstHandle2ConstSlices self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"SliceSize", self, extract::slice); +} + +// Add +void +SlicesSliceAdd(ConstHandle2Slices self, ConstHandle2ConstSlice slice) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"SliceAdd", self, extract::slice, slice); +} + +// Get, by index \in [0,size), const +Handle2ConstSlice +SlicesSliceGetConst(ConstHandle2ConstSlices self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SliceGetConst", self, extract::slice, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Slice +SlicesSliceGet(ConstHandle2Slices self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SliceGet", self, extract::slice, index_); +} + +// Set, by index \in [0,size) +void +SlicesSliceSet( + ConstHandle2Slices self, + const size_t index_, + ConstHandle2ConstSlice slice +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"SliceSet", self, extract::slice, index_, slice); +} + +// ------------------------ +// Re: metadatum dimension +// ------------------------ + +// Has, by dimension +int +SlicesSliceHasByDimension( + ConstHandle2ConstSlices self, + const int dimension +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SliceHasByDimension", + self, extract::slice, meta::dimension, dimension); +} + +// Get, by dimension, const +Handle2ConstSlice +SlicesSliceGetByDimensionConst( + ConstHandle2ConstSlices self, + const int dimension +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDimensionConst", + self, extract::slice, meta::dimension, dimension); +} + +// Get, by dimension, non-const +Handle2Slice +SlicesSliceGetByDimension( + ConstHandle2Slices self, + const int dimension +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDimension", + self, extract::slice, meta::dimension, dimension); +} + +// Set, by dimension +void +SlicesSliceSetByDimension( + ConstHandle2Slices self, + const int dimension, + ConstHandle2ConstSlice slice +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SliceSetByDimension", + self, extract::slice, meta::dimension, dimension, slice); +} + +// ------------------------ +// Re: metadatum domainValue +// ------------------------ + +// Has, by domainValue +int +SlicesSliceHasByDomainValue( + ConstHandle2ConstSlices self, + const int domainValue +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SliceHasByDomainValue", + self, extract::slice, meta::domainValue, domainValue); +} + +// Get, by domainValue, const +Handle2ConstSlice +SlicesSliceGetByDomainValueConst( + ConstHandle2ConstSlices self, + const int domainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainValueConst", + self, extract::slice, meta::domainValue, domainValue); +} + +// Get, by domainValue, non-const +Handle2Slice +SlicesSliceGetByDomainValue( + ConstHandle2Slices self, + const int domainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainValue", + self, extract::slice, meta::domainValue, domainValue); +} + +// Set, by domainValue +void +SlicesSliceSetByDomainValue( + ConstHandle2Slices self, + const int domainValue, + ConstHandle2ConstSlice slice +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SliceSetByDomainValue", + self, extract::slice, meta::domainValue, domainValue, slice); +} + +// ------------------------ +// Re: metadatum domainMin +// ------------------------ + +// Has, by domainMin +int +SlicesSliceHasByDomainMin( + ConstHandle2ConstSlices self, + const double domainMin +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SliceHasByDomainMin", + self, extract::slice, meta::domainMin, domainMin); +} + +// Get, by domainMin, const +Handle2ConstSlice +SlicesSliceGetByDomainMinConst( + ConstHandle2ConstSlices self, + const double domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainMinConst", + self, extract::slice, meta::domainMin, domainMin); +} + +// Get, by domainMin, non-const +Handle2Slice +SlicesSliceGetByDomainMin( + ConstHandle2Slices self, + const double domainMin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainMin", + self, extract::slice, meta::domainMin, domainMin); +} + +// Set, by domainMin +void +SlicesSliceSetByDomainMin( + ConstHandle2Slices self, + const double domainMin, + ConstHandle2ConstSlice slice +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SliceSetByDomainMin", + self, extract::slice, meta::domainMin, domainMin, slice); +} + +// ------------------------ +// Re: metadatum domainMax +// ------------------------ + +// Has, by domainMax +int +SlicesSliceHasByDomainMax( + ConstHandle2ConstSlices self, + const double domainMax +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SliceHasByDomainMax", + self, extract::slice, meta::domainMax, domainMax); +} + +// Get, by domainMax, const +Handle2ConstSlice +SlicesSliceGetByDomainMaxConst( + ConstHandle2ConstSlices self, + const double domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainMaxConst", + self, extract::slice, meta::domainMax, domainMax); +} + +// Get, by domainMax, non-const +Handle2Slice +SlicesSliceGetByDomainMax( + ConstHandle2Slices self, + const double domainMax +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainMax", + self, extract::slice, meta::domainMax, domainMax); +} + +// Set, by domainMax +void +SlicesSliceSetByDomainMax( + ConstHandle2Slices self, + const double domainMax, + ConstHandle2ConstSlice slice +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SliceSetByDomainMax", + self, extract::slice, meta::domainMax, domainMax, slice); +} + +// ------------------------ +// Re: metadatum domainUnit +// ------------------------ + +// Has, by domainUnit +int +SlicesSliceHasByDomainUnit( + ConstHandle2ConstSlices self, + const char *const domainUnit +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SliceHasByDomainUnit", + self, extract::slice, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, const +Handle2ConstSlice +SlicesSliceGetByDomainUnitConst( + ConstHandle2ConstSlices self, + const char *const domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainUnitConst", + self, extract::slice, meta::domainUnit, domainUnit); +} + +// Get, by domainUnit, non-const +Handle2Slice +SlicesSliceGetByDomainUnit( + ConstHandle2Slices self, + const char *const domainUnit +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SliceGetByDomainUnit", + self, extract::slice, meta::domainUnit, domainUnit); +} + +// Set, by domainUnit +void +SlicesSliceSetByDomainUnit( + ConstHandle2Slices self, + const char *const domainUnit, + ConstHandle2ConstSlice slice +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SliceSetByDomainUnit", + self, extract::slice, meta::domainUnit, domainUnit, slice); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Slices/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slices.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slices.h new file mode 100644 index 000000000..49f936e71 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slices.h @@ -0,0 +1,342 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Slices is the basic handle type in this file. Example: +// // Create a default Slices object: +// Slices handle = SlicesDefault(); +// Functions involving Slices are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SLICES +#define C_INTERFACE_GNDS_V2_0_GENERAL_SLICES + +#include "GNDStk.h" +#include "v2.0/general/Slice.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SlicesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Slices +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SlicesClass *Slices; + +// --- Const-aware handles. +typedef const struct SlicesClass *const ConstHandle2ConstSlices; +typedef struct SlicesClass *const ConstHandle2Slices; +typedef const struct SlicesClass * Handle2ConstSlices; +typedef struct SlicesClass * Handle2Slices; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSlices +SlicesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Slices +SlicesDefault(); + +// --- Create, general, const +extern_c Handle2ConstSlices +SlicesCreateConst( + ConstHandle2Slice *const slice, const size_t sliceSize +); + +// +++ Create, general, non-const +extern_c Handle2Slices +SlicesCreate( + ConstHandle2Slice *const slice, const size_t sliceSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SlicesAssign(ConstHandle2Slices self, ConstHandle2ConstSlices from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SlicesDelete(ConstHandle2ConstSlices self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SlicesRead(ConstHandle2Slices self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SlicesWrite(ConstHandle2ConstSlices self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SlicesPrint(ConstHandle2ConstSlices self); + +// +++ Print to standard output, as XML +extern_c int +SlicesPrintXML(ConstHandle2ConstSlices self); + +// +++ Print to standard output, as JSON +extern_c int +SlicesPrintJSON(ConstHandle2ConstSlices self); + + +// ----------------------------------------------------------------------------- +// Child: slice +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SlicesSliceHas(ConstHandle2ConstSlices self); + +// +++ Clear +extern_c void +SlicesSliceClear(ConstHandle2Slices self); + +// +++ Size +extern_c size_t +SlicesSliceSize(ConstHandle2ConstSlices self); + +// +++ Add +extern_c void +SlicesSliceAdd(ConstHandle2Slices self, ConstHandle2ConstSlice slice); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstSlice +SlicesSliceGetConst(ConstHandle2ConstSlices self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Slice +SlicesSliceGet(ConstHandle2Slices self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +SlicesSliceSet( + ConstHandle2Slices self, + const size_t index_, + ConstHandle2ConstSlice slice +); + +// ------------------------ +// Re: metadatum dimension +// ------------------------ + +// +++ Has, by dimension +extern_c int +SlicesSliceHasByDimension( + ConstHandle2ConstSlices self, + const int dimension +); + +// --- Get, by dimension, const +extern_c Handle2ConstSlice +SlicesSliceGetByDimensionConst( + ConstHandle2ConstSlices self, + const int dimension +); + +// +++ Get, by dimension, non-const +extern_c Handle2Slice +SlicesSliceGetByDimension( + ConstHandle2Slices self, + const int dimension +); + +// +++ Set, by dimension +extern_c void +SlicesSliceSetByDimension( + ConstHandle2Slices self, + const int dimension, + ConstHandle2ConstSlice slice +); + +// ------------------------ +// Re: metadatum domainValue +// ------------------------ + +// +++ Has, by domainValue +extern_c int +SlicesSliceHasByDomainValue( + ConstHandle2ConstSlices self, + const int domainValue +); + +// --- Get, by domainValue, const +extern_c Handle2ConstSlice +SlicesSliceGetByDomainValueConst( + ConstHandle2ConstSlices self, + const int domainValue +); + +// +++ Get, by domainValue, non-const +extern_c Handle2Slice +SlicesSliceGetByDomainValue( + ConstHandle2Slices self, + const int domainValue +); + +// +++ Set, by domainValue +extern_c void +SlicesSliceSetByDomainValue( + ConstHandle2Slices self, + const int domainValue, + ConstHandle2ConstSlice slice +); + +// ------------------------ +// Re: metadatum domainMin +// ------------------------ + +// +++ Has, by domainMin +extern_c int +SlicesSliceHasByDomainMin( + ConstHandle2ConstSlices self, + const double domainMin +); + +// --- Get, by domainMin, const +extern_c Handle2ConstSlice +SlicesSliceGetByDomainMinConst( + ConstHandle2ConstSlices self, + const double domainMin +); + +// +++ Get, by domainMin, non-const +extern_c Handle2Slice +SlicesSliceGetByDomainMin( + ConstHandle2Slices self, + const double domainMin +); + +// +++ Set, by domainMin +extern_c void +SlicesSliceSetByDomainMin( + ConstHandle2Slices self, + const double domainMin, + ConstHandle2ConstSlice slice +); + +// ------------------------ +// Re: metadatum domainMax +// ------------------------ + +// +++ Has, by domainMax +extern_c int +SlicesSliceHasByDomainMax( + ConstHandle2ConstSlices self, + const double domainMax +); + +// --- Get, by domainMax, const +extern_c Handle2ConstSlice +SlicesSliceGetByDomainMaxConst( + ConstHandle2ConstSlices self, + const double domainMax +); + +// +++ Get, by domainMax, non-const +extern_c Handle2Slice +SlicesSliceGetByDomainMax( + ConstHandle2Slices self, + const double domainMax +); + +// +++ Set, by domainMax +extern_c void +SlicesSliceSetByDomainMax( + ConstHandle2Slices self, + const double domainMax, + ConstHandle2ConstSlice slice +); + +// ------------------------ +// Re: metadatum domainUnit +// ------------------------ + +// +++ Has, by domainUnit +extern_c int +SlicesSliceHasByDomainUnit( + ConstHandle2ConstSlices self, + const char *const domainUnit +); + +// --- Get, by domainUnit, const +extern_c Handle2ConstSlice +SlicesSliceGetByDomainUnitConst( + ConstHandle2ConstSlices self, + const char *const domainUnit +); + +// +++ Get, by domainUnit, non-const +extern_c Handle2Slice +SlicesSliceGetByDomainUnit( + ConstHandle2Slices self, + const char *const domainUnit +); + +// +++ Set, by domainUnit +extern_c void +SlicesSliceSetByDomainUnit( + ConstHandle2Slices self, + const char *const domainUnit, + ConstHandle2ConstSlice slice +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Slices/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slices/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slices/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slices/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Slices/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectra.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectra.cpp new file mode 100644 index 000000000..d26b8c4fe --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectra.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Spectra.hpp" +#include "Spectra.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SpectraClass; +using CPP = multigroup::Spectra; + +static const std::string CLASSNAME = "Spectra"; + +namespace extract { + static auto spectrum = [](auto &obj) { return &obj.spectrum; }; +} + +using CPPSpectrum = general::Spectrum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSpectra +SpectraDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Spectra +SpectraDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSpectra +SpectraCreateConst( + ConstHandle2Spectrum *const spectrum, const size_t spectrumSize +) { + ConstHandle2Spectra handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t SpectrumN = 0; SpectrumN < spectrumSize; ++SpectrumN) + SpectraSpectrumAdd(handle, spectrum[SpectrumN]); + return handle; +} + +// Create, general, non-const +Handle2Spectra +SpectraCreate( + ConstHandle2Spectrum *const spectrum, const size_t spectrumSize +) { + ConstHandle2Spectra handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t SpectrumN = 0; SpectrumN < spectrumSize; ++SpectrumN) + SpectraSpectrumAdd(handle, spectrum[SpectrumN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SpectraAssign(ConstHandle2Spectra self, ConstHandle2ConstSpectra from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SpectraDelete(ConstHandle2ConstSpectra self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SpectraRead(ConstHandle2Spectra self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SpectraWrite(ConstHandle2ConstSpectra self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SpectraPrint(ConstHandle2ConstSpectra self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SpectraPrintXML(ConstHandle2ConstSpectra self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SpectraPrintJSON(ConstHandle2ConstSpectra self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: spectrum +// ----------------------------------------------------------------------------- + +// Has +int +SpectraSpectrumHas(ConstHandle2ConstSpectra self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SpectrumHas", self, extract::spectrum); +} + +// Clear +void +SpectraSpectrumClear(ConstHandle2Spectra self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"SpectrumClear", self, extract::spectrum); +} + +// Size +size_t +SpectraSpectrumSize(ConstHandle2ConstSpectra self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"SpectrumSize", self, extract::spectrum); +} + +// Add +void +SpectraSpectrumAdd(ConstHandle2Spectra self, ConstHandle2ConstSpectrum spectrum) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"SpectrumAdd", self, extract::spectrum, spectrum); +} + +// Get, by index \in [0,size), const +Handle2ConstSpectrum +SpectraSpectrumGetConst(ConstHandle2ConstSpectra self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SpectrumGetConst", self, extract::spectrum, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Spectrum +SpectraSpectrumGet(ConstHandle2Spectra self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SpectrumGet", self, extract::spectrum, index_); +} + +// Set, by index \in [0,size) +void +SpectraSpectrumSet( + ConstHandle2Spectra self, + const size_t index_, + ConstHandle2ConstSpectrum spectrum +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"SpectrumSet", self, extract::spectrum, index_, spectrum); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +SpectraSpectrumHasByLabel( + ConstHandle2ConstSpectra self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumHasByLabel", + self, extract::spectrum, meta::label, label); +} + +// Get, by label, const +Handle2ConstSpectrum +SpectraSpectrumGetByLabelConst( + ConstHandle2ConstSpectra self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumGetByLabelConst", + self, extract::spectrum, meta::label, label); +} + +// Get, by label, non-const +Handle2Spectrum +SpectraSpectrumGetByLabel( + ConstHandle2Spectra self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumGetByLabel", + self, extract::spectrum, meta::label, label); +} + +// Set, by label +void +SpectraSpectrumSetByLabel( + ConstHandle2Spectra self, + const char *const label, + ConstHandle2ConstSpectrum spectrum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumSetByLabel", + self, extract::spectrum, meta::label, label, spectrum); +} + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// Has, by pid +int +SpectraSpectrumHasByPid( + ConstHandle2ConstSpectra self, + const char *const pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumHasByPid", + self, extract::spectrum, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstSpectrum +SpectraSpectrumGetByPidConst( + ConstHandle2ConstSpectra self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumGetByPidConst", + self, extract::spectrum, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2Spectrum +SpectraSpectrumGetByPid( + ConstHandle2Spectra self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumGetByPid", + self, extract::spectrum, meta::pid, pid); +} + +// Set, by pid +void +SpectraSpectrumSetByPid( + ConstHandle2Spectra self, + const char *const pid, + ConstHandle2ConstSpectrum spectrum +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SpectrumSetByPid", + self, extract::spectrum, meta::pid, pid, spectrum); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Spectra/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectra.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectra.h new file mode 100644 index 000000000..32b4dbfe2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectra.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Spectra is the basic handle type in this file. Example: +// // Create a default Spectra object: +// Spectra handle = SpectraDefault(); +// Functions involving Spectra are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SPECTRA +#define C_INTERFACE_GNDS_V2_0_GENERAL_SPECTRA + +#include "GNDStk.h" +#include "v2.0/general/Spectrum.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SpectraClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Spectra +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SpectraClass *Spectra; + +// --- Const-aware handles. +typedef const struct SpectraClass *const ConstHandle2ConstSpectra; +typedef struct SpectraClass *const ConstHandle2Spectra; +typedef const struct SpectraClass * Handle2ConstSpectra; +typedef struct SpectraClass * Handle2Spectra; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSpectra +SpectraDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Spectra +SpectraDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpectra +SpectraCreateConst( + ConstHandle2Spectrum *const spectrum, const size_t spectrumSize +); + +// +++ Create, general, non-const +extern_c Handle2Spectra +SpectraCreate( + ConstHandle2Spectrum *const spectrum, const size_t spectrumSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SpectraAssign(ConstHandle2Spectra self, ConstHandle2ConstSpectra from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SpectraDelete(ConstHandle2ConstSpectra self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SpectraRead(ConstHandle2Spectra self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SpectraWrite(ConstHandle2ConstSpectra self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SpectraPrint(ConstHandle2ConstSpectra self); + +// +++ Print to standard output, as XML +extern_c int +SpectraPrintXML(ConstHandle2ConstSpectra self); + +// +++ Print to standard output, as JSON +extern_c int +SpectraPrintJSON(ConstHandle2ConstSpectra self); + + +// ----------------------------------------------------------------------------- +// Child: spectrum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpectraSpectrumHas(ConstHandle2ConstSpectra self); + +// +++ Clear +extern_c void +SpectraSpectrumClear(ConstHandle2Spectra self); + +// +++ Size +extern_c size_t +SpectraSpectrumSize(ConstHandle2ConstSpectra self); + +// +++ Add +extern_c void +SpectraSpectrumAdd(ConstHandle2Spectra self, ConstHandle2ConstSpectrum spectrum); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstSpectrum +SpectraSpectrumGetConst(ConstHandle2ConstSpectra self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Spectrum +SpectraSpectrumGet(ConstHandle2Spectra self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +SpectraSpectrumSet( + ConstHandle2Spectra self, + const size_t index_, + ConstHandle2ConstSpectrum spectrum +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +SpectraSpectrumHasByLabel( + ConstHandle2ConstSpectra self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstSpectrum +SpectraSpectrumGetByLabelConst( + ConstHandle2ConstSpectra self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Spectrum +SpectraSpectrumGetByLabel( + ConstHandle2Spectra self, + const char *const label +); + +// +++ Set, by label +extern_c void +SpectraSpectrumSetByLabel( + ConstHandle2Spectra self, + const char *const label, + ConstHandle2ConstSpectrum spectrum +); + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// +++ Has, by pid +extern_c int +SpectraSpectrumHasByPid( + ConstHandle2ConstSpectra self, + const char *const pid +); + +// --- Get, by pid, const +extern_c Handle2ConstSpectrum +SpectraSpectrumGetByPidConst( + ConstHandle2ConstSpectra self, + const char *const pid +); + +// +++ Get, by pid, non-const +extern_c Handle2Spectrum +SpectraSpectrumGetByPid( + ConstHandle2Spectra self, + const char *const pid +); + +// +++ Set, by pid +extern_c void +SpectraSpectrumSetByPid( + ConstHandle2Spectra self, + const char *const pid, + ConstHandle2ConstSpectrum spectrum +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Spectra/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectra/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectra/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectra/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectra/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectrum.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectrum.cpp new file mode 100644 index 000000000..bb3bab6cf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectrum.cpp @@ -0,0 +1,374 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Spectrum.hpp" +#include "Spectrum.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SpectrumClass; +using CPP = multigroup::Spectrum; + +static const std::string CLASSNAME = "Spectrum"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto pid = [](auto &obj) { return &obj.pid; }; + static auto discrete = [](auto &obj) { return &obj.discrete; }; + static auto continuum = [](auto &obj) { return &obj.continuum; }; +} + +using CPPDiscrete = general::Discrete; +using CPPContinuum = general::Continuum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSpectrum +SpectrumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Spectrum +SpectrumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSpectrum +SpectrumCreateConst( + const char *const label, + const char *const pid, + ConstHandle2Discrete *const discrete, const size_t discreteSize, + ConstHandle2ConstContinuum continuum +) { + ConstHandle2Spectrum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + pid, + std::vector{}, + detail::tocpp(continuum) + ); + for (size_t DiscreteN = 0; DiscreteN < discreteSize; ++DiscreteN) + SpectrumDiscreteAdd(handle, discrete[DiscreteN]); + return handle; +} + +// Create, general, non-const +Handle2Spectrum +SpectrumCreate( + const char *const label, + const char *const pid, + ConstHandle2Discrete *const discrete, const size_t discreteSize, + ConstHandle2ConstContinuum continuum +) { + ConstHandle2Spectrum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + pid, + std::vector{}, + detail::tocpp(continuum) + ); + for (size_t DiscreteN = 0; DiscreteN < discreteSize; ++DiscreteN) + SpectrumDiscreteAdd(handle, discrete[DiscreteN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SpectrumAssign(ConstHandle2Spectrum self, ConstHandle2ConstSpectrum from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SpectrumDelete(ConstHandle2ConstSpectrum self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SpectrumRead(ConstHandle2Spectrum self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SpectrumWrite(ConstHandle2ConstSpectrum self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SpectrumPrint(ConstHandle2ConstSpectrum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SpectrumPrintXML(ConstHandle2ConstSpectrum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SpectrumPrintJSON(ConstHandle2ConstSpectrum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +SpectrumLabelHas(ConstHandle2ConstSpectrum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +SpectrumLabelGet(ConstHandle2ConstSpectrum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +SpectrumLabelSet(ConstHandle2Spectrum self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +SpectrumPidHas(ConstHandle2ConstSpectrum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +SpectrumPidGet(ConstHandle2ConstSpectrum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +SpectrumPidSet(ConstHandle2Spectrum self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Child: discrete +// ----------------------------------------------------------------------------- + +// Has +int +SpectrumDiscreteHas(ConstHandle2ConstSpectrum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DiscreteHas", self, extract::discrete); +} + +// Clear +void +SpectrumDiscreteClear(ConstHandle2Spectrum self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"DiscreteClear", self, extract::discrete); +} + +// Size +size_t +SpectrumDiscreteSize(ConstHandle2ConstSpectrum self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"DiscreteSize", self, extract::discrete); +} + +// Add +void +SpectrumDiscreteAdd(ConstHandle2Spectrum self, ConstHandle2ConstDiscrete discrete) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"DiscreteAdd", self, extract::discrete, discrete); +} + +// Get, by index \in [0,size), const +Handle2ConstDiscrete +SpectrumDiscreteGetConst(ConstHandle2ConstSpectrum self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DiscreteGetConst", self, extract::discrete, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Discrete +SpectrumDiscreteGet(ConstHandle2Spectrum self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"DiscreteGet", self, extract::discrete, index_); +} + +// Set, by index \in [0,size) +void +SpectrumDiscreteSet( + ConstHandle2Spectrum self, + const size_t index_, + ConstHandle2ConstDiscrete discrete +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"DiscreteSet", self, extract::discrete, index_, discrete); +} + +// ------------------------ +// Re: metadatum type +// ------------------------ + +// Has, by type +int +SpectrumDiscreteHasByType( + ConstHandle2ConstSpectrum self, + const char *const type +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"DiscreteHasByType", + self, extract::discrete, meta::type, type); +} + +// Get, by type, const +Handle2ConstDiscrete +SpectrumDiscreteGetByTypeConst( + ConstHandle2ConstSpectrum self, + const char *const type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DiscreteGetByTypeConst", + self, extract::discrete, meta::type, type); +} + +// Get, by type, non-const +Handle2Discrete +SpectrumDiscreteGetByType( + ConstHandle2Spectrum self, + const char *const type +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"DiscreteGetByType", + self, extract::discrete, meta::type, type); +} + +// Set, by type +void +SpectrumDiscreteSetByType( + ConstHandle2Spectrum self, + const char *const type, + ConstHandle2ConstDiscrete discrete +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"DiscreteSetByType", + self, extract::discrete, meta::type, type, discrete); +} + + +// ----------------------------------------------------------------------------- +// Child: continuum +// ----------------------------------------------------------------------------- + +// Has +int +SpectrumContinuumHas(ConstHandle2ConstSpectrum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ContinuumHas", self, extract::continuum); +} + +// Get, const +Handle2ConstContinuum +SpectrumContinuumGetConst(ConstHandle2ConstSpectrum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ContinuumGetConst", self, extract::continuum); +} + +// Get, non-const +Handle2Continuum +SpectrumContinuumGet(ConstHandle2Spectrum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ContinuumGet", self, extract::continuum); +} + +// Set +void +SpectrumContinuumSet(ConstHandle2Spectrum self, ConstHandle2ConstContinuum continuum) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ContinuumSet", self, extract::continuum, continuum); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Spectrum/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectrum.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectrum.h new file mode 100644 index 000000000..011b719c4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectrum.h @@ -0,0 +1,274 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Spectrum is the basic handle type in this file. Example: +// // Create a default Spectrum object: +// Spectrum handle = SpectrumDefault(); +// Functions involving Spectrum are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SPECTRUM +#define C_INTERFACE_GNDS_V2_0_GENERAL_SPECTRUM + +#include "GNDStk.h" +#include "v2.0/general/Discrete.h" +#include "v2.0/general/Continuum.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SpectrumClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Spectrum +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SpectrumClass *Spectrum; + +// --- Const-aware handles. +typedef const struct SpectrumClass *const ConstHandle2ConstSpectrum; +typedef struct SpectrumClass *const ConstHandle2Spectrum; +typedef const struct SpectrumClass * Handle2ConstSpectrum; +typedef struct SpectrumClass * Handle2Spectrum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSpectrum +SpectrumDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Spectrum +SpectrumDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpectrum +SpectrumCreateConst( + const char *const label, + const char *const pid, + ConstHandle2Discrete *const discrete, const size_t discreteSize, + ConstHandle2ConstContinuum continuum +); + +// +++ Create, general, non-const +extern_c Handle2Spectrum +SpectrumCreate( + const char *const label, + const char *const pid, + ConstHandle2Discrete *const discrete, const size_t discreteSize, + ConstHandle2ConstContinuum continuum +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SpectrumAssign(ConstHandle2Spectrum self, ConstHandle2ConstSpectrum from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SpectrumDelete(ConstHandle2ConstSpectrum self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SpectrumRead(ConstHandle2Spectrum self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SpectrumWrite(ConstHandle2ConstSpectrum self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SpectrumPrint(ConstHandle2ConstSpectrum self); + +// +++ Print to standard output, as XML +extern_c int +SpectrumPrintXML(ConstHandle2ConstSpectrum self); + +// +++ Print to standard output, as JSON +extern_c int +SpectrumPrintJSON(ConstHandle2ConstSpectrum self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpectrumLabelHas(ConstHandle2ConstSpectrum self); + +// +++ Get +// +++ Returns by value +extern_c const char * +SpectrumLabelGet(ConstHandle2ConstSpectrum self); + +// +++ Set +extern_c void +SpectrumLabelSet(ConstHandle2Spectrum self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpectrumPidHas(ConstHandle2ConstSpectrum self); + +// +++ Get +// +++ Returns by value +extern_c const char * +SpectrumPidGet(ConstHandle2ConstSpectrum self); + +// +++ Set +extern_c void +SpectrumPidSet(ConstHandle2Spectrum self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Child: discrete +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpectrumDiscreteHas(ConstHandle2ConstSpectrum self); + +// +++ Clear +extern_c void +SpectrumDiscreteClear(ConstHandle2Spectrum self); + +// +++ Size +extern_c size_t +SpectrumDiscreteSize(ConstHandle2ConstSpectrum self); + +// +++ Add +extern_c void +SpectrumDiscreteAdd(ConstHandle2Spectrum self, ConstHandle2ConstDiscrete discrete); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstDiscrete +SpectrumDiscreteGetConst(ConstHandle2ConstSpectrum self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Discrete +SpectrumDiscreteGet(ConstHandle2Spectrum self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +SpectrumDiscreteSet( + ConstHandle2Spectrum self, + const size_t index_, + ConstHandle2ConstDiscrete discrete +); + +// ------------------------ +// Re: metadatum type +// ------------------------ + +// +++ Has, by type +extern_c int +SpectrumDiscreteHasByType( + ConstHandle2ConstSpectrum self, + const char *const type +); + +// --- Get, by type, const +extern_c Handle2ConstDiscrete +SpectrumDiscreteGetByTypeConst( + ConstHandle2ConstSpectrum self, + const char *const type +); + +// +++ Get, by type, non-const +extern_c Handle2Discrete +SpectrumDiscreteGetByType( + ConstHandle2Spectrum self, + const char *const type +); + +// +++ Set, by type +extern_c void +SpectrumDiscreteSetByType( + ConstHandle2Spectrum self, + const char *const type, + ConstHandle2ConstDiscrete discrete +); + + +// ----------------------------------------------------------------------------- +// Child: continuum +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpectrumContinuumHas(ConstHandle2ConstSpectrum self); + +// --- Get, const +extern_c Handle2ConstContinuum +SpectrumContinuumGetConst(ConstHandle2ConstSpectrum self); + +// +++ Get, non-const +extern_c Handle2Continuum +SpectrumContinuumGet(ConstHandle2Spectrum self); + +// +++ Set +extern_c void +SpectrumContinuumSet(ConstHandle2Spectrum self, ConstHandle2ConstContinuum continuum); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Spectrum/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectrum/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectrum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectrum/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spectrum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spin.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spin.cpp new file mode 100644 index 000000000..3dea59cb2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spin.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Spin.hpp" +#include "Spin.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SpinClass; +using CPP = multigroup::Spin; + +static const std::string CLASSNAME = "Spin"; + +namespace extract { + static auto fraction = [](auto &obj) { return &obj.fraction; }; +} + +using CPPFraction = general::Fraction; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSpin +SpinDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Spin +SpinDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSpin +SpinCreateConst( + ConstHandle2ConstFraction fraction +) { + ConstHandle2Spin handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(fraction) + ); + return handle; +} + +// Create, general, non-const +Handle2Spin +SpinCreate( + ConstHandle2ConstFraction fraction +) { + ConstHandle2Spin handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(fraction) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SpinAssign(ConstHandle2Spin self, ConstHandle2ConstSpin from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SpinDelete(ConstHandle2ConstSpin self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SpinRead(ConstHandle2Spin self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SpinWrite(ConstHandle2ConstSpin self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SpinPrint(ConstHandle2ConstSpin self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SpinPrintXML(ConstHandle2ConstSpin self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SpinPrintJSON(ConstHandle2ConstSpin self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: fraction +// ----------------------------------------------------------------------------- + +// Has +int +SpinFractionHas(ConstHandle2ConstSpin self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FractionHas", self, extract::fraction); +} + +// Get, const +Handle2ConstFraction +SpinFractionGetConst(ConstHandle2ConstSpin self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FractionGetConst", self, extract::fraction); +} + +// Get, non-const +Handle2Fraction +SpinFractionGet(ConstHandle2Spin self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FractionGet", self, extract::fraction); +} + +// Set +void +SpinFractionSet(ConstHandle2Spin self, ConstHandle2ConstFraction fraction) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FractionSet", self, extract::fraction, fraction); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Spin/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spin.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spin.h new file mode 100644 index 000000000..f454bc764 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spin.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Spin is the basic handle type in this file. Example: +// // Create a default Spin object: +// Spin handle = SpinDefault(); +// Functions involving Spin are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SPIN +#define C_INTERFACE_GNDS_V2_0_GENERAL_SPIN + +#include "GNDStk.h" +#include "v2.0/general/Fraction.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SpinClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Spin +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SpinClass *Spin; + +// --- Const-aware handles. +typedef const struct SpinClass *const ConstHandle2ConstSpin; +typedef struct SpinClass *const ConstHandle2Spin; +typedef const struct SpinClass * Handle2ConstSpin; +typedef struct SpinClass * Handle2Spin; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSpin +SpinDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Spin +SpinDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpin +SpinCreateConst( + ConstHandle2ConstFraction fraction +); + +// +++ Create, general, non-const +extern_c Handle2Spin +SpinCreate( + ConstHandle2ConstFraction fraction +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SpinAssign(ConstHandle2Spin self, ConstHandle2ConstSpin from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SpinDelete(ConstHandle2ConstSpin self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SpinRead(ConstHandle2Spin self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SpinWrite(ConstHandle2ConstSpin self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SpinPrint(ConstHandle2ConstSpin self); + +// +++ Print to standard output, as XML +extern_c int +SpinPrintXML(ConstHandle2ConstSpin self); + +// +++ Print to standard output, as JSON +extern_c int +SpinPrintJSON(ConstHandle2ConstSpin self); + + +// ----------------------------------------------------------------------------- +// Child: fraction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinFractionHas(ConstHandle2ConstSpin self); + +// --- Get, const +extern_c Handle2ConstFraction +SpinFractionGetConst(ConstHandle2ConstSpin self); + +// +++ Get, non-const +extern_c Handle2Fraction +SpinFractionGet(ConstHandle2Spin self); + +// +++ Set +extern_c void +SpinFractionSet(ConstHandle2Spin self, ConstHandle2ConstFraction fraction); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Spin/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spin/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spin/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spin/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Spin/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroup.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroup.cpp new file mode 100644 index 000000000..1517f7ebd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroup.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/SpinGroup.hpp" +#include "SpinGroup.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SpinGroupClass; +using CPP = multigroup::SpinGroup; + +static const std::string CLASSNAME = "SpinGroup"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto spin = [](auto &obj) { return &obj.spin; }; + static auto parity = [](auto &obj) { return &obj.parity; }; + static auto channels = [](auto &obj) { return &obj.channels; }; + static auto resonanceParameters = [](auto &obj) { return &obj.resonanceParameters; }; +} + +using CPPChannels = general::Channels; +using CPPResonanceParameters = general::ResonanceParameters; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSpinGroup +SpinGroupDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2SpinGroup +SpinGroupDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSpinGroup +SpinGroupCreateConst( + const char *const label, + const int spin, + const int parity, + ConstHandle2ConstChannels channels, + ConstHandle2ConstResonanceParameters resonanceParameters +) { + ConstHandle2SpinGroup handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + spin, + parity, + detail::tocpp(channels), + detail::tocpp(resonanceParameters) + ); + return handle; +} + +// Create, general, non-const +Handle2SpinGroup +SpinGroupCreate( + const char *const label, + const int spin, + const int parity, + ConstHandle2ConstChannels channels, + ConstHandle2ConstResonanceParameters resonanceParameters +) { + ConstHandle2SpinGroup handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + spin, + parity, + detail::tocpp(channels), + detail::tocpp(resonanceParameters) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SpinGroupAssign(ConstHandle2SpinGroup self, ConstHandle2ConstSpinGroup from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SpinGroupDelete(ConstHandle2ConstSpinGroup self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SpinGroupRead(ConstHandle2SpinGroup self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SpinGroupWrite(ConstHandle2ConstSpinGroup self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SpinGroupPrint(ConstHandle2ConstSpinGroup self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SpinGroupPrintXML(ConstHandle2ConstSpinGroup self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SpinGroupPrintJSON(ConstHandle2ConstSpinGroup self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +SpinGroupLabelHas(ConstHandle2ConstSpinGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +SpinGroupLabelGet(ConstHandle2ConstSpinGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +SpinGroupLabelSet(ConstHandle2SpinGroup self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: spin +// ----------------------------------------------------------------------------- + +// Has +int +SpinGroupSpinHas(ConstHandle2ConstSpinGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SpinHas", self, extract::spin); +} + +// Get +// Returns by value +int +SpinGroupSpinGet(ConstHandle2ConstSpinGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SpinGet", self, extract::spin); +} + +// Set +void +SpinGroupSpinSet(ConstHandle2SpinGroup self, const int spin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SpinSet", self, extract::spin, spin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: parity +// ----------------------------------------------------------------------------- + +// Has +int +SpinGroupParityHas(ConstHandle2ConstSpinGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ParityHas", self, extract::parity); +} + +// Get +// Returns by value +int +SpinGroupParityGet(ConstHandle2ConstSpinGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParityGet", self, extract::parity); +} + +// Set +void +SpinGroupParitySet(ConstHandle2SpinGroup self, const int parity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ParitySet", self, extract::parity, parity); +} + + +// ----------------------------------------------------------------------------- +// Child: channels +// ----------------------------------------------------------------------------- + +// Has +int +SpinGroupChannelsHas(ConstHandle2ConstSpinGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChannelsHas", self, extract::channels); +} + +// Get, const +Handle2ConstChannels +SpinGroupChannelsGetConst(ConstHandle2ConstSpinGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChannelsGetConst", self, extract::channels); +} + +// Get, non-const +Handle2Channels +SpinGroupChannelsGet(ConstHandle2SpinGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChannelsGet", self, extract::channels); +} + +// Set +void +SpinGroupChannelsSet(ConstHandle2SpinGroup self, ConstHandle2ConstChannels channels) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChannelsSet", self, extract::channels, channels); +} + + +// ----------------------------------------------------------------------------- +// Child: resonanceParameters +// ----------------------------------------------------------------------------- + +// Has +int +SpinGroupResonanceParametersHas(ConstHandle2ConstSpinGroup self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResonanceParametersHas", self, extract::resonanceParameters); +} + +// Get, const +Handle2ConstResonanceParameters +SpinGroupResonanceParametersGetConst(ConstHandle2ConstSpinGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonanceParametersGetConst", self, extract::resonanceParameters); +} + +// Get, non-const +Handle2ResonanceParameters +SpinGroupResonanceParametersGet(ConstHandle2SpinGroup self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonanceParametersGet", self, extract::resonanceParameters); +} + +// Set +void +SpinGroupResonanceParametersSet(ConstHandle2SpinGroup self, ConstHandle2ConstResonanceParameters resonanceParameters) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResonanceParametersSet", self, extract::resonanceParameters, resonanceParameters); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/SpinGroup/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroup.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroup.h new file mode 100644 index 000000000..a3a152961 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroup.h @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// SpinGroup is the basic handle type in this file. Example: +// // Create a default SpinGroup object: +// SpinGroup handle = SpinGroupDefault(); +// Functions involving SpinGroup are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SPINGROUP +#define C_INTERFACE_GNDS_V2_0_GENERAL_SPINGROUP + +#include "GNDStk.h" +#include "v2.0/general/Channels.h" +#include "v2.0/general/ResonanceParameters.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SpinGroupClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ SpinGroup +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SpinGroupClass *SpinGroup; + +// --- Const-aware handles. +typedef const struct SpinGroupClass *const ConstHandle2ConstSpinGroup; +typedef struct SpinGroupClass *const ConstHandle2SpinGroup; +typedef const struct SpinGroupClass * Handle2ConstSpinGroup; +typedef struct SpinGroupClass * Handle2SpinGroup; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSpinGroup +SpinGroupDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2SpinGroup +SpinGroupDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpinGroup +SpinGroupCreateConst( + const char *const label, + const int spin, + const int parity, + ConstHandle2ConstChannels channels, + ConstHandle2ConstResonanceParameters resonanceParameters +); + +// +++ Create, general, non-const +extern_c Handle2SpinGroup +SpinGroupCreate( + const char *const label, + const int spin, + const int parity, + ConstHandle2ConstChannels channels, + ConstHandle2ConstResonanceParameters resonanceParameters +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SpinGroupAssign(ConstHandle2SpinGroup self, ConstHandle2ConstSpinGroup from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SpinGroupDelete(ConstHandle2ConstSpinGroup self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SpinGroupRead(ConstHandle2SpinGroup self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SpinGroupWrite(ConstHandle2ConstSpinGroup self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SpinGroupPrint(ConstHandle2ConstSpinGroup self); + +// +++ Print to standard output, as XML +extern_c int +SpinGroupPrintXML(ConstHandle2ConstSpinGroup self); + +// +++ Print to standard output, as JSON +extern_c int +SpinGroupPrintJSON(ConstHandle2ConstSpinGroup self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinGroupLabelHas(ConstHandle2ConstSpinGroup self); + +// +++ Get +// +++ Returns by value +extern_c const char * +SpinGroupLabelGet(ConstHandle2ConstSpinGroup self); + +// +++ Set +extern_c void +SpinGroupLabelSet(ConstHandle2SpinGroup self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: spin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinGroupSpinHas(ConstHandle2ConstSpinGroup self); + +// +++ Get +// +++ Returns by value +extern_c int +SpinGroupSpinGet(ConstHandle2ConstSpinGroup self); + +// +++ Set +extern_c void +SpinGroupSpinSet(ConstHandle2SpinGroup self, const int spin); + + +// ----------------------------------------------------------------------------- +// Metadatum: parity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinGroupParityHas(ConstHandle2ConstSpinGroup self); + +// +++ Get +// +++ Returns by value +extern_c int +SpinGroupParityGet(ConstHandle2ConstSpinGroup self); + +// +++ Set +extern_c void +SpinGroupParitySet(ConstHandle2SpinGroup self, const int parity); + + +// ----------------------------------------------------------------------------- +// Child: channels +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinGroupChannelsHas(ConstHandle2ConstSpinGroup self); + +// --- Get, const +extern_c Handle2ConstChannels +SpinGroupChannelsGetConst(ConstHandle2ConstSpinGroup self); + +// +++ Get, non-const +extern_c Handle2Channels +SpinGroupChannelsGet(ConstHandle2SpinGroup self); + +// +++ Set +extern_c void +SpinGroupChannelsSet(ConstHandle2SpinGroup self, ConstHandle2ConstChannels channels); + + +// ----------------------------------------------------------------------------- +// Child: resonanceParameters +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinGroupResonanceParametersHas(ConstHandle2ConstSpinGroup self); + +// --- Get, const +extern_c Handle2ConstResonanceParameters +SpinGroupResonanceParametersGetConst(ConstHandle2ConstSpinGroup self); + +// +++ Get, non-const +extern_c Handle2ResonanceParameters +SpinGroupResonanceParametersGet(ConstHandle2SpinGroup self); + +// +++ Set +extern_c void +SpinGroupResonanceParametersSet(ConstHandle2SpinGroup self, ConstHandle2ConstResonanceParameters resonanceParameters); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/SpinGroup/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroup/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroup/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroup/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroup/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroups.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroups.cpp new file mode 100644 index 000000000..639f2f49f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroups.cpp @@ -0,0 +1,359 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/SpinGroups.hpp" +#include "SpinGroups.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SpinGroupsClass; +using CPP = multigroup::SpinGroups; + +static const std::string CLASSNAME = "SpinGroups"; + +namespace extract { + static auto spinGroup = [](auto &obj) { return &obj.spinGroup; }; +} + +using CPPSpinGroup = general::SpinGroup; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSpinGroups +SpinGroupsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2SpinGroups +SpinGroupsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSpinGroups +SpinGroupsCreateConst( + ConstHandle2SpinGroup *const spinGroup, const size_t spinGroupSize +) { + ConstHandle2SpinGroups handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t SpinGroupN = 0; SpinGroupN < spinGroupSize; ++SpinGroupN) + SpinGroupsSpinGroupAdd(handle, spinGroup[SpinGroupN]); + return handle; +} + +// Create, general, non-const +Handle2SpinGroups +SpinGroupsCreate( + ConstHandle2SpinGroup *const spinGroup, const size_t spinGroupSize +) { + ConstHandle2SpinGroups handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t SpinGroupN = 0; SpinGroupN < spinGroupSize; ++SpinGroupN) + SpinGroupsSpinGroupAdd(handle, spinGroup[SpinGroupN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SpinGroupsAssign(ConstHandle2SpinGroups self, ConstHandle2ConstSpinGroups from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SpinGroupsDelete(ConstHandle2ConstSpinGroups self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SpinGroupsRead(ConstHandle2SpinGroups self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SpinGroupsWrite(ConstHandle2ConstSpinGroups self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SpinGroupsPrint(ConstHandle2ConstSpinGroups self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SpinGroupsPrintXML(ConstHandle2ConstSpinGroups self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SpinGroupsPrintJSON(ConstHandle2ConstSpinGroups self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: spinGroup +// ----------------------------------------------------------------------------- + +// Has +int +SpinGroupsSpinGroupHas(ConstHandle2ConstSpinGroups self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SpinGroupHas", self, extract::spinGroup); +} + +// Clear +void +SpinGroupsSpinGroupClear(ConstHandle2SpinGroups self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"SpinGroupClear", self, extract::spinGroup); +} + +// Size +size_t +SpinGroupsSpinGroupSize(ConstHandle2ConstSpinGroups self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"SpinGroupSize", self, extract::spinGroup); +} + +// Add +void +SpinGroupsSpinGroupAdd(ConstHandle2SpinGroups self, ConstHandle2ConstSpinGroup spinGroup) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"SpinGroupAdd", self, extract::spinGroup, spinGroup); +} + +// Get, by index \in [0,size), const +Handle2ConstSpinGroup +SpinGroupsSpinGroupGetConst(ConstHandle2ConstSpinGroups self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SpinGroupGetConst", self, extract::spinGroup, index_); +} + +// Get, by index \in [0,size), non-const +Handle2SpinGroup +SpinGroupsSpinGroupGet(ConstHandle2SpinGroups self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SpinGroupGet", self, extract::spinGroup, index_); +} + +// Set, by index \in [0,size) +void +SpinGroupsSpinGroupSet( + ConstHandle2SpinGroups self, + const size_t index_, + ConstHandle2ConstSpinGroup spinGroup +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"SpinGroupSet", self, extract::spinGroup, index_, spinGroup); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +SpinGroupsSpinGroupHasByLabel( + ConstHandle2ConstSpinGroups self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupHasByLabel", + self, extract::spinGroup, meta::label, label); +} + +// Get, by label, const +Handle2ConstSpinGroup +SpinGroupsSpinGroupGetByLabelConst( + ConstHandle2ConstSpinGroups self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetByLabelConst", + self, extract::spinGroup, meta::label, label); +} + +// Get, by label, non-const +Handle2SpinGroup +SpinGroupsSpinGroupGetByLabel( + ConstHandle2SpinGroups self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetByLabel", + self, extract::spinGroup, meta::label, label); +} + +// Set, by label +void +SpinGroupsSpinGroupSetByLabel( + ConstHandle2SpinGroups self, + const char *const label, + ConstHandle2ConstSpinGroup spinGroup +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupSetByLabel", + self, extract::spinGroup, meta::label, label, spinGroup); +} + +// ------------------------ +// Re: metadatum spin +// ------------------------ + +// Has, by spin +int +SpinGroupsSpinGroupHasBySpin( + ConstHandle2ConstSpinGroups self, + const int spin +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupHasBySpin", + self, extract::spinGroup, meta::spin, spin); +} + +// Get, by spin, const +Handle2ConstSpinGroup +SpinGroupsSpinGroupGetBySpinConst( + ConstHandle2ConstSpinGroups self, + const int spin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetBySpinConst", + self, extract::spinGroup, meta::spin, spin); +} + +// Get, by spin, non-const +Handle2SpinGroup +SpinGroupsSpinGroupGetBySpin( + ConstHandle2SpinGroups self, + const int spin +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetBySpin", + self, extract::spinGroup, meta::spin, spin); +} + +// Set, by spin +void +SpinGroupsSpinGroupSetBySpin( + ConstHandle2SpinGroups self, + const int spin, + ConstHandle2ConstSpinGroup spinGroup +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupSetBySpin", + self, extract::spinGroup, meta::spin, spin, spinGroup); +} + +// ------------------------ +// Re: metadatum parity +// ------------------------ + +// Has, by parity +int +SpinGroupsSpinGroupHasByParity( + ConstHandle2ConstSpinGroups self, + const int parity +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupHasByParity", + self, extract::spinGroup, meta::parity, parity); +} + +// Get, by parity, const +Handle2ConstSpinGroup +SpinGroupsSpinGroupGetByParityConst( + ConstHandle2ConstSpinGroups self, + const int parity +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetByParityConst", + self, extract::spinGroup, meta::parity, parity); +} + +// Get, by parity, non-const +Handle2SpinGroup +SpinGroupsSpinGroupGetByParity( + ConstHandle2SpinGroups self, + const int parity +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupGetByParity", + self, extract::spinGroup, meta::parity, parity); +} + +// Set, by parity +void +SpinGroupsSpinGroupSetByParity( + ConstHandle2SpinGroups self, + const int parity, + ConstHandle2ConstSpinGroup spinGroup +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SpinGroupSetByParity", + self, extract::spinGroup, meta::parity, parity, spinGroup); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/SpinGroups/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroups.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroups.h new file mode 100644 index 000000000..286dad480 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroups.h @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// SpinGroups is the basic handle type in this file. Example: +// // Create a default SpinGroups object: +// SpinGroups handle = SpinGroupsDefault(); +// Functions involving SpinGroups are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SPINGROUPS +#define C_INTERFACE_GNDS_V2_0_GENERAL_SPINGROUPS + +#include "GNDStk.h" +#include "v2.0/general/SpinGroup.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SpinGroupsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ SpinGroups +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SpinGroupsClass *SpinGroups; + +// --- Const-aware handles. +typedef const struct SpinGroupsClass *const ConstHandle2ConstSpinGroups; +typedef struct SpinGroupsClass *const ConstHandle2SpinGroups; +typedef const struct SpinGroupsClass * Handle2ConstSpinGroups; +typedef struct SpinGroupsClass * Handle2SpinGroups; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSpinGroups +SpinGroupsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2SpinGroups +SpinGroupsDefault(); + +// --- Create, general, const +extern_c Handle2ConstSpinGroups +SpinGroupsCreateConst( + ConstHandle2SpinGroup *const spinGroup, const size_t spinGroupSize +); + +// +++ Create, general, non-const +extern_c Handle2SpinGroups +SpinGroupsCreate( + ConstHandle2SpinGroup *const spinGroup, const size_t spinGroupSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SpinGroupsAssign(ConstHandle2SpinGroups self, ConstHandle2ConstSpinGroups from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SpinGroupsDelete(ConstHandle2ConstSpinGroups self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SpinGroupsRead(ConstHandle2SpinGroups self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SpinGroupsWrite(ConstHandle2ConstSpinGroups self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SpinGroupsPrint(ConstHandle2ConstSpinGroups self); + +// +++ Print to standard output, as XML +extern_c int +SpinGroupsPrintXML(ConstHandle2ConstSpinGroups self); + +// +++ Print to standard output, as JSON +extern_c int +SpinGroupsPrintJSON(ConstHandle2ConstSpinGroups self); + + +// ----------------------------------------------------------------------------- +// Child: spinGroup +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SpinGroupsSpinGroupHas(ConstHandle2ConstSpinGroups self); + +// +++ Clear +extern_c void +SpinGroupsSpinGroupClear(ConstHandle2SpinGroups self); + +// +++ Size +extern_c size_t +SpinGroupsSpinGroupSize(ConstHandle2ConstSpinGroups self); + +// +++ Add +extern_c void +SpinGroupsSpinGroupAdd(ConstHandle2SpinGroups self, ConstHandle2ConstSpinGroup spinGroup); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstSpinGroup +SpinGroupsSpinGroupGetConst(ConstHandle2ConstSpinGroups self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2SpinGroup +SpinGroupsSpinGroupGet(ConstHandle2SpinGroups self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +SpinGroupsSpinGroupSet( + ConstHandle2SpinGroups self, + const size_t index_, + ConstHandle2ConstSpinGroup spinGroup +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +SpinGroupsSpinGroupHasByLabel( + ConstHandle2ConstSpinGroups self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstSpinGroup +SpinGroupsSpinGroupGetByLabelConst( + ConstHandle2ConstSpinGroups self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2SpinGroup +SpinGroupsSpinGroupGetByLabel( + ConstHandle2SpinGroups self, + const char *const label +); + +// +++ Set, by label +extern_c void +SpinGroupsSpinGroupSetByLabel( + ConstHandle2SpinGroups self, + const char *const label, + ConstHandle2ConstSpinGroup spinGroup +); + +// ------------------------ +// Re: metadatum spin +// ------------------------ + +// +++ Has, by spin +extern_c int +SpinGroupsSpinGroupHasBySpin( + ConstHandle2ConstSpinGroups self, + const int spin +); + +// --- Get, by spin, const +extern_c Handle2ConstSpinGroup +SpinGroupsSpinGroupGetBySpinConst( + ConstHandle2ConstSpinGroups self, + const int spin +); + +// +++ Get, by spin, non-const +extern_c Handle2SpinGroup +SpinGroupsSpinGroupGetBySpin( + ConstHandle2SpinGroups self, + const int spin +); + +// +++ Set, by spin +extern_c void +SpinGroupsSpinGroupSetBySpin( + ConstHandle2SpinGroups self, + const int spin, + ConstHandle2ConstSpinGroup spinGroup +); + +// ------------------------ +// Re: metadatum parity +// ------------------------ + +// +++ Has, by parity +extern_c int +SpinGroupsSpinGroupHasByParity( + ConstHandle2ConstSpinGroups self, + const int parity +); + +// --- Get, by parity, const +extern_c Handle2ConstSpinGroup +SpinGroupsSpinGroupGetByParityConst( + ConstHandle2ConstSpinGroups self, + const int parity +); + +// +++ Get, by parity, non-const +extern_c Handle2SpinGroup +SpinGroupsSpinGroupGetByParity( + ConstHandle2SpinGroups self, + const int parity +); + +// +++ Set, by parity +extern_c void +SpinGroupsSpinGroupSetByParity( + ConstHandle2SpinGroups self, + const int parity, + ConstHandle2ConstSpinGroup spinGroup +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/SpinGroups/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroups/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroups/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroups/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/SpinGroups/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Standard.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Standard.cpp new file mode 100644 index 000000000..194f7d401 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Standard.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Standard.hpp" +#include "Standard.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = StandardClass; +using CPP = multigroup::Standard; + +static const std::string CLASSNAME = "Standard"; + +namespace extract { + static auto Double = [](auto &obj) { return &obj.Double; }; +} + +using CPPDouble = reduced::Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstStandard +StandardDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Standard +StandardDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstStandard +StandardCreateConst( + ConstHandle2ConstDouble Double +) { + ConstHandle2Standard handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(Double) + ); + return handle; +} + +// Create, general, non-const +Handle2Standard +StandardCreate( + ConstHandle2ConstDouble Double +) { + ConstHandle2Standard handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(Double) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +StandardAssign(ConstHandle2Standard self, ConstHandle2ConstStandard from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +StandardDelete(ConstHandle2ConstStandard self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +StandardRead(ConstHandle2Standard self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +StandardWrite(ConstHandle2ConstStandard self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +StandardPrint(ConstHandle2ConstStandard self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +StandardPrintXML(ConstHandle2ConstStandard self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +StandardPrintJSON(ConstHandle2ConstStandard self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +StandardDoubleHas(ConstHandle2ConstStandard self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Get, const +Handle2ConstDouble +StandardDoubleGetConst(ConstHandle2ConstStandard self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double); +} + +// Get, non-const +Handle2Double +StandardDoubleGet(ConstHandle2Standard self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double); +} + +// Set +void +StandardDoubleSet(ConstHandle2Standard self, ConstHandle2ConstDouble Double) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, Double); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Standard/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Standard.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Standard.h new file mode 100644 index 000000000..27979261e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Standard.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Standard is the basic handle type in this file. Example: +// // Create a default Standard object: +// Standard handle = StandardDefault(); +// Functions involving Standard are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_STANDARD +#define C_INTERFACE_GNDS_V2_0_GENERAL_STANDARD + +#include "GNDStk.h" +#include "v2.0/reduced/Double.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct StandardClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Standard +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct StandardClass *Standard; + +// --- Const-aware handles. +typedef const struct StandardClass *const ConstHandle2ConstStandard; +typedef struct StandardClass *const ConstHandle2Standard; +typedef const struct StandardClass * Handle2ConstStandard; +typedef struct StandardClass * Handle2Standard; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstStandard +StandardDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Standard +StandardDefault(); + +// --- Create, general, const +extern_c Handle2ConstStandard +StandardCreateConst( + ConstHandle2ConstDouble Double +); + +// +++ Create, general, non-const +extern_c Handle2Standard +StandardCreate( + ConstHandle2ConstDouble Double +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +StandardAssign(ConstHandle2Standard self, ConstHandle2ConstStandard from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +StandardDelete(ConstHandle2ConstStandard self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +StandardRead(ConstHandle2Standard self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +StandardWrite(ConstHandle2ConstStandard self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +StandardPrint(ConstHandle2ConstStandard self); + +// +++ Print to standard output, as XML +extern_c int +StandardPrintXML(ConstHandle2ConstStandard self); + +// +++ Print to standard output, as JSON +extern_c int +StandardPrintJSON(ConstHandle2ConstStandard self); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StandardDoubleHas(ConstHandle2ConstStandard self); + +// --- Get, const +extern_c Handle2ConstDouble +StandardDoubleGetConst(ConstHandle2ConstStandard self); + +// +++ Get, non-const +extern_c Handle2Double +StandardDoubleGet(ConstHandle2Standard self); + +// +++ Set +extern_c void +StandardDoubleSet(ConstHandle2Standard self, ConstHandle2ConstDouble Double); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Standard/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Standard/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Standard/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Standard/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Standard/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/String.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/String.cpp new file mode 100644 index 000000000..324301c47 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/String.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/String.hpp" +#include "String.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = StringClass; +using CPP = multigroup::String; + +static const std::string CLASSNAME = "String"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstString +StringDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2String +StringDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstString +StringCreateConst( + const char *const label, + const char *const value, + const char *const unit +) { + ConstHandle2String handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + value, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2String +StringCreate( + const char *const label, + const char *const value, + const char *const unit +) { + ConstHandle2String handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + value, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +StringAssign(ConstHandle2String self, ConstHandle2ConstString from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +StringDelete(ConstHandle2ConstString self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +StringRead(ConstHandle2String self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +StringWrite(ConstHandle2ConstString self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +StringPrint(ConstHandle2ConstString self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +StringPrintXML(ConstHandle2ConstString self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +StringPrintJSON(ConstHandle2ConstString self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +StringLabelHas(ConstHandle2ConstString self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +StringLabelGet(ConstHandle2ConstString self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +StringLabelSet(ConstHandle2String self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +StringValueHas(ConstHandle2ConstString self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +const char * +StringValueGet(ConstHandle2ConstString self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +StringValueSet(ConstHandle2String self, const char *const value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +StringUnitHas(ConstHandle2ConstString self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +StringUnitGet(ConstHandle2ConstString self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +StringUnitSet(ConstHandle2String self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/String/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/String.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/String.h new file mode 100644 index 000000000..18af081f9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/String.h @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// String is the basic handle type in this file. Example: +// // Create a default String object: +// String handle = StringDefault(); +// Functions involving String are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_STRING +#define C_INTERFACE_GNDS_V2_0_GENERAL_STRING + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct StringClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ String +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct StringClass *String; + +// --- Const-aware handles. +typedef const struct StringClass *const ConstHandle2ConstString; +typedef struct StringClass *const ConstHandle2String; +typedef const struct StringClass * Handle2ConstString; +typedef struct StringClass * Handle2String; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstString +StringDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2String +StringDefault(); + +// --- Create, general, const +extern_c Handle2ConstString +StringCreateConst( + const char *const label, + const char *const value, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2String +StringCreate( + const char *const label, + const char *const value, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +StringAssign(ConstHandle2String self, ConstHandle2ConstString from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +StringDelete(ConstHandle2ConstString self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +StringRead(ConstHandle2String self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +StringWrite(ConstHandle2ConstString self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +StringPrint(ConstHandle2ConstString self); + +// +++ Print to standard output, as XML +extern_c int +StringPrintXML(ConstHandle2ConstString self); + +// +++ Print to standard output, as JSON +extern_c int +StringPrintJSON(ConstHandle2ConstString self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StringLabelHas(ConstHandle2ConstString self); + +// +++ Get +// +++ Returns by value +extern_c const char * +StringLabelGet(ConstHandle2ConstString self); + +// +++ Set +extern_c void +StringLabelSet(ConstHandle2String self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StringValueHas(ConstHandle2ConstString self); + +// +++ Get +// +++ Returns by value +extern_c const char * +StringValueGet(ConstHandle2ConstString self); + +// +++ Set +extern_c void +StringValueSet(ConstHandle2String self, const char *const value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StringUnitHas(ConstHandle2ConstString self); + +// +++ Get +// +++ Returns by value +extern_c const char * +StringUnitGet(ConstHandle2ConstString self); + +// +++ Set +extern_c void +StringUnitSet(ConstHandle2String self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/String/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/String/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/String/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/String/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/String/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Styles.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Styles.cpp new file mode 100644 index 000000000..ba1a4606a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Styles.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Styles.hpp" +#include "Styles.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = StylesClass; +using CPP = multigroup::Styles; + +static const std::string CLASSNAME = "Styles"; + +namespace extract { + static auto evaluated = [](auto &obj) { return &obj.evaluated; }; + static auto crossSectionReconstructed = [](auto &obj) { return &obj.crossSectionReconstructed; }; +} + +using CPPEvaluated = general::Evaluated; +using CPPCrossSectionReconstructed = general::CrossSectionReconstructed; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstStyles +StylesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Styles +StylesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstStyles +StylesCreateConst( + ConstHandle2ConstEvaluated evaluated, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +) { + ConstHandle2Styles handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(evaluated), + detail::tocpp(crossSectionReconstructed) + ); + return handle; +} + +// Create, general, non-const +Handle2Styles +StylesCreate( + ConstHandle2ConstEvaluated evaluated, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +) { + ConstHandle2Styles handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(evaluated), + detail::tocpp(crossSectionReconstructed) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +StylesAssign(ConstHandle2Styles self, ConstHandle2ConstStyles from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +StylesDelete(ConstHandle2ConstStyles self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +StylesRead(ConstHandle2Styles self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +StylesWrite(ConstHandle2ConstStyles self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +StylesPrint(ConstHandle2ConstStyles self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +StylesPrintXML(ConstHandle2ConstStyles self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +StylesPrintJSON(ConstHandle2ConstStyles self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: evaluated +// ----------------------------------------------------------------------------- + +// Has +int +StylesEvaluatedHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EvaluatedHas", self, extract::evaluated); +} + +// Get, const +Handle2ConstEvaluated +StylesEvaluatedGetConst(ConstHandle2ConstStyles self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaluatedGetConst", self, extract::evaluated); +} + +// Get, non-const +Handle2Evaluated +StylesEvaluatedGet(ConstHandle2Styles self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaluatedGet", self, extract::evaluated); +} + +// Set +void +StylesEvaluatedSet(ConstHandle2Styles self, ConstHandle2ConstEvaluated evaluated) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EvaluatedSet", self, extract::evaluated, evaluated); +} + + +// ----------------------------------------------------------------------------- +// Child: crossSectionReconstructed +// ----------------------------------------------------------------------------- + +// Has +int +StylesCrossSectionReconstructedHas(ConstHandle2ConstStyles self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedHas", self, extract::crossSectionReconstructed); +} + +// Get, const +Handle2ConstCrossSectionReconstructed +StylesCrossSectionReconstructedGetConst(ConstHandle2ConstStyles self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedGetConst", self, extract::crossSectionReconstructed); +} + +// Get, non-const +Handle2CrossSectionReconstructed +StylesCrossSectionReconstructedGet(ConstHandle2Styles self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedGet", self, extract::crossSectionReconstructed); +} + +// Set +void +StylesCrossSectionReconstructedSet(ConstHandle2Styles self, ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CrossSectionReconstructedSet", self, extract::crossSectionReconstructed, crossSectionReconstructed); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Styles/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Styles.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Styles.h new file mode 100644 index 000000000..0333a9a37 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Styles.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Styles is the basic handle type in this file. Example: +// // Create a default Styles object: +// Styles handle = StylesDefault(); +// Functions involving Styles are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_STYLES +#define C_INTERFACE_GNDS_V2_0_GENERAL_STYLES + +#include "GNDStk.h" +#include "v2.0/general/Evaluated.h" +#include "v2.0/general/CrossSectionReconstructed.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct StylesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Styles +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct StylesClass *Styles; + +// --- Const-aware handles. +typedef const struct StylesClass *const ConstHandle2ConstStyles; +typedef struct StylesClass *const ConstHandle2Styles; +typedef const struct StylesClass * Handle2ConstStyles; +typedef struct StylesClass * Handle2Styles; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstStyles +StylesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Styles +StylesDefault(); + +// --- Create, general, const +extern_c Handle2ConstStyles +StylesCreateConst( + ConstHandle2ConstEvaluated evaluated, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +); + +// +++ Create, general, non-const +extern_c Handle2Styles +StylesCreate( + ConstHandle2ConstEvaluated evaluated, + ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +StylesAssign(ConstHandle2Styles self, ConstHandle2ConstStyles from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +StylesDelete(ConstHandle2ConstStyles self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +StylesRead(ConstHandle2Styles self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +StylesWrite(ConstHandle2ConstStyles self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +StylesPrint(ConstHandle2ConstStyles self); + +// +++ Print to standard output, as XML +extern_c int +StylesPrintXML(ConstHandle2ConstStyles self); + +// +++ Print to standard output, as JSON +extern_c int +StylesPrintJSON(ConstHandle2ConstStyles self); + + +// ----------------------------------------------------------------------------- +// Child: evaluated +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesEvaluatedHas(ConstHandle2ConstStyles self); + +// --- Get, const +extern_c Handle2ConstEvaluated +StylesEvaluatedGetConst(ConstHandle2ConstStyles self); + +// +++ Get, non-const +extern_c Handle2Evaluated +StylesEvaluatedGet(ConstHandle2Styles self); + +// +++ Set +extern_c void +StylesEvaluatedSet(ConstHandle2Styles self, ConstHandle2ConstEvaluated evaluated); + + +// ----------------------------------------------------------------------------- +// Child: crossSectionReconstructed +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +StylesCrossSectionReconstructedHas(ConstHandle2ConstStyles self); + +// --- Get, const +extern_c Handle2ConstCrossSectionReconstructed +StylesCrossSectionReconstructedGetConst(ConstHandle2ConstStyles self); + +// +++ Get, non-const +extern_c Handle2CrossSectionReconstructed +StylesCrossSectionReconstructedGet(ConstHandle2Styles self); + +// +++ Set +extern_c void +StylesCrossSectionReconstructedSet(ConstHandle2Styles self, ConstHandle2ConstCrossSectionReconstructed crossSectionReconstructed); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Styles/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Styles/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Styles/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Styles/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Styles/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sum.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sum.cpp new file mode 100644 index 000000000..bc1238520 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sum.cpp @@ -0,0 +1,499 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Sum.hpp" +#include "Sum.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SumClass; +using CPP = multigroup::Sum; + +static const std::string CLASSNAME = "Sum"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto domainUnit = [](auto &obj) { return &obj.domainUnit; }; + static auto summand = [](auto &obj) { return &obj.summand; }; +} + +using CPPSummand = general::Summand; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSum +SumDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Sum +SumDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSum +SumCreateConst( + const char *const label, + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2Summand *const summand, const size_t summandSize +) { + ConstHandle2Sum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + domainMin, + domainMax, + domainUnit, + std::vector{} + ); + for (size_t SummandN = 0; SummandN < summandSize; ++SummandN) + SumSummandAdd(handle, summand[SummandN]); + return handle; +} + +// Create, general, non-const +Handle2Sum +SumCreate( + const char *const label, + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2Summand *const summand, const size_t summandSize +) { + ConstHandle2Sum handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + domainMin, + domainMax, + domainUnit, + std::vector{} + ); + for (size_t SummandN = 0; SummandN < summandSize; ++SummandN) + SumSummandAdd(handle, summand[SummandN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SumAssign(ConstHandle2Sum self, ConstHandle2ConstSum from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SumDelete(ConstHandle2ConstSum self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SumRead(ConstHandle2Sum self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SumWrite(ConstHandle2ConstSum self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SumPrint(ConstHandle2ConstSum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SumPrintXML(ConstHandle2ConstSum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SumPrintJSON(ConstHandle2ConstSum self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +SumLabelHas(ConstHandle2ConstSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +SumLabelGet(ConstHandle2ConstSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +SumLabelSet(ConstHandle2Sum self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +SumDomainMinHas(ConstHandle2ConstSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +double +SumDomainMinGet(ConstHandle2ConstSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +SumDomainMinSet(ConstHandle2Sum self, const double domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +SumDomainMaxHas(ConstHandle2ConstSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +double +SumDomainMaxGet(ConstHandle2ConstSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +SumDomainMaxSet(ConstHandle2Sum self, const double domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// Has +int +SumDomainUnitHas(ConstHandle2ConstSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainUnitHas", self, extract::domainUnit); +} + +// Get +// Returns by value +const char * +SumDomainUnitGet(ConstHandle2ConstSum self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainUnitGet", self, extract::domainUnit); +} + +// Set +void +SumDomainUnitSet(ConstHandle2Sum self, const char *const domainUnit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainUnitSet", self, extract::domainUnit, domainUnit); +} + + +// ----------------------------------------------------------------------------- +// Child: summand +// ----------------------------------------------------------------------------- + +// Has +int +SumSummandHas(ConstHandle2ConstSum self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SummandHas", self, extract::summand); +} + +// Clear +void +SumSummandClear(ConstHandle2Sum self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"SummandClear", self, extract::summand); +} + +// Size +size_t +SumSummandSize(ConstHandle2ConstSum self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"SummandSize", self, extract::summand); +} + +// Add +void +SumSummandAdd(ConstHandle2Sum self, ConstHandle2ConstSummand summand) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"SummandAdd", self, extract::summand, summand); +} + +// Get, by index \in [0,size), const +Handle2ConstSummand +SumSummandGetConst(ConstHandle2ConstSum self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SummandGetConst", self, extract::summand, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Summand +SumSummandGet(ConstHandle2Sum self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"SummandGet", self, extract::summand, index_); +} + +// Set, by index \in [0,size) +void +SumSummandSet( + ConstHandle2Sum self, + const size_t index_, + ConstHandle2ConstSummand summand +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"SummandSet", self, extract::summand, index_, summand); +} + +// ------------------------ +// Re: metadatum ENDF_MFMT +// ------------------------ + +// Has, by ENDF_MFMT +int +SumSummandHasByENDFMFMT( + ConstHandle2ConstSum self, + const char *const ENDF_MFMT +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SummandHasByENDFMFMT", + self, extract::summand, meta::ENDF_MFMT, ENDF_MFMT); +} + +// Get, by ENDF_MFMT, const +Handle2ConstSummand +SumSummandGetByENDFMFMTConst( + ConstHandle2ConstSum self, + const char *const ENDF_MFMT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SummandGetByENDFMFMTConst", + self, extract::summand, meta::ENDF_MFMT, ENDF_MFMT); +} + +// Get, by ENDF_MFMT, non-const +Handle2Summand +SumSummandGetByENDFMFMT( + ConstHandle2Sum self, + const char *const ENDF_MFMT +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SummandGetByENDFMFMT", + self, extract::summand, meta::ENDF_MFMT, ENDF_MFMT); +} + +// Set, by ENDF_MFMT +void +SumSummandSetByENDFMFMT( + ConstHandle2Sum self, + const char *const ENDF_MFMT, + ConstHandle2ConstSummand summand +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SummandSetByENDFMFMT", + self, extract::summand, meta::ENDF_MFMT, ENDF_MFMT, summand); +} + +// ------------------------ +// Re: metadatum coefficient +// ------------------------ + +// Has, by coefficient +int +SumSummandHasByCoefficient( + ConstHandle2ConstSum self, + const char *const coefficient +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SummandHasByCoefficient", + self, extract::summand, meta::coefficient, coefficient); +} + +// Get, by coefficient, const +Handle2ConstSummand +SumSummandGetByCoefficientConst( + ConstHandle2ConstSum self, + const char *const coefficient +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SummandGetByCoefficientConst", + self, extract::summand, meta::coefficient, coefficient); +} + +// Get, by coefficient, non-const +Handle2Summand +SumSummandGetByCoefficient( + ConstHandle2Sum self, + const char *const coefficient +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SummandGetByCoefficient", + self, extract::summand, meta::coefficient, coefficient); +} + +// Set, by coefficient +void +SumSummandSetByCoefficient( + ConstHandle2Sum self, + const char *const coefficient, + ConstHandle2ConstSummand summand +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SummandSetByCoefficient", + self, extract::summand, meta::coefficient, coefficient, summand); +} + +// ------------------------ +// Re: metadatum href +// ------------------------ + +// Has, by href +int +SumSummandHasByHref( + ConstHandle2ConstSum self, + const char *const href +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"SummandHasByHref", + self, extract::summand, meta::href, href); +} + +// Get, by href, const +Handle2ConstSummand +SumSummandGetByHrefConst( + ConstHandle2ConstSum self, + const char *const href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SummandGetByHrefConst", + self, extract::summand, meta::href, href); +} + +// Get, by href, non-const +Handle2Summand +SumSummandGetByHref( + ConstHandle2Sum self, + const char *const href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"SummandGetByHref", + self, extract::summand, meta::href, href); +} + +// Set, by href +void +SumSummandSetByHref( + ConstHandle2Sum self, + const char *const href, + ConstHandle2ConstSummand summand +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"SummandSetByHref", + self, extract::summand, meta::href, href, summand); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Sum/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sum.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sum.h new file mode 100644 index 000000000..91a450311 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sum.h @@ -0,0 +1,356 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Sum is the basic handle type in this file. Example: +// // Create a default Sum object: +// Sum handle = SumDefault(); +// Functions involving Sum are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SUM +#define C_INTERFACE_GNDS_V2_0_GENERAL_SUM + +#include "GNDStk.h" +#include "v2.0/general/Summand.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SumClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Sum +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SumClass *Sum; + +// --- Const-aware handles. +typedef const struct SumClass *const ConstHandle2ConstSum; +typedef struct SumClass *const ConstHandle2Sum; +typedef const struct SumClass * Handle2ConstSum; +typedef struct SumClass * Handle2Sum; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSum +SumDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Sum +SumDefault(); + +// --- Create, general, const +extern_c Handle2ConstSum +SumCreateConst( + const char *const label, + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2Summand *const summand, const size_t summandSize +); + +// +++ Create, general, non-const +extern_c Handle2Sum +SumCreate( + const char *const label, + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2Summand *const summand, const size_t summandSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SumAssign(ConstHandle2Sum self, ConstHandle2ConstSum from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SumDelete(ConstHandle2ConstSum self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SumRead(ConstHandle2Sum self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SumWrite(ConstHandle2ConstSum self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SumPrint(ConstHandle2ConstSum self); + +// +++ Print to standard output, as XML +extern_c int +SumPrintXML(ConstHandle2ConstSum self); + +// +++ Print to standard output, as JSON +extern_c int +SumPrintJSON(ConstHandle2ConstSum self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SumLabelHas(ConstHandle2ConstSum self); + +// +++ Get +// +++ Returns by value +extern_c const char * +SumLabelGet(ConstHandle2ConstSum self); + +// +++ Set +extern_c void +SumLabelSet(ConstHandle2Sum self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SumDomainMinHas(ConstHandle2ConstSum self); + +// +++ Get +// +++ Returns by value +extern_c double +SumDomainMinGet(ConstHandle2ConstSum self); + +// +++ Set +extern_c void +SumDomainMinSet(ConstHandle2Sum self, const double domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SumDomainMaxHas(ConstHandle2ConstSum self); + +// +++ Get +// +++ Returns by value +extern_c double +SumDomainMaxGet(ConstHandle2ConstSum self); + +// +++ Set +extern_c void +SumDomainMaxSet(ConstHandle2Sum self, const double domainMax); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SumDomainUnitHas(ConstHandle2ConstSum self); + +// +++ Get +// +++ Returns by value +extern_c const char * +SumDomainUnitGet(ConstHandle2ConstSum self); + +// +++ Set +extern_c void +SumDomainUnitSet(ConstHandle2Sum self, const char *const domainUnit); + + +// ----------------------------------------------------------------------------- +// Child: summand +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SumSummandHas(ConstHandle2ConstSum self); + +// +++ Clear +extern_c void +SumSummandClear(ConstHandle2Sum self); + +// +++ Size +extern_c size_t +SumSummandSize(ConstHandle2ConstSum self); + +// +++ Add +extern_c void +SumSummandAdd(ConstHandle2Sum self, ConstHandle2ConstSummand summand); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstSummand +SumSummandGetConst(ConstHandle2ConstSum self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Summand +SumSummandGet(ConstHandle2Sum self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +SumSummandSet( + ConstHandle2Sum self, + const size_t index_, + ConstHandle2ConstSummand summand +); + +// ------------------------ +// Re: metadatum ENDF_MFMT +// ------------------------ + +// +++ Has, by ENDF_MFMT +extern_c int +SumSummandHasByENDFMFMT( + ConstHandle2ConstSum self, + const char *const ENDF_MFMT +); + +// --- Get, by ENDF_MFMT, const +extern_c Handle2ConstSummand +SumSummandGetByENDFMFMTConst( + ConstHandle2ConstSum self, + const char *const ENDF_MFMT +); + +// +++ Get, by ENDF_MFMT, non-const +extern_c Handle2Summand +SumSummandGetByENDFMFMT( + ConstHandle2Sum self, + const char *const ENDF_MFMT +); + +// +++ Set, by ENDF_MFMT +extern_c void +SumSummandSetByENDFMFMT( + ConstHandle2Sum self, + const char *const ENDF_MFMT, + ConstHandle2ConstSummand summand +); + +// ------------------------ +// Re: metadatum coefficient +// ------------------------ + +// +++ Has, by coefficient +extern_c int +SumSummandHasByCoefficient( + ConstHandle2ConstSum self, + const char *const coefficient +); + +// --- Get, by coefficient, const +extern_c Handle2ConstSummand +SumSummandGetByCoefficientConst( + ConstHandle2ConstSum self, + const char *const coefficient +); + +// +++ Get, by coefficient, non-const +extern_c Handle2Summand +SumSummandGetByCoefficient( + ConstHandle2Sum self, + const char *const coefficient +); + +// +++ Set, by coefficient +extern_c void +SumSummandSetByCoefficient( + ConstHandle2Sum self, + const char *const coefficient, + ConstHandle2ConstSummand summand +); + +// ------------------------ +// Re: metadatum href +// ------------------------ + +// +++ Has, by href +extern_c int +SumSummandHasByHref( + ConstHandle2ConstSum self, + const char *const href +); + +// --- Get, by href, const +extern_c Handle2ConstSummand +SumSummandGetByHrefConst( + ConstHandle2ConstSum self, + const char *const href +); + +// +++ Get, by href, non-const +extern_c Handle2Summand +SumSummandGetByHref( + ConstHandle2Sum self, + const char *const href +); + +// +++ Set, by href +extern_c void +SumSummandSetByHref( + ConstHandle2Sum self, + const char *const href, + ConstHandle2ConstSummand summand +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Sum/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sum/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sum/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sum/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sum/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summand.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summand.cpp new file mode 100644 index 000000000..e7de30cb6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summand.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Summand.hpp" +#include "Summand.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SummandClass; +using CPP = multigroup::Summand; + +static const std::string CLASSNAME = "Summand"; + +namespace extract { + static auto ENDF_MFMT = [](auto &obj) { return &obj.ENDF_MFMT; }; + static auto coefficient = [](auto &obj) { return &obj.coefficient; }; + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSummand +SummandDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Summand +SummandDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSummand +SummandCreateConst( + const char *const ENDF_MFMT, + const char *const coefficient, + const char *const href +) { + ConstHandle2Summand handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + ENDF_MFMT, + coefficient, + href + ); + return handle; +} + +// Create, general, non-const +Handle2Summand +SummandCreate( + const char *const ENDF_MFMT, + const char *const coefficient, + const char *const href +) { + ConstHandle2Summand handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + ENDF_MFMT, + coefficient, + href + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SummandAssign(ConstHandle2Summand self, ConstHandle2ConstSummand from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SummandDelete(ConstHandle2ConstSummand self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SummandRead(ConstHandle2Summand self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SummandWrite(ConstHandle2ConstSummand self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SummandPrint(ConstHandle2ConstSummand self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SummandPrintXML(ConstHandle2ConstSummand self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SummandPrintJSON(ConstHandle2ConstSummand self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MFMT +// ----------------------------------------------------------------------------- + +// Has +int +SummandENDFMFMTHas(ConstHandle2ConstSummand self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ENDFMFMTHas", self, extract::ENDF_MFMT); +} + +// Get +// Returns by value +const char * +SummandENDFMFMTGet(ConstHandle2ConstSummand self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ENDFMFMTGet", self, extract::ENDF_MFMT); +} + +// Set +void +SummandENDFMFMTSet(ConstHandle2Summand self, const char *const ENDF_MFMT) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ENDFMFMTSet", self, extract::ENDF_MFMT, ENDF_MFMT); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: coefficient +// ----------------------------------------------------------------------------- + +// Has +int +SummandCoefficientHas(ConstHandle2ConstSummand self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CoefficientHas", self, extract::coefficient); +} + +// Get +// Returns by value +const char * +SummandCoefficientGet(ConstHandle2ConstSummand self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CoefficientGet", self, extract::coefficient); +} + +// Set +void +SummandCoefficientSet(ConstHandle2Summand self, const char *const coefficient) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CoefficientSet", self, extract::coefficient, coefficient); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +SummandHrefHas(ConstHandle2ConstSummand self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +SummandHrefGet(ConstHandle2ConstSummand self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +SummandHrefSet(ConstHandle2Summand self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Summand/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summand.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summand.h new file mode 100644 index 000000000..68791aedc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summand.h @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Summand is the basic handle type in this file. Example: +// // Create a default Summand object: +// Summand handle = SummandDefault(); +// Functions involving Summand are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SUMMAND +#define C_INTERFACE_GNDS_V2_0_GENERAL_SUMMAND + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SummandClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Summand +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SummandClass *Summand; + +// --- Const-aware handles. +typedef const struct SummandClass *const ConstHandle2ConstSummand; +typedef struct SummandClass *const ConstHandle2Summand; +typedef const struct SummandClass * Handle2ConstSummand; +typedef struct SummandClass * Handle2Summand; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSummand +SummandDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Summand +SummandDefault(); + +// --- Create, general, const +extern_c Handle2ConstSummand +SummandCreateConst( + const char *const ENDF_MFMT, + const char *const coefficient, + const char *const href +); + +// +++ Create, general, non-const +extern_c Handle2Summand +SummandCreate( + const char *const ENDF_MFMT, + const char *const coefficient, + const char *const href +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SummandAssign(ConstHandle2Summand self, ConstHandle2ConstSummand from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SummandDelete(ConstHandle2ConstSummand self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SummandRead(ConstHandle2Summand self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SummandWrite(ConstHandle2ConstSummand self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SummandPrint(ConstHandle2ConstSummand self); + +// +++ Print to standard output, as XML +extern_c int +SummandPrintXML(ConstHandle2ConstSummand self); + +// +++ Print to standard output, as JSON +extern_c int +SummandPrintJSON(ConstHandle2ConstSummand self); + + +// ----------------------------------------------------------------------------- +// Metadatum: ENDF_MFMT +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SummandENDFMFMTHas(ConstHandle2ConstSummand self); + +// +++ Get +// +++ Returns by value +extern_c const char * +SummandENDFMFMTGet(ConstHandle2ConstSummand self); + +// +++ Set +extern_c void +SummandENDFMFMTSet(ConstHandle2Summand self, const char *const ENDF_MFMT); + + +// ----------------------------------------------------------------------------- +// Metadatum: coefficient +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SummandCoefficientHas(ConstHandle2ConstSummand self); + +// +++ Get +// +++ Returns by value +extern_c const char * +SummandCoefficientGet(ConstHandle2ConstSummand self); + +// +++ Set +extern_c void +SummandCoefficientSet(ConstHandle2Summand self, const char *const coefficient); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SummandHrefHas(ConstHandle2ConstSummand self); + +// +++ Get +// +++ Returns by value +extern_c const char * +SummandHrefGet(ConstHandle2ConstSummand self); + +// +++ Set +extern_c void +SummandHrefSet(ConstHandle2Summand self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Summand/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summand/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summand/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summand/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summand/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summands.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summands.cpp new file mode 100644 index 000000000..fdaaf0756 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summands.cpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Summands.hpp" +#include "Summands.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SummandsClass; +using CPP = multigroup::Summands; + +static const std::string CLASSNAME = "Summands"; + +namespace extract { + static auto add = [](auto &obj) { return &obj.add; }; +} + +using CPPAdd = general::Add; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSummands +SummandsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Summands +SummandsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSummands +SummandsCreateConst( + ConstHandle2Add *const add, const size_t addSize +) { + ConstHandle2Summands handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t AddN = 0; AddN < addSize; ++AddN) + SummandsAddAdd(handle, add[AddN]); + return handle; +} + +// Create, general, non-const +Handle2Summands +SummandsCreate( + ConstHandle2Add *const add, const size_t addSize +) { + ConstHandle2Summands handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t AddN = 0; AddN < addSize; ++AddN) + SummandsAddAdd(handle, add[AddN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SummandsAssign(ConstHandle2Summands self, ConstHandle2ConstSummands from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SummandsDelete(ConstHandle2ConstSummands self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SummandsRead(ConstHandle2Summands self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SummandsWrite(ConstHandle2ConstSummands self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SummandsPrint(ConstHandle2ConstSummands self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SummandsPrintXML(ConstHandle2ConstSummands self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SummandsPrintJSON(ConstHandle2ConstSummands self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: add +// ----------------------------------------------------------------------------- + +// Has +int +SummandsAddHas(ConstHandle2ConstSummands self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AddHas", self, extract::add); +} + +// Clear +void +SummandsAddClear(ConstHandle2Summands self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"AddClear", self, extract::add); +} + +// Size +size_t +SummandsAddSize(ConstHandle2ConstSummands self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"AddSize", self, extract::add); +} + +// Add +void +SummandsAddAdd(ConstHandle2Summands self, ConstHandle2ConstAdd add) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"AddAdd", self, extract::add, add); +} + +// Get, by index \in [0,size), const +Handle2ConstAdd +SummandsAddGetConst(ConstHandle2ConstSummands self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AddGetConst", self, extract::add, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Add +SummandsAddGet(ConstHandle2Summands self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"AddGet", self, extract::add, index_); +} + +// Set, by index \in [0,size) +void +SummandsAddSet( + ConstHandle2Summands self, + const size_t index_, + ConstHandle2ConstAdd add +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"AddSet", self, extract::add, index_, add); +} + +// ------------------------ +// Re: metadatum href +// ------------------------ + +// Has, by href +int +SummandsAddHasByHref( + ConstHandle2ConstSummands self, + const char *const href +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"AddHasByHref", + self, extract::add, meta::href, href); +} + +// Get, by href, const +Handle2ConstAdd +SummandsAddGetByHrefConst( + ConstHandle2ConstSummands self, + const char *const href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AddGetByHrefConst", + self, extract::add, meta::href, href); +} + +// Get, by href, non-const +Handle2Add +SummandsAddGetByHref( + ConstHandle2Summands self, + const char *const href +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"AddGetByHref", + self, extract::add, meta::href, href); +} + +// Set, by href +void +SummandsAddSetByHref( + ConstHandle2Summands self, + const char *const href, + ConstHandle2ConstAdd add +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"AddSetByHref", + self, extract::add, meta::href, href, add); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Summands/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summands.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summands.h new file mode 100644 index 000000000..2ad1690d0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summands.h @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Summands is the basic handle type in this file. Example: +// // Create a default Summands object: +// Summands handle = SummandsDefault(); +// Functions involving Summands are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SUMMANDS +#define C_INTERFACE_GNDS_V2_0_GENERAL_SUMMANDS + +#include "GNDStk.h" +#include "v2.0/general/Add.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SummandsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Summands +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SummandsClass *Summands; + +// --- Const-aware handles. +typedef const struct SummandsClass *const ConstHandle2ConstSummands; +typedef struct SummandsClass *const ConstHandle2Summands; +typedef const struct SummandsClass * Handle2ConstSummands; +typedef struct SummandsClass * Handle2Summands; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSummands +SummandsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Summands +SummandsDefault(); + +// --- Create, general, const +extern_c Handle2ConstSummands +SummandsCreateConst( + ConstHandle2Add *const add, const size_t addSize +); + +// +++ Create, general, non-const +extern_c Handle2Summands +SummandsCreate( + ConstHandle2Add *const add, const size_t addSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SummandsAssign(ConstHandle2Summands self, ConstHandle2ConstSummands from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SummandsDelete(ConstHandle2ConstSummands self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SummandsRead(ConstHandle2Summands self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SummandsWrite(ConstHandle2ConstSummands self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SummandsPrint(ConstHandle2ConstSummands self); + +// +++ Print to standard output, as XML +extern_c int +SummandsPrintXML(ConstHandle2ConstSummands self); + +// +++ Print to standard output, as JSON +extern_c int +SummandsPrintJSON(ConstHandle2ConstSummands self); + + +// ----------------------------------------------------------------------------- +// Child: add +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SummandsAddHas(ConstHandle2ConstSummands self); + +// +++ Clear +extern_c void +SummandsAddClear(ConstHandle2Summands self); + +// +++ Size +extern_c size_t +SummandsAddSize(ConstHandle2ConstSummands self); + +// +++ Add +extern_c void +SummandsAddAdd(ConstHandle2Summands self, ConstHandle2ConstAdd add); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstAdd +SummandsAddGetConst(ConstHandle2ConstSummands self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Add +SummandsAddGet(ConstHandle2Summands self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +SummandsAddSet( + ConstHandle2Summands self, + const size_t index_, + ConstHandle2ConstAdd add +); + +// ------------------------ +// Re: metadatum href +// ------------------------ + +// +++ Has, by href +extern_c int +SummandsAddHasByHref( + ConstHandle2ConstSummands self, + const char *const href +); + +// --- Get, by href, const +extern_c Handle2ConstAdd +SummandsAddGetByHrefConst( + ConstHandle2ConstSummands self, + const char *const href +); + +// +++ Get, by href, non-const +extern_c Handle2Add +SummandsAddGetByHref( + ConstHandle2Summands self, + const char *const href +); + +// +++ Set, by href +extern_c void +SummandsAddSetByHref( + ConstHandle2Summands self, + const char *const href, + ConstHandle2ConstAdd add +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Summands/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summands/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summands/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summands/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Summands/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sums.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sums.cpp new file mode 100644 index 000000000..fd566b065 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sums.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Sums.hpp" +#include "Sums.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = SumsClass; +using CPP = multigroup::Sums; + +static const std::string CLASSNAME = "Sums"; + +namespace extract { + static auto crossSectionSums = [](auto &obj) { return &obj.crossSectionSums; }; + static auto multiplicitySums = [](auto &obj) { return &obj.multiplicitySums; }; +} + +using CPPCrossSectionSums = general::CrossSectionSums; +using CPPMultiplicitySums = general::MultiplicitySums; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstSums +SumsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Sums +SumsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstSums +SumsCreateConst( + ConstHandle2ConstCrossSectionSums crossSectionSums, + ConstHandle2ConstMultiplicitySums multiplicitySums +) { + ConstHandle2Sums handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(crossSectionSums), + detail::tocpp(multiplicitySums) + ); + return handle; +} + +// Create, general, non-const +Handle2Sums +SumsCreate( + ConstHandle2ConstCrossSectionSums crossSectionSums, + ConstHandle2ConstMultiplicitySums multiplicitySums +) { + ConstHandle2Sums handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(crossSectionSums), + detail::tocpp(multiplicitySums) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +SumsAssign(ConstHandle2Sums self, ConstHandle2ConstSums from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +SumsDelete(ConstHandle2ConstSums self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +SumsRead(ConstHandle2Sums self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +SumsWrite(ConstHandle2ConstSums self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +SumsPrint(ConstHandle2ConstSums self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +SumsPrintXML(ConstHandle2ConstSums self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +SumsPrintJSON(ConstHandle2ConstSums self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: crossSectionSums +// ----------------------------------------------------------------------------- + +// Has +int +SumsCrossSectionSumsHas(ConstHandle2ConstSums self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CrossSectionSumsHas", self, extract::crossSectionSums); +} + +// Get, const +Handle2ConstCrossSectionSums +SumsCrossSectionSumsGetConst(ConstHandle2ConstSums self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionSumsGetConst", self, extract::crossSectionSums); +} + +// Get, non-const +Handle2CrossSectionSums +SumsCrossSectionSumsGet(ConstHandle2Sums self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CrossSectionSumsGet", self, extract::crossSectionSums); +} + +// Set +void +SumsCrossSectionSumsSet(ConstHandle2Sums self, ConstHandle2ConstCrossSectionSums crossSectionSums) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CrossSectionSumsSet", self, extract::crossSectionSums, crossSectionSums); +} + + +// ----------------------------------------------------------------------------- +// Child: multiplicitySums +// ----------------------------------------------------------------------------- + +// Has +int +SumsMultiplicitySumsHas(ConstHandle2ConstSums self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MultiplicitySumsHas", self, extract::multiplicitySums); +} + +// Get, const +Handle2ConstMultiplicitySums +SumsMultiplicitySumsGetConst(ConstHandle2ConstSums self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MultiplicitySumsGetConst", self, extract::multiplicitySums); +} + +// Get, non-const +Handle2MultiplicitySums +SumsMultiplicitySumsGet(ConstHandle2Sums self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MultiplicitySumsGet", self, extract::multiplicitySums); +} + +// Set +void +SumsMultiplicitySumsSet(ConstHandle2Sums self, ConstHandle2ConstMultiplicitySums multiplicitySums) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MultiplicitySumsSet", self, extract::multiplicitySums, multiplicitySums); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Sums/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sums.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sums.h new file mode 100644 index 000000000..966857226 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sums.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Sums is the basic handle type in this file. Example: +// // Create a default Sums object: +// Sums handle = SumsDefault(); +// Functions involving Sums are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_SUMS +#define C_INTERFACE_GNDS_V2_0_GENERAL_SUMS + +#include "GNDStk.h" +#include "v2.0/general/CrossSectionSums.h" +#include "v2.0/general/MultiplicitySums.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct SumsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Sums +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct SumsClass *Sums; + +// --- Const-aware handles. +typedef const struct SumsClass *const ConstHandle2ConstSums; +typedef struct SumsClass *const ConstHandle2Sums; +typedef const struct SumsClass * Handle2ConstSums; +typedef struct SumsClass * Handle2Sums; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstSums +SumsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Sums +SumsDefault(); + +// --- Create, general, const +extern_c Handle2ConstSums +SumsCreateConst( + ConstHandle2ConstCrossSectionSums crossSectionSums, + ConstHandle2ConstMultiplicitySums multiplicitySums +); + +// +++ Create, general, non-const +extern_c Handle2Sums +SumsCreate( + ConstHandle2ConstCrossSectionSums crossSectionSums, + ConstHandle2ConstMultiplicitySums multiplicitySums +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +SumsAssign(ConstHandle2Sums self, ConstHandle2ConstSums from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +SumsDelete(ConstHandle2ConstSums self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +SumsRead(ConstHandle2Sums self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +SumsWrite(ConstHandle2ConstSums self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +SumsPrint(ConstHandle2ConstSums self); + +// +++ Print to standard output, as XML +extern_c int +SumsPrintXML(ConstHandle2ConstSums self); + +// +++ Print to standard output, as JSON +extern_c int +SumsPrintJSON(ConstHandle2ConstSums self); + + +// ----------------------------------------------------------------------------- +// Child: crossSectionSums +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SumsCrossSectionSumsHas(ConstHandle2ConstSums self); + +// --- Get, const +extern_c Handle2ConstCrossSectionSums +SumsCrossSectionSumsGetConst(ConstHandle2ConstSums self); + +// +++ Get, non-const +extern_c Handle2CrossSectionSums +SumsCrossSectionSumsGet(ConstHandle2Sums self); + +// +++ Set +extern_c void +SumsCrossSectionSumsSet(ConstHandle2Sums self, ConstHandle2ConstCrossSectionSums crossSectionSums); + + +// ----------------------------------------------------------------------------- +// Child: multiplicitySums +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +SumsMultiplicitySumsHas(ConstHandle2ConstSums self); + +// --- Get, const +extern_c Handle2ConstMultiplicitySums +SumsMultiplicitySumsGetConst(ConstHandle2ConstSums self); + +// +++ Get, non-const +extern_c Handle2MultiplicitySums +SumsMultiplicitySumsGet(ConstHandle2Sums self); + +// +++ Set +extern_c void +SumsMultiplicitySumsSet(ConstHandle2Sums self, ConstHandle2ConstMultiplicitySums multiplicitySums); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Sums/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sums/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sums/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sums/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Sums/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_M.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_M.cpp new file mode 100644 index 000000000..5eb41fd40 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_M.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/T_M.hpp" +#include "T_M.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = T_MClass; +using CPP = multigroup::T_M; + +static const std::string CLASSNAME = "T_M"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstT_M +T_MDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2T_M +T_MDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstT_M +T_MCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2T_M handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2T_M +T_MCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2T_M handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +T_MAssign(ConstHandle2T_M self, ConstHandle2ConstT_M from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +T_MDelete(ConstHandle2ConstT_M self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +T_MRead(ConstHandle2T_M self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +T_MWrite(ConstHandle2ConstT_M self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +T_MPrint(ConstHandle2ConstT_M self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +T_MPrintXML(ConstHandle2ConstT_M self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +T_MPrintJSON(ConstHandle2ConstT_M self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +T_MXYs1dHas(ConstHandle2ConstT_M self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +T_MXYs1dGetConst(ConstHandle2ConstT_M self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +T_MXYs1dGet(ConstHandle2T_M self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +T_MXYs1dSet(ConstHandle2T_M self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/T_M/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_M.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_M.h new file mode 100644 index 000000000..6d7b69403 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_M.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// T_M is the basic handle type in this file. Example: +// // Create a default T_M object: +// T_M handle = T_MDefault(); +// Functions involving T_M are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_T_M +#define C_INTERFACE_GNDS_V2_0_GENERAL_T_M + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct T_MClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ T_M +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct T_MClass *T_M; + +// --- Const-aware handles. +typedef const struct T_MClass *const ConstHandle2ConstT_M; +typedef struct T_MClass *const ConstHandle2T_M; +typedef const struct T_MClass * Handle2ConstT_M; +typedef struct T_MClass * Handle2T_M; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstT_M +T_MDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2T_M +T_MDefault(); + +// --- Create, general, const +extern_c Handle2ConstT_M +T_MCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2T_M +T_MCreate( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +T_MAssign(ConstHandle2T_M self, ConstHandle2ConstT_M from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +T_MDelete(ConstHandle2ConstT_M self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +T_MRead(ConstHandle2T_M self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +T_MWrite(ConstHandle2ConstT_M self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +T_MPrint(ConstHandle2ConstT_M self); + +// +++ Print to standard output, as XML +extern_c int +T_MPrintXML(ConstHandle2ConstT_M self); + +// +++ Print to standard output, as JSON +extern_c int +T_MPrintJSON(ConstHandle2ConstT_M self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +T_MXYs1dHas(ConstHandle2ConstT_M self); + +// --- Get, const +extern_c Handle2ConstXYs1d +T_MXYs1dGetConst(ConstHandle2ConstT_M self); + +// +++ Get, non-const +extern_c Handle2XYs1d +T_MXYs1dGet(ConstHandle2T_M self); + +// +++ Set +extern_c void +T_MXYs1dSet(ConstHandle2T_M self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/T_M/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_M/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_M/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_M/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_M/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_effective.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_effective.cpp new file mode 100644 index 000000000..afed3c114 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_effective.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/T_effective.hpp" +#include "T_effective.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = T_effectiveClass; +using CPP = multigroup::T_effective; + +static const std::string CLASSNAME = "T_effective"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstT_effective +T_effectiveDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2T_effective +T_effectiveDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstT_effective +T_effectiveCreateConst( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2T_effective handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Create, general, non-const +Handle2T_effective +T_effectiveCreate( + ConstHandle2ConstXYs1d XYs1d +) { + ConstHandle2T_effective handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +T_effectiveAssign(ConstHandle2T_effective self, ConstHandle2ConstT_effective from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +T_effectiveDelete(ConstHandle2ConstT_effective self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +T_effectiveRead(ConstHandle2T_effective self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +T_effectiveWrite(ConstHandle2ConstT_effective self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +T_effectivePrint(ConstHandle2ConstT_effective self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +T_effectivePrintXML(ConstHandle2ConstT_effective self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +T_effectivePrintJSON(ConstHandle2ConstT_effective self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +T_effectiveXYs1dHas(ConstHandle2ConstT_effective self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +T_effectiveXYs1dGetConst(ConstHandle2ConstT_effective self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +T_effectiveXYs1dGet(ConstHandle2T_effective self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +T_effectiveXYs1dSet(ConstHandle2T_effective self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/T_effective/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_effective.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_effective.h new file mode 100644 index 000000000..532ff310c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_effective.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// T_effective is the basic handle type in this file. Example: +// // Create a default T_effective object: +// T_effective handle = T_effectiveDefault(); +// Functions involving T_effective are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_T_EFFECTIVE +#define C_INTERFACE_GNDS_V2_0_GENERAL_T_EFFECTIVE + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct T_effectiveClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ T_effective +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct T_effectiveClass *T_effective; + +// --- Const-aware handles. +typedef const struct T_effectiveClass *const ConstHandle2ConstT_effective; +typedef struct T_effectiveClass *const ConstHandle2T_effective; +typedef const struct T_effectiveClass * Handle2ConstT_effective; +typedef struct T_effectiveClass * Handle2T_effective; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstT_effective +T_effectiveDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2T_effective +T_effectiveDefault(); + +// --- Create, general, const +extern_c Handle2ConstT_effective +T_effectiveCreateConst( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Create, general, non-const +extern_c Handle2T_effective +T_effectiveCreate( + ConstHandle2ConstXYs1d XYs1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +T_effectiveAssign(ConstHandle2T_effective self, ConstHandle2ConstT_effective from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +T_effectiveDelete(ConstHandle2ConstT_effective self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +T_effectiveRead(ConstHandle2T_effective self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +T_effectiveWrite(ConstHandle2ConstT_effective self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +T_effectivePrint(ConstHandle2ConstT_effective self); + +// +++ Print to standard output, as XML +extern_c int +T_effectivePrintXML(ConstHandle2ConstT_effective self); + +// +++ Print to standard output, as JSON +extern_c int +T_effectivePrintJSON(ConstHandle2ConstT_effective self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +T_effectiveXYs1dHas(ConstHandle2ConstT_effective self); + +// --- Get, const +extern_c Handle2ConstXYs1d +T_effectiveXYs1dGetConst(ConstHandle2ConstT_effective self); + +// +++ Get, non-const +extern_c Handle2XYs1d +T_effectiveXYs1dGet(ConstHandle2T_effective self); + +// +++ Set +extern_c void +T_effectiveXYs1dSet(ConstHandle2T_effective self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/T_effective/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_effective/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_effective/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_effective/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/T_effective/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Table.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Table.cpp new file mode 100644 index 000000000..e2fdd6c32 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Table.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Table.hpp" +#include "Table.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = TableClass; +using CPP = multigroup::Table; + +static const std::string CLASSNAME = "Table"; + +namespace extract { + static auto rows = [](auto &obj) { return &obj.rows; }; + static auto columns = [](auto &obj) { return &obj.columns; }; + static auto columnHeaders = [](auto &obj) { return &obj.columnHeaders; }; + static auto data = [](auto &obj) { return &obj.data; }; +} + +using CPPColumnHeaders = general::ColumnHeaders; +using CPPData = general::Data; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTable +TableDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Table +TableDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTable +TableCreateConst( + const int rows, + const int columns, + ConstHandle2ConstColumnHeaders columnHeaders, + ConstHandle2ConstData data +) { + ConstHandle2Table handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + rows, + columns, + detail::tocpp(columnHeaders), + detail::tocpp(data) + ); + return handle; +} + +// Create, general, non-const +Handle2Table +TableCreate( + const int rows, + const int columns, + ConstHandle2ConstColumnHeaders columnHeaders, + ConstHandle2ConstData data +) { + ConstHandle2Table handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + rows, + columns, + detail::tocpp(columnHeaders), + detail::tocpp(data) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +TableAssign(ConstHandle2Table self, ConstHandle2ConstTable from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +TableDelete(ConstHandle2ConstTable self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +TableRead(ConstHandle2Table self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +TableWrite(ConstHandle2ConstTable self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +TablePrint(ConstHandle2ConstTable self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +TablePrintXML(ConstHandle2ConstTable self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +TablePrintJSON(ConstHandle2ConstTable self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: rows +// ----------------------------------------------------------------------------- + +// Has +int +TableRowsHas(ConstHandle2ConstTable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"RowsHas", self, extract::rows); +} + +// Get +// Returns by value +int +TableRowsGet(ConstHandle2ConstTable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"RowsGet", self, extract::rows); +} + +// Set +void +TableRowsSet(ConstHandle2Table self, const int rows) +{ + detail::setField + (CLASSNAME, CLASSNAME+"RowsSet", self, extract::rows, rows); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: columns +// ----------------------------------------------------------------------------- + +// Has +int +TableColumnsHas(ConstHandle2ConstTable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ColumnsHas", self, extract::columns); +} + +// Get +// Returns by value +int +TableColumnsGet(ConstHandle2ConstTable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnsGet", self, extract::columns); +} + +// Set +void +TableColumnsSet(ConstHandle2Table self, const int columns) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ColumnsSet", self, extract::columns, columns); +} + + +// ----------------------------------------------------------------------------- +// Child: columnHeaders +// ----------------------------------------------------------------------------- + +// Has +int +TableColumnHeadersHas(ConstHandle2ConstTable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ColumnHeadersHas", self, extract::columnHeaders); +} + +// Get, const +Handle2ConstColumnHeaders +TableColumnHeadersGetConst(ConstHandle2ConstTable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnHeadersGetConst", self, extract::columnHeaders); +} + +// Get, non-const +Handle2ColumnHeaders +TableColumnHeadersGet(ConstHandle2Table self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ColumnHeadersGet", self, extract::columnHeaders); +} + +// Set +void +TableColumnHeadersSet(ConstHandle2Table self, ConstHandle2ConstColumnHeaders columnHeaders) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ColumnHeadersSet", self, extract::columnHeaders, columnHeaders); +} + + +// ----------------------------------------------------------------------------- +// Child: data +// ----------------------------------------------------------------------------- + +// Has +int +TableDataHas(ConstHandle2ConstTable self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DataHas", self, extract::data); +} + +// Get, const +Handle2ConstData +TableDataGetConst(ConstHandle2ConstTable self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DataGetConst", self, extract::data); +} + +// Get, non-const +Handle2Data +TableDataGet(ConstHandle2Table self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DataGet", self, extract::data); +} + +// Set +void +TableDataSet(ConstHandle2Table self, ConstHandle2ConstData data) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DataSet", self, extract::data, data); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Table/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Table.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Table.h new file mode 100644 index 000000000..77669c278 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Table.h @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Table is the basic handle type in this file. Example: +// // Create a default Table object: +// Table handle = TableDefault(); +// Functions involving Table are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_TABLE +#define C_INTERFACE_GNDS_V2_0_GENERAL_TABLE + +#include "GNDStk.h" +#include "v2.0/general/ColumnHeaders.h" +#include "v2.0/general/Data.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct TableClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Table +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct TableClass *Table; + +// --- Const-aware handles. +typedef const struct TableClass *const ConstHandle2ConstTable; +typedef struct TableClass *const ConstHandle2Table; +typedef const struct TableClass * Handle2ConstTable; +typedef struct TableClass * Handle2Table; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstTable +TableDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Table +TableDefault(); + +// --- Create, general, const +extern_c Handle2ConstTable +TableCreateConst( + const int rows, + const int columns, + ConstHandle2ConstColumnHeaders columnHeaders, + ConstHandle2ConstData data +); + +// +++ Create, general, non-const +extern_c Handle2Table +TableCreate( + const int rows, + const int columns, + ConstHandle2ConstColumnHeaders columnHeaders, + ConstHandle2ConstData data +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +TableAssign(ConstHandle2Table self, ConstHandle2ConstTable from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +TableDelete(ConstHandle2ConstTable self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +TableRead(ConstHandle2Table self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +TableWrite(ConstHandle2ConstTable self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +TablePrint(ConstHandle2ConstTable self); + +// +++ Print to standard output, as XML +extern_c int +TablePrintXML(ConstHandle2ConstTable self); + +// +++ Print to standard output, as JSON +extern_c int +TablePrintJSON(ConstHandle2ConstTable self); + + +// ----------------------------------------------------------------------------- +// Metadatum: rows +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TableRowsHas(ConstHandle2ConstTable self); + +// +++ Get +// +++ Returns by value +extern_c int +TableRowsGet(ConstHandle2ConstTable self); + +// +++ Set +extern_c void +TableRowsSet(ConstHandle2Table self, const int rows); + + +// ----------------------------------------------------------------------------- +// Metadatum: columns +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TableColumnsHas(ConstHandle2ConstTable self); + +// +++ Get +// +++ Returns by value +extern_c int +TableColumnsGet(ConstHandle2ConstTable self); + +// +++ Set +extern_c void +TableColumnsSet(ConstHandle2Table self, const int columns); + + +// ----------------------------------------------------------------------------- +// Child: columnHeaders +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TableColumnHeadersHas(ConstHandle2ConstTable self); + +// --- Get, const +extern_c Handle2ConstColumnHeaders +TableColumnHeadersGetConst(ConstHandle2ConstTable self); + +// +++ Get, non-const +extern_c Handle2ColumnHeaders +TableColumnHeadersGet(ConstHandle2Table self); + +// +++ Set +extern_c void +TableColumnHeadersSet(ConstHandle2Table self, ConstHandle2ConstColumnHeaders columnHeaders); + + +// ----------------------------------------------------------------------------- +// Child: data +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TableDataHas(ConstHandle2ConstTable self); + +// --- Get, const +extern_c Handle2ConstData +TableDataGetConst(ConstHandle2ConstTable self); + +// +++ Get, non-const +extern_c Handle2Data +TableDataGet(ConstHandle2Table self); + +// +++ Set +extern_c void +TableDataSet(ConstHandle2Table self, ConstHandle2ConstData data); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Table/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Table/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Table/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Table/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Table/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TabulatedWidths.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TabulatedWidths.cpp new file mode 100644 index 000000000..d497d51aa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TabulatedWidths.cpp @@ -0,0 +1,415 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/TabulatedWidths.hpp" +#include "TabulatedWidths.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = TabulatedWidthsClass; +using CPP = multigroup::TabulatedWidths; + +static const std::string CLASSNAME = "TabulatedWidths"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto approximation = [](auto &obj) { return &obj.approximation; }; + static auto useForSelfShieldingOnly = [](auto &obj) { return &obj.useForSelfShieldingOnly; }; + static auto resonanceReactions = [](auto &obj) { return &obj.resonanceReactions; }; + static auto Ls = [](auto &obj) { return &obj.Ls; }; + static auto PoPs = [](auto &obj) { return &obj.PoPs; }; + static auto scatteringRadius = [](auto &obj) { return &obj.scatteringRadius; }; +} + +using CPPResonanceReactions = general::ResonanceReactions; +using CPPLs = general::Ls; +using CPPPoPs = top::PoPs; +using CPPScatteringRadius = general::ScatteringRadius; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTabulatedWidths +TabulatedWidthsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2TabulatedWidths +TabulatedWidthsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTabulatedWidths +TabulatedWidthsCreateConst( + const char *const label, + const char *const approximation, + const bool useForSelfShieldingOnly, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstLs Ls, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstScatteringRadius scatteringRadius +) { + ConstHandle2TabulatedWidths handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + approximation, + useForSelfShieldingOnly, + detail::tocpp(resonanceReactions), + detail::tocpp(Ls), + detail::tocpp(PoPs), + detail::tocpp(scatteringRadius) + ); + return handle; +} + +// Create, general, non-const +Handle2TabulatedWidths +TabulatedWidthsCreate( + const char *const label, + const char *const approximation, + const bool useForSelfShieldingOnly, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstLs Ls, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstScatteringRadius scatteringRadius +) { + ConstHandle2TabulatedWidths handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + approximation, + useForSelfShieldingOnly, + detail::tocpp(resonanceReactions), + detail::tocpp(Ls), + detail::tocpp(PoPs), + detail::tocpp(scatteringRadius) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +TabulatedWidthsAssign(ConstHandle2TabulatedWidths self, ConstHandle2ConstTabulatedWidths from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +TabulatedWidthsDelete(ConstHandle2ConstTabulatedWidths self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +TabulatedWidthsRead(ConstHandle2TabulatedWidths self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +TabulatedWidthsWrite(ConstHandle2ConstTabulatedWidths self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +TabulatedWidthsPrint(ConstHandle2ConstTabulatedWidths self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +TabulatedWidthsPrintXML(ConstHandle2ConstTabulatedWidths self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +TabulatedWidthsPrintJSON(ConstHandle2ConstTabulatedWidths self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +TabulatedWidthsLabelHas(ConstHandle2ConstTabulatedWidths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +TabulatedWidthsLabelGet(ConstHandle2ConstTabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +TabulatedWidthsLabelSet(ConstHandle2TabulatedWidths self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: approximation +// ----------------------------------------------------------------------------- + +// Has +int +TabulatedWidthsApproximationHas(ConstHandle2ConstTabulatedWidths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ApproximationHas", self, extract::approximation); +} + +// Get +// Returns by value +const char * +TabulatedWidthsApproximationGet(ConstHandle2ConstTabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ApproximationGet", self, extract::approximation); +} + +// Set +void +TabulatedWidthsApproximationSet(ConstHandle2TabulatedWidths self, const char *const approximation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ApproximationSet", self, extract::approximation, approximation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: useForSelfShieldingOnly +// ----------------------------------------------------------------------------- + +// Has +int +TabulatedWidthsUseForSelfShieldingOnlyHas(ConstHandle2ConstTabulatedWidths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UseForSelfShieldingOnlyHas", self, extract::useForSelfShieldingOnly); +} + +// Get +// Returns by value +bool +TabulatedWidthsUseForSelfShieldingOnlyGet(ConstHandle2ConstTabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UseForSelfShieldingOnlyGet", self, extract::useForSelfShieldingOnly); +} + +// Set +void +TabulatedWidthsUseForSelfShieldingOnlySet(ConstHandle2TabulatedWidths self, const bool useForSelfShieldingOnly) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UseForSelfShieldingOnlySet", self, extract::useForSelfShieldingOnly, useForSelfShieldingOnly); +} + + +// ----------------------------------------------------------------------------- +// Child: resonanceReactions +// ----------------------------------------------------------------------------- + +// Has +int +TabulatedWidthsResonanceReactionsHas(ConstHandle2ConstTabulatedWidths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResonanceReactionsHas", self, extract::resonanceReactions); +} + +// Get, const +Handle2ConstResonanceReactions +TabulatedWidthsResonanceReactionsGetConst(ConstHandle2ConstTabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonanceReactionsGetConst", self, extract::resonanceReactions); +} + +// Get, non-const +Handle2ResonanceReactions +TabulatedWidthsResonanceReactionsGet(ConstHandle2TabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonanceReactionsGet", self, extract::resonanceReactions); +} + +// Set +void +TabulatedWidthsResonanceReactionsSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstResonanceReactions resonanceReactions) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResonanceReactionsSet", self, extract::resonanceReactions, resonanceReactions); +} + + +// ----------------------------------------------------------------------------- +// Child: Ls +// ----------------------------------------------------------------------------- + +// Has +int +TabulatedWidthsLsHas(ConstHandle2ConstTabulatedWidths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LsHas", self, extract::Ls); +} + +// Get, const +Handle2ConstLs +TabulatedWidthsLsGetConst(ConstHandle2ConstTabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LsGetConst", self, extract::Ls); +} + +// Get, non-const +Handle2Ls +TabulatedWidthsLsGet(ConstHandle2TabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LsGet", self, extract::Ls); +} + +// Set +void +TabulatedWidthsLsSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstLs Ls) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LsSet", self, extract::Ls, Ls); +} + + +// ----------------------------------------------------------------------------- +// Child: PoPs +// ----------------------------------------------------------------------------- + +// Has +int +TabulatedWidthsPoPsHas(ConstHandle2ConstTabulatedWidths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PoPsHas", self, extract::PoPs); +} + +// Get, const +Handle2ConstPoPs +TabulatedWidthsPoPsGetConst(ConstHandle2ConstTabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPsGetConst", self, extract::PoPs); +} + +// Get, non-const +Handle2PoPs +TabulatedWidthsPoPsGet(ConstHandle2TabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPsGet", self, extract::PoPs); +} + +// Set +void +TabulatedWidthsPoPsSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstPoPs PoPs) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PoPsSet", self, extract::PoPs, PoPs); +} + + +// ----------------------------------------------------------------------------- +// Child: scatteringRadius +// ----------------------------------------------------------------------------- + +// Has +int +TabulatedWidthsScatteringRadiusHas(ConstHandle2ConstTabulatedWidths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ScatteringRadiusHas", self, extract::scatteringRadius); +} + +// Get, const +Handle2ConstScatteringRadius +TabulatedWidthsScatteringRadiusGetConst(ConstHandle2ConstTabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringRadiusGetConst", self, extract::scatteringRadius); +} + +// Get, non-const +Handle2ScatteringRadius +TabulatedWidthsScatteringRadiusGet(ConstHandle2TabulatedWidths self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringRadiusGet", self, extract::scatteringRadius); +} + +// Set +void +TabulatedWidthsScatteringRadiusSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstScatteringRadius scatteringRadius) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ScatteringRadiusSet", self, extract::scatteringRadius, scatteringRadius); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/TabulatedWidths/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TabulatedWidths.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TabulatedWidths.h new file mode 100644 index 000000000..ce3d594e4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TabulatedWidths.h @@ -0,0 +1,293 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// TabulatedWidths is the basic handle type in this file. Example: +// // Create a default TabulatedWidths object: +// TabulatedWidths handle = TabulatedWidthsDefault(); +// Functions involving TabulatedWidths are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_TABULATEDWIDTHS +#define C_INTERFACE_GNDS_V2_0_GENERAL_TABULATEDWIDTHS + +#include "GNDStk.h" +#include "v2.0/general/ResonanceReactions.h" +#include "v2.0/general/Ls.h" +#include "v2.0/top/PoPs.h" +#include "v2.0/general/ScatteringRadius.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct TabulatedWidthsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ TabulatedWidths +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct TabulatedWidthsClass *TabulatedWidths; + +// --- Const-aware handles. +typedef const struct TabulatedWidthsClass *const ConstHandle2ConstTabulatedWidths; +typedef struct TabulatedWidthsClass *const ConstHandle2TabulatedWidths; +typedef const struct TabulatedWidthsClass * Handle2ConstTabulatedWidths; +typedef struct TabulatedWidthsClass * Handle2TabulatedWidths; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstTabulatedWidths +TabulatedWidthsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2TabulatedWidths +TabulatedWidthsDefault(); + +// --- Create, general, const +extern_c Handle2ConstTabulatedWidths +TabulatedWidthsCreateConst( + const char *const label, + const char *const approximation, + const bool useForSelfShieldingOnly, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstLs Ls, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstScatteringRadius scatteringRadius +); + +// +++ Create, general, non-const +extern_c Handle2TabulatedWidths +TabulatedWidthsCreate( + const char *const label, + const char *const approximation, + const bool useForSelfShieldingOnly, + ConstHandle2ConstResonanceReactions resonanceReactions, + ConstHandle2ConstLs Ls, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstScatteringRadius scatteringRadius +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +TabulatedWidthsAssign(ConstHandle2TabulatedWidths self, ConstHandle2ConstTabulatedWidths from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +TabulatedWidthsDelete(ConstHandle2ConstTabulatedWidths self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +TabulatedWidthsRead(ConstHandle2TabulatedWidths self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +TabulatedWidthsWrite(ConstHandle2ConstTabulatedWidths self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +TabulatedWidthsPrint(ConstHandle2ConstTabulatedWidths self); + +// +++ Print to standard output, as XML +extern_c int +TabulatedWidthsPrintXML(ConstHandle2ConstTabulatedWidths self); + +// +++ Print to standard output, as JSON +extern_c int +TabulatedWidthsPrintJSON(ConstHandle2ConstTabulatedWidths self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TabulatedWidthsLabelHas(ConstHandle2ConstTabulatedWidths self); + +// +++ Get +// +++ Returns by value +extern_c const char * +TabulatedWidthsLabelGet(ConstHandle2ConstTabulatedWidths self); + +// +++ Set +extern_c void +TabulatedWidthsLabelSet(ConstHandle2TabulatedWidths self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: approximation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TabulatedWidthsApproximationHas(ConstHandle2ConstTabulatedWidths self); + +// +++ Get +// +++ Returns by value +extern_c const char * +TabulatedWidthsApproximationGet(ConstHandle2ConstTabulatedWidths self); + +// +++ Set +extern_c void +TabulatedWidthsApproximationSet(ConstHandle2TabulatedWidths self, const char *const approximation); + + +// ----------------------------------------------------------------------------- +// Metadatum: useForSelfShieldingOnly +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TabulatedWidthsUseForSelfShieldingOnlyHas(ConstHandle2ConstTabulatedWidths self); + +// +++ Get +// +++ Returns by value +extern_c bool +TabulatedWidthsUseForSelfShieldingOnlyGet(ConstHandle2ConstTabulatedWidths self); + +// +++ Set +extern_c void +TabulatedWidthsUseForSelfShieldingOnlySet(ConstHandle2TabulatedWidths self, const bool useForSelfShieldingOnly); + + +// ----------------------------------------------------------------------------- +// Child: resonanceReactions +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TabulatedWidthsResonanceReactionsHas(ConstHandle2ConstTabulatedWidths self); + +// --- Get, const +extern_c Handle2ConstResonanceReactions +TabulatedWidthsResonanceReactionsGetConst(ConstHandle2ConstTabulatedWidths self); + +// +++ Get, non-const +extern_c Handle2ResonanceReactions +TabulatedWidthsResonanceReactionsGet(ConstHandle2TabulatedWidths self); + +// +++ Set +extern_c void +TabulatedWidthsResonanceReactionsSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstResonanceReactions resonanceReactions); + + +// ----------------------------------------------------------------------------- +// Child: Ls +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TabulatedWidthsLsHas(ConstHandle2ConstTabulatedWidths self); + +// --- Get, const +extern_c Handle2ConstLs +TabulatedWidthsLsGetConst(ConstHandle2ConstTabulatedWidths self); + +// +++ Get, non-const +extern_c Handle2Ls +TabulatedWidthsLsGet(ConstHandle2TabulatedWidths self); + +// +++ Set +extern_c void +TabulatedWidthsLsSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstLs Ls); + + +// ----------------------------------------------------------------------------- +// Child: PoPs +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TabulatedWidthsPoPsHas(ConstHandle2ConstTabulatedWidths self); + +// --- Get, const +extern_c Handle2ConstPoPs +TabulatedWidthsPoPsGetConst(ConstHandle2ConstTabulatedWidths self); + +// +++ Get, non-const +extern_c Handle2PoPs +TabulatedWidthsPoPsGet(ConstHandle2TabulatedWidths self); + +// +++ Set +extern_c void +TabulatedWidthsPoPsSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstPoPs PoPs); + + +// ----------------------------------------------------------------------------- +// Child: scatteringRadius +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TabulatedWidthsScatteringRadiusHas(ConstHandle2ConstTabulatedWidths self); + +// --- Get, const +extern_c Handle2ConstScatteringRadius +TabulatedWidthsScatteringRadiusGetConst(ConstHandle2ConstTabulatedWidths self); + +// +++ Get, non-const +extern_c Handle2ScatteringRadius +TabulatedWidthsScatteringRadiusGet(ConstHandle2TabulatedWidths self); + +// +++ Set +extern_c void +TabulatedWidthsScatteringRadiusSet(ConstHandle2TabulatedWidths self, ConstHandle2ConstScatteringRadius scatteringRadius); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/TabulatedWidths/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TabulatedWidths/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TabulatedWidths/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TabulatedWidths/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TabulatedWidths/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Temperature.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Temperature.cpp new file mode 100644 index 000000000..07f8c0371 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Temperature.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Temperature.hpp" +#include "Temperature.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = TemperatureClass; +using CPP = multigroup::Temperature; + +static const std::string CLASSNAME = "Temperature"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTemperature +TemperatureDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Temperature +TemperatureDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTemperature +TemperatureCreateConst( + const double value, + const char *const unit +) { + ConstHandle2Temperature handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2Temperature +TemperatureCreate( + const double value, + const char *const unit +) { + ConstHandle2Temperature handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +TemperatureAssign(ConstHandle2Temperature self, ConstHandle2ConstTemperature from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +TemperatureDelete(ConstHandle2ConstTemperature self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +TemperatureRead(ConstHandle2Temperature self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +TemperatureWrite(ConstHandle2ConstTemperature self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +TemperaturePrint(ConstHandle2ConstTemperature self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +TemperaturePrintXML(ConstHandle2ConstTemperature self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +TemperaturePrintJSON(ConstHandle2ConstTemperature self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +TemperatureValueHas(ConstHandle2ConstTemperature self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +TemperatureValueGet(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +TemperatureValueSet(ConstHandle2Temperature self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +TemperatureUnitHas(ConstHandle2ConstTemperature self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +TemperatureUnitGet(ConstHandle2ConstTemperature self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +TemperatureUnitSet(ConstHandle2Temperature self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Temperature/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Temperature.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Temperature.h new file mode 100644 index 000000000..c0b700f54 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Temperature.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Temperature is the basic handle type in this file. Example: +// // Create a default Temperature object: +// Temperature handle = TemperatureDefault(); +// Functions involving Temperature are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_TEMPERATURE +#define C_INTERFACE_GNDS_V2_0_GENERAL_TEMPERATURE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct TemperatureClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Temperature +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct TemperatureClass *Temperature; + +// --- Const-aware handles. +typedef const struct TemperatureClass *const ConstHandle2ConstTemperature; +typedef struct TemperatureClass *const ConstHandle2Temperature; +typedef const struct TemperatureClass * Handle2ConstTemperature; +typedef struct TemperatureClass * Handle2Temperature; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstTemperature +TemperatureDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Temperature +TemperatureDefault(); + +// --- Create, general, const +extern_c Handle2ConstTemperature +TemperatureCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2Temperature +TemperatureCreate( + const double value, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +TemperatureAssign(ConstHandle2Temperature self, ConstHandle2ConstTemperature from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +TemperatureDelete(ConstHandle2ConstTemperature self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +TemperatureRead(ConstHandle2Temperature self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +TemperatureWrite(ConstHandle2ConstTemperature self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +TemperaturePrint(ConstHandle2ConstTemperature self); + +// +++ Print to standard output, as XML +extern_c int +TemperaturePrintXML(ConstHandle2ConstTemperature self); + +// +++ Print to standard output, as JSON +extern_c int +TemperaturePrintJSON(ConstHandle2ConstTemperature self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureValueHas(ConstHandle2ConstTemperature self); + +// +++ Get +// +++ Returns by value +extern_c double +TemperatureValueGet(ConstHandle2ConstTemperature self); + +// +++ Set +extern_c void +TemperatureValueSet(ConstHandle2Temperature self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TemperatureUnitHas(ConstHandle2ConstTemperature self); + +// +++ Get +// +++ Returns by value +extern_c const char * +TemperatureUnitGet(ConstHandle2ConstTemperature self); + +// +++ Set +extern_c void +TemperatureUnitSet(ConstHandle2Temperature self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Temperature/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Temperature/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Temperature/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Temperature/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Temperature/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw.cpp new file mode 100644 index 000000000..9ef8a9623 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw.hpp" +#include "ThermalNeutronScatteringLaw.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ThermalNeutronScatteringLawClass; +using CPP = multigroup::ThermalNeutronScatteringLaw; + +static const std::string CLASSNAME = "ThermalNeutronScatteringLaw"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstThermalNeutronScatteringLaw +ThermalNeutronScatteringLawDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ThermalNeutronScatteringLaw +ThermalNeutronScatteringLawDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstThermalNeutronScatteringLaw +ThermalNeutronScatteringLawCreateConst( + const char *const label, + const char *const href +) { + ConstHandle2ThermalNeutronScatteringLaw handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href + ); + return handle; +} + +// Create, general, non-const +Handle2ThermalNeutronScatteringLaw +ThermalNeutronScatteringLawCreate( + const char *const label, + const char *const href +) { + ConstHandle2ThermalNeutronScatteringLaw handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + href + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ThermalNeutronScatteringLawAssign(ConstHandle2ThermalNeutronScatteringLaw self, ConstHandle2ConstThermalNeutronScatteringLaw from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ThermalNeutronScatteringLawDelete(ConstHandle2ConstThermalNeutronScatteringLaw self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ThermalNeutronScatteringLawRead(ConstHandle2ThermalNeutronScatteringLaw self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ThermalNeutronScatteringLawWrite(ConstHandle2ConstThermalNeutronScatteringLaw self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ThermalNeutronScatteringLawPrint(ConstHandle2ConstThermalNeutronScatteringLaw self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ThermalNeutronScatteringLawPrintXML(ConstHandle2ConstThermalNeutronScatteringLaw self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ThermalNeutronScatteringLawPrintJSON(ConstHandle2ConstThermalNeutronScatteringLaw self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLawLabelHas(ConstHandle2ConstThermalNeutronScatteringLaw self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLawLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ThermalNeutronScatteringLawLabelSet(ConstHandle2ThermalNeutronScatteringLaw self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLawHrefHas(ConstHandle2ConstThermalNeutronScatteringLaw self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLawHrefGet(ConstHandle2ConstThermalNeutronScatteringLaw self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ThermalNeutronScatteringLawHrefSet(ConstHandle2ThermalNeutronScatteringLaw self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ThermalNeutronScatteringLaw/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw.h new file mode 100644 index 000000000..bf0f956da --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ThermalNeutronScatteringLaw is the basic handle type in this file. Example: +// // Create a default ThermalNeutronScatteringLaw object: +// ThermalNeutronScatteringLaw handle = ThermalNeutronScatteringLawDefault(); +// Functions involving ThermalNeutronScatteringLaw are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW +#define C_INTERFACE_GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ThermalNeutronScatteringLawClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ThermalNeutronScatteringLaw +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ThermalNeutronScatteringLawClass *ThermalNeutronScatteringLaw; + +// --- Const-aware handles. +typedef const struct ThermalNeutronScatteringLawClass *const ConstHandle2ConstThermalNeutronScatteringLaw; +typedef struct ThermalNeutronScatteringLawClass *const ConstHandle2ThermalNeutronScatteringLaw; +typedef const struct ThermalNeutronScatteringLawClass * Handle2ConstThermalNeutronScatteringLaw; +typedef struct ThermalNeutronScatteringLawClass * Handle2ThermalNeutronScatteringLaw; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstThermalNeutronScatteringLaw +ThermalNeutronScatteringLawDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ThermalNeutronScatteringLaw +ThermalNeutronScatteringLawDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw +ThermalNeutronScatteringLawCreateConst( + const char *const label, + const char *const href +); + +// +++ Create, general, non-const +extern_c Handle2ThermalNeutronScatteringLaw +ThermalNeutronScatteringLawCreate( + const char *const label, + const char *const href +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ThermalNeutronScatteringLawAssign(ConstHandle2ThermalNeutronScatteringLaw self, ConstHandle2ConstThermalNeutronScatteringLaw from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ThermalNeutronScatteringLawDelete(ConstHandle2ConstThermalNeutronScatteringLaw self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ThermalNeutronScatteringLawRead(ConstHandle2ThermalNeutronScatteringLaw self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ThermalNeutronScatteringLawWrite(ConstHandle2ConstThermalNeutronScatteringLaw self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ThermalNeutronScatteringLawPrint(ConstHandle2ConstThermalNeutronScatteringLaw self); + +// +++ Print to standard output, as XML +extern_c int +ThermalNeutronScatteringLawPrintXML(ConstHandle2ConstThermalNeutronScatteringLaw self); + +// +++ Print to standard output, as JSON +extern_c int +ThermalNeutronScatteringLawPrintJSON(ConstHandle2ConstThermalNeutronScatteringLaw self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLawLabelHas(ConstHandle2ConstThermalNeutronScatteringLaw self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLawLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLawLabelSet(ConstHandle2ThermalNeutronScatteringLaw self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLawHrefHas(ConstHandle2ConstThermalNeutronScatteringLaw self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLawHrefGet(ConstHandle2ConstThermalNeutronScatteringLaw self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLawHrefSet(ConstHandle2ThermalNeutronScatteringLaw self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ThermalNeutronScatteringLaw/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw1d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw1d.cpp new file mode 100644 index 000000000..ca79b7009 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw1d.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw1d.hpp" +#include "ThermalNeutronScatteringLaw1d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ThermalNeutronScatteringLaw1dClass; +using CPP = multigroup::ThermalNeutronScatteringLaw1d; + +static const std::string CLASSNAME = "ThermalNeutronScatteringLaw1d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dCreateConst( + const char *const label, + const char *const href +) { + ConstHandle2ThermalNeutronScatteringLaw1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + href + ); + return handle; +} + +// Create, general, non-const +Handle2ThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dCreate( + const char *const label, + const char *const href +) { + ConstHandle2ThermalNeutronScatteringLaw1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + href + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ThermalNeutronScatteringLaw1dAssign(ConstHandle2ThermalNeutronScatteringLaw1d self, ConstHandle2ConstThermalNeutronScatteringLaw1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ThermalNeutronScatteringLaw1dDelete(ConstHandle2ConstThermalNeutronScatteringLaw1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ThermalNeutronScatteringLaw1dRead(ConstHandle2ThermalNeutronScatteringLaw1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ThermalNeutronScatteringLaw1dWrite(ConstHandle2ConstThermalNeutronScatteringLaw1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ThermalNeutronScatteringLaw1dPrint(ConstHandle2ConstThermalNeutronScatteringLaw1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ThermalNeutronScatteringLaw1dPrintXML(ConstHandle2ConstThermalNeutronScatteringLaw1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ThermalNeutronScatteringLaw1dPrintJSON(ConstHandle2ConstThermalNeutronScatteringLaw1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw1dLabelHas(ConstHandle2ConstThermalNeutronScatteringLaw1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw1dLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ThermalNeutronScatteringLaw1dLabelSet(ConstHandle2ThermalNeutronScatteringLaw1d self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw1dHrefHas(ConstHandle2ConstThermalNeutronScatteringLaw1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw1dHrefGet(ConstHandle2ConstThermalNeutronScatteringLaw1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +ThermalNeutronScatteringLaw1dHrefSet(ConstHandle2ThermalNeutronScatteringLaw1d self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw1d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw1d.h new file mode 100644 index 000000000..2ce063de7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw1d.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ThermalNeutronScatteringLaw1d is the basic handle type in this file. Example: +// // Create a default ThermalNeutronScatteringLaw1d object: +// ThermalNeutronScatteringLaw1d handle = ThermalNeutronScatteringLaw1dDefault(); +// Functions involving ThermalNeutronScatteringLaw1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW1D +#define C_INTERFACE_GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW1D + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ThermalNeutronScatteringLaw1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ThermalNeutronScatteringLaw1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ThermalNeutronScatteringLaw1dClass *ThermalNeutronScatteringLaw1d; + +// --- Const-aware handles. +typedef const struct ThermalNeutronScatteringLaw1dClass *const ConstHandle2ConstThermalNeutronScatteringLaw1d; +typedef struct ThermalNeutronScatteringLaw1dClass *const ConstHandle2ThermalNeutronScatteringLaw1d; +typedef const struct ThermalNeutronScatteringLaw1dClass * Handle2ConstThermalNeutronScatteringLaw1d; +typedef struct ThermalNeutronScatteringLaw1dClass * Handle2ThermalNeutronScatteringLaw1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dCreateConst( + const char *const label, + const char *const href +); + +// +++ Create, general, non-const +extern_c Handle2ThermalNeutronScatteringLaw1d +ThermalNeutronScatteringLaw1dCreate( + const char *const label, + const char *const href +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ThermalNeutronScatteringLaw1dAssign(ConstHandle2ThermalNeutronScatteringLaw1d self, ConstHandle2ConstThermalNeutronScatteringLaw1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ThermalNeutronScatteringLaw1dDelete(ConstHandle2ConstThermalNeutronScatteringLaw1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ThermalNeutronScatteringLaw1dRead(ConstHandle2ThermalNeutronScatteringLaw1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ThermalNeutronScatteringLaw1dWrite(ConstHandle2ConstThermalNeutronScatteringLaw1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ThermalNeutronScatteringLaw1dPrint(ConstHandle2ConstThermalNeutronScatteringLaw1d self); + +// +++ Print to standard output, as XML +extern_c int +ThermalNeutronScatteringLaw1dPrintXML(ConstHandle2ConstThermalNeutronScatteringLaw1d self); + +// +++ Print to standard output, as JSON +extern_c int +ThermalNeutronScatteringLaw1dPrintJSON(ConstHandle2ConstThermalNeutronScatteringLaw1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw1dLabelHas(ConstHandle2ConstThermalNeutronScatteringLaw1d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw1dLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw1d self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw1dLabelSet(ConstHandle2ThermalNeutronScatteringLaw1d self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw1dHrefHas(ConstHandle2ConstThermalNeutronScatteringLaw1d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw1dHrefGet(ConstHandle2ConstThermalNeutronScatteringLaw1d self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw1dHrefSet(ConstHandle2ThermalNeutronScatteringLaw1d self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.cpp new file mode 100644 index 000000000..d768d8175 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "ThermalNeutronScatteringLaw_coherentElastic.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ThermalNeutronScatteringLaw_coherentElasticClass; +using CPP = multigroup::ThermalNeutronScatteringLaw_coherentElastic; + +static const std::string CLASSNAME = "ThermalNeutronScatteringLaw_coherentElastic"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto pid = [](auto &obj) { return &obj.pid; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto S_table = [](auto &obj) { return &obj.S_table; }; +} + +using CPPS_table = general::S_table; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticCreateConst( + const char *const label, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstS_table S_table +) { + ConstHandle2ThermalNeutronScatteringLaw_coherentElastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + pid, + productFrame, + detail::tocpp(S_table) + ); + return handle; +} + +// Create, general, non-const +Handle2ThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticCreate( + const char *const label, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstS_table S_table +) { + ConstHandle2ThermalNeutronScatteringLaw_coherentElastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + pid, + productFrame, + detail::tocpp(S_table) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ThermalNeutronScatteringLaw_coherentElasticAssign(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ThermalNeutronScatteringLaw_coherentElasticDelete(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ThermalNeutronScatteringLaw_coherentElasticRead(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ThermalNeutronScatteringLaw_coherentElasticWrite(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ThermalNeutronScatteringLaw_coherentElasticPrint(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ThermalNeutronScatteringLaw_coherentElasticPrintXML(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ThermalNeutronScatteringLaw_coherentElasticPrintJSON(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_coherentElasticLabelHas(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw_coherentElasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ThermalNeutronScatteringLaw_coherentElasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_coherentElasticPidHas(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw_coherentElasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ThermalNeutronScatteringLaw_coherentElasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_coherentElasticProductFrameHas(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw_coherentElasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +ThermalNeutronScatteringLaw_coherentElasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: S_table +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_coherentElasticS_tableHas(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"S_tableHas", self, extract::S_table); +} + +// Get, const +Handle2ConstS_table +ThermalNeutronScatteringLaw_coherentElasticS_tableGetConst(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"S_tableGetConst", self, extract::S_table); +} + +// Get, non-const +Handle2S_table +ThermalNeutronScatteringLaw_coherentElasticS_tableGet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"S_tableGet", self, extract::S_table); +} + +// Set +void +ThermalNeutronScatteringLaw_coherentElasticS_tableSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, ConstHandle2ConstS_table S_table) +{ + detail::setField + (CLASSNAME, CLASSNAME+"S_tableSet", self, extract::S_table, S_table); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.h new file mode 100644 index 000000000..61d8cf6cf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ThermalNeutronScatteringLaw_coherentElastic is the basic handle type in this file. Example: +// // Create a default ThermalNeutronScatteringLaw_coherentElastic object: +// ThermalNeutronScatteringLaw_coherentElastic handle = ThermalNeutronScatteringLaw_coherentElasticDefault(); +// Functions involving ThermalNeutronScatteringLaw_coherentElastic are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_COHERENTELASTIC +#define C_INTERFACE_GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_COHERENTELASTIC + +#include "GNDStk.h" +#include "v2.0/general/S_table.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ThermalNeutronScatteringLaw_coherentElasticClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ThermalNeutronScatteringLaw_coherentElastic +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ThermalNeutronScatteringLaw_coherentElasticClass *ThermalNeutronScatteringLaw_coherentElastic; + +// --- Const-aware handles. +typedef const struct ThermalNeutronScatteringLaw_coherentElasticClass *const ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic; +typedef struct ThermalNeutronScatteringLaw_coherentElasticClass *const ConstHandle2ThermalNeutronScatteringLaw_coherentElastic; +typedef const struct ThermalNeutronScatteringLaw_coherentElasticClass * Handle2ConstThermalNeutronScatteringLaw_coherentElastic; +typedef struct ThermalNeutronScatteringLaw_coherentElasticClass * Handle2ThermalNeutronScatteringLaw_coherentElastic; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticCreateConst( + const char *const label, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstS_table S_table +); + +// +++ Create, general, non-const +extern_c Handle2ThermalNeutronScatteringLaw_coherentElastic +ThermalNeutronScatteringLaw_coherentElasticCreate( + const char *const label, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstS_table S_table +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ThermalNeutronScatteringLaw_coherentElasticAssign(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ThermalNeutronScatteringLaw_coherentElasticDelete(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ThermalNeutronScatteringLaw_coherentElasticRead(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ThermalNeutronScatteringLaw_coherentElasticWrite(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ThermalNeutronScatteringLaw_coherentElasticPrint(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Print to standard output, as XML +extern_c int +ThermalNeutronScatteringLaw_coherentElasticPrintXML(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Print to standard output, as JSON +extern_c int +ThermalNeutronScatteringLaw_coherentElasticPrintJSON(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_coherentElasticLabelHas(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw_coherentElasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_coherentElasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_coherentElasticPidHas(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw_coherentElasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_coherentElasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_coherentElasticProductFrameHas(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw_coherentElasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_coherentElasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Child: S_table +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_coherentElasticS_tableHas(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// --- Get, const +extern_c Handle2ConstS_table +ThermalNeutronScatteringLaw_coherentElasticS_tableGetConst(ConstHandle2ConstThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Get, non-const +extern_c Handle2S_table +ThermalNeutronScatteringLaw_coherentElasticS_tableGet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_coherentElasticS_tableSet(ConstHandle2ThermalNeutronScatteringLaw_coherentElastic self, ConstHandle2ConstS_table S_table); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.cpp new file mode 100644 index 000000000..30142dc65 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.cpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "ThermalNeutronScatteringLaw_incoherentElastic.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ThermalNeutronScatteringLaw_incoherentElasticClass; +using CPP = multigroup::ThermalNeutronScatteringLaw_incoherentElastic; + +static const std::string CLASSNAME = "ThermalNeutronScatteringLaw_incoherentElastic"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto pid = [](auto &obj) { return &obj.pid; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto boundAtomCrossSection = [](auto &obj) { return &obj.boundAtomCrossSection; }; + static auto DebyeWallerIntegral = [](auto &obj) { return &obj.DebyeWallerIntegral; }; +} + +using CPPBoundAtomCrossSection = general::BoundAtomCrossSection; +using CPPDebyeWallerIntegral = general::DebyeWallerIntegral; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticCreateConst( + const char *const label, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstDebyeWallerIntegral DebyeWallerIntegral +) { + ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + pid, + productFrame, + detail::tocpp(boundAtomCrossSection), + detail::tocpp(DebyeWallerIntegral) + ); + return handle; +} + +// Create, general, non-const +Handle2ThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticCreate( + const char *const label, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstDebyeWallerIntegral DebyeWallerIntegral +) { + ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + pid, + productFrame, + detail::tocpp(boundAtomCrossSection), + detail::tocpp(DebyeWallerIntegral) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ThermalNeutronScatteringLaw_incoherentElasticAssign(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ThermalNeutronScatteringLaw_incoherentElasticDelete(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ThermalNeutronScatteringLaw_incoherentElasticRead(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ThermalNeutronScatteringLaw_incoherentElasticWrite(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ThermalNeutronScatteringLaw_incoherentElasticPrint(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ThermalNeutronScatteringLaw_incoherentElasticPrintXML(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ThermalNeutronScatteringLaw_incoherentElasticPrintJSON(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentElasticLabelHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw_incoherentElasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentElasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentElasticPidHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw_incoherentElasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentElasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentElasticProductFrameHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw_incoherentElasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentElasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: boundAtomCrossSection +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BoundAtomCrossSectionHas", self, extract::boundAtomCrossSection); +} + +// Get, const +Handle2ConstBoundAtomCrossSection +ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGetConst(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BoundAtomCrossSectionGetConst", self, extract::boundAtomCrossSection); +} + +// Get, non-const +Handle2BoundAtomCrossSection +ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BoundAtomCrossSectionGet", self, extract::boundAtomCrossSection); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BoundAtomCrossSectionSet", self, extract::boundAtomCrossSection, boundAtomCrossSection); +} + + +// ----------------------------------------------------------------------------- +// Child: DebyeWallerIntegral +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DebyeWallerIntegralHas", self, extract::DebyeWallerIntegral); +} + +// Get, const +Handle2ConstDebyeWallerIntegral +ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGetConst(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DebyeWallerIntegralGetConst", self, extract::DebyeWallerIntegral); +} + +// Get, non-const +Handle2DebyeWallerIntegral +ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DebyeWallerIntegralGet", self, extract::DebyeWallerIntegral); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, ConstHandle2ConstDebyeWallerIntegral DebyeWallerIntegral) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DebyeWallerIntegralSet", self, extract::DebyeWallerIntegral, DebyeWallerIntegral); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.h new file mode 100644 index 000000000..13b6d2187 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.h @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ThermalNeutronScatteringLaw_incoherentElastic is the basic handle type in this file. Example: +// // Create a default ThermalNeutronScatteringLaw_incoherentElastic object: +// ThermalNeutronScatteringLaw_incoherentElastic handle = ThermalNeutronScatteringLaw_incoherentElasticDefault(); +// Functions involving ThermalNeutronScatteringLaw_incoherentElastic are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTELASTIC +#define C_INTERFACE_GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTELASTIC + +#include "GNDStk.h" +#include "v2.0/general/BoundAtomCrossSection.h" +#include "v2.0/general/DebyeWallerIntegral.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ThermalNeutronScatteringLaw_incoherentElasticClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ThermalNeutronScatteringLaw_incoherentElastic +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ThermalNeutronScatteringLaw_incoherentElasticClass *ThermalNeutronScatteringLaw_incoherentElastic; + +// --- Const-aware handles. +typedef const struct ThermalNeutronScatteringLaw_incoherentElasticClass *const ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic; +typedef struct ThermalNeutronScatteringLaw_incoherentElasticClass *const ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic; +typedef const struct ThermalNeutronScatteringLaw_incoherentElasticClass * Handle2ConstThermalNeutronScatteringLaw_incoherentElastic; +typedef struct ThermalNeutronScatteringLaw_incoherentElasticClass * Handle2ThermalNeutronScatteringLaw_incoherentElastic; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticCreateConst( + const char *const label, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstDebyeWallerIntegral DebyeWallerIntegral +); + +// +++ Create, general, non-const +extern_c Handle2ThermalNeutronScatteringLaw_incoherentElastic +ThermalNeutronScatteringLaw_incoherentElasticCreate( + const char *const label, + const char *const pid, + const char *const productFrame, + ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection, + ConstHandle2ConstDebyeWallerIntegral DebyeWallerIntegral +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ThermalNeutronScatteringLaw_incoherentElasticAssign(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ThermalNeutronScatteringLaw_incoherentElasticDelete(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticRead(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticWrite(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticPrint(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Print to standard output, as XML +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticPrintXML(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Print to standard output, as JSON +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticPrintJSON(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticLabelHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw_incoherentElasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentElasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticPidHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw_incoherentElasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentElasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticProductFrameHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw_incoherentElasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentElasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Child: boundAtomCrossSection +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// --- Get, const +extern_c Handle2ConstBoundAtomCrossSection +ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGetConst(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Get, non-const +extern_c Handle2BoundAtomCrossSection +ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, ConstHandle2ConstBoundAtomCrossSection boundAtomCrossSection); + + +// ----------------------------------------------------------------------------- +// Child: DebyeWallerIntegral +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// --- Get, const +extern_c Handle2ConstDebyeWallerIntegral +ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGetConst(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Get, non-const +extern_c Handle2DebyeWallerIntegral +ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentElastic self, ConstHandle2ConstDebyeWallerIntegral DebyeWallerIntegral); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.cpp new file mode 100644 index 000000000..27f568c35 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.cpp @@ -0,0 +1,356 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" +#include "ThermalNeutronScatteringLaw_incoherentInelastic.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ThermalNeutronScatteringLaw_incoherentInelasticClass; +using CPP = multigroup::ThermalNeutronScatteringLaw_incoherentInelastic; + +static const std::string CLASSNAME = "ThermalNeutronScatteringLaw_incoherentInelastic"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto pid = [](auto &obj) { return &obj.pid; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto primaryScatterer = [](auto &obj) { return &obj.primaryScatterer; }; + static auto calculatedAtThermal = [](auto &obj) { return &obj.calculatedAtThermal; }; + static auto scatteringAtoms = [](auto &obj) { return &obj.scatteringAtoms; }; +} + +using CPPScatteringAtoms = general::ScatteringAtoms; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticCreateConst( + const char *const label, + const char *const pid, + const char *const productFrame, + const char *const primaryScatterer, + const bool calculatedAtThermal, + ConstHandle2ConstScatteringAtoms scatteringAtoms +) { + ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + pid, + productFrame, + primaryScatterer, + calculatedAtThermal, + detail::tocpp(scatteringAtoms) + ); + return handle; +} + +// Create, general, non-const +Handle2ThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticCreate( + const char *const label, + const char *const pid, + const char *const productFrame, + const char *const primaryScatterer, + const bool calculatedAtThermal, + ConstHandle2ConstScatteringAtoms scatteringAtoms +) { + ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + pid, + productFrame, + primaryScatterer, + calculatedAtThermal, + detail::tocpp(scatteringAtoms) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ThermalNeutronScatteringLaw_incoherentInelasticAssign(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ThermalNeutronScatteringLaw_incoherentInelasticDelete(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ThermalNeutronScatteringLaw_incoherentInelasticRead(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ThermalNeutronScatteringLaw_incoherentInelasticWrite(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ThermalNeutronScatteringLaw_incoherentInelasticPrint(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ThermalNeutronScatteringLaw_incoherentInelasticPrintXML(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ThermalNeutronScatteringLaw_incoherentInelasticPrintJSON(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentInelasticLabelHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw_incoherentInelasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentInelasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentInelasticPidHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw_incoherentInelasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentInelasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentInelasticProductFrameHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw_incoherentInelasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentInelasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: primaryScatterer +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PrimaryScattererHas", self, extract::primaryScatterer); +} + +// Get +// Returns by value +const char * +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PrimaryScattererGet", self, extract::primaryScatterer); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const char *const primaryScatterer) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PrimaryScattererSet", self, extract::primaryScatterer, primaryScatterer); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: calculatedAtThermal +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CalculatedAtThermalHas", self, extract::calculatedAtThermal); +} + +// Get +// Returns by value +bool +ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CalculatedAtThermalGet", self, extract::calculatedAtThermal); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const bool calculatedAtThermal) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CalculatedAtThermalSet", self, extract::calculatedAtThermal, calculatedAtThermal); +} + + +// ----------------------------------------------------------------------------- +// Child: scatteringAtoms +// ----------------------------------------------------------------------------- + +// Has +int +ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ScatteringAtomsHas", self, extract::scatteringAtoms); +} + +// Get, const +Handle2ConstScatteringAtoms +ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGetConst(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringAtomsGetConst", self, extract::scatteringAtoms); +} + +// Get, non-const +Handle2ScatteringAtoms +ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ScatteringAtomsGet", self, extract::scatteringAtoms); +} + +// Set +void +ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, ConstHandle2ConstScatteringAtoms scatteringAtoms) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ScatteringAtomsSet", self, extract::scatteringAtoms, scatteringAtoms); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.h new file mode 100644 index 000000000..07fbc6631 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.h @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ThermalNeutronScatteringLaw_incoherentInelastic is the basic handle type in this file. Example: +// // Create a default ThermalNeutronScatteringLaw_incoherentInelastic object: +// ThermalNeutronScatteringLaw_incoherentInelastic handle = ThermalNeutronScatteringLaw_incoherentInelasticDefault(); +// Functions involving ThermalNeutronScatteringLaw_incoherentInelastic are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTINELASTIC +#define C_INTERFACE_GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTINELASTIC + +#include "GNDStk.h" +#include "v2.0/general/ScatteringAtoms.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ThermalNeutronScatteringLaw_incoherentInelasticClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ThermalNeutronScatteringLaw_incoherentInelastic +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ThermalNeutronScatteringLaw_incoherentInelasticClass *ThermalNeutronScatteringLaw_incoherentInelastic; + +// --- Const-aware handles. +typedef const struct ThermalNeutronScatteringLaw_incoherentInelasticClass *const ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic; +typedef struct ThermalNeutronScatteringLaw_incoherentInelasticClass *const ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic; +typedef const struct ThermalNeutronScatteringLaw_incoherentInelasticClass * Handle2ConstThermalNeutronScatteringLaw_incoherentInelastic; +typedef struct ThermalNeutronScatteringLaw_incoherentInelasticClass * Handle2ThermalNeutronScatteringLaw_incoherentInelastic; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticDefault(); + +// --- Create, general, const +extern_c Handle2ConstThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticCreateConst( + const char *const label, + const char *const pid, + const char *const productFrame, + const char *const primaryScatterer, + const bool calculatedAtThermal, + ConstHandle2ConstScatteringAtoms scatteringAtoms +); + +// +++ Create, general, non-const +extern_c Handle2ThermalNeutronScatteringLaw_incoherentInelastic +ThermalNeutronScatteringLaw_incoherentInelasticCreate( + const char *const label, + const char *const pid, + const char *const productFrame, + const char *const primaryScatterer, + const bool calculatedAtThermal, + ConstHandle2ConstScatteringAtoms scatteringAtoms +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticAssign(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticDelete(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticRead(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticWrite(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticPrint(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Print to standard output, as XML +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticPrintXML(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Print to standard output, as JSON +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticPrintJSON(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticLabelHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw_incoherentInelasticLabelGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticLabelSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticPidHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw_incoherentInelasticPidGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticPidSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticProductFrameHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw_incoherentInelasticProductFrameGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticProductFrameSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Metadatum: primaryScatterer +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const char *const primaryScatterer); + + +// ----------------------------------------------------------------------------- +// Metadatum: calculatedAtThermal +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Get +// +++ Returns by value +extern_c bool +ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalGet(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, const bool calculatedAtThermal); + + +// ----------------------------------------------------------------------------- +// Child: scatteringAtoms +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsHas(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// --- Get, const +extern_c Handle2ConstScatteringAtoms +ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGetConst(ConstHandle2ConstThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Get, non-const +extern_c Handle2ScatteringAtoms +ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self); + +// +++ Set +extern_c void +ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsSet(ConstHandle2ThermalNeutronScatteringLaw_incoherentInelastic self, ConstHandle2ConstScatteringAtoms scatteringAtoms); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Theta.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Theta.cpp new file mode 100644 index 000000000..364de0d15 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Theta.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Theta.hpp" +#include "Theta.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ThetaClass; +using CPP = multigroup::Theta; + +static const std::string CLASSNAME = "Theta"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = general::XYs1d; +using CPPRegions1d = general::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTheta +ThetaDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Theta +ThetaDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTheta +ThetaCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2Theta handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general, non-const +Handle2Theta +ThetaCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2Theta handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ThetaAssign(ConstHandle2Theta self, ConstHandle2ConstTheta from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ThetaDelete(ConstHandle2ConstTheta self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ThetaRead(ConstHandle2Theta self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ThetaWrite(ConstHandle2ConstTheta self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ThetaPrint(ConstHandle2ConstTheta self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ThetaPrintXML(ConstHandle2ConstTheta self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ThetaPrintJSON(ConstHandle2ConstTheta self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +ThetaXYs1dHas(ConstHandle2ConstTheta self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +ThetaXYs1dGetConst(ConstHandle2ConstTheta self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +ThetaXYs1dGet(ConstHandle2Theta self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +ThetaXYs1dSet(ConstHandle2Theta self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +ThetaRegions1dHas(ConstHandle2ConstTheta self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +ThetaRegions1dGetConst(ConstHandle2ConstTheta self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +ThetaRegions1dGet(ConstHandle2Theta self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +ThetaRegions1dSet(ConstHandle2Theta self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Theta/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Theta.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Theta.h new file mode 100644 index 000000000..4bb551a4f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Theta.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Theta is the basic handle type in this file. Example: +// // Create a default Theta object: +// Theta handle = ThetaDefault(); +// Functions involving Theta are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_THETA +#define C_INTERFACE_GNDS_V2_0_GENERAL_THETA + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/Regions1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ThetaClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Theta +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ThetaClass *Theta; + +// --- Const-aware handles. +typedef const struct ThetaClass *const ConstHandle2ConstTheta; +typedef struct ThetaClass *const ConstHandle2Theta; +typedef const struct ThetaClass * Handle2ConstTheta; +typedef struct ThetaClass * Handle2Theta; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstTheta +ThetaDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Theta +ThetaDefault(); + +// --- Create, general, const +extern_c Handle2ConstTheta +ThetaCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general, non-const +extern_c Handle2Theta +ThetaCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ThetaAssign(ConstHandle2Theta self, ConstHandle2ConstTheta from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ThetaDelete(ConstHandle2ConstTheta self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ThetaRead(ConstHandle2Theta self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ThetaWrite(ConstHandle2ConstTheta self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ThetaPrint(ConstHandle2ConstTheta self); + +// +++ Print to standard output, as XML +extern_c int +ThetaPrintXML(ConstHandle2ConstTheta self); + +// +++ Print to standard output, as JSON +extern_c int +ThetaPrintJSON(ConstHandle2ConstTheta self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThetaXYs1dHas(ConstHandle2ConstTheta self); + +// --- Get, const +extern_c Handle2ConstXYs1d +ThetaXYs1dGetConst(ConstHandle2ConstTheta self); + +// +++ Get, non-const +extern_c Handle2XYs1d +ThetaXYs1dGet(ConstHandle2Theta self); + +// +++ Set +extern_c void +ThetaXYs1dSet(ConstHandle2Theta self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ThetaRegions1dHas(ConstHandle2ConstTheta self); + +// --- Get, const +extern_c Handle2ConstRegions1d +ThetaRegions1dGetConst(ConstHandle2ConstTheta self); + +// +++ Get, non-const +extern_c Handle2Regions1d +ThetaRegions1dGet(ConstHandle2Theta self); + +// +++ Set +extern_c void +ThetaRegions1dSet(ConstHandle2Theta self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Theta/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Theta/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Theta/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Theta/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Theta/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Time.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Time.cpp new file mode 100644 index 000000000..34b1bef62 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Time.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Time.hpp" +#include "Time.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = TimeClass; +using CPP = multigroup::Time; + +static const std::string CLASSNAME = "Time"; + +namespace extract { + static auto Double = [](auto &obj) { return &obj.Double; }; + static auto string = [](auto &obj) { return &obj.string; }; +} + +using CPPDouble = general::Double; +using CPPString = general::String; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTime +TimeDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Time +TimeDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTime +TimeCreateConst( + ConstHandle2ConstDouble Double, + ConstHandle2ConstString string +) { + ConstHandle2Time handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(Double), + detail::tocpp(string) + ); + return handle; +} + +// Create, general, non-const +Handle2Time +TimeCreate( + ConstHandle2ConstDouble Double, + ConstHandle2ConstString string +) { + ConstHandle2Time handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(Double), + detail::tocpp(string) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +TimeAssign(ConstHandle2Time self, ConstHandle2ConstTime from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +TimeDelete(ConstHandle2ConstTime self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +TimeRead(ConstHandle2Time self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +TimeWrite(ConstHandle2ConstTime self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +TimePrint(ConstHandle2ConstTime self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +TimePrintXML(ConstHandle2ConstTime self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +TimePrintJSON(ConstHandle2ConstTime self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// Has +int +TimeDoubleHas(ConstHandle2ConstTime self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DoubleHas", self, extract::Double); +} + +// Get, const +Handle2ConstDouble +TimeDoubleGetConst(ConstHandle2ConstTime self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGetConst", self, extract::Double); +} + +// Get, non-const +Handle2Double +TimeDoubleGet(ConstHandle2Time self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DoubleGet", self, extract::Double); +} + +// Set +void +TimeDoubleSet(ConstHandle2Time self, ConstHandle2ConstDouble Double) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DoubleSet", self, extract::Double, Double); +} + + +// ----------------------------------------------------------------------------- +// Child: string +// ----------------------------------------------------------------------------- + +// Has +int +TimeStringHas(ConstHandle2ConstTime self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StringHas", self, extract::string); +} + +// Get, const +Handle2ConstString +TimeStringGetConst(ConstHandle2ConstTime self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StringGetConst", self, extract::string); +} + +// Get, non-const +Handle2String +TimeStringGet(ConstHandle2Time self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StringGet", self, extract::string); +} + +// Set +void +TimeStringSet(ConstHandle2Time self, ConstHandle2ConstString string) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StringSet", self, extract::string, string); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Time/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Time.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Time.h new file mode 100644 index 000000000..bebf265c5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Time.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Time is the basic handle type in this file. Example: +// // Create a default Time object: +// Time handle = TimeDefault(); +// Functions involving Time are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_TIME +#define C_INTERFACE_GNDS_V2_0_GENERAL_TIME + +#include "GNDStk.h" +#include "v2.0/general/Double.h" +#include "v2.0/general/String.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct TimeClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Time +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct TimeClass *Time; + +// --- Const-aware handles. +typedef const struct TimeClass *const ConstHandle2ConstTime; +typedef struct TimeClass *const ConstHandle2Time; +typedef const struct TimeClass * Handle2ConstTime; +typedef struct TimeClass * Handle2Time; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstTime +TimeDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Time +TimeDefault(); + +// --- Create, general, const +extern_c Handle2ConstTime +TimeCreateConst( + ConstHandle2ConstDouble Double, + ConstHandle2ConstString string +); + +// +++ Create, general, non-const +extern_c Handle2Time +TimeCreate( + ConstHandle2ConstDouble Double, + ConstHandle2ConstString string +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +TimeAssign(ConstHandle2Time self, ConstHandle2ConstTime from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +TimeDelete(ConstHandle2ConstTime self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +TimeRead(ConstHandle2Time self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +TimeWrite(ConstHandle2ConstTime self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +TimePrint(ConstHandle2ConstTime self); + +// +++ Print to standard output, as XML +extern_c int +TimePrintXML(ConstHandle2ConstTime self); + +// +++ Print to standard output, as JSON +extern_c int +TimePrintJSON(ConstHandle2ConstTime self); + + +// ----------------------------------------------------------------------------- +// Child: Double +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TimeDoubleHas(ConstHandle2ConstTime self); + +// --- Get, const +extern_c Handle2ConstDouble +TimeDoubleGetConst(ConstHandle2ConstTime self); + +// +++ Get, non-const +extern_c Handle2Double +TimeDoubleGet(ConstHandle2Time self); + +// +++ Set +extern_c void +TimeDoubleSet(ConstHandle2Time self, ConstHandle2ConstDouble Double); + + +// ----------------------------------------------------------------------------- +// Child: string +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TimeStringHas(ConstHandle2ConstTime self); + +// --- Get, const +extern_c Handle2ConstString +TimeStringGetConst(ConstHandle2ConstTime self); + +// +++ Get, non-const +extern_c Handle2String +TimeStringGet(ConstHandle2Time self); + +// +++ Set +extern_c void +TimeStringSet(ConstHandle2Time self, ConstHandle2ConstString string); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Time/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Time/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Time/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Time/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Time/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Title.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Title.cpp new file mode 100644 index 000000000..cdabf47c1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Title.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Title.hpp" +#include "Title.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = TitleClass; +using CPP = multigroup::Title; + +static const std::string CLASSNAME = "Title"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTitle +TitleDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Title +TitleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTitle +TitleCreateConst() +{ + ConstHandle2Title handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general, non-const +Handle2Title +TitleCreate() +{ + ConstHandle2Title handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create" + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +TitleAssign(ConstHandle2Title self, ConstHandle2ConstTitle from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +TitleDelete(ConstHandle2ConstTitle self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +TitleRead(ConstHandle2Title self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +TitleWrite(ConstHandle2ConstTitle self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +TitlePrint(ConstHandle2ConstTitle self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +TitlePrintXML(ConstHandle2ConstTitle self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +TitlePrintJSON(ConstHandle2ConstTitle self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Title/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Title.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Title.h new file mode 100644 index 000000000..4c5076c5d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Title.h @@ -0,0 +1,135 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Title is the basic handle type in this file. Example: +// // Create a default Title object: +// Title handle = TitleDefault(); +// Functions involving Title are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_TITLE +#define C_INTERFACE_GNDS_V2_0_GENERAL_TITLE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct TitleClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Title +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct TitleClass *Title; + +// --- Const-aware handles. +typedef const struct TitleClass *const ConstHandle2ConstTitle; +typedef struct TitleClass *const ConstHandle2Title; +typedef const struct TitleClass * Handle2ConstTitle; +typedef struct TitleClass * Handle2Title; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstTitle +TitleDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Title +TitleDefault(); + +// --- Create, general, const +extern_c Handle2ConstTitle +TitleCreateConst(); + +// +++ Create, general, non-const +extern_c Handle2Title +TitleCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +TitleAssign(ConstHandle2Title self, ConstHandle2ConstTitle from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +TitleDelete(ConstHandle2ConstTitle self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +TitleRead(ConstHandle2Title self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +TitleWrite(ConstHandle2ConstTitle self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +TitlePrint(ConstHandle2ConstTitle self); + +// +++ Print to standard output, as XML +extern_c int +TitlePrintXML(ConstHandle2ConstTitle self); + +// +++ Print to standard output, as JSON +extern_c int +TitlePrintJSON(ConstHandle2ConstTitle self); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Title/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Title/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Title/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Title/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Title/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TotalEnergy.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TotalEnergy.cpp new file mode 100644 index 000000000..a91dfb718 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TotalEnergy.cpp @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/TotalEnergy.hpp" +#include "TotalEnergy.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = TotalEnergyClass; +using CPP = multigroup::TotalEnergy; + +static const std::string CLASSNAME = "TotalEnergy"; + +namespace extract { + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; +} + +using CPPPolynomial1d = general::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstTotalEnergy +TotalEnergyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2TotalEnergy +TotalEnergyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstTotalEnergy +TotalEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2TotalEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Create, general, non-const +Handle2TotalEnergy +TotalEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2TotalEnergy handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +TotalEnergyAssign(ConstHandle2TotalEnergy self, ConstHandle2ConstTotalEnergy from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +TotalEnergyDelete(ConstHandle2ConstTotalEnergy self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +TotalEnergyRead(ConstHandle2TotalEnergy self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +TotalEnergyWrite(ConstHandle2ConstTotalEnergy self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +TotalEnergyPrint(ConstHandle2ConstTotalEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +TotalEnergyPrintXML(ConstHandle2ConstTotalEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +TotalEnergyPrintJSON(ConstHandle2ConstTotalEnergy self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// Has +int +TotalEnergyPolynomial1dHas(ConstHandle2ConstTotalEnergy self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Polynomial1dHas", self, extract::polynomial1d); +} + +// Get, const +Handle2ConstPolynomial1d +TotalEnergyPolynomial1dGetConst(ConstHandle2ConstTotalEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGetConst", self, extract::polynomial1d); +} + +// Get, non-const +Handle2Polynomial1d +TotalEnergyPolynomial1dGet(ConstHandle2TotalEnergy self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGet", self, extract::polynomial1d); +} + +// Set +void +TotalEnergyPolynomial1dSet(ConstHandle2TotalEnergy self, ConstHandle2ConstPolynomial1d polynomial1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Polynomial1dSet", self, extract::polynomial1d, polynomial1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/TotalEnergy/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TotalEnergy.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TotalEnergy.h new file mode 100644 index 000000000..4cc2ddde8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TotalEnergy.h @@ -0,0 +1,161 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// TotalEnergy is the basic handle type in this file. Example: +// // Create a default TotalEnergy object: +// TotalEnergy handle = TotalEnergyDefault(); +// Functions involving TotalEnergy are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_TOTALENERGY +#define C_INTERFACE_GNDS_V2_0_GENERAL_TOTALENERGY + +#include "GNDStk.h" +#include "v2.0/general/Polynomial1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct TotalEnergyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ TotalEnergy +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct TotalEnergyClass *TotalEnergy; + +// --- Const-aware handles. +typedef const struct TotalEnergyClass *const ConstHandle2ConstTotalEnergy; +typedef struct TotalEnergyClass *const ConstHandle2TotalEnergy; +typedef const struct TotalEnergyClass * Handle2ConstTotalEnergy; +typedef struct TotalEnergyClass * Handle2TotalEnergy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstTotalEnergy +TotalEnergyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2TotalEnergy +TotalEnergyDefault(); + +// --- Create, general, const +extern_c Handle2ConstTotalEnergy +TotalEnergyCreateConst( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general, non-const +extern_c Handle2TotalEnergy +TotalEnergyCreate( + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +TotalEnergyAssign(ConstHandle2TotalEnergy self, ConstHandle2ConstTotalEnergy from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +TotalEnergyDelete(ConstHandle2ConstTotalEnergy self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +TotalEnergyRead(ConstHandle2TotalEnergy self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +TotalEnergyWrite(ConstHandle2ConstTotalEnergy self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +TotalEnergyPrint(ConstHandle2ConstTotalEnergy self); + +// +++ Print to standard output, as XML +extern_c int +TotalEnergyPrintXML(ConstHandle2ConstTotalEnergy self); + +// +++ Print to standard output, as JSON +extern_c int +TotalEnergyPrintJSON(ConstHandle2ConstTotalEnergy self); + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +TotalEnergyPolynomial1dHas(ConstHandle2ConstTotalEnergy self); + +// --- Get, const +extern_c Handle2ConstPolynomial1d +TotalEnergyPolynomial1dGetConst(ConstHandle2ConstTotalEnergy self); + +// +++ Get, non-const +extern_c Handle2Polynomial1d +TotalEnergyPolynomial1dGet(ConstHandle2TotalEnergy self); + +// +++ Set +extern_c void +TotalEnergyPolynomial1dSet(ConstHandle2TotalEnergy self, ConstHandle2ConstPolynomial1d polynomial1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/TotalEnergy/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TotalEnergy/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TotalEnergy/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TotalEnergy/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/TotalEnergy/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/U.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/U.cpp new file mode 100644 index 000000000..66b7492ca --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/U.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/U.hpp" +#include "U.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = UClass; +using CPP = multigroup::U; + +static const std::string CLASSNAME = "U"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; + static auto unit = [](auto &obj) { return &obj.unit; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstU +UDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2U +UDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstU +UCreateConst( + const double value, + const char *const unit +) { + ConstHandle2U handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value, + unit + ); + return handle; +} + +// Create, general, non-const +Handle2U +UCreate( + const double value, + const char *const unit +) { + ConstHandle2U handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value, + unit + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +UAssign(ConstHandle2U self, ConstHandle2ConstU from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +UDelete(ConstHandle2ConstU self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +URead(ConstHandle2U self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +UWrite(ConstHandle2ConstU self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +UPrint(ConstHandle2ConstU self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +UPrintXML(ConstHandle2ConstU self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +UPrintJSON(ConstHandle2ConstU self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +UValueHas(ConstHandle2ConstU self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +UValueGet(ConstHandle2ConstU self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +UValueSet(ConstHandle2U self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// Has +int +UUnitHas(ConstHandle2ConstU self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnitHas", self, extract::unit); +} + +// Get +// Returns by value +const char * +UUnitGet(ConstHandle2ConstU self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnitGet", self, extract::unit); +} + +// Set +void +UUnitSet(ConstHandle2U self, const char *const unit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnitSet", self, extract::unit, unit); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/U/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/U.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/U.h new file mode 100644 index 000000000..ba6caeefb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/U.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// U is the basic handle type in this file. Example: +// // Create a default U object: +// U handle = UDefault(); +// Functions involving U are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_U +#define C_INTERFACE_GNDS_V2_0_GENERAL_U + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct UClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ U +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct UClass *U; + +// --- Const-aware handles. +typedef const struct UClass *const ConstHandle2ConstU; +typedef struct UClass *const ConstHandle2U; +typedef const struct UClass * Handle2ConstU; +typedef struct UClass * Handle2U; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstU +UDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2U +UDefault(); + +// --- Create, general, const +extern_c Handle2ConstU +UCreateConst( + const double value, + const char *const unit +); + +// +++ Create, general, non-const +extern_c Handle2U +UCreate( + const double value, + const char *const unit +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +UAssign(ConstHandle2U self, ConstHandle2ConstU from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +UDelete(ConstHandle2ConstU self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +URead(ConstHandle2U self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +UWrite(ConstHandle2ConstU self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +UPrint(ConstHandle2ConstU self); + +// +++ Print to standard output, as XML +extern_c int +UPrintXML(ConstHandle2ConstU self); + +// +++ Print to standard output, as JSON +extern_c int +UPrintJSON(ConstHandle2ConstU self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UValueHas(ConstHandle2ConstU self); + +// +++ Get +// +++ Returns by value +extern_c double +UValueGet(ConstHandle2ConstU self); + +// +++ Set +extern_c void +UValueSet(ConstHandle2U self, const double value); + + +// ----------------------------------------------------------------------------- +// Metadatum: unit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UUnitHas(ConstHandle2ConstU self); + +// +++ Get +// +++ Returns by value +extern_c const char * +UUnitGet(ConstHandle2ConstU self); + +// +++ Set +extern_c void +UUnitSet(ConstHandle2U self, const char *const unit); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/U/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/U/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/U/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/U/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/U/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncertainty.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncertainty.cpp new file mode 100644 index 000000000..bf44bf81b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncertainty.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Uncertainty.hpp" +#include "Uncertainty.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = UncertaintyClass; +using CPP = multigroup::Uncertainty; + +static const std::string CLASSNAME = "Uncertainty"; + +namespace extract { + static auto covariance = [](auto &obj) { return &obj.covariance; }; + static auto standard = [](auto &obj) { return &obj.standard; }; + static auto listOfCovariances = [](auto &obj) { return &obj.listOfCovariances; }; + static auto polynomial1d = [](auto &obj) { return &obj.polynomial1d; }; +} + +using CPPCovariance = general::Covariance; +using CPPStandard = general::Standard; +using CPPListOfCovariances = general::ListOfCovariances; +using CPPPolynomial1d = reduced::Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUncertainty +UncertaintyDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Uncertainty +UncertaintyDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUncertainty +UncertaintyCreateConst( + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstStandard standard, + ConstHandle2ConstListOfCovariances listOfCovariances, + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2Uncertainty handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(covariance), + detail::tocpp(standard), + detail::tocpp(listOfCovariances), + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Create, general, non-const +Handle2Uncertainty +UncertaintyCreate( + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstStandard standard, + ConstHandle2ConstListOfCovariances listOfCovariances, + ConstHandle2ConstPolynomial1d polynomial1d +) { + ConstHandle2Uncertainty handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(covariance), + detail::tocpp(standard), + detail::tocpp(listOfCovariances), + detail::tocpp(polynomial1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +UncertaintyAssign(ConstHandle2Uncertainty self, ConstHandle2ConstUncertainty from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +UncertaintyDelete(ConstHandle2ConstUncertainty self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +UncertaintyRead(ConstHandle2Uncertainty self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +UncertaintyWrite(ConstHandle2ConstUncertainty self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +UncertaintyPrint(ConstHandle2ConstUncertainty self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +UncertaintyPrintXML(ConstHandle2ConstUncertainty self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +UncertaintyPrintJSON(ConstHandle2ConstUncertainty self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: covariance +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyCovarianceHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CovarianceHas", self, extract::covariance); +} + +// Get, const +Handle2ConstCovariance +UncertaintyCovarianceGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceGetConst", self, extract::covariance); +} + +// Get, non-const +Handle2Covariance +UncertaintyCovarianceGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceGet", self, extract::covariance); +} + +// Set +void +UncertaintyCovarianceSet(ConstHandle2Uncertainty self, ConstHandle2ConstCovariance covariance) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CovarianceSet", self, extract::covariance, covariance); +} + + +// ----------------------------------------------------------------------------- +// Child: standard +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyStandardHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StandardHas", self, extract::standard); +} + +// Get, const +Handle2ConstStandard +UncertaintyStandardGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StandardGetConst", self, extract::standard); +} + +// Get, non-const +Handle2Standard +UncertaintyStandardGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StandardGet", self, extract::standard); +} + +// Set +void +UncertaintyStandardSet(ConstHandle2Uncertainty self, ConstHandle2ConstStandard standard) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StandardSet", self, extract::standard, standard); +} + + +// ----------------------------------------------------------------------------- +// Child: listOfCovariances +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyListOfCovariancesHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ListOfCovariancesHas", self, extract::listOfCovariances); +} + +// Get, const +Handle2ConstListOfCovariances +UncertaintyListOfCovariancesGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ListOfCovariancesGetConst", self, extract::listOfCovariances); +} + +// Get, non-const +Handle2ListOfCovariances +UncertaintyListOfCovariancesGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ListOfCovariancesGet", self, extract::listOfCovariances); +} + +// Set +void +UncertaintyListOfCovariancesSet(ConstHandle2Uncertainty self, ConstHandle2ConstListOfCovariances listOfCovariances) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ListOfCovariancesSet", self, extract::listOfCovariances, listOfCovariances); +} + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// Has +int +UncertaintyPolynomial1dHas(ConstHandle2ConstUncertainty self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Polynomial1dHas", self, extract::polynomial1d); +} + +// Get, const +Handle2ConstPolynomial1d +UncertaintyPolynomial1dGetConst(ConstHandle2ConstUncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGetConst", self, extract::polynomial1d); +} + +// Get, non-const +Handle2Polynomial1d +UncertaintyPolynomial1dGet(ConstHandle2Uncertainty self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Polynomial1dGet", self, extract::polynomial1d); +} + +// Set +void +UncertaintyPolynomial1dSet(ConstHandle2Uncertainty self, ConstHandle2ConstPolynomial1d polynomial1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Polynomial1dSet", self, extract::polynomial1d, polynomial1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Uncertainty/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncertainty.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncertainty.h new file mode 100644 index 000000000..258b70343 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncertainty.h @@ -0,0 +1,233 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Uncertainty is the basic handle type in this file. Example: +// // Create a default Uncertainty object: +// Uncertainty handle = UncertaintyDefault(); +// Functions involving Uncertainty are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_UNCERTAINTY +#define C_INTERFACE_GNDS_V2_0_GENERAL_UNCERTAINTY + +#include "GNDStk.h" +#include "v2.0/general/Covariance.h" +#include "v2.0/general/Standard.h" +#include "v2.0/general/ListOfCovariances.h" +#include "v2.0/reduced/Polynomial1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct UncertaintyClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Uncertainty +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct UncertaintyClass *Uncertainty; + +// --- Const-aware handles. +typedef const struct UncertaintyClass *const ConstHandle2ConstUncertainty; +typedef struct UncertaintyClass *const ConstHandle2Uncertainty; +typedef const struct UncertaintyClass * Handle2ConstUncertainty; +typedef struct UncertaintyClass * Handle2Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstUncertainty +UncertaintyDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Uncertainty +UncertaintyDefault(); + +// --- Create, general, const +extern_c Handle2ConstUncertainty +UncertaintyCreateConst( + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstStandard standard, + ConstHandle2ConstListOfCovariances listOfCovariances, + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Create, general, non-const +extern_c Handle2Uncertainty +UncertaintyCreate( + ConstHandle2ConstCovariance covariance, + ConstHandle2ConstStandard standard, + ConstHandle2ConstListOfCovariances listOfCovariances, + ConstHandle2ConstPolynomial1d polynomial1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +UncertaintyAssign(ConstHandle2Uncertainty self, ConstHandle2ConstUncertainty from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +UncertaintyDelete(ConstHandle2ConstUncertainty self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +UncertaintyRead(ConstHandle2Uncertainty self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +UncertaintyWrite(ConstHandle2ConstUncertainty self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +UncertaintyPrint(ConstHandle2ConstUncertainty self); + +// +++ Print to standard output, as XML +extern_c int +UncertaintyPrintXML(ConstHandle2ConstUncertainty self); + +// +++ Print to standard output, as JSON +extern_c int +UncertaintyPrintJSON(ConstHandle2ConstUncertainty self); + + +// ----------------------------------------------------------------------------- +// Child: covariance +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyCovarianceHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstCovariance +UncertaintyCovarianceGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2Covariance +UncertaintyCovarianceGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyCovarianceSet(ConstHandle2Uncertainty self, ConstHandle2ConstCovariance covariance); + + +// ----------------------------------------------------------------------------- +// Child: standard +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyStandardHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstStandard +UncertaintyStandardGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2Standard +UncertaintyStandardGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyStandardSet(ConstHandle2Uncertainty self, ConstHandle2ConstStandard standard); + + +// ----------------------------------------------------------------------------- +// Child: listOfCovariances +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyListOfCovariancesHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstListOfCovariances +UncertaintyListOfCovariancesGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2ListOfCovariances +UncertaintyListOfCovariancesGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyListOfCovariancesSet(ConstHandle2Uncertainty self, ConstHandle2ConstListOfCovariances listOfCovariances); + + +// ----------------------------------------------------------------------------- +// Child: polynomial1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncertaintyPolynomial1dHas(ConstHandle2ConstUncertainty self); + +// --- Get, const +extern_c Handle2ConstPolynomial1d +UncertaintyPolynomial1dGetConst(ConstHandle2ConstUncertainty self); + +// +++ Get, non-const +extern_c Handle2Polynomial1d +UncertaintyPolynomial1dGet(ConstHandle2Uncertainty self); + +// +++ Set +extern_c void +UncertaintyPolynomial1dSet(ConstHandle2Uncertainty self, ConstHandle2ConstPolynomial1d polynomial1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Uncertainty/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncertainty/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncertainty/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncertainty/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncertainty/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncorrelated.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncorrelated.cpp new file mode 100644 index 000000000..76da555b9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncorrelated.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Uncorrelated.hpp" +#include "Uncorrelated.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = UncorrelatedClass; +using CPP = multigroup::Uncorrelated; + +static const std::string CLASSNAME = "Uncorrelated"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; + static auto angular = [](auto &obj) { return &obj.angular; }; + static auto energy = [](auto &obj) { return &obj.energy; }; +} + +using CPPAngular = general::Angular; +using CPPEnergy = general::Energy; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUncorrelated +UncorrelatedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Uncorrelated +UncorrelatedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUncorrelated +UncorrelatedCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstAngular angular, + ConstHandle2ConstEnergy energy +) { + ConstHandle2Uncorrelated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame, + detail::tocpp(angular), + detail::tocpp(energy) + ); + return handle; +} + +// Create, general, non-const +Handle2Uncorrelated +UncorrelatedCreate( + const char *const label, + const char *const productFrame, + ConstHandle2ConstAngular angular, + ConstHandle2ConstEnergy energy +) { + ConstHandle2Uncorrelated handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame, + detail::tocpp(angular), + detail::tocpp(energy) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +UncorrelatedAssign(ConstHandle2Uncorrelated self, ConstHandle2ConstUncorrelated from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +UncorrelatedDelete(ConstHandle2ConstUncorrelated self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +UncorrelatedRead(ConstHandle2Uncorrelated self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +UncorrelatedWrite(ConstHandle2ConstUncorrelated self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +UncorrelatedPrint(ConstHandle2ConstUncorrelated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +UncorrelatedPrintXML(ConstHandle2ConstUncorrelated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +UncorrelatedPrintJSON(ConstHandle2ConstUncorrelated self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +UncorrelatedLabelHas(ConstHandle2ConstUncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +UncorrelatedLabelGet(ConstHandle2ConstUncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +UncorrelatedLabelSet(ConstHandle2Uncorrelated self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +UncorrelatedProductFrameHas(ConstHandle2ConstUncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +UncorrelatedProductFrameGet(ConstHandle2ConstUncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +UncorrelatedProductFrameSet(ConstHandle2Uncorrelated self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Child: angular +// ----------------------------------------------------------------------------- + +// Has +int +UncorrelatedAngularHas(ConstHandle2ConstUncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AngularHas", self, extract::angular); +} + +// Get, const +Handle2ConstAngular +UncorrelatedAngularGetConst(ConstHandle2ConstUncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AngularGetConst", self, extract::angular); +} + +// Get, non-const +Handle2Angular +UncorrelatedAngularGet(ConstHandle2Uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AngularGet", self, extract::angular); +} + +// Set +void +UncorrelatedAngularSet(ConstHandle2Uncorrelated self, ConstHandle2ConstAngular angular) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AngularSet", self, extract::angular, angular); +} + + +// ----------------------------------------------------------------------------- +// Child: energy +// ----------------------------------------------------------------------------- + +// Has +int +UncorrelatedEnergyHas(ConstHandle2ConstUncorrelated self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EnergyHas", self, extract::energy); +} + +// Get, const +Handle2ConstEnergy +UncorrelatedEnergyGetConst(ConstHandle2ConstUncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyGetConst", self, extract::energy); +} + +// Get, non-const +Handle2Energy +UncorrelatedEnergyGet(ConstHandle2Uncorrelated self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EnergyGet", self, extract::energy); +} + +// Set +void +UncorrelatedEnergySet(ConstHandle2Uncorrelated self, ConstHandle2ConstEnergy energy) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EnergySet", self, extract::energy, energy); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Uncorrelated/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncorrelated.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncorrelated.h new file mode 100644 index 000000000..baddd6a47 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncorrelated.h @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Uncorrelated is the basic handle type in this file. Example: +// // Create a default Uncorrelated object: +// Uncorrelated handle = UncorrelatedDefault(); +// Functions involving Uncorrelated are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_UNCORRELATED +#define C_INTERFACE_GNDS_V2_0_GENERAL_UNCORRELATED + +#include "GNDStk.h" +#include "v2.0/general/Angular.h" +#include "v2.0/general/Energy.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct UncorrelatedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Uncorrelated +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct UncorrelatedClass *Uncorrelated; + +// --- Const-aware handles. +typedef const struct UncorrelatedClass *const ConstHandle2ConstUncorrelated; +typedef struct UncorrelatedClass *const ConstHandle2Uncorrelated; +typedef const struct UncorrelatedClass * Handle2ConstUncorrelated; +typedef struct UncorrelatedClass * Handle2Uncorrelated; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstUncorrelated +UncorrelatedDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Uncorrelated +UncorrelatedDefault(); + +// --- Create, general, const +extern_c Handle2ConstUncorrelated +UncorrelatedCreateConst( + const char *const label, + const char *const productFrame, + ConstHandle2ConstAngular angular, + ConstHandle2ConstEnergy energy +); + +// +++ Create, general, non-const +extern_c Handle2Uncorrelated +UncorrelatedCreate( + const char *const label, + const char *const productFrame, + ConstHandle2ConstAngular angular, + ConstHandle2ConstEnergy energy +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +UncorrelatedAssign(ConstHandle2Uncorrelated self, ConstHandle2ConstUncorrelated from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +UncorrelatedDelete(ConstHandle2ConstUncorrelated self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +UncorrelatedRead(ConstHandle2Uncorrelated self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +UncorrelatedWrite(ConstHandle2ConstUncorrelated self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +UncorrelatedPrint(ConstHandle2ConstUncorrelated self); + +// +++ Print to standard output, as XML +extern_c int +UncorrelatedPrintXML(ConstHandle2ConstUncorrelated self); + +// +++ Print to standard output, as JSON +extern_c int +UncorrelatedPrintJSON(ConstHandle2ConstUncorrelated self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncorrelatedLabelHas(ConstHandle2ConstUncorrelated self); + +// +++ Get +// +++ Returns by value +extern_c const char * +UncorrelatedLabelGet(ConstHandle2ConstUncorrelated self); + +// +++ Set +extern_c void +UncorrelatedLabelSet(ConstHandle2Uncorrelated self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncorrelatedProductFrameHas(ConstHandle2ConstUncorrelated self); + +// +++ Get +// +++ Returns by value +extern_c const char * +UncorrelatedProductFrameGet(ConstHandle2ConstUncorrelated self); + +// +++ Set +extern_c void +UncorrelatedProductFrameSet(ConstHandle2Uncorrelated self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Child: angular +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncorrelatedAngularHas(ConstHandle2ConstUncorrelated self); + +// --- Get, const +extern_c Handle2ConstAngular +UncorrelatedAngularGetConst(ConstHandle2ConstUncorrelated self); + +// +++ Get, non-const +extern_c Handle2Angular +UncorrelatedAngularGet(ConstHandle2Uncorrelated self); + +// +++ Set +extern_c void +UncorrelatedAngularSet(ConstHandle2Uncorrelated self, ConstHandle2ConstAngular angular); + + +// ----------------------------------------------------------------------------- +// Child: energy +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UncorrelatedEnergyHas(ConstHandle2ConstUncorrelated self); + +// --- Get, const +extern_c Handle2ConstEnergy +UncorrelatedEnergyGetConst(ConstHandle2ConstUncorrelated self); + +// +++ Get, non-const +extern_c Handle2Energy +UncorrelatedEnergyGet(ConstHandle2Uncorrelated self); + +// +++ Set +extern_c void +UncorrelatedEnergySet(ConstHandle2Uncorrelated self, ConstHandle2ConstEnergy energy); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Uncorrelated/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncorrelated/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncorrelated/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncorrelated/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Uncorrelated/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodox.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodox.cpp new file mode 100644 index 000000000..6f59cda8e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodox.cpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Unorthodox.hpp" +#include "Unorthodox.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = UnorthodoxClass; +using CPP = multigroup::Unorthodox; + +static const std::string CLASSNAME = "Unorthodox"; + +namespace extract { + static auto id = [](auto &obj) { return &obj.id; }; + static auto mass = [](auto &obj) { return &obj.mass; }; +} + +using CPPMass = general::Mass; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUnorthodox +UnorthodoxDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Unorthodox +UnorthodoxDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUnorthodox +UnorthodoxCreateConst( + const char *const id, + ConstHandle2ConstMass mass +) { + ConstHandle2Unorthodox handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + id, + detail::tocpp(mass) + ); + return handle; +} + +// Create, general, non-const +Handle2Unorthodox +UnorthodoxCreate( + const char *const id, + ConstHandle2ConstMass mass +) { + ConstHandle2Unorthodox handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + id, + detail::tocpp(mass) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +UnorthodoxAssign(ConstHandle2Unorthodox self, ConstHandle2ConstUnorthodox from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +UnorthodoxDelete(ConstHandle2ConstUnorthodox self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +UnorthodoxRead(ConstHandle2Unorthodox self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +UnorthodoxWrite(ConstHandle2ConstUnorthodox self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +UnorthodoxPrint(ConstHandle2ConstUnorthodox self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +UnorthodoxPrintXML(ConstHandle2ConstUnorthodox self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +UnorthodoxPrintJSON(ConstHandle2ConstUnorthodox self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// Has +int +UnorthodoxIdHas(ConstHandle2ConstUnorthodox self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IdHas", self, extract::id); +} + +// Get +// Returns by value +const char * +UnorthodoxIdGet(ConstHandle2ConstUnorthodox self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IdGet", self, extract::id); +} + +// Set +void +UnorthodoxIdSet(ConstHandle2Unorthodox self, const char *const id) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IdSet", self, extract::id, id); +} + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// Has +int +UnorthodoxMassHas(ConstHandle2ConstUnorthodox self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MassHas", self, extract::mass); +} + +// Get, const +Handle2ConstMass +UnorthodoxMassGetConst(ConstHandle2ConstUnorthodox self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGetConst", self, extract::mass); +} + +// Get, non-const +Handle2Mass +UnorthodoxMassGet(ConstHandle2Unorthodox self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MassGet", self, extract::mass); +} + +// Set +void +UnorthodoxMassSet(ConstHandle2Unorthodox self, ConstHandle2ConstMass mass) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MassSet", self, extract::mass, mass); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Unorthodox/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodox.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodox.h new file mode 100644 index 000000000..67182abf8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodox.h @@ -0,0 +1,181 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Unorthodox is the basic handle type in this file. Example: +// // Create a default Unorthodox object: +// Unorthodox handle = UnorthodoxDefault(); +// Functions involving Unorthodox are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_UNORTHODOX +#define C_INTERFACE_GNDS_V2_0_GENERAL_UNORTHODOX + +#include "GNDStk.h" +#include "v2.0/general/Mass.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct UnorthodoxClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Unorthodox +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct UnorthodoxClass *Unorthodox; + +// --- Const-aware handles. +typedef const struct UnorthodoxClass *const ConstHandle2ConstUnorthodox; +typedef struct UnorthodoxClass *const ConstHandle2Unorthodox; +typedef const struct UnorthodoxClass * Handle2ConstUnorthodox; +typedef struct UnorthodoxClass * Handle2Unorthodox; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstUnorthodox +UnorthodoxDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Unorthodox +UnorthodoxDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnorthodox +UnorthodoxCreateConst( + const char *const id, + ConstHandle2ConstMass mass +); + +// +++ Create, general, non-const +extern_c Handle2Unorthodox +UnorthodoxCreate( + const char *const id, + ConstHandle2ConstMass mass +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +UnorthodoxAssign(ConstHandle2Unorthodox self, ConstHandle2ConstUnorthodox from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +UnorthodoxDelete(ConstHandle2ConstUnorthodox self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +UnorthodoxRead(ConstHandle2Unorthodox self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +UnorthodoxWrite(ConstHandle2ConstUnorthodox self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +UnorthodoxPrint(ConstHandle2ConstUnorthodox self); + +// +++ Print to standard output, as XML +extern_c int +UnorthodoxPrintXML(ConstHandle2ConstUnorthodox self); + +// +++ Print to standard output, as JSON +extern_c int +UnorthodoxPrintJSON(ConstHandle2ConstUnorthodox self); + + +// ----------------------------------------------------------------------------- +// Metadatum: id +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnorthodoxIdHas(ConstHandle2ConstUnorthodox self); + +// +++ Get +// +++ Returns by value +extern_c const char * +UnorthodoxIdGet(ConstHandle2ConstUnorthodox self); + +// +++ Set +extern_c void +UnorthodoxIdSet(ConstHandle2Unorthodox self, const char *const id); + + +// ----------------------------------------------------------------------------- +// Child: mass +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnorthodoxMassHas(ConstHandle2ConstUnorthodox self); + +// --- Get, const +extern_c Handle2ConstMass +UnorthodoxMassGetConst(ConstHandle2ConstUnorthodox self); + +// +++ Get, non-const +extern_c Handle2Mass +UnorthodoxMassGet(ConstHandle2Unorthodox self); + +// +++ Set +extern_c void +UnorthodoxMassSet(ConstHandle2Unorthodox self, ConstHandle2ConstMass mass); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Unorthodox/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodox/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodox/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodox/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodox/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodoxes.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodoxes.cpp new file mode 100644 index 000000000..1df02ca79 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodoxes.cpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Unorthodoxes.hpp" +#include "Unorthodoxes.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = UnorthodoxesClass; +using CPP = multigroup::Unorthodoxes; + +static const std::string CLASSNAME = "Unorthodoxes"; + +namespace extract { + static auto unorthodox = [](auto &obj) { return &obj.unorthodox; }; +} + +using CPPUnorthodox = general::Unorthodox; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUnorthodoxes +UnorthodoxesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Unorthodoxes +UnorthodoxesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUnorthodoxes +UnorthodoxesCreateConst( + ConstHandle2Unorthodox *const unorthodox, const size_t unorthodoxSize +) { + ConstHandle2Unorthodoxes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t UnorthodoxN = 0; UnorthodoxN < unorthodoxSize; ++UnorthodoxN) + UnorthodoxesUnorthodoxAdd(handle, unorthodox[UnorthodoxN]); + return handle; +} + +// Create, general, non-const +Handle2Unorthodoxes +UnorthodoxesCreate( + ConstHandle2Unorthodox *const unorthodox, const size_t unorthodoxSize +) { + ConstHandle2Unorthodoxes handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t UnorthodoxN = 0; UnorthodoxN < unorthodoxSize; ++UnorthodoxN) + UnorthodoxesUnorthodoxAdd(handle, unorthodox[UnorthodoxN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +UnorthodoxesAssign(ConstHandle2Unorthodoxes self, ConstHandle2ConstUnorthodoxes from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +UnorthodoxesDelete(ConstHandle2ConstUnorthodoxes self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +UnorthodoxesRead(ConstHandle2Unorthodoxes self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +UnorthodoxesWrite(ConstHandle2ConstUnorthodoxes self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +UnorthodoxesPrint(ConstHandle2ConstUnorthodoxes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +UnorthodoxesPrintXML(ConstHandle2ConstUnorthodoxes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +UnorthodoxesPrintJSON(ConstHandle2ConstUnorthodoxes self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: unorthodox +// ----------------------------------------------------------------------------- + +// Has +int +UnorthodoxesUnorthodoxHas(ConstHandle2ConstUnorthodoxes self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnorthodoxHas", self, extract::unorthodox); +} + +// Clear +void +UnorthodoxesUnorthodoxClear(ConstHandle2Unorthodoxes self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"UnorthodoxClear", self, extract::unorthodox); +} + +// Size +size_t +UnorthodoxesUnorthodoxSize(ConstHandle2ConstUnorthodoxes self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"UnorthodoxSize", self, extract::unorthodox); +} + +// Add +void +UnorthodoxesUnorthodoxAdd(ConstHandle2Unorthodoxes self, ConstHandle2ConstUnorthodox unorthodox) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"UnorthodoxAdd", self, extract::unorthodox, unorthodox); +} + +// Get, by index \in [0,size), const +Handle2ConstUnorthodox +UnorthodoxesUnorthodoxGetConst(ConstHandle2ConstUnorthodoxes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"UnorthodoxGetConst", self, extract::unorthodox, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Unorthodox +UnorthodoxesUnorthodoxGet(ConstHandle2Unorthodoxes self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"UnorthodoxGet", self, extract::unorthodox, index_); +} + +// Set, by index \in [0,size) +void +UnorthodoxesUnorthodoxSet( + ConstHandle2Unorthodoxes self, + const size_t index_, + ConstHandle2ConstUnorthodox unorthodox +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"UnorthodoxSet", self, extract::unorthodox, index_, unorthodox); +} + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// Has, by id +int +UnorthodoxesUnorthodoxHasById( + ConstHandle2ConstUnorthodoxes self, + const char *const id +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"UnorthodoxHasById", + self, extract::unorthodox, meta::id, id); +} + +// Get, by id, const +Handle2ConstUnorthodox +UnorthodoxesUnorthodoxGetByIdConst( + ConstHandle2ConstUnorthodoxes self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"UnorthodoxGetByIdConst", + self, extract::unorthodox, meta::id, id); +} + +// Get, by id, non-const +Handle2Unorthodox +UnorthodoxesUnorthodoxGetById( + ConstHandle2Unorthodoxes self, + const char *const id +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"UnorthodoxGetById", + self, extract::unorthodox, meta::id, id); +} + +// Set, by id +void +UnorthodoxesUnorthodoxSetById( + ConstHandle2Unorthodoxes self, + const char *const id, + ConstHandle2ConstUnorthodox unorthodox +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"UnorthodoxSetById", + self, extract::unorthodox, meta::id, id, unorthodox); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Unorthodoxes/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodoxes.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodoxes.h new file mode 100644 index 000000000..94189e7d2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodoxes.h @@ -0,0 +1,210 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Unorthodoxes is the basic handle type in this file. Example: +// // Create a default Unorthodoxes object: +// Unorthodoxes handle = UnorthodoxesDefault(); +// Functions involving Unorthodoxes are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_UNORTHODOXES +#define C_INTERFACE_GNDS_V2_0_GENERAL_UNORTHODOXES + +#include "GNDStk.h" +#include "v2.0/general/Unorthodox.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct UnorthodoxesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Unorthodoxes +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct UnorthodoxesClass *Unorthodoxes; + +// --- Const-aware handles. +typedef const struct UnorthodoxesClass *const ConstHandle2ConstUnorthodoxes; +typedef struct UnorthodoxesClass *const ConstHandle2Unorthodoxes; +typedef const struct UnorthodoxesClass * Handle2ConstUnorthodoxes; +typedef struct UnorthodoxesClass * Handle2Unorthodoxes; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstUnorthodoxes +UnorthodoxesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Unorthodoxes +UnorthodoxesDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnorthodoxes +UnorthodoxesCreateConst( + ConstHandle2Unorthodox *const unorthodox, const size_t unorthodoxSize +); + +// +++ Create, general, non-const +extern_c Handle2Unorthodoxes +UnorthodoxesCreate( + ConstHandle2Unorthodox *const unorthodox, const size_t unorthodoxSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +UnorthodoxesAssign(ConstHandle2Unorthodoxes self, ConstHandle2ConstUnorthodoxes from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +UnorthodoxesDelete(ConstHandle2ConstUnorthodoxes self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +UnorthodoxesRead(ConstHandle2Unorthodoxes self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +UnorthodoxesWrite(ConstHandle2ConstUnorthodoxes self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +UnorthodoxesPrint(ConstHandle2ConstUnorthodoxes self); + +// +++ Print to standard output, as XML +extern_c int +UnorthodoxesPrintXML(ConstHandle2ConstUnorthodoxes self); + +// +++ Print to standard output, as JSON +extern_c int +UnorthodoxesPrintJSON(ConstHandle2ConstUnorthodoxes self); + + +// ----------------------------------------------------------------------------- +// Child: unorthodox +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnorthodoxesUnorthodoxHas(ConstHandle2ConstUnorthodoxes self); + +// +++ Clear +extern_c void +UnorthodoxesUnorthodoxClear(ConstHandle2Unorthodoxes self); + +// +++ Size +extern_c size_t +UnorthodoxesUnorthodoxSize(ConstHandle2ConstUnorthodoxes self); + +// +++ Add +extern_c void +UnorthodoxesUnorthodoxAdd(ConstHandle2Unorthodoxes self, ConstHandle2ConstUnorthodox unorthodox); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstUnorthodox +UnorthodoxesUnorthodoxGetConst(ConstHandle2ConstUnorthodoxes self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Unorthodox +UnorthodoxesUnorthodoxGet(ConstHandle2Unorthodoxes self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +UnorthodoxesUnorthodoxSet( + ConstHandle2Unorthodoxes self, + const size_t index_, + ConstHandle2ConstUnorthodox unorthodox +); + +// ------------------------ +// Re: metadatum id +// ------------------------ + +// +++ Has, by id +extern_c int +UnorthodoxesUnorthodoxHasById( + ConstHandle2ConstUnorthodoxes self, + const char *const id +); + +// --- Get, by id, const +extern_c Handle2ConstUnorthodox +UnorthodoxesUnorthodoxGetByIdConst( + ConstHandle2ConstUnorthodoxes self, + const char *const id +); + +// +++ Get, by id, non-const +extern_c Handle2Unorthodox +UnorthodoxesUnorthodoxGetById( + ConstHandle2Unorthodoxes self, + const char *const id +); + +// +++ Set, by id +extern_c void +UnorthodoxesUnorthodoxSetById( + ConstHandle2Unorthodoxes self, + const char *const id, + ConstHandle2ConstUnorthodox unorthodox +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Unorthodoxes/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodoxes/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodoxes/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodoxes/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unorthodoxes/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unresolved.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unresolved.cpp new file mode 100644 index 000000000..0d9bac074 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unresolved.cpp @@ -0,0 +1,286 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Unresolved.hpp" +#include "Unresolved.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = UnresolvedClass; +using CPP = multigroup::Unresolved; + +static const std::string CLASSNAME = "Unresolved"; + +namespace extract { + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto domainUnit = [](auto &obj) { return &obj.domainUnit; }; + static auto tabulatedWidths = [](auto &obj) { return &obj.tabulatedWidths; }; +} + +using CPPTabulatedWidths = general::TabulatedWidths; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUnresolved +UnresolvedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Unresolved +UnresolvedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUnresolved +UnresolvedCreateConst( + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2ConstTabulatedWidths tabulatedWidths +) { + ConstHandle2Unresolved handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + domainMin, + domainMax, + domainUnit, + detail::tocpp(tabulatedWidths) + ); + return handle; +} + +// Create, general, non-const +Handle2Unresolved +UnresolvedCreate( + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2ConstTabulatedWidths tabulatedWidths +) { + ConstHandle2Unresolved handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + domainMin, + domainMax, + domainUnit, + detail::tocpp(tabulatedWidths) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +UnresolvedAssign(ConstHandle2Unresolved self, ConstHandle2ConstUnresolved from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +UnresolvedDelete(ConstHandle2ConstUnresolved self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +UnresolvedRead(ConstHandle2Unresolved self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +UnresolvedWrite(ConstHandle2ConstUnresolved self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +UnresolvedPrint(ConstHandle2ConstUnresolved self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +UnresolvedPrintXML(ConstHandle2ConstUnresolved self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +UnresolvedPrintJSON(ConstHandle2ConstUnresolved self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +UnresolvedDomainMinHas(ConstHandle2ConstUnresolved self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +double +UnresolvedDomainMinGet(ConstHandle2ConstUnresolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +UnresolvedDomainMinSet(ConstHandle2Unresolved self, const double domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +UnresolvedDomainMaxHas(ConstHandle2ConstUnresolved self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +double +UnresolvedDomainMaxGet(ConstHandle2ConstUnresolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +UnresolvedDomainMaxSet(ConstHandle2Unresolved self, const double domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// Has +int +UnresolvedDomainUnitHas(ConstHandle2ConstUnresolved self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainUnitHas", self, extract::domainUnit); +} + +// Get +// Returns by value +const char * +UnresolvedDomainUnitGet(ConstHandle2ConstUnresolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainUnitGet", self, extract::domainUnit); +} + +// Set +void +UnresolvedDomainUnitSet(ConstHandle2Unresolved self, const char *const domainUnit) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainUnitSet", self, extract::domainUnit, domainUnit); +} + + +// ----------------------------------------------------------------------------- +// Child: tabulatedWidths +// ----------------------------------------------------------------------------- + +// Has +int +UnresolvedTabulatedWidthsHas(ConstHandle2ConstUnresolved self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TabulatedWidthsHas", self, extract::tabulatedWidths); +} + +// Get, const +Handle2ConstTabulatedWidths +UnresolvedTabulatedWidthsGetConst(ConstHandle2ConstUnresolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TabulatedWidthsGetConst", self, extract::tabulatedWidths); +} + +// Get, non-const +Handle2TabulatedWidths +UnresolvedTabulatedWidthsGet(ConstHandle2Unresolved self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TabulatedWidthsGet", self, extract::tabulatedWidths); +} + +// Set +void +UnresolvedTabulatedWidthsSet(ConstHandle2Unresolved self, ConstHandle2ConstTabulatedWidths tabulatedWidths) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TabulatedWidthsSet", self, extract::tabulatedWidths, tabulatedWidths); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Unresolved/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unresolved.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unresolved.h new file mode 100644 index 000000000..ed2e355db --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unresolved.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Unresolved is the basic handle type in this file. Example: +// // Create a default Unresolved object: +// Unresolved handle = UnresolvedDefault(); +// Functions involving Unresolved are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_UNRESOLVED +#define C_INTERFACE_GNDS_V2_0_GENERAL_UNRESOLVED + +#include "GNDStk.h" +#include "v2.0/general/TabulatedWidths.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct UnresolvedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Unresolved +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct UnresolvedClass *Unresolved; + +// --- Const-aware handles. +typedef const struct UnresolvedClass *const ConstHandle2ConstUnresolved; +typedef struct UnresolvedClass *const ConstHandle2Unresolved; +typedef const struct UnresolvedClass * Handle2ConstUnresolved; +typedef struct UnresolvedClass * Handle2Unresolved; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstUnresolved +UnresolvedDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Unresolved +UnresolvedDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnresolved +UnresolvedCreateConst( + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2ConstTabulatedWidths tabulatedWidths +); + +// +++ Create, general, non-const +extern_c Handle2Unresolved +UnresolvedCreate( + const double domainMin, + const double domainMax, + const char *const domainUnit, + ConstHandle2ConstTabulatedWidths tabulatedWidths +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +UnresolvedAssign(ConstHandle2Unresolved self, ConstHandle2ConstUnresolved from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +UnresolvedDelete(ConstHandle2ConstUnresolved self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +UnresolvedRead(ConstHandle2Unresolved self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +UnresolvedWrite(ConstHandle2ConstUnresolved self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +UnresolvedPrint(ConstHandle2ConstUnresolved self); + +// +++ Print to standard output, as XML +extern_c int +UnresolvedPrintXML(ConstHandle2ConstUnresolved self); + +// +++ Print to standard output, as JSON +extern_c int +UnresolvedPrintJSON(ConstHandle2ConstUnresolved self); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnresolvedDomainMinHas(ConstHandle2ConstUnresolved self); + +// +++ Get +// +++ Returns by value +extern_c double +UnresolvedDomainMinGet(ConstHandle2ConstUnresolved self); + +// +++ Set +extern_c void +UnresolvedDomainMinSet(ConstHandle2Unresolved self, const double domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnresolvedDomainMaxHas(ConstHandle2ConstUnresolved self); + +// +++ Get +// +++ Returns by value +extern_c double +UnresolvedDomainMaxGet(ConstHandle2ConstUnresolved self); + +// +++ Set +extern_c void +UnresolvedDomainMaxSet(ConstHandle2Unresolved self, const double domainMax); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainUnit +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnresolvedDomainUnitHas(ConstHandle2ConstUnresolved self); + +// +++ Get +// +++ Returns by value +extern_c const char * +UnresolvedDomainUnitGet(ConstHandle2ConstUnresolved self); + +// +++ Set +extern_c void +UnresolvedDomainUnitSet(ConstHandle2Unresolved self, const char *const domainUnit); + + +// ----------------------------------------------------------------------------- +// Child: tabulatedWidths +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnresolvedTabulatedWidthsHas(ConstHandle2ConstUnresolved self); + +// --- Get, const +extern_c Handle2ConstTabulatedWidths +UnresolvedTabulatedWidthsGetConst(ConstHandle2ConstUnresolved self); + +// +++ Get, non-const +extern_c Handle2TabulatedWidths +UnresolvedTabulatedWidthsGet(ConstHandle2Unresolved self); + +// +++ Set +extern_c void +UnresolvedTabulatedWidthsSet(ConstHandle2Unresolved self, ConstHandle2ConstTabulatedWidths tabulatedWidths); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Unresolved/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unresolved/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unresolved/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unresolved/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unresolved/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/UnresolvedRegion.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/UnresolvedRegion.cpp new file mode 100644 index 000000000..7ea98087f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/UnresolvedRegion.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/UnresolvedRegion.hpp" +#include "UnresolvedRegion.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = UnresolvedRegionClass; +using CPP = multigroup::UnresolvedRegion; + +static const std::string CLASSNAME = "UnresolvedRegion"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = general::XYs1d; +using CPPRegions1d = general::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUnresolvedRegion +UnresolvedRegionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2UnresolvedRegion +UnresolvedRegionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUnresolvedRegion +UnresolvedRegionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2UnresolvedRegion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general, non-const +Handle2UnresolvedRegion +UnresolvedRegionCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2UnresolvedRegion handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +UnresolvedRegionAssign(ConstHandle2UnresolvedRegion self, ConstHandle2ConstUnresolvedRegion from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +UnresolvedRegionDelete(ConstHandle2ConstUnresolvedRegion self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +UnresolvedRegionRead(ConstHandle2UnresolvedRegion self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +UnresolvedRegionWrite(ConstHandle2ConstUnresolvedRegion self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +UnresolvedRegionPrint(ConstHandle2ConstUnresolvedRegion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +UnresolvedRegionPrintXML(ConstHandle2ConstUnresolvedRegion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +UnresolvedRegionPrintJSON(ConstHandle2ConstUnresolvedRegion self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +UnresolvedRegionXYs1dHas(ConstHandle2ConstUnresolvedRegion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +UnresolvedRegionXYs1dGetConst(ConstHandle2ConstUnresolvedRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +UnresolvedRegionXYs1dGet(ConstHandle2UnresolvedRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +UnresolvedRegionXYs1dSet(ConstHandle2UnresolvedRegion self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +UnresolvedRegionRegions1dHas(ConstHandle2ConstUnresolvedRegion self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +UnresolvedRegionRegions1dGetConst(ConstHandle2ConstUnresolvedRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +UnresolvedRegionRegions1dGet(ConstHandle2UnresolvedRegion self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +UnresolvedRegionRegions1dSet(ConstHandle2UnresolvedRegion self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/UnresolvedRegion/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/UnresolvedRegion.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/UnresolvedRegion.h new file mode 100644 index 000000000..5633f8139 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/UnresolvedRegion.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// UnresolvedRegion is the basic handle type in this file. Example: +// // Create a default UnresolvedRegion object: +// UnresolvedRegion handle = UnresolvedRegionDefault(); +// Functions involving UnresolvedRegion are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_UNRESOLVEDREGION +#define C_INTERFACE_GNDS_V2_0_GENERAL_UNRESOLVEDREGION + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/Regions1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct UnresolvedRegionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ UnresolvedRegion +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct UnresolvedRegionClass *UnresolvedRegion; + +// --- Const-aware handles. +typedef const struct UnresolvedRegionClass *const ConstHandle2ConstUnresolvedRegion; +typedef struct UnresolvedRegionClass *const ConstHandle2UnresolvedRegion; +typedef const struct UnresolvedRegionClass * Handle2ConstUnresolvedRegion; +typedef struct UnresolvedRegionClass * Handle2UnresolvedRegion; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstUnresolvedRegion +UnresolvedRegionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2UnresolvedRegion +UnresolvedRegionDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnresolvedRegion +UnresolvedRegionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general, non-const +extern_c Handle2UnresolvedRegion +UnresolvedRegionCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +UnresolvedRegionAssign(ConstHandle2UnresolvedRegion self, ConstHandle2ConstUnresolvedRegion from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +UnresolvedRegionDelete(ConstHandle2ConstUnresolvedRegion self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +UnresolvedRegionRead(ConstHandle2UnresolvedRegion self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +UnresolvedRegionWrite(ConstHandle2ConstUnresolvedRegion self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +UnresolvedRegionPrint(ConstHandle2ConstUnresolvedRegion self); + +// +++ Print to standard output, as XML +extern_c int +UnresolvedRegionPrintXML(ConstHandle2ConstUnresolvedRegion self); + +// +++ Print to standard output, as JSON +extern_c int +UnresolvedRegionPrintJSON(ConstHandle2ConstUnresolvedRegion self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnresolvedRegionXYs1dHas(ConstHandle2ConstUnresolvedRegion self); + +// --- Get, const +extern_c Handle2ConstXYs1d +UnresolvedRegionXYs1dGetConst(ConstHandle2ConstUnresolvedRegion self); + +// +++ Get, non-const +extern_c Handle2XYs1d +UnresolvedRegionXYs1dGet(ConstHandle2UnresolvedRegion self); + +// +++ Set +extern_c void +UnresolvedRegionXYs1dSet(ConstHandle2UnresolvedRegion self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnresolvedRegionRegions1dHas(ConstHandle2ConstUnresolvedRegion self); + +// --- Get, const +extern_c Handle2ConstRegions1d +UnresolvedRegionRegions1dGetConst(ConstHandle2ConstUnresolvedRegion self); + +// +++ Get, non-const +extern_c Handle2Regions1d +UnresolvedRegionRegions1dGet(ConstHandle2UnresolvedRegion self); + +// +++ Set +extern_c void +UnresolvedRegionRegions1dSet(ConstHandle2UnresolvedRegion self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/UnresolvedRegion/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/UnresolvedRegion/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/UnresolvedRegion/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/UnresolvedRegion/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/UnresolvedRegion/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unspecified.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unspecified.cpp new file mode 100644 index 000000000..df00f5c92 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unspecified.cpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Unspecified.hpp" +#include "Unspecified.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = UnspecifiedClass; +using CPP = multigroup::Unspecified; + +static const std::string CLASSNAME = "Unspecified"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto productFrame = [](auto &obj) { return &obj.productFrame; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstUnspecified +UnspecifiedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Unspecified +UnspecifiedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstUnspecified +UnspecifiedCreateConst( + const char *const label, + const char *const productFrame +) { + ConstHandle2Unspecified handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + productFrame + ); + return handle; +} + +// Create, general, non-const +Handle2Unspecified +UnspecifiedCreate( + const char *const label, + const char *const productFrame +) { + ConstHandle2Unspecified handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + productFrame + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +UnspecifiedAssign(ConstHandle2Unspecified self, ConstHandle2ConstUnspecified from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +UnspecifiedDelete(ConstHandle2ConstUnspecified self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +UnspecifiedRead(ConstHandle2Unspecified self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +UnspecifiedWrite(ConstHandle2ConstUnspecified self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +UnspecifiedPrint(ConstHandle2ConstUnspecified self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +UnspecifiedPrintXML(ConstHandle2ConstUnspecified self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +UnspecifiedPrintJSON(ConstHandle2ConstUnspecified self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +UnspecifiedLabelHas(ConstHandle2ConstUnspecified self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +UnspecifiedLabelGet(ConstHandle2ConstUnspecified self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +UnspecifiedLabelSet(ConstHandle2Unspecified self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// Has +int +UnspecifiedProductFrameHas(ConstHandle2ConstUnspecified self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductFrameHas", self, extract::productFrame); +} + +// Get +// Returns by value +const char * +UnspecifiedProductFrameGet(ConstHandle2ConstUnspecified self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductFrameGet", self, extract::productFrame); +} + +// Set +void +UnspecifiedProductFrameSet(ConstHandle2Unspecified self, const char *const productFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductFrameSet", self, extract::productFrame, productFrame); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Unspecified/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unspecified.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unspecified.h new file mode 100644 index 000000000..62e5967e8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unspecified.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Unspecified is the basic handle type in this file. Example: +// // Create a default Unspecified object: +// Unspecified handle = UnspecifiedDefault(); +// Functions involving Unspecified are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_UNSPECIFIED +#define C_INTERFACE_GNDS_V2_0_GENERAL_UNSPECIFIED + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct UnspecifiedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Unspecified +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct UnspecifiedClass *Unspecified; + +// --- Const-aware handles. +typedef const struct UnspecifiedClass *const ConstHandle2ConstUnspecified; +typedef struct UnspecifiedClass *const ConstHandle2Unspecified; +typedef const struct UnspecifiedClass * Handle2ConstUnspecified; +typedef struct UnspecifiedClass * Handle2Unspecified; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstUnspecified +UnspecifiedDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Unspecified +UnspecifiedDefault(); + +// --- Create, general, const +extern_c Handle2ConstUnspecified +UnspecifiedCreateConst( + const char *const label, + const char *const productFrame +); + +// +++ Create, general, non-const +extern_c Handle2Unspecified +UnspecifiedCreate( + const char *const label, + const char *const productFrame +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +UnspecifiedAssign(ConstHandle2Unspecified self, ConstHandle2ConstUnspecified from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +UnspecifiedDelete(ConstHandle2ConstUnspecified self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +UnspecifiedRead(ConstHandle2Unspecified self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +UnspecifiedWrite(ConstHandle2ConstUnspecified self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +UnspecifiedPrint(ConstHandle2ConstUnspecified self); + +// +++ Print to standard output, as XML +extern_c int +UnspecifiedPrintXML(ConstHandle2ConstUnspecified self); + +// +++ Print to standard output, as JSON +extern_c int +UnspecifiedPrintJSON(ConstHandle2ConstUnspecified self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnspecifiedLabelHas(ConstHandle2ConstUnspecified self); + +// +++ Get +// +++ Returns by value +extern_c const char * +UnspecifiedLabelGet(ConstHandle2ConstUnspecified self); + +// +++ Set +extern_c void +UnspecifiedLabelSet(ConstHandle2Unspecified self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: productFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +UnspecifiedProductFrameHas(ConstHandle2ConstUnspecified self); + +// +++ Get +// +++ Returns by value +extern_c const char * +UnspecifiedProductFrameGet(ConstHandle2ConstUnspecified self); + +// +++ Set +extern_c void +UnspecifiedProductFrameSet(ConstHandle2Unspecified self, const char *const productFrame); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Unspecified/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unspecified/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unspecified/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unspecified/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Unspecified/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Values.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Values.cpp new file mode 100644 index 000000000..ef5db1499 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Values.cpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Values.hpp" +#include "Values.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ValuesClass; +using CPP = multigroup::Values; + +static const std::string CLASSNAME = "Values"; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstValues +ValuesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Values +ValuesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstValues +ValuesCreateConst() +{ + ConstHandle2Values handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst" + ); + return handle; +} + +// Create, general, non-const +Handle2Values +ValuesCreate() +{ + ConstHandle2Values handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create" + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ValuesAssign(ConstHandle2Values self, ConstHandle2ConstValues from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ValuesDelete(ConstHandle2ConstValues self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ValuesRead(ConstHandle2Values self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ValuesWrite(ConstHandle2ConstValues self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ValuesPrint(ConstHandle2ConstValues self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ValuesPrintXML(ConstHandle2ConstValues self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ValuesPrintJSON(ConstHandle2ConstValues self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// Clear +void +ValuesDoublesClear(ConstHandle2Values self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"DoublesClear", self); +} + +// Get size +size_t +ValuesDoublesSize(ConstHandle2ConstValues self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"DoublesSize", self); +} + +// Get value +// By index \in [0,size) +double +ValuesDoublesGet(ConstHandle2ConstValues self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGet", self, index); +} + +// Set value +// By index \in [0,size) +void +ValuesDoublesSet(ConstHandle2Values self, const size_t index, const double value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSet", self, index, value); +} + +// Get pointer to existing values, const +const double * +ValuesDoublesGetArrayConst(ConstHandle2ConstValues self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArrayConst", self); +} + +// Get pointer to existing values, non-const +double * +ValuesDoublesGetArray(ConstHandle2Values self) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"DoublesGetArray", self); +} + +// Set completely new values and size +void +ValuesDoublesSetArray(ConstHandle2Values self, const double *const values, const size_t size) +{ + return detail::vectorSet + (CLASSNAME, CLASSNAME+"DoublesSetArray", self, size, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Values/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Values.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Values.h new file mode 100644 index 000000000..92482abd8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Values.h @@ -0,0 +1,170 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Values is the basic handle type in this file. Example: +// // Create a default Values object: +// Values handle = ValuesDefault(); +// Functions involving Values are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_VALUES +#define C_INTERFACE_GNDS_V2_0_GENERAL_VALUES + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ValuesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Values +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ValuesClass *Values; + +// --- Const-aware handles. +typedef const struct ValuesClass *const ConstHandle2ConstValues; +typedef struct ValuesClass *const ConstHandle2Values; +typedef const struct ValuesClass * Handle2ConstValues; +typedef struct ValuesClass * Handle2Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstValues +ValuesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Values +ValuesDefault(); + +// --- Create, general, const +extern_c Handle2ConstValues +ValuesCreateConst(); + +// +++ Create, general, non-const +extern_c Handle2Values +ValuesCreate(); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ValuesAssign(ConstHandle2Values self, ConstHandle2ConstValues from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ValuesDelete(ConstHandle2ConstValues self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ValuesRead(ConstHandle2Values self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ValuesWrite(ConstHandle2ConstValues self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ValuesPrint(ConstHandle2ConstValues self); + +// +++ Print to standard output, as XML +extern_c int +ValuesPrintXML(ConstHandle2ConstValues self); + +// +++ Print to standard output, as JSON +extern_c int +ValuesPrintJSON(ConstHandle2ConstValues self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// +++ Clear +extern_c void +ValuesDoublesClear(ConstHandle2Values self); + +// +++ Get size +extern_c size_t +ValuesDoublesSize(ConstHandle2ConstValues self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c double +ValuesDoublesGet(ConstHandle2ConstValues self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +ValuesDoublesSet(ConstHandle2Values self, const size_t index, const double value); + +// --- Get pointer to existing values, const +extern_c const double * +ValuesDoublesGetArrayConst(ConstHandle2ConstValues self); + +// +++ Get pointer to existing values, non-const +extern_c double * +ValuesDoublesGetArray(ConstHandle2Values self); + +// +++ Set completely new values and size +extern_c void +ValuesDoublesSetArray(ConstHandle2Values self, const double *const values, const size_t size); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Values/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Values/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Values/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Values/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Values/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Weighted.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Weighted.cpp new file mode 100644 index 000000000..7ef47536b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Weighted.cpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Weighted.hpp" +#include "Weighted.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = WeightedClass; +using CPP = multigroup::Weighted; + +static const std::string CLASSNAME = "Weighted"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto evaporation = [](auto &obj) { return &obj.evaporation; }; +} + +using CPPXYs1d = general::XYs1d; +using CPPEvaporation = general::Evaporation; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstWeighted +WeightedDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Weighted +WeightedDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstWeighted +WeightedCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstEvaporation evaporation +) { + ConstHandle2Weighted handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(evaporation) + ); + return handle; +} + +// Create, general, non-const +Handle2Weighted +WeightedCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstEvaporation evaporation +) { + ConstHandle2Weighted handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(evaporation) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +WeightedAssign(ConstHandle2Weighted self, ConstHandle2ConstWeighted from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +WeightedDelete(ConstHandle2ConstWeighted self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +WeightedRead(ConstHandle2Weighted self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +WeightedWrite(ConstHandle2ConstWeighted self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +WeightedPrint(ConstHandle2ConstWeighted self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +WeightedPrintXML(ConstHandle2ConstWeighted self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +WeightedPrintJSON(ConstHandle2ConstWeighted self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +WeightedXYs1dHas(ConstHandle2ConstWeighted self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +WeightedXYs1dGetConst(ConstHandle2ConstWeighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +WeightedXYs1dGet(ConstHandle2Weighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +WeightedXYs1dSet(ConstHandle2Weighted self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: evaporation +// ----------------------------------------------------------------------------- + +// Has +int +WeightedEvaporationHas(ConstHandle2ConstWeighted self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EvaporationHas", self, extract::evaporation); +} + +// Get, const +Handle2ConstEvaporation +WeightedEvaporationGetConst(ConstHandle2ConstWeighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaporationGetConst", self, extract::evaporation); +} + +// Get, non-const +Handle2Evaporation +WeightedEvaporationGet(ConstHandle2Weighted self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaporationGet", self, extract::evaporation); +} + +// Set +void +WeightedEvaporationSet(ConstHandle2Weighted self, ConstHandle2ConstEvaporation evaporation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EvaporationSet", self, extract::evaporation, evaporation); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Weighted/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Weighted.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Weighted.h new file mode 100644 index 000000000..ff8f1ea21 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Weighted.h @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Weighted is the basic handle type in this file. Example: +// // Create a default Weighted object: +// Weighted handle = WeightedDefault(); +// Functions involving Weighted are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_WEIGHTED +#define C_INTERFACE_GNDS_V2_0_GENERAL_WEIGHTED + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/Evaporation.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct WeightedClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Weighted +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct WeightedClass *Weighted; + +// --- Const-aware handles. +typedef const struct WeightedClass *const ConstHandle2ConstWeighted; +typedef struct WeightedClass *const ConstHandle2Weighted; +typedef const struct WeightedClass * Handle2ConstWeighted; +typedef struct WeightedClass * Handle2Weighted; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstWeighted +WeightedDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Weighted +WeightedDefault(); + +// --- Create, general, const +extern_c Handle2ConstWeighted +WeightedCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstEvaporation evaporation +); + +// +++ Create, general, non-const +extern_c Handle2Weighted +WeightedCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstEvaporation evaporation +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +WeightedAssign(ConstHandle2Weighted self, ConstHandle2ConstWeighted from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +WeightedDelete(ConstHandle2ConstWeighted self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +WeightedRead(ConstHandle2Weighted self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +WeightedWrite(ConstHandle2ConstWeighted self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +WeightedPrint(ConstHandle2ConstWeighted self); + +// +++ Print to standard output, as XML +extern_c int +WeightedPrintXML(ConstHandle2ConstWeighted self); + +// +++ Print to standard output, as JSON +extern_c int +WeightedPrintJSON(ConstHandle2ConstWeighted self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WeightedXYs1dHas(ConstHandle2ConstWeighted self); + +// --- Get, const +extern_c Handle2ConstXYs1d +WeightedXYs1dGetConst(ConstHandle2ConstWeighted self); + +// +++ Get, non-const +extern_c Handle2XYs1d +WeightedXYs1dGet(ConstHandle2Weighted self); + +// +++ Set +extern_c void +WeightedXYs1dSet(ConstHandle2Weighted self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: evaporation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WeightedEvaporationHas(ConstHandle2ConstWeighted self); + +// --- Get, const +extern_c Handle2ConstEvaporation +WeightedEvaporationGetConst(ConstHandle2ConstWeighted self); + +// +++ Get, non-const +extern_c Handle2Evaporation +WeightedEvaporationGet(ConstHandle2Weighted self); + +// +++ Set +extern_c void +WeightedEvaporationSet(ConstHandle2Weighted self, ConstHandle2ConstEvaporation evaporation); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Weighted/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Weighted/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Weighted/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Weighted/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Weighted/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/WeightedFunctionals.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/WeightedFunctionals.cpp new file mode 100644 index 000000000..dbf366019 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/WeightedFunctionals.cpp @@ -0,0 +1,212 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/WeightedFunctionals.hpp" +#include "WeightedFunctionals.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = WeightedFunctionalsClass; +using CPP = multigroup::WeightedFunctionals; + +static const std::string CLASSNAME = "WeightedFunctionals"; + +namespace extract { + static auto weighted = [](auto &obj) { return &obj.weighted; }; +} + +using CPPWeighted = general::Weighted; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstWeightedFunctionals +WeightedFunctionalsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2WeightedFunctionals +WeightedFunctionalsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstWeightedFunctionals +WeightedFunctionalsCreateConst( + ConstHandle2Weighted *const weighted, const size_t weightedSize +) { + ConstHandle2WeightedFunctionals handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t WeightedN = 0; WeightedN < weightedSize; ++WeightedN) + WeightedFunctionalsWeightedAdd(handle, weighted[WeightedN]); + return handle; +} + +// Create, general, non-const +Handle2WeightedFunctionals +WeightedFunctionalsCreate( + ConstHandle2Weighted *const weighted, const size_t weightedSize +) { + ConstHandle2WeightedFunctionals handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t WeightedN = 0; WeightedN < weightedSize; ++WeightedN) + WeightedFunctionalsWeightedAdd(handle, weighted[WeightedN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +WeightedFunctionalsAssign(ConstHandle2WeightedFunctionals self, ConstHandle2ConstWeightedFunctionals from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +WeightedFunctionalsDelete(ConstHandle2ConstWeightedFunctionals self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +WeightedFunctionalsRead(ConstHandle2WeightedFunctionals self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +WeightedFunctionalsWrite(ConstHandle2ConstWeightedFunctionals self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +WeightedFunctionalsPrint(ConstHandle2ConstWeightedFunctionals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +WeightedFunctionalsPrintXML(ConstHandle2ConstWeightedFunctionals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +WeightedFunctionalsPrintJSON(ConstHandle2ConstWeightedFunctionals self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: weighted +// ----------------------------------------------------------------------------- + +// Has +int +WeightedFunctionalsWeightedHas(ConstHandle2ConstWeightedFunctionals self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"WeightedHas", self, extract::weighted); +} + +// Clear +void +WeightedFunctionalsWeightedClear(ConstHandle2WeightedFunctionals self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"WeightedClear", self, extract::weighted); +} + +// Size +size_t +WeightedFunctionalsWeightedSize(ConstHandle2ConstWeightedFunctionals self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"WeightedSize", self, extract::weighted); +} + +// Add +void +WeightedFunctionalsWeightedAdd(ConstHandle2WeightedFunctionals self, ConstHandle2ConstWeighted weighted) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"WeightedAdd", self, extract::weighted, weighted); +} + +// Get, by index \in [0,size), const +Handle2ConstWeighted +WeightedFunctionalsWeightedGetConst(ConstHandle2ConstWeightedFunctionals self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"WeightedGetConst", self, extract::weighted, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Weighted +WeightedFunctionalsWeightedGet(ConstHandle2WeightedFunctionals self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"WeightedGet", self, extract::weighted, index_); +} + +// Set, by index \in [0,size) +void +WeightedFunctionalsWeightedSet( + ConstHandle2WeightedFunctionals self, + const size_t index_, + ConstHandle2ConstWeighted weighted +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"WeightedSet", self, extract::weighted, index_, weighted); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/WeightedFunctionals/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/WeightedFunctionals.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/WeightedFunctionals.h new file mode 100644 index 000000000..c87d06f0a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/WeightedFunctionals.h @@ -0,0 +1,177 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// WeightedFunctionals is the basic handle type in this file. Example: +// // Create a default WeightedFunctionals object: +// WeightedFunctionals handle = WeightedFunctionalsDefault(); +// Functions involving WeightedFunctionals are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_WEIGHTEDFUNCTIONALS +#define C_INTERFACE_GNDS_V2_0_GENERAL_WEIGHTEDFUNCTIONALS + +#include "GNDStk.h" +#include "v2.0/general/Weighted.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct WeightedFunctionalsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ WeightedFunctionals +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct WeightedFunctionalsClass *WeightedFunctionals; + +// --- Const-aware handles. +typedef const struct WeightedFunctionalsClass *const ConstHandle2ConstWeightedFunctionals; +typedef struct WeightedFunctionalsClass *const ConstHandle2WeightedFunctionals; +typedef const struct WeightedFunctionalsClass * Handle2ConstWeightedFunctionals; +typedef struct WeightedFunctionalsClass * Handle2WeightedFunctionals; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstWeightedFunctionals +WeightedFunctionalsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2WeightedFunctionals +WeightedFunctionalsDefault(); + +// --- Create, general, const +extern_c Handle2ConstWeightedFunctionals +WeightedFunctionalsCreateConst( + ConstHandle2Weighted *const weighted, const size_t weightedSize +); + +// +++ Create, general, non-const +extern_c Handle2WeightedFunctionals +WeightedFunctionalsCreate( + ConstHandle2Weighted *const weighted, const size_t weightedSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +WeightedFunctionalsAssign(ConstHandle2WeightedFunctionals self, ConstHandle2ConstWeightedFunctionals from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +WeightedFunctionalsDelete(ConstHandle2ConstWeightedFunctionals self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +WeightedFunctionalsRead(ConstHandle2WeightedFunctionals self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +WeightedFunctionalsWrite(ConstHandle2ConstWeightedFunctionals self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +WeightedFunctionalsPrint(ConstHandle2ConstWeightedFunctionals self); + +// +++ Print to standard output, as XML +extern_c int +WeightedFunctionalsPrintXML(ConstHandle2ConstWeightedFunctionals self); + +// +++ Print to standard output, as JSON +extern_c int +WeightedFunctionalsPrintJSON(ConstHandle2ConstWeightedFunctionals self); + + +// ----------------------------------------------------------------------------- +// Child: weighted +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WeightedFunctionalsWeightedHas(ConstHandle2ConstWeightedFunctionals self); + +// +++ Clear +extern_c void +WeightedFunctionalsWeightedClear(ConstHandle2WeightedFunctionals self); + +// +++ Size +extern_c size_t +WeightedFunctionalsWeightedSize(ConstHandle2ConstWeightedFunctionals self); + +// +++ Add +extern_c void +WeightedFunctionalsWeightedAdd(ConstHandle2WeightedFunctionals self, ConstHandle2ConstWeighted weighted); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstWeighted +WeightedFunctionalsWeightedGetConst(ConstHandle2ConstWeightedFunctionals self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Weighted +WeightedFunctionalsWeightedGet(ConstHandle2WeightedFunctionals self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +WeightedFunctionalsWeightedSet( + ConstHandle2WeightedFunctionals self, + const size_t index_, + ConstHandle2ConstWeighted weighted +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/WeightedFunctionals/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/WeightedFunctionals/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/WeightedFunctionals/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/WeightedFunctionals/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/WeightedFunctionals/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Width.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Width.cpp new file mode 100644 index 000000000..237f1d8f3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Width.cpp @@ -0,0 +1,372 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Width.hpp" +#include "Width.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = WidthClass; +using CPP = multigroup::Width; + +static const std::string CLASSNAME = "Width"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto resonanceReaction = [](auto &obj) { return &obj.resonanceReaction; }; + static auto degreesOfFreedom = [](auto &obj) { return &obj.degreesOfFreedom; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto constant1d = [](auto &obj) { return &obj.constant1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; +} + +using CPPXYs1d = general::XYs1d; +using CPPConstant1d = general::Constant1d; +using CPPRegions1d = general::Regions1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstWidth +WidthDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Width +WidthDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstWidth +WidthCreateConst( + const char *const label, + const char *const resonanceReaction, + const int degreesOfFreedom, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2Width handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + resonanceReaction, + degreesOfFreedom, + detail::tocpp(XYs1d), + detail::tocpp(constant1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Create, general, non-const +Handle2Width +WidthCreate( + const char *const label, + const char *const resonanceReaction, + const int degreesOfFreedom, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstRegions1d regions1d +) { + ConstHandle2Width handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + resonanceReaction, + degreesOfFreedom, + detail::tocpp(XYs1d), + detail::tocpp(constant1d), + detail::tocpp(regions1d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +WidthAssign(ConstHandle2Width self, ConstHandle2ConstWidth from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +WidthDelete(ConstHandle2ConstWidth self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +WidthRead(ConstHandle2Width self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +WidthWrite(ConstHandle2ConstWidth self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +WidthPrint(ConstHandle2ConstWidth self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +WidthPrintXML(ConstHandle2ConstWidth self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +WidthPrintJSON(ConstHandle2ConstWidth self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +WidthLabelHas(ConstHandle2ConstWidth self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +WidthLabelGet(ConstHandle2ConstWidth self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +WidthLabelSet(ConstHandle2Width self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: resonanceReaction +// ----------------------------------------------------------------------------- + +// Has +int +WidthResonanceReactionHas(ConstHandle2ConstWidth self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResonanceReactionHas", self, extract::resonanceReaction); +} + +// Get +// Returns by value +const char * +WidthResonanceReactionGet(ConstHandle2ConstWidth self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonanceReactionGet", self, extract::resonanceReaction); +} + +// Set +void +WidthResonanceReactionSet(ConstHandle2Width self, const char *const resonanceReaction) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResonanceReactionSet", self, extract::resonanceReaction, resonanceReaction); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: degreesOfFreedom +// ----------------------------------------------------------------------------- + +// Has +int +WidthDegreesOfFreedomHas(ConstHandle2ConstWidth self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DegreesOfFreedomHas", self, extract::degreesOfFreedom); +} + +// Get +// Returns by value +int +WidthDegreesOfFreedomGet(ConstHandle2ConstWidth self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DegreesOfFreedomGet", self, extract::degreesOfFreedom); +} + +// Set +void +WidthDegreesOfFreedomSet(ConstHandle2Width self, const int degreesOfFreedom) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DegreesOfFreedomSet", self, extract::degreesOfFreedom, degreesOfFreedom); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +WidthXYs1dHas(ConstHandle2ConstWidth self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +WidthXYs1dGetConst(ConstHandle2ConstWidth self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +WidthXYs1dGet(ConstHandle2Width self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +WidthXYs1dSet(ConstHandle2Width self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// Has +int +WidthConstant1dHas(ConstHandle2ConstWidth self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Constant1dHas", self, extract::constant1d); +} + +// Get, const +Handle2ConstConstant1d +WidthConstant1dGetConst(ConstHandle2ConstWidth self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGetConst", self, extract::constant1d); +} + +// Get, non-const +Handle2Constant1d +WidthConstant1dGet(ConstHandle2Width self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Constant1dGet", self, extract::constant1d); +} + +// Set +void +WidthConstant1dSet(ConstHandle2Width self, ConstHandle2ConstConstant1d constant1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Constant1dSet", self, extract::constant1d, constant1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +WidthRegions1dHas(ConstHandle2ConstWidth self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +WidthRegions1dGetConst(ConstHandle2ConstWidth self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +WidthRegions1dGet(ConstHandle2Width self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +WidthRegions1dSet(ConstHandle2Width self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Width/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Width.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Width.h new file mode 100644 index 000000000..873ec79a8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Width.h @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Width is the basic handle type in this file. Example: +// // Create a default Width object: +// Width handle = WidthDefault(); +// Functions involving Width are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_WIDTH +#define C_INTERFACE_GNDS_V2_0_GENERAL_WIDTH + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/Constant1d.h" +#include "v2.0/general/Regions1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct WidthClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Width +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct WidthClass *Width; + +// --- Const-aware handles. +typedef const struct WidthClass *const ConstHandle2ConstWidth; +typedef struct WidthClass *const ConstHandle2Width; +typedef const struct WidthClass * Handle2ConstWidth; +typedef struct WidthClass * Handle2Width; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstWidth +WidthDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Width +WidthDefault(); + +// --- Create, general, const +extern_c Handle2ConstWidth +WidthCreateConst( + const char *const label, + const char *const resonanceReaction, + const int degreesOfFreedom, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Create, general, non-const +extern_c Handle2Width +WidthCreate( + const char *const label, + const char *const resonanceReaction, + const int degreesOfFreedom, + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstConstant1d constant1d, + ConstHandle2ConstRegions1d regions1d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +WidthAssign(ConstHandle2Width self, ConstHandle2ConstWidth from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +WidthDelete(ConstHandle2ConstWidth self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +WidthRead(ConstHandle2Width self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +WidthWrite(ConstHandle2ConstWidth self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +WidthPrint(ConstHandle2ConstWidth self); + +// +++ Print to standard output, as XML +extern_c int +WidthPrintXML(ConstHandle2ConstWidth self); + +// +++ Print to standard output, as JSON +extern_c int +WidthPrintJSON(ConstHandle2ConstWidth self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WidthLabelHas(ConstHandle2ConstWidth self); + +// +++ Get +// +++ Returns by value +extern_c const char * +WidthLabelGet(ConstHandle2ConstWidth self); + +// +++ Set +extern_c void +WidthLabelSet(ConstHandle2Width self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: resonanceReaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WidthResonanceReactionHas(ConstHandle2ConstWidth self); + +// +++ Get +// +++ Returns by value +extern_c const char * +WidthResonanceReactionGet(ConstHandle2ConstWidth self); + +// +++ Set +extern_c void +WidthResonanceReactionSet(ConstHandle2Width self, const char *const resonanceReaction); + + +// ----------------------------------------------------------------------------- +// Metadatum: degreesOfFreedom +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WidthDegreesOfFreedomHas(ConstHandle2ConstWidth self); + +// +++ Get +// +++ Returns by value +extern_c int +WidthDegreesOfFreedomGet(ConstHandle2ConstWidth self); + +// +++ Set +extern_c void +WidthDegreesOfFreedomSet(ConstHandle2Width self, const int degreesOfFreedom); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WidthXYs1dHas(ConstHandle2ConstWidth self); + +// --- Get, const +extern_c Handle2ConstXYs1d +WidthXYs1dGetConst(ConstHandle2ConstWidth self); + +// +++ Get, non-const +extern_c Handle2XYs1d +WidthXYs1dGet(ConstHandle2Width self); + +// +++ Set +extern_c void +WidthXYs1dSet(ConstHandle2Width self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: constant1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WidthConstant1dHas(ConstHandle2ConstWidth self); + +// --- Get, const +extern_c Handle2ConstConstant1d +WidthConstant1dGetConst(ConstHandle2ConstWidth self); + +// +++ Get, non-const +extern_c Handle2Constant1d +WidthConstant1dGet(ConstHandle2Width self); + +// +++ Set +extern_c void +WidthConstant1dSet(ConstHandle2Width self, ConstHandle2ConstConstant1d constant1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WidthRegions1dHas(ConstHandle2ConstWidth self); + +// --- Get, const +extern_c Handle2ConstRegions1d +WidthRegions1dGetConst(ConstHandle2ConstWidth self); + +// +++ Get, non-const +extern_c Handle2Regions1d +WidthRegions1dGet(ConstHandle2Width self); + +// +++ Set +extern_c void +WidthRegions1dSet(ConstHandle2Width self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Width/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Width/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Width/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Width/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Width/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Widths.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Widths.cpp new file mode 100644 index 000000000..673408a7d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Widths.cpp @@ -0,0 +1,359 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Widths.hpp" +#include "Widths.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = WidthsClass; +using CPP = multigroup::Widths; + +static const std::string CLASSNAME = "Widths"; + +namespace extract { + static auto width = [](auto &obj) { return &obj.width; }; +} + +using CPPWidth = general::Width; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstWidths +WidthsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Widths +WidthsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstWidths +WidthsCreateConst( + ConstHandle2Width *const width, const size_t widthSize +) { + ConstHandle2Widths handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t WidthN = 0; WidthN < widthSize; ++WidthN) + WidthsWidthAdd(handle, width[WidthN]); + return handle; +} + +// Create, general, non-const +Handle2Widths +WidthsCreate( + ConstHandle2Width *const width, const size_t widthSize +) { + ConstHandle2Widths handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t WidthN = 0; WidthN < widthSize; ++WidthN) + WidthsWidthAdd(handle, width[WidthN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +WidthsAssign(ConstHandle2Widths self, ConstHandle2ConstWidths from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +WidthsDelete(ConstHandle2ConstWidths self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +WidthsRead(ConstHandle2Widths self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +WidthsWrite(ConstHandle2ConstWidths self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +WidthsPrint(ConstHandle2ConstWidths self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +WidthsPrintXML(ConstHandle2ConstWidths self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +WidthsPrintJSON(ConstHandle2ConstWidths self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: width +// ----------------------------------------------------------------------------- + +// Has +int +WidthsWidthHas(ConstHandle2ConstWidths self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"WidthHas", self, extract::width); +} + +// Clear +void +WidthsWidthClear(ConstHandle2Widths self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"WidthClear", self, extract::width); +} + +// Size +size_t +WidthsWidthSize(ConstHandle2ConstWidths self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"WidthSize", self, extract::width); +} + +// Add +void +WidthsWidthAdd(ConstHandle2Widths self, ConstHandle2ConstWidth width) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"WidthAdd", self, extract::width, width); +} + +// Get, by index \in [0,size), const +Handle2ConstWidth +WidthsWidthGetConst(ConstHandle2ConstWidths self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"WidthGetConst", self, extract::width, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Width +WidthsWidthGet(ConstHandle2Widths self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"WidthGet", self, extract::width, index_); +} + +// Set, by index \in [0,size) +void +WidthsWidthSet( + ConstHandle2Widths self, + const size_t index_, + ConstHandle2ConstWidth width +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"WidthSet", self, extract::width, index_, width); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +WidthsWidthHasByLabel( + ConstHandle2ConstWidths self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"WidthHasByLabel", + self, extract::width, meta::label, label); +} + +// Get, by label, const +Handle2ConstWidth +WidthsWidthGetByLabelConst( + ConstHandle2ConstWidths self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"WidthGetByLabelConst", + self, extract::width, meta::label, label); +} + +// Get, by label, non-const +Handle2Width +WidthsWidthGetByLabel( + ConstHandle2Widths self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"WidthGetByLabel", + self, extract::width, meta::label, label); +} + +// Set, by label +void +WidthsWidthSetByLabel( + ConstHandle2Widths self, + const char *const label, + ConstHandle2ConstWidth width +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"WidthSetByLabel", + self, extract::width, meta::label, label, width); +} + +// ------------------------ +// Re: metadatum resonanceReaction +// ------------------------ + +// Has, by resonanceReaction +int +WidthsWidthHasByResonanceReaction( + ConstHandle2ConstWidths self, + const char *const resonanceReaction +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"WidthHasByResonanceReaction", + self, extract::width, meta::resonanceReaction, resonanceReaction); +} + +// Get, by resonanceReaction, const +Handle2ConstWidth +WidthsWidthGetByResonanceReactionConst( + ConstHandle2ConstWidths self, + const char *const resonanceReaction +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"WidthGetByResonanceReactionConst", + self, extract::width, meta::resonanceReaction, resonanceReaction); +} + +// Get, by resonanceReaction, non-const +Handle2Width +WidthsWidthGetByResonanceReaction( + ConstHandle2Widths self, + const char *const resonanceReaction +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"WidthGetByResonanceReaction", + self, extract::width, meta::resonanceReaction, resonanceReaction); +} + +// Set, by resonanceReaction +void +WidthsWidthSetByResonanceReaction( + ConstHandle2Widths self, + const char *const resonanceReaction, + ConstHandle2ConstWidth width +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"WidthSetByResonanceReaction", + self, extract::width, meta::resonanceReaction, resonanceReaction, width); +} + +// ------------------------ +// Re: metadatum degreesOfFreedom +// ------------------------ + +// Has, by degreesOfFreedom +int +WidthsWidthHasByDegreesOfFreedom( + ConstHandle2ConstWidths self, + const int degreesOfFreedom +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"WidthHasByDegreesOfFreedom", + self, extract::width, meta::degreesOfFreedom, degreesOfFreedom); +} + +// Get, by degreesOfFreedom, const +Handle2ConstWidth +WidthsWidthGetByDegreesOfFreedomConst( + ConstHandle2ConstWidths self, + const int degreesOfFreedom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"WidthGetByDegreesOfFreedomConst", + self, extract::width, meta::degreesOfFreedom, degreesOfFreedom); +} + +// Get, by degreesOfFreedom, non-const +Handle2Width +WidthsWidthGetByDegreesOfFreedom( + ConstHandle2Widths self, + const int degreesOfFreedom +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"WidthGetByDegreesOfFreedom", + self, extract::width, meta::degreesOfFreedom, degreesOfFreedom); +} + +// Set, by degreesOfFreedom +void +WidthsWidthSetByDegreesOfFreedom( + ConstHandle2Widths self, + const int degreesOfFreedom, + ConstHandle2ConstWidth width +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"WidthSetByDegreesOfFreedom", + self, extract::width, meta::degreesOfFreedom, degreesOfFreedom, width); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Widths/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Widths.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Widths.h new file mode 100644 index 000000000..9b6f14758 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Widths.h @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Widths is the basic handle type in this file. Example: +// // Create a default Widths object: +// Widths handle = WidthsDefault(); +// Functions involving Widths are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_WIDTHS +#define C_INTERFACE_GNDS_V2_0_GENERAL_WIDTHS + +#include "GNDStk.h" +#include "v2.0/general/Width.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct WidthsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Widths +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct WidthsClass *Widths; + +// --- Const-aware handles. +typedef const struct WidthsClass *const ConstHandle2ConstWidths; +typedef struct WidthsClass *const ConstHandle2Widths; +typedef const struct WidthsClass * Handle2ConstWidths; +typedef struct WidthsClass * Handle2Widths; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstWidths +WidthsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Widths +WidthsDefault(); + +// --- Create, general, const +extern_c Handle2ConstWidths +WidthsCreateConst( + ConstHandle2Width *const width, const size_t widthSize +); + +// +++ Create, general, non-const +extern_c Handle2Widths +WidthsCreate( + ConstHandle2Width *const width, const size_t widthSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +WidthsAssign(ConstHandle2Widths self, ConstHandle2ConstWidths from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +WidthsDelete(ConstHandle2ConstWidths self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +WidthsRead(ConstHandle2Widths self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +WidthsWrite(ConstHandle2ConstWidths self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +WidthsPrint(ConstHandle2ConstWidths self); + +// +++ Print to standard output, as XML +extern_c int +WidthsPrintXML(ConstHandle2ConstWidths self); + +// +++ Print to standard output, as JSON +extern_c int +WidthsPrintJSON(ConstHandle2ConstWidths self); + + +// ----------------------------------------------------------------------------- +// Child: width +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +WidthsWidthHas(ConstHandle2ConstWidths self); + +// +++ Clear +extern_c void +WidthsWidthClear(ConstHandle2Widths self); + +// +++ Size +extern_c size_t +WidthsWidthSize(ConstHandle2ConstWidths self); + +// +++ Add +extern_c void +WidthsWidthAdd(ConstHandle2Widths self, ConstHandle2ConstWidth width); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstWidth +WidthsWidthGetConst(ConstHandle2ConstWidths self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Width +WidthsWidthGet(ConstHandle2Widths self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +WidthsWidthSet( + ConstHandle2Widths self, + const size_t index_, + ConstHandle2ConstWidth width +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +WidthsWidthHasByLabel( + ConstHandle2ConstWidths self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstWidth +WidthsWidthGetByLabelConst( + ConstHandle2ConstWidths self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Width +WidthsWidthGetByLabel( + ConstHandle2Widths self, + const char *const label +); + +// +++ Set, by label +extern_c void +WidthsWidthSetByLabel( + ConstHandle2Widths self, + const char *const label, + ConstHandle2ConstWidth width +); + +// ------------------------ +// Re: metadatum resonanceReaction +// ------------------------ + +// +++ Has, by resonanceReaction +extern_c int +WidthsWidthHasByResonanceReaction( + ConstHandle2ConstWidths self, + const char *const resonanceReaction +); + +// --- Get, by resonanceReaction, const +extern_c Handle2ConstWidth +WidthsWidthGetByResonanceReactionConst( + ConstHandle2ConstWidths self, + const char *const resonanceReaction +); + +// +++ Get, by resonanceReaction, non-const +extern_c Handle2Width +WidthsWidthGetByResonanceReaction( + ConstHandle2Widths self, + const char *const resonanceReaction +); + +// +++ Set, by resonanceReaction +extern_c void +WidthsWidthSetByResonanceReaction( + ConstHandle2Widths self, + const char *const resonanceReaction, + ConstHandle2ConstWidth width +); + +// ------------------------ +// Re: metadatum degreesOfFreedom +// ------------------------ + +// +++ Has, by degreesOfFreedom +extern_c int +WidthsWidthHasByDegreesOfFreedom( + ConstHandle2ConstWidths self, + const int degreesOfFreedom +); + +// --- Get, by degreesOfFreedom, const +extern_c Handle2ConstWidth +WidthsWidthGetByDegreesOfFreedomConst( + ConstHandle2ConstWidths self, + const int degreesOfFreedom +); + +// +++ Get, by degreesOfFreedom, non-const +extern_c Handle2Width +WidthsWidthGetByDegreesOfFreedom( + ConstHandle2Widths self, + const int degreesOfFreedom +); + +// +++ Set, by degreesOfFreedom +extern_c void +WidthsWidthSetByDegreesOfFreedom( + ConstHandle2Widths self, + const int degreesOfFreedom, + ConstHandle2ConstWidth width +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Widths/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Widths/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Widths/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Widths/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Widths/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs1d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs1d.cpp new file mode 100644 index 000000000..190dae2a4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs1d.cpp @@ -0,0 +1,407 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "XYs1d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = XYs1dClass; +using CPP = multigroup::XYs1d; + +static const std::string CLASSNAME = "XYs1d"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto index = [](auto &obj) { return &obj.index; }; + static auto interpolation = [](auto &obj) { return &obj.interpolation; }; + static auto outerDomainValue = [](auto &obj) { return &obj.outerDomainValue; }; + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto values = [](auto &obj) { return &obj.values; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPAxes = general::Axes; +using CPPValues = general::Values; +using CPPUncertainty = general::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstXYs1d +XYs1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2XYs1d +XYs1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstXYs1d +XYs1dCreateConst( + const char *const label, + const int index, + const char *const interpolation, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2XYs1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + index, + interpolation, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(values), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general, non-const +Handle2XYs1d +XYs1dCreate( + const char *const label, + const int index, + const char *const interpolation, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2XYs1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + index, + interpolation, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(values), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +XYs1dAssign(ConstHandle2XYs1d self, ConstHandle2ConstXYs1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +XYs1dDelete(ConstHandle2ConstXYs1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +XYs1dRead(ConstHandle2XYs1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +XYs1dWrite(ConstHandle2ConstXYs1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +XYs1dPrint(ConstHandle2ConstXYs1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +XYs1dPrintXML(ConstHandle2ConstXYs1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +XYs1dPrintJSON(ConstHandle2ConstXYs1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dLabelHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +XYs1dLabelGet(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +XYs1dLabelSet(ConstHandle2XYs1d self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dIndexHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IndexHas", self, extract::index); +} + +// Get +// Returns by value +int +XYs1dIndexGet(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +XYs1dIndexSet(ConstHandle2XYs1d self, const int index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dInterpolationHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InterpolationHas", self, extract::interpolation); +} + +// Get +// Returns by value +const char * +XYs1dInterpolationGet(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationGet", self, extract::interpolation); +} + +// Set +void +XYs1dInterpolationSet(ConstHandle2XYs1d self, const char *const interpolation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InterpolationSet", self, extract::interpolation, interpolation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dOuterDomainValueHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +double +XYs1dOuterDomainValueGet(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +XYs1dOuterDomainValueSet(ConstHandle2XYs1d self, const double outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dAxesHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +XYs1dAxesGetConst(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +XYs1dAxesGet(ConstHandle2XYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +XYs1dAxesSet(ConstHandle2XYs1d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dValuesHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +XYs1dValuesGetConst(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +XYs1dValuesGet(ConstHandle2XYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +XYs1dValuesSet(ConstHandle2XYs1d self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +XYs1dUncertaintyHas(ConstHandle2ConstXYs1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +XYs1dUncertaintyGetConst(ConstHandle2ConstXYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +XYs1dUncertaintyGet(ConstHandle2XYs1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +XYs1dUncertaintySet(ConstHandle2XYs1d self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/XYs1d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs1d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs1d.h new file mode 100644 index 000000000..bddadedb2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs1d.h @@ -0,0 +1,289 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// XYs1d is the basic handle type in this file. Example: +// // Create a default XYs1d object: +// XYs1d handle = XYs1dDefault(); +// Functions involving XYs1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_XYS1D +#define C_INTERFACE_GNDS_V2_0_GENERAL_XYS1D + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" +#include "v2.0/general/Values.h" +#include "v2.0/general/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct XYs1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ XYs1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct XYs1dClass *XYs1d; + +// --- Const-aware handles. +typedef const struct XYs1dClass *const ConstHandle2ConstXYs1d; +typedef struct XYs1dClass *const ConstHandle2XYs1d; +typedef const struct XYs1dClass * Handle2ConstXYs1d; +typedef struct XYs1dClass * Handle2XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstXYs1d +XYs1dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2XYs1d +XYs1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstXYs1d +XYs1dCreateConst( + const char *const label, + const int index, + const char *const interpolation, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general, non-const +extern_c Handle2XYs1d +XYs1dCreate( + const char *const label, + const int index, + const char *const interpolation, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +XYs1dAssign(ConstHandle2XYs1d self, ConstHandle2ConstXYs1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +XYs1dDelete(ConstHandle2ConstXYs1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +XYs1dRead(ConstHandle2XYs1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +XYs1dWrite(ConstHandle2ConstXYs1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +XYs1dPrint(ConstHandle2ConstXYs1d self); + +// +++ Print to standard output, as XML +extern_c int +XYs1dPrintXML(ConstHandle2ConstXYs1d self); + +// +++ Print to standard output, as JSON +extern_c int +XYs1dPrintJSON(ConstHandle2ConstXYs1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dLabelHas(ConstHandle2ConstXYs1d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +XYs1dLabelGet(ConstHandle2ConstXYs1d self); + +// +++ Set +extern_c void +XYs1dLabelSet(ConstHandle2XYs1d self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dIndexHas(ConstHandle2ConstXYs1d self); + +// +++ Get +// +++ Returns by value +extern_c int +XYs1dIndexGet(ConstHandle2ConstXYs1d self); + +// +++ Set +extern_c void +XYs1dIndexSet(ConstHandle2XYs1d self, const int index); + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dInterpolationHas(ConstHandle2ConstXYs1d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +XYs1dInterpolationGet(ConstHandle2ConstXYs1d self); + +// +++ Set +extern_c void +XYs1dInterpolationSet(ConstHandle2XYs1d self, const char *const interpolation); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dOuterDomainValueHas(ConstHandle2ConstXYs1d self); + +// +++ Get +// +++ Returns by value +extern_c double +XYs1dOuterDomainValueGet(ConstHandle2ConstXYs1d self); + +// +++ Set +extern_c void +XYs1dOuterDomainValueSet(ConstHandle2XYs1d self, const double outerDomainValue); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dAxesHas(ConstHandle2ConstXYs1d self); + +// --- Get, const +extern_c Handle2ConstAxes +XYs1dAxesGetConst(ConstHandle2ConstXYs1d self); + +// +++ Get, non-const +extern_c Handle2Axes +XYs1dAxesGet(ConstHandle2XYs1d self); + +// +++ Set +extern_c void +XYs1dAxesSet(ConstHandle2XYs1d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dValuesHas(ConstHandle2ConstXYs1d self); + +// --- Get, const +extern_c Handle2ConstValues +XYs1dValuesGetConst(ConstHandle2ConstXYs1d self); + +// +++ Get, non-const +extern_c Handle2Values +XYs1dValuesGet(ConstHandle2XYs1d self); + +// +++ Set +extern_c void +XYs1dValuesSet(ConstHandle2XYs1d self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs1dUncertaintyHas(ConstHandle2ConstXYs1d self); + +// --- Get, const +extern_c Handle2ConstUncertainty +XYs1dUncertaintyGetConst(ConstHandle2ConstXYs1d self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +XYs1dUncertaintyGet(ConstHandle2XYs1d self); + +// +++ Set +extern_c void +XYs1dUncertaintySet(ConstHandle2XYs1d self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/XYs1d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs1d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs1d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs2d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs2d.cpp new file mode 100644 index 000000000..e5ad86710 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs2d.cpp @@ -0,0 +1,407 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/XYs2d.hpp" +#include "XYs2d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = XYs2dClass; +using CPP = multigroup::XYs2d; + +static const std::string CLASSNAME = "XYs2d"; + +namespace extract { + static auto index = [](auto &obj) { return &obj.index; }; + static auto interpolation = [](auto &obj) { return &obj.interpolation; }; + static auto interpolationQualifier = [](auto &obj) { return &obj.interpolationQualifier; }; + static auto outerDomainValue = [](auto &obj) { return &obj.outerDomainValue; }; + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto function1ds = [](auto &obj) { return &obj.function1ds; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPAxes = general::Axes; +using CPPFunction1ds = general::Function1ds; +using CPPUncertainty = general::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstXYs2d +XYs2dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2XYs2d +XYs2dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstXYs2d +XYs2dCreateConst( + const int index, + const char *const interpolation, + const char *const interpolationQualifier, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction1ds function1ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2XYs2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + index, + interpolation, + interpolationQualifier, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(function1ds), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general, non-const +Handle2XYs2d +XYs2dCreate( + const int index, + const char *const interpolation, + const char *const interpolationQualifier, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction1ds function1ds, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2XYs2d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + index, + interpolation, + interpolationQualifier, + outerDomainValue, + detail::tocpp(axes), + detail::tocpp(function1ds), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +XYs2dAssign(ConstHandle2XYs2d self, ConstHandle2ConstXYs2d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +XYs2dDelete(ConstHandle2ConstXYs2d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +XYs2dRead(ConstHandle2XYs2d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +XYs2dWrite(ConstHandle2ConstXYs2d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +XYs2dPrint(ConstHandle2ConstXYs2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +XYs2dPrintXML(ConstHandle2ConstXYs2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +XYs2dPrintJSON(ConstHandle2ConstXYs2d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// Has +int +XYs2dIndexHas(ConstHandle2ConstXYs2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IndexHas", self, extract::index); +} + +// Get +// Returns by value +int +XYs2dIndexGet(ConstHandle2ConstXYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IndexGet", self, extract::index); +} + +// Set +void +XYs2dIndexSet(ConstHandle2XYs2d self, const int index) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IndexSet", self, extract::index, index); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// Has +int +XYs2dInterpolationHas(ConstHandle2ConstXYs2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InterpolationHas", self, extract::interpolation); +} + +// Get +// Returns by value +const char * +XYs2dInterpolationGet(ConstHandle2ConstXYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationGet", self, extract::interpolation); +} + +// Set +void +XYs2dInterpolationSet(ConstHandle2XYs2d self, const char *const interpolation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InterpolationSet", self, extract::interpolation, interpolation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolationQualifier +// ----------------------------------------------------------------------------- + +// Has +int +XYs2dInterpolationQualifierHas(ConstHandle2ConstXYs2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InterpolationQualifierHas", self, extract::interpolationQualifier); +} + +// Get +// Returns by value +const char * +XYs2dInterpolationQualifierGet(ConstHandle2ConstXYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationQualifierGet", self, extract::interpolationQualifier); +} + +// Set +void +XYs2dInterpolationQualifierSet(ConstHandle2XYs2d self, const char *const interpolationQualifier) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InterpolationQualifierSet", self, extract::interpolationQualifier, interpolationQualifier); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// Has +int +XYs2dOuterDomainValueHas(ConstHandle2ConstXYs2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OuterDomainValueHas", self, extract::outerDomainValue); +} + +// Get +// Returns by value +double +XYs2dOuterDomainValueGet(ConstHandle2ConstXYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OuterDomainValueGet", self, extract::outerDomainValue); +} + +// Set +void +XYs2dOuterDomainValueSet(ConstHandle2XYs2d self, const double outerDomainValue) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OuterDomainValueSet", self, extract::outerDomainValue, outerDomainValue); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +XYs2dAxesHas(ConstHandle2ConstXYs2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +XYs2dAxesGetConst(ConstHandle2ConstXYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +XYs2dAxesGet(ConstHandle2XYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +XYs2dAxesSet(ConstHandle2XYs2d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: function1ds +// ----------------------------------------------------------------------------- + +// Has +int +XYs2dFunction1dsHas(ConstHandle2ConstXYs2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Function1dsHas", self, extract::function1ds); +} + +// Get, const +Handle2ConstFunction1ds +XYs2dFunction1dsGetConst(ConstHandle2ConstXYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Function1dsGetConst", self, extract::function1ds); +} + +// Get, non-const +Handle2Function1ds +XYs2dFunction1dsGet(ConstHandle2XYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Function1dsGet", self, extract::function1ds); +} + +// Set +void +XYs2dFunction1dsSet(ConstHandle2XYs2d self, ConstHandle2ConstFunction1ds function1ds) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Function1dsSet", self, extract::function1ds, function1ds); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +XYs2dUncertaintyHas(ConstHandle2ConstXYs2d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +XYs2dUncertaintyGetConst(ConstHandle2ConstXYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +XYs2dUncertaintyGet(ConstHandle2XYs2d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +XYs2dUncertaintySet(ConstHandle2XYs2d self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/XYs2d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs2d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs2d.h new file mode 100644 index 000000000..5914101d3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs2d.h @@ -0,0 +1,289 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// XYs2d is the basic handle type in this file. Example: +// // Create a default XYs2d object: +// XYs2d handle = XYs2dDefault(); +// Functions involving XYs2d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_XYS2D +#define C_INTERFACE_GNDS_V2_0_GENERAL_XYS2D + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" +#include "v2.0/general/Function1ds.h" +#include "v2.0/general/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct XYs2dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ XYs2d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct XYs2dClass *XYs2d; + +// --- Const-aware handles. +typedef const struct XYs2dClass *const ConstHandle2ConstXYs2d; +typedef struct XYs2dClass *const ConstHandle2XYs2d; +typedef const struct XYs2dClass * Handle2ConstXYs2d; +typedef struct XYs2dClass * Handle2XYs2d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstXYs2d +XYs2dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2XYs2d +XYs2dDefault(); + +// --- Create, general, const +extern_c Handle2ConstXYs2d +XYs2dCreateConst( + const int index, + const char *const interpolation, + const char *const interpolationQualifier, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction1ds function1ds, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general, non-const +extern_c Handle2XYs2d +XYs2dCreate( + const int index, + const char *const interpolation, + const char *const interpolationQualifier, + const double outerDomainValue, + ConstHandle2ConstAxes axes, + ConstHandle2ConstFunction1ds function1ds, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +XYs2dAssign(ConstHandle2XYs2d self, ConstHandle2ConstXYs2d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +XYs2dDelete(ConstHandle2ConstXYs2d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +XYs2dRead(ConstHandle2XYs2d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +XYs2dWrite(ConstHandle2ConstXYs2d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +XYs2dPrint(ConstHandle2ConstXYs2d self); + +// +++ Print to standard output, as XML +extern_c int +XYs2dPrintXML(ConstHandle2ConstXYs2d self); + +// +++ Print to standard output, as JSON +extern_c int +XYs2dPrintJSON(ConstHandle2ConstXYs2d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: index +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs2dIndexHas(ConstHandle2ConstXYs2d self); + +// +++ Get +// +++ Returns by value +extern_c int +XYs2dIndexGet(ConstHandle2ConstXYs2d self); + +// +++ Set +extern_c void +XYs2dIndexSet(ConstHandle2XYs2d self, const int index); + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs2dInterpolationHas(ConstHandle2ConstXYs2d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +XYs2dInterpolationGet(ConstHandle2ConstXYs2d self); + +// +++ Set +extern_c void +XYs2dInterpolationSet(ConstHandle2XYs2d self, const char *const interpolation); + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolationQualifier +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs2dInterpolationQualifierHas(ConstHandle2ConstXYs2d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +XYs2dInterpolationQualifierGet(ConstHandle2ConstXYs2d self); + +// +++ Set +extern_c void +XYs2dInterpolationQualifierSet(ConstHandle2XYs2d self, const char *const interpolationQualifier); + + +// ----------------------------------------------------------------------------- +// Metadatum: outerDomainValue +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs2dOuterDomainValueHas(ConstHandle2ConstXYs2d self); + +// +++ Get +// +++ Returns by value +extern_c double +XYs2dOuterDomainValueGet(ConstHandle2ConstXYs2d self); + +// +++ Set +extern_c void +XYs2dOuterDomainValueSet(ConstHandle2XYs2d self, const double outerDomainValue); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs2dAxesHas(ConstHandle2ConstXYs2d self); + +// --- Get, const +extern_c Handle2ConstAxes +XYs2dAxesGetConst(ConstHandle2ConstXYs2d self); + +// +++ Get, non-const +extern_c Handle2Axes +XYs2dAxesGet(ConstHandle2XYs2d self); + +// +++ Set +extern_c void +XYs2dAxesSet(ConstHandle2XYs2d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: function1ds +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs2dFunction1dsHas(ConstHandle2ConstXYs2d self); + +// --- Get, const +extern_c Handle2ConstFunction1ds +XYs2dFunction1dsGetConst(ConstHandle2ConstXYs2d self); + +// +++ Get, non-const +extern_c Handle2Function1ds +XYs2dFunction1dsGet(ConstHandle2XYs2d self); + +// +++ Set +extern_c void +XYs2dFunction1dsSet(ConstHandle2XYs2d self, ConstHandle2ConstFunction1ds function1ds); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs2dUncertaintyHas(ConstHandle2ConstXYs2d self); + +// --- Get, const +extern_c Handle2ConstUncertainty +XYs2dUncertaintyGetConst(ConstHandle2ConstXYs2d self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +XYs2dUncertaintyGet(ConstHandle2XYs2d self); + +// +++ Set +extern_c void +XYs2dUncertaintySet(ConstHandle2XYs2d self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/XYs2d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs2d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs2d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs2d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs2d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs3d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs3d.cpp new file mode 100644 index 000000000..f182e2598 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs3d.cpp @@ -0,0 +1,290 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/XYs3d.hpp" +#include "XYs3d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = XYs3dClass; +using CPP = multigroup::XYs3d; + +static const std::string CLASSNAME = "XYs3d"; + +namespace extract { + static auto interpolationQualifier = [](auto &obj) { return &obj.interpolationQualifier; }; + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto function2ds = [](auto &obj) { return &obj.function2ds; }; +} + +using CPPAxes = general::Axes; +using CPPFunction2ds = general::Function2ds; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstXYs3d +XYs3dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2XYs3d +XYs3dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstXYs3d +XYs3dCreateConst( + const char *const interpolationQualifier, + ConstHandle2ConstAxes axes, + ConstHandle2Function2ds *const function2ds, const size_t function2dsSize +) { + ConstHandle2XYs3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + interpolationQualifier, + detail::tocpp(axes), + std::vector{} + ); + for (size_t Function2dsN = 0; Function2dsN < function2dsSize; ++Function2dsN) + XYs3dFunction2dsAdd(handle, function2ds[Function2dsN]); + return handle; +} + +// Create, general, non-const +Handle2XYs3d +XYs3dCreate( + const char *const interpolationQualifier, + ConstHandle2ConstAxes axes, + ConstHandle2Function2ds *const function2ds, const size_t function2dsSize +) { + ConstHandle2XYs3d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + interpolationQualifier, + detail::tocpp(axes), + std::vector{} + ); + for (size_t Function2dsN = 0; Function2dsN < function2dsSize; ++Function2dsN) + XYs3dFunction2dsAdd(handle, function2ds[Function2dsN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +XYs3dAssign(ConstHandle2XYs3d self, ConstHandle2ConstXYs3d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +XYs3dDelete(ConstHandle2ConstXYs3d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +XYs3dRead(ConstHandle2XYs3d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +XYs3dWrite(ConstHandle2ConstXYs3d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +XYs3dPrint(ConstHandle2ConstXYs3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +XYs3dPrintXML(ConstHandle2ConstXYs3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +XYs3dPrintJSON(ConstHandle2ConstXYs3d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolationQualifier +// ----------------------------------------------------------------------------- + +// Has +int +XYs3dInterpolationQualifierHas(ConstHandle2ConstXYs3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InterpolationQualifierHas", self, extract::interpolationQualifier); +} + +// Get +// Returns by value +const char * +XYs3dInterpolationQualifierGet(ConstHandle2ConstXYs3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InterpolationQualifierGet", self, extract::interpolationQualifier); +} + +// Set +void +XYs3dInterpolationQualifierSet(ConstHandle2XYs3d self, const char *const interpolationQualifier) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InterpolationQualifierSet", self, extract::interpolationQualifier, interpolationQualifier); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +XYs3dAxesHas(ConstHandle2ConstXYs3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +XYs3dAxesGetConst(ConstHandle2ConstXYs3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +XYs3dAxesGet(ConstHandle2XYs3d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +XYs3dAxesSet(ConstHandle2XYs3d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: function2ds +// ----------------------------------------------------------------------------- + +// Has +int +XYs3dFunction2dsHas(ConstHandle2ConstXYs3d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Function2dsHas", self, extract::function2ds); +} + +// Clear +void +XYs3dFunction2dsClear(ConstHandle2XYs3d self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"Function2dsClear", self, extract::function2ds); +} + +// Size +size_t +XYs3dFunction2dsSize(ConstHandle2ConstXYs3d self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"Function2dsSize", self, extract::function2ds); +} + +// Add +void +XYs3dFunction2dsAdd(ConstHandle2XYs3d self, ConstHandle2ConstFunction2ds function2ds) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"Function2dsAdd", self, extract::function2ds, function2ds); +} + +// Get, by index \in [0,size), const +Handle2ConstFunction2ds +XYs3dFunction2dsGetConst(ConstHandle2ConstXYs3d self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"Function2dsGetConst", self, extract::function2ds, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Function2ds +XYs3dFunction2dsGet(ConstHandle2XYs3d self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"Function2dsGet", self, extract::function2ds, index_); +} + +// Set, by index \in [0,size) +void +XYs3dFunction2dsSet( + ConstHandle2XYs3d self, + const size_t index_, + ConstHandle2ConstFunction2ds function2ds +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"Function2dsSet", self, extract::function2ds, index_, function2ds); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/XYs3d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs3d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs3d.h new file mode 100644 index 000000000..3147ac9ad --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs3d.h @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// XYs3d is the basic handle type in this file. Example: +// // Create a default XYs3d object: +// XYs3d handle = XYs3dDefault(); +// Functions involving XYs3d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_XYS3D +#define C_INTERFACE_GNDS_V2_0_GENERAL_XYS3D + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" +#include "v2.0/general/Function2ds.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct XYs3dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ XYs3d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct XYs3dClass *XYs3d; + +// --- Const-aware handles. +typedef const struct XYs3dClass *const ConstHandle2ConstXYs3d; +typedef struct XYs3dClass *const ConstHandle2XYs3d; +typedef const struct XYs3dClass * Handle2ConstXYs3d; +typedef struct XYs3dClass * Handle2XYs3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstXYs3d +XYs3dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2XYs3d +XYs3dDefault(); + +// --- Create, general, const +extern_c Handle2ConstXYs3d +XYs3dCreateConst( + const char *const interpolationQualifier, + ConstHandle2ConstAxes axes, + ConstHandle2Function2ds *const function2ds, const size_t function2dsSize +); + +// +++ Create, general, non-const +extern_c Handle2XYs3d +XYs3dCreate( + const char *const interpolationQualifier, + ConstHandle2ConstAxes axes, + ConstHandle2Function2ds *const function2ds, const size_t function2dsSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +XYs3dAssign(ConstHandle2XYs3d self, ConstHandle2ConstXYs3d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +XYs3dDelete(ConstHandle2ConstXYs3d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +XYs3dRead(ConstHandle2XYs3d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +XYs3dWrite(ConstHandle2ConstXYs3d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +XYs3dPrint(ConstHandle2ConstXYs3d self); + +// +++ Print to standard output, as XML +extern_c int +XYs3dPrintXML(ConstHandle2ConstXYs3d self); + +// +++ Print to standard output, as JSON +extern_c int +XYs3dPrintJSON(ConstHandle2ConstXYs3d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: interpolationQualifier +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs3dInterpolationQualifierHas(ConstHandle2ConstXYs3d self); + +// +++ Get +// +++ Returns by value +extern_c const char * +XYs3dInterpolationQualifierGet(ConstHandle2ConstXYs3d self); + +// +++ Set +extern_c void +XYs3dInterpolationQualifierSet(ConstHandle2XYs3d self, const char *const interpolationQualifier); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs3dAxesHas(ConstHandle2ConstXYs3d self); + +// --- Get, const +extern_c Handle2ConstAxes +XYs3dAxesGetConst(ConstHandle2ConstXYs3d self); + +// +++ Get, non-const +extern_c Handle2Axes +XYs3dAxesGet(ConstHandle2XYs3d self); + +// +++ Set +extern_c void +XYs3dAxesSet(ConstHandle2XYs3d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: function2ds +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +XYs3dFunction2dsHas(ConstHandle2ConstXYs3d self); + +// +++ Clear +extern_c void +XYs3dFunction2dsClear(ConstHandle2XYs3d self); + +// +++ Size +extern_c size_t +XYs3dFunction2dsSize(ConstHandle2ConstXYs3d self); + +// +++ Add +extern_c void +XYs3dFunction2dsAdd(ConstHandle2XYs3d self, ConstHandle2ConstFunction2ds function2ds); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstFunction2ds +XYs3dFunction2dsGetConst(ConstHandle2ConstXYs3d self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Function2ds +XYs3dFunction2dsGet(ConstHandle2XYs3d self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +XYs3dFunction2dsSet( + ConstHandle2XYs3d self, + const size_t index_, + ConstHandle2ConstFunction2ds function2ds +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/XYs3d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs3d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs3d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs3d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/XYs3d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Yields.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Yields.cpp new file mode 100644 index 000000000..1e0685142 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Yields.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/general/Yields.hpp" +#include "Yields.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = YieldsClass; +using CPP = multigroup::Yields; + +static const std::string CLASSNAME = "Yields"; + +namespace extract { + static auto nuclides = [](auto &obj) { return &obj.nuclides; }; + static auto values = [](auto &obj) { return &obj.values; }; + static auto uncertainty = [](auto &obj) { return &obj.uncertainty; }; +} + +using CPPNuclides = reduced::Nuclides; +using CPPValues = general::Values; +using CPPUncertainty = general::Uncertainty; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstYields +YieldsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Yields +YieldsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstYields +YieldsCreateConst( + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Yields handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(nuclides), + detail::tocpp(values), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Create, general, non-const +Handle2Yields +YieldsCreate( + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +) { + ConstHandle2Yields handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(nuclides), + detail::tocpp(values), + detail::tocpp(uncertainty) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +YieldsAssign(ConstHandle2Yields self, ConstHandle2ConstYields from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +YieldsDelete(ConstHandle2ConstYields self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +YieldsRead(ConstHandle2Yields self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +YieldsWrite(ConstHandle2ConstYields self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +YieldsPrint(ConstHandle2ConstYields self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +YieldsPrintXML(ConstHandle2ConstYields self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +YieldsPrintJSON(ConstHandle2ConstYields self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: nuclides +// ----------------------------------------------------------------------------- + +// Has +int +YieldsNuclidesHas(ConstHandle2ConstYields self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NuclidesHas", self, extract::nuclides); +} + +// Get, const +Handle2ConstNuclides +YieldsNuclidesGetConst(ConstHandle2ConstYields self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclidesGetConst", self, extract::nuclides); +} + +// Get, non-const +Handle2Nuclides +YieldsNuclidesGet(ConstHandle2Yields self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NuclidesGet", self, extract::nuclides); +} + +// Set +void +YieldsNuclidesSet(ConstHandle2Yields self, ConstHandle2ConstNuclides nuclides) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NuclidesSet", self, extract::nuclides, nuclides); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +YieldsValuesHas(ConstHandle2ConstYields self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +YieldsValuesGetConst(ConstHandle2ConstYields self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +YieldsValuesGet(ConstHandle2Yields self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +YieldsValuesSet(ConstHandle2Yields self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// Has +int +YieldsUncertaintyHas(ConstHandle2ConstYields self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncertaintyHas", self, extract::uncertainty); +} + +// Get, const +Handle2ConstUncertainty +YieldsUncertaintyGetConst(ConstHandle2ConstYields self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGetConst", self, extract::uncertainty); +} + +// Get, non-const +Handle2Uncertainty +YieldsUncertaintyGet(ConstHandle2Yields self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncertaintyGet", self, extract::uncertainty); +} + +// Set +void +YieldsUncertaintySet(ConstHandle2Yields self, ConstHandle2ConstUncertainty uncertainty) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncertaintySet", self, extract::uncertainty, uncertainty); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Yields/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Yields.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Yields.h new file mode 100644 index 000000000..4adf493b9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Yields.h @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Yields is the basic handle type in this file. Example: +// // Create a default Yields object: +// Yields handle = YieldsDefault(); +// Functions involving Yields are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_GENERAL_YIELDS +#define C_INTERFACE_GNDS_V2_0_GENERAL_YIELDS + +#include "GNDStk.h" +#include "v2.0/reduced/Nuclides.h" +#include "v2.0/general/Values.h" +#include "v2.0/general/Uncertainty.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct YieldsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Yields +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct YieldsClass *Yields; + +// --- Const-aware handles. +typedef const struct YieldsClass *const ConstHandle2ConstYields; +typedef struct YieldsClass *const ConstHandle2Yields; +typedef const struct YieldsClass * Handle2ConstYields; +typedef struct YieldsClass * Handle2Yields; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstYields +YieldsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Yields +YieldsDefault(); + +// --- Create, general, const +extern_c Handle2ConstYields +YieldsCreateConst( + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Create, general, non-const +extern_c Handle2Yields +YieldsCreate( + ConstHandle2ConstNuclides nuclides, + ConstHandle2ConstValues values, + ConstHandle2ConstUncertainty uncertainty +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +YieldsAssign(ConstHandle2Yields self, ConstHandle2ConstYields from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +YieldsDelete(ConstHandle2ConstYields self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +YieldsRead(ConstHandle2Yields self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +YieldsWrite(ConstHandle2ConstYields self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +YieldsPrint(ConstHandle2ConstYields self); + +// +++ Print to standard output, as XML +extern_c int +YieldsPrintXML(ConstHandle2ConstYields self); + +// +++ Print to standard output, as JSON +extern_c int +YieldsPrintJSON(ConstHandle2ConstYields self); + + +// ----------------------------------------------------------------------------- +// Child: nuclides +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +YieldsNuclidesHas(ConstHandle2ConstYields self); + +// --- Get, const +extern_c Handle2ConstNuclides +YieldsNuclidesGetConst(ConstHandle2ConstYields self); + +// +++ Get, non-const +extern_c Handle2Nuclides +YieldsNuclidesGet(ConstHandle2Yields self); + +// +++ Set +extern_c void +YieldsNuclidesSet(ConstHandle2Yields self, ConstHandle2ConstNuclides nuclides); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +YieldsValuesHas(ConstHandle2ConstYields self); + +// --- Get, const +extern_c Handle2ConstValues +YieldsValuesGetConst(ConstHandle2ConstYields self); + +// +++ Get, non-const +extern_c Handle2Values +YieldsValuesGet(ConstHandle2Yields self); + +// +++ Set +extern_c void +YieldsValuesSet(ConstHandle2Yields self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Child: uncertainty +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +YieldsUncertaintyHas(ConstHandle2ConstYields self); + +// --- Get, const +extern_c Handle2ConstUncertainty +YieldsUncertaintyGetConst(ConstHandle2ConstYields self); + +// +++ Get, non-const +extern_c Handle2Uncertainty +YieldsUncertaintyGet(ConstHandle2Yields self); + +// +++ Set +extern_c void +YieldsUncertaintySet(ConstHandle2Yields self, ConstHandle2ConstUncertainty uncertainty); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/general/Yields/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Yields/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Yields/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Yields/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/general/Yields/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/CrossSection.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/CrossSection.cpp new file mode 100644 index 000000000..9daeeee61 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/CrossSection.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/reduced/CrossSection.hpp" +#include "CrossSection.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CrossSectionClass; +using CPP = multigroup::CrossSection; + +static const std::string CLASSNAME = "CrossSection"; + +namespace extract { + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; + static auto regions1d = [](auto &obj) { return &obj.regions1d; }; + static auto reference = [](auto &obj) { return &obj.reference; }; +} + +using CPPXYs1d = general::XYs1d; +using CPPRegions1d = general::Regions1d; +using CPPReference = general::Reference; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCrossSection +CrossSectionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2CrossSection +CrossSectionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCrossSection +CrossSectionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstReference reference +) { + ConstHandle2CrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(XYs1d), + detail::tocpp(regions1d), + detail::tocpp(reference) + ); + return handle; +} + +// Create, general, non-const +Handle2CrossSection +CrossSectionCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstReference reference +) { + ConstHandle2CrossSection handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(XYs1d), + detail::tocpp(regions1d), + detail::tocpp(reference) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CrossSectionAssign(ConstHandle2CrossSection self, ConstHandle2ConstCrossSection from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CrossSectionDelete(ConstHandle2ConstCrossSection self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CrossSectionRead(ConstHandle2CrossSection self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CrossSectionWrite(ConstHandle2ConstCrossSection self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CrossSectionPrint(ConstHandle2ConstCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CrossSectionPrintXML(ConstHandle2ConstCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CrossSectionPrintJSON(ConstHandle2ConstCrossSection self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionXYs1dHas(ConstHandle2ConstCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Get, const +Handle2ConstXYs1d +CrossSectionXYs1dGetConst(ConstHandle2ConstCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d); +} + +// Get, non-const +Handle2XYs1d +CrossSectionXYs1dGet(ConstHandle2CrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d); +} + +// Set +void +CrossSectionXYs1dSet(ConstHandle2CrossSection self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionRegions1dHas(ConstHandle2ConstCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Regions1dHas", self, extract::regions1d); +} + +// Get, const +Handle2ConstRegions1d +CrossSectionRegions1dGetConst(ConstHandle2ConstCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGetConst", self, extract::regions1d); +} + +// Get, non-const +Handle2Regions1d +CrossSectionRegions1dGet(ConstHandle2CrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Regions1dGet", self, extract::regions1d); +} + +// Set +void +CrossSectionRegions1dSet(ConstHandle2CrossSection self, ConstHandle2ConstRegions1d regions1d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Regions1dSet", self, extract::regions1d, regions1d); +} + + +// ----------------------------------------------------------------------------- +// Child: reference +// ----------------------------------------------------------------------------- + +// Has +int +CrossSectionReferenceHas(ConstHandle2ConstCrossSection self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ReferenceHas", self, extract::reference); +} + +// Get, const +Handle2ConstReference +CrossSectionReferenceGetConst(ConstHandle2ConstCrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReferenceGetConst", self, extract::reference); +} + +// Get, non-const +Handle2Reference +CrossSectionReferenceGet(ConstHandle2CrossSection self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReferenceGet", self, extract::reference); +} + +// Set +void +CrossSectionReferenceSet(ConstHandle2CrossSection self, ConstHandle2ConstReference reference) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ReferenceSet", self, extract::reference, reference); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/CrossSection/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/CrossSection.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/CrossSection.h new file mode 100644 index 000000000..5d3df4138 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/CrossSection.h @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CrossSection is the basic handle type in this file. Example: +// // Create a default CrossSection object: +// CrossSection handle = CrossSectionDefault(); +// Functions involving CrossSection are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_REDUCED_CROSSSECTION +#define C_INTERFACE_GNDS_V2_0_REDUCED_CROSSSECTION + +#include "GNDStk.h" +#include "v2.0/general/XYs1d.h" +#include "v2.0/general/Regions1d.h" +#include "v2.0/general/Reference.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CrossSectionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CrossSection +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CrossSectionClass *CrossSection; + +// --- Const-aware handles. +typedef const struct CrossSectionClass *const ConstHandle2ConstCrossSection; +typedef struct CrossSectionClass *const ConstHandle2CrossSection; +typedef const struct CrossSectionClass * Handle2ConstCrossSection; +typedef struct CrossSectionClass * Handle2CrossSection; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCrossSection +CrossSectionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2CrossSection +CrossSectionDefault(); + +// --- Create, general, const +extern_c Handle2ConstCrossSection +CrossSectionCreateConst( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstReference reference +); + +// +++ Create, general, non-const +extern_c Handle2CrossSection +CrossSectionCreate( + ConstHandle2ConstXYs1d XYs1d, + ConstHandle2ConstRegions1d regions1d, + ConstHandle2ConstReference reference +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CrossSectionAssign(ConstHandle2CrossSection self, ConstHandle2ConstCrossSection from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CrossSectionDelete(ConstHandle2ConstCrossSection self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CrossSectionRead(ConstHandle2CrossSection self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CrossSectionWrite(ConstHandle2ConstCrossSection self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CrossSectionPrint(ConstHandle2ConstCrossSection self); + +// +++ Print to standard output, as XML +extern_c int +CrossSectionPrintXML(ConstHandle2ConstCrossSection self); + +// +++ Print to standard output, as JSON +extern_c int +CrossSectionPrintJSON(ConstHandle2ConstCrossSection self); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionXYs1dHas(ConstHandle2ConstCrossSection self); + +// --- Get, const +extern_c Handle2ConstXYs1d +CrossSectionXYs1dGetConst(ConstHandle2ConstCrossSection self); + +// +++ Get, non-const +extern_c Handle2XYs1d +CrossSectionXYs1dGet(ConstHandle2CrossSection self); + +// +++ Set +extern_c void +CrossSectionXYs1dSet(ConstHandle2CrossSection self, ConstHandle2ConstXYs1d XYs1d); + + +// ----------------------------------------------------------------------------- +// Child: regions1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionRegions1dHas(ConstHandle2ConstCrossSection self); + +// --- Get, const +extern_c Handle2ConstRegions1d +CrossSectionRegions1dGetConst(ConstHandle2ConstCrossSection self); + +// +++ Get, non-const +extern_c Handle2Regions1d +CrossSectionRegions1dGet(ConstHandle2CrossSection self); + +// +++ Set +extern_c void +CrossSectionRegions1dSet(ConstHandle2CrossSection self, ConstHandle2ConstRegions1d regions1d); + + +// ----------------------------------------------------------------------------- +// Child: reference +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CrossSectionReferenceHas(ConstHandle2ConstCrossSection self); + +// --- Get, const +extern_c Handle2ConstReference +CrossSectionReferenceGetConst(ConstHandle2ConstCrossSection self); + +// +++ Get, non-const +extern_c Handle2Reference +CrossSectionReferenceGet(ConstHandle2CrossSection self); + +// +++ Set +extern_c void +CrossSectionReferenceSet(ConstHandle2CrossSection self, ConstHandle2ConstReference reference); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/CrossSection/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/CrossSection/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/CrossSection/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/CrossSection/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/CrossSection/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Distribution.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Distribution.cpp new file mode 100644 index 000000000..938727cf2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Distribution.cpp @@ -0,0 +1,353 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/reduced/Distribution.hpp" +#include "Distribution.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DistributionClass; +using CPP = multigroup::Distribution; + +static const std::string CLASSNAME = "Distribution"; + +namespace extract { + static auto thermalNeutronScatteringLaw = [](auto &obj) { return &obj.thermalNeutronScatteringLaw; }; + static auto uncorrelated = [](auto &obj) { return &obj.uncorrelated; }; + static auto unspecified = [](auto &obj) { return &obj.unspecified; }; + static auto XYs2d = [](auto &obj) { return &obj.XYs2d; }; + static auto branching3d = [](auto &obj) { return &obj.branching3d; }; +} + +using CPPThermalNeutronScatteringLaw = general::ThermalNeutronScatteringLaw; +using CPPUncorrelated = general::Uncorrelated; +using CPPUnspecified = general::Unspecified; +using CPPXYs2d = general::XYs2d; +using CPPBranching3d = general::Branching3d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDistribution +DistributionDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Distribution +DistributionDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDistribution +DistributionCreateConst( + ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw, + ConstHandle2ConstUncorrelated uncorrelated, + ConstHandle2ConstUnspecified unspecified, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstBranching3d branching3d +) { + ConstHandle2Distribution handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(thermalNeutronScatteringLaw), + detail::tocpp(uncorrelated), + detail::tocpp(unspecified), + detail::tocpp(XYs2d), + detail::tocpp(branching3d) + ); + return handle; +} + +// Create, general, non-const +Handle2Distribution +DistributionCreate( + ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw, + ConstHandle2ConstUncorrelated uncorrelated, + ConstHandle2ConstUnspecified unspecified, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstBranching3d branching3d +) { + ConstHandle2Distribution handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(thermalNeutronScatteringLaw), + detail::tocpp(uncorrelated), + detail::tocpp(unspecified), + detail::tocpp(XYs2d), + detail::tocpp(branching3d) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DistributionAssign(ConstHandle2Distribution self, ConstHandle2ConstDistribution from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DistributionDelete(ConstHandle2ConstDistribution self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DistributionRead(ConstHandle2Distribution self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DistributionWrite(ConstHandle2ConstDistribution self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DistributionPrint(ConstHandle2ConstDistribution self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DistributionPrintXML(ConstHandle2ConstDistribution self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DistributionPrintJSON(ConstHandle2ConstDistribution self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw +// ----------------------------------------------------------------------------- + +// Has +int +DistributionThermalNeutronScatteringLawHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLawHas", self, extract::thermalNeutronScatteringLaw); +} + +// Get, const +Handle2ConstThermalNeutronScatteringLaw +DistributionThermalNeutronScatteringLawGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLawGetConst", self, extract::thermalNeutronScatteringLaw); +} + +// Get, non-const +Handle2ThermalNeutronScatteringLaw +DistributionThermalNeutronScatteringLawGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLawGet", self, extract::thermalNeutronScatteringLaw); +} + +// Set +void +DistributionThermalNeutronScatteringLawSet(ConstHandle2Distribution self, ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ThermalNeutronScatteringLawSet", self, extract::thermalNeutronScatteringLaw, thermalNeutronScatteringLaw); +} + + +// ----------------------------------------------------------------------------- +// Child: uncorrelated +// ----------------------------------------------------------------------------- + +// Has +int +DistributionUncorrelatedHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UncorrelatedHas", self, extract::uncorrelated); +} + +// Get, const +Handle2ConstUncorrelated +DistributionUncorrelatedGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncorrelatedGetConst", self, extract::uncorrelated); +} + +// Get, non-const +Handle2Uncorrelated +DistributionUncorrelatedGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UncorrelatedGet", self, extract::uncorrelated); +} + +// Set +void +DistributionUncorrelatedSet(ConstHandle2Distribution self, ConstHandle2ConstUncorrelated uncorrelated) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UncorrelatedSet", self, extract::uncorrelated, uncorrelated); +} + + +// ----------------------------------------------------------------------------- +// Child: unspecified +// ----------------------------------------------------------------------------- + +// Has +int +DistributionUnspecifiedHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnspecifiedHas", self, extract::unspecified); +} + +// Get, const +Handle2ConstUnspecified +DistributionUnspecifiedGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnspecifiedGetConst", self, extract::unspecified); +} + +// Get, non-const +Handle2Unspecified +DistributionUnspecifiedGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnspecifiedGet", self, extract::unspecified); +} + +// Set +void +DistributionUnspecifiedSet(ConstHandle2Distribution self, ConstHandle2ConstUnspecified unspecified) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnspecifiedSet", self, extract::unspecified, unspecified); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// Has +int +DistributionXYs2dHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs2dHas", self, extract::XYs2d); +} + +// Get, const +Handle2ConstXYs2d +DistributionXYs2dGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGetConst", self, extract::XYs2d); +} + +// Get, non-const +Handle2XYs2d +DistributionXYs2dGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"XYs2dGet", self, extract::XYs2d); +} + +// Set +void +DistributionXYs2dSet(ConstHandle2Distribution self, ConstHandle2ConstXYs2d XYs2d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"XYs2dSet", self, extract::XYs2d, XYs2d); +} + + +// ----------------------------------------------------------------------------- +// Child: branching3d +// ----------------------------------------------------------------------------- + +// Has +int +DistributionBranching3dHas(ConstHandle2ConstDistribution self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"Branching3dHas", self, extract::branching3d); +} + +// Get, const +Handle2ConstBranching3d +DistributionBranching3dGetConst(ConstHandle2ConstDistribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Branching3dGetConst", self, extract::branching3d); +} + +// Get, non-const +Handle2Branching3d +DistributionBranching3dGet(ConstHandle2Distribution self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"Branching3dGet", self, extract::branching3d); +} + +// Set +void +DistributionBranching3dSet(ConstHandle2Distribution self, ConstHandle2ConstBranching3d branching3d) +{ + detail::setField + (CLASSNAME, CLASSNAME+"Branching3dSet", self, extract::branching3d, branching3d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Distribution/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Distribution.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Distribution.h new file mode 100644 index 000000000..e2cc679ca --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Distribution.h @@ -0,0 +1,257 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Distribution is the basic handle type in this file. Example: +// // Create a default Distribution object: +// Distribution handle = DistributionDefault(); +// Functions involving Distribution are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_REDUCED_DISTRIBUTION +#define C_INTERFACE_GNDS_V2_0_REDUCED_DISTRIBUTION + +#include "GNDStk.h" +#include "v2.0/general/ThermalNeutronScatteringLaw.h" +#include "v2.0/general/Uncorrelated.h" +#include "v2.0/general/Unspecified.h" +#include "v2.0/general/XYs2d.h" +#include "v2.0/general/Branching3d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DistributionClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Distribution +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DistributionClass *Distribution; + +// --- Const-aware handles. +typedef const struct DistributionClass *const ConstHandle2ConstDistribution; +typedef struct DistributionClass *const ConstHandle2Distribution; +typedef const struct DistributionClass * Handle2ConstDistribution; +typedef struct DistributionClass * Handle2Distribution; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDistribution +DistributionDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Distribution +DistributionDefault(); + +// --- Create, general, const +extern_c Handle2ConstDistribution +DistributionCreateConst( + ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw, + ConstHandle2ConstUncorrelated uncorrelated, + ConstHandle2ConstUnspecified unspecified, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstBranching3d branching3d +); + +// +++ Create, general, non-const +extern_c Handle2Distribution +DistributionCreate( + ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw, + ConstHandle2ConstUncorrelated uncorrelated, + ConstHandle2ConstUnspecified unspecified, + ConstHandle2ConstXYs2d XYs2d, + ConstHandle2ConstBranching3d branching3d +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DistributionAssign(ConstHandle2Distribution self, ConstHandle2ConstDistribution from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DistributionDelete(ConstHandle2ConstDistribution self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DistributionRead(ConstHandle2Distribution self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DistributionWrite(ConstHandle2ConstDistribution self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DistributionPrint(ConstHandle2ConstDistribution self); + +// +++ Print to standard output, as XML +extern_c int +DistributionPrintXML(ConstHandle2ConstDistribution self); + +// +++ Print to standard output, as JSON +extern_c int +DistributionPrintJSON(ConstHandle2ConstDistribution self); + + +// ----------------------------------------------------------------------------- +// Child: thermalNeutronScatteringLaw +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionThermalNeutronScatteringLawHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstThermalNeutronScatteringLaw +DistributionThermalNeutronScatteringLawGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2ThermalNeutronScatteringLaw +DistributionThermalNeutronScatteringLawGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionThermalNeutronScatteringLawSet(ConstHandle2Distribution self, ConstHandle2ConstThermalNeutronScatteringLaw thermalNeutronScatteringLaw); + + +// ----------------------------------------------------------------------------- +// Child: uncorrelated +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionUncorrelatedHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstUncorrelated +DistributionUncorrelatedGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2Uncorrelated +DistributionUncorrelatedGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionUncorrelatedSet(ConstHandle2Distribution self, ConstHandle2ConstUncorrelated uncorrelated); + + +// ----------------------------------------------------------------------------- +// Child: unspecified +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionUnspecifiedHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstUnspecified +DistributionUnspecifiedGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2Unspecified +DistributionUnspecifiedGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionUnspecifiedSet(ConstHandle2Distribution self, ConstHandle2ConstUnspecified unspecified); + + +// ----------------------------------------------------------------------------- +// Child: XYs2d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionXYs2dHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstXYs2d +DistributionXYs2dGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2XYs2d +DistributionXYs2dGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionXYs2dSet(ConstHandle2Distribution self, ConstHandle2ConstXYs2d XYs2d); + + +// ----------------------------------------------------------------------------- +// Child: branching3d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DistributionBranching3dHas(ConstHandle2ConstDistribution self); + +// --- Get, const +extern_c Handle2ConstBranching3d +DistributionBranching3dGetConst(ConstHandle2ConstDistribution self); + +// +++ Get, non-const +extern_c Handle2Branching3d +DistributionBranching3dGet(ConstHandle2Distribution self); + +// +++ Set +extern_c void +DistributionBranching3dSet(ConstHandle2Distribution self, ConstHandle2ConstBranching3d branching3d); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Distribution/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Distribution/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Distribution/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Distribution/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Distribution/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Double.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Double.cpp new file mode 100644 index 000000000..3d5a4afd5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Double.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/reduced/Double.hpp" +#include "Double.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = DoubleClass; +using CPP = multigroup::Double; + +static const std::string CLASSNAME = "Double"; + +namespace extract { + static auto value = [](auto &obj) { return &obj.value; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstDouble +DoubleDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Double +DoubleDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstDouble +DoubleCreateConst( + const double value +) { + ConstHandle2Double handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + value + ); + return handle; +} + +// Create, general, non-const +Handle2Double +DoubleCreate( + const double value +) { + ConstHandle2Double handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + value + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +DoubleAssign(ConstHandle2Double self, ConstHandle2ConstDouble from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +DoubleDelete(ConstHandle2ConstDouble self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +DoubleRead(ConstHandle2Double self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +DoubleWrite(ConstHandle2ConstDouble self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +DoublePrint(ConstHandle2ConstDouble self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +DoublePrintXML(ConstHandle2ConstDouble self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +DoublePrintJSON(ConstHandle2ConstDouble self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// Has +int +DoubleValueHas(ConstHandle2ConstDouble self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValueHas", self, extract::value); +} + +// Get +// Returns by value +double +DoubleValueGet(ConstHandle2ConstDouble self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValueGet", self, extract::value); +} + +// Set +void +DoubleValueSet(ConstHandle2Double self, const double value) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValueSet", self, extract::value, value); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Double/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Double.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Double.h new file mode 100644 index 000000000..391032ba8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Double.h @@ -0,0 +1,157 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Double is the basic handle type in this file. Example: +// // Create a default Double object: +// Double handle = DoubleDefault(); +// Functions involving Double are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_REDUCED_DOUBLE +#define C_INTERFACE_GNDS_V2_0_REDUCED_DOUBLE + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct DoubleClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Double +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct DoubleClass *Double; + +// --- Const-aware handles. +typedef const struct DoubleClass *const ConstHandle2ConstDouble; +typedef struct DoubleClass *const ConstHandle2Double; +typedef const struct DoubleClass * Handle2ConstDouble; +typedef struct DoubleClass * Handle2Double; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstDouble +DoubleDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Double +DoubleDefault(); + +// --- Create, general, const +extern_c Handle2ConstDouble +DoubleCreateConst( + const double value +); + +// +++ Create, general, non-const +extern_c Handle2Double +DoubleCreate( + const double value +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +DoubleAssign(ConstHandle2Double self, ConstHandle2ConstDouble from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +DoubleDelete(ConstHandle2ConstDouble self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +DoubleRead(ConstHandle2Double self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +DoubleWrite(ConstHandle2ConstDouble self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +DoublePrint(ConstHandle2ConstDouble self); + +// +++ Print to standard output, as XML +extern_c int +DoublePrintXML(ConstHandle2ConstDouble self); + +// +++ Print to standard output, as JSON +extern_c int +DoublePrintJSON(ConstHandle2ConstDouble self); + + +// ----------------------------------------------------------------------------- +// Metadatum: value +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +DoubleValueHas(ConstHandle2ConstDouble self); + +// +++ Get +// +++ Returns by value +extern_c double +DoubleValueGet(ConstHandle2ConstDouble self); + +// +++ Set +extern_c void +DoubleValueSet(ConstHandle2Double self, const double value); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Double/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Double/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Double/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Double/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Double/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Function1ds.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Function1ds.cpp new file mode 100644 index 000000000..f6bc2cbd5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Function1ds.cpp @@ -0,0 +1,531 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/reduced/Function1ds.hpp" +#include "Function1ds.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Function1dsClass; +using CPP = multigroup::Function1ds; + +static const std::string CLASSNAME = "Function1ds"; + +namespace extract { + static auto Legendre = [](auto &obj) { return &obj.Legendre; }; + static auto XYs1d = [](auto &obj) { return &obj.XYs1d; }; +} + +using CPPLegendre = general::Legendre; +using CPPXYs1d = general::XYs1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFunction1ds +Function1dsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Function1ds +Function1dsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFunction1ds +Function1dsCreateConst( + ConstHandle2Legendre *const Legendre, const size_t LegendreSize, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize +) { + ConstHandle2Function1ds handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{}, + std::vector{} + ); + for (size_t LegendreN = 0; LegendreN < LegendreSize; ++LegendreN) + Function1dsLegendreAdd(handle, Legendre[LegendreN]); + for (size_t XYs1dN = 0; XYs1dN < XYs1dSize; ++XYs1dN) + Function1dsXYs1dAdd(handle, XYs1d[XYs1dN]); + return handle; +} + +// Create, general, non-const +Handle2Function1ds +Function1dsCreate( + ConstHandle2Legendre *const Legendre, const size_t LegendreSize, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize +) { + ConstHandle2Function1ds handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{}, + std::vector{} + ); + for (size_t LegendreN = 0; LegendreN < LegendreSize; ++LegendreN) + Function1dsLegendreAdd(handle, Legendre[LegendreN]); + for (size_t XYs1dN = 0; XYs1dN < XYs1dSize; ++XYs1dN) + Function1dsXYs1dAdd(handle, XYs1d[XYs1dN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Function1dsAssign(ConstHandle2Function1ds self, ConstHandle2ConstFunction1ds from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Function1dsDelete(ConstHandle2ConstFunction1ds self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Function1dsRead(ConstHandle2Function1ds self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Function1dsWrite(ConstHandle2ConstFunction1ds self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Function1dsPrint(ConstHandle2ConstFunction1ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Function1dsPrintXML(ConstHandle2ConstFunction1ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Function1dsPrintJSON(ConstHandle2ConstFunction1ds self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: Legendre +// ----------------------------------------------------------------------------- + +// Has +int +Function1dsLegendreHas(ConstHandle2ConstFunction1ds self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LegendreHas", self, extract::Legendre); +} + +// Clear +void +Function1dsLegendreClear(ConstHandle2Function1ds self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"LegendreClear", self, extract::Legendre); +} + +// Size +size_t +Function1dsLegendreSize(ConstHandle2ConstFunction1ds self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"LegendreSize", self, extract::Legendre); +} + +// Add +void +Function1dsLegendreAdd(ConstHandle2Function1ds self, ConstHandle2ConstLegendre Legendre) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"LegendreAdd", self, extract::Legendre, Legendre); +} + +// Get, by index \in [0,size), const +Handle2ConstLegendre +Function1dsLegendreGetConst(ConstHandle2ConstFunction1ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"LegendreGetConst", self, extract::Legendre, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Legendre +Function1dsLegendreGet(ConstHandle2Function1ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"LegendreGet", self, extract::Legendre, index_); +} + +// Set, by index \in [0,size) +void +Function1dsLegendreSet( + ConstHandle2Function1ds self, + const size_t index_, + ConstHandle2ConstLegendre Legendre +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"LegendreSet", self, extract::Legendre, index_, Legendre); +} + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// Has, by outerDomainValue +int +Function1dsLegendreHasByOuterDomainValue( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"LegendreHasByOuterDomainValue", + self, extract::Legendre, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, const +Handle2ConstLegendre +Function1dsLegendreGetByOuterDomainValueConst( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LegendreGetByOuterDomainValueConst", + self, extract::Legendre, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, non-const +Handle2Legendre +Function1dsLegendreGetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"LegendreGetByOuterDomainValue", + self, extract::Legendre, meta::outerDomainValue, outerDomainValue); +} + +// Set, by outerDomainValue +void +Function1dsLegendreSetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue, + ConstHandle2ConstLegendre Legendre +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"LegendreSetByOuterDomainValue", + self, extract::Legendre, meta::outerDomainValue, outerDomainValue, Legendre); +} + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// Has +int +Function1dsXYs1dHas(ConstHandle2ConstFunction1ds self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"XYs1dHas", self, extract::XYs1d); +} + +// Clear +void +Function1dsXYs1dClear(ConstHandle2Function1ds self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"XYs1dClear", self, extract::XYs1d); +} + +// Size +size_t +Function1dsXYs1dSize(ConstHandle2ConstFunction1ds self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"XYs1dSize", self, extract::XYs1d); +} + +// Add +void +Function1dsXYs1dAdd(ConstHandle2Function1ds self, ConstHandle2ConstXYs1d XYs1d) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"XYs1dAdd", self, extract::XYs1d, XYs1d); +} + +// Get, by index \in [0,size), const +Handle2ConstXYs1d +Function1dsXYs1dGetConst(ConstHandle2ConstFunction1ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"XYs1dGetConst", self, extract::XYs1d, index_); +} + +// Get, by index \in [0,size), non-const +Handle2XYs1d +Function1dsXYs1dGet(ConstHandle2Function1ds self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"XYs1dGet", self, extract::XYs1d, index_); +} + +// Set, by index \in [0,size) +void +Function1dsXYs1dSet( + ConstHandle2Function1ds self, + const size_t index_, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"XYs1dSet", self, extract::XYs1d, index_, XYs1d); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +Function1dsXYs1dHasByLabel( + ConstHandle2ConstFunction1ds self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByLabel", + self, extract::XYs1d, meta::label, label); +} + +// Get, by label, const +Handle2ConstXYs1d +Function1dsXYs1dGetByLabelConst( + ConstHandle2ConstFunction1ds self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByLabelConst", + self, extract::XYs1d, meta::label, label); +} + +// Get, by label, non-const +Handle2XYs1d +Function1dsXYs1dGetByLabel( + ConstHandle2Function1ds self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByLabel", + self, extract::XYs1d, meta::label, label); +} + +// Set, by label +void +Function1dsXYs1dSetByLabel( + ConstHandle2Function1ds self, + const char *const label, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByLabel", + self, extract::XYs1d, meta::label, label, XYs1d); +} + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// Has, by index +int +Function1dsXYs1dHasByIndex( + ConstHandle2ConstFunction1ds self, + const int index +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByIndex", + self, extract::XYs1d, meta::index, index); +} + +// Get, by index, const +Handle2ConstXYs1d +Function1dsXYs1dGetByIndexConst( + ConstHandle2ConstFunction1ds self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByIndexConst", + self, extract::XYs1d, meta::index, index); +} + +// Get, by index, non-const +Handle2XYs1d +Function1dsXYs1dGetByIndex( + ConstHandle2Function1ds self, + const int index +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByIndex", + self, extract::XYs1d, meta::index, index); +} + +// Set, by index +void +Function1dsXYs1dSetByIndex( + ConstHandle2Function1ds self, + const int index, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByIndex", + self, extract::XYs1d, meta::index, index, XYs1d); +} + +// ------------------------ +// Re: metadatum interpolation +// ------------------------ + +// Has, by interpolation +int +Function1dsXYs1dHasByInterpolation( + ConstHandle2ConstFunction1ds self, + const char *const interpolation +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByInterpolation", + self, extract::XYs1d, meta::interpolation, interpolation); +} + +// Get, by interpolation, const +Handle2ConstXYs1d +Function1dsXYs1dGetByInterpolationConst( + ConstHandle2ConstFunction1ds self, + const char *const interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByInterpolationConst", + self, extract::XYs1d, meta::interpolation, interpolation); +} + +// Get, by interpolation, non-const +Handle2XYs1d +Function1dsXYs1dGetByInterpolation( + ConstHandle2Function1ds self, + const char *const interpolation +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByInterpolation", + self, extract::XYs1d, meta::interpolation, interpolation); +} + +// Set, by interpolation +void +Function1dsXYs1dSetByInterpolation( + ConstHandle2Function1ds self, + const char *const interpolation, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByInterpolation", + self, extract::XYs1d, meta::interpolation, interpolation, XYs1d); +} + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// Has, by outerDomainValue +int +Function1dsXYs1dHasByOuterDomainValue( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dHasByOuterDomainValue", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, const +Handle2ConstXYs1d +Function1dsXYs1dGetByOuterDomainValueConst( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByOuterDomainValueConst", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue); +} + +// Get, by outerDomainValue, non-const +Handle2XYs1d +Function1dsXYs1dGetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dGetByOuterDomainValue", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue); +} + +// Set, by outerDomainValue +void +Function1dsXYs1dSetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue, + ConstHandle2ConstXYs1d XYs1d +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"XYs1dSetByOuterDomainValue", + self, extract::XYs1d, meta::outerDomainValue, outerDomainValue, XYs1d); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Function1ds/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Function1ds.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Function1ds.h new file mode 100644 index 000000000..d3fad79aa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Function1ds.h @@ -0,0 +1,382 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Function1ds is the basic handle type in this file. Example: +// // Create a default Function1ds object: +// Function1ds handle = Function1dsDefault(); +// Functions involving Function1ds are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_REDUCED_FUNCTION1DS +#define C_INTERFACE_GNDS_V2_0_REDUCED_FUNCTION1DS + +#include "GNDStk.h" +#include "v2.0/general/Legendre.h" +#include "v2.0/general/XYs1d.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Function1dsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Function1ds +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Function1dsClass *Function1ds; + +// --- Const-aware handles. +typedef const struct Function1dsClass *const ConstHandle2ConstFunction1ds; +typedef struct Function1dsClass *const ConstHandle2Function1ds; +typedef const struct Function1dsClass * Handle2ConstFunction1ds; +typedef struct Function1dsClass * Handle2Function1ds; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFunction1ds +Function1dsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Function1ds +Function1dsDefault(); + +// --- Create, general, const +extern_c Handle2ConstFunction1ds +Function1dsCreateConst( + ConstHandle2Legendre *const Legendre, const size_t LegendreSize, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize +); + +// +++ Create, general, non-const +extern_c Handle2Function1ds +Function1dsCreate( + ConstHandle2Legendre *const Legendre, const size_t LegendreSize, + ConstHandle2XYs1d *const XYs1d, const size_t XYs1dSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Function1dsAssign(ConstHandle2Function1ds self, ConstHandle2ConstFunction1ds from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Function1dsDelete(ConstHandle2ConstFunction1ds self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Function1dsRead(ConstHandle2Function1ds self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Function1dsWrite(ConstHandle2ConstFunction1ds self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Function1dsPrint(ConstHandle2ConstFunction1ds self); + +// +++ Print to standard output, as XML +extern_c int +Function1dsPrintXML(ConstHandle2ConstFunction1ds self); + +// +++ Print to standard output, as JSON +extern_c int +Function1dsPrintJSON(ConstHandle2ConstFunction1ds self); + + +// ----------------------------------------------------------------------------- +// Child: Legendre +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Function1dsLegendreHas(ConstHandle2ConstFunction1ds self); + +// +++ Clear +extern_c void +Function1dsLegendreClear(ConstHandle2Function1ds self); + +// +++ Size +extern_c size_t +Function1dsLegendreSize(ConstHandle2ConstFunction1ds self); + +// +++ Add +extern_c void +Function1dsLegendreAdd(ConstHandle2Function1ds self, ConstHandle2ConstLegendre Legendre); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstLegendre +Function1dsLegendreGetConst(ConstHandle2ConstFunction1ds self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Legendre +Function1dsLegendreGet(ConstHandle2Function1ds self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +Function1dsLegendreSet( + ConstHandle2Function1ds self, + const size_t index_, + ConstHandle2ConstLegendre Legendre +); + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// +++ Has, by outerDomainValue +extern_c int +Function1dsLegendreHasByOuterDomainValue( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +); + +// --- Get, by outerDomainValue, const +extern_c Handle2ConstLegendre +Function1dsLegendreGetByOuterDomainValueConst( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +); + +// +++ Get, by outerDomainValue, non-const +extern_c Handle2Legendre +Function1dsLegendreGetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue +); + +// +++ Set, by outerDomainValue +extern_c void +Function1dsLegendreSetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue, + ConstHandle2ConstLegendre Legendre +); + + +// ----------------------------------------------------------------------------- +// Child: XYs1d +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Function1dsXYs1dHas(ConstHandle2ConstFunction1ds self); + +// +++ Clear +extern_c void +Function1dsXYs1dClear(ConstHandle2Function1ds self); + +// +++ Size +extern_c size_t +Function1dsXYs1dSize(ConstHandle2ConstFunction1ds self); + +// +++ Add +extern_c void +Function1dsXYs1dAdd(ConstHandle2Function1ds self, ConstHandle2ConstXYs1d XYs1d); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstXYs1d +Function1dsXYs1dGetConst(ConstHandle2ConstFunction1ds self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2XYs1d +Function1dsXYs1dGet(ConstHandle2Function1ds self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +Function1dsXYs1dSet( + ConstHandle2Function1ds self, + const size_t index_, + ConstHandle2ConstXYs1d XYs1d +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +Function1dsXYs1dHasByLabel( + ConstHandle2ConstFunction1ds self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstXYs1d +Function1dsXYs1dGetByLabelConst( + ConstHandle2ConstFunction1ds self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2XYs1d +Function1dsXYs1dGetByLabel( + ConstHandle2Function1ds self, + const char *const label +); + +// +++ Set, by label +extern_c void +Function1dsXYs1dSetByLabel( + ConstHandle2Function1ds self, + const char *const label, + ConstHandle2ConstXYs1d XYs1d +); + +// ------------------------ +// Re: metadatum index +// ------------------------ + +// +++ Has, by index +extern_c int +Function1dsXYs1dHasByIndex( + ConstHandle2ConstFunction1ds self, + const int index +); + +// --- Get, by index, const +extern_c Handle2ConstXYs1d +Function1dsXYs1dGetByIndexConst( + ConstHandle2ConstFunction1ds self, + const int index +); + +// +++ Get, by index, non-const +extern_c Handle2XYs1d +Function1dsXYs1dGetByIndex( + ConstHandle2Function1ds self, + const int index +); + +// +++ Set, by index +extern_c void +Function1dsXYs1dSetByIndex( + ConstHandle2Function1ds self, + const int index, + ConstHandle2ConstXYs1d XYs1d +); + +// ------------------------ +// Re: metadatum interpolation +// ------------------------ + +// +++ Has, by interpolation +extern_c int +Function1dsXYs1dHasByInterpolation( + ConstHandle2ConstFunction1ds self, + const char *const interpolation +); + +// --- Get, by interpolation, const +extern_c Handle2ConstXYs1d +Function1dsXYs1dGetByInterpolationConst( + ConstHandle2ConstFunction1ds self, + const char *const interpolation +); + +// +++ Get, by interpolation, non-const +extern_c Handle2XYs1d +Function1dsXYs1dGetByInterpolation( + ConstHandle2Function1ds self, + const char *const interpolation +); + +// +++ Set, by interpolation +extern_c void +Function1dsXYs1dSetByInterpolation( + ConstHandle2Function1ds self, + const char *const interpolation, + ConstHandle2ConstXYs1d XYs1d +); + +// ------------------------ +// Re: metadatum outerDomainValue +// ------------------------ + +// +++ Has, by outerDomainValue +extern_c int +Function1dsXYs1dHasByOuterDomainValue( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +); + +// --- Get, by outerDomainValue, const +extern_c Handle2ConstXYs1d +Function1dsXYs1dGetByOuterDomainValueConst( + ConstHandle2ConstFunction1ds self, + const double outerDomainValue +); + +// +++ Get, by outerDomainValue, non-const +extern_c Handle2XYs1d +Function1dsXYs1dGetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue +); + +// +++ Set, by outerDomainValue +extern_c void +Function1dsXYs1dSetByOuterDomainValue( + ConstHandle2Function1ds self, + const double outerDomainValue, + ConstHandle2ConstXYs1d XYs1d +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Function1ds/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Function1ds/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Function1ds/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Function1ds/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Function1ds/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Nuclides.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Nuclides.cpp new file mode 100644 index 000000000..3a7f43e60 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Nuclides.cpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/reduced/Nuclides.hpp" +#include "Nuclides.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = NuclidesClass; +using CPP = multigroup::Nuclides; + +static const std::string CLASSNAME = "Nuclides"; + +namespace extract { + static auto href = [](auto &obj) { return &obj.href; }; +} + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstNuclides +NuclidesDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Nuclides +NuclidesDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstNuclides +NuclidesCreateConst( + const char *const href +) { + ConstHandle2Nuclides handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + href + ); + return handle; +} + +// Create, general, non-const +Handle2Nuclides +NuclidesCreate( + const char *const href +) { + ConstHandle2Nuclides handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + href + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +NuclidesAssign(ConstHandle2Nuclides self, ConstHandle2ConstNuclides from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +NuclidesDelete(ConstHandle2ConstNuclides self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +NuclidesRead(ConstHandle2Nuclides self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +NuclidesWrite(ConstHandle2ConstNuclides self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +NuclidesPrint(ConstHandle2ConstNuclides self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +NuclidesPrintXML(ConstHandle2ConstNuclides self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +NuclidesPrintJSON(ConstHandle2ConstNuclides self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// Clear +void +NuclidesStringsClear(ConstHandle2Nuclides self) +{ + detail::vectorClear + (CLASSNAME, CLASSNAME+"StringsClear", self); +} + +// Get size +size_t +NuclidesStringsSize(ConstHandle2ConstNuclides self) +{ + return detail::vectorSize + (CLASSNAME, CLASSNAME+"StringsSize", self); +} + +// Get value +// By index \in [0,size) +std::string +NuclidesStringsGet(ConstHandle2ConstNuclides self, const size_t index) +{ + return detail::vectorGet + (CLASSNAME, CLASSNAME+"StringsGet", self, index); +} + +// Set value +// By index \in [0,size) +void +NuclidesStringsSet(ConstHandle2Nuclides self, const size_t index, const std::string value) +{ + detail::vectorSet + (CLASSNAME, CLASSNAME+"StringsSet", self, index, value); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// Has +int +NuclidesHrefHas(ConstHandle2ConstNuclides self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"HrefHas", self, extract::href); +} + +// Get +// Returns by value +const char * +NuclidesHrefGet(ConstHandle2ConstNuclides self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"HrefGet", self, extract::href); +} + +// Set +void +NuclidesHrefSet(ConstHandle2Nuclides self, const char *const href) +{ + detail::setField + (CLASSNAME, CLASSNAME+"HrefSet", self, extract::href, href); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Nuclides/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Nuclides.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Nuclides.h new file mode 100644 index 000000000..10f5129b7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Nuclides.h @@ -0,0 +1,180 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Nuclides is the basic handle type in this file. Example: +// // Create a default Nuclides object: +// Nuclides handle = NuclidesDefault(); +// Functions involving Nuclides are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_REDUCED_NUCLIDES +#define C_INTERFACE_GNDS_V2_0_REDUCED_NUCLIDES + +#include "GNDStk.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct NuclidesClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Nuclides +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct NuclidesClass *Nuclides; + +// --- Const-aware handles. +typedef const struct NuclidesClass *const ConstHandle2ConstNuclides; +typedef struct NuclidesClass *const ConstHandle2Nuclides; +typedef const struct NuclidesClass * Handle2ConstNuclides; +typedef struct NuclidesClass * Handle2Nuclides; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstNuclides +NuclidesDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Nuclides +NuclidesDefault(); + +// --- Create, general, const +extern_c Handle2ConstNuclides +NuclidesCreateConst( + const char *const href +); + +// +++ Create, general, non-const +extern_c Handle2Nuclides +NuclidesCreate( + const char *const href +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +NuclidesAssign(ConstHandle2Nuclides self, ConstHandle2ConstNuclides from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +NuclidesDelete(ConstHandle2ConstNuclides self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +NuclidesRead(ConstHandle2Nuclides self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +NuclidesWrite(ConstHandle2ConstNuclides self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +NuclidesPrint(ConstHandle2ConstNuclides self); + +// +++ Print to standard output, as XML +extern_c int +NuclidesPrintXML(ConstHandle2ConstNuclides self); + +// +++ Print to standard output, as JSON +extern_c int +NuclidesPrintJSON(ConstHandle2ConstNuclides self); + + +// ----------------------------------------------------------------------------- +// Data vector +// ----------------------------------------------------------------------------- + +// +++ Clear +extern_c void +NuclidesStringsClear(ConstHandle2Nuclides self); + +// +++ Get size +extern_c size_t +NuclidesStringsSize(ConstHandle2ConstNuclides self); + +// +++ Get value +// +++ By index \in [0,size) +extern_c std::string +NuclidesStringsGet(ConstHandle2ConstNuclides self, const size_t index); + +// +++ Set value +// +++ By index \in [0,size) +extern_c void +NuclidesStringsSet(ConstHandle2Nuclides self, const size_t index, const std::string value); + + +// ----------------------------------------------------------------------------- +// Metadatum: href +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +NuclidesHrefHas(ConstHandle2ConstNuclides self); + +// +++ Get +// +++ Returns by value +extern_c const char * +NuclidesHrefGet(ConstHandle2ConstNuclides self); + +// +++ Set +extern_c void +NuclidesHrefSet(ConstHandle2Nuclides self, const char *const href); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Nuclides/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Nuclides/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Nuclides/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Nuclides/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Nuclides/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/OutputChannel.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/OutputChannel.cpp new file mode 100644 index 000000000..759bf3d57 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/OutputChannel.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/reduced/OutputChannel.hpp" +#include "OutputChannel.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = OutputChannelClass; +using CPP = multigroup::OutputChannel; + +static const std::string CLASSNAME = "OutputChannel"; + +namespace extract { + static auto genre = [](auto &obj) { return &obj.genre; }; + static auto process = [](auto &obj) { return &obj.process; }; + static auto Q = [](auto &obj) { return &obj.Q; }; + static auto products = [](auto &obj) { return &obj.products; }; +} + +using CPPQ = general::Q; +using CPPProducts = reduced::Products; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstOutputChannel +OutputChannelDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2OutputChannel +OutputChannelDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstOutputChannel +OutputChannelCreateConst( + const char *const genre, + const char *const process, + ConstHandle2ConstQ Q, + ConstHandle2ConstProducts products +) { + ConstHandle2OutputChannel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + genre, + process, + detail::tocpp(Q), + detail::tocpp(products) + ); + return handle; +} + +// Create, general, non-const +Handle2OutputChannel +OutputChannelCreate( + const char *const genre, + const char *const process, + ConstHandle2ConstQ Q, + ConstHandle2ConstProducts products +) { + ConstHandle2OutputChannel handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + genre, + process, + detail::tocpp(Q), + detail::tocpp(products) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +OutputChannelAssign(ConstHandle2OutputChannel self, ConstHandle2ConstOutputChannel from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +OutputChannelDelete(ConstHandle2ConstOutputChannel self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +OutputChannelRead(ConstHandle2OutputChannel self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +OutputChannelWrite(ConstHandle2ConstOutputChannel self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +OutputChannelPrint(ConstHandle2ConstOutputChannel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +OutputChannelPrintXML(ConstHandle2ConstOutputChannel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +OutputChannelPrintJSON(ConstHandle2ConstOutputChannel self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: genre +// ----------------------------------------------------------------------------- + +// Has +int +OutputChannelGenreHas(ConstHandle2ConstOutputChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GenreHas", self, extract::genre); +} + +// Get +// Returns by value +const char * +OutputChannelGenreGet(ConstHandle2ConstOutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GenreGet", self, extract::genre); +} + +// Set +void +OutputChannelGenreSet(ConstHandle2OutputChannel self, const char *const genre) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GenreSet", self, extract::genre, genre); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: process +// ----------------------------------------------------------------------------- + +// Has +int +OutputChannelProcessHas(ConstHandle2ConstOutputChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProcessHas", self, extract::process); +} + +// Get +// Returns by value +const char * +OutputChannelProcessGet(ConstHandle2ConstOutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProcessGet", self, extract::process); +} + +// Set +void +OutputChannelProcessSet(ConstHandle2OutputChannel self, const char *const process) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProcessSet", self, extract::process, process); +} + + +// ----------------------------------------------------------------------------- +// Child: Q +// ----------------------------------------------------------------------------- + +// Has +int +OutputChannelQHas(ConstHandle2ConstOutputChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"QHas", self, extract::Q); +} + +// Get, const +Handle2ConstQ +OutputChannelQGetConst(ConstHandle2ConstOutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"QGetConst", self, extract::Q); +} + +// Get, non-const +Handle2Q +OutputChannelQGet(ConstHandle2OutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"QGet", self, extract::Q); +} + +// Set +void +OutputChannelQSet(ConstHandle2OutputChannel self, ConstHandle2ConstQ Q) +{ + detail::setField + (CLASSNAME, CLASSNAME+"QSet", self, extract::Q, Q); +} + + +// ----------------------------------------------------------------------------- +// Child: products +// ----------------------------------------------------------------------------- + +// Has +int +OutputChannelProductsHas(ConstHandle2ConstOutputChannel self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductsHas", self, extract::products); +} + +// Get, const +Handle2ConstProducts +OutputChannelProductsGetConst(ConstHandle2ConstOutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductsGetConst", self, extract::products); +} + +// Get, non-const +Handle2Products +OutputChannelProductsGet(ConstHandle2OutputChannel self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductsGet", self, extract::products); +} + +// Set +void +OutputChannelProductsSet(ConstHandle2OutputChannel self, ConstHandle2ConstProducts products) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductsSet", self, extract::products, products); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/OutputChannel/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/OutputChannel.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/OutputChannel.h new file mode 100644 index 000000000..7496236f1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/OutputChannel.h @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// OutputChannel is the basic handle type in this file. Example: +// // Create a default OutputChannel object: +// OutputChannel handle = OutputChannelDefault(); +// Functions involving OutputChannel are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_REDUCED_OUTPUTCHANNEL +#define C_INTERFACE_GNDS_V2_0_REDUCED_OUTPUTCHANNEL + +#include "GNDStk.h" +#include "v2.0/general/Q.h" +#include "v2.0/reduced/Products.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct OutputChannelClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ OutputChannel +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct OutputChannelClass *OutputChannel; + +// --- Const-aware handles. +typedef const struct OutputChannelClass *const ConstHandle2ConstOutputChannel; +typedef struct OutputChannelClass *const ConstHandle2OutputChannel; +typedef const struct OutputChannelClass * Handle2ConstOutputChannel; +typedef struct OutputChannelClass * Handle2OutputChannel; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstOutputChannel +OutputChannelDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2OutputChannel +OutputChannelDefault(); + +// --- Create, general, const +extern_c Handle2ConstOutputChannel +OutputChannelCreateConst( + const char *const genre, + const char *const process, + ConstHandle2ConstQ Q, + ConstHandle2ConstProducts products +); + +// +++ Create, general, non-const +extern_c Handle2OutputChannel +OutputChannelCreate( + const char *const genre, + const char *const process, + ConstHandle2ConstQ Q, + ConstHandle2ConstProducts products +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +OutputChannelAssign(ConstHandle2OutputChannel self, ConstHandle2ConstOutputChannel from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +OutputChannelDelete(ConstHandle2ConstOutputChannel self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +OutputChannelRead(ConstHandle2OutputChannel self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +OutputChannelWrite(ConstHandle2ConstOutputChannel self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +OutputChannelPrint(ConstHandle2ConstOutputChannel self); + +// +++ Print to standard output, as XML +extern_c int +OutputChannelPrintXML(ConstHandle2ConstOutputChannel self); + +// +++ Print to standard output, as JSON +extern_c int +OutputChannelPrintJSON(ConstHandle2ConstOutputChannel self); + + +// ----------------------------------------------------------------------------- +// Metadatum: genre +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputChannelGenreHas(ConstHandle2ConstOutputChannel self); + +// +++ Get +// +++ Returns by value +extern_c const char * +OutputChannelGenreGet(ConstHandle2ConstOutputChannel self); + +// +++ Set +extern_c void +OutputChannelGenreSet(ConstHandle2OutputChannel self, const char *const genre); + + +// ----------------------------------------------------------------------------- +// Metadatum: process +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputChannelProcessHas(ConstHandle2ConstOutputChannel self); + +// +++ Get +// +++ Returns by value +extern_c const char * +OutputChannelProcessGet(ConstHandle2ConstOutputChannel self); + +// +++ Set +extern_c void +OutputChannelProcessSet(ConstHandle2OutputChannel self, const char *const process); + + +// ----------------------------------------------------------------------------- +// Child: Q +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputChannelQHas(ConstHandle2ConstOutputChannel self); + +// --- Get, const +extern_c Handle2ConstQ +OutputChannelQGetConst(ConstHandle2ConstOutputChannel self); + +// +++ Get, non-const +extern_c Handle2Q +OutputChannelQGet(ConstHandle2OutputChannel self); + +// +++ Set +extern_c void +OutputChannelQSet(ConstHandle2OutputChannel self, ConstHandle2ConstQ Q); + + +// ----------------------------------------------------------------------------- +// Child: products +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +OutputChannelProductsHas(ConstHandle2ConstOutputChannel self); + +// --- Get, const +extern_c Handle2ConstProducts +OutputChannelProductsGetConst(ConstHandle2ConstOutputChannel self); + +// +++ Get, non-const +extern_c Handle2Products +OutputChannelProductsGet(ConstHandle2OutputChannel self); + +// +++ Set +extern_c void +OutputChannelProductsSet(ConstHandle2OutputChannel self, ConstHandle2ConstProducts products); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/OutputChannel/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/OutputChannel/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/OutputChannel/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/OutputChannel/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/OutputChannel/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Polynomial1d.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Polynomial1d.cpp new file mode 100644 index 000000000..d4fbaa7c6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Polynomial1d.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/reduced/Polynomial1d.hpp" +#include "Polynomial1d.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = Polynomial1dClass; +using CPP = multigroup::Polynomial1d; + +static const std::string CLASSNAME = "Polynomial1d"; + +namespace extract { + static auto domainMin = [](auto &obj) { return &obj.domainMin; }; + static auto domainMax = [](auto &obj) { return &obj.domainMax; }; + static auto axes = [](auto &obj) { return &obj.axes; }; + static auto values = [](auto &obj) { return &obj.values; }; +} + +using CPPAxes = general::Axes; +using CPPValues = general::Values; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPolynomial1d +Polynomial1dDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Polynomial1d +Polynomial1dDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPolynomial1d +Polynomial1dCreateConst( + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +) { + ConstHandle2Polynomial1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + domainMin, + domainMax, + detail::tocpp(axes), + detail::tocpp(values) + ); + return handle; +} + +// Create, general, non-const +Handle2Polynomial1d +Polynomial1dCreate( + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +) { + ConstHandle2Polynomial1d handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + domainMin, + domainMax, + detail::tocpp(axes), + detail::tocpp(values) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +Polynomial1dAssign(ConstHandle2Polynomial1d self, ConstHandle2ConstPolynomial1d from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +Polynomial1dDelete(ConstHandle2ConstPolynomial1d self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +Polynomial1dRead(ConstHandle2Polynomial1d self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +Polynomial1dWrite(ConstHandle2ConstPolynomial1d self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +Polynomial1dPrint(ConstHandle2ConstPolynomial1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +Polynomial1dPrintXML(ConstHandle2ConstPolynomial1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +Polynomial1dPrintJSON(ConstHandle2ConstPolynomial1d self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dDomainMinHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMinHas", self, extract::domainMin); +} + +// Get +// Returns by value +double +Polynomial1dDomainMinGet(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMinGet", self, extract::domainMin); +} + +// Set +void +Polynomial1dDomainMinSet(ConstHandle2Polynomial1d self, const double domainMin) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMinSet", self, extract::domainMin, domainMin); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dDomainMaxHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DomainMaxHas", self, extract::domainMax); +} + +// Get +// Returns by value +double +Polynomial1dDomainMaxGet(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DomainMaxGet", self, extract::domainMax); +} + +// Set +void +Polynomial1dDomainMaxSet(ConstHandle2Polynomial1d self, const double domainMax) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DomainMaxSet", self, extract::domainMax, domainMax); +} + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dAxesHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AxesHas", self, extract::axes); +} + +// Get, const +Handle2ConstAxes +Polynomial1dAxesGetConst(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGetConst", self, extract::axes); +} + +// Get, non-const +Handle2Axes +Polynomial1dAxesGet(ConstHandle2Polynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AxesGet", self, extract::axes); +} + +// Set +void +Polynomial1dAxesSet(ConstHandle2Polynomial1d self, ConstHandle2ConstAxes axes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AxesSet", self, extract::axes, axes); +} + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// Has +int +Polynomial1dValuesHas(ConstHandle2ConstPolynomial1d self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ValuesHas", self, extract::values); +} + +// Get, const +Handle2ConstValues +Polynomial1dValuesGetConst(ConstHandle2ConstPolynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGetConst", self, extract::values); +} + +// Get, non-const +Handle2Values +Polynomial1dValuesGet(ConstHandle2Polynomial1d self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ValuesGet", self, extract::values); +} + +// Set +void +Polynomial1dValuesSet(ConstHandle2Polynomial1d self, ConstHandle2ConstValues values) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ValuesSet", self, extract::values, values); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Polynomial1d/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Polynomial1d.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Polynomial1d.h new file mode 100644 index 000000000..70dad52c2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Polynomial1d.h @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Polynomial1d is the basic handle type in this file. Example: +// // Create a default Polynomial1d object: +// Polynomial1d handle = Polynomial1dDefault(); +// Functions involving Polynomial1d are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_REDUCED_POLYNOMIAL1D +#define C_INTERFACE_GNDS_V2_0_REDUCED_POLYNOMIAL1D + +#include "GNDStk.h" +#include "v2.0/general/Axes.h" +#include "v2.0/general/Values.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct Polynomial1dClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Polynomial1d +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct Polynomial1dClass *Polynomial1d; + +// --- Const-aware handles. +typedef const struct Polynomial1dClass *const ConstHandle2ConstPolynomial1d; +typedef struct Polynomial1dClass *const ConstHandle2Polynomial1d; +typedef const struct Polynomial1dClass * Handle2ConstPolynomial1d; +typedef struct Polynomial1dClass * Handle2Polynomial1d; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPolynomial1d +Polynomial1dDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Polynomial1d +Polynomial1dDefault(); + +// --- Create, general, const +extern_c Handle2ConstPolynomial1d +Polynomial1dCreateConst( + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +); + +// +++ Create, general, non-const +extern_c Handle2Polynomial1d +Polynomial1dCreate( + const double domainMin, + const double domainMax, + ConstHandle2ConstAxes axes, + ConstHandle2ConstValues values +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +Polynomial1dAssign(ConstHandle2Polynomial1d self, ConstHandle2ConstPolynomial1d from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +Polynomial1dDelete(ConstHandle2ConstPolynomial1d self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +Polynomial1dRead(ConstHandle2Polynomial1d self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +Polynomial1dWrite(ConstHandle2ConstPolynomial1d self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +Polynomial1dPrint(ConstHandle2ConstPolynomial1d self); + +// +++ Print to standard output, as XML +extern_c int +Polynomial1dPrintXML(ConstHandle2ConstPolynomial1d self); + +// +++ Print to standard output, as JSON +extern_c int +Polynomial1dPrintJSON(ConstHandle2ConstPolynomial1d self); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMin +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dDomainMinHas(ConstHandle2ConstPolynomial1d self); + +// +++ Get +// +++ Returns by value +extern_c double +Polynomial1dDomainMinGet(ConstHandle2ConstPolynomial1d self); + +// +++ Set +extern_c void +Polynomial1dDomainMinSet(ConstHandle2Polynomial1d self, const double domainMin); + + +// ----------------------------------------------------------------------------- +// Metadatum: domainMax +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dDomainMaxHas(ConstHandle2ConstPolynomial1d self); + +// +++ Get +// +++ Returns by value +extern_c double +Polynomial1dDomainMaxGet(ConstHandle2ConstPolynomial1d self); + +// +++ Set +extern_c void +Polynomial1dDomainMaxSet(ConstHandle2Polynomial1d self, const double domainMax); + + +// ----------------------------------------------------------------------------- +// Child: axes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dAxesHas(ConstHandle2ConstPolynomial1d self); + +// --- Get, const +extern_c Handle2ConstAxes +Polynomial1dAxesGetConst(ConstHandle2ConstPolynomial1d self); + +// +++ Get, non-const +extern_c Handle2Axes +Polynomial1dAxesGet(ConstHandle2Polynomial1d self); + +// +++ Set +extern_c void +Polynomial1dAxesSet(ConstHandle2Polynomial1d self, ConstHandle2ConstAxes axes); + + +// ----------------------------------------------------------------------------- +// Child: values +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +Polynomial1dValuesHas(ConstHandle2ConstPolynomial1d self); + +// --- Get, const +extern_c Handle2ConstValues +Polynomial1dValuesGetConst(ConstHandle2ConstPolynomial1d self); + +// +++ Get, non-const +extern_c Handle2Values +Polynomial1dValuesGet(ConstHandle2Polynomial1d self); + +// +++ Set +extern_c void +Polynomial1dValuesSet(ConstHandle2Polynomial1d self, ConstHandle2ConstValues values); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Polynomial1d/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Polynomial1d/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Polynomial1d/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Polynomial1d/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Polynomial1d/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Product.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Product.cpp new file mode 100644 index 000000000..0c22acc07 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Product.cpp @@ -0,0 +1,294 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/reduced/Product.hpp" +#include "Product.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ProductClass; +using CPP = multigroup::Product; + +static const std::string CLASSNAME = "Product"; + +namespace extract { + static auto label = [](auto &obj) { return &obj.label; }; + static auto pid = [](auto &obj) { return &obj.pid; }; + static auto multiplicity = [](auto &obj) { return &obj.multiplicity; }; + static auto distribution = [](auto &obj) { return &obj.distribution; }; +} + +using CPPMultiplicity = general::Multiplicity; +using CPPDistribution = reduced::Distribution; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProduct +ProductDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Product +ProductDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProduct +ProductCreateConst( + const char *const label, + const char *const pid, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstDistribution distribution +) { + ConstHandle2Product handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + label, + pid, + detail::tocpp(multiplicity), + detail::tocpp(distribution) + ); + return handle; +} + +// Create, general, non-const +Handle2Product +ProductCreate( + const char *const label, + const char *const pid, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstDistribution distribution +) { + ConstHandle2Product handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + label, + pid, + detail::tocpp(multiplicity), + detail::tocpp(distribution) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ProductAssign(ConstHandle2Product self, ConstHandle2ConstProduct from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ProductDelete(ConstHandle2ConstProduct self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ProductRead(ConstHandle2Product self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ProductWrite(ConstHandle2ConstProduct self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ProductPrint(ConstHandle2ConstProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ProductPrintXML(ConstHandle2ConstProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ProductPrintJSON(ConstHandle2ConstProduct self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// Has +int +ProductLabelHas(ConstHandle2ConstProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LabelHas", self, extract::label); +} + +// Get +// Returns by value +const char * +ProductLabelGet(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LabelGet", self, extract::label); +} + +// Set +void +ProductLabelSet(ConstHandle2Product self, const char *const label) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LabelSet", self, extract::label, label); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// Has +int +ProductPidHas(ConstHandle2ConstProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PidHas", self, extract::pid); +} + +// Get +// Returns by value +const char * +ProductPidGet(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PidGet", self, extract::pid); +} + +// Set +void +ProductPidSet(ConstHandle2Product self, const char *const pid) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PidSet", self, extract::pid, pid); +} + + +// ----------------------------------------------------------------------------- +// Child: multiplicity +// ----------------------------------------------------------------------------- + +// Has +int +ProductMultiplicityHas(ConstHandle2ConstProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"MultiplicityHas", self, extract::multiplicity); +} + +// Get, const +Handle2ConstMultiplicity +ProductMultiplicityGetConst(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MultiplicityGetConst", self, extract::multiplicity); +} + +// Get, non-const +Handle2Multiplicity +ProductMultiplicityGet(ConstHandle2Product self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"MultiplicityGet", self, extract::multiplicity); +} + +// Set +void +ProductMultiplicitySet(ConstHandle2Product self, ConstHandle2ConstMultiplicity multiplicity) +{ + detail::setField + (CLASSNAME, CLASSNAME+"MultiplicitySet", self, extract::multiplicity, multiplicity); +} + + +// ----------------------------------------------------------------------------- +// Child: distribution +// ----------------------------------------------------------------------------- + +// Has +int +ProductDistributionHas(ConstHandle2ConstProduct self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DistributionHas", self, extract::distribution); +} + +// Get, const +Handle2ConstDistribution +ProductDistributionGetConst(ConstHandle2ConstProduct self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DistributionGetConst", self, extract::distribution); +} + +// Get, non-const +Handle2Distribution +ProductDistributionGet(ConstHandle2Product self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DistributionGet", self, extract::distribution); +} + +// Set +void +ProductDistributionSet(ConstHandle2Product self, ConstHandle2ConstDistribution distribution) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DistributionSet", self, extract::distribution, distribution); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Product/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Product.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Product.h new file mode 100644 index 000000000..ccf3c1399 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Product.h @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Product is the basic handle type in this file. Example: +// // Create a default Product object: +// Product handle = ProductDefault(); +// Functions involving Product are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_REDUCED_PRODUCT +#define C_INTERFACE_GNDS_V2_0_REDUCED_PRODUCT + +#include "GNDStk.h" +#include "v2.0/general/Multiplicity.h" +#include "v2.0/reduced/Distribution.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ProductClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Product +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ProductClass *Product; + +// --- Const-aware handles. +typedef const struct ProductClass *const ConstHandle2ConstProduct; +typedef struct ProductClass *const ConstHandle2Product; +typedef const struct ProductClass * Handle2ConstProduct; +typedef struct ProductClass * Handle2Product; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstProduct +ProductDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Product +ProductDefault(); + +// --- Create, general, const +extern_c Handle2ConstProduct +ProductCreateConst( + const char *const label, + const char *const pid, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstDistribution distribution +); + +// +++ Create, general, non-const +extern_c Handle2Product +ProductCreate( + const char *const label, + const char *const pid, + ConstHandle2ConstMultiplicity multiplicity, + ConstHandle2ConstDistribution distribution +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ProductAssign(ConstHandle2Product self, ConstHandle2ConstProduct from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ProductDelete(ConstHandle2ConstProduct self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ProductRead(ConstHandle2Product self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ProductWrite(ConstHandle2ConstProduct self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ProductPrint(ConstHandle2ConstProduct self); + +// +++ Print to standard output, as XML +extern_c int +ProductPrintXML(ConstHandle2ConstProduct self); + +// +++ Print to standard output, as JSON +extern_c int +ProductPrintJSON(ConstHandle2ConstProduct self); + + +// ----------------------------------------------------------------------------- +// Metadatum: label +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductLabelHas(ConstHandle2ConstProduct self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ProductLabelGet(ConstHandle2ConstProduct self); + +// +++ Set +extern_c void +ProductLabelSet(ConstHandle2Product self, const char *const label); + + +// ----------------------------------------------------------------------------- +// Metadatum: pid +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductPidHas(ConstHandle2ConstProduct self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ProductPidGet(ConstHandle2ConstProduct self); + +// +++ Set +extern_c void +ProductPidSet(ConstHandle2Product self, const char *const pid); + + +// ----------------------------------------------------------------------------- +// Child: multiplicity +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductMultiplicityHas(ConstHandle2ConstProduct self); + +// --- Get, const +extern_c Handle2ConstMultiplicity +ProductMultiplicityGetConst(ConstHandle2ConstProduct self); + +// +++ Get, non-const +extern_c Handle2Multiplicity +ProductMultiplicityGet(ConstHandle2Product self); + +// +++ Set +extern_c void +ProductMultiplicitySet(ConstHandle2Product self, ConstHandle2ConstMultiplicity multiplicity); + + +// ----------------------------------------------------------------------------- +// Child: distribution +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductDistributionHas(ConstHandle2ConstProduct self); + +// --- Get, const +extern_c Handle2ConstDistribution +ProductDistributionGetConst(ConstHandle2ConstProduct self); + +// +++ Get, non-const +extern_c Handle2Distribution +ProductDistributionGet(ConstHandle2Product self); + +// +++ Set +extern_c void +ProductDistributionSet(ConstHandle2Product self, ConstHandle2ConstDistribution distribution); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Product/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Product/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Product/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Product/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Product/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Products.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Products.cpp new file mode 100644 index 000000000..cf2fde456 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Products.cpp @@ -0,0 +1,310 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/reduced/Products.hpp" +#include "Products.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ProductsClass; +using CPP = multigroup::Products; + +static const std::string CLASSNAME = "Products"; + +namespace extract { + static auto product = [](auto &obj) { return &obj.product; }; +} + +using CPPProduct = reduced::Product; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstProducts +ProductsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2Products +ProductsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstProducts +ProductsCreateConst( + ConstHandle2Product *const product, const size_t productSize +) { + ConstHandle2Products handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + std::vector{} + ); + for (size_t ProductN = 0; ProductN < productSize; ++ProductN) + ProductsProductAdd(handle, product[ProductN]); + return handle; +} + +// Create, general, non-const +Handle2Products +ProductsCreate( + ConstHandle2Product *const product, const size_t productSize +) { + ConstHandle2Products handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + std::vector{} + ); + for (size_t ProductN = 0; ProductN < productSize; ++ProductN) + ProductsProductAdd(handle, product[ProductN]); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ProductsAssign(ConstHandle2Products self, ConstHandle2ConstProducts from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ProductsDelete(ConstHandle2ConstProducts self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ProductsRead(ConstHandle2Products self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ProductsWrite(ConstHandle2ConstProducts self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ProductsPrint(ConstHandle2ConstProducts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ProductsPrintXML(ConstHandle2ConstProducts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ProductsPrintJSON(ConstHandle2ConstProducts self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: product +// ----------------------------------------------------------------------------- + +// Has +int +ProductsProductHas(ConstHandle2ConstProducts self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductHas", self, extract::product); +} + +// Clear +void +ProductsProductClear(ConstHandle2Products self) +{ + detail::clearContainer + (CLASSNAME, CLASSNAME+"ProductClear", self, extract::product); +} + +// Size +size_t +ProductsProductSize(ConstHandle2ConstProducts self) +{ + return detail::sizeOfContainer + (CLASSNAME, CLASSNAME+"ProductSize", self, extract::product); +} + +// Add +void +ProductsProductAdd(ConstHandle2Products self, ConstHandle2ConstProduct product) +{ + detail::addToContainer + (CLASSNAME, CLASSNAME+"ProductAdd", self, extract::product, product); +} + +// Get, by index \in [0,size), const +Handle2ConstProduct +ProductsProductGetConst(ConstHandle2ConstProducts self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ProductGetConst", self, extract::product, index_); +} + +// Get, by index \in [0,size), non-const +Handle2Product +ProductsProductGet(ConstHandle2Products self, const size_t index_) +{ + return detail::getByIndex + (CLASSNAME, CLASSNAME+"ProductGet", self, extract::product, index_); +} + +// Set, by index \in [0,size) +void +ProductsProductSet( + ConstHandle2Products self, + const size_t index_, + ConstHandle2ConstProduct product +) { + detail::setByIndex + (CLASSNAME, CLASSNAME+"ProductSet", self, extract::product, index_, product); +} + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// Has, by label +int +ProductsProductHasByLabel( + ConstHandle2ConstProducts self, + const char *const label +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductHasByLabel", + self, extract::product, meta::label, label); +} + +// Get, by label, const +Handle2ConstProduct +ProductsProductGetByLabelConst( + ConstHandle2ConstProducts self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByLabelConst", + self, extract::product, meta::label, label); +} + +// Get, by label, non-const +Handle2Product +ProductsProductGetByLabel( + ConstHandle2Products self, + const char *const label +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByLabel", + self, extract::product, meta::label, label); +} + +// Set, by label +void +ProductsProductSetByLabel( + ConstHandle2Products self, + const char *const label, + ConstHandle2ConstProduct product +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductSetByLabel", + self, extract::product, meta::label, label, product); +} + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// Has, by pid +int +ProductsProductHasByPid( + ConstHandle2ConstProducts self, + const char *const pid +) { + return detail::hasByMetadatum + (CLASSNAME, CLASSNAME+"ProductHasByPid", + self, extract::product, meta::pid, pid); +} + +// Get, by pid, const +Handle2ConstProduct +ProductsProductGetByPidConst( + ConstHandle2ConstProducts self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByPidConst", + self, extract::product, meta::pid, pid); +} + +// Get, by pid, non-const +Handle2Product +ProductsProductGetByPid( + ConstHandle2Products self, + const char *const pid +) { + return detail::getByMetadatum + (CLASSNAME, CLASSNAME+"ProductGetByPid", + self, extract::product, meta::pid, pid); +} + +// Set, by pid +void +ProductsProductSetByPid( + ConstHandle2Products self, + const char *const pid, + ConstHandle2ConstProduct product +) { + detail::setByMetadatum + (CLASSNAME, CLASSNAME+"ProductSetByPid", + self, extract::product, meta::pid, pid, product); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Products/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Products.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Products.h new file mode 100644 index 000000000..97e25c7d3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Products.h @@ -0,0 +1,243 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// Products is the basic handle type in this file. Example: +// // Create a default Products object: +// Products handle = ProductsDefault(); +// Functions involving Products are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_REDUCED_PRODUCTS +#define C_INTERFACE_GNDS_V2_0_REDUCED_PRODUCTS + +#include "GNDStk.h" +#include "v2.0/reduced/Product.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ProductsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ Products +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ProductsClass *Products; + +// --- Const-aware handles. +typedef const struct ProductsClass *const ConstHandle2ConstProducts; +typedef struct ProductsClass *const ConstHandle2Products; +typedef const struct ProductsClass * Handle2ConstProducts; +typedef struct ProductsClass * Handle2Products; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstProducts +ProductsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2Products +ProductsDefault(); + +// --- Create, general, const +extern_c Handle2ConstProducts +ProductsCreateConst( + ConstHandle2Product *const product, const size_t productSize +); + +// +++ Create, general, non-const +extern_c Handle2Products +ProductsCreate( + ConstHandle2Product *const product, const size_t productSize +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ProductsAssign(ConstHandle2Products self, ConstHandle2ConstProducts from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ProductsDelete(ConstHandle2ConstProducts self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ProductsRead(ConstHandle2Products self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ProductsWrite(ConstHandle2ConstProducts self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ProductsPrint(ConstHandle2ConstProducts self); + +// +++ Print to standard output, as XML +extern_c int +ProductsPrintXML(ConstHandle2ConstProducts self); + +// +++ Print to standard output, as JSON +extern_c int +ProductsPrintJSON(ConstHandle2ConstProducts self); + + +// ----------------------------------------------------------------------------- +// Child: product +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ProductsProductHas(ConstHandle2ConstProducts self); + +// +++ Clear +extern_c void +ProductsProductClear(ConstHandle2Products self); + +// +++ Size +extern_c size_t +ProductsProductSize(ConstHandle2ConstProducts self); + +// +++ Add +extern_c void +ProductsProductAdd(ConstHandle2Products self, ConstHandle2ConstProduct product); + +// --- Get, by index \in [0,size), const +extern_c Handle2ConstProduct +ProductsProductGetConst(ConstHandle2ConstProducts self, const size_t index_); + +// +++ Get, by index \in [0,size), non-const +extern_c Handle2Product +ProductsProductGet(ConstHandle2Products self, const size_t index_); + +// +++ Set, by index \in [0,size) +extern_c void +ProductsProductSet( + ConstHandle2Products self, + const size_t index_, + ConstHandle2ConstProduct product +); + +// ------------------------ +// Re: metadatum label +// ------------------------ + +// +++ Has, by label +extern_c int +ProductsProductHasByLabel( + ConstHandle2ConstProducts self, + const char *const label +); + +// --- Get, by label, const +extern_c Handle2ConstProduct +ProductsProductGetByLabelConst( + ConstHandle2ConstProducts self, + const char *const label +); + +// +++ Get, by label, non-const +extern_c Handle2Product +ProductsProductGetByLabel( + ConstHandle2Products self, + const char *const label +); + +// +++ Set, by label +extern_c void +ProductsProductSetByLabel( + ConstHandle2Products self, + const char *const label, + ConstHandle2ConstProduct product +); + +// ------------------------ +// Re: metadatum pid +// ------------------------ + +// +++ Has, by pid +extern_c int +ProductsProductHasByPid( + ConstHandle2ConstProducts self, + const char *const pid +); + +// --- Get, by pid, const +extern_c Handle2ConstProduct +ProductsProductGetByPidConst( + ConstHandle2ConstProducts self, + const char *const pid +); + +// +++ Get, by pid, non-const +extern_c Handle2Product +ProductsProductGetByPid( + ConstHandle2Products self, + const char *const pid +); + +// +++ Set, by pid +extern_c void +ProductsProductSetByPid( + ConstHandle2Products self, + const char *const pid, + ConstHandle2ConstProduct product +); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/reduced/Products/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Products/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Products/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Products/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/reduced/Products/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/CovarianceSuite.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/CovarianceSuite.cpp new file mode 100644 index 000000000..4ea3f6e22 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/CovarianceSuite.cpp @@ -0,0 +1,485 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/top/CovarianceSuite.hpp" +#include "CovarianceSuite.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = CovarianceSuiteClass; +using CPP = multigroup::CovarianceSuite; + +static const std::string CLASSNAME = "CovarianceSuite"; + +namespace extract { + static auto projectile = [](auto &obj) { return &obj.projectile; }; + static auto target = [](auto &obj) { return &obj.target; }; + static auto evaluation = [](auto &obj) { return &obj.evaluation; }; + static auto interaction = [](auto &obj) { return &obj.interaction; }; + static auto format = [](auto &obj) { return &obj.format; }; + static auto externalFiles = [](auto &obj) { return &obj.externalFiles; }; + static auto styles = [](auto &obj) { return &obj.styles; }; + static auto covarianceSections = [](auto &obj) { return &obj.covarianceSections; }; + static auto parameterCovariances = [](auto &obj) { return &obj.parameterCovariances; }; +} + +using CPPExternalFiles = general::ExternalFiles; +using CPPStyles = general::Styles; +using CPPCovarianceSections = general::CovarianceSections; +using CPPParameterCovariances = general::ParameterCovariances; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstCovarianceSuite +CovarianceSuiteDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2CovarianceSuite +CovarianceSuiteDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstCovarianceSuite +CovarianceSuiteCreateConst( + const char *const projectile, + const char *const target, + const char *const evaluation, + const char *const interaction, + const char *const format, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstStyles styles, + ConstHandle2ConstCovarianceSections covarianceSections, + ConstHandle2ConstParameterCovariances parameterCovariances +) { + ConstHandle2CovarianceSuite handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + projectile, + target, + evaluation, + interaction, + format, + detail::tocpp(externalFiles), + detail::tocpp(styles), + detail::tocpp(covarianceSections), + detail::tocpp(parameterCovariances) + ); + return handle; +} + +// Create, general, non-const +Handle2CovarianceSuite +CovarianceSuiteCreate( + const char *const projectile, + const char *const target, + const char *const evaluation, + const char *const interaction, + const char *const format, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstStyles styles, + ConstHandle2ConstCovarianceSections covarianceSections, + ConstHandle2ConstParameterCovariances parameterCovariances +) { + ConstHandle2CovarianceSuite handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + projectile, + target, + evaluation, + interaction, + format, + detail::tocpp(externalFiles), + detail::tocpp(styles), + detail::tocpp(covarianceSections), + detail::tocpp(parameterCovariances) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +CovarianceSuiteAssign(ConstHandle2CovarianceSuite self, ConstHandle2ConstCovarianceSuite from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +CovarianceSuiteDelete(ConstHandle2ConstCovarianceSuite self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +CovarianceSuiteRead(ConstHandle2CovarianceSuite self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +CovarianceSuiteWrite(ConstHandle2ConstCovarianceSuite self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +CovarianceSuitePrint(ConstHandle2ConstCovarianceSuite self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +CovarianceSuitePrintXML(ConstHandle2ConstCovarianceSuite self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +CovarianceSuitePrintJSON(ConstHandle2ConstCovarianceSuite self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteProjectileHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProjectileHas", self, extract::projectile); +} + +// Get +// Returns by value +const char * +CovarianceSuiteProjectileGet(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileGet", self, extract::projectile); +} + +// Set +void +CovarianceSuiteProjectileSet(ConstHandle2CovarianceSuite self, const char *const projectile) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProjectileSet", self, extract::projectile, projectile); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: target +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteTargetHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TargetHas", self, extract::target); +} + +// Get +// Returns by value +const char * +CovarianceSuiteTargetGet(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TargetGet", self, extract::target); +} + +// Set +void +CovarianceSuiteTargetSet(ConstHandle2CovarianceSuite self, const char *const target) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TargetSet", self, extract::target, target); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: evaluation +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteEvaluationHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EvaluationHas", self, extract::evaluation); +} + +// Get +// Returns by value +const char * +CovarianceSuiteEvaluationGet(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaluationGet", self, extract::evaluation); +} + +// Set +void +CovarianceSuiteEvaluationSet(ConstHandle2CovarianceSuite self, const char *const evaluation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EvaluationSet", self, extract::evaluation, evaluation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteInteractionHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InteractionHas", self, extract::interaction); +} + +// Get +// Returns by value +const char * +CovarianceSuiteInteractionGet(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InteractionGet", self, extract::interaction); +} + +// Set +void +CovarianceSuiteInteractionSet(ConstHandle2CovarianceSuite self, const char *const interaction) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InteractionSet", self, extract::interaction, interaction); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteFormatHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FormatHas", self, extract::format); +} + +// Get +// Returns by value +const char * +CovarianceSuiteFormatGet(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FormatGet", self, extract::format); +} + +// Set +void +CovarianceSuiteFormatSet(ConstHandle2CovarianceSuite self, const char *const format) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FormatSet", self, extract::format, format); +} + + +// ----------------------------------------------------------------------------- +// Child: externalFiles +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteExternalFilesHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ExternalFilesHas", self, extract::externalFiles); +} + +// Get, const +Handle2ConstExternalFiles +CovarianceSuiteExternalFilesGetConst(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExternalFilesGetConst", self, extract::externalFiles); +} + +// Get, non-const +Handle2ExternalFiles +CovarianceSuiteExternalFilesGet(ConstHandle2CovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExternalFilesGet", self, extract::externalFiles); +} + +// Set +void +CovarianceSuiteExternalFilesSet(ConstHandle2CovarianceSuite self, ConstHandle2ConstExternalFiles externalFiles) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ExternalFilesSet", self, extract::externalFiles, externalFiles); +} + + +// ----------------------------------------------------------------------------- +// Child: styles +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteStylesHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StylesHas", self, extract::styles); +} + +// Get, const +Handle2ConstStyles +CovarianceSuiteStylesGetConst(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StylesGetConst", self, extract::styles); +} + +// Get, non-const +Handle2Styles +CovarianceSuiteStylesGet(ConstHandle2CovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StylesGet", self, extract::styles); +} + +// Set +void +CovarianceSuiteStylesSet(ConstHandle2CovarianceSuite self, ConstHandle2ConstStyles styles) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StylesSet", self, extract::styles, styles); +} + + +// ----------------------------------------------------------------------------- +// Child: covarianceSections +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteCovarianceSectionsHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"CovarianceSectionsHas", self, extract::covarianceSections); +} + +// Get, const +Handle2ConstCovarianceSections +CovarianceSuiteCovarianceSectionsGetConst(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceSectionsGetConst", self, extract::covarianceSections); +} + +// Get, non-const +Handle2CovarianceSections +CovarianceSuiteCovarianceSectionsGet(ConstHandle2CovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"CovarianceSectionsGet", self, extract::covarianceSections); +} + +// Set +void +CovarianceSuiteCovarianceSectionsSet(ConstHandle2CovarianceSuite self, ConstHandle2ConstCovarianceSections covarianceSections) +{ + detail::setField + (CLASSNAME, CLASSNAME+"CovarianceSectionsSet", self, extract::covarianceSections, covarianceSections); +} + + +// ----------------------------------------------------------------------------- +// Child: parameterCovariances +// ----------------------------------------------------------------------------- + +// Has +int +CovarianceSuiteParameterCovariancesHas(ConstHandle2ConstCovarianceSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ParameterCovariancesHas", self, extract::parameterCovariances); +} + +// Get, const +Handle2ConstParameterCovariances +CovarianceSuiteParameterCovariancesGetConst(ConstHandle2ConstCovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParameterCovariancesGetConst", self, extract::parameterCovariances); +} + +// Get, non-const +Handle2ParameterCovariances +CovarianceSuiteParameterCovariancesGet(ConstHandle2CovarianceSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ParameterCovariancesGet", self, extract::parameterCovariances); +} + +// Set +void +CovarianceSuiteParameterCovariancesSet(ConstHandle2CovarianceSuite self, ConstHandle2ConstParameterCovariances parameterCovariances) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ParameterCovariancesSet", self, extract::parameterCovariances, parameterCovariances); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/top/CovarianceSuite/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/CovarianceSuite.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/CovarianceSuite.h new file mode 100644 index 000000000..0aa0fad0d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/CovarianceSuite.h @@ -0,0 +1,333 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// CovarianceSuite is the basic handle type in this file. Example: +// // Create a default CovarianceSuite object: +// CovarianceSuite handle = CovarianceSuiteDefault(); +// Functions involving CovarianceSuite are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_TOP_COVARIANCESUITE +#define C_INTERFACE_GNDS_V2_0_TOP_COVARIANCESUITE + +#include "GNDStk.h" +#include "v2.0/general/ExternalFiles.h" +#include "v2.0/general/Styles.h" +#include "v2.0/general/CovarianceSections.h" +#include "v2.0/general/ParameterCovariances.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct CovarianceSuiteClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ CovarianceSuite +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct CovarianceSuiteClass *CovarianceSuite; + +// --- Const-aware handles. +typedef const struct CovarianceSuiteClass *const ConstHandle2ConstCovarianceSuite; +typedef struct CovarianceSuiteClass *const ConstHandle2CovarianceSuite; +typedef const struct CovarianceSuiteClass * Handle2ConstCovarianceSuite; +typedef struct CovarianceSuiteClass * Handle2CovarianceSuite; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstCovarianceSuite +CovarianceSuiteDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2CovarianceSuite +CovarianceSuiteDefault(); + +// --- Create, general, const +extern_c Handle2ConstCovarianceSuite +CovarianceSuiteCreateConst( + const char *const projectile, + const char *const target, + const char *const evaluation, + const char *const interaction, + const char *const format, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstStyles styles, + ConstHandle2ConstCovarianceSections covarianceSections, + ConstHandle2ConstParameterCovariances parameterCovariances +); + +// +++ Create, general, non-const +extern_c Handle2CovarianceSuite +CovarianceSuiteCreate( + const char *const projectile, + const char *const target, + const char *const evaluation, + const char *const interaction, + const char *const format, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstStyles styles, + ConstHandle2ConstCovarianceSections covarianceSections, + ConstHandle2ConstParameterCovariances parameterCovariances +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +CovarianceSuiteAssign(ConstHandle2CovarianceSuite self, ConstHandle2ConstCovarianceSuite from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +CovarianceSuiteDelete(ConstHandle2ConstCovarianceSuite self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +CovarianceSuiteRead(ConstHandle2CovarianceSuite self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +CovarianceSuiteWrite(ConstHandle2ConstCovarianceSuite self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +CovarianceSuitePrint(ConstHandle2ConstCovarianceSuite self); + +// +++ Print to standard output, as XML +extern_c int +CovarianceSuitePrintXML(ConstHandle2ConstCovarianceSuite self); + +// +++ Print to standard output, as JSON +extern_c int +CovarianceSuitePrintJSON(ConstHandle2ConstCovarianceSuite self); + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteProjectileHas(ConstHandle2ConstCovarianceSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceSuiteProjectileGet(ConstHandle2ConstCovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteProjectileSet(ConstHandle2CovarianceSuite self, const char *const projectile); + + +// ----------------------------------------------------------------------------- +// Metadatum: target +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteTargetHas(ConstHandle2ConstCovarianceSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceSuiteTargetGet(ConstHandle2ConstCovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteTargetSet(ConstHandle2CovarianceSuite self, const char *const target); + + +// ----------------------------------------------------------------------------- +// Metadatum: evaluation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteEvaluationHas(ConstHandle2ConstCovarianceSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceSuiteEvaluationGet(ConstHandle2ConstCovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteEvaluationSet(ConstHandle2CovarianceSuite self, const char *const evaluation); + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteInteractionHas(ConstHandle2ConstCovarianceSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceSuiteInteractionGet(ConstHandle2ConstCovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteInteractionSet(ConstHandle2CovarianceSuite self, const char *const interaction); + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteFormatHas(ConstHandle2ConstCovarianceSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +CovarianceSuiteFormatGet(ConstHandle2ConstCovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteFormatSet(ConstHandle2CovarianceSuite self, const char *const format); + + +// ----------------------------------------------------------------------------- +// Child: externalFiles +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteExternalFilesHas(ConstHandle2ConstCovarianceSuite self); + +// --- Get, const +extern_c Handle2ConstExternalFiles +CovarianceSuiteExternalFilesGetConst(ConstHandle2ConstCovarianceSuite self); + +// +++ Get, non-const +extern_c Handle2ExternalFiles +CovarianceSuiteExternalFilesGet(ConstHandle2CovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteExternalFilesSet(ConstHandle2CovarianceSuite self, ConstHandle2ConstExternalFiles externalFiles); + + +// ----------------------------------------------------------------------------- +// Child: styles +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteStylesHas(ConstHandle2ConstCovarianceSuite self); + +// --- Get, const +extern_c Handle2ConstStyles +CovarianceSuiteStylesGetConst(ConstHandle2ConstCovarianceSuite self); + +// +++ Get, non-const +extern_c Handle2Styles +CovarianceSuiteStylesGet(ConstHandle2CovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteStylesSet(ConstHandle2CovarianceSuite self, ConstHandle2ConstStyles styles); + + +// ----------------------------------------------------------------------------- +// Child: covarianceSections +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteCovarianceSectionsHas(ConstHandle2ConstCovarianceSuite self); + +// --- Get, const +extern_c Handle2ConstCovarianceSections +CovarianceSuiteCovarianceSectionsGetConst(ConstHandle2ConstCovarianceSuite self); + +// +++ Get, non-const +extern_c Handle2CovarianceSections +CovarianceSuiteCovarianceSectionsGet(ConstHandle2CovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteCovarianceSectionsSet(ConstHandle2CovarianceSuite self, ConstHandle2ConstCovarianceSections covarianceSections); + + +// ----------------------------------------------------------------------------- +// Child: parameterCovariances +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +CovarianceSuiteParameterCovariancesHas(ConstHandle2ConstCovarianceSuite self); + +// --- Get, const +extern_c Handle2ConstParameterCovariances +CovarianceSuiteParameterCovariancesGetConst(ConstHandle2ConstCovarianceSuite self); + +// +++ Get, non-const +extern_c Handle2ParameterCovariances +CovarianceSuiteParameterCovariancesGet(ConstHandle2CovarianceSuite self); + +// +++ Set +extern_c void +CovarianceSuiteParameterCovariancesSet(ConstHandle2CovarianceSuite self, ConstHandle2ConstParameterCovariances parameterCovariances); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/top/CovarianceSuite/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/CovarianceSuite/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/CovarianceSuite/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/CovarianceSuite/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/CovarianceSuite/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/FissionFragmentData.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/FissionFragmentData.cpp new file mode 100644 index 000000000..088c594d2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/FissionFragmentData.cpp @@ -0,0 +1,267 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/top/FissionFragmentData.hpp" +#include "FissionFragmentData.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = FissionFragmentDataClass; +using CPP = multigroup::FissionFragmentData; + +static const std::string CLASSNAME = "FissionFragmentData"; + +namespace extract { + static auto productYields = [](auto &obj) { return &obj.productYields; }; + static auto delayedNeutrons = [](auto &obj) { return &obj.delayedNeutrons; }; + static auto fissionEnergyReleases = [](auto &obj) { return &obj.fissionEnergyReleases; }; +} + +using CPPProductYields = general::ProductYields; +using CPPDelayedNeutrons = general::DelayedNeutrons; +using CPPFissionEnergyReleases = general::FissionEnergyReleases; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstFissionFragmentData +FissionFragmentDataDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2FissionFragmentData +FissionFragmentDataDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstFissionFragmentData +FissionFragmentDataCreateConst( + ConstHandle2ConstProductYields productYields, + ConstHandle2ConstDelayedNeutrons delayedNeutrons, + ConstHandle2ConstFissionEnergyReleases fissionEnergyReleases +) { + ConstHandle2FissionFragmentData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + detail::tocpp(productYields), + detail::tocpp(delayedNeutrons), + detail::tocpp(fissionEnergyReleases) + ); + return handle; +} + +// Create, general, non-const +Handle2FissionFragmentData +FissionFragmentDataCreate( + ConstHandle2ConstProductYields productYields, + ConstHandle2ConstDelayedNeutrons delayedNeutrons, + ConstHandle2ConstFissionEnergyReleases fissionEnergyReleases +) { + ConstHandle2FissionFragmentData handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + detail::tocpp(productYields), + detail::tocpp(delayedNeutrons), + detail::tocpp(fissionEnergyReleases) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +FissionFragmentDataAssign(ConstHandle2FissionFragmentData self, ConstHandle2ConstFissionFragmentData from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +FissionFragmentDataDelete(ConstHandle2ConstFissionFragmentData self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +FissionFragmentDataRead(ConstHandle2FissionFragmentData self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +FissionFragmentDataWrite(ConstHandle2ConstFissionFragmentData self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +FissionFragmentDataPrint(ConstHandle2ConstFissionFragmentData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +FissionFragmentDataPrintXML(ConstHandle2ConstFissionFragmentData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +FissionFragmentDataPrintJSON(ConstHandle2ConstFissionFragmentData self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Child: productYields +// ----------------------------------------------------------------------------- + +// Has +int +FissionFragmentDataProductYieldsHas(ConstHandle2ConstFissionFragmentData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductYieldsHas", self, extract::productYields); +} + +// Get, const +Handle2ConstProductYields +FissionFragmentDataProductYieldsGetConst(ConstHandle2ConstFissionFragmentData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductYieldsGetConst", self, extract::productYields); +} + +// Get, non-const +Handle2ProductYields +FissionFragmentDataProductYieldsGet(ConstHandle2FissionFragmentData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductYieldsGet", self, extract::productYields); +} + +// Set +void +FissionFragmentDataProductYieldsSet(ConstHandle2FissionFragmentData self, ConstHandle2ConstProductYields productYields) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductYieldsSet", self, extract::productYields, productYields); +} + + +// ----------------------------------------------------------------------------- +// Child: delayedNeutrons +// ----------------------------------------------------------------------------- + +// Has +int +FissionFragmentDataDelayedNeutronsHas(ConstHandle2ConstFissionFragmentData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"DelayedNeutronsHas", self, extract::delayedNeutrons); +} + +// Get, const +Handle2ConstDelayedNeutrons +FissionFragmentDataDelayedNeutronsGetConst(ConstHandle2ConstFissionFragmentData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedNeutronsGetConst", self, extract::delayedNeutrons); +} + +// Get, non-const +Handle2DelayedNeutrons +FissionFragmentDataDelayedNeutronsGet(ConstHandle2FissionFragmentData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"DelayedNeutronsGet", self, extract::delayedNeutrons); +} + +// Set +void +FissionFragmentDataDelayedNeutronsSet(ConstHandle2FissionFragmentData self, ConstHandle2ConstDelayedNeutrons delayedNeutrons) +{ + detail::setField + (CLASSNAME, CLASSNAME+"DelayedNeutronsSet", self, extract::delayedNeutrons, delayedNeutrons); +} + + +// ----------------------------------------------------------------------------- +// Child: fissionEnergyReleases +// ----------------------------------------------------------------------------- + +// Has +int +FissionFragmentDataFissionEnergyReleasesHas(ConstHandle2ConstFissionFragmentData self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FissionEnergyReleasesHas", self, extract::fissionEnergyReleases); +} + +// Get, const +Handle2ConstFissionEnergyReleases +FissionFragmentDataFissionEnergyReleasesGetConst(ConstHandle2ConstFissionFragmentData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionEnergyReleasesGetConst", self, extract::fissionEnergyReleases); +} + +// Get, non-const +Handle2FissionEnergyReleases +FissionFragmentDataFissionEnergyReleasesGet(ConstHandle2FissionFragmentData self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionEnergyReleasesGet", self, extract::fissionEnergyReleases); +} + +// Set +void +FissionFragmentDataFissionEnergyReleasesSet(ConstHandle2FissionFragmentData self, ConstHandle2ConstFissionEnergyReleases fissionEnergyReleases) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FissionEnergyReleasesSet", self, extract::fissionEnergyReleases, fissionEnergyReleases); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/top/FissionFragmentData/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/FissionFragmentData.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/FissionFragmentData.h new file mode 100644 index 000000000..810925a74 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/FissionFragmentData.h @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// FissionFragmentData is the basic handle type in this file. Example: +// // Create a default FissionFragmentData object: +// FissionFragmentData handle = FissionFragmentDataDefault(); +// Functions involving FissionFragmentData are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_TOP_FISSIONFRAGMENTDATA +#define C_INTERFACE_GNDS_V2_0_TOP_FISSIONFRAGMENTDATA + +#include "GNDStk.h" +#include "v2.0/general/ProductYields.h" +#include "v2.0/general/DelayedNeutrons.h" +#include "v2.0/general/FissionEnergyReleases.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct FissionFragmentDataClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ FissionFragmentData +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct FissionFragmentDataClass *FissionFragmentData; + +// --- Const-aware handles. +typedef const struct FissionFragmentDataClass *const ConstHandle2ConstFissionFragmentData; +typedef struct FissionFragmentDataClass *const ConstHandle2FissionFragmentData; +typedef const struct FissionFragmentDataClass * Handle2ConstFissionFragmentData; +typedef struct FissionFragmentDataClass * Handle2FissionFragmentData; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstFissionFragmentData +FissionFragmentDataDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2FissionFragmentData +FissionFragmentDataDefault(); + +// --- Create, general, const +extern_c Handle2ConstFissionFragmentData +FissionFragmentDataCreateConst( + ConstHandle2ConstProductYields productYields, + ConstHandle2ConstDelayedNeutrons delayedNeutrons, + ConstHandle2ConstFissionEnergyReleases fissionEnergyReleases +); + +// +++ Create, general, non-const +extern_c Handle2FissionFragmentData +FissionFragmentDataCreate( + ConstHandle2ConstProductYields productYields, + ConstHandle2ConstDelayedNeutrons delayedNeutrons, + ConstHandle2ConstFissionEnergyReleases fissionEnergyReleases +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +FissionFragmentDataAssign(ConstHandle2FissionFragmentData self, ConstHandle2ConstFissionFragmentData from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +FissionFragmentDataDelete(ConstHandle2ConstFissionFragmentData self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +FissionFragmentDataRead(ConstHandle2FissionFragmentData self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +FissionFragmentDataWrite(ConstHandle2ConstFissionFragmentData self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +FissionFragmentDataPrint(ConstHandle2ConstFissionFragmentData self); + +// +++ Print to standard output, as XML +extern_c int +FissionFragmentDataPrintXML(ConstHandle2ConstFissionFragmentData self); + +// +++ Print to standard output, as JSON +extern_c int +FissionFragmentDataPrintJSON(ConstHandle2ConstFissionFragmentData self); + + +// ----------------------------------------------------------------------------- +// Child: productYields +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionFragmentDataProductYieldsHas(ConstHandle2ConstFissionFragmentData self); + +// --- Get, const +extern_c Handle2ConstProductYields +FissionFragmentDataProductYieldsGetConst(ConstHandle2ConstFissionFragmentData self); + +// +++ Get, non-const +extern_c Handle2ProductYields +FissionFragmentDataProductYieldsGet(ConstHandle2FissionFragmentData self); + +// +++ Set +extern_c void +FissionFragmentDataProductYieldsSet(ConstHandle2FissionFragmentData self, ConstHandle2ConstProductYields productYields); + + +// ----------------------------------------------------------------------------- +// Child: delayedNeutrons +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionFragmentDataDelayedNeutronsHas(ConstHandle2ConstFissionFragmentData self); + +// --- Get, const +extern_c Handle2ConstDelayedNeutrons +FissionFragmentDataDelayedNeutronsGetConst(ConstHandle2ConstFissionFragmentData self); + +// +++ Get, non-const +extern_c Handle2DelayedNeutrons +FissionFragmentDataDelayedNeutronsGet(ConstHandle2FissionFragmentData self); + +// +++ Set +extern_c void +FissionFragmentDataDelayedNeutronsSet(ConstHandle2FissionFragmentData self, ConstHandle2ConstDelayedNeutrons delayedNeutrons); + + +// ----------------------------------------------------------------------------- +// Child: fissionEnergyReleases +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +FissionFragmentDataFissionEnergyReleasesHas(ConstHandle2ConstFissionFragmentData self); + +// --- Get, const +extern_c Handle2ConstFissionEnergyReleases +FissionFragmentDataFissionEnergyReleasesGetConst(ConstHandle2ConstFissionFragmentData self); + +// +++ Get, non-const +extern_c Handle2FissionEnergyReleases +FissionFragmentDataFissionEnergyReleasesGet(ConstHandle2FissionFragmentData self); + +// +++ Set +extern_c void +FissionFragmentDataFissionEnergyReleasesSet(ConstHandle2FissionFragmentData self, ConstHandle2ConstFissionEnergyReleases fissionEnergyReleases); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/top/FissionFragmentData/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/FissionFragmentData/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/FissionFragmentData/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/FissionFragmentData/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/FissionFragmentData/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/PoPs.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/PoPs.cpp new file mode 100644 index 000000000..0ce559d29 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/PoPs.cpp @@ -0,0 +1,544 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/top/PoPs.hpp" +#include "PoPs.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = PoPsClass; +using CPP = multigroup::PoPs; + +static const std::string CLASSNAME = "PoPs"; + +namespace extract { + static auto name = [](auto &obj) { return &obj.name; }; + static auto version = [](auto &obj) { return &obj.version; }; + static auto format = [](auto &obj) { return &obj.format; }; + static auto aliases = [](auto &obj) { return &obj.aliases; }; + static auto baryons = [](auto &obj) { return &obj.baryons; }; + static auto chemicalElements = [](auto &obj) { return &obj.chemicalElements; }; + static auto styles = [](auto &obj) { return &obj.styles; }; + static auto unorthodoxes = [](auto &obj) { return &obj.unorthodoxes; }; + static auto gaugeBosons = [](auto &obj) { return &obj.gaugeBosons; }; + static auto leptons = [](auto &obj) { return &obj.leptons; }; +} + +using CPPAliases = general::Aliases; +using CPPBaryons = general::Baryons; +using CPPChemicalElements = general::ChemicalElements; +using CPPStyles = general::Styles; +using CPPUnorthodoxes = general::Unorthodoxes; +using CPPGaugeBosons = general::GaugeBosons; +using CPPLeptons = general::Leptons; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstPoPs +PoPsDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2PoPs +PoPsDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstPoPs +PoPsCreateConst( + const char *const name, + const char *const version, + const char *const format, + ConstHandle2ConstAliases aliases, + ConstHandle2ConstBaryons baryons, + ConstHandle2ConstChemicalElements chemicalElements, + ConstHandle2ConstStyles styles, + ConstHandle2ConstUnorthodoxes unorthodoxes, + ConstHandle2ConstGaugeBosons gaugeBosons, + ConstHandle2ConstLeptons leptons +) { + ConstHandle2PoPs handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + name, + version, + format, + detail::tocpp(aliases), + detail::tocpp(baryons), + detail::tocpp(chemicalElements), + detail::tocpp(styles), + detail::tocpp(unorthodoxes), + detail::tocpp(gaugeBosons), + detail::tocpp(leptons) + ); + return handle; +} + +// Create, general, non-const +Handle2PoPs +PoPsCreate( + const char *const name, + const char *const version, + const char *const format, + ConstHandle2ConstAliases aliases, + ConstHandle2ConstBaryons baryons, + ConstHandle2ConstChemicalElements chemicalElements, + ConstHandle2ConstStyles styles, + ConstHandle2ConstUnorthodoxes unorthodoxes, + ConstHandle2ConstGaugeBosons gaugeBosons, + ConstHandle2ConstLeptons leptons +) { + ConstHandle2PoPs handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + name, + version, + format, + detail::tocpp(aliases), + detail::tocpp(baryons), + detail::tocpp(chemicalElements), + detail::tocpp(styles), + detail::tocpp(unorthodoxes), + detail::tocpp(gaugeBosons), + detail::tocpp(leptons) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +PoPsAssign(ConstHandle2PoPs self, ConstHandle2ConstPoPs from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +PoPsDelete(ConstHandle2ConstPoPs self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +PoPsRead(ConstHandle2PoPs self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +PoPsWrite(ConstHandle2ConstPoPs self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +PoPsPrint(ConstHandle2ConstPoPs self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +PoPsPrintXML(ConstHandle2ConstPoPs self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +PoPsPrintJSON(ConstHandle2ConstPoPs self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// Has +int +PoPsNameHas(ConstHandle2ConstPoPs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"NameHas", self, extract::name); +} + +// Get +// Returns by value +const char * +PoPsNameGet(ConstHandle2ConstPoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"NameGet", self, extract::name); +} + +// Set +void +PoPsNameSet(ConstHandle2PoPs self, const char *const name) +{ + detail::setField + (CLASSNAME, CLASSNAME+"NameSet", self, extract::name, name); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: version +// ----------------------------------------------------------------------------- + +// Has +int +PoPsVersionHas(ConstHandle2ConstPoPs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"VersionHas", self, extract::version); +} + +// Get +// Returns by value +const char * +PoPsVersionGet(ConstHandle2ConstPoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"VersionGet", self, extract::version); +} + +// Set +void +PoPsVersionSet(ConstHandle2PoPs self, const char *const version) +{ + detail::setField + (CLASSNAME, CLASSNAME+"VersionSet", self, extract::version, version); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// Has +int +PoPsFormatHas(ConstHandle2ConstPoPs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FormatHas", self, extract::format); +} + +// Get +// Returns by value +const char * +PoPsFormatGet(ConstHandle2ConstPoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FormatGet", self, extract::format); +} + +// Set +void +PoPsFormatSet(ConstHandle2PoPs self, const char *const format) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FormatSet", self, extract::format, format); +} + + +// ----------------------------------------------------------------------------- +// Child: aliases +// ----------------------------------------------------------------------------- + +// Has +int +PoPsAliasesHas(ConstHandle2ConstPoPs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"AliasesHas", self, extract::aliases); +} + +// Get, const +Handle2ConstAliases +PoPsAliasesGetConst(ConstHandle2ConstPoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AliasesGetConst", self, extract::aliases); +} + +// Get, non-const +Handle2Aliases +PoPsAliasesGet(ConstHandle2PoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"AliasesGet", self, extract::aliases); +} + +// Set +void +PoPsAliasesSet(ConstHandle2PoPs self, ConstHandle2ConstAliases aliases) +{ + detail::setField + (CLASSNAME, CLASSNAME+"AliasesSet", self, extract::aliases, aliases); +} + + +// ----------------------------------------------------------------------------- +// Child: baryons +// ----------------------------------------------------------------------------- + +// Has +int +PoPsBaryonsHas(ConstHandle2ConstPoPs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"BaryonsHas", self, extract::baryons); +} + +// Get, const +Handle2ConstBaryons +PoPsBaryonsGetConst(ConstHandle2ConstPoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BaryonsGetConst", self, extract::baryons); +} + +// Get, non-const +Handle2Baryons +PoPsBaryonsGet(ConstHandle2PoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"BaryonsGet", self, extract::baryons); +} + +// Set +void +PoPsBaryonsSet(ConstHandle2PoPs self, ConstHandle2ConstBaryons baryons) +{ + detail::setField + (CLASSNAME, CLASSNAME+"BaryonsSet", self, extract::baryons, baryons); +} + + +// ----------------------------------------------------------------------------- +// Child: chemicalElements +// ----------------------------------------------------------------------------- + +// Has +int +PoPsChemicalElementsHas(ConstHandle2ConstPoPs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ChemicalElementsHas", self, extract::chemicalElements); +} + +// Get, const +Handle2ConstChemicalElements +PoPsChemicalElementsGetConst(ConstHandle2ConstPoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChemicalElementsGetConst", self, extract::chemicalElements); +} + +// Get, non-const +Handle2ChemicalElements +PoPsChemicalElementsGet(ConstHandle2PoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ChemicalElementsGet", self, extract::chemicalElements); +} + +// Set +void +PoPsChemicalElementsSet(ConstHandle2PoPs self, ConstHandle2ConstChemicalElements chemicalElements) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ChemicalElementsSet", self, extract::chemicalElements, chemicalElements); +} + + +// ----------------------------------------------------------------------------- +// Child: styles +// ----------------------------------------------------------------------------- + +// Has +int +PoPsStylesHas(ConstHandle2ConstPoPs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StylesHas", self, extract::styles); +} + +// Get, const +Handle2ConstStyles +PoPsStylesGetConst(ConstHandle2ConstPoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StylesGetConst", self, extract::styles); +} + +// Get, non-const +Handle2Styles +PoPsStylesGet(ConstHandle2PoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StylesGet", self, extract::styles); +} + +// Set +void +PoPsStylesSet(ConstHandle2PoPs self, ConstHandle2ConstStyles styles) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StylesSet", self, extract::styles, styles); +} + + +// ----------------------------------------------------------------------------- +// Child: unorthodoxes +// ----------------------------------------------------------------------------- + +// Has +int +PoPsUnorthodoxesHas(ConstHandle2ConstPoPs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"UnorthodoxesHas", self, extract::unorthodoxes); +} + +// Get, const +Handle2ConstUnorthodoxes +PoPsUnorthodoxesGetConst(ConstHandle2ConstPoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnorthodoxesGetConst", self, extract::unorthodoxes); +} + +// Get, non-const +Handle2Unorthodoxes +PoPsUnorthodoxesGet(ConstHandle2PoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"UnorthodoxesGet", self, extract::unorthodoxes); +} + +// Set +void +PoPsUnorthodoxesSet(ConstHandle2PoPs self, ConstHandle2ConstUnorthodoxes unorthodoxes) +{ + detail::setField + (CLASSNAME, CLASSNAME+"UnorthodoxesSet", self, extract::unorthodoxes, unorthodoxes); +} + + +// ----------------------------------------------------------------------------- +// Child: gaugeBosons +// ----------------------------------------------------------------------------- + +// Has +int +PoPsGaugeBosonsHas(ConstHandle2ConstPoPs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"GaugeBosonsHas", self, extract::gaugeBosons); +} + +// Get, const +Handle2ConstGaugeBosons +PoPsGaugeBosonsGetConst(ConstHandle2ConstPoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GaugeBosonsGetConst", self, extract::gaugeBosons); +} + +// Get, non-const +Handle2GaugeBosons +PoPsGaugeBosonsGet(ConstHandle2PoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"GaugeBosonsGet", self, extract::gaugeBosons); +} + +// Set +void +PoPsGaugeBosonsSet(ConstHandle2PoPs self, ConstHandle2ConstGaugeBosons gaugeBosons) +{ + detail::setField + (CLASSNAME, CLASSNAME+"GaugeBosonsSet", self, extract::gaugeBosons, gaugeBosons); +} + + +// ----------------------------------------------------------------------------- +// Child: leptons +// ----------------------------------------------------------------------------- + +// Has +int +PoPsLeptonsHas(ConstHandle2ConstPoPs self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"LeptonsHas", self, extract::leptons); +} + +// Get, const +Handle2ConstLeptons +PoPsLeptonsGetConst(ConstHandle2ConstPoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LeptonsGetConst", self, extract::leptons); +} + +// Get, non-const +Handle2Leptons +PoPsLeptonsGet(ConstHandle2PoPs self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"LeptonsGet", self, extract::leptons); +} + +// Set +void +PoPsLeptonsSet(ConstHandle2PoPs self, ConstHandle2ConstLeptons leptons) +{ + detail::setField + (CLASSNAME, CLASSNAME+"LeptonsSet", self, extract::leptons, leptons); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/top/PoPs/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/PoPs.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/PoPs.h new file mode 100644 index 000000000..428dfffd2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/PoPs.h @@ -0,0 +1,365 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// PoPs is the basic handle type in this file. Example: +// // Create a default PoPs object: +// PoPs handle = PoPsDefault(); +// Functions involving PoPs are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_TOP_POPS +#define C_INTERFACE_GNDS_V2_0_TOP_POPS + +#include "GNDStk.h" +#include "v2.0/general/Aliases.h" +#include "v2.0/general/Baryons.h" +#include "v2.0/general/ChemicalElements.h" +#include "v2.0/general/Styles.h" +#include "v2.0/general/Unorthodoxes.h" +#include "v2.0/general/GaugeBosons.h" +#include "v2.0/general/Leptons.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct PoPsClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ PoPs +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct PoPsClass *PoPs; + +// --- Const-aware handles. +typedef const struct PoPsClass *const ConstHandle2ConstPoPs; +typedef struct PoPsClass *const ConstHandle2PoPs; +typedef const struct PoPsClass * Handle2ConstPoPs; +typedef struct PoPsClass * Handle2PoPs; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstPoPs +PoPsDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2PoPs +PoPsDefault(); + +// --- Create, general, const +extern_c Handle2ConstPoPs +PoPsCreateConst( + const char *const name, + const char *const version, + const char *const format, + ConstHandle2ConstAliases aliases, + ConstHandle2ConstBaryons baryons, + ConstHandle2ConstChemicalElements chemicalElements, + ConstHandle2ConstStyles styles, + ConstHandle2ConstUnorthodoxes unorthodoxes, + ConstHandle2ConstGaugeBosons gaugeBosons, + ConstHandle2ConstLeptons leptons +); + +// +++ Create, general, non-const +extern_c Handle2PoPs +PoPsCreate( + const char *const name, + const char *const version, + const char *const format, + ConstHandle2ConstAliases aliases, + ConstHandle2ConstBaryons baryons, + ConstHandle2ConstChemicalElements chemicalElements, + ConstHandle2ConstStyles styles, + ConstHandle2ConstUnorthodoxes unorthodoxes, + ConstHandle2ConstGaugeBosons gaugeBosons, + ConstHandle2ConstLeptons leptons +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +PoPsAssign(ConstHandle2PoPs self, ConstHandle2ConstPoPs from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +PoPsDelete(ConstHandle2ConstPoPs self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +PoPsRead(ConstHandle2PoPs self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +PoPsWrite(ConstHandle2ConstPoPs self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +PoPsPrint(ConstHandle2ConstPoPs self); + +// +++ Print to standard output, as XML +extern_c int +PoPsPrintXML(ConstHandle2ConstPoPs self); + +// +++ Print to standard output, as JSON +extern_c int +PoPsPrintJSON(ConstHandle2ConstPoPs self); + + +// ----------------------------------------------------------------------------- +// Metadatum: name +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPsNameHas(ConstHandle2ConstPoPs self); + +// +++ Get +// +++ Returns by value +extern_c const char * +PoPsNameGet(ConstHandle2ConstPoPs self); + +// +++ Set +extern_c void +PoPsNameSet(ConstHandle2PoPs self, const char *const name); + + +// ----------------------------------------------------------------------------- +// Metadatum: version +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPsVersionHas(ConstHandle2ConstPoPs self); + +// +++ Get +// +++ Returns by value +extern_c const char * +PoPsVersionGet(ConstHandle2ConstPoPs self); + +// +++ Set +extern_c void +PoPsVersionSet(ConstHandle2PoPs self, const char *const version); + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPsFormatHas(ConstHandle2ConstPoPs self); + +// +++ Get +// +++ Returns by value +extern_c const char * +PoPsFormatGet(ConstHandle2ConstPoPs self); + +// +++ Set +extern_c void +PoPsFormatSet(ConstHandle2PoPs self, const char *const format); + + +// ----------------------------------------------------------------------------- +// Child: aliases +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPsAliasesHas(ConstHandle2ConstPoPs self); + +// --- Get, const +extern_c Handle2ConstAliases +PoPsAliasesGetConst(ConstHandle2ConstPoPs self); + +// +++ Get, non-const +extern_c Handle2Aliases +PoPsAliasesGet(ConstHandle2PoPs self); + +// +++ Set +extern_c void +PoPsAliasesSet(ConstHandle2PoPs self, ConstHandle2ConstAliases aliases); + + +// ----------------------------------------------------------------------------- +// Child: baryons +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPsBaryonsHas(ConstHandle2ConstPoPs self); + +// --- Get, const +extern_c Handle2ConstBaryons +PoPsBaryonsGetConst(ConstHandle2ConstPoPs self); + +// +++ Get, non-const +extern_c Handle2Baryons +PoPsBaryonsGet(ConstHandle2PoPs self); + +// +++ Set +extern_c void +PoPsBaryonsSet(ConstHandle2PoPs self, ConstHandle2ConstBaryons baryons); + + +// ----------------------------------------------------------------------------- +// Child: chemicalElements +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPsChemicalElementsHas(ConstHandle2ConstPoPs self); + +// --- Get, const +extern_c Handle2ConstChemicalElements +PoPsChemicalElementsGetConst(ConstHandle2ConstPoPs self); + +// +++ Get, non-const +extern_c Handle2ChemicalElements +PoPsChemicalElementsGet(ConstHandle2PoPs self); + +// +++ Set +extern_c void +PoPsChemicalElementsSet(ConstHandle2PoPs self, ConstHandle2ConstChemicalElements chemicalElements); + + +// ----------------------------------------------------------------------------- +// Child: styles +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPsStylesHas(ConstHandle2ConstPoPs self); + +// --- Get, const +extern_c Handle2ConstStyles +PoPsStylesGetConst(ConstHandle2ConstPoPs self); + +// +++ Get, non-const +extern_c Handle2Styles +PoPsStylesGet(ConstHandle2PoPs self); + +// +++ Set +extern_c void +PoPsStylesSet(ConstHandle2PoPs self, ConstHandle2ConstStyles styles); + + +// ----------------------------------------------------------------------------- +// Child: unorthodoxes +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPsUnorthodoxesHas(ConstHandle2ConstPoPs self); + +// --- Get, const +extern_c Handle2ConstUnorthodoxes +PoPsUnorthodoxesGetConst(ConstHandle2ConstPoPs self); + +// +++ Get, non-const +extern_c Handle2Unorthodoxes +PoPsUnorthodoxesGet(ConstHandle2PoPs self); + +// +++ Set +extern_c void +PoPsUnorthodoxesSet(ConstHandle2PoPs self, ConstHandle2ConstUnorthodoxes unorthodoxes); + + +// ----------------------------------------------------------------------------- +// Child: gaugeBosons +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPsGaugeBosonsHas(ConstHandle2ConstPoPs self); + +// --- Get, const +extern_c Handle2ConstGaugeBosons +PoPsGaugeBosonsGetConst(ConstHandle2ConstPoPs self); + +// +++ Get, non-const +extern_c Handle2GaugeBosons +PoPsGaugeBosonsGet(ConstHandle2PoPs self); + +// +++ Set +extern_c void +PoPsGaugeBosonsSet(ConstHandle2PoPs self, ConstHandle2ConstGaugeBosons gaugeBosons); + + +// ----------------------------------------------------------------------------- +// Child: leptons +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +PoPsLeptonsHas(ConstHandle2ConstPoPs self); + +// --- Get, const +extern_c Handle2ConstLeptons +PoPsLeptonsGetConst(ConstHandle2ConstPoPs self); + +// +++ Get, non-const +extern_c Handle2Leptons +PoPsLeptonsGet(ConstHandle2PoPs self); + +// +++ Set +extern_c void +PoPsLeptonsSet(ConstHandle2PoPs self, ConstHandle2ConstLeptons leptons); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/top/PoPs/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/PoPs/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/PoPs/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/PoPs/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/PoPs/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/ReactionSuite.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/ReactionSuite.cpp new file mode 100644 index 000000000..eb7fd7edc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/ReactionSuite.cpp @@ -0,0 +1,821 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include "GNDS/v2.0/top/ReactionSuite.hpp" +#include "ReactionSuite.h" + +using namespace njoy::GNDStk; +using namespace GNDS::v2_0; + +using C = ReactionSuiteClass; +using CPP = multigroup::ReactionSuite; + +static const std::string CLASSNAME = "ReactionSuite"; + +namespace extract { + static auto projectile = [](auto &obj) { return &obj.projectile; }; + static auto target = [](auto &obj) { return &obj.target; }; + static auto evaluation = [](auto &obj) { return &obj.evaluation; }; + static auto format = [](auto &obj) { return &obj.format; }; + static auto projectileFrame = [](auto &obj) { return &obj.projectileFrame; }; + static auto interaction = [](auto &obj) { return &obj.interaction; }; + static auto styles = [](auto &obj) { return &obj.styles; }; + static auto PoPs = [](auto &obj) { return &obj.PoPs; }; + static auto reactions = [](auto &obj) { return &obj.reactions; }; + static auto applicationData = [](auto &obj) { return &obj.applicationData; }; + static auto externalFiles = [](auto &obj) { return &obj.externalFiles; }; + static auto resonances = [](auto &obj) { return &obj.resonances; }; + static auto sums = [](auto &obj) { return &obj.sums; }; + static auto productions = [](auto &obj) { return &obj.productions; }; + static auto fissionComponents = [](auto &obj) { return &obj.fissionComponents; }; + static auto orphanProducts = [](auto &obj) { return &obj.orphanProducts; }; + static auto incompleteReactions = [](auto &obj) { return &obj.incompleteReactions; }; +} + +using CPPStyles = general::Styles; +using CPPPoPs = top::PoPs; +using CPPReactions = general::Reactions; +using CPPApplicationData = general::ApplicationData; +using CPPExternalFiles = general::ExternalFiles; +using CPPResonances = general::Resonances; +using CPPSums = general::Sums; +using CPPProductions = general::Productions; +using CPPFissionComponents = general::FissionComponents; +using CPPOrphanProducts = general::OrphanProducts; +using CPPIncompleteReactions = general::IncompleteReactions; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// Create, default, const +Handle2ConstReactionSuite +ReactionSuiteDefaultConst() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"DefaultConst"); +} + +// Create, default, non-const +Handle2ReactionSuite +ReactionSuiteDefault() +{ + return detail::createHandle + (CLASSNAME, CLASSNAME+"Default"); +} + +// Create, general, const +Handle2ConstReactionSuite +ReactionSuiteCreateConst( + const char *const projectile, + const char *const target, + const char *const evaluation, + const char *const format, + const char *const projectileFrame, + const char *const interaction, + ConstHandle2ConstStyles styles, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstReactions reactions, + ConstHandle2ConstApplicationData applicationData, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstSums sums, + ConstHandle2ConstProductions productions, + ConstHandle2ConstFissionComponents fissionComponents, + ConstHandle2ConstOrphanProducts orphanProducts, + ConstHandle2ConstIncompleteReactions incompleteReactions +) { + ConstHandle2ReactionSuite handle = detail::createHandle( + CLASSNAME, CLASSNAME+"CreateConst", + projectile, + target, + evaluation, + format, + projectileFrame, + interaction, + detail::tocpp(styles), + detail::tocpp(PoPs), + detail::tocpp(reactions), + detail::tocpp(applicationData), + detail::tocpp(externalFiles), + detail::tocpp(resonances), + detail::tocpp(sums), + detail::tocpp(productions), + detail::tocpp(fissionComponents), + detail::tocpp(orphanProducts), + detail::tocpp(incompleteReactions) + ); + return handle; +} + +// Create, general, non-const +Handle2ReactionSuite +ReactionSuiteCreate( + const char *const projectile, + const char *const target, + const char *const evaluation, + const char *const format, + const char *const projectileFrame, + const char *const interaction, + ConstHandle2ConstStyles styles, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstReactions reactions, + ConstHandle2ConstApplicationData applicationData, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstSums sums, + ConstHandle2ConstProductions productions, + ConstHandle2ConstFissionComponents fissionComponents, + ConstHandle2ConstOrphanProducts orphanProducts, + ConstHandle2ConstIncompleteReactions incompleteReactions +) { + ConstHandle2ReactionSuite handle = detail::createHandle( + CLASSNAME, CLASSNAME+"Create", + projectile, + target, + evaluation, + format, + projectileFrame, + interaction, + detail::tocpp(styles), + detail::tocpp(PoPs), + detail::tocpp(reactions), + detail::tocpp(applicationData), + detail::tocpp(externalFiles), + detail::tocpp(resonances), + detail::tocpp(sums), + detail::tocpp(productions), + detail::tocpp(fissionComponents), + detail::tocpp(orphanProducts), + detail::tocpp(incompleteReactions) + ); + return handle; +} + +// Assign +// Use this to assign one handled object to another. Don't assign handles, +// as with to = from. That has a meaning that you probably don't intend. +void +ReactionSuiteAssign(ConstHandle2ReactionSuite self, ConstHandle2ConstReactionSuite from) +{ + detail::assignHandle + (CLASSNAME, CLASSNAME+"Assign", self, from); +} + +// Delete +// We'll attempt to remove no-longer-used objects automatically, but you +// may improve performance if you delete them when you're done with them. +void +ReactionSuiteDelete(ConstHandle2ConstReactionSuite self) +{ + detail::deleteHandle + (CLASSNAME, CLASSNAME+"Delete", self); +} + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// Read from file +// File can be XML, JSON, or HDF5. +// We'll examine the file's contents to determine its type automatically. +int +ReactionSuiteRead(ConstHandle2ReactionSuite self, const char *const filename) +{ + return detail::readHandle + (CLASSNAME, CLASSNAME+"Read", self, filename); +} + +// Write to file +// File can be XML, JSON, or HDF5. +// We'll use filename's extension to determine the type you want written. +int +ReactionSuiteWrite(ConstHandle2ConstReactionSuite self, const char *const filename) +{ + return detail::writeHandle + (CLASSNAME, CLASSNAME+"Write", self, filename); +} + +// Print to standard output, in our prettyprinting format +int +ReactionSuitePrint(ConstHandle2ConstReactionSuite self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"Print", self); +} + +// Print to standard output, as XML +int +ReactionSuitePrintXML(ConstHandle2ConstReactionSuite self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintXML", self, "XML"); +} + +// Print to standard output, as JSON +int +ReactionSuitePrintJSON(ConstHandle2ConstReactionSuite self) +{ + return detail::printHandle + (CLASSNAME, CLASSNAME+"PrintJSON", self, "JSON"); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteProjectileHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProjectileHas", self, extract::projectile); +} + +// Get +// Returns by value +const char * +ReactionSuiteProjectileGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileGet", self, extract::projectile); +} + +// Set +void +ReactionSuiteProjectileSet(ConstHandle2ReactionSuite self, const char *const projectile) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProjectileSet", self, extract::projectile, projectile); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: target +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteTargetHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"TargetHas", self, extract::target); +} + +// Get +// Returns by value +const char * +ReactionSuiteTargetGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"TargetGet", self, extract::target); +} + +// Set +void +ReactionSuiteTargetSet(ConstHandle2ReactionSuite self, const char *const target) +{ + detail::setField + (CLASSNAME, CLASSNAME+"TargetSet", self, extract::target, target); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: evaluation +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteEvaluationHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"EvaluationHas", self, extract::evaluation); +} + +// Get +// Returns by value +const char * +ReactionSuiteEvaluationGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"EvaluationGet", self, extract::evaluation); +} + +// Set +void +ReactionSuiteEvaluationSet(ConstHandle2ReactionSuite self, const char *const evaluation) +{ + detail::setField + (CLASSNAME, CLASSNAME+"EvaluationSet", self, extract::evaluation, evaluation); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteFormatHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FormatHas", self, extract::format); +} + +// Get +// Returns by value +const char * +ReactionSuiteFormatGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FormatGet", self, extract::format); +} + +// Set +void +ReactionSuiteFormatSet(ConstHandle2ReactionSuite self, const char *const format) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FormatSet", self, extract::format, format); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: projectileFrame +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteProjectileFrameHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProjectileFrameHas", self, extract::projectileFrame); +} + +// Get +// Returns by value +const char * +ReactionSuiteProjectileFrameGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProjectileFrameGet", self, extract::projectileFrame); +} + +// Set +void +ReactionSuiteProjectileFrameSet(ConstHandle2ReactionSuite self, const char *const projectileFrame) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProjectileFrameSet", self, extract::projectileFrame, projectileFrame); +} + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteInteractionHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"InteractionHas", self, extract::interaction); +} + +// Get +// Returns by value +const char * +ReactionSuiteInteractionGet(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"InteractionGet", self, extract::interaction); +} + +// Set +void +ReactionSuiteInteractionSet(ConstHandle2ReactionSuite self, const char *const interaction) +{ + detail::setField + (CLASSNAME, CLASSNAME+"InteractionSet", self, extract::interaction, interaction); +} + + +// ----------------------------------------------------------------------------- +// Child: styles +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteStylesHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"StylesHas", self, extract::styles); +} + +// Get, const +Handle2ConstStyles +ReactionSuiteStylesGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StylesGetConst", self, extract::styles); +} + +// Get, non-const +Handle2Styles +ReactionSuiteStylesGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"StylesGet", self, extract::styles); +} + +// Set +void +ReactionSuiteStylesSet(ConstHandle2ReactionSuite self, ConstHandle2ConstStyles styles) +{ + detail::setField + (CLASSNAME, CLASSNAME+"StylesSet", self, extract::styles, styles); +} + + +// ----------------------------------------------------------------------------- +// Child: PoPs +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuitePoPsHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"PoPsHas", self, extract::PoPs); +} + +// Get, const +Handle2ConstPoPs +ReactionSuitePoPsGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPsGetConst", self, extract::PoPs); +} + +// Get, non-const +Handle2PoPs +ReactionSuitePoPsGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"PoPsGet", self, extract::PoPs); +} + +// Set +void +ReactionSuitePoPsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstPoPs PoPs) +{ + detail::setField + (CLASSNAME, CLASSNAME+"PoPsSet", self, extract::PoPs, PoPs); +} + + +// ----------------------------------------------------------------------------- +// Child: reactions +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteReactionsHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ReactionsHas", self, extract::reactions); +} + +// Get, const +Handle2ConstReactions +ReactionSuiteReactionsGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReactionsGetConst", self, extract::reactions); +} + +// Get, non-const +Handle2Reactions +ReactionSuiteReactionsGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ReactionsGet", self, extract::reactions); +} + +// Set +void +ReactionSuiteReactionsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstReactions reactions) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ReactionsSet", self, extract::reactions, reactions); +} + + +// ----------------------------------------------------------------------------- +// Child: applicationData +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteApplicationDataHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ApplicationDataHas", self, extract::applicationData); +} + +// Get, const +Handle2ConstApplicationData +ReactionSuiteApplicationDataGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ApplicationDataGetConst", self, extract::applicationData); +} + +// Get, non-const +Handle2ApplicationData +ReactionSuiteApplicationDataGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ApplicationDataGet", self, extract::applicationData); +} + +// Set +void +ReactionSuiteApplicationDataSet(ConstHandle2ReactionSuite self, ConstHandle2ConstApplicationData applicationData) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ApplicationDataSet", self, extract::applicationData, applicationData); +} + + +// ----------------------------------------------------------------------------- +// Child: externalFiles +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteExternalFilesHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ExternalFilesHas", self, extract::externalFiles); +} + +// Get, const +Handle2ConstExternalFiles +ReactionSuiteExternalFilesGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExternalFilesGetConst", self, extract::externalFiles); +} + +// Get, non-const +Handle2ExternalFiles +ReactionSuiteExternalFilesGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ExternalFilesGet", self, extract::externalFiles); +} + +// Set +void +ReactionSuiteExternalFilesSet(ConstHandle2ReactionSuite self, ConstHandle2ConstExternalFiles externalFiles) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ExternalFilesSet", self, extract::externalFiles, externalFiles); +} + + +// ----------------------------------------------------------------------------- +// Child: resonances +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteResonancesHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ResonancesHas", self, extract::resonances); +} + +// Get, const +Handle2ConstResonances +ReactionSuiteResonancesGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonancesGetConst", self, extract::resonances); +} + +// Get, non-const +Handle2Resonances +ReactionSuiteResonancesGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ResonancesGet", self, extract::resonances); +} + +// Set +void +ReactionSuiteResonancesSet(ConstHandle2ReactionSuite self, ConstHandle2ConstResonances resonances) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ResonancesSet", self, extract::resonances, resonances); +} + + +// ----------------------------------------------------------------------------- +// Child: sums +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteSumsHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"SumsHas", self, extract::sums); +} + +// Get, const +Handle2ConstSums +ReactionSuiteSumsGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SumsGetConst", self, extract::sums); +} + +// Get, non-const +Handle2Sums +ReactionSuiteSumsGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"SumsGet", self, extract::sums); +} + +// Set +void +ReactionSuiteSumsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstSums sums) +{ + detail::setField + (CLASSNAME, CLASSNAME+"SumsSet", self, extract::sums, sums); +} + + +// ----------------------------------------------------------------------------- +// Child: productions +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteProductionsHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"ProductionsHas", self, extract::productions); +} + +// Get, const +Handle2ConstProductions +ReactionSuiteProductionsGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductionsGetConst", self, extract::productions); +} + +// Get, non-const +Handle2Productions +ReactionSuiteProductionsGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"ProductionsGet", self, extract::productions); +} + +// Set +void +ReactionSuiteProductionsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstProductions productions) +{ + detail::setField + (CLASSNAME, CLASSNAME+"ProductionsSet", self, extract::productions, productions); +} + + +// ----------------------------------------------------------------------------- +// Child: fissionComponents +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteFissionComponentsHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"FissionComponentsHas", self, extract::fissionComponents); +} + +// Get, const +Handle2ConstFissionComponents +ReactionSuiteFissionComponentsGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionComponentsGetConst", self, extract::fissionComponents); +} + +// Get, non-const +Handle2FissionComponents +ReactionSuiteFissionComponentsGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"FissionComponentsGet", self, extract::fissionComponents); +} + +// Set +void +ReactionSuiteFissionComponentsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstFissionComponents fissionComponents) +{ + detail::setField + (CLASSNAME, CLASSNAME+"FissionComponentsSet", self, extract::fissionComponents, fissionComponents); +} + + +// ----------------------------------------------------------------------------- +// Child: orphanProducts +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteOrphanProductsHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"OrphanProductsHas", self, extract::orphanProducts); +} + +// Get, const +Handle2ConstOrphanProducts +ReactionSuiteOrphanProductsGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OrphanProductsGetConst", self, extract::orphanProducts); +} + +// Get, non-const +Handle2OrphanProducts +ReactionSuiteOrphanProductsGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"OrphanProductsGet", self, extract::orphanProducts); +} + +// Set +void +ReactionSuiteOrphanProductsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstOrphanProducts orphanProducts) +{ + detail::setField + (CLASSNAME, CLASSNAME+"OrphanProductsSet", self, extract::orphanProducts, orphanProducts); +} + + +// ----------------------------------------------------------------------------- +// Child: incompleteReactions +// ----------------------------------------------------------------------------- + +// Has +int +ReactionSuiteIncompleteReactionsHas(ConstHandle2ConstReactionSuite self) +{ + return detail::hasField + (CLASSNAME, CLASSNAME+"IncompleteReactionsHas", self, extract::incompleteReactions); +} + +// Get, const +Handle2ConstIncompleteReactions +ReactionSuiteIncompleteReactionsGetConst(ConstHandle2ConstReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IncompleteReactionsGetConst", self, extract::incompleteReactions); +} + +// Get, non-const +Handle2IncompleteReactions +ReactionSuiteIncompleteReactionsGet(ConstHandle2ReactionSuite self) +{ + return detail::getField + (CLASSNAME, CLASSNAME+"IncompleteReactionsGet", self, extract::incompleteReactions); +} + +// Set +void +ReactionSuiteIncompleteReactionsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstIncompleteReactions incompleteReactions) +{ + detail::setField + (CLASSNAME, CLASSNAME+"IncompleteReactionsSet", self, extract::incompleteReactions, incompleteReactions); +} + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/top/ReactionSuite/src/custom.cpp" diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/ReactionSuite.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/ReactionSuite.h new file mode 100644 index 000000000..14a64d365 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/ReactionSuite.h @@ -0,0 +1,521 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// Interface for C +// This header file is designed to work with both C and C++ +// Function definitions are in this file's .cpp source + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// Instructions for Users +// +// Constructs you're MORE likely to care about are preceded with: +// // +++ remark +// Constructs you're LESS likely to care about are preceded with: +// // --- remark +// Anything not marked as above can be ignored by most users. +// +// ReactionSuite is the basic handle type in this file. Example: +// // Create a default ReactionSuite object: +// ReactionSuite handle = ReactionSuiteDefault(); +// Functions involving ReactionSuite are declared throughout this file. +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// Preliminaries +// ----------------------------------------------------------------------------- + +#ifndef C_INTERFACE_GNDS_V2_0_TOP_REACTIONSUITE +#define C_INTERFACE_GNDS_V2_0_TOP_REACTIONSUITE + +#include "GNDStk.h" +#include "v2.0/general/Styles.h" +#include "v2.0/top/PoPs.h" +#include "v2.0/general/Reactions.h" +#include "v2.0/general/ApplicationData.h" +#include "v2.0/general/ExternalFiles.h" +#include "v2.0/general/Resonances.h" +#include "v2.0/general/Sums.h" +#include "v2.0/general/Productions.h" +#include "v2.0/general/FissionComponents.h" +#include "v2.0/general/OrphanProducts.h" +#include "v2.0/general/IncompleteReactions.h" + +#ifdef __cplusplus + #define extern_c extern "C" +#else + #define extern_c +#endif + +// Proxy C struct for the handled C++ class +struct ReactionSuiteClass { }; + + +// ----------------------------------------------------------------------------- +// Handle types +// ----------------------------------------------------------------------------- + +// +++ ReactionSuite +// +++ General handle, suitable for most users. If you're not concerned about +// +++ strict "const correctness" in your C code, you can probably use this in +// +++ place of any function parameter of a const-aware handle type. +typedef struct ReactionSuiteClass *ReactionSuite; + +// --- Const-aware handles. +typedef const struct ReactionSuiteClass *const ConstHandle2ConstReactionSuite; +typedef struct ReactionSuiteClass *const ConstHandle2ReactionSuite; +typedef const struct ReactionSuiteClass * Handle2ConstReactionSuite; +typedef struct ReactionSuiteClass * Handle2ReactionSuite; + + +// ----------------------------------------------------------------------------- +// Basics +// Create, Assign, Delete +// ----------------------------------------------------------------------------- + +// --- Create, default, const +extern_c Handle2ConstReactionSuite +ReactionSuiteDefaultConst(); + +// +++ Create, default, non-const +extern_c Handle2ReactionSuite +ReactionSuiteDefault(); + +// --- Create, general, const +extern_c Handle2ConstReactionSuite +ReactionSuiteCreateConst( + const char *const projectile, + const char *const target, + const char *const evaluation, + const char *const format, + const char *const projectileFrame, + const char *const interaction, + ConstHandle2ConstStyles styles, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstReactions reactions, + ConstHandle2ConstApplicationData applicationData, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstSums sums, + ConstHandle2ConstProductions productions, + ConstHandle2ConstFissionComponents fissionComponents, + ConstHandle2ConstOrphanProducts orphanProducts, + ConstHandle2ConstIncompleteReactions incompleteReactions +); + +// +++ Create, general, non-const +extern_c Handle2ReactionSuite +ReactionSuiteCreate( + const char *const projectile, + const char *const target, + const char *const evaluation, + const char *const format, + const char *const projectileFrame, + const char *const interaction, + ConstHandle2ConstStyles styles, + ConstHandle2ConstPoPs PoPs, + ConstHandle2ConstReactions reactions, + ConstHandle2ConstApplicationData applicationData, + ConstHandle2ConstExternalFiles externalFiles, + ConstHandle2ConstResonances resonances, + ConstHandle2ConstSums sums, + ConstHandle2ConstProductions productions, + ConstHandle2ConstFissionComponents fissionComponents, + ConstHandle2ConstOrphanProducts orphanProducts, + ConstHandle2ConstIncompleteReactions incompleteReactions +); + +// +++ Assign +// +++ Use this to assign one handled object to another. Don't assign handles, +// +++ as with to = from. That has a meaning that you probably don't intend. +extern_c void +ReactionSuiteAssign(ConstHandle2ReactionSuite self, ConstHandle2ConstReactionSuite from); + +// +++ Delete +// +++ We'll attempt to remove no-longer-used objects automatically, but you +// +++ may improve performance if you delete them when you're done with them. +extern_c void +ReactionSuiteDelete(ConstHandle2ConstReactionSuite self); + + +// ----------------------------------------------------------------------------- +// I/O +// Read, Write, Print +// Each returns 0 if failure, 1 if success. +// ----------------------------------------------------------------------------- + +// +++ Read from file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll examine the file's contents to determine its type automatically. +extern_c int +ReactionSuiteRead(ConstHandle2ReactionSuite self, const char *const filename); + +// +++ Write to file +// +++ File can be XML, JSON, or HDF5. +// +++ We'll use filename's extension to determine the type you want written. +extern_c int +ReactionSuiteWrite(ConstHandle2ConstReactionSuite self, const char *const filename); + +// +++ Print to standard output, in our prettyprinting format +extern_c int +ReactionSuitePrint(ConstHandle2ConstReactionSuite self); + +// +++ Print to standard output, as XML +extern_c int +ReactionSuitePrintXML(ConstHandle2ConstReactionSuite self); + +// +++ Print to standard output, as JSON +extern_c int +ReactionSuitePrintJSON(ConstHandle2ConstReactionSuite self); + + +// ----------------------------------------------------------------------------- +// Metadatum: projectile +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteProjectileHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionSuiteProjectileGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteProjectileSet(ConstHandle2ReactionSuite self, const char *const projectile); + + +// ----------------------------------------------------------------------------- +// Metadatum: target +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteTargetHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionSuiteTargetGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteTargetSet(ConstHandle2ReactionSuite self, const char *const target); + + +// ----------------------------------------------------------------------------- +// Metadatum: evaluation +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteEvaluationHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionSuiteEvaluationGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteEvaluationSet(ConstHandle2ReactionSuite self, const char *const evaluation); + + +// ----------------------------------------------------------------------------- +// Metadatum: format +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteFormatHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionSuiteFormatGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteFormatSet(ConstHandle2ReactionSuite self, const char *const format); + + +// ----------------------------------------------------------------------------- +// Metadatum: projectileFrame +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteProjectileFrameHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionSuiteProjectileFrameGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteProjectileFrameSet(ConstHandle2ReactionSuite self, const char *const projectileFrame); + + +// ----------------------------------------------------------------------------- +// Metadatum: interaction +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteInteractionHas(ConstHandle2ConstReactionSuite self); + +// +++ Get +// +++ Returns by value +extern_c const char * +ReactionSuiteInteractionGet(ConstHandle2ConstReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteInteractionSet(ConstHandle2ReactionSuite self, const char *const interaction); + + +// ----------------------------------------------------------------------------- +// Child: styles +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteStylesHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstStyles +ReactionSuiteStylesGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2Styles +ReactionSuiteStylesGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteStylesSet(ConstHandle2ReactionSuite self, ConstHandle2ConstStyles styles); + + +// ----------------------------------------------------------------------------- +// Child: PoPs +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuitePoPsHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstPoPs +ReactionSuitePoPsGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2PoPs +ReactionSuitePoPsGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuitePoPsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstPoPs PoPs); + + +// ----------------------------------------------------------------------------- +// Child: reactions +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteReactionsHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstReactions +ReactionSuiteReactionsGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2Reactions +ReactionSuiteReactionsGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteReactionsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstReactions reactions); + + +// ----------------------------------------------------------------------------- +// Child: applicationData +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteApplicationDataHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstApplicationData +ReactionSuiteApplicationDataGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2ApplicationData +ReactionSuiteApplicationDataGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteApplicationDataSet(ConstHandle2ReactionSuite self, ConstHandle2ConstApplicationData applicationData); + + +// ----------------------------------------------------------------------------- +// Child: externalFiles +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteExternalFilesHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstExternalFiles +ReactionSuiteExternalFilesGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2ExternalFiles +ReactionSuiteExternalFilesGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteExternalFilesSet(ConstHandle2ReactionSuite self, ConstHandle2ConstExternalFiles externalFiles); + + +// ----------------------------------------------------------------------------- +// Child: resonances +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteResonancesHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstResonances +ReactionSuiteResonancesGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2Resonances +ReactionSuiteResonancesGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteResonancesSet(ConstHandle2ReactionSuite self, ConstHandle2ConstResonances resonances); + + +// ----------------------------------------------------------------------------- +// Child: sums +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteSumsHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstSums +ReactionSuiteSumsGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2Sums +ReactionSuiteSumsGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteSumsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstSums sums); + + +// ----------------------------------------------------------------------------- +// Child: productions +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteProductionsHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstProductions +ReactionSuiteProductionsGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2Productions +ReactionSuiteProductionsGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteProductionsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstProductions productions); + + +// ----------------------------------------------------------------------------- +// Child: fissionComponents +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteFissionComponentsHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstFissionComponents +ReactionSuiteFissionComponentsGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2FissionComponents +ReactionSuiteFissionComponentsGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteFissionComponentsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstFissionComponents fissionComponents); + + +// ----------------------------------------------------------------------------- +// Child: orphanProducts +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteOrphanProductsHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstOrphanProducts +ReactionSuiteOrphanProductsGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2OrphanProducts +ReactionSuiteOrphanProductsGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteOrphanProductsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstOrphanProducts orphanProducts); + + +// ----------------------------------------------------------------------------- +// Child: incompleteReactions +// ----------------------------------------------------------------------------- + +// +++ Has +extern_c int +ReactionSuiteIncompleteReactionsHas(ConstHandle2ConstReactionSuite self); + +// --- Get, const +extern_c Handle2ConstIncompleteReactions +ReactionSuiteIncompleteReactionsGetConst(ConstHandle2ConstReactionSuite self); + +// +++ Get, non-const +extern_c Handle2IncompleteReactions +ReactionSuiteIncompleteReactionsGet(ConstHandle2ReactionSuite self); + +// +++ Set +extern_c void +ReactionSuiteIncompleteReactionsSet(ConstHandle2ReactionSuite self, ConstHandle2ConstIncompleteReactions incompleteReactions); + + +// ----------------------------------------------------------------------------- +// Custom functionality +// ----------------------------------------------------------------------------- + +#include "v2.0/top/ReactionSuite/src/custom.h" + +#undef extern_c +#endif diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/ReactionSuite/src/custom.cpp b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/ReactionSuite/src/custom.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/ReactionSuite/src/custom.h b/versions/GNDS-v2.0/GNDS/c/src/v2.0/top/ReactionSuite/src/custom.h new file mode 100644 index 000000000..e69de29bb diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/.gitignore b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/.gitignore new file mode 100644 index 000000000..eb9d89e52 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/.gitignore @@ -0,0 +1,3 @@ + +c +f diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g2d/Array.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g2d/Array.f03 new file mode 100644 index 000000000..a7ecc11e4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g2d/Array.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module g2dArray +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ArrayDefaultConst() & + bind(C, name='ArrayDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ArrayDefaultConst +end function ArrayDefaultConst + +!! Create, default, non-const +function ArrayDefault() & + bind(C, name='ArrayDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ArrayDefault +end function ArrayDefault + +!! Create, general, const +function ArrayCreateConst( & + shape, & + compression, & + symmetry, & + values, & + shapeSize, & + compressionSize, & + symmetrySize & +) & + bind(C, name='ArrayCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: shapeSize + character(c_char), intent(in) :: shape(shapeSize) + integer(c_size_t), intent(in), value :: compressionSize + character(c_char), intent(in) :: compression(compressionSize) + integer(c_size_t), intent(in), value :: symmetrySize + character(c_char), intent(in) :: symmetry(symmetrySize) + type(c_ptr), intent(in), value :: values + type(c_ptr) :: ArrayCreateConst +end function ArrayCreateConst + +!! Create, general, non-const +function ArrayCreate( & + shape, & + compression, & + symmetry, & + values, & + shapeSize, & + compressionSize, & + symmetrySize & +) & + bind(C, name='ArrayCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: shapeSize + character(c_char), intent(in) :: shape(shapeSize) + integer(c_size_t), intent(in), value :: compressionSize + character(c_char), intent(in) :: compression(compressionSize) + integer(c_size_t), intent(in), value :: symmetrySize + character(c_char), intent(in) :: symmetry(symmetrySize) + type(c_ptr), intent(in), value :: values + type(c_ptr) :: ArrayCreate +end function ArrayCreate + +!! Assign +subroutine ArrayAssign(handleLHS, handleRHS) & + bind(C, name='ArrayAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ArrayAssign + +!! Delete +subroutine ArrayDelete(handle) & + bind(C, name='ArrayDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ArrayDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ArrayRead(handle, filename, filenameSize) & + bind(C, name='ArrayRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ArrayRead +end function ArrayRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ArrayWrite(handle, filename, filenameSize) & + bind(C, name='ArrayWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ArrayWrite +end function ArrayWrite + +!! Print to standard output, in our prettyprinting format +function ArrayPrint(handle) & + bind(C, name='ArrayPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayPrint +end function ArrayPrint + +!! Print to standard output, as XML +function ArrayPrintXML(handle) & + bind(C, name='ArrayPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayPrintXML +end function ArrayPrintXML + +!! Print to standard output, as JSON +function ArrayPrintJSON(handle) & + bind(C, name='ArrayPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayPrintJSON +end function ArrayPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: shape +!! ----------------------------------------------------------------------------- + +!! Has +function ArrayShapeHas(handle) & + bind(C, name='ArrayShapeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayShapeHas +end function ArrayShapeHas + +!! Get +function ArrayShapeGet(handle) & + bind(C, name='ArrayShapeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArrayShapeGet +end function ArrayShapeGet + +!! Set +subroutine ArrayShapeSet(handle, shape, shapeSize) & + bind(C, name='ArrayShapeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: shapeSize + character(c_char), intent(in) :: shape(shapeSize) +end subroutine ArrayShapeSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: compression +!! ----------------------------------------------------------------------------- + +!! Has +function ArrayCompressionHas(handle) & + bind(C, name='ArrayCompressionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayCompressionHas +end function ArrayCompressionHas + +!! Get +function ArrayCompressionGet(handle) & + bind(C, name='ArrayCompressionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArrayCompressionGet +end function ArrayCompressionGet + +!! Set +subroutine ArrayCompressionSet(handle, compression, compressionSize) & + bind(C, name='ArrayCompressionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: compressionSize + character(c_char), intent(in) :: compression(compressionSize) +end subroutine ArrayCompressionSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: symmetry +!! ----------------------------------------------------------------------------- + +!! Has +function ArraySymmetryHas(handle) & + bind(C, name='ArraySymmetryHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArraySymmetryHas +end function ArraySymmetryHas + +!! Get +function ArraySymmetryGet(handle) & + bind(C, name='ArraySymmetryGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArraySymmetryGet +end function ArraySymmetryGet + +!! Set +subroutine ArraySymmetrySet(handle, symmetry, symmetrySize) & + bind(C, name='ArraySymmetrySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: symmetrySize + character(c_char), intent(in) :: symmetry(symmetrySize) +end subroutine ArraySymmetrySet + + +!! ----------------------------------------------------------------------------- +!! Child: values +!! ----------------------------------------------------------------------------- + +!! Has +function ArrayValuesHas(handle) & + bind(C, name='ArrayValuesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayValuesHas +end function ArrayValuesHas + +!! Get, const +function ArrayValuesGetConst(handle) & + bind(C, name='ArrayValuesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArrayValuesGetConst +end function ArrayValuesGetConst + +!! Get, non-const +function ArrayValuesGet(handle) & + bind(C, name='ArrayValuesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ArrayValuesGet +end function ArrayValuesGet + +!! Set +subroutine ArrayValuesSet(handle, fieldHandle) & + bind(C, name='ArrayValuesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ArrayValuesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module g2dArray diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g3d/Array.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g3d/Array.f03 new file mode 100644 index 000000000..8d149e22f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g3d/Array.f03 @@ -0,0 +1,389 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module g3dArray +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ArrayDefaultConst() & + bind(C, name='ArrayDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ArrayDefaultConst +end function ArrayDefaultConst + +!! Create, default, non-const +function ArrayDefault() & + bind(C, name='ArrayDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ArrayDefault +end function ArrayDefault + +!! Create, general, const +function ArrayCreateConst( & + shape, & + compression, & + symmetry, & + starts, & + lengths, & + values, & + shapeSize, & + compressionSize, & + symmetrySize & +) & + bind(C, name='ArrayCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: shapeSize + character(c_char), intent(in) :: shape(shapeSize) + integer(c_size_t), intent(in), value :: compressionSize + character(c_char), intent(in) :: compression(compressionSize) + integer(c_size_t), intent(in), value :: symmetrySize + character(c_char), intent(in) :: symmetry(symmetrySize) + type(c_ptr), intent(in), value :: starts + type(c_ptr), intent(in), value :: lengths + type(c_ptr), intent(in), value :: values + type(c_ptr) :: ArrayCreateConst +end function ArrayCreateConst + +!! Create, general, non-const +function ArrayCreate( & + shape, & + compression, & + symmetry, & + starts, & + lengths, & + values, & + shapeSize, & + compressionSize, & + symmetrySize & +) & + bind(C, name='ArrayCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: shapeSize + character(c_char), intent(in) :: shape(shapeSize) + integer(c_size_t), intent(in), value :: compressionSize + character(c_char), intent(in) :: compression(compressionSize) + integer(c_size_t), intent(in), value :: symmetrySize + character(c_char), intent(in) :: symmetry(symmetrySize) + type(c_ptr), intent(in), value :: starts + type(c_ptr), intent(in), value :: lengths + type(c_ptr), intent(in), value :: values + type(c_ptr) :: ArrayCreate +end function ArrayCreate + +!! Assign +subroutine ArrayAssign(handleLHS, handleRHS) & + bind(C, name='ArrayAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ArrayAssign + +!! Delete +subroutine ArrayDelete(handle) & + bind(C, name='ArrayDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ArrayDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ArrayRead(handle, filename, filenameSize) & + bind(C, name='ArrayRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ArrayRead +end function ArrayRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ArrayWrite(handle, filename, filenameSize) & + bind(C, name='ArrayWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ArrayWrite +end function ArrayWrite + +!! Print to standard output, in our prettyprinting format +function ArrayPrint(handle) & + bind(C, name='ArrayPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayPrint +end function ArrayPrint + +!! Print to standard output, as XML +function ArrayPrintXML(handle) & + bind(C, name='ArrayPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayPrintXML +end function ArrayPrintXML + +!! Print to standard output, as JSON +function ArrayPrintJSON(handle) & + bind(C, name='ArrayPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayPrintJSON +end function ArrayPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: shape +!! ----------------------------------------------------------------------------- + +!! Has +function ArrayShapeHas(handle) & + bind(C, name='ArrayShapeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayShapeHas +end function ArrayShapeHas + +!! Get +function ArrayShapeGet(handle) & + bind(C, name='ArrayShapeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArrayShapeGet +end function ArrayShapeGet + +!! Set +subroutine ArrayShapeSet(handle, shape, shapeSize) & + bind(C, name='ArrayShapeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: shapeSize + character(c_char), intent(in) :: shape(shapeSize) +end subroutine ArrayShapeSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: compression +!! ----------------------------------------------------------------------------- + +!! Has +function ArrayCompressionHas(handle) & + bind(C, name='ArrayCompressionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayCompressionHas +end function ArrayCompressionHas + +!! Get +function ArrayCompressionGet(handle) & + bind(C, name='ArrayCompressionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArrayCompressionGet +end function ArrayCompressionGet + +!! Set +subroutine ArrayCompressionSet(handle, compression, compressionSize) & + bind(C, name='ArrayCompressionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: compressionSize + character(c_char), intent(in) :: compression(compressionSize) +end subroutine ArrayCompressionSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: symmetry +!! ----------------------------------------------------------------------------- + +!! Has +function ArraySymmetryHas(handle) & + bind(C, name='ArraySymmetryHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArraySymmetryHas +end function ArraySymmetryHas + +!! Get +function ArraySymmetryGet(handle) & + bind(C, name='ArraySymmetryGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArraySymmetryGet +end function ArraySymmetryGet + +!! Set +subroutine ArraySymmetrySet(handle, symmetry, symmetrySize) & + bind(C, name='ArraySymmetrySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: symmetrySize + character(c_char), intent(in) :: symmetry(symmetrySize) +end subroutine ArraySymmetrySet + + +!! ----------------------------------------------------------------------------- +!! Child: starts +!! ----------------------------------------------------------------------------- + +!! Has +function ArrayStartsHas(handle) & + bind(C, name='ArrayStartsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayStartsHas +end function ArrayStartsHas + +!! Get, const +function ArrayStartsGetConst(handle) & + bind(C, name='ArrayStartsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArrayStartsGetConst +end function ArrayStartsGetConst + +!! Get, non-const +function ArrayStartsGet(handle) & + bind(C, name='ArrayStartsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ArrayStartsGet +end function ArrayStartsGet + +!! Set +subroutine ArrayStartsSet(handle, fieldHandle) & + bind(C, name='ArrayStartsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ArrayStartsSet + + +!! ----------------------------------------------------------------------------- +!! Child: lengths +!! ----------------------------------------------------------------------------- + +!! Has +function ArrayLengthsHas(handle) & + bind(C, name='ArrayLengthsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayLengthsHas +end function ArrayLengthsHas + +!! Get, const +function ArrayLengthsGetConst(handle) & + bind(C, name='ArrayLengthsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArrayLengthsGetConst +end function ArrayLengthsGetConst + +!! Get, non-const +function ArrayLengthsGet(handle) & + bind(C, name='ArrayLengthsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ArrayLengthsGet +end function ArrayLengthsGet + +!! Set +subroutine ArrayLengthsSet(handle, fieldHandle) & + bind(C, name='ArrayLengthsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ArrayLengthsSet + + +!! ----------------------------------------------------------------------------- +!! Child: values +!! ----------------------------------------------------------------------------- + +!! Has +function ArrayValuesHas(handle) & + bind(C, name='ArrayValuesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayValuesHas +end function ArrayValuesHas + +!! Get, const +function ArrayValuesGetConst(handle) & + bind(C, name='ArrayValuesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArrayValuesGetConst +end function ArrayValuesGetConst + +!! Get, non-const +function ArrayValuesGet(handle) & + bind(C, name='ArrayValuesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ArrayValuesGet +end function ArrayValuesGet + +!! Set +subroutine ArrayValuesSet(handle, fieldHandle) & + bind(C, name='ArrayValuesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ArrayValuesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module g3dArray diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g3d/Lengths.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g3d/Lengths.f03 new file mode 100644 index 000000000..c4911b8bd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g3d/Lengths.f03 @@ -0,0 +1,285 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module g3dLengths +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function LengthsDefaultConst() & + bind(C, name='LengthsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: LengthsDefaultConst +end function LengthsDefaultConst + +!! Create, default, non-const +function LengthsDefault() & + bind(C, name='LengthsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: LengthsDefault +end function LengthsDefault + +!! Create, general, const +function LengthsCreateConst( & + valueType, & + label, & + valueTypeSize, & + labelSize & +) & + bind(C, name='LengthsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: valueTypeSize + character(c_char), intent(in) :: valueType(valueTypeSize) + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr) :: LengthsCreateConst +end function LengthsCreateConst + +!! Create, general, non-const +function LengthsCreate( & + valueType, & + label, & + valueTypeSize, & + labelSize & +) & + bind(C, name='LengthsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: valueTypeSize + character(c_char), intent(in) :: valueType(valueTypeSize) + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr) :: LengthsCreate +end function LengthsCreate + +!! Assign +subroutine LengthsAssign(handleLHS, handleRHS) & + bind(C, name='LengthsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine LengthsAssign + +!! Delete +subroutine LengthsDelete(handle) & + bind(C, name='LengthsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LengthsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function LengthsRead(handle, filename, filenameSize) & + bind(C, name='LengthsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LengthsRead +end function LengthsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function LengthsWrite(handle, filename, filenameSize) & + bind(C, name='LengthsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LengthsWrite +end function LengthsWrite + +!! Print to standard output, in our prettyprinting format +function LengthsPrint(handle) & + bind(C, name='LengthsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LengthsPrint +end function LengthsPrint + +!! Print to standard output, as XML +function LengthsPrintXML(handle) & + bind(C, name='LengthsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LengthsPrintXML +end function LengthsPrintXML + +!! Print to standard output, as JSON +function LengthsPrintJSON(handle) & + bind(C, name='LengthsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LengthsPrintJSON +end function LengthsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Data vector +!! ----------------------------------------------------------------------------- + +!! Clear +subroutine LengthsIntsClear(handle) & + bind(C, name='LengthsIntsClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LengthsIntsClear + +!! Get size +function LengthsIntsSize(handle) & + bind(C, name='LengthsIntsSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: LengthsIntsSize +end function LengthsIntsSize + +!! Get value +!! By index \in [0,size) +function LengthsIntsGet(handle, arrayIndex) & + bind(C, name='LengthsIntsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + integer(c_int) :: LengthsIntsGet +end function LengthsIntsGet + +!! Set value +!! By index \in [0,size) +subroutine LengthsIntsSet(handle, arrayIndex, valueAtIndex) & + bind(C, name='LengthsIntsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + integer(c_int), intent(in), value :: valueAtIndex +end subroutine LengthsIntsSet + +!! Get pointer to existing values, const +function LengthsIntsGetArrayConst(handle) & + bind(C, name='LengthsIntsGetArrayConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LengthsIntsGetArrayConst +end function LengthsIntsGetArrayConst + +!! Get pointer to existing values, non-const +function LengthsIntsGetArray(handle) & + bind(C, name='LengthsIntsGetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: LengthsIntsGetArray +end function LengthsIntsGetArray + +!! Set completely new values and size +subroutine LengthsIntsSetArray(handle, values, valuesSize) & + bind(C, name='LengthsIntsSetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: valuesSize + integer(c_int), intent(in) :: values(valuesSize) +end subroutine LengthsIntsSetArray + + +!! ----------------------------------------------------------------------------- +!! Metadatum: valueType +!! ----------------------------------------------------------------------------- + +!! Has +function LengthsValueTypeHas(handle) & + bind(C, name='LengthsValueTypeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LengthsValueTypeHas +end function LengthsValueTypeHas + +!! Get +function LengthsValueTypeGet(handle) & + bind(C, name='LengthsValueTypeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LengthsValueTypeGet +end function LengthsValueTypeGet + +!! Set +subroutine LengthsValueTypeSet(handle, valueType, valueTypeSize) & + bind(C, name='LengthsValueTypeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: valueTypeSize + character(c_char), intent(in) :: valueType(valueTypeSize) +end subroutine LengthsValueTypeSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function LengthsLabelHas(handle) & + bind(C, name='LengthsLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LengthsLabelHas +end function LengthsLabelHas + +!! Get +function LengthsLabelGet(handle) & + bind(C, name='LengthsLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LengthsLabelGet +end function LengthsLabelGet + +!! Set +subroutine LengthsLabelSet(handle, label, labelSize) & + bind(C, name='LengthsLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine LengthsLabelSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module g3dLengths diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g3d/Starts.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g3d/Starts.f03 new file mode 100644 index 000000000..7e4e90a53 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/g3d/Starts.f03 @@ -0,0 +1,285 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module g3dStarts +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function StartsDefaultConst() & + bind(C, name='StartsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: StartsDefaultConst +end function StartsDefaultConst + +!! Create, default, non-const +function StartsDefault() & + bind(C, name='StartsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: StartsDefault +end function StartsDefault + +!! Create, general, const +function StartsCreateConst( & + valueType, & + label, & + valueTypeSize, & + labelSize & +) & + bind(C, name='StartsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: valueTypeSize + character(c_char), intent(in) :: valueType(valueTypeSize) + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr) :: StartsCreateConst +end function StartsCreateConst + +!! Create, general, non-const +function StartsCreate( & + valueType, & + label, & + valueTypeSize, & + labelSize & +) & + bind(C, name='StartsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: valueTypeSize + character(c_char), intent(in) :: valueType(valueTypeSize) + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr) :: StartsCreate +end function StartsCreate + +!! Assign +subroutine StartsAssign(handleLHS, handleRHS) & + bind(C, name='StartsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine StartsAssign + +!! Delete +subroutine StartsDelete(handle) & + bind(C, name='StartsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine StartsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function StartsRead(handle, filename, filenameSize) & + bind(C, name='StartsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: StartsRead +end function StartsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function StartsWrite(handle, filename, filenameSize) & + bind(C, name='StartsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: StartsWrite +end function StartsWrite + +!! Print to standard output, in our prettyprinting format +function StartsPrint(handle) & + bind(C, name='StartsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StartsPrint +end function StartsPrint + +!! Print to standard output, as XML +function StartsPrintXML(handle) & + bind(C, name='StartsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StartsPrintXML +end function StartsPrintXML + +!! Print to standard output, as JSON +function StartsPrintJSON(handle) & + bind(C, name='StartsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StartsPrintJSON +end function StartsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Data vector +!! ----------------------------------------------------------------------------- + +!! Clear +subroutine StartsIntsClear(handle) & + bind(C, name='StartsIntsClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine StartsIntsClear + +!! Get size +function StartsIntsSize(handle) & + bind(C, name='StartsIntsSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: StartsIntsSize +end function StartsIntsSize + +!! Get value +!! By index \in [0,size) +function StartsIntsGet(handle, arrayIndex) & + bind(C, name='StartsIntsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + integer(c_int) :: StartsIntsGet +end function StartsIntsGet + +!! Set value +!! By index \in [0,size) +subroutine StartsIntsSet(handle, arrayIndex, valueAtIndex) & + bind(C, name='StartsIntsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + integer(c_int), intent(in), value :: valueAtIndex +end subroutine StartsIntsSet + +!! Get pointer to existing values, const +function StartsIntsGetArrayConst(handle) & + bind(C, name='StartsIntsGetArrayConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: StartsIntsGetArrayConst +end function StartsIntsGetArrayConst + +!! Get pointer to existing values, non-const +function StartsIntsGetArray(handle) & + bind(C, name='StartsIntsGetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: StartsIntsGetArray +end function StartsIntsGetArray + +!! Set completely new values and size +subroutine StartsIntsSetArray(handle, values, valuesSize) & + bind(C, name='StartsIntsSetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: valuesSize + integer(c_int), intent(in) :: values(valuesSize) +end subroutine StartsIntsSetArray + + +!! ----------------------------------------------------------------------------- +!! Metadatum: valueType +!! ----------------------------------------------------------------------------- + +!! Has +function StartsValueTypeHas(handle) & + bind(C, name='StartsValueTypeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StartsValueTypeHas +end function StartsValueTypeHas + +!! Get +function StartsValueTypeGet(handle) & + bind(C, name='StartsValueTypeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: StartsValueTypeGet +end function StartsValueTypeGet + +!! Set +subroutine StartsValueTypeSet(handle, valueType, valueTypeSize) & + bind(C, name='StartsValueTypeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: valueTypeSize + character(c_char), intent(in) :: valueType(valueTypeSize) +end subroutine StartsValueTypeSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function StartsLabelHas(handle) & + bind(C, name='StartsLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StartsLabelHas +end function StartsLabelHas + +!! Get +function StartsLabelGet(handle) & + bind(C, name='StartsLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: StartsLabelGet +end function StartsLabelGet + +!! Set +subroutine StartsLabelSet(handle, label, labelSize) & + bind(C, name='StartsLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine StartsLabelSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module g3dStarts diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Add.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Add.f03 new file mode 100644 index 000000000..6b89bdcdd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Add.f03 @@ -0,0 +1,172 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAdd +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AddDefaultConst() & + bind(C, name='AddDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AddDefaultConst +end function AddDefaultConst + +!! Create, default, non-const +function AddDefault() & + bind(C, name='AddDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AddDefault +end function AddDefault + +!! Create, general, const +function AddCreateConst( & + href, & + hrefSize & +) & + bind(C, name='AddCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: AddCreateConst +end function AddCreateConst + +!! Create, general, non-const +function AddCreate( & + href, & + hrefSize & +) & + bind(C, name='AddCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: AddCreate +end function AddCreate + +!! Assign +subroutine AddAssign(handleLHS, handleRHS) & + bind(C, name='AddAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AddAssign + +!! Delete +subroutine AddDelete(handle) & + bind(C, name='AddDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AddDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AddRead(handle, filename, filenameSize) & + bind(C, name='AddRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AddRead +end function AddRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AddWrite(handle, filename, filenameSize) & + bind(C, name='AddWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AddWrite +end function AddWrite + +!! Print to standard output, in our prettyprinting format +function AddPrint(handle) & + bind(C, name='AddPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AddPrint +end function AddPrint + +!! Print to standard output, as XML +function AddPrintXML(handle) & + bind(C, name='AddPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AddPrintXML +end function AddPrintXML + +!! Print to standard output, as JSON +function AddPrintJSON(handle) & + bind(C, name='AddPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AddPrintJSON +end function AddPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function AddHrefHas(handle) & + bind(C, name='AddHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AddHrefHas +end function AddHrefHas + +!! Get +function AddHrefGet(handle) & + bind(C, name='AddHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AddHrefGet +end function AddHrefGet + +!! Set +subroutine AddHrefSet(handle, href, hrefSize) & + bind(C, name='AddHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine AddHrefSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAdd diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Alias.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Alias.f03 new file mode 100644 index 000000000..e1c67e11b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Alias.f03 @@ -0,0 +1,213 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAlias +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AliasDefaultConst() & + bind(C, name='AliasDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AliasDefaultConst +end function AliasDefaultConst + +!! Create, default, non-const +function AliasDefault() & + bind(C, name='AliasDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AliasDefault +end function AliasDefault + +!! Create, general, const +function AliasCreateConst( & + id, & + pid, & + idSize, & + pidSize & +) & + bind(C, name='AliasCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + type(c_ptr) :: AliasCreateConst +end function AliasCreateConst + +!! Create, general, non-const +function AliasCreate( & + id, & + pid, & + idSize, & + pidSize & +) & + bind(C, name='AliasCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + type(c_ptr) :: AliasCreate +end function AliasCreate + +!! Assign +subroutine AliasAssign(handleLHS, handleRHS) & + bind(C, name='AliasAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AliasAssign + +!! Delete +subroutine AliasDelete(handle) & + bind(C, name='AliasDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AliasDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AliasRead(handle, filename, filenameSize) & + bind(C, name='AliasRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AliasRead +end function AliasRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AliasWrite(handle, filename, filenameSize) & + bind(C, name='AliasWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AliasWrite +end function AliasWrite + +!! Print to standard output, in our prettyprinting format +function AliasPrint(handle) & + bind(C, name='AliasPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AliasPrint +end function AliasPrint + +!! Print to standard output, as XML +function AliasPrintXML(handle) & + bind(C, name='AliasPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AliasPrintXML +end function AliasPrintXML + +!! Print to standard output, as JSON +function AliasPrintJSON(handle) & + bind(C, name='AliasPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AliasPrintJSON +end function AliasPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: id +!! ----------------------------------------------------------------------------- + +!! Has +function AliasIdHas(handle) & + bind(C, name='AliasIdHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AliasIdHas +end function AliasIdHas + +!! Get +function AliasIdGet(handle) & + bind(C, name='AliasIdGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AliasIdGet +end function AliasIdGet + +!! Set +subroutine AliasIdSet(handle, id, idSize) & + bind(C, name='AliasIdSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) +end subroutine AliasIdSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function AliasPidHas(handle) & + bind(C, name='AliasPidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AliasPidHas +end function AliasPidHas + +!! Get +function AliasPidGet(handle) & + bind(C, name='AliasPidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AliasPidGet +end function AliasPidGet + +!! Set +subroutine AliasPidSet(handle, pid, pidSize) & + bind(C, name='AliasPidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine AliasPidSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAlias diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Aliases.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Aliases.f03 new file mode 100644 index 000000000..811a9f97d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Aliases.f03 @@ -0,0 +1,519 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAliases +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AliasesDefaultConst() & + bind(C, name='AliasesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AliasesDefaultConst +end function AliasesDefaultConst + +!! Create, default, non-const +function AliasesDefault() & + bind(C, name='AliasesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AliasesDefault +end function AliasesDefault + +!! Create, general, const +function AliasesCreateConst( & + alias, aliasSize, & + metaStable, metaStableSize & +) & + bind(C, name='AliasesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: aliasSize + type(c_ptr), intent(in) :: alias(aliasSize) + integer(c_size_t), intent(in), value :: metaStableSize + type(c_ptr), intent(in) :: metaStable(metaStableSize) + type(c_ptr) :: AliasesCreateConst +end function AliasesCreateConst + +!! Create, general, non-const +function AliasesCreate( & + alias, aliasSize, & + metaStable, metaStableSize & +) & + bind(C, name='AliasesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: aliasSize + type(c_ptr), intent(in) :: alias(aliasSize) + integer(c_size_t), intent(in), value :: metaStableSize + type(c_ptr), intent(in) :: metaStable(metaStableSize) + type(c_ptr) :: AliasesCreate +end function AliasesCreate + +!! Assign +subroutine AliasesAssign(handleLHS, handleRHS) & + bind(C, name='AliasesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AliasesAssign + +!! Delete +subroutine AliasesDelete(handle) & + bind(C, name='AliasesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AliasesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AliasesRead(handle, filename, filenameSize) & + bind(C, name='AliasesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AliasesRead +end function AliasesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AliasesWrite(handle, filename, filenameSize) & + bind(C, name='AliasesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AliasesWrite +end function AliasesWrite + +!! Print to standard output, in our prettyprinting format +function AliasesPrint(handle) & + bind(C, name='AliasesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AliasesPrint +end function AliasesPrint + +!! Print to standard output, as XML +function AliasesPrintXML(handle) & + bind(C, name='AliasesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AliasesPrintXML +end function AliasesPrintXML + +!! Print to standard output, as JSON +function AliasesPrintJSON(handle) & + bind(C, name='AliasesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AliasesPrintJSON +end function AliasesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: alias +!! ----------------------------------------------------------------------------- + +!! Has +function AliasesAliasHas(handle) & + bind(C, name='AliasesAliasHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AliasesAliasHas +end function AliasesAliasHas + +!! Clear +subroutine AliasesAliasClear(handle) & + bind(C, name='AliasesAliasClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AliasesAliasClear + +!! Size +function AliasesAliasSize(handle) & + bind(C, name='AliasesAliasSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: AliasesAliasSize +end function AliasesAliasSize + +!! Add +subroutine AliasesAliasAdd(handle, fieldHandle) & + bind(C, name='AliasesAliasAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AliasesAliasAdd + +!! Get, by index \in [0,size), const +function AliasesAliasGetConst(handle, index) & + bind(C, name='AliasesAliasGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AliasesAliasGetConst +end function AliasesAliasGetConst + +!! Get, by index \in [0,size), non-const +function AliasesAliasGet(handle, index) & + bind(C, name='AliasesAliasGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AliasesAliasGet +end function AliasesAliasGet + +!! Set, by index \in [0,size) +subroutine AliasesAliasSet(handle, index, fieldHandle) & + bind(C, name='AliasesAliasSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AliasesAliasSet + +!! ------------------------ +!! Re: metadatum id +!! ------------------------ + +!! Has, by id +function AliasesAliasHasById(handle, meta, metaSize) & + bind(C, name='AliasesAliasHasById') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AliasesAliasHasById +end function AliasesAliasHasById + +!! Get, by id, const +function AliasesAliasGetByIdConst(handle, meta, metaSize) & + bind(C, name='AliasesAliasGetByIdConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AliasesAliasGetByIdConst +end function AliasesAliasGetByIdConst + +!! Get, by id, non-const +function AliasesAliasGetById(handle, meta, metaSize) & + bind(C, name='AliasesAliasGetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AliasesAliasGetById +end function AliasesAliasGetById + +!! Set, by id +subroutine AliasesAliasSetById(handle, meta, metaSize, fieldHandle) & + bind(C, name='AliasesAliasSetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AliasesAliasSetById + +!! ------------------------ +!! Re: metadatum pid +!! ------------------------ + +!! Has, by pid +function AliasesAliasHasByPid(handle, meta, metaSize) & + bind(C, name='AliasesAliasHasByPid') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AliasesAliasHasByPid +end function AliasesAliasHasByPid + +!! Get, by pid, const +function AliasesAliasGetByPidConst(handle, meta, metaSize) & + bind(C, name='AliasesAliasGetByPidConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AliasesAliasGetByPidConst +end function AliasesAliasGetByPidConst + +!! Get, by pid, non-const +function AliasesAliasGetByPid(handle, meta, metaSize) & + bind(C, name='AliasesAliasGetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AliasesAliasGetByPid +end function AliasesAliasGetByPid + +!! Set, by pid +subroutine AliasesAliasSetByPid(handle, meta, metaSize, fieldHandle) & + bind(C, name='AliasesAliasSetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AliasesAliasSetByPid + + +!! ----------------------------------------------------------------------------- +!! Child: metaStable +!! ----------------------------------------------------------------------------- + +!! Has +function AliasesMetaStableHas(handle) & + bind(C, name='AliasesMetaStableHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AliasesMetaStableHas +end function AliasesMetaStableHas + +!! Clear +subroutine AliasesMetaStableClear(handle) & + bind(C, name='AliasesMetaStableClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AliasesMetaStableClear + +!! Size +function AliasesMetaStableSize(handle) & + bind(C, name='AliasesMetaStableSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: AliasesMetaStableSize +end function AliasesMetaStableSize + +!! Add +subroutine AliasesMetaStableAdd(handle, fieldHandle) & + bind(C, name='AliasesMetaStableAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AliasesMetaStableAdd + +!! Get, by index \in [0,size), const +function AliasesMetaStableGetConst(handle, index) & + bind(C, name='AliasesMetaStableGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AliasesMetaStableGetConst +end function AliasesMetaStableGetConst + +!! Get, by index \in [0,size), non-const +function AliasesMetaStableGet(handle, index) & + bind(C, name='AliasesMetaStableGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AliasesMetaStableGet +end function AliasesMetaStableGet + +!! Set, by index \in [0,size) +subroutine AliasesMetaStableSet(handle, index, fieldHandle) & + bind(C, name='AliasesMetaStableSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AliasesMetaStableSet + +!! ------------------------ +!! Re: metadatum id +!! ------------------------ + +!! Has, by id +function AliasesMetaStableHasById(handle, meta, metaSize) & + bind(C, name='AliasesMetaStableHasById') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AliasesMetaStableHasById +end function AliasesMetaStableHasById + +!! Get, by id, const +function AliasesMetaStableGetByIdConst(handle, meta, metaSize) & + bind(C, name='AliasesMetaStableGetByIdConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AliasesMetaStableGetByIdConst +end function AliasesMetaStableGetByIdConst + +!! Get, by id, non-const +function AliasesMetaStableGetById(handle, meta, metaSize) & + bind(C, name='AliasesMetaStableGetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AliasesMetaStableGetById +end function AliasesMetaStableGetById + +!! Set, by id +subroutine AliasesMetaStableSetById(handle, meta, metaSize, fieldHandle) & + bind(C, name='AliasesMetaStableSetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AliasesMetaStableSetById + +!! ------------------------ +!! Re: metadatum pid +!! ------------------------ + +!! Has, by pid +function AliasesMetaStableHasByPid(handle, meta, metaSize) & + bind(C, name='AliasesMetaStableHasByPid') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AliasesMetaStableHasByPid +end function AliasesMetaStableHasByPid + +!! Get, by pid, const +function AliasesMetaStableGetByPidConst(handle, meta, metaSize) & + bind(C, name='AliasesMetaStableGetByPidConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AliasesMetaStableGetByPidConst +end function AliasesMetaStableGetByPidConst + +!! Get, by pid, non-const +function AliasesMetaStableGetByPid(handle, meta, metaSize) & + bind(C, name='AliasesMetaStableGetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AliasesMetaStableGetByPid +end function AliasesMetaStableGetByPid + +!! Set, by pid +subroutine AliasesMetaStableSetByPid(handle, meta, metaSize, fieldHandle) & + bind(C, name='AliasesMetaStableSetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AliasesMetaStableSetByPid + +!! ------------------------ +!! Re: metadatum metaStableIndex +!! ------------------------ + +!! Has, by metaStableIndex +function AliasesMetaStableHasByMetaStableIndex(handle, meta) & + bind(C, name='AliasesMetaStableHasByMetaStableIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: AliasesMetaStableHasByMetaStableIndex +end function AliasesMetaStableHasByMetaStableIndex + +!! Get, by metaStableIndex, const +function AliasesMetaStableGetByMetaStableIndexConst(handle, meta) & + bind(C, name='AliasesMetaStableGetByMetaStableIndexConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: AliasesMetaStableGetByMetaStableIndexConst +end function AliasesMetaStableGetByMetaStableIndexConst + +!! Get, by metaStableIndex, non-const +function AliasesMetaStableGetByMetaStableIndex(handle, meta) & + bind(C, name='AliasesMetaStableGetByMetaStableIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: AliasesMetaStableGetByMetaStableIndex +end function AliasesMetaStableGetByMetaStableIndex + +!! Set, by metaStableIndex +subroutine AliasesMetaStableSetByMetaStableIndex(handle, meta, fieldHandle) & + bind(C, name='AliasesMetaStableSetByMetaStableIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AliasesMetaStableSetByMetaStableIndex + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAliases diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Angular.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Angular.f03 new file mode 100644 index 000000000..037436f81 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Angular.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAngular +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AngularDefaultConst() & + bind(C, name='AngularDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AngularDefaultConst +end function AngularDefaultConst + +!! Create, default, non-const +function AngularDefault() & + bind(C, name='AngularDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AngularDefault +end function AngularDefault + +!! Create, general, const +function AngularCreateConst( & + isotropic2d, & + XYs2d & +) & + bind(C, name='AngularCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: isotropic2d + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: AngularCreateConst +end function AngularCreateConst + +!! Create, general, non-const +function AngularCreate( & + isotropic2d, & + XYs2d & +) & + bind(C, name='AngularCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: isotropic2d + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: AngularCreate +end function AngularCreate + +!! Assign +subroutine AngularAssign(handleLHS, handleRHS) & + bind(C, name='AngularAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AngularAssign + +!! Delete +subroutine AngularDelete(handle) & + bind(C, name='AngularDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AngularDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AngularRead(handle, filename, filenameSize) & + bind(C, name='AngularRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AngularRead +end function AngularRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AngularWrite(handle, filename, filenameSize) & + bind(C, name='AngularWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AngularWrite +end function AngularWrite + +!! Print to standard output, in our prettyprinting format +function AngularPrint(handle) & + bind(C, name='AngularPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularPrint +end function AngularPrint + +!! Print to standard output, as XML +function AngularPrintXML(handle) & + bind(C, name='AngularPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularPrintXML +end function AngularPrintXML + +!! Print to standard output, as JSON +function AngularPrintJSON(handle) & + bind(C, name='AngularPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularPrintJSON +end function AngularPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: isotropic2d +!! ----------------------------------------------------------------------------- + +!! Has +function AngularIsotropic2dHas(handle) & + bind(C, name='AngularIsotropic2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularIsotropic2dHas +end function AngularIsotropic2dHas + +!! Get, const +function AngularIsotropic2dGetConst(handle) & + bind(C, name='AngularIsotropic2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AngularIsotropic2dGetConst +end function AngularIsotropic2dGetConst + +!! Get, non-const +function AngularIsotropic2dGet(handle) & + bind(C, name='AngularIsotropic2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AngularIsotropic2dGet +end function AngularIsotropic2dGet + +!! Set +subroutine AngularIsotropic2dSet(handle, fieldHandle) & + bind(C, name='AngularIsotropic2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AngularIsotropic2dSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs2d +!! ----------------------------------------------------------------------------- + +!! Has +function AngularXYs2dHas(handle) & + bind(C, name='AngularXYs2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularXYs2dHas +end function AngularXYs2dHas + +!! Get, const +function AngularXYs2dGetConst(handle) & + bind(C, name='AngularXYs2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AngularXYs2dGetConst +end function AngularXYs2dGetConst + +!! Get, non-const +function AngularXYs2dGet(handle) & + bind(C, name='AngularXYs2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AngularXYs2dGet +end function AngularXYs2dGet + +!! Set +subroutine AngularXYs2dSet(handle, fieldHandle) & + bind(C, name='AngularXYs2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AngularXYs2dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAngular diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AngularEnergy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AngularEnergy.f03 new file mode 100644 index 000000000..a82b2d04c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AngularEnergy.f03 @@ -0,0 +1,258 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAngularEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AngularEnergyDefaultConst() & + bind(C, name='AngularEnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AngularEnergyDefaultConst +end function AngularEnergyDefaultConst + +!! Create, default, non-const +function AngularEnergyDefault() & + bind(C, name='AngularEnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AngularEnergyDefault +end function AngularEnergyDefault + +!! Create, general, const +function AngularEnergyCreateConst( & + label, & + productFrame, & + XYs3d, & + labelSize, & + productFrameSize & +) & + bind(C, name='AngularEnergyCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: XYs3d + type(c_ptr) :: AngularEnergyCreateConst +end function AngularEnergyCreateConst + +!! Create, general, non-const +function AngularEnergyCreate( & + label, & + productFrame, & + XYs3d, & + labelSize, & + productFrameSize & +) & + bind(C, name='AngularEnergyCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: XYs3d + type(c_ptr) :: AngularEnergyCreate +end function AngularEnergyCreate + +!! Assign +subroutine AngularEnergyAssign(handleLHS, handleRHS) & + bind(C, name='AngularEnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AngularEnergyAssign + +!! Delete +subroutine AngularEnergyDelete(handle) & + bind(C, name='AngularEnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AngularEnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AngularEnergyRead(handle, filename, filenameSize) & + bind(C, name='AngularEnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AngularEnergyRead +end function AngularEnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AngularEnergyWrite(handle, filename, filenameSize) & + bind(C, name='AngularEnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AngularEnergyWrite +end function AngularEnergyWrite + +!! Print to standard output, in our prettyprinting format +function AngularEnergyPrint(handle) & + bind(C, name='AngularEnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularEnergyPrint +end function AngularEnergyPrint + +!! Print to standard output, as XML +function AngularEnergyPrintXML(handle) & + bind(C, name='AngularEnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularEnergyPrintXML +end function AngularEnergyPrintXML + +!! Print to standard output, as JSON +function AngularEnergyPrintJSON(handle) & + bind(C, name='AngularEnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularEnergyPrintJSON +end function AngularEnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function AngularEnergyLabelHas(handle) & + bind(C, name='AngularEnergyLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularEnergyLabelHas +end function AngularEnergyLabelHas + +!! Get +function AngularEnergyLabelGet(handle) & + bind(C, name='AngularEnergyLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AngularEnergyLabelGet +end function AngularEnergyLabelGet + +!! Set +subroutine AngularEnergyLabelSet(handle, label, labelSize) & + bind(C, name='AngularEnergyLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine AngularEnergyLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function AngularEnergyProductFrameHas(handle) & + bind(C, name='AngularEnergyProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularEnergyProductFrameHas +end function AngularEnergyProductFrameHas + +!! Get +function AngularEnergyProductFrameGet(handle) & + bind(C, name='AngularEnergyProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AngularEnergyProductFrameGet +end function AngularEnergyProductFrameGet + +!! Set +subroutine AngularEnergyProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='AngularEnergyProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine AngularEnergyProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs3d +!! ----------------------------------------------------------------------------- + +!! Has +function AngularEnergyXYs3dHas(handle) & + bind(C, name='AngularEnergyXYs3dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularEnergyXYs3dHas +end function AngularEnergyXYs3dHas + +!! Get, const +function AngularEnergyXYs3dGetConst(handle) & + bind(C, name='AngularEnergyXYs3dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AngularEnergyXYs3dGetConst +end function AngularEnergyXYs3dGetConst + +!! Get, non-const +function AngularEnergyXYs3dGet(handle) & + bind(C, name='AngularEnergyXYs3dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AngularEnergyXYs3dGet +end function AngularEnergyXYs3dGet + +!! Set +subroutine AngularEnergyXYs3dSet(handle, fieldHandle) & + bind(C, name='AngularEnergyXYs3dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AngularEnergyXYs3dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAngularEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AngularTwoBody.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AngularTwoBody.f03 new file mode 100644 index 000000000..b4f1cab64 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AngularTwoBody.f03 @@ -0,0 +1,393 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAngularTwoBody +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AngularTwoBodyDefaultConst() & + bind(C, name='AngularTwoBodyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AngularTwoBodyDefaultConst +end function AngularTwoBodyDefaultConst + +!! Create, default, non-const +function AngularTwoBodyDefault() & + bind(C, name='AngularTwoBodyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AngularTwoBodyDefault +end function AngularTwoBodyDefault + +!! Create, general, const +function AngularTwoBodyCreateConst( & + label, & + productFrame, & + XYs2d, & + regions2d, & + recoil, & + isotropic2d, & + labelSize, & + productFrameSize & +) & + bind(C, name='AngularTwoBodyCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr), intent(in), value :: regions2d + type(c_ptr), intent(in), value :: recoil + type(c_ptr), intent(in), value :: isotropic2d + type(c_ptr) :: AngularTwoBodyCreateConst +end function AngularTwoBodyCreateConst + +!! Create, general, non-const +function AngularTwoBodyCreate( & + label, & + productFrame, & + XYs2d, & + regions2d, & + recoil, & + isotropic2d, & + labelSize, & + productFrameSize & +) & + bind(C, name='AngularTwoBodyCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr), intent(in), value :: regions2d + type(c_ptr), intent(in), value :: recoil + type(c_ptr), intent(in), value :: isotropic2d + type(c_ptr) :: AngularTwoBodyCreate +end function AngularTwoBodyCreate + +!! Assign +subroutine AngularTwoBodyAssign(handleLHS, handleRHS) & + bind(C, name='AngularTwoBodyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AngularTwoBodyAssign + +!! Delete +subroutine AngularTwoBodyDelete(handle) & + bind(C, name='AngularTwoBodyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AngularTwoBodyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AngularTwoBodyRead(handle, filename, filenameSize) & + bind(C, name='AngularTwoBodyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AngularTwoBodyRead +end function AngularTwoBodyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AngularTwoBodyWrite(handle, filename, filenameSize) & + bind(C, name='AngularTwoBodyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AngularTwoBodyWrite +end function AngularTwoBodyWrite + +!! Print to standard output, in our prettyprinting format +function AngularTwoBodyPrint(handle) & + bind(C, name='AngularTwoBodyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularTwoBodyPrint +end function AngularTwoBodyPrint + +!! Print to standard output, as XML +function AngularTwoBodyPrintXML(handle) & + bind(C, name='AngularTwoBodyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularTwoBodyPrintXML +end function AngularTwoBodyPrintXML + +!! Print to standard output, as JSON +function AngularTwoBodyPrintJSON(handle) & + bind(C, name='AngularTwoBodyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularTwoBodyPrintJSON +end function AngularTwoBodyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function AngularTwoBodyLabelHas(handle) & + bind(C, name='AngularTwoBodyLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularTwoBodyLabelHas +end function AngularTwoBodyLabelHas + +!! Get +function AngularTwoBodyLabelGet(handle) & + bind(C, name='AngularTwoBodyLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AngularTwoBodyLabelGet +end function AngularTwoBodyLabelGet + +!! Set +subroutine AngularTwoBodyLabelSet(handle, label, labelSize) & + bind(C, name='AngularTwoBodyLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine AngularTwoBodyLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function AngularTwoBodyProductFrameHas(handle) & + bind(C, name='AngularTwoBodyProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularTwoBodyProductFrameHas +end function AngularTwoBodyProductFrameHas + +!! Get +function AngularTwoBodyProductFrameGet(handle) & + bind(C, name='AngularTwoBodyProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AngularTwoBodyProductFrameGet +end function AngularTwoBodyProductFrameGet + +!! Set +subroutine AngularTwoBodyProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='AngularTwoBodyProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine AngularTwoBodyProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs2d +!! ----------------------------------------------------------------------------- + +!! Has +function AngularTwoBodyXYs2dHas(handle) & + bind(C, name='AngularTwoBodyXYs2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularTwoBodyXYs2dHas +end function AngularTwoBodyXYs2dHas + +!! Get, const +function AngularTwoBodyXYs2dGetConst(handle) & + bind(C, name='AngularTwoBodyXYs2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AngularTwoBodyXYs2dGetConst +end function AngularTwoBodyXYs2dGetConst + +!! Get, non-const +function AngularTwoBodyXYs2dGet(handle) & + bind(C, name='AngularTwoBodyXYs2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AngularTwoBodyXYs2dGet +end function AngularTwoBodyXYs2dGet + +!! Set +subroutine AngularTwoBodyXYs2dSet(handle, fieldHandle) & + bind(C, name='AngularTwoBodyXYs2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AngularTwoBodyXYs2dSet + + +!! ----------------------------------------------------------------------------- +!! Child: regions2d +!! ----------------------------------------------------------------------------- + +!! Has +function AngularTwoBodyRegions2dHas(handle) & + bind(C, name='AngularTwoBodyRegions2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularTwoBodyRegions2dHas +end function AngularTwoBodyRegions2dHas + +!! Get, const +function AngularTwoBodyRegions2dGetConst(handle) & + bind(C, name='AngularTwoBodyRegions2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AngularTwoBodyRegions2dGetConst +end function AngularTwoBodyRegions2dGetConst + +!! Get, non-const +function AngularTwoBodyRegions2dGet(handle) & + bind(C, name='AngularTwoBodyRegions2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AngularTwoBodyRegions2dGet +end function AngularTwoBodyRegions2dGet + +!! Set +subroutine AngularTwoBodyRegions2dSet(handle, fieldHandle) & + bind(C, name='AngularTwoBodyRegions2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AngularTwoBodyRegions2dSet + + +!! ----------------------------------------------------------------------------- +!! Child: recoil +!! ----------------------------------------------------------------------------- + +!! Has +function AngularTwoBodyRecoilHas(handle) & + bind(C, name='AngularTwoBodyRecoilHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularTwoBodyRecoilHas +end function AngularTwoBodyRecoilHas + +!! Get, const +function AngularTwoBodyRecoilGetConst(handle) & + bind(C, name='AngularTwoBodyRecoilGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AngularTwoBodyRecoilGetConst +end function AngularTwoBodyRecoilGetConst + +!! Get, non-const +function AngularTwoBodyRecoilGet(handle) & + bind(C, name='AngularTwoBodyRecoilGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AngularTwoBodyRecoilGet +end function AngularTwoBodyRecoilGet + +!! Set +subroutine AngularTwoBodyRecoilSet(handle, fieldHandle) & + bind(C, name='AngularTwoBodyRecoilSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AngularTwoBodyRecoilSet + + +!! ----------------------------------------------------------------------------- +!! Child: isotropic2d +!! ----------------------------------------------------------------------------- + +!! Has +function AngularTwoBodyIsotropic2dHas(handle) & + bind(C, name='AngularTwoBodyIsotropic2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AngularTwoBodyIsotropic2dHas +end function AngularTwoBodyIsotropic2dHas + +!! Get, const +function AngularTwoBodyIsotropic2dGetConst(handle) & + bind(C, name='AngularTwoBodyIsotropic2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AngularTwoBodyIsotropic2dGetConst +end function AngularTwoBodyIsotropic2dGetConst + +!! Get, non-const +function AngularTwoBodyIsotropic2dGet(handle) & + bind(C, name='AngularTwoBodyIsotropic2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AngularTwoBodyIsotropic2dGet +end function AngularTwoBodyIsotropic2dGet + +!! Set +subroutine AngularTwoBodyIsotropic2dSet(handle, fieldHandle) & + bind(C, name='AngularTwoBodyIsotropic2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AngularTwoBodyIsotropic2dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAngularTwoBody diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ApplicationData.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ApplicationData.f03 new file mode 100644 index 000000000..8b829c0ea --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ApplicationData.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalApplicationData +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ApplicationDataDefaultConst() & + bind(C, name='ApplicationDataDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ApplicationDataDefaultConst +end function ApplicationDataDefaultConst + +!! Create, default, non-const +function ApplicationDataDefault() & + bind(C, name='ApplicationDataDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ApplicationDataDefault +end function ApplicationDataDefault + +!! Create, general, const +function ApplicationDataCreateConst( & + institution & +) & + bind(C, name='ApplicationDataCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: institution + type(c_ptr) :: ApplicationDataCreateConst +end function ApplicationDataCreateConst + +!! Create, general, non-const +function ApplicationDataCreate( & + institution & +) & + bind(C, name='ApplicationDataCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: institution + type(c_ptr) :: ApplicationDataCreate +end function ApplicationDataCreate + +!! Assign +subroutine ApplicationDataAssign(handleLHS, handleRHS) & + bind(C, name='ApplicationDataAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ApplicationDataAssign + +!! Delete +subroutine ApplicationDataDelete(handle) & + bind(C, name='ApplicationDataDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ApplicationDataDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ApplicationDataRead(handle, filename, filenameSize) & + bind(C, name='ApplicationDataRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ApplicationDataRead +end function ApplicationDataRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ApplicationDataWrite(handle, filename, filenameSize) & + bind(C, name='ApplicationDataWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ApplicationDataWrite +end function ApplicationDataWrite + +!! Print to standard output, in our prettyprinting format +function ApplicationDataPrint(handle) & + bind(C, name='ApplicationDataPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ApplicationDataPrint +end function ApplicationDataPrint + +!! Print to standard output, as XML +function ApplicationDataPrintXML(handle) & + bind(C, name='ApplicationDataPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ApplicationDataPrintXML +end function ApplicationDataPrintXML + +!! Print to standard output, as JSON +function ApplicationDataPrintJSON(handle) & + bind(C, name='ApplicationDataPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ApplicationDataPrintJSON +end function ApplicationDataPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: institution +!! ----------------------------------------------------------------------------- + +!! Has +function ApplicationDataInstitutionHas(handle) & + bind(C, name='ApplicationDataInstitutionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ApplicationDataInstitutionHas +end function ApplicationDataInstitutionHas + +!! Get, const +function ApplicationDataInstitutionGetConst(handle) & + bind(C, name='ApplicationDataInstitutionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ApplicationDataInstitutionGetConst +end function ApplicationDataInstitutionGetConst + +!! Get, non-const +function ApplicationDataInstitutionGet(handle) & + bind(C, name='ApplicationDataInstitutionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ApplicationDataInstitutionGet +end function ApplicationDataInstitutionGet + +!! Set +subroutine ApplicationDataInstitutionSet(handle, fieldHandle) & + bind(C, name='ApplicationDataInstitutionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ApplicationDataInstitutionSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalApplicationData diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Array.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Array.f03 new file mode 100644 index 000000000..fc293e534 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Array.f03 @@ -0,0 +1,258 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalArray +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ArrayDefaultConst() & + bind(C, name='ArrayDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ArrayDefaultConst +end function ArrayDefaultConst + +!! Create, default, non-const +function ArrayDefault() & + bind(C, name='ArrayDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ArrayDefault +end function ArrayDefault + +!! Create, general, const +function ArrayCreateConst( & + shape, & + compression, & + values, & + shapeSize, & + compressionSize & +) & + bind(C, name='ArrayCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: shapeSize + character(c_char), intent(in) :: shape(shapeSize) + integer(c_size_t), intent(in), value :: compressionSize + character(c_char), intent(in) :: compression(compressionSize) + type(c_ptr), intent(in), value :: values + type(c_ptr) :: ArrayCreateConst +end function ArrayCreateConst + +!! Create, general, non-const +function ArrayCreate( & + shape, & + compression, & + values, & + shapeSize, & + compressionSize & +) & + bind(C, name='ArrayCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: shapeSize + character(c_char), intent(in) :: shape(shapeSize) + integer(c_size_t), intent(in), value :: compressionSize + character(c_char), intent(in) :: compression(compressionSize) + type(c_ptr), intent(in), value :: values + type(c_ptr) :: ArrayCreate +end function ArrayCreate + +!! Assign +subroutine ArrayAssign(handleLHS, handleRHS) & + bind(C, name='ArrayAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ArrayAssign + +!! Delete +subroutine ArrayDelete(handle) & + bind(C, name='ArrayDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ArrayDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ArrayRead(handle, filename, filenameSize) & + bind(C, name='ArrayRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ArrayRead +end function ArrayRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ArrayWrite(handle, filename, filenameSize) & + bind(C, name='ArrayWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ArrayWrite +end function ArrayWrite + +!! Print to standard output, in our prettyprinting format +function ArrayPrint(handle) & + bind(C, name='ArrayPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayPrint +end function ArrayPrint + +!! Print to standard output, as XML +function ArrayPrintXML(handle) & + bind(C, name='ArrayPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayPrintXML +end function ArrayPrintXML + +!! Print to standard output, as JSON +function ArrayPrintJSON(handle) & + bind(C, name='ArrayPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayPrintJSON +end function ArrayPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: shape +!! ----------------------------------------------------------------------------- + +!! Has +function ArrayShapeHas(handle) & + bind(C, name='ArrayShapeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayShapeHas +end function ArrayShapeHas + +!! Get +function ArrayShapeGet(handle) & + bind(C, name='ArrayShapeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArrayShapeGet +end function ArrayShapeGet + +!! Set +subroutine ArrayShapeSet(handle, shape, shapeSize) & + bind(C, name='ArrayShapeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: shapeSize + character(c_char), intent(in) :: shape(shapeSize) +end subroutine ArrayShapeSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: compression +!! ----------------------------------------------------------------------------- + +!! Has +function ArrayCompressionHas(handle) & + bind(C, name='ArrayCompressionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayCompressionHas +end function ArrayCompressionHas + +!! Get +function ArrayCompressionGet(handle) & + bind(C, name='ArrayCompressionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArrayCompressionGet +end function ArrayCompressionGet + +!! Set +subroutine ArrayCompressionSet(handle, compression, compressionSize) & + bind(C, name='ArrayCompressionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: compressionSize + character(c_char), intent(in) :: compression(compressionSize) +end subroutine ArrayCompressionSet + + +!! ----------------------------------------------------------------------------- +!! Child: values +!! ----------------------------------------------------------------------------- + +!! Has +function ArrayValuesHas(handle) & + bind(C, name='ArrayValuesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ArrayValuesHas +end function ArrayValuesHas + +!! Get, const +function ArrayValuesGetConst(handle) & + bind(C, name='ArrayValuesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ArrayValuesGetConst +end function ArrayValuesGetConst + +!! Get, non-const +function ArrayValuesGet(handle) & + bind(C, name='ArrayValuesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ArrayValuesGet +end function ArrayValuesGet + +!! Set +subroutine ArrayValuesSet(handle, fieldHandle) & + bind(C, name='ArrayValuesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ArrayValuesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalArray diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Atomic.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Atomic.f03 new file mode 100644 index 000000000..0c95c4eac --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Atomic.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAtomic +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AtomicDefaultConst() & + bind(C, name='AtomicDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AtomicDefaultConst +end function AtomicDefaultConst + +!! Create, default, non-const +function AtomicDefault() & + bind(C, name='AtomicDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AtomicDefault +end function AtomicDefault + +!! Create, general, const +function AtomicCreateConst( & + configurations & +) & + bind(C, name='AtomicCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: configurations + type(c_ptr) :: AtomicCreateConst +end function AtomicCreateConst + +!! Create, general, non-const +function AtomicCreate( & + configurations & +) & + bind(C, name='AtomicCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: configurations + type(c_ptr) :: AtomicCreate +end function AtomicCreate + +!! Assign +subroutine AtomicAssign(handleLHS, handleRHS) & + bind(C, name='AtomicAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AtomicAssign + +!! Delete +subroutine AtomicDelete(handle) & + bind(C, name='AtomicDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AtomicDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AtomicRead(handle, filename, filenameSize) & + bind(C, name='AtomicRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AtomicRead +end function AtomicRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AtomicWrite(handle, filename, filenameSize) & + bind(C, name='AtomicWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AtomicWrite +end function AtomicWrite + +!! Print to standard output, in our prettyprinting format +function AtomicPrint(handle) & + bind(C, name='AtomicPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AtomicPrint +end function AtomicPrint + +!! Print to standard output, as XML +function AtomicPrintXML(handle) & + bind(C, name='AtomicPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AtomicPrintXML +end function AtomicPrintXML + +!! Print to standard output, as JSON +function AtomicPrintJSON(handle) & + bind(C, name='AtomicPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AtomicPrintJSON +end function AtomicPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: configurations +!! ----------------------------------------------------------------------------- + +!! Has +function AtomicConfigurationsHas(handle) & + bind(C, name='AtomicConfigurationsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AtomicConfigurationsHas +end function AtomicConfigurationsHas + +!! Get, const +function AtomicConfigurationsGetConst(handle) & + bind(C, name='AtomicConfigurationsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AtomicConfigurationsGetConst +end function AtomicConfigurationsGetConst + +!! Get, non-const +function AtomicConfigurationsGet(handle) & + bind(C, name='AtomicConfigurationsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AtomicConfigurationsGet +end function AtomicConfigurationsGet + +!! Set +subroutine AtomicConfigurationsSet(handle, fieldHandle) & + bind(C, name='AtomicConfigurationsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AtomicConfigurationsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAtomic diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Author.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Author.f03 new file mode 100644 index 000000000..bad1bc6cf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Author.f03 @@ -0,0 +1,172 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAuthor +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AuthorDefaultConst() & + bind(C, name='AuthorDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AuthorDefaultConst +end function AuthorDefaultConst + +!! Create, default, non-const +function AuthorDefault() & + bind(C, name='AuthorDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AuthorDefault +end function AuthorDefault + +!! Create, general, const +function AuthorCreateConst( & + name, & + nameSize & +) & + bind(C, name='AuthorCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) + type(c_ptr) :: AuthorCreateConst +end function AuthorCreateConst + +!! Create, general, non-const +function AuthorCreate( & + name, & + nameSize & +) & + bind(C, name='AuthorCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) + type(c_ptr) :: AuthorCreate +end function AuthorCreate + +!! Assign +subroutine AuthorAssign(handleLHS, handleRHS) & + bind(C, name='AuthorAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AuthorAssign + +!! Delete +subroutine AuthorDelete(handle) & + bind(C, name='AuthorDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AuthorDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AuthorRead(handle, filename, filenameSize) & + bind(C, name='AuthorRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AuthorRead +end function AuthorRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AuthorWrite(handle, filename, filenameSize) & + bind(C, name='AuthorWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AuthorWrite +end function AuthorWrite + +!! Print to standard output, in our prettyprinting format +function AuthorPrint(handle) & + bind(C, name='AuthorPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AuthorPrint +end function AuthorPrint + +!! Print to standard output, as XML +function AuthorPrintXML(handle) & + bind(C, name='AuthorPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AuthorPrintXML +end function AuthorPrintXML + +!! Print to standard output, as JSON +function AuthorPrintJSON(handle) & + bind(C, name='AuthorPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AuthorPrintJSON +end function AuthorPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: name +!! ----------------------------------------------------------------------------- + +!! Has +function AuthorNameHas(handle) & + bind(C, name='AuthorNameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AuthorNameHas +end function AuthorNameHas + +!! Get +function AuthorNameGet(handle) & + bind(C, name='AuthorNameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AuthorNameGet +end function AuthorNameGet + +!! Set +subroutine AuthorNameSet(handle, name, nameSize) & + bind(C, name='AuthorNameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) +end subroutine AuthorNameSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAuthor diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Authors.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Authors.f03 new file mode 100644 index 000000000..0b083b467 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Authors.f03 @@ -0,0 +1,255 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAuthors +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AuthorsDefaultConst() & + bind(C, name='AuthorsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AuthorsDefaultConst +end function AuthorsDefaultConst + +!! Create, default, non-const +function AuthorsDefault() & + bind(C, name='AuthorsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AuthorsDefault +end function AuthorsDefault + +!! Create, general, const +function AuthorsCreateConst( & + author, authorSize & +) & + bind(C, name='AuthorsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: authorSize + type(c_ptr), intent(in) :: author(authorSize) + type(c_ptr) :: AuthorsCreateConst +end function AuthorsCreateConst + +!! Create, general, non-const +function AuthorsCreate( & + author, authorSize & +) & + bind(C, name='AuthorsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: authorSize + type(c_ptr), intent(in) :: author(authorSize) + type(c_ptr) :: AuthorsCreate +end function AuthorsCreate + +!! Assign +subroutine AuthorsAssign(handleLHS, handleRHS) & + bind(C, name='AuthorsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AuthorsAssign + +!! Delete +subroutine AuthorsDelete(handle) & + bind(C, name='AuthorsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AuthorsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AuthorsRead(handle, filename, filenameSize) & + bind(C, name='AuthorsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AuthorsRead +end function AuthorsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AuthorsWrite(handle, filename, filenameSize) & + bind(C, name='AuthorsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AuthorsWrite +end function AuthorsWrite + +!! Print to standard output, in our prettyprinting format +function AuthorsPrint(handle) & + bind(C, name='AuthorsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AuthorsPrint +end function AuthorsPrint + +!! Print to standard output, as XML +function AuthorsPrintXML(handle) & + bind(C, name='AuthorsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AuthorsPrintXML +end function AuthorsPrintXML + +!! Print to standard output, as JSON +function AuthorsPrintJSON(handle) & + bind(C, name='AuthorsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AuthorsPrintJSON +end function AuthorsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: author +!! ----------------------------------------------------------------------------- + +!! Has +function AuthorsAuthorHas(handle) & + bind(C, name='AuthorsAuthorHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AuthorsAuthorHas +end function AuthorsAuthorHas + +!! Clear +subroutine AuthorsAuthorClear(handle) & + bind(C, name='AuthorsAuthorClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AuthorsAuthorClear + +!! Size +function AuthorsAuthorSize(handle) & + bind(C, name='AuthorsAuthorSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: AuthorsAuthorSize +end function AuthorsAuthorSize + +!! Add +subroutine AuthorsAuthorAdd(handle, fieldHandle) & + bind(C, name='AuthorsAuthorAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AuthorsAuthorAdd + +!! Get, by index \in [0,size), const +function AuthorsAuthorGetConst(handle, index) & + bind(C, name='AuthorsAuthorGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AuthorsAuthorGetConst +end function AuthorsAuthorGetConst + +!! Get, by index \in [0,size), non-const +function AuthorsAuthorGet(handle, index) & + bind(C, name='AuthorsAuthorGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AuthorsAuthorGet +end function AuthorsAuthorGet + +!! Set, by index \in [0,size) +subroutine AuthorsAuthorSet(handle, index, fieldHandle) & + bind(C, name='AuthorsAuthorSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AuthorsAuthorSet + +!! ------------------------ +!! Re: metadatum name +!! ------------------------ + +!! Has, by name +function AuthorsAuthorHasByName(handle, meta, metaSize) & + bind(C, name='AuthorsAuthorHasByName') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AuthorsAuthorHasByName +end function AuthorsAuthorHasByName + +!! Get, by name, const +function AuthorsAuthorGetByNameConst(handle, meta, metaSize) & + bind(C, name='AuthorsAuthorGetByNameConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AuthorsAuthorGetByNameConst +end function AuthorsAuthorGetByNameConst + +!! Get, by name, non-const +function AuthorsAuthorGetByName(handle, meta, metaSize) & + bind(C, name='AuthorsAuthorGetByName') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AuthorsAuthorGetByName +end function AuthorsAuthorGetByName + +!! Set, by name +subroutine AuthorsAuthorSetByName(handle, meta, metaSize, fieldHandle) & + bind(C, name='AuthorsAuthorSetByName') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AuthorsAuthorSetByName + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAuthors diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageEnergies.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageEnergies.f03 new file mode 100644 index 000000000..203769c23 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageEnergies.f03 @@ -0,0 +1,347 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAverageEnergies +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AverageEnergiesDefaultConst() & + bind(C, name='AverageEnergiesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AverageEnergiesDefaultConst +end function AverageEnergiesDefaultConst + +!! Create, default, non-const +function AverageEnergiesDefault() & + bind(C, name='AverageEnergiesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AverageEnergiesDefault +end function AverageEnergiesDefault + +!! Create, general, const +function AverageEnergiesCreateConst( & + averageEnergy, averageEnergySize & +) & + bind(C, name='AverageEnergiesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: averageEnergySize + type(c_ptr), intent(in) :: averageEnergy(averageEnergySize) + type(c_ptr) :: AverageEnergiesCreateConst +end function AverageEnergiesCreateConst + +!! Create, general, non-const +function AverageEnergiesCreate( & + averageEnergy, averageEnergySize & +) & + bind(C, name='AverageEnergiesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: averageEnergySize + type(c_ptr), intent(in) :: averageEnergy(averageEnergySize) + type(c_ptr) :: AverageEnergiesCreate +end function AverageEnergiesCreate + +!! Assign +subroutine AverageEnergiesAssign(handleLHS, handleRHS) & + bind(C, name='AverageEnergiesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AverageEnergiesAssign + +!! Delete +subroutine AverageEnergiesDelete(handle) & + bind(C, name='AverageEnergiesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AverageEnergiesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AverageEnergiesRead(handle, filename, filenameSize) & + bind(C, name='AverageEnergiesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AverageEnergiesRead +end function AverageEnergiesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AverageEnergiesWrite(handle, filename, filenameSize) & + bind(C, name='AverageEnergiesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AverageEnergiesWrite +end function AverageEnergiesWrite + +!! Print to standard output, in our prettyprinting format +function AverageEnergiesPrint(handle) & + bind(C, name='AverageEnergiesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageEnergiesPrint +end function AverageEnergiesPrint + +!! Print to standard output, as XML +function AverageEnergiesPrintXML(handle) & + bind(C, name='AverageEnergiesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageEnergiesPrintXML +end function AverageEnergiesPrintXML + +!! Print to standard output, as JSON +function AverageEnergiesPrintJSON(handle) & + bind(C, name='AverageEnergiesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageEnergiesPrintJSON +end function AverageEnergiesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: averageEnergy +!! ----------------------------------------------------------------------------- + +!! Has +function AverageEnergiesAverageEnergyHas(handle) & + bind(C, name='AverageEnergiesAverageEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageEnergiesAverageEnergyHas +end function AverageEnergiesAverageEnergyHas + +!! Clear +subroutine AverageEnergiesAverageEnergyClear(handle) & + bind(C, name='AverageEnergiesAverageEnergyClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AverageEnergiesAverageEnergyClear + +!! Size +function AverageEnergiesAverageEnergySize(handle) & + bind(C, name='AverageEnergiesAverageEnergySize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: AverageEnergiesAverageEnergySize +end function AverageEnergiesAverageEnergySize + +!! Add +subroutine AverageEnergiesAverageEnergyAdd(handle, fieldHandle) & + bind(C, name='AverageEnergiesAverageEnergyAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AverageEnergiesAverageEnergyAdd + +!! Get, by index \in [0,size), const +function AverageEnergiesAverageEnergyGetConst(handle, index) & + bind(C, name='AverageEnergiesAverageEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AverageEnergiesAverageEnergyGetConst +end function AverageEnergiesAverageEnergyGetConst + +!! Get, by index \in [0,size), non-const +function AverageEnergiesAverageEnergyGet(handle, index) & + bind(C, name='AverageEnergiesAverageEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AverageEnergiesAverageEnergyGet +end function AverageEnergiesAverageEnergyGet + +!! Set, by index \in [0,size) +subroutine AverageEnergiesAverageEnergySet(handle, index, fieldHandle) & + bind(C, name='AverageEnergiesAverageEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AverageEnergiesAverageEnergySet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function AverageEnergiesAverageEnergyHasByLabel(handle, meta, metaSize) & + bind(C, name='AverageEnergiesAverageEnergyHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AverageEnergiesAverageEnergyHasByLabel +end function AverageEnergiesAverageEnergyHasByLabel + +!! Get, by label, const +function AverageEnergiesAverageEnergyGetByLabelConst(handle, meta, metaSize) & + bind(C, name='AverageEnergiesAverageEnergyGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AverageEnergiesAverageEnergyGetByLabelConst +end function AverageEnergiesAverageEnergyGetByLabelConst + +!! Get, by label, non-const +function AverageEnergiesAverageEnergyGetByLabel(handle, meta, metaSize) & + bind(C, name='AverageEnergiesAverageEnergyGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AverageEnergiesAverageEnergyGetByLabel +end function AverageEnergiesAverageEnergyGetByLabel + +!! Set, by label +subroutine AverageEnergiesAverageEnergySetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='AverageEnergiesAverageEnergySetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AverageEnergiesAverageEnergySetByLabel + +!! ------------------------ +!! Re: metadatum value +!! ------------------------ + +!! Has, by value +function AverageEnergiesAverageEnergyHasByValue(handle, meta) & + bind(C, name='AverageEnergiesAverageEnergyHasByValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: AverageEnergiesAverageEnergyHasByValue +end function AverageEnergiesAverageEnergyHasByValue + +!! Get, by value, const +function AverageEnergiesAverageEnergyGetByValueConst(handle, meta) & + bind(C, name='AverageEnergiesAverageEnergyGetByValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: AverageEnergiesAverageEnergyGetByValueConst +end function AverageEnergiesAverageEnergyGetByValueConst + +!! Get, by value, non-const +function AverageEnergiesAverageEnergyGetByValue(handle, meta) & + bind(C, name='AverageEnergiesAverageEnergyGetByValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: AverageEnergiesAverageEnergyGetByValue +end function AverageEnergiesAverageEnergyGetByValue + +!! Set, by value +subroutine AverageEnergiesAverageEnergySetByValue(handle, meta, fieldHandle) & + bind(C, name='AverageEnergiesAverageEnergySetByValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AverageEnergiesAverageEnergySetByValue + +!! ------------------------ +!! Re: metadatum unit +!! ------------------------ + +!! Has, by unit +function AverageEnergiesAverageEnergyHasByUnit(handle, meta, metaSize) & + bind(C, name='AverageEnergiesAverageEnergyHasByUnit') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AverageEnergiesAverageEnergyHasByUnit +end function AverageEnergiesAverageEnergyHasByUnit + +!! Get, by unit, const +function AverageEnergiesAverageEnergyGetByUnitConst(handle, meta, metaSize) & + bind(C, name='AverageEnergiesAverageEnergyGetByUnitConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AverageEnergiesAverageEnergyGetByUnitConst +end function AverageEnergiesAverageEnergyGetByUnitConst + +!! Get, by unit, non-const +function AverageEnergiesAverageEnergyGetByUnit(handle, meta, metaSize) & + bind(C, name='AverageEnergiesAverageEnergyGetByUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AverageEnergiesAverageEnergyGetByUnit +end function AverageEnergiesAverageEnergyGetByUnit + +!! Set, by unit +subroutine AverageEnergiesAverageEnergySetByUnit(handle, meta, metaSize, fieldHandle) & + bind(C, name='AverageEnergiesAverageEnergySetByUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AverageEnergiesAverageEnergySetByUnit + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAverageEnergies diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageEnergy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageEnergy.f03 new file mode 100644 index 000000000..c9cc996bc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageEnergy.f03 @@ -0,0 +1,294 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAverageEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AverageEnergyDefaultConst() & + bind(C, name='AverageEnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AverageEnergyDefaultConst +end function AverageEnergyDefaultConst + +!! Create, default, non-const +function AverageEnergyDefault() & + bind(C, name='AverageEnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AverageEnergyDefault +end function AverageEnergyDefault + +!! Create, general, const +function AverageEnergyCreateConst( & + label, & + value, & + unit, & + uncertainty, & + labelSize, & + unitSize & +) & + bind(C, name='AverageEnergyCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: AverageEnergyCreateConst +end function AverageEnergyCreateConst + +!! Create, general, non-const +function AverageEnergyCreate( & + label, & + value, & + unit, & + uncertainty, & + labelSize, & + unitSize & +) & + bind(C, name='AverageEnergyCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: AverageEnergyCreate +end function AverageEnergyCreate + +!! Assign +subroutine AverageEnergyAssign(handleLHS, handleRHS) & + bind(C, name='AverageEnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AverageEnergyAssign + +!! Delete +subroutine AverageEnergyDelete(handle) & + bind(C, name='AverageEnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AverageEnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AverageEnergyRead(handle, filename, filenameSize) & + bind(C, name='AverageEnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AverageEnergyRead +end function AverageEnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AverageEnergyWrite(handle, filename, filenameSize) & + bind(C, name='AverageEnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AverageEnergyWrite +end function AverageEnergyWrite + +!! Print to standard output, in our prettyprinting format +function AverageEnergyPrint(handle) & + bind(C, name='AverageEnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageEnergyPrint +end function AverageEnergyPrint + +!! Print to standard output, as XML +function AverageEnergyPrintXML(handle) & + bind(C, name='AverageEnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageEnergyPrintXML +end function AverageEnergyPrintXML + +!! Print to standard output, as JSON +function AverageEnergyPrintJSON(handle) & + bind(C, name='AverageEnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageEnergyPrintJSON +end function AverageEnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function AverageEnergyLabelHas(handle) & + bind(C, name='AverageEnergyLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageEnergyLabelHas +end function AverageEnergyLabelHas + +!! Get +function AverageEnergyLabelGet(handle) & + bind(C, name='AverageEnergyLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AverageEnergyLabelGet +end function AverageEnergyLabelGet + +!! Set +subroutine AverageEnergyLabelSet(handle, label, labelSize) & + bind(C, name='AverageEnergyLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine AverageEnergyLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function AverageEnergyValueHas(handle) & + bind(C, name='AverageEnergyValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageEnergyValueHas +end function AverageEnergyValueHas + +!! Get +function AverageEnergyValueGet(handle) & + bind(C, name='AverageEnergyValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: AverageEnergyValueGet +end function AverageEnergyValueGet + +!! Set +subroutine AverageEnergyValueSet(handle, value) & + bind(C, name='AverageEnergyValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine AverageEnergyValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function AverageEnergyUnitHas(handle) & + bind(C, name='AverageEnergyUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageEnergyUnitHas +end function AverageEnergyUnitHas + +!! Get +function AverageEnergyUnitGet(handle) & + bind(C, name='AverageEnergyUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AverageEnergyUnitGet +end function AverageEnergyUnitGet + +!! Set +subroutine AverageEnergyUnitSet(handle, unit, unitSize) & + bind(C, name='AverageEnergyUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine AverageEnergyUnitSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function AverageEnergyUncertaintyHas(handle) & + bind(C, name='AverageEnergyUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageEnergyUncertaintyHas +end function AverageEnergyUncertaintyHas + +!! Get, const +function AverageEnergyUncertaintyGetConst(handle) & + bind(C, name='AverageEnergyUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AverageEnergyUncertaintyGetConst +end function AverageEnergyUncertaintyGetConst + +!! Get, non-const +function AverageEnergyUncertaintyGet(handle) & + bind(C, name='AverageEnergyUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AverageEnergyUncertaintyGet +end function AverageEnergyUncertaintyGet + +!! Set +subroutine AverageEnergyUncertaintySet(handle, fieldHandle) & + bind(C, name='AverageEnergyUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AverageEnergyUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAverageEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageParameterCovariance.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageParameterCovariance.f03 new file mode 100644 index 000000000..66bd09ca8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageParameterCovariance.f03 @@ -0,0 +1,343 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAverageParameterCovariance +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AverageParameterCovarianceDefaultConst() & + bind(C, name='AverageParameterCovarianceDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AverageParameterCovarianceDefaultConst +end function AverageParameterCovarianceDefaultConst + +!! Create, default, non-const +function AverageParameterCovarianceDefault() & + bind(C, name='AverageParameterCovarianceDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AverageParameterCovarianceDefault +end function AverageParameterCovarianceDefault + +!! Create, general, const +function AverageParameterCovarianceCreateConst( & + label, & + crossTerm, & + covarianceMatrix, & + rowData, & + columnData, & + labelSize & +) & + bind(C, name='AverageParameterCovarianceCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + logical(c_bool), intent(in), value :: crossTerm + type(c_ptr), intent(in), value :: covarianceMatrix + type(c_ptr), intent(in), value :: rowData + type(c_ptr), intent(in), value :: columnData + type(c_ptr) :: AverageParameterCovarianceCreateConst +end function AverageParameterCovarianceCreateConst + +!! Create, general, non-const +function AverageParameterCovarianceCreate( & + label, & + crossTerm, & + covarianceMatrix, & + rowData, & + columnData, & + labelSize & +) & + bind(C, name='AverageParameterCovarianceCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + logical(c_bool), intent(in), value :: crossTerm + type(c_ptr), intent(in), value :: covarianceMatrix + type(c_ptr), intent(in), value :: rowData + type(c_ptr), intent(in), value :: columnData + type(c_ptr) :: AverageParameterCovarianceCreate +end function AverageParameterCovarianceCreate + +!! Assign +subroutine AverageParameterCovarianceAssign(handleLHS, handleRHS) & + bind(C, name='AverageParameterCovarianceAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AverageParameterCovarianceAssign + +!! Delete +subroutine AverageParameterCovarianceDelete(handle) & + bind(C, name='AverageParameterCovarianceDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AverageParameterCovarianceDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AverageParameterCovarianceRead(handle, filename, filenameSize) & + bind(C, name='AverageParameterCovarianceRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AverageParameterCovarianceRead +end function AverageParameterCovarianceRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AverageParameterCovarianceWrite(handle, filename, filenameSize) & + bind(C, name='AverageParameterCovarianceWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AverageParameterCovarianceWrite +end function AverageParameterCovarianceWrite + +!! Print to standard output, in our prettyprinting format +function AverageParameterCovariancePrint(handle) & + bind(C, name='AverageParameterCovariancePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageParameterCovariancePrint +end function AverageParameterCovariancePrint + +!! Print to standard output, as XML +function AverageParameterCovariancePrintXML(handle) & + bind(C, name='AverageParameterCovariancePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageParameterCovariancePrintXML +end function AverageParameterCovariancePrintXML + +!! Print to standard output, as JSON +function AverageParameterCovariancePrintJSON(handle) & + bind(C, name='AverageParameterCovariancePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageParameterCovariancePrintJSON +end function AverageParameterCovariancePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function AverageParameterCovarianceLabelHas(handle) & + bind(C, name='AverageParameterCovarianceLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageParameterCovarianceLabelHas +end function AverageParameterCovarianceLabelHas + +!! Get +function AverageParameterCovarianceLabelGet(handle) & + bind(C, name='AverageParameterCovarianceLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AverageParameterCovarianceLabelGet +end function AverageParameterCovarianceLabelGet + +!! Set +subroutine AverageParameterCovarianceLabelSet(handle, label, labelSize) & + bind(C, name='AverageParameterCovarianceLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine AverageParameterCovarianceLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: crossTerm +!! ----------------------------------------------------------------------------- + +!! Has +function AverageParameterCovarianceCrossTermHas(handle) & + bind(C, name='AverageParameterCovarianceCrossTermHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageParameterCovarianceCrossTermHas +end function AverageParameterCovarianceCrossTermHas + +!! Get +function AverageParameterCovarianceCrossTermGet(handle) & + bind(C, name='AverageParameterCovarianceCrossTermGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: AverageParameterCovarianceCrossTermGet +end function AverageParameterCovarianceCrossTermGet + +!! Set +subroutine AverageParameterCovarianceCrossTermSet(handle, crossTerm) & + bind(C, name='AverageParameterCovarianceCrossTermSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: crossTerm +end subroutine AverageParameterCovarianceCrossTermSet + + +!! ----------------------------------------------------------------------------- +!! Child: covarianceMatrix +!! ----------------------------------------------------------------------------- + +!! Has +function AverageParameterCovarianceCovarianceMatrixHas(handle) & + bind(C, name='AverageParameterCovarianceCovarianceMatrixHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageParameterCovarianceCovarianceMatrixHas +end function AverageParameterCovarianceCovarianceMatrixHas + +!! Get, const +function AverageParameterCovarianceCovarianceMatrixGetConst(handle) & + bind(C, name='AverageParameterCovarianceCovarianceMatrixGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AverageParameterCovarianceCovarianceMatrixGetConst +end function AverageParameterCovarianceCovarianceMatrixGetConst + +!! Get, non-const +function AverageParameterCovarianceCovarianceMatrixGet(handle) & + bind(C, name='AverageParameterCovarianceCovarianceMatrixGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AverageParameterCovarianceCovarianceMatrixGet +end function AverageParameterCovarianceCovarianceMatrixGet + +!! Set +subroutine AverageParameterCovarianceCovarianceMatrixSet(handle, fieldHandle) & + bind(C, name='AverageParameterCovarianceCovarianceMatrixSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AverageParameterCovarianceCovarianceMatrixSet + + +!! ----------------------------------------------------------------------------- +!! Child: rowData +!! ----------------------------------------------------------------------------- + +!! Has +function AverageParameterCovarianceRowDataHas(handle) & + bind(C, name='AverageParameterCovarianceRowDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageParameterCovarianceRowDataHas +end function AverageParameterCovarianceRowDataHas + +!! Get, const +function AverageParameterCovarianceRowDataGetConst(handle) & + bind(C, name='AverageParameterCovarianceRowDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AverageParameterCovarianceRowDataGetConst +end function AverageParameterCovarianceRowDataGetConst + +!! Get, non-const +function AverageParameterCovarianceRowDataGet(handle) & + bind(C, name='AverageParameterCovarianceRowDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AverageParameterCovarianceRowDataGet +end function AverageParameterCovarianceRowDataGet + +!! Set +subroutine AverageParameterCovarianceRowDataSet(handle, fieldHandle) & + bind(C, name='AverageParameterCovarianceRowDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AverageParameterCovarianceRowDataSet + + +!! ----------------------------------------------------------------------------- +!! Child: columnData +!! ----------------------------------------------------------------------------- + +!! Has +function AverageParameterCovarianceColumnDataHas(handle) & + bind(C, name='AverageParameterCovarianceColumnDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageParameterCovarianceColumnDataHas +end function AverageParameterCovarianceColumnDataHas + +!! Get, const +function AverageParameterCovarianceColumnDataGetConst(handle) & + bind(C, name='AverageParameterCovarianceColumnDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AverageParameterCovarianceColumnDataGetConst +end function AverageParameterCovarianceColumnDataGetConst + +!! Get, non-const +function AverageParameterCovarianceColumnDataGet(handle) & + bind(C, name='AverageParameterCovarianceColumnDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AverageParameterCovarianceColumnDataGet +end function AverageParameterCovarianceColumnDataGet + +!! Set +subroutine AverageParameterCovarianceColumnDataSet(handle, fieldHandle) & + bind(C, name='AverageParameterCovarianceColumnDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AverageParameterCovarianceColumnDataSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAverageParameterCovariance diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageProductEnergy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageProductEnergy.f03 new file mode 100644 index 000000000..252338383 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/AverageProductEnergy.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAverageProductEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AverageProductEnergyDefaultConst() & + bind(C, name='AverageProductEnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AverageProductEnergyDefaultConst +end function AverageProductEnergyDefaultConst + +!! Create, default, non-const +function AverageProductEnergyDefault() & + bind(C, name='AverageProductEnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AverageProductEnergyDefault +end function AverageProductEnergyDefault + +!! Create, general, const +function AverageProductEnergyCreateConst( & + XYs1d & +) & + bind(C, name='AverageProductEnergyCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: AverageProductEnergyCreateConst +end function AverageProductEnergyCreateConst + +!! Create, general, non-const +function AverageProductEnergyCreate( & + XYs1d & +) & + bind(C, name='AverageProductEnergyCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: AverageProductEnergyCreate +end function AverageProductEnergyCreate + +!! Assign +subroutine AverageProductEnergyAssign(handleLHS, handleRHS) & + bind(C, name='AverageProductEnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AverageProductEnergyAssign + +!! Delete +subroutine AverageProductEnergyDelete(handle) & + bind(C, name='AverageProductEnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AverageProductEnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AverageProductEnergyRead(handle, filename, filenameSize) & + bind(C, name='AverageProductEnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AverageProductEnergyRead +end function AverageProductEnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AverageProductEnergyWrite(handle, filename, filenameSize) & + bind(C, name='AverageProductEnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AverageProductEnergyWrite +end function AverageProductEnergyWrite + +!! Print to standard output, in our prettyprinting format +function AverageProductEnergyPrint(handle) & + bind(C, name='AverageProductEnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageProductEnergyPrint +end function AverageProductEnergyPrint + +!! Print to standard output, as XML +function AverageProductEnergyPrintXML(handle) & + bind(C, name='AverageProductEnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageProductEnergyPrintXML +end function AverageProductEnergyPrintXML + +!! Print to standard output, as JSON +function AverageProductEnergyPrintJSON(handle) & + bind(C, name='AverageProductEnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageProductEnergyPrintJSON +end function AverageProductEnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function AverageProductEnergyXYs1dHas(handle) & + bind(C, name='AverageProductEnergyXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AverageProductEnergyXYs1dHas +end function AverageProductEnergyXYs1dHas + +!! Get, const +function AverageProductEnergyXYs1dGetConst(handle) & + bind(C, name='AverageProductEnergyXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AverageProductEnergyXYs1dGetConst +end function AverageProductEnergyXYs1dGetConst + +!! Get, non-const +function AverageProductEnergyXYs1dGet(handle) & + bind(C, name='AverageProductEnergyXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: AverageProductEnergyXYs1dGet +end function AverageProductEnergyXYs1dGet + +!! Set +subroutine AverageProductEnergyXYs1dSet(handle, fieldHandle) & + bind(C, name='AverageProductEnergyXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AverageProductEnergyXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAverageProductEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Axes.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Axes.f03 new file mode 100644 index 000000000..3592f24ae --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Axes.f03 @@ -0,0 +1,659 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAxes +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AxesDefaultConst() & + bind(C, name='AxesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AxesDefaultConst +end function AxesDefaultConst + +!! Create, default, non-const +function AxesDefault() & + bind(C, name='AxesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AxesDefault +end function AxesDefault + +!! Create, general, const +function AxesCreateConst( & + axis, axisSize, & + grid, gridSize & +) & + bind(C, name='AxesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: axisSize + type(c_ptr), intent(in) :: axis(axisSize) + integer(c_size_t), intent(in), value :: gridSize + type(c_ptr), intent(in) :: grid(gridSize) + type(c_ptr) :: AxesCreateConst +end function AxesCreateConst + +!! Create, general, non-const +function AxesCreate( & + axis, axisSize, & + grid, gridSize & +) & + bind(C, name='AxesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: axisSize + type(c_ptr), intent(in) :: axis(axisSize) + integer(c_size_t), intent(in), value :: gridSize + type(c_ptr), intent(in) :: grid(gridSize) + type(c_ptr) :: AxesCreate +end function AxesCreate + +!! Assign +subroutine AxesAssign(handleLHS, handleRHS) & + bind(C, name='AxesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AxesAssign + +!! Delete +subroutine AxesDelete(handle) & + bind(C, name='AxesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AxesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AxesRead(handle, filename, filenameSize) & + bind(C, name='AxesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AxesRead +end function AxesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AxesWrite(handle, filename, filenameSize) & + bind(C, name='AxesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AxesWrite +end function AxesWrite + +!! Print to standard output, in our prettyprinting format +function AxesPrint(handle) & + bind(C, name='AxesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxesPrint +end function AxesPrint + +!! Print to standard output, as XML +function AxesPrintXML(handle) & + bind(C, name='AxesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxesPrintXML +end function AxesPrintXML + +!! Print to standard output, as JSON +function AxesPrintJSON(handle) & + bind(C, name='AxesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxesPrintJSON +end function AxesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: axis +!! ----------------------------------------------------------------------------- + +!! Has +function AxesAxisHas(handle) & + bind(C, name='AxesAxisHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxesAxisHas +end function AxesAxisHas + +!! Clear +subroutine AxesAxisClear(handle) & + bind(C, name='AxesAxisClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AxesAxisClear + +!! Size +function AxesAxisSize(handle) & + bind(C, name='AxesAxisSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: AxesAxisSize +end function AxesAxisSize + +!! Add +subroutine AxesAxisAdd(handle, fieldHandle) & + bind(C, name='AxesAxisAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesAxisAdd + +!! Get, by index \in [0,size), const +function AxesAxisGetConst(handle, index) & + bind(C, name='AxesAxisGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AxesAxisGetConst +end function AxesAxisGetConst + +!! Get, by index \in [0,size), non-const +function AxesAxisGet(handle, index) & + bind(C, name='AxesAxisGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AxesAxisGet +end function AxesAxisGet + +!! Set, by index \in [0,size) +subroutine AxesAxisSet(handle, index, fieldHandle) & + bind(C, name='AxesAxisSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesAxisSet + +!! ------------------------ +!! Re: metadatum index +!! ------------------------ + +!! Has, by index +function AxesAxisHasByIndex(handle, meta) & + bind(C, name='AxesAxisHasByIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: AxesAxisHasByIndex +end function AxesAxisHasByIndex + +!! Get, by index, const +function AxesAxisGetByIndexConst(handle, meta) & + bind(C, name='AxesAxisGetByIndexConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: AxesAxisGetByIndexConst +end function AxesAxisGetByIndexConst + +!! Get, by index, non-const +function AxesAxisGetByIndex(handle, meta) & + bind(C, name='AxesAxisGetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: AxesAxisGetByIndex +end function AxesAxisGetByIndex + +!! Set, by index +subroutine AxesAxisSetByIndex(handle, meta, fieldHandle) & + bind(C, name='AxesAxisSetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesAxisSetByIndex + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function AxesAxisHasByLabel(handle, meta, metaSize) & + bind(C, name='AxesAxisHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AxesAxisHasByLabel +end function AxesAxisHasByLabel + +!! Get, by label, const +function AxesAxisGetByLabelConst(handle, meta, metaSize) & + bind(C, name='AxesAxisGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesAxisGetByLabelConst +end function AxesAxisGetByLabelConst + +!! Get, by label, non-const +function AxesAxisGetByLabel(handle, meta, metaSize) & + bind(C, name='AxesAxisGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesAxisGetByLabel +end function AxesAxisGetByLabel + +!! Set, by label +subroutine AxesAxisSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='AxesAxisSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesAxisSetByLabel + +!! ------------------------ +!! Re: metadatum unit +!! ------------------------ + +!! Has, by unit +function AxesAxisHasByUnit(handle, meta, metaSize) & + bind(C, name='AxesAxisHasByUnit') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AxesAxisHasByUnit +end function AxesAxisHasByUnit + +!! Get, by unit, const +function AxesAxisGetByUnitConst(handle, meta, metaSize) & + bind(C, name='AxesAxisGetByUnitConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesAxisGetByUnitConst +end function AxesAxisGetByUnitConst + +!! Get, by unit, non-const +function AxesAxisGetByUnit(handle, meta, metaSize) & + bind(C, name='AxesAxisGetByUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesAxisGetByUnit +end function AxesAxisGetByUnit + +!! Set, by unit +subroutine AxesAxisSetByUnit(handle, meta, metaSize, fieldHandle) & + bind(C, name='AxesAxisSetByUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesAxisSetByUnit + + +!! ----------------------------------------------------------------------------- +!! Child: grid +!! ----------------------------------------------------------------------------- + +!! Has +function AxesGridHas(handle) & + bind(C, name='AxesGridHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxesGridHas +end function AxesGridHas + +!! Clear +subroutine AxesGridClear(handle) & + bind(C, name='AxesGridClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AxesGridClear + +!! Size +function AxesGridSize(handle) & + bind(C, name='AxesGridSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: AxesGridSize +end function AxesGridSize + +!! Add +subroutine AxesGridAdd(handle, fieldHandle) & + bind(C, name='AxesGridAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesGridAdd + +!! Get, by index \in [0,size), const +function AxesGridGetConst(handle, index) & + bind(C, name='AxesGridGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AxesGridGetConst +end function AxesGridGetConst + +!! Get, by index \in [0,size), non-const +function AxesGridGet(handle, index) & + bind(C, name='AxesGridGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: AxesGridGet +end function AxesGridGet + +!! Set, by index \in [0,size) +subroutine AxesGridSet(handle, index, fieldHandle) & + bind(C, name='AxesGridSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesGridSet + +!! ------------------------ +!! Re: metadatum index +!! ------------------------ + +!! Has, by index +function AxesGridHasByIndex(handle, meta) & + bind(C, name='AxesGridHasByIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: AxesGridHasByIndex +end function AxesGridHasByIndex + +!! Get, by index, const +function AxesGridGetByIndexConst(handle, meta) & + bind(C, name='AxesGridGetByIndexConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: AxesGridGetByIndexConst +end function AxesGridGetByIndexConst + +!! Get, by index, non-const +function AxesGridGetByIndex(handle, meta) & + bind(C, name='AxesGridGetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: AxesGridGetByIndex +end function AxesGridGetByIndex + +!! Set, by index +subroutine AxesGridSetByIndex(handle, meta, fieldHandle) & + bind(C, name='AxesGridSetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesGridSetByIndex + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function AxesGridHasByLabel(handle, meta, metaSize) & + bind(C, name='AxesGridHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AxesGridHasByLabel +end function AxesGridHasByLabel + +!! Get, by label, const +function AxesGridGetByLabelConst(handle, meta, metaSize) & + bind(C, name='AxesGridGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesGridGetByLabelConst +end function AxesGridGetByLabelConst + +!! Get, by label, non-const +function AxesGridGetByLabel(handle, meta, metaSize) & + bind(C, name='AxesGridGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesGridGetByLabel +end function AxesGridGetByLabel + +!! Set, by label +subroutine AxesGridSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='AxesGridSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesGridSetByLabel + +!! ------------------------ +!! Re: metadatum unit +!! ------------------------ + +!! Has, by unit +function AxesGridHasByUnit(handle, meta, metaSize) & + bind(C, name='AxesGridHasByUnit') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AxesGridHasByUnit +end function AxesGridHasByUnit + +!! Get, by unit, const +function AxesGridGetByUnitConst(handle, meta, metaSize) & + bind(C, name='AxesGridGetByUnitConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesGridGetByUnitConst +end function AxesGridGetByUnitConst + +!! Get, by unit, non-const +function AxesGridGetByUnit(handle, meta, metaSize) & + bind(C, name='AxesGridGetByUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesGridGetByUnit +end function AxesGridGetByUnit + +!! Set, by unit +subroutine AxesGridSetByUnit(handle, meta, metaSize, fieldHandle) & + bind(C, name='AxesGridSetByUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesGridSetByUnit + +!! ------------------------ +!! Re: metadatum style +!! ------------------------ + +!! Has, by style +function AxesGridHasByStyle(handle, meta, metaSize) & + bind(C, name='AxesGridHasByStyle') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AxesGridHasByStyle +end function AxesGridHasByStyle + +!! Get, by style, const +function AxesGridGetByStyleConst(handle, meta, metaSize) & + bind(C, name='AxesGridGetByStyleConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesGridGetByStyleConst +end function AxesGridGetByStyleConst + +!! Get, by style, non-const +function AxesGridGetByStyle(handle, meta, metaSize) & + bind(C, name='AxesGridGetByStyle') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesGridGetByStyle +end function AxesGridGetByStyle + +!! Set, by style +subroutine AxesGridSetByStyle(handle, meta, metaSize, fieldHandle) & + bind(C, name='AxesGridSetByStyle') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesGridSetByStyle + +!! ------------------------ +!! Re: metadatum interpolation +!! ------------------------ + +!! Has, by interpolation +function AxesGridHasByInterpolation(handle, meta, metaSize) & + bind(C, name='AxesGridHasByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: AxesGridHasByInterpolation +end function AxesGridHasByInterpolation + +!! Get, by interpolation, const +function AxesGridGetByInterpolationConst(handle, meta, metaSize) & + bind(C, name='AxesGridGetByInterpolationConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesGridGetByInterpolationConst +end function AxesGridGetByInterpolationConst + +!! Get, by interpolation, non-const +function AxesGridGetByInterpolation(handle, meta, metaSize) & + bind(C, name='AxesGridGetByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: AxesGridGetByInterpolation +end function AxesGridGetByInterpolation + +!! Set, by interpolation +subroutine AxesGridSetByInterpolation(handle, meta, metaSize, fieldHandle) & + bind(C, name='AxesGridSetByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine AxesGridSetByInterpolation + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAxes diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Axis.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Axis.f03 new file mode 100644 index 000000000..aa480587c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Axis.f03 @@ -0,0 +1,249 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalAxis +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function AxisDefaultConst() & + bind(C, name='AxisDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: AxisDefaultConst +end function AxisDefaultConst + +!! Create, default, non-const +function AxisDefault() & + bind(C, name='AxisDefault') + use iso_c_binding + implicit none + type(c_ptr) :: AxisDefault +end function AxisDefault + +!! Create, general, const +function AxisCreateConst( & + index, & + label, & + unit, & + labelSize, & + unitSize & +) & + bind(C, name='AxisCreateConst') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: AxisCreateConst +end function AxisCreateConst + +!! Create, general, non-const +function AxisCreate( & + index, & + label, & + unit, & + labelSize, & + unitSize & +) & + bind(C, name='AxisCreate') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: AxisCreate +end function AxisCreate + +!! Assign +subroutine AxisAssign(handleLHS, handleRHS) & + bind(C, name='AxisAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine AxisAssign + +!! Delete +subroutine AxisDelete(handle) & + bind(C, name='AxisDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine AxisDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function AxisRead(handle, filename, filenameSize) & + bind(C, name='AxisRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AxisRead +end function AxisRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function AxisWrite(handle, filename, filenameSize) & + bind(C, name='AxisWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: AxisWrite +end function AxisWrite + +!! Print to standard output, in our prettyprinting format +function AxisPrint(handle) & + bind(C, name='AxisPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisPrint +end function AxisPrint + +!! Print to standard output, as XML +function AxisPrintXML(handle) & + bind(C, name='AxisPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisPrintXML +end function AxisPrintXML + +!! Print to standard output, as JSON +function AxisPrintJSON(handle) & + bind(C, name='AxisPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisPrintJSON +end function AxisPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: index +!! ----------------------------------------------------------------------------- + +!! Has +function AxisIndexHas(handle) & + bind(C, name='AxisIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisIndexHas +end function AxisIndexHas + +!! Get +function AxisIndexGet(handle) & + bind(C, name='AxisIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisIndexGet +end function AxisIndexGet + +!! Set +subroutine AxisIndexSet(handle, index) & + bind(C, name='AxisIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: index +end subroutine AxisIndexSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function AxisLabelHas(handle) & + bind(C, name='AxisLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisLabelHas +end function AxisLabelHas + +!! Get +function AxisLabelGet(handle) & + bind(C, name='AxisLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AxisLabelGet +end function AxisLabelGet + +!! Set +subroutine AxisLabelSet(handle, label, labelSize) & + bind(C, name='AxisLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine AxisLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function AxisUnitHas(handle) & + bind(C, name='AxisUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: AxisUnitHas +end function AxisUnitHas + +!! Get +function AxisUnitGet(handle) & + bind(C, name='AxisUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: AxisUnitGet +end function AxisUnitGet + +!! Set +subroutine AxisUnitSet(handle, unit, unitSize) & + bind(C, name='AxisUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine AxisUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalAxis diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Background.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Background.f03 new file mode 100644 index 000000000..33d19799f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Background.f03 @@ -0,0 +1,266 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalBackground +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function BackgroundDefaultConst() & + bind(C, name='BackgroundDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: BackgroundDefaultConst +end function BackgroundDefaultConst + +!! Create, default, non-const +function BackgroundDefault() & + bind(C, name='BackgroundDefault') + use iso_c_binding + implicit none + type(c_ptr) :: BackgroundDefault +end function BackgroundDefault + +!! Create, general, const +function BackgroundCreateConst( & + resolvedRegion, & + fastRegion, & + unresolvedRegion & +) & + bind(C, name='BackgroundCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: resolvedRegion + type(c_ptr), intent(in), value :: fastRegion + type(c_ptr), intent(in), value :: unresolvedRegion + type(c_ptr) :: BackgroundCreateConst +end function BackgroundCreateConst + +!! Create, general, non-const +function BackgroundCreate( & + resolvedRegion, & + fastRegion, & + unresolvedRegion & +) & + bind(C, name='BackgroundCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: resolvedRegion + type(c_ptr), intent(in), value :: fastRegion + type(c_ptr), intent(in), value :: unresolvedRegion + type(c_ptr) :: BackgroundCreate +end function BackgroundCreate + +!! Assign +subroutine BackgroundAssign(handleLHS, handleRHS) & + bind(C, name='BackgroundAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine BackgroundAssign + +!! Delete +subroutine BackgroundDelete(handle) & + bind(C, name='BackgroundDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine BackgroundDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function BackgroundRead(handle, filename, filenameSize) & + bind(C, name='BackgroundRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BackgroundRead +end function BackgroundRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function BackgroundWrite(handle, filename, filenameSize) & + bind(C, name='BackgroundWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BackgroundWrite +end function BackgroundWrite + +!! Print to standard output, in our prettyprinting format +function BackgroundPrint(handle) & + bind(C, name='BackgroundPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BackgroundPrint +end function BackgroundPrint + +!! Print to standard output, as XML +function BackgroundPrintXML(handle) & + bind(C, name='BackgroundPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BackgroundPrintXML +end function BackgroundPrintXML + +!! Print to standard output, as JSON +function BackgroundPrintJSON(handle) & + bind(C, name='BackgroundPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BackgroundPrintJSON +end function BackgroundPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: resolvedRegion +!! ----------------------------------------------------------------------------- + +!! Has +function BackgroundResolvedRegionHas(handle) & + bind(C, name='BackgroundResolvedRegionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BackgroundResolvedRegionHas +end function BackgroundResolvedRegionHas + +!! Get, const +function BackgroundResolvedRegionGetConst(handle) & + bind(C, name='BackgroundResolvedRegionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BackgroundResolvedRegionGetConst +end function BackgroundResolvedRegionGetConst + +!! Get, non-const +function BackgroundResolvedRegionGet(handle) & + bind(C, name='BackgroundResolvedRegionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BackgroundResolvedRegionGet +end function BackgroundResolvedRegionGet + +!! Set +subroutine BackgroundResolvedRegionSet(handle, fieldHandle) & + bind(C, name='BackgroundResolvedRegionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BackgroundResolvedRegionSet + + +!! ----------------------------------------------------------------------------- +!! Child: fastRegion +!! ----------------------------------------------------------------------------- + +!! Has +function BackgroundFastRegionHas(handle) & + bind(C, name='BackgroundFastRegionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BackgroundFastRegionHas +end function BackgroundFastRegionHas + +!! Get, const +function BackgroundFastRegionGetConst(handle) & + bind(C, name='BackgroundFastRegionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BackgroundFastRegionGetConst +end function BackgroundFastRegionGetConst + +!! Get, non-const +function BackgroundFastRegionGet(handle) & + bind(C, name='BackgroundFastRegionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BackgroundFastRegionGet +end function BackgroundFastRegionGet + +!! Set +subroutine BackgroundFastRegionSet(handle, fieldHandle) & + bind(C, name='BackgroundFastRegionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BackgroundFastRegionSet + + +!! ----------------------------------------------------------------------------- +!! Child: unresolvedRegion +!! ----------------------------------------------------------------------------- + +!! Has +function BackgroundUnresolvedRegionHas(handle) & + bind(C, name='BackgroundUnresolvedRegionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BackgroundUnresolvedRegionHas +end function BackgroundUnresolvedRegionHas + +!! Get, const +function BackgroundUnresolvedRegionGetConst(handle) & + bind(C, name='BackgroundUnresolvedRegionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BackgroundUnresolvedRegionGetConst +end function BackgroundUnresolvedRegionGetConst + +!! Get, non-const +function BackgroundUnresolvedRegionGet(handle) & + bind(C, name='BackgroundUnresolvedRegionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BackgroundUnresolvedRegionGet +end function BackgroundUnresolvedRegionGet + +!! Set +subroutine BackgroundUnresolvedRegionSet(handle, fieldHandle) & + bind(C, name='BackgroundUnresolvedRegionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BackgroundUnresolvedRegionSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalBackground diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Baryon.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Baryon.f03 new file mode 100644 index 000000000..0f85bfe9f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Baryon.f03 @@ -0,0 +1,442 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalBaryon +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function BaryonDefaultConst() & + bind(C, name='BaryonDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: BaryonDefaultConst +end function BaryonDefaultConst + +!! Create, default, non-const +function BaryonDefault() & + bind(C, name='BaryonDefault') + use iso_c_binding + implicit none + type(c_ptr) :: BaryonDefault +end function BaryonDefault + +!! Create, general, const +function BaryonCreateConst( & + id, & + mass, & + spin, & + parity, & + charge, & + halflife, & + decayData, & + idSize & +) & + bind(C, name='BaryonCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: spin + type(c_ptr), intent(in), value :: parity + type(c_ptr), intent(in), value :: charge + type(c_ptr), intent(in), value :: halflife + type(c_ptr), intent(in), value :: decayData + type(c_ptr) :: BaryonCreateConst +end function BaryonCreateConst + +!! Create, general, non-const +function BaryonCreate( & + id, & + mass, & + spin, & + parity, & + charge, & + halflife, & + decayData, & + idSize & +) & + bind(C, name='BaryonCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: spin + type(c_ptr), intent(in), value :: parity + type(c_ptr), intent(in), value :: charge + type(c_ptr), intent(in), value :: halflife + type(c_ptr), intent(in), value :: decayData + type(c_ptr) :: BaryonCreate +end function BaryonCreate + +!! Assign +subroutine BaryonAssign(handleLHS, handleRHS) & + bind(C, name='BaryonAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine BaryonAssign + +!! Delete +subroutine BaryonDelete(handle) & + bind(C, name='BaryonDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine BaryonDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function BaryonRead(handle, filename, filenameSize) & + bind(C, name='BaryonRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BaryonRead +end function BaryonRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function BaryonWrite(handle, filename, filenameSize) & + bind(C, name='BaryonWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BaryonWrite +end function BaryonWrite + +!! Print to standard output, in our prettyprinting format +function BaryonPrint(handle) & + bind(C, name='BaryonPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonPrint +end function BaryonPrint + +!! Print to standard output, as XML +function BaryonPrintXML(handle) & + bind(C, name='BaryonPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonPrintXML +end function BaryonPrintXML + +!! Print to standard output, as JSON +function BaryonPrintJSON(handle) & + bind(C, name='BaryonPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonPrintJSON +end function BaryonPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: id +!! ----------------------------------------------------------------------------- + +!! Has +function BaryonIdHas(handle) & + bind(C, name='BaryonIdHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonIdHas +end function BaryonIdHas + +!! Get +function BaryonIdGet(handle) & + bind(C, name='BaryonIdGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BaryonIdGet +end function BaryonIdGet + +!! Set +subroutine BaryonIdSet(handle, id, idSize) & + bind(C, name='BaryonIdSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) +end subroutine BaryonIdSet + + +!! ----------------------------------------------------------------------------- +!! Child: mass +!! ----------------------------------------------------------------------------- + +!! Has +function BaryonMassHas(handle) & + bind(C, name='BaryonMassHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonMassHas +end function BaryonMassHas + +!! Get, const +function BaryonMassGetConst(handle) & + bind(C, name='BaryonMassGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BaryonMassGetConst +end function BaryonMassGetConst + +!! Get, non-const +function BaryonMassGet(handle) & + bind(C, name='BaryonMassGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BaryonMassGet +end function BaryonMassGet + +!! Set +subroutine BaryonMassSet(handle, fieldHandle) & + bind(C, name='BaryonMassSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BaryonMassSet + + +!! ----------------------------------------------------------------------------- +!! Child: spin +!! ----------------------------------------------------------------------------- + +!! Has +function BaryonSpinHas(handle) & + bind(C, name='BaryonSpinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonSpinHas +end function BaryonSpinHas + +!! Get, const +function BaryonSpinGetConst(handle) & + bind(C, name='BaryonSpinGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BaryonSpinGetConst +end function BaryonSpinGetConst + +!! Get, non-const +function BaryonSpinGet(handle) & + bind(C, name='BaryonSpinGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BaryonSpinGet +end function BaryonSpinGet + +!! Set +subroutine BaryonSpinSet(handle, fieldHandle) & + bind(C, name='BaryonSpinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BaryonSpinSet + + +!! ----------------------------------------------------------------------------- +!! Child: parity +!! ----------------------------------------------------------------------------- + +!! Has +function BaryonParityHas(handle) & + bind(C, name='BaryonParityHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonParityHas +end function BaryonParityHas + +!! Get, const +function BaryonParityGetConst(handle) & + bind(C, name='BaryonParityGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BaryonParityGetConst +end function BaryonParityGetConst + +!! Get, non-const +function BaryonParityGet(handle) & + bind(C, name='BaryonParityGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BaryonParityGet +end function BaryonParityGet + +!! Set +subroutine BaryonParitySet(handle, fieldHandle) & + bind(C, name='BaryonParitySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BaryonParitySet + + +!! ----------------------------------------------------------------------------- +!! Child: charge +!! ----------------------------------------------------------------------------- + +!! Has +function BaryonChargeHas(handle) & + bind(C, name='BaryonChargeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonChargeHas +end function BaryonChargeHas + +!! Get, const +function BaryonChargeGetConst(handle) & + bind(C, name='BaryonChargeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BaryonChargeGetConst +end function BaryonChargeGetConst + +!! Get, non-const +function BaryonChargeGet(handle) & + bind(C, name='BaryonChargeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BaryonChargeGet +end function BaryonChargeGet + +!! Set +subroutine BaryonChargeSet(handle, fieldHandle) & + bind(C, name='BaryonChargeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BaryonChargeSet + + +!! ----------------------------------------------------------------------------- +!! Child: halflife +!! ----------------------------------------------------------------------------- + +!! Has +function BaryonHalflifeHas(handle) & + bind(C, name='BaryonHalflifeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonHalflifeHas +end function BaryonHalflifeHas + +!! Get, const +function BaryonHalflifeGetConst(handle) & + bind(C, name='BaryonHalflifeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BaryonHalflifeGetConst +end function BaryonHalflifeGetConst + +!! Get, non-const +function BaryonHalflifeGet(handle) & + bind(C, name='BaryonHalflifeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BaryonHalflifeGet +end function BaryonHalflifeGet + +!! Set +subroutine BaryonHalflifeSet(handle, fieldHandle) & + bind(C, name='BaryonHalflifeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BaryonHalflifeSet + + +!! ----------------------------------------------------------------------------- +!! Child: decayData +!! ----------------------------------------------------------------------------- + +!! Has +function BaryonDecayDataHas(handle) & + bind(C, name='BaryonDecayDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonDecayDataHas +end function BaryonDecayDataHas + +!! Get, const +function BaryonDecayDataGetConst(handle) & + bind(C, name='BaryonDecayDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BaryonDecayDataGetConst +end function BaryonDecayDataGetConst + +!! Get, non-const +function BaryonDecayDataGet(handle) & + bind(C, name='BaryonDecayDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BaryonDecayDataGet +end function BaryonDecayDataGet + +!! Set +subroutine BaryonDecayDataSet(handle, fieldHandle) & + bind(C, name='BaryonDecayDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BaryonDecayDataSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalBaryon diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Baryons.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Baryons.f03 new file mode 100644 index 000000000..ed3584eec --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Baryons.f03 @@ -0,0 +1,255 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalBaryons +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function BaryonsDefaultConst() & + bind(C, name='BaryonsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: BaryonsDefaultConst +end function BaryonsDefaultConst + +!! Create, default, non-const +function BaryonsDefault() & + bind(C, name='BaryonsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: BaryonsDefault +end function BaryonsDefault + +!! Create, general, const +function BaryonsCreateConst( & + baryon, baryonSize & +) & + bind(C, name='BaryonsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: baryonSize + type(c_ptr), intent(in) :: baryon(baryonSize) + type(c_ptr) :: BaryonsCreateConst +end function BaryonsCreateConst + +!! Create, general, non-const +function BaryonsCreate( & + baryon, baryonSize & +) & + bind(C, name='BaryonsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: baryonSize + type(c_ptr), intent(in) :: baryon(baryonSize) + type(c_ptr) :: BaryonsCreate +end function BaryonsCreate + +!! Assign +subroutine BaryonsAssign(handleLHS, handleRHS) & + bind(C, name='BaryonsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine BaryonsAssign + +!! Delete +subroutine BaryonsDelete(handle) & + bind(C, name='BaryonsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine BaryonsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function BaryonsRead(handle, filename, filenameSize) & + bind(C, name='BaryonsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BaryonsRead +end function BaryonsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function BaryonsWrite(handle, filename, filenameSize) & + bind(C, name='BaryonsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BaryonsWrite +end function BaryonsWrite + +!! Print to standard output, in our prettyprinting format +function BaryonsPrint(handle) & + bind(C, name='BaryonsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonsPrint +end function BaryonsPrint + +!! Print to standard output, as XML +function BaryonsPrintXML(handle) & + bind(C, name='BaryonsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonsPrintXML +end function BaryonsPrintXML + +!! Print to standard output, as JSON +function BaryonsPrintJSON(handle) & + bind(C, name='BaryonsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonsPrintJSON +end function BaryonsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: baryon +!! ----------------------------------------------------------------------------- + +!! Has +function BaryonsBaryonHas(handle) & + bind(C, name='BaryonsBaryonHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BaryonsBaryonHas +end function BaryonsBaryonHas + +!! Clear +subroutine BaryonsBaryonClear(handle) & + bind(C, name='BaryonsBaryonClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine BaryonsBaryonClear + +!! Size +function BaryonsBaryonSize(handle) & + bind(C, name='BaryonsBaryonSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: BaryonsBaryonSize +end function BaryonsBaryonSize + +!! Add +subroutine BaryonsBaryonAdd(handle, fieldHandle) & + bind(C, name='BaryonsBaryonAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BaryonsBaryonAdd + +!! Get, by index \in [0,size), const +function BaryonsBaryonGetConst(handle, index) & + bind(C, name='BaryonsBaryonGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: BaryonsBaryonGetConst +end function BaryonsBaryonGetConst + +!! Get, by index \in [0,size), non-const +function BaryonsBaryonGet(handle, index) & + bind(C, name='BaryonsBaryonGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: BaryonsBaryonGet +end function BaryonsBaryonGet + +!! Set, by index \in [0,size) +subroutine BaryonsBaryonSet(handle, index, fieldHandle) & + bind(C, name='BaryonsBaryonSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BaryonsBaryonSet + +!! ------------------------ +!! Re: metadatum id +!! ------------------------ + +!! Has, by id +function BaryonsBaryonHasById(handle, meta, metaSize) & + bind(C, name='BaryonsBaryonHasById') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: BaryonsBaryonHasById +end function BaryonsBaryonHasById + +!! Get, by id, const +function BaryonsBaryonGetByIdConst(handle, meta, metaSize) & + bind(C, name='BaryonsBaryonGetByIdConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: BaryonsBaryonGetByIdConst +end function BaryonsBaryonGetByIdConst + +!! Get, by id, non-const +function BaryonsBaryonGetById(handle, meta, metaSize) & + bind(C, name='BaryonsBaryonGetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: BaryonsBaryonGetById +end function BaryonsBaryonGetById + +!! Set, by id +subroutine BaryonsBaryonSetById(handle, meta, metaSize, fieldHandle) & + bind(C, name='BaryonsBaryonSetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BaryonsBaryonSetById + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalBaryons diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/BindingEnergy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/BindingEnergy.f03 new file mode 100644 index 000000000..75d41998f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/BindingEnergy.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalBindingEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function BindingEnergyDefaultConst() & + bind(C, name='BindingEnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: BindingEnergyDefaultConst +end function BindingEnergyDefaultConst + +!! Create, default, non-const +function BindingEnergyDefault() & + bind(C, name='BindingEnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: BindingEnergyDefault +end function BindingEnergyDefault + +!! Create, general, const +function BindingEnergyCreateConst( & + Double & +) & + bind(C, name='BindingEnergyCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: BindingEnergyCreateConst +end function BindingEnergyCreateConst + +!! Create, general, non-const +function BindingEnergyCreate( & + Double & +) & + bind(C, name='BindingEnergyCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: BindingEnergyCreate +end function BindingEnergyCreate + +!! Assign +subroutine BindingEnergyAssign(handleLHS, handleRHS) & + bind(C, name='BindingEnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine BindingEnergyAssign + +!! Delete +subroutine BindingEnergyDelete(handle) & + bind(C, name='BindingEnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine BindingEnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function BindingEnergyRead(handle, filename, filenameSize) & + bind(C, name='BindingEnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BindingEnergyRead +end function BindingEnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function BindingEnergyWrite(handle, filename, filenameSize) & + bind(C, name='BindingEnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BindingEnergyWrite +end function BindingEnergyWrite + +!! Print to standard output, in our prettyprinting format +function BindingEnergyPrint(handle) & + bind(C, name='BindingEnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BindingEnergyPrint +end function BindingEnergyPrint + +!! Print to standard output, as XML +function BindingEnergyPrintXML(handle) & + bind(C, name='BindingEnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BindingEnergyPrintXML +end function BindingEnergyPrintXML + +!! Print to standard output, as JSON +function BindingEnergyPrintJSON(handle) & + bind(C, name='BindingEnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BindingEnergyPrintJSON +end function BindingEnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: Double +!! ----------------------------------------------------------------------------- + +!! Has +function BindingEnergyDoubleHas(handle) & + bind(C, name='BindingEnergyDoubleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BindingEnergyDoubleHas +end function BindingEnergyDoubleHas + +!! Get, const +function BindingEnergyDoubleGetConst(handle) & + bind(C, name='BindingEnergyDoubleGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BindingEnergyDoubleGetConst +end function BindingEnergyDoubleGetConst + +!! Get, non-const +function BindingEnergyDoubleGet(handle) & + bind(C, name='BindingEnergyDoubleGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BindingEnergyDoubleGet +end function BindingEnergyDoubleGet + +!! Set +subroutine BindingEnergyDoubleSet(handle, fieldHandle) & + bind(C, name='BindingEnergyDoubleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BindingEnergyDoubleSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalBindingEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Body.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Body.f03 new file mode 100644 index 000000000..5b373b664 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Body.f03 @@ -0,0 +1,131 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalBody +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function BodyDefaultConst() & + bind(C, name='BodyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: BodyDefaultConst +end function BodyDefaultConst + +!! Create, default, non-const +function BodyDefault() & + bind(C, name='BodyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: BodyDefault +end function BodyDefault + +!! Create, general, const +function BodyCreateConst( & +) & + bind(C, name='BodyCreateConst') + use iso_c_binding + implicit none + type(c_ptr) :: BodyCreateConst +end function BodyCreateConst + +!! Create, general, non-const +function BodyCreate( & +) & + bind(C, name='BodyCreate') + use iso_c_binding + implicit none + type(c_ptr) :: BodyCreate +end function BodyCreate + +!! Assign +subroutine BodyAssign(handleLHS, handleRHS) & + bind(C, name='BodyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine BodyAssign + +!! Delete +subroutine BodyDelete(handle) & + bind(C, name='BodyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine BodyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function BodyRead(handle, filename, filenameSize) & + bind(C, name='BodyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BodyRead +end function BodyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function BodyWrite(handle, filename, filenameSize) & + bind(C, name='BodyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BodyWrite +end function BodyWrite + +!! Print to standard output, in our prettyprinting format +function BodyPrint(handle) & + bind(C, name='BodyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BodyPrint +end function BodyPrint + +!! Print to standard output, as XML +function BodyPrintXML(handle) & + bind(C, name='BodyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BodyPrintXML +end function BodyPrintXML + +!! Print to standard output, as JSON +function BodyPrintJSON(handle) & + bind(C, name='BodyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BodyPrintJSON +end function BodyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalBody diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/BoundAtomCrossSection.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/BoundAtomCrossSection.f03 new file mode 100644 index 000000000..7e98fabef --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/BoundAtomCrossSection.f03 @@ -0,0 +1,208 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalBoundAtomCrossSection +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function BoundAtomCrossSectionDefaultConst() & + bind(C, name='BoundAtomCrossSectionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: BoundAtomCrossSectionDefaultConst +end function BoundAtomCrossSectionDefaultConst + +!! Create, default, non-const +function BoundAtomCrossSectionDefault() & + bind(C, name='BoundAtomCrossSectionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: BoundAtomCrossSectionDefault +end function BoundAtomCrossSectionDefault + +!! Create, general, const +function BoundAtomCrossSectionCreateConst( & + value, & + unit, & + unitSize & +) & + bind(C, name='BoundAtomCrossSectionCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: BoundAtomCrossSectionCreateConst +end function BoundAtomCrossSectionCreateConst + +!! Create, general, non-const +function BoundAtomCrossSectionCreate( & + value, & + unit, & + unitSize & +) & + bind(C, name='BoundAtomCrossSectionCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: BoundAtomCrossSectionCreate +end function BoundAtomCrossSectionCreate + +!! Assign +subroutine BoundAtomCrossSectionAssign(handleLHS, handleRHS) & + bind(C, name='BoundAtomCrossSectionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine BoundAtomCrossSectionAssign + +!! Delete +subroutine BoundAtomCrossSectionDelete(handle) & + bind(C, name='BoundAtomCrossSectionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine BoundAtomCrossSectionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function BoundAtomCrossSectionRead(handle, filename, filenameSize) & + bind(C, name='BoundAtomCrossSectionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BoundAtomCrossSectionRead +end function BoundAtomCrossSectionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function BoundAtomCrossSectionWrite(handle, filename, filenameSize) & + bind(C, name='BoundAtomCrossSectionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BoundAtomCrossSectionWrite +end function BoundAtomCrossSectionWrite + +!! Print to standard output, in our prettyprinting format +function BoundAtomCrossSectionPrint(handle) & + bind(C, name='BoundAtomCrossSectionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BoundAtomCrossSectionPrint +end function BoundAtomCrossSectionPrint + +!! Print to standard output, as XML +function BoundAtomCrossSectionPrintXML(handle) & + bind(C, name='BoundAtomCrossSectionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BoundAtomCrossSectionPrintXML +end function BoundAtomCrossSectionPrintXML + +!! Print to standard output, as JSON +function BoundAtomCrossSectionPrintJSON(handle) & + bind(C, name='BoundAtomCrossSectionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BoundAtomCrossSectionPrintJSON +end function BoundAtomCrossSectionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function BoundAtomCrossSectionValueHas(handle) & + bind(C, name='BoundAtomCrossSectionValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BoundAtomCrossSectionValueHas +end function BoundAtomCrossSectionValueHas + +!! Get +function BoundAtomCrossSectionValueGet(handle) & + bind(C, name='BoundAtomCrossSectionValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: BoundAtomCrossSectionValueGet +end function BoundAtomCrossSectionValueGet + +!! Set +subroutine BoundAtomCrossSectionValueSet(handle, value) & + bind(C, name='BoundAtomCrossSectionValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine BoundAtomCrossSectionValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function BoundAtomCrossSectionUnitHas(handle) & + bind(C, name='BoundAtomCrossSectionUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BoundAtomCrossSectionUnitHas +end function BoundAtomCrossSectionUnitHas + +!! Get +function BoundAtomCrossSectionUnitGet(handle) & + bind(C, name='BoundAtomCrossSectionUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BoundAtomCrossSectionUnitGet +end function BoundAtomCrossSectionUnitGet + +!! Set +subroutine BoundAtomCrossSectionUnitSet(handle, unit, unitSize) & + bind(C, name='BoundAtomCrossSectionUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine BoundAtomCrossSectionUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalBoundAtomCrossSection diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Branching1d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Branching1d.f03 new file mode 100644 index 000000000..0931b2696 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Branching1d.f03 @@ -0,0 +1,172 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalBranching1d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Branching1dDefaultConst() & + bind(C, name='Branching1dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Branching1dDefaultConst +end function Branching1dDefaultConst + +!! Create, default, non-const +function Branching1dDefault() & + bind(C, name='Branching1dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Branching1dDefault +end function Branching1dDefault + +!! Create, general, const +function Branching1dCreateConst( & + label, & + labelSize & +) & + bind(C, name='Branching1dCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr) :: Branching1dCreateConst +end function Branching1dCreateConst + +!! Create, general, non-const +function Branching1dCreate( & + label, & + labelSize & +) & + bind(C, name='Branching1dCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr) :: Branching1dCreate +end function Branching1dCreate + +!! Assign +subroutine Branching1dAssign(handleLHS, handleRHS) & + bind(C, name='Branching1dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Branching1dAssign + +!! Delete +subroutine Branching1dDelete(handle) & + bind(C, name='Branching1dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Branching1dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Branching1dRead(handle, filename, filenameSize) & + bind(C, name='Branching1dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Branching1dRead +end function Branching1dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Branching1dWrite(handle, filename, filenameSize) & + bind(C, name='Branching1dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Branching1dWrite +end function Branching1dWrite + +!! Print to standard output, in our prettyprinting format +function Branching1dPrint(handle) & + bind(C, name='Branching1dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Branching1dPrint +end function Branching1dPrint + +!! Print to standard output, as XML +function Branching1dPrintXML(handle) & + bind(C, name='Branching1dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Branching1dPrintXML +end function Branching1dPrintXML + +!! Print to standard output, as JSON +function Branching1dPrintJSON(handle) & + bind(C, name='Branching1dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Branching1dPrintJSON +end function Branching1dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function Branching1dLabelHas(handle) & + bind(C, name='Branching1dLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Branching1dLabelHas +end function Branching1dLabelHas + +!! Get +function Branching1dLabelGet(handle) & + bind(C, name='Branching1dLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Branching1dLabelGet +end function Branching1dLabelGet + +!! Set +subroutine Branching1dLabelSet(handle, label, labelSize) & + bind(C, name='Branching1dLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine Branching1dLabelSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalBranching1d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Branching3d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Branching3d.f03 new file mode 100644 index 000000000..f203f25f0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Branching3d.f03 @@ -0,0 +1,213 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalBranching3d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Branching3dDefaultConst() & + bind(C, name='Branching3dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Branching3dDefaultConst +end function Branching3dDefaultConst + +!! Create, default, non-const +function Branching3dDefault() & + bind(C, name='Branching3dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Branching3dDefault +end function Branching3dDefault + +!! Create, general, const +function Branching3dCreateConst( & + label, & + productFrame, & + labelSize, & + productFrameSize & +) & + bind(C, name='Branching3dCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr) :: Branching3dCreateConst +end function Branching3dCreateConst + +!! Create, general, non-const +function Branching3dCreate( & + label, & + productFrame, & + labelSize, & + productFrameSize & +) & + bind(C, name='Branching3dCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr) :: Branching3dCreate +end function Branching3dCreate + +!! Assign +subroutine Branching3dAssign(handleLHS, handleRHS) & + bind(C, name='Branching3dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Branching3dAssign + +!! Delete +subroutine Branching3dDelete(handle) & + bind(C, name='Branching3dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Branching3dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Branching3dRead(handle, filename, filenameSize) & + bind(C, name='Branching3dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Branching3dRead +end function Branching3dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Branching3dWrite(handle, filename, filenameSize) & + bind(C, name='Branching3dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Branching3dWrite +end function Branching3dWrite + +!! Print to standard output, in our prettyprinting format +function Branching3dPrint(handle) & + bind(C, name='Branching3dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Branching3dPrint +end function Branching3dPrint + +!! Print to standard output, as XML +function Branching3dPrintXML(handle) & + bind(C, name='Branching3dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Branching3dPrintXML +end function Branching3dPrintXML + +!! Print to standard output, as JSON +function Branching3dPrintJSON(handle) & + bind(C, name='Branching3dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Branching3dPrintJSON +end function Branching3dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function Branching3dLabelHas(handle) & + bind(C, name='Branching3dLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Branching3dLabelHas +end function Branching3dLabelHas + +!! Get +function Branching3dLabelGet(handle) & + bind(C, name='Branching3dLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Branching3dLabelGet +end function Branching3dLabelGet + +!! Set +subroutine Branching3dLabelSet(handle, label, labelSize) & + bind(C, name='Branching3dLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine Branching3dLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function Branching3dProductFrameHas(handle) & + bind(C, name='Branching3dProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Branching3dProductFrameHas +end function Branching3dProductFrameHas + +!! Get +function Branching3dProductFrameGet(handle) & + bind(C, name='Branching3dProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Branching3dProductFrameGet +end function Branching3dProductFrameGet + +!! Set +subroutine Branching3dProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='Branching3dProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine Branching3dProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalBranching3d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/BreitWigner.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/BreitWigner.f03 new file mode 100644 index 000000000..da55ccd9f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/BreitWigner.f03 @@ -0,0 +1,384 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalBreitWigner +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function BreitWignerDefaultConst() & + bind(C, name='BreitWignerDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: BreitWignerDefaultConst +end function BreitWignerDefaultConst + +!! Create, default, non-const +function BreitWignerDefault() & + bind(C, name='BreitWignerDefault') + use iso_c_binding + implicit none + type(c_ptr) :: BreitWignerDefault +end function BreitWignerDefault + +!! Create, general, const +function BreitWignerCreateConst( & + label, & + approximation, & + calculateChannelRadius, & + resonanceParameters, & + PoPs, & + scatteringRadius, & + labelSize, & + approximationSize & +) & + bind(C, name='BreitWignerCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: approximationSize + character(c_char), intent(in) :: approximation(approximationSize) + logical(c_bool), intent(in), value :: calculateChannelRadius + type(c_ptr), intent(in), value :: resonanceParameters + type(c_ptr), intent(in), value :: PoPs + type(c_ptr), intent(in), value :: scatteringRadius + type(c_ptr) :: BreitWignerCreateConst +end function BreitWignerCreateConst + +!! Create, general, non-const +function BreitWignerCreate( & + label, & + approximation, & + calculateChannelRadius, & + resonanceParameters, & + PoPs, & + scatteringRadius, & + labelSize, & + approximationSize & +) & + bind(C, name='BreitWignerCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: approximationSize + character(c_char), intent(in) :: approximation(approximationSize) + logical(c_bool), intent(in), value :: calculateChannelRadius + type(c_ptr), intent(in), value :: resonanceParameters + type(c_ptr), intent(in), value :: PoPs + type(c_ptr), intent(in), value :: scatteringRadius + type(c_ptr) :: BreitWignerCreate +end function BreitWignerCreate + +!! Assign +subroutine BreitWignerAssign(handleLHS, handleRHS) & + bind(C, name='BreitWignerAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine BreitWignerAssign + +!! Delete +subroutine BreitWignerDelete(handle) & + bind(C, name='BreitWignerDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine BreitWignerDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function BreitWignerRead(handle, filename, filenameSize) & + bind(C, name='BreitWignerRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BreitWignerRead +end function BreitWignerRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function BreitWignerWrite(handle, filename, filenameSize) & + bind(C, name='BreitWignerWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: BreitWignerWrite +end function BreitWignerWrite + +!! Print to standard output, in our prettyprinting format +function BreitWignerPrint(handle) & + bind(C, name='BreitWignerPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BreitWignerPrint +end function BreitWignerPrint + +!! Print to standard output, as XML +function BreitWignerPrintXML(handle) & + bind(C, name='BreitWignerPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BreitWignerPrintXML +end function BreitWignerPrintXML + +!! Print to standard output, as JSON +function BreitWignerPrintJSON(handle) & + bind(C, name='BreitWignerPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BreitWignerPrintJSON +end function BreitWignerPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function BreitWignerLabelHas(handle) & + bind(C, name='BreitWignerLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BreitWignerLabelHas +end function BreitWignerLabelHas + +!! Get +function BreitWignerLabelGet(handle) & + bind(C, name='BreitWignerLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BreitWignerLabelGet +end function BreitWignerLabelGet + +!! Set +subroutine BreitWignerLabelSet(handle, label, labelSize) & + bind(C, name='BreitWignerLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine BreitWignerLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: approximation +!! ----------------------------------------------------------------------------- + +!! Has +function BreitWignerApproximationHas(handle) & + bind(C, name='BreitWignerApproximationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BreitWignerApproximationHas +end function BreitWignerApproximationHas + +!! Get +function BreitWignerApproximationGet(handle) & + bind(C, name='BreitWignerApproximationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BreitWignerApproximationGet +end function BreitWignerApproximationGet + +!! Set +subroutine BreitWignerApproximationSet(handle, approximation, approximationSize) & + bind(C, name='BreitWignerApproximationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: approximationSize + character(c_char), intent(in) :: approximation(approximationSize) +end subroutine BreitWignerApproximationSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: calculateChannelRadius +!! ----------------------------------------------------------------------------- + +!! Has +function BreitWignerCalculateChannelRadiusHas(handle) & + bind(C, name='BreitWignerCalculateChannelRadiusHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BreitWignerCalculateChannelRadiusHas +end function BreitWignerCalculateChannelRadiusHas + +!! Get +function BreitWignerCalculateChannelRadiusGet(handle) & + bind(C, name='BreitWignerCalculateChannelRadiusGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: BreitWignerCalculateChannelRadiusGet +end function BreitWignerCalculateChannelRadiusGet + +!! Set +subroutine BreitWignerCalculateChannelRadiusSet(handle, calculateChannelRadius) & + bind(C, name='BreitWignerCalculateChannelRadiusSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: calculateChannelRadius +end subroutine BreitWignerCalculateChannelRadiusSet + + +!! ----------------------------------------------------------------------------- +!! Child: resonanceParameters +!! ----------------------------------------------------------------------------- + +!! Has +function BreitWignerResonanceParametersHas(handle) & + bind(C, name='BreitWignerResonanceParametersHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BreitWignerResonanceParametersHas +end function BreitWignerResonanceParametersHas + +!! Get, const +function BreitWignerResonanceParametersGetConst(handle) & + bind(C, name='BreitWignerResonanceParametersGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BreitWignerResonanceParametersGetConst +end function BreitWignerResonanceParametersGetConst + +!! Get, non-const +function BreitWignerResonanceParametersGet(handle) & + bind(C, name='BreitWignerResonanceParametersGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BreitWignerResonanceParametersGet +end function BreitWignerResonanceParametersGet + +!! Set +subroutine BreitWignerResonanceParametersSet(handle, fieldHandle) & + bind(C, name='BreitWignerResonanceParametersSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BreitWignerResonanceParametersSet + + +!! ----------------------------------------------------------------------------- +!! Child: PoPs +!! ----------------------------------------------------------------------------- + +!! Has +function BreitWignerPoPsHas(handle) & + bind(C, name='BreitWignerPoPsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BreitWignerPoPsHas +end function BreitWignerPoPsHas + +!! Get, const +function BreitWignerPoPsGetConst(handle) & + bind(C, name='BreitWignerPoPsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BreitWignerPoPsGetConst +end function BreitWignerPoPsGetConst + +!! Get, non-const +function BreitWignerPoPsGet(handle) & + bind(C, name='BreitWignerPoPsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BreitWignerPoPsGet +end function BreitWignerPoPsGet + +!! Set +subroutine BreitWignerPoPsSet(handle, fieldHandle) & + bind(C, name='BreitWignerPoPsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BreitWignerPoPsSet + + +!! ----------------------------------------------------------------------------- +!! Child: scatteringRadius +!! ----------------------------------------------------------------------------- + +!! Has +function BreitWignerScatteringRadiusHas(handle) & + bind(C, name='BreitWignerScatteringRadiusHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: BreitWignerScatteringRadiusHas +end function BreitWignerScatteringRadiusHas + +!! Get, const +function BreitWignerScatteringRadiusGetConst(handle) & + bind(C, name='BreitWignerScatteringRadiusGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: BreitWignerScatteringRadiusGetConst +end function BreitWignerScatteringRadiusGetConst + +!! Get, non-const +function BreitWignerScatteringRadiusGet(handle) & + bind(C, name='BreitWignerScatteringRadiusGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: BreitWignerScatteringRadiusGet +end function BreitWignerScatteringRadiusGet + +!! Set +subroutine BreitWignerScatteringRadiusSet(handle, fieldHandle) & + bind(C, name='BreitWignerScatteringRadiusSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine BreitWignerScatteringRadiusSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalBreitWigner diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Channel.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Channel.f03 new file mode 100644 index 000000000..013aed101 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Channel.f03 @@ -0,0 +1,411 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalChannel +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ChannelDefaultConst() & + bind(C, name='ChannelDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ChannelDefaultConst +end function ChannelDefaultConst + +!! Create, default, non-const +function ChannelDefault() & + bind(C, name='ChannelDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ChannelDefault +end function ChannelDefault + +!! Create, general, const +function ChannelCreateConst( & + label, & + resonanceReaction, & + L, & + channelSpin, & + columnIndex, & + scatteringRadius, & + hardSphereRadius, & + labelSize, & + resonanceReactionSize & +) & + bind(C, name='ChannelCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: resonanceReactionSize + character(c_char), intent(in) :: resonanceReaction(resonanceReactionSize) + integer(c_int), intent(in), value :: L + integer(c_int), intent(in), value :: channelSpin + integer(c_int), intent(in), value :: columnIndex + type(c_ptr), intent(in), value :: scatteringRadius + type(c_ptr), intent(in), value :: hardSphereRadius + type(c_ptr) :: ChannelCreateConst +end function ChannelCreateConst + +!! Create, general, non-const +function ChannelCreate( & + label, & + resonanceReaction, & + L, & + channelSpin, & + columnIndex, & + scatteringRadius, & + hardSphereRadius, & + labelSize, & + resonanceReactionSize & +) & + bind(C, name='ChannelCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: resonanceReactionSize + character(c_char), intent(in) :: resonanceReaction(resonanceReactionSize) + integer(c_int), intent(in), value :: L + integer(c_int), intent(in), value :: channelSpin + integer(c_int), intent(in), value :: columnIndex + type(c_ptr), intent(in), value :: scatteringRadius + type(c_ptr), intent(in), value :: hardSphereRadius + type(c_ptr) :: ChannelCreate +end function ChannelCreate + +!! Assign +subroutine ChannelAssign(handleLHS, handleRHS) & + bind(C, name='ChannelAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ChannelAssign + +!! Delete +subroutine ChannelDelete(handle) & + bind(C, name='ChannelDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ChannelDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ChannelRead(handle, filename, filenameSize) & + bind(C, name='ChannelRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ChannelRead +end function ChannelRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ChannelWrite(handle, filename, filenameSize) & + bind(C, name='ChannelWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ChannelWrite +end function ChannelWrite + +!! Print to standard output, in our prettyprinting format +function ChannelPrint(handle) & + bind(C, name='ChannelPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelPrint +end function ChannelPrint + +!! Print to standard output, as XML +function ChannelPrintXML(handle) & + bind(C, name='ChannelPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelPrintXML +end function ChannelPrintXML + +!! Print to standard output, as JSON +function ChannelPrintJSON(handle) & + bind(C, name='ChannelPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelPrintJSON +end function ChannelPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ChannelLabelHas(handle) & + bind(C, name='ChannelLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelLabelHas +end function ChannelLabelHas + +!! Get +function ChannelLabelGet(handle) & + bind(C, name='ChannelLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ChannelLabelGet +end function ChannelLabelGet + +!! Set +subroutine ChannelLabelSet(handle, label, labelSize) & + bind(C, name='ChannelLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ChannelLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: resonanceReaction +!! ----------------------------------------------------------------------------- + +!! Has +function ChannelResonanceReactionHas(handle) & + bind(C, name='ChannelResonanceReactionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelResonanceReactionHas +end function ChannelResonanceReactionHas + +!! Get +function ChannelResonanceReactionGet(handle) & + bind(C, name='ChannelResonanceReactionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ChannelResonanceReactionGet +end function ChannelResonanceReactionGet + +!! Set +subroutine ChannelResonanceReactionSet(handle, resonanceReaction, resonanceReactionSize) & + bind(C, name='ChannelResonanceReactionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: resonanceReactionSize + character(c_char), intent(in) :: resonanceReaction(resonanceReactionSize) +end subroutine ChannelResonanceReactionSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: L +!! ----------------------------------------------------------------------------- + +!! Has +function ChannelLHas(handle) & + bind(C, name='ChannelLHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelLHas +end function ChannelLHas + +!! Get +function ChannelLGet(handle) & + bind(C, name='ChannelLGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelLGet +end function ChannelLGet + +!! Set +subroutine ChannelLSet(handle, L) & + bind(C, name='ChannelLSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: L +end subroutine ChannelLSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: channelSpin +!! ----------------------------------------------------------------------------- + +!! Has +function ChannelChannelSpinHas(handle) & + bind(C, name='ChannelChannelSpinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelChannelSpinHas +end function ChannelChannelSpinHas + +!! Get +function ChannelChannelSpinGet(handle) & + bind(C, name='ChannelChannelSpinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelChannelSpinGet +end function ChannelChannelSpinGet + +!! Set +subroutine ChannelChannelSpinSet(handle, channelSpin) & + bind(C, name='ChannelChannelSpinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: channelSpin +end subroutine ChannelChannelSpinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: columnIndex +!! ----------------------------------------------------------------------------- + +!! Has +function ChannelColumnIndexHas(handle) & + bind(C, name='ChannelColumnIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelColumnIndexHas +end function ChannelColumnIndexHas + +!! Get +function ChannelColumnIndexGet(handle) & + bind(C, name='ChannelColumnIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelColumnIndexGet +end function ChannelColumnIndexGet + +!! Set +subroutine ChannelColumnIndexSet(handle, columnIndex) & + bind(C, name='ChannelColumnIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: columnIndex +end subroutine ChannelColumnIndexSet + + +!! ----------------------------------------------------------------------------- +!! Child: scatteringRadius +!! ----------------------------------------------------------------------------- + +!! Has +function ChannelScatteringRadiusHas(handle) & + bind(C, name='ChannelScatteringRadiusHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelScatteringRadiusHas +end function ChannelScatteringRadiusHas + +!! Get, const +function ChannelScatteringRadiusGetConst(handle) & + bind(C, name='ChannelScatteringRadiusGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ChannelScatteringRadiusGetConst +end function ChannelScatteringRadiusGetConst + +!! Get, non-const +function ChannelScatteringRadiusGet(handle) & + bind(C, name='ChannelScatteringRadiusGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ChannelScatteringRadiusGet +end function ChannelScatteringRadiusGet + +!! Set +subroutine ChannelScatteringRadiusSet(handle, fieldHandle) & + bind(C, name='ChannelScatteringRadiusSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChannelScatteringRadiusSet + + +!! ----------------------------------------------------------------------------- +!! Child: hardSphereRadius +!! ----------------------------------------------------------------------------- + +!! Has +function ChannelHardSphereRadiusHas(handle) & + bind(C, name='ChannelHardSphereRadiusHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelHardSphereRadiusHas +end function ChannelHardSphereRadiusHas + +!! Get, const +function ChannelHardSphereRadiusGetConst(handle) & + bind(C, name='ChannelHardSphereRadiusGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ChannelHardSphereRadiusGetConst +end function ChannelHardSphereRadiusGetConst + +!! Get, non-const +function ChannelHardSphereRadiusGet(handle) & + bind(C, name='ChannelHardSphereRadiusGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ChannelHardSphereRadiusGet +end function ChannelHardSphereRadiusGet + +!! Set +subroutine ChannelHardSphereRadiusSet(handle, fieldHandle) & + bind(C, name='ChannelHardSphereRadiusSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChannelHardSphereRadiusSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalChannel diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Channels.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Channels.f03 new file mode 100644 index 000000000..9d153845f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Channels.f03 @@ -0,0 +1,435 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalChannels +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ChannelsDefaultConst() & + bind(C, name='ChannelsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ChannelsDefaultConst +end function ChannelsDefaultConst + +!! Create, default, non-const +function ChannelsDefault() & + bind(C, name='ChannelsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ChannelsDefault +end function ChannelsDefault + +!! Create, general, const +function ChannelsCreateConst( & + channel, channelSize & +) & + bind(C, name='ChannelsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: channelSize + type(c_ptr), intent(in) :: channel(channelSize) + type(c_ptr) :: ChannelsCreateConst +end function ChannelsCreateConst + +!! Create, general, non-const +function ChannelsCreate( & + channel, channelSize & +) & + bind(C, name='ChannelsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: channelSize + type(c_ptr), intent(in) :: channel(channelSize) + type(c_ptr) :: ChannelsCreate +end function ChannelsCreate + +!! Assign +subroutine ChannelsAssign(handleLHS, handleRHS) & + bind(C, name='ChannelsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ChannelsAssign + +!! Delete +subroutine ChannelsDelete(handle) & + bind(C, name='ChannelsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ChannelsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ChannelsRead(handle, filename, filenameSize) & + bind(C, name='ChannelsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ChannelsRead +end function ChannelsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ChannelsWrite(handle, filename, filenameSize) & + bind(C, name='ChannelsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ChannelsWrite +end function ChannelsWrite + +!! Print to standard output, in our prettyprinting format +function ChannelsPrint(handle) & + bind(C, name='ChannelsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelsPrint +end function ChannelsPrint + +!! Print to standard output, as XML +function ChannelsPrintXML(handle) & + bind(C, name='ChannelsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelsPrintXML +end function ChannelsPrintXML + +!! Print to standard output, as JSON +function ChannelsPrintJSON(handle) & + bind(C, name='ChannelsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelsPrintJSON +end function ChannelsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: channel +!! ----------------------------------------------------------------------------- + +!! Has +function ChannelsChannelHas(handle) & + bind(C, name='ChannelsChannelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChannelsChannelHas +end function ChannelsChannelHas + +!! Clear +subroutine ChannelsChannelClear(handle) & + bind(C, name='ChannelsChannelClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ChannelsChannelClear + +!! Size +function ChannelsChannelSize(handle) & + bind(C, name='ChannelsChannelSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ChannelsChannelSize +end function ChannelsChannelSize + +!! Add +subroutine ChannelsChannelAdd(handle, fieldHandle) & + bind(C, name='ChannelsChannelAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChannelsChannelAdd + +!! Get, by index \in [0,size), const +function ChannelsChannelGetConst(handle, index) & + bind(C, name='ChannelsChannelGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ChannelsChannelGetConst +end function ChannelsChannelGetConst + +!! Get, by index \in [0,size), non-const +function ChannelsChannelGet(handle, index) & + bind(C, name='ChannelsChannelGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ChannelsChannelGet +end function ChannelsChannelGet + +!! Set, by index \in [0,size) +subroutine ChannelsChannelSet(handle, index, fieldHandle) & + bind(C, name='ChannelsChannelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChannelsChannelSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ChannelsChannelHasByLabel(handle, meta, metaSize) & + bind(C, name='ChannelsChannelHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ChannelsChannelHasByLabel +end function ChannelsChannelHasByLabel + +!! Get, by label, const +function ChannelsChannelGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ChannelsChannelGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ChannelsChannelGetByLabelConst +end function ChannelsChannelGetByLabelConst + +!! Get, by label, non-const +function ChannelsChannelGetByLabel(handle, meta, metaSize) & + bind(C, name='ChannelsChannelGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ChannelsChannelGetByLabel +end function ChannelsChannelGetByLabel + +!! Set, by label +subroutine ChannelsChannelSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ChannelsChannelSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChannelsChannelSetByLabel + +!! ------------------------ +!! Re: metadatum resonanceReaction +!! ------------------------ + +!! Has, by resonanceReaction +function ChannelsChannelHasByResonanceReaction(handle, meta, metaSize) & + bind(C, name='ChannelsChannelHasByResonanceReaction') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ChannelsChannelHasByResonanceReaction +end function ChannelsChannelHasByResonanceReaction + +!! Get, by resonanceReaction, const +function ChannelsChannelGetByResonanceReactionConst(handle, meta, metaSize) & + bind(C, name='ChannelsChannelGetByResonanceReactionConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ChannelsChannelGetByResonanceReactionConst +end function ChannelsChannelGetByResonanceReactionConst + +!! Get, by resonanceReaction, non-const +function ChannelsChannelGetByResonanceReaction(handle, meta, metaSize) & + bind(C, name='ChannelsChannelGetByResonanceReaction') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ChannelsChannelGetByResonanceReaction +end function ChannelsChannelGetByResonanceReaction + +!! Set, by resonanceReaction +subroutine ChannelsChannelSetByResonanceReaction(handle, meta, metaSize, fieldHandle) & + bind(C, name='ChannelsChannelSetByResonanceReaction') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChannelsChannelSetByResonanceReaction + +!! ------------------------ +!! Re: metadatum L +!! ------------------------ + +!! Has, by L +function ChannelsChannelHasByL(handle, meta) & + bind(C, name='ChannelsChannelHasByL') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: ChannelsChannelHasByL +end function ChannelsChannelHasByL + +!! Get, by L, const +function ChannelsChannelGetByLConst(handle, meta) & + bind(C, name='ChannelsChannelGetByLConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ChannelsChannelGetByLConst +end function ChannelsChannelGetByLConst + +!! Get, by L, non-const +function ChannelsChannelGetByL(handle, meta) & + bind(C, name='ChannelsChannelGetByL') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ChannelsChannelGetByL +end function ChannelsChannelGetByL + +!! Set, by L +subroutine ChannelsChannelSetByL(handle, meta, fieldHandle) & + bind(C, name='ChannelsChannelSetByL') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChannelsChannelSetByL + +!! ------------------------ +!! Re: metadatum channelSpin +!! ------------------------ + +!! Has, by channelSpin +function ChannelsChannelHasByChannelSpin(handle, meta) & + bind(C, name='ChannelsChannelHasByChannelSpin') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: ChannelsChannelHasByChannelSpin +end function ChannelsChannelHasByChannelSpin + +!! Get, by channelSpin, const +function ChannelsChannelGetByChannelSpinConst(handle, meta) & + bind(C, name='ChannelsChannelGetByChannelSpinConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ChannelsChannelGetByChannelSpinConst +end function ChannelsChannelGetByChannelSpinConst + +!! Get, by channelSpin, non-const +function ChannelsChannelGetByChannelSpin(handle, meta) & + bind(C, name='ChannelsChannelGetByChannelSpin') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ChannelsChannelGetByChannelSpin +end function ChannelsChannelGetByChannelSpin + +!! Set, by channelSpin +subroutine ChannelsChannelSetByChannelSpin(handle, meta, fieldHandle) & + bind(C, name='ChannelsChannelSetByChannelSpin') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChannelsChannelSetByChannelSpin + +!! ------------------------ +!! Re: metadatum columnIndex +!! ------------------------ + +!! Has, by columnIndex +function ChannelsChannelHasByColumnIndex(handle, meta) & + bind(C, name='ChannelsChannelHasByColumnIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: ChannelsChannelHasByColumnIndex +end function ChannelsChannelHasByColumnIndex + +!! Get, by columnIndex, const +function ChannelsChannelGetByColumnIndexConst(handle, meta) & + bind(C, name='ChannelsChannelGetByColumnIndexConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ChannelsChannelGetByColumnIndexConst +end function ChannelsChannelGetByColumnIndexConst + +!! Get, by columnIndex, non-const +function ChannelsChannelGetByColumnIndex(handle, meta) & + bind(C, name='ChannelsChannelGetByColumnIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ChannelsChannelGetByColumnIndex +end function ChannelsChannelGetByColumnIndex + +!! Set, by columnIndex +subroutine ChannelsChannelSetByColumnIndex(handle, meta, fieldHandle) & + bind(C, name='ChannelsChannelSetByColumnIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChannelsChannelSetByColumnIndex + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalChannels diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Charge.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Charge.f03 new file mode 100644 index 000000000..9f30ca87b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Charge.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalCharge +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ChargeDefaultConst() & + bind(C, name='ChargeDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ChargeDefaultConst +end function ChargeDefaultConst + +!! Create, default, non-const +function ChargeDefault() & + bind(C, name='ChargeDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ChargeDefault +end function ChargeDefault + +!! Create, general, const +function ChargeCreateConst( & + integer & +) & + bind(C, name='ChargeCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: integer + type(c_ptr) :: ChargeCreateConst +end function ChargeCreateConst + +!! Create, general, non-const +function ChargeCreate( & + integer & +) & + bind(C, name='ChargeCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: integer + type(c_ptr) :: ChargeCreate +end function ChargeCreate + +!! Assign +subroutine ChargeAssign(handleLHS, handleRHS) & + bind(C, name='ChargeAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ChargeAssign + +!! Delete +subroutine ChargeDelete(handle) & + bind(C, name='ChargeDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ChargeDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ChargeRead(handle, filename, filenameSize) & + bind(C, name='ChargeRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ChargeRead +end function ChargeRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ChargeWrite(handle, filename, filenameSize) & + bind(C, name='ChargeWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ChargeWrite +end function ChargeWrite + +!! Print to standard output, in our prettyprinting format +function ChargePrint(handle) & + bind(C, name='ChargePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChargePrint +end function ChargePrint + +!! Print to standard output, as XML +function ChargePrintXML(handle) & + bind(C, name='ChargePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChargePrintXML +end function ChargePrintXML + +!! Print to standard output, as JSON +function ChargePrintJSON(handle) & + bind(C, name='ChargePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChargePrintJSON +end function ChargePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: integer +!! ----------------------------------------------------------------------------- + +!! Has +function ChargeIntegerHas(handle) & + bind(C, name='ChargeIntegerHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChargeIntegerHas +end function ChargeIntegerHas + +!! Get, const +function ChargeIntegerGetConst(handle) & + bind(C, name='ChargeIntegerGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ChargeIntegerGetConst +end function ChargeIntegerGetConst + +!! Get, non-const +function ChargeIntegerGet(handle) & + bind(C, name='ChargeIntegerGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ChargeIntegerGet +end function ChargeIntegerGet + +!! Set +subroutine ChargeIntegerSet(handle, fieldHandle) & + bind(C, name='ChargeIntegerSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChargeIntegerSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalCharge diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ChemicalElement.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ChemicalElement.f03 new file mode 100644 index 000000000..f66976f26 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ChemicalElement.f03 @@ -0,0 +1,339 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalChemicalElement +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ChemicalElementDefaultConst() & + bind(C, name='ChemicalElementDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ChemicalElementDefaultConst +end function ChemicalElementDefaultConst + +!! Create, default, non-const +function ChemicalElementDefault() & + bind(C, name='ChemicalElementDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ChemicalElementDefault +end function ChemicalElementDefault + +!! Create, general, const +function ChemicalElementCreateConst( & + symbol, & + Z, & + name, & + atomic, & + isotopes, & + symbolSize, & + nameSize & +) & + bind(C, name='ChemicalElementCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: symbolSize + character(c_char), intent(in) :: symbol(symbolSize) + integer(c_int), intent(in), value :: Z + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) + type(c_ptr), intent(in), value :: atomic + type(c_ptr), intent(in), value :: isotopes + type(c_ptr) :: ChemicalElementCreateConst +end function ChemicalElementCreateConst + +!! Create, general, non-const +function ChemicalElementCreate( & + symbol, & + Z, & + name, & + atomic, & + isotopes, & + symbolSize, & + nameSize & +) & + bind(C, name='ChemicalElementCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: symbolSize + character(c_char), intent(in) :: symbol(symbolSize) + integer(c_int), intent(in), value :: Z + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) + type(c_ptr), intent(in), value :: atomic + type(c_ptr), intent(in), value :: isotopes + type(c_ptr) :: ChemicalElementCreate +end function ChemicalElementCreate + +!! Assign +subroutine ChemicalElementAssign(handleLHS, handleRHS) & + bind(C, name='ChemicalElementAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ChemicalElementAssign + +!! Delete +subroutine ChemicalElementDelete(handle) & + bind(C, name='ChemicalElementDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ChemicalElementDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ChemicalElementRead(handle, filename, filenameSize) & + bind(C, name='ChemicalElementRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ChemicalElementRead +end function ChemicalElementRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ChemicalElementWrite(handle, filename, filenameSize) & + bind(C, name='ChemicalElementWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ChemicalElementWrite +end function ChemicalElementWrite + +!! Print to standard output, in our prettyprinting format +function ChemicalElementPrint(handle) & + bind(C, name='ChemicalElementPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementPrint +end function ChemicalElementPrint + +!! Print to standard output, as XML +function ChemicalElementPrintXML(handle) & + bind(C, name='ChemicalElementPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementPrintXML +end function ChemicalElementPrintXML + +!! Print to standard output, as JSON +function ChemicalElementPrintJSON(handle) & + bind(C, name='ChemicalElementPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementPrintJSON +end function ChemicalElementPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: symbol +!! ----------------------------------------------------------------------------- + +!! Has +function ChemicalElementSymbolHas(handle) & + bind(C, name='ChemicalElementSymbolHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementSymbolHas +end function ChemicalElementSymbolHas + +!! Get +function ChemicalElementSymbolGet(handle) & + bind(C, name='ChemicalElementSymbolGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ChemicalElementSymbolGet +end function ChemicalElementSymbolGet + +!! Set +subroutine ChemicalElementSymbolSet(handle, symbol, symbolSize) & + bind(C, name='ChemicalElementSymbolSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: symbolSize + character(c_char), intent(in) :: symbol(symbolSize) +end subroutine ChemicalElementSymbolSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: Z +!! ----------------------------------------------------------------------------- + +!! Has +function ChemicalElementZHas(handle) & + bind(C, name='ChemicalElementZHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementZHas +end function ChemicalElementZHas + +!! Get +function ChemicalElementZGet(handle) & + bind(C, name='ChemicalElementZGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementZGet +end function ChemicalElementZGet + +!! Set +subroutine ChemicalElementZSet(handle, Z) & + bind(C, name='ChemicalElementZSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: Z +end subroutine ChemicalElementZSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: name +!! ----------------------------------------------------------------------------- + +!! Has +function ChemicalElementNameHas(handle) & + bind(C, name='ChemicalElementNameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementNameHas +end function ChemicalElementNameHas + +!! Get +function ChemicalElementNameGet(handle) & + bind(C, name='ChemicalElementNameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ChemicalElementNameGet +end function ChemicalElementNameGet + +!! Set +subroutine ChemicalElementNameSet(handle, name, nameSize) & + bind(C, name='ChemicalElementNameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) +end subroutine ChemicalElementNameSet + + +!! ----------------------------------------------------------------------------- +!! Child: atomic +!! ----------------------------------------------------------------------------- + +!! Has +function ChemicalElementAtomicHas(handle) & + bind(C, name='ChemicalElementAtomicHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementAtomicHas +end function ChemicalElementAtomicHas + +!! Get, const +function ChemicalElementAtomicGetConst(handle) & + bind(C, name='ChemicalElementAtomicGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ChemicalElementAtomicGetConst +end function ChemicalElementAtomicGetConst + +!! Get, non-const +function ChemicalElementAtomicGet(handle) & + bind(C, name='ChemicalElementAtomicGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ChemicalElementAtomicGet +end function ChemicalElementAtomicGet + +!! Set +subroutine ChemicalElementAtomicSet(handle, fieldHandle) & + bind(C, name='ChemicalElementAtomicSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChemicalElementAtomicSet + + +!! ----------------------------------------------------------------------------- +!! Child: isotopes +!! ----------------------------------------------------------------------------- + +!! Has +function ChemicalElementIsotopesHas(handle) & + bind(C, name='ChemicalElementIsotopesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementIsotopesHas +end function ChemicalElementIsotopesHas + +!! Get, const +function ChemicalElementIsotopesGetConst(handle) & + bind(C, name='ChemicalElementIsotopesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ChemicalElementIsotopesGetConst +end function ChemicalElementIsotopesGetConst + +!! Get, non-const +function ChemicalElementIsotopesGet(handle) & + bind(C, name='ChemicalElementIsotopesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ChemicalElementIsotopesGet +end function ChemicalElementIsotopesGet + +!! Set +subroutine ChemicalElementIsotopesSet(handle, fieldHandle) & + bind(C, name='ChemicalElementIsotopesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChemicalElementIsotopesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalChemicalElement diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ChemicalElements.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ChemicalElements.f03 new file mode 100644 index 000000000..c38e79485 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ChemicalElements.f03 @@ -0,0 +1,347 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalChemicalElements +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ChemicalElementsDefaultConst() & + bind(C, name='ChemicalElementsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ChemicalElementsDefaultConst +end function ChemicalElementsDefaultConst + +!! Create, default, non-const +function ChemicalElementsDefault() & + bind(C, name='ChemicalElementsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ChemicalElementsDefault +end function ChemicalElementsDefault + +!! Create, general, const +function ChemicalElementsCreateConst( & + chemicalElement, chemicalElementSize & +) & + bind(C, name='ChemicalElementsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: chemicalElementSize + type(c_ptr), intent(in) :: chemicalElement(chemicalElementSize) + type(c_ptr) :: ChemicalElementsCreateConst +end function ChemicalElementsCreateConst + +!! Create, general, non-const +function ChemicalElementsCreate( & + chemicalElement, chemicalElementSize & +) & + bind(C, name='ChemicalElementsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: chemicalElementSize + type(c_ptr), intent(in) :: chemicalElement(chemicalElementSize) + type(c_ptr) :: ChemicalElementsCreate +end function ChemicalElementsCreate + +!! Assign +subroutine ChemicalElementsAssign(handleLHS, handleRHS) & + bind(C, name='ChemicalElementsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ChemicalElementsAssign + +!! Delete +subroutine ChemicalElementsDelete(handle) & + bind(C, name='ChemicalElementsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ChemicalElementsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ChemicalElementsRead(handle, filename, filenameSize) & + bind(C, name='ChemicalElementsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ChemicalElementsRead +end function ChemicalElementsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ChemicalElementsWrite(handle, filename, filenameSize) & + bind(C, name='ChemicalElementsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ChemicalElementsWrite +end function ChemicalElementsWrite + +!! Print to standard output, in our prettyprinting format +function ChemicalElementsPrint(handle) & + bind(C, name='ChemicalElementsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementsPrint +end function ChemicalElementsPrint + +!! Print to standard output, as XML +function ChemicalElementsPrintXML(handle) & + bind(C, name='ChemicalElementsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementsPrintXML +end function ChemicalElementsPrintXML + +!! Print to standard output, as JSON +function ChemicalElementsPrintJSON(handle) & + bind(C, name='ChemicalElementsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementsPrintJSON +end function ChemicalElementsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: chemicalElement +!! ----------------------------------------------------------------------------- + +!! Has +function ChemicalElementsChemicalElementHas(handle) & + bind(C, name='ChemicalElementsChemicalElementHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ChemicalElementsChemicalElementHas +end function ChemicalElementsChemicalElementHas + +!! Clear +subroutine ChemicalElementsChemicalElementClear(handle) & + bind(C, name='ChemicalElementsChemicalElementClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ChemicalElementsChemicalElementClear + +!! Size +function ChemicalElementsChemicalElementSize(handle) & + bind(C, name='ChemicalElementsChemicalElementSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ChemicalElementsChemicalElementSize +end function ChemicalElementsChemicalElementSize + +!! Add +subroutine ChemicalElementsChemicalElementAdd(handle, fieldHandle) & + bind(C, name='ChemicalElementsChemicalElementAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChemicalElementsChemicalElementAdd + +!! Get, by index \in [0,size), const +function ChemicalElementsChemicalElementGetConst(handle, index) & + bind(C, name='ChemicalElementsChemicalElementGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ChemicalElementsChemicalElementGetConst +end function ChemicalElementsChemicalElementGetConst + +!! Get, by index \in [0,size), non-const +function ChemicalElementsChemicalElementGet(handle, index) & + bind(C, name='ChemicalElementsChemicalElementGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ChemicalElementsChemicalElementGet +end function ChemicalElementsChemicalElementGet + +!! Set, by index \in [0,size) +subroutine ChemicalElementsChemicalElementSet(handle, index, fieldHandle) & + bind(C, name='ChemicalElementsChemicalElementSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChemicalElementsChemicalElementSet + +!! ------------------------ +!! Re: metadatum symbol +!! ------------------------ + +!! Has, by symbol +function ChemicalElementsChemicalElementHasBySymbol(handle, meta, metaSize) & + bind(C, name='ChemicalElementsChemicalElementHasBySymbol') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ChemicalElementsChemicalElementHasBySymbol +end function ChemicalElementsChemicalElementHasBySymbol + +!! Get, by symbol, const +function ChemicalElementsChemicalElementGetBySymbolConst(handle, meta, metaSize) & + bind(C, name='ChemicalElementsChemicalElementGetBySymbolConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ChemicalElementsChemicalElementGetBySymbolConst +end function ChemicalElementsChemicalElementGetBySymbolConst + +!! Get, by symbol, non-const +function ChemicalElementsChemicalElementGetBySymbol(handle, meta, metaSize) & + bind(C, name='ChemicalElementsChemicalElementGetBySymbol') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ChemicalElementsChemicalElementGetBySymbol +end function ChemicalElementsChemicalElementGetBySymbol + +!! Set, by symbol +subroutine ChemicalElementsChemicalElementSetBySymbol(handle, meta, metaSize, fieldHandle) & + bind(C, name='ChemicalElementsChemicalElementSetBySymbol') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChemicalElementsChemicalElementSetBySymbol + +!! ------------------------ +!! Re: metadatum Z +!! ------------------------ + +!! Has, by Z +function ChemicalElementsChemicalElementHasByZ(handle, meta) & + bind(C, name='ChemicalElementsChemicalElementHasByZ') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: ChemicalElementsChemicalElementHasByZ +end function ChemicalElementsChemicalElementHasByZ + +!! Get, by Z, const +function ChemicalElementsChemicalElementGetByZConst(handle, meta) & + bind(C, name='ChemicalElementsChemicalElementGetByZConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ChemicalElementsChemicalElementGetByZConst +end function ChemicalElementsChemicalElementGetByZConst + +!! Get, by Z, non-const +function ChemicalElementsChemicalElementGetByZ(handle, meta) & + bind(C, name='ChemicalElementsChemicalElementGetByZ') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ChemicalElementsChemicalElementGetByZ +end function ChemicalElementsChemicalElementGetByZ + +!! Set, by Z +subroutine ChemicalElementsChemicalElementSetByZ(handle, meta, fieldHandle) & + bind(C, name='ChemicalElementsChemicalElementSetByZ') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChemicalElementsChemicalElementSetByZ + +!! ------------------------ +!! Re: metadatum name +!! ------------------------ + +!! Has, by name +function ChemicalElementsChemicalElementHasByName(handle, meta, metaSize) & + bind(C, name='ChemicalElementsChemicalElementHasByName') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ChemicalElementsChemicalElementHasByName +end function ChemicalElementsChemicalElementHasByName + +!! Get, by name, const +function ChemicalElementsChemicalElementGetByNameConst(handle, meta, metaSize) & + bind(C, name='ChemicalElementsChemicalElementGetByNameConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ChemicalElementsChemicalElementGetByNameConst +end function ChemicalElementsChemicalElementGetByNameConst + +!! Get, by name, non-const +function ChemicalElementsChemicalElementGetByName(handle, meta, metaSize) & + bind(C, name='ChemicalElementsChemicalElementGetByName') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ChemicalElementsChemicalElementGetByName +end function ChemicalElementsChemicalElementGetByName + +!! Set, by name +subroutine ChemicalElementsChemicalElementSetByName(handle, meta, metaSize, fieldHandle) & + bind(C, name='ChemicalElementsChemicalElementSetByName') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ChemicalElementsChemicalElementSetByName + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalChemicalElements diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CoherentPhotonScattering.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CoherentPhotonScattering.f03 new file mode 100644 index 000000000..30b96f80a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CoherentPhotonScattering.f03 @@ -0,0 +1,430 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalCoherentPhotonScattering +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CoherentPhotonScatteringDefaultConst() & + bind(C, name='CoherentPhotonScatteringDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CoherentPhotonScatteringDefaultConst +end function CoherentPhotonScatteringDefaultConst + +!! Create, default, non-const +function CoherentPhotonScatteringDefault() & + bind(C, name='CoherentPhotonScatteringDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CoherentPhotonScatteringDefault +end function CoherentPhotonScatteringDefault + +!! Create, general, const +function CoherentPhotonScatteringCreateConst( & + label, & + href, & + pid, & + productFrame, & + formFactor, & + realAnomalousFactor, & + imaginaryAnomalousFactor, & + labelSize, & + hrefSize, & + pidSize, & + productFrameSize & +) & + bind(C, name='CoherentPhotonScatteringCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: formFactor + type(c_ptr), intent(in), value :: realAnomalousFactor + type(c_ptr), intent(in), value :: imaginaryAnomalousFactor + type(c_ptr) :: CoherentPhotonScatteringCreateConst +end function CoherentPhotonScatteringCreateConst + +!! Create, general, non-const +function CoherentPhotonScatteringCreate( & + label, & + href, & + pid, & + productFrame, & + formFactor, & + realAnomalousFactor, & + imaginaryAnomalousFactor, & + labelSize, & + hrefSize, & + pidSize, & + productFrameSize & +) & + bind(C, name='CoherentPhotonScatteringCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: formFactor + type(c_ptr), intent(in), value :: realAnomalousFactor + type(c_ptr), intent(in), value :: imaginaryAnomalousFactor + type(c_ptr) :: CoherentPhotonScatteringCreate +end function CoherentPhotonScatteringCreate + +!! Assign +subroutine CoherentPhotonScatteringAssign(handleLHS, handleRHS) & + bind(C, name='CoherentPhotonScatteringAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CoherentPhotonScatteringAssign + +!! Delete +subroutine CoherentPhotonScatteringDelete(handle) & + bind(C, name='CoherentPhotonScatteringDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CoherentPhotonScatteringDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CoherentPhotonScatteringRead(handle, filename, filenameSize) & + bind(C, name='CoherentPhotonScatteringRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CoherentPhotonScatteringRead +end function CoherentPhotonScatteringRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CoherentPhotonScatteringWrite(handle, filename, filenameSize) & + bind(C, name='CoherentPhotonScatteringWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CoherentPhotonScatteringWrite +end function CoherentPhotonScatteringWrite + +!! Print to standard output, in our prettyprinting format +function CoherentPhotonScatteringPrint(handle) & + bind(C, name='CoherentPhotonScatteringPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoherentPhotonScatteringPrint +end function CoherentPhotonScatteringPrint + +!! Print to standard output, as XML +function CoherentPhotonScatteringPrintXML(handle) & + bind(C, name='CoherentPhotonScatteringPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoherentPhotonScatteringPrintXML +end function CoherentPhotonScatteringPrintXML + +!! Print to standard output, as JSON +function CoherentPhotonScatteringPrintJSON(handle) & + bind(C, name='CoherentPhotonScatteringPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoherentPhotonScatteringPrintJSON +end function CoherentPhotonScatteringPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function CoherentPhotonScatteringLabelHas(handle) & + bind(C, name='CoherentPhotonScatteringLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoherentPhotonScatteringLabelHas +end function CoherentPhotonScatteringLabelHas + +!! Get +function CoherentPhotonScatteringLabelGet(handle) & + bind(C, name='CoherentPhotonScatteringLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoherentPhotonScatteringLabelGet +end function CoherentPhotonScatteringLabelGet + +!! Set +subroutine CoherentPhotonScatteringLabelSet(handle, label, labelSize) & + bind(C, name='CoherentPhotonScatteringLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine CoherentPhotonScatteringLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function CoherentPhotonScatteringHrefHas(handle) & + bind(C, name='CoherentPhotonScatteringHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoherentPhotonScatteringHrefHas +end function CoherentPhotonScatteringHrefHas + +!! Get +function CoherentPhotonScatteringHrefGet(handle) & + bind(C, name='CoherentPhotonScatteringHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoherentPhotonScatteringHrefGet +end function CoherentPhotonScatteringHrefGet + +!! Set +subroutine CoherentPhotonScatteringHrefSet(handle, href, hrefSize) & + bind(C, name='CoherentPhotonScatteringHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine CoherentPhotonScatteringHrefSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function CoherentPhotonScatteringPidHas(handle) & + bind(C, name='CoherentPhotonScatteringPidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoherentPhotonScatteringPidHas +end function CoherentPhotonScatteringPidHas + +!! Get +function CoherentPhotonScatteringPidGet(handle) & + bind(C, name='CoherentPhotonScatteringPidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoherentPhotonScatteringPidGet +end function CoherentPhotonScatteringPidGet + +!! Set +subroutine CoherentPhotonScatteringPidSet(handle, pid, pidSize) & + bind(C, name='CoherentPhotonScatteringPidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine CoherentPhotonScatteringPidSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function CoherentPhotonScatteringProductFrameHas(handle) & + bind(C, name='CoherentPhotonScatteringProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoherentPhotonScatteringProductFrameHas +end function CoherentPhotonScatteringProductFrameHas + +!! Get +function CoherentPhotonScatteringProductFrameGet(handle) & + bind(C, name='CoherentPhotonScatteringProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoherentPhotonScatteringProductFrameGet +end function CoherentPhotonScatteringProductFrameGet + +!! Set +subroutine CoherentPhotonScatteringProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='CoherentPhotonScatteringProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine CoherentPhotonScatteringProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Child: formFactor +!! ----------------------------------------------------------------------------- + +!! Has +function CoherentPhotonScatteringFormFactorHas(handle) & + bind(C, name='CoherentPhotonScatteringFormFactorHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoherentPhotonScatteringFormFactorHas +end function CoherentPhotonScatteringFormFactorHas + +!! Get, const +function CoherentPhotonScatteringFormFactorGetConst(handle) & + bind(C, name='CoherentPhotonScatteringFormFactorGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoherentPhotonScatteringFormFactorGetConst +end function CoherentPhotonScatteringFormFactorGetConst + +!! Get, non-const +function CoherentPhotonScatteringFormFactorGet(handle) & + bind(C, name='CoherentPhotonScatteringFormFactorGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CoherentPhotonScatteringFormFactorGet +end function CoherentPhotonScatteringFormFactorGet + +!! Set +subroutine CoherentPhotonScatteringFormFactorSet(handle, fieldHandle) & + bind(C, name='CoherentPhotonScatteringFormFactorSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CoherentPhotonScatteringFormFactorSet + + +!! ----------------------------------------------------------------------------- +!! Child: realAnomalousFactor +!! ----------------------------------------------------------------------------- + +!! Has +function CoherentPhotonScatteringRealAnomalousFactorHas(handle) & + bind(C, name='CoherentPhotonScatteringRealAnomalousFactorHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoherentPhotonScatteringRealAnomalousFactorHas +end function CoherentPhotonScatteringRealAnomalousFactorHas + +!! Get, const +function CoherentPhotonScatteringRealAnomalousFactorGetConst(handle) & + bind(C, name='CoherentPhotonScatteringRealAnomalousFactorGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoherentPhotonScatteringRealAnomalousFactorGetConst +end function CoherentPhotonScatteringRealAnomalousFactorGetConst + +!! Get, non-const +function CoherentPhotonScatteringRealAnomalousFactorGet(handle) & + bind(C, name='CoherentPhotonScatteringRealAnomalousFactorGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CoherentPhotonScatteringRealAnomalousFactorGet +end function CoherentPhotonScatteringRealAnomalousFactorGet + +!! Set +subroutine CoherentPhotonScatteringRealAnomalousFactorSet(handle, fieldHandle) & + bind(C, name='CoherentPhotonScatteringRealAnomalousFactorSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CoherentPhotonScatteringRealAnomalousFactorSet + + +!! ----------------------------------------------------------------------------- +!! Child: imaginaryAnomalousFactor +!! ----------------------------------------------------------------------------- + +!! Has +function CoherentPhotonScatteringImaginaryAnomalousFactorHas(handle) & + bind(C, name='CoherentPhotonScatteringImaginaryAnomalousFactorHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoherentPhotonScatteringImaginaryAnomalousFactorHas +end function CoherentPhotonScatteringImaginaryAnomalousFactorHas + +!! Get, const +function CoherentPhotonScatteringImaginaryAnomalousFactorGetConst(handle) & + bind(C, name='CoherentPhotonScatteringImaginaryAnomalousFactorGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoherentPhotonScatteringImaginaryAnomalousFactorGetConst +end function CoherentPhotonScatteringImaginaryAnomalousFactorGetConst + +!! Get, non-const +function CoherentPhotonScatteringImaginaryAnomalousFactorGet(handle) & + bind(C, name='CoherentPhotonScatteringImaginaryAnomalousFactorGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CoherentPhotonScatteringImaginaryAnomalousFactorGet +end function CoherentPhotonScatteringImaginaryAnomalousFactorGet + +!! Set +subroutine CoherentPhotonScatteringImaginaryAnomalousFactorSet(handle, fieldHandle) & + bind(C, name='CoherentPhotonScatteringImaginaryAnomalousFactorSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CoherentPhotonScatteringImaginaryAnomalousFactorSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalCoherentPhotonScattering diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Column.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Column.f03 new file mode 100644 index 000000000..055fef3de --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Column.f03 @@ -0,0 +1,249 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalColumn +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ColumnDefaultConst() & + bind(C, name='ColumnDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ColumnDefaultConst +end function ColumnDefaultConst + +!! Create, default, non-const +function ColumnDefault() & + bind(C, name='ColumnDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ColumnDefault +end function ColumnDefault + +!! Create, general, const +function ColumnCreateConst( & + index, & + name, & + unit, & + nameSize, & + unitSize & +) & + bind(C, name='ColumnCreateConst') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: ColumnCreateConst +end function ColumnCreateConst + +!! Create, general, non-const +function ColumnCreate( & + index, & + name, & + unit, & + nameSize, & + unitSize & +) & + bind(C, name='ColumnCreate') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: ColumnCreate +end function ColumnCreate + +!! Assign +subroutine ColumnAssign(handleLHS, handleRHS) & + bind(C, name='ColumnAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ColumnAssign + +!! Delete +subroutine ColumnDelete(handle) & + bind(C, name='ColumnDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ColumnDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ColumnRead(handle, filename, filenameSize) & + bind(C, name='ColumnRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ColumnRead +end function ColumnRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ColumnWrite(handle, filename, filenameSize) & + bind(C, name='ColumnWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ColumnWrite +end function ColumnWrite + +!! Print to standard output, in our prettyprinting format +function ColumnPrint(handle) & + bind(C, name='ColumnPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnPrint +end function ColumnPrint + +!! Print to standard output, as XML +function ColumnPrintXML(handle) & + bind(C, name='ColumnPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnPrintXML +end function ColumnPrintXML + +!! Print to standard output, as JSON +function ColumnPrintJSON(handle) & + bind(C, name='ColumnPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnPrintJSON +end function ColumnPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: index +!! ----------------------------------------------------------------------------- + +!! Has +function ColumnIndexHas(handle) & + bind(C, name='ColumnIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnIndexHas +end function ColumnIndexHas + +!! Get +function ColumnIndexGet(handle) & + bind(C, name='ColumnIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnIndexGet +end function ColumnIndexGet + +!! Set +subroutine ColumnIndexSet(handle, index) & + bind(C, name='ColumnIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: index +end subroutine ColumnIndexSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: name +!! ----------------------------------------------------------------------------- + +!! Has +function ColumnNameHas(handle) & + bind(C, name='ColumnNameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnNameHas +end function ColumnNameHas + +!! Get +function ColumnNameGet(handle) & + bind(C, name='ColumnNameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ColumnNameGet +end function ColumnNameGet + +!! Set +subroutine ColumnNameSet(handle, name, nameSize) & + bind(C, name='ColumnNameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) +end subroutine ColumnNameSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function ColumnUnitHas(handle) & + bind(C, name='ColumnUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnUnitHas +end function ColumnUnitHas + +!! Get +function ColumnUnitGet(handle) & + bind(C, name='ColumnUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ColumnUnitGet +end function ColumnUnitGet + +!! Set +subroutine ColumnUnitSet(handle, unit, unitSize) & + bind(C, name='ColumnUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine ColumnUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalColumn diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ColumnData.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ColumnData.f03 new file mode 100644 index 000000000..9b3855abc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ColumnData.f03 @@ -0,0 +1,258 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalColumnData +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ColumnDataDefaultConst() & + bind(C, name='ColumnDataDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ColumnDataDefaultConst +end function ColumnDataDefaultConst + +!! Create, default, non-const +function ColumnDataDefault() & + bind(C, name='ColumnDataDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ColumnDataDefault +end function ColumnDataDefault + +!! Create, general, const +function ColumnDataCreateConst( & + ENDF_MFMT, & + href, & + slices, & + ENDF_MFMTSize, & + hrefSize & +) & + bind(C, name='ColumnDataCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: ENDF_MFMTSize + character(c_char), intent(in) :: ENDF_MFMT(ENDF_MFMTSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr), intent(in), value :: slices + type(c_ptr) :: ColumnDataCreateConst +end function ColumnDataCreateConst + +!! Create, general, non-const +function ColumnDataCreate( & + ENDF_MFMT, & + href, & + slices, & + ENDF_MFMTSize, & + hrefSize & +) & + bind(C, name='ColumnDataCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: ENDF_MFMTSize + character(c_char), intent(in) :: ENDF_MFMT(ENDF_MFMTSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr), intent(in), value :: slices + type(c_ptr) :: ColumnDataCreate +end function ColumnDataCreate + +!! Assign +subroutine ColumnDataAssign(handleLHS, handleRHS) & + bind(C, name='ColumnDataAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ColumnDataAssign + +!! Delete +subroutine ColumnDataDelete(handle) & + bind(C, name='ColumnDataDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ColumnDataDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ColumnDataRead(handle, filename, filenameSize) & + bind(C, name='ColumnDataRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ColumnDataRead +end function ColumnDataRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ColumnDataWrite(handle, filename, filenameSize) & + bind(C, name='ColumnDataWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ColumnDataWrite +end function ColumnDataWrite + +!! Print to standard output, in our prettyprinting format +function ColumnDataPrint(handle) & + bind(C, name='ColumnDataPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnDataPrint +end function ColumnDataPrint + +!! Print to standard output, as XML +function ColumnDataPrintXML(handle) & + bind(C, name='ColumnDataPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnDataPrintXML +end function ColumnDataPrintXML + +!! Print to standard output, as JSON +function ColumnDataPrintJSON(handle) & + bind(C, name='ColumnDataPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnDataPrintJSON +end function ColumnDataPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: ENDF_MFMT +!! ----------------------------------------------------------------------------- + +!! Has +function ColumnDataENDFMFMTHas(handle) & + bind(C, name='ColumnDataENDFMFMTHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnDataENDFMFMTHas +end function ColumnDataENDFMFMTHas + +!! Get +function ColumnDataENDFMFMTGet(handle) & + bind(C, name='ColumnDataENDFMFMTGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ColumnDataENDFMFMTGet +end function ColumnDataENDFMFMTGet + +!! Set +subroutine ColumnDataENDFMFMTSet(handle, ENDF_MFMT, ENDF_MFMTSize) & + bind(C, name='ColumnDataENDFMFMTSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: ENDF_MFMTSize + character(c_char), intent(in) :: ENDF_MFMT(ENDF_MFMTSize) +end subroutine ColumnDataENDFMFMTSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function ColumnDataHrefHas(handle) & + bind(C, name='ColumnDataHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnDataHrefHas +end function ColumnDataHrefHas + +!! Get +function ColumnDataHrefGet(handle) & + bind(C, name='ColumnDataHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ColumnDataHrefGet +end function ColumnDataHrefGet + +!! Set +subroutine ColumnDataHrefSet(handle, href, hrefSize) & + bind(C, name='ColumnDataHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine ColumnDataHrefSet + + +!! ----------------------------------------------------------------------------- +!! Child: slices +!! ----------------------------------------------------------------------------- + +!! Has +function ColumnDataSlicesHas(handle) & + bind(C, name='ColumnDataSlicesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnDataSlicesHas +end function ColumnDataSlicesHas + +!! Get, const +function ColumnDataSlicesGetConst(handle) & + bind(C, name='ColumnDataSlicesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ColumnDataSlicesGetConst +end function ColumnDataSlicesGetConst + +!! Get, non-const +function ColumnDataSlicesGet(handle) & + bind(C, name='ColumnDataSlicesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ColumnDataSlicesGet +end function ColumnDataSlicesGet + +!! Set +subroutine ColumnDataSlicesSet(handle, fieldHandle) & + bind(C, name='ColumnDataSlicesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ColumnDataSlicesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalColumnData diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ColumnHeaders.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ColumnHeaders.f03 new file mode 100644 index 000000000..40f401421 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ColumnHeaders.f03 @@ -0,0 +1,347 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalColumnHeaders +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ColumnHeadersDefaultConst() & + bind(C, name='ColumnHeadersDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ColumnHeadersDefaultConst +end function ColumnHeadersDefaultConst + +!! Create, default, non-const +function ColumnHeadersDefault() & + bind(C, name='ColumnHeadersDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ColumnHeadersDefault +end function ColumnHeadersDefault + +!! Create, general, const +function ColumnHeadersCreateConst( & + column, columnSize & +) & + bind(C, name='ColumnHeadersCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: columnSize + type(c_ptr), intent(in) :: column(columnSize) + type(c_ptr) :: ColumnHeadersCreateConst +end function ColumnHeadersCreateConst + +!! Create, general, non-const +function ColumnHeadersCreate( & + column, columnSize & +) & + bind(C, name='ColumnHeadersCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: columnSize + type(c_ptr), intent(in) :: column(columnSize) + type(c_ptr) :: ColumnHeadersCreate +end function ColumnHeadersCreate + +!! Assign +subroutine ColumnHeadersAssign(handleLHS, handleRHS) & + bind(C, name='ColumnHeadersAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ColumnHeadersAssign + +!! Delete +subroutine ColumnHeadersDelete(handle) & + bind(C, name='ColumnHeadersDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ColumnHeadersDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ColumnHeadersRead(handle, filename, filenameSize) & + bind(C, name='ColumnHeadersRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ColumnHeadersRead +end function ColumnHeadersRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ColumnHeadersWrite(handle, filename, filenameSize) & + bind(C, name='ColumnHeadersWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ColumnHeadersWrite +end function ColumnHeadersWrite + +!! Print to standard output, in our prettyprinting format +function ColumnHeadersPrint(handle) & + bind(C, name='ColumnHeadersPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnHeadersPrint +end function ColumnHeadersPrint + +!! Print to standard output, as XML +function ColumnHeadersPrintXML(handle) & + bind(C, name='ColumnHeadersPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnHeadersPrintXML +end function ColumnHeadersPrintXML + +!! Print to standard output, as JSON +function ColumnHeadersPrintJSON(handle) & + bind(C, name='ColumnHeadersPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnHeadersPrintJSON +end function ColumnHeadersPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: column +!! ----------------------------------------------------------------------------- + +!! Has +function ColumnHeadersColumnHas(handle) & + bind(C, name='ColumnHeadersColumnHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ColumnHeadersColumnHas +end function ColumnHeadersColumnHas + +!! Clear +subroutine ColumnHeadersColumnClear(handle) & + bind(C, name='ColumnHeadersColumnClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ColumnHeadersColumnClear + +!! Size +function ColumnHeadersColumnSize(handle) & + bind(C, name='ColumnHeadersColumnSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ColumnHeadersColumnSize +end function ColumnHeadersColumnSize + +!! Add +subroutine ColumnHeadersColumnAdd(handle, fieldHandle) & + bind(C, name='ColumnHeadersColumnAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ColumnHeadersColumnAdd + +!! Get, by index \in [0,size), const +function ColumnHeadersColumnGetConst(handle, index) & + bind(C, name='ColumnHeadersColumnGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ColumnHeadersColumnGetConst +end function ColumnHeadersColumnGetConst + +!! Get, by index \in [0,size), non-const +function ColumnHeadersColumnGet(handle, index) & + bind(C, name='ColumnHeadersColumnGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ColumnHeadersColumnGet +end function ColumnHeadersColumnGet + +!! Set, by index \in [0,size) +subroutine ColumnHeadersColumnSet(handle, index, fieldHandle) & + bind(C, name='ColumnHeadersColumnSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ColumnHeadersColumnSet + +!! ------------------------ +!! Re: metadatum index +!! ------------------------ + +!! Has, by index +function ColumnHeadersColumnHasByIndex(handle, meta) & + bind(C, name='ColumnHeadersColumnHasByIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: ColumnHeadersColumnHasByIndex +end function ColumnHeadersColumnHasByIndex + +!! Get, by index, const +function ColumnHeadersColumnGetByIndexConst(handle, meta) & + bind(C, name='ColumnHeadersColumnGetByIndexConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ColumnHeadersColumnGetByIndexConst +end function ColumnHeadersColumnGetByIndexConst + +!! Get, by index, non-const +function ColumnHeadersColumnGetByIndex(handle, meta) & + bind(C, name='ColumnHeadersColumnGetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ColumnHeadersColumnGetByIndex +end function ColumnHeadersColumnGetByIndex + +!! Set, by index +subroutine ColumnHeadersColumnSetByIndex(handle, meta, fieldHandle) & + bind(C, name='ColumnHeadersColumnSetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ColumnHeadersColumnSetByIndex + +!! ------------------------ +!! Re: metadatum name +!! ------------------------ + +!! Has, by name +function ColumnHeadersColumnHasByName(handle, meta, metaSize) & + bind(C, name='ColumnHeadersColumnHasByName') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ColumnHeadersColumnHasByName +end function ColumnHeadersColumnHasByName + +!! Get, by name, const +function ColumnHeadersColumnGetByNameConst(handle, meta, metaSize) & + bind(C, name='ColumnHeadersColumnGetByNameConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ColumnHeadersColumnGetByNameConst +end function ColumnHeadersColumnGetByNameConst + +!! Get, by name, non-const +function ColumnHeadersColumnGetByName(handle, meta, metaSize) & + bind(C, name='ColumnHeadersColumnGetByName') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ColumnHeadersColumnGetByName +end function ColumnHeadersColumnGetByName + +!! Set, by name +subroutine ColumnHeadersColumnSetByName(handle, meta, metaSize, fieldHandle) & + bind(C, name='ColumnHeadersColumnSetByName') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ColumnHeadersColumnSetByName + +!! ------------------------ +!! Re: metadatum unit +!! ------------------------ + +!! Has, by unit +function ColumnHeadersColumnHasByUnit(handle, meta, metaSize) & + bind(C, name='ColumnHeadersColumnHasByUnit') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ColumnHeadersColumnHasByUnit +end function ColumnHeadersColumnHasByUnit + +!! Get, by unit, const +function ColumnHeadersColumnGetByUnitConst(handle, meta, metaSize) & + bind(C, name='ColumnHeadersColumnGetByUnitConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ColumnHeadersColumnGetByUnitConst +end function ColumnHeadersColumnGetByUnitConst + +!! Get, by unit, non-const +function ColumnHeadersColumnGetByUnit(handle, meta, metaSize) & + bind(C, name='ColumnHeadersColumnGetByUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ColumnHeadersColumnGetByUnit +end function ColumnHeadersColumnGetByUnit + +!! Set, by unit +subroutine ColumnHeadersColumnSetByUnit(handle, meta, metaSize, fieldHandle) & + bind(C, name='ColumnHeadersColumnSetByUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ColumnHeadersColumnSetByUnit + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalColumnHeaders diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Configuration.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Configuration.f03 new file mode 100644 index 000000000..e05391452 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Configuration.f03 @@ -0,0 +1,329 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalConfiguration +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ConfigurationDefaultConst() & + bind(C, name='ConfigurationDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ConfigurationDefaultConst +end function ConfigurationDefaultConst + +!! Create, default, non-const +function ConfigurationDefault() & + bind(C, name='ConfigurationDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ConfigurationDefault +end function ConfigurationDefault + +!! Create, general, const +function ConfigurationCreateConst( & + subshell, & + electronNumber, & + bindingEnergy, & + decayData, decayDataSize, & + subshellSize & +) & + bind(C, name='ConfigurationCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: subshellSize + character(c_char), intent(in) :: subshell(subshellSize) + real(c_double), intent(in), value :: electronNumber + type(c_ptr), intent(in), value :: bindingEnergy + integer(c_size_t), intent(in), value :: decayDataSize + type(c_ptr), intent(in) :: decayData(decayDataSize) + type(c_ptr) :: ConfigurationCreateConst +end function ConfigurationCreateConst + +!! Create, general, non-const +function ConfigurationCreate( & + subshell, & + electronNumber, & + bindingEnergy, & + decayData, decayDataSize, & + subshellSize & +) & + bind(C, name='ConfigurationCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: subshellSize + character(c_char), intent(in) :: subshell(subshellSize) + real(c_double), intent(in), value :: electronNumber + type(c_ptr), intent(in), value :: bindingEnergy + integer(c_size_t), intent(in), value :: decayDataSize + type(c_ptr), intent(in) :: decayData(decayDataSize) + type(c_ptr) :: ConfigurationCreate +end function ConfigurationCreate + +!! Assign +subroutine ConfigurationAssign(handleLHS, handleRHS) & + bind(C, name='ConfigurationAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ConfigurationAssign + +!! Delete +subroutine ConfigurationDelete(handle) & + bind(C, name='ConfigurationDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ConfigurationDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ConfigurationRead(handle, filename, filenameSize) & + bind(C, name='ConfigurationRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ConfigurationRead +end function ConfigurationRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ConfigurationWrite(handle, filename, filenameSize) & + bind(C, name='ConfigurationWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ConfigurationWrite +end function ConfigurationWrite + +!! Print to standard output, in our prettyprinting format +function ConfigurationPrint(handle) & + bind(C, name='ConfigurationPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConfigurationPrint +end function ConfigurationPrint + +!! Print to standard output, as XML +function ConfigurationPrintXML(handle) & + bind(C, name='ConfigurationPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConfigurationPrintXML +end function ConfigurationPrintXML + +!! Print to standard output, as JSON +function ConfigurationPrintJSON(handle) & + bind(C, name='ConfigurationPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConfigurationPrintJSON +end function ConfigurationPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: subshell +!! ----------------------------------------------------------------------------- + +!! Has +function ConfigurationSubshellHas(handle) & + bind(C, name='ConfigurationSubshellHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConfigurationSubshellHas +end function ConfigurationSubshellHas + +!! Get +function ConfigurationSubshellGet(handle) & + bind(C, name='ConfigurationSubshellGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ConfigurationSubshellGet +end function ConfigurationSubshellGet + +!! Set +subroutine ConfigurationSubshellSet(handle, subshell, subshellSize) & + bind(C, name='ConfigurationSubshellSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: subshellSize + character(c_char), intent(in) :: subshell(subshellSize) +end subroutine ConfigurationSubshellSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: electronNumber +!! ----------------------------------------------------------------------------- + +!! Has +function ConfigurationElectronNumberHas(handle) & + bind(C, name='ConfigurationElectronNumberHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConfigurationElectronNumberHas +end function ConfigurationElectronNumberHas + +!! Get +function ConfigurationElectronNumberGet(handle) & + bind(C, name='ConfigurationElectronNumberGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: ConfigurationElectronNumberGet +end function ConfigurationElectronNumberGet + +!! Set +subroutine ConfigurationElectronNumberSet(handle, electronNumber) & + bind(C, name='ConfigurationElectronNumberSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: electronNumber +end subroutine ConfigurationElectronNumberSet + + +!! ----------------------------------------------------------------------------- +!! Child: bindingEnergy +!! ----------------------------------------------------------------------------- + +!! Has +function ConfigurationBindingEnergyHas(handle) & + bind(C, name='ConfigurationBindingEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConfigurationBindingEnergyHas +end function ConfigurationBindingEnergyHas + +!! Get, const +function ConfigurationBindingEnergyGetConst(handle) & + bind(C, name='ConfigurationBindingEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ConfigurationBindingEnergyGetConst +end function ConfigurationBindingEnergyGetConst + +!! Get, non-const +function ConfigurationBindingEnergyGet(handle) & + bind(C, name='ConfigurationBindingEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ConfigurationBindingEnergyGet +end function ConfigurationBindingEnergyGet + +!! Set +subroutine ConfigurationBindingEnergySet(handle, fieldHandle) & + bind(C, name='ConfigurationBindingEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ConfigurationBindingEnergySet + + +!! ----------------------------------------------------------------------------- +!! Child: decayData +!! ----------------------------------------------------------------------------- + +!! Has +function ConfigurationDecayDataHas(handle) & + bind(C, name='ConfigurationDecayDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConfigurationDecayDataHas +end function ConfigurationDecayDataHas + +!! Clear +subroutine ConfigurationDecayDataClear(handle) & + bind(C, name='ConfigurationDecayDataClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ConfigurationDecayDataClear + +!! Size +function ConfigurationDecayDataSize(handle) & + bind(C, name='ConfigurationDecayDataSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ConfigurationDecayDataSize +end function ConfigurationDecayDataSize + +!! Add +subroutine ConfigurationDecayDataAdd(handle, fieldHandle) & + bind(C, name='ConfigurationDecayDataAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ConfigurationDecayDataAdd + +!! Get, by index \in [0,size), const +function ConfigurationDecayDataGetConst(handle, index) & + bind(C, name='ConfigurationDecayDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ConfigurationDecayDataGetConst +end function ConfigurationDecayDataGetConst + +!! Get, by index \in [0,size), non-const +function ConfigurationDecayDataGet(handle, index) & + bind(C, name='ConfigurationDecayDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ConfigurationDecayDataGet +end function ConfigurationDecayDataGet + +!! Set, by index \in [0,size) +subroutine ConfigurationDecayDataSet(handle, index, fieldHandle) & + bind(C, name='ConfigurationDecayDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ConfigurationDecayDataSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalConfiguration diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Configurations.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Configurations.f03 new file mode 100644 index 000000000..e5793b2ad --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Configurations.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalConfigurations +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ConfigurationsDefaultConst() & + bind(C, name='ConfigurationsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ConfigurationsDefaultConst +end function ConfigurationsDefaultConst + +!! Create, default, non-const +function ConfigurationsDefault() & + bind(C, name='ConfigurationsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ConfigurationsDefault +end function ConfigurationsDefault + +!! Create, general, const +function ConfigurationsCreateConst( & + configuration, configurationSize & +) & + bind(C, name='ConfigurationsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: configurationSize + type(c_ptr), intent(in) :: configuration(configurationSize) + type(c_ptr) :: ConfigurationsCreateConst +end function ConfigurationsCreateConst + +!! Create, general, non-const +function ConfigurationsCreate( & + configuration, configurationSize & +) & + bind(C, name='ConfigurationsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: configurationSize + type(c_ptr), intent(in) :: configuration(configurationSize) + type(c_ptr) :: ConfigurationsCreate +end function ConfigurationsCreate + +!! Assign +subroutine ConfigurationsAssign(handleLHS, handleRHS) & + bind(C, name='ConfigurationsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ConfigurationsAssign + +!! Delete +subroutine ConfigurationsDelete(handle) & + bind(C, name='ConfigurationsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ConfigurationsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ConfigurationsRead(handle, filename, filenameSize) & + bind(C, name='ConfigurationsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ConfigurationsRead +end function ConfigurationsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ConfigurationsWrite(handle, filename, filenameSize) & + bind(C, name='ConfigurationsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ConfigurationsWrite +end function ConfigurationsWrite + +!! Print to standard output, in our prettyprinting format +function ConfigurationsPrint(handle) & + bind(C, name='ConfigurationsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConfigurationsPrint +end function ConfigurationsPrint + +!! Print to standard output, as XML +function ConfigurationsPrintXML(handle) & + bind(C, name='ConfigurationsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConfigurationsPrintXML +end function ConfigurationsPrintXML + +!! Print to standard output, as JSON +function ConfigurationsPrintJSON(handle) & + bind(C, name='ConfigurationsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConfigurationsPrintJSON +end function ConfigurationsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: configuration +!! ----------------------------------------------------------------------------- + +!! Has +function ConfigurationsConfigurationHas(handle) & + bind(C, name='ConfigurationsConfigurationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConfigurationsConfigurationHas +end function ConfigurationsConfigurationHas + +!! Clear +subroutine ConfigurationsConfigurationClear(handle) & + bind(C, name='ConfigurationsConfigurationClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ConfigurationsConfigurationClear + +!! Size +function ConfigurationsConfigurationSize(handle) & + bind(C, name='ConfigurationsConfigurationSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ConfigurationsConfigurationSize +end function ConfigurationsConfigurationSize + +!! Add +subroutine ConfigurationsConfigurationAdd(handle, fieldHandle) & + bind(C, name='ConfigurationsConfigurationAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ConfigurationsConfigurationAdd + +!! Get, by index \in [0,size), const +function ConfigurationsConfigurationGetConst(handle, index) & + bind(C, name='ConfigurationsConfigurationGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ConfigurationsConfigurationGetConst +end function ConfigurationsConfigurationGetConst + +!! Get, by index \in [0,size), non-const +function ConfigurationsConfigurationGet(handle, index) & + bind(C, name='ConfigurationsConfigurationGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ConfigurationsConfigurationGet +end function ConfigurationsConfigurationGet + +!! Set, by index \in [0,size) +subroutine ConfigurationsConfigurationSet(handle, index, fieldHandle) & + bind(C, name='ConfigurationsConfigurationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ConfigurationsConfigurationSet + +!! ------------------------ +!! Re: metadatum subshell +!! ------------------------ + +!! Has, by subshell +function ConfigurationsConfigurationHasBySubshell(handle, meta, metaSize) & + bind(C, name='ConfigurationsConfigurationHasBySubshell') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ConfigurationsConfigurationHasBySubshell +end function ConfigurationsConfigurationHasBySubshell + +!! Get, by subshell, const +function ConfigurationsConfigurationGetBySubshellConst(handle, meta, metaSize) & + bind(C, name='ConfigurationsConfigurationGetBySubshellConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ConfigurationsConfigurationGetBySubshellConst +end function ConfigurationsConfigurationGetBySubshellConst + +!! Get, by subshell, non-const +function ConfigurationsConfigurationGetBySubshell(handle, meta, metaSize) & + bind(C, name='ConfigurationsConfigurationGetBySubshell') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ConfigurationsConfigurationGetBySubshell +end function ConfigurationsConfigurationGetBySubshell + +!! Set, by subshell +subroutine ConfigurationsConfigurationSetBySubshell(handle, meta, metaSize, fieldHandle) & + bind(C, name='ConfigurationsConfigurationSetBySubshell') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ConfigurationsConfigurationSetBySubshell + +!! ------------------------ +!! Re: metadatum electronNumber +!! ------------------------ + +!! Has, by electronNumber +function ConfigurationsConfigurationHasByElectronNumber(handle, meta) & + bind(C, name='ConfigurationsConfigurationHasByElectronNumber') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: ConfigurationsConfigurationHasByElectronNumber +end function ConfigurationsConfigurationHasByElectronNumber + +!! Get, by electronNumber, const +function ConfigurationsConfigurationGetByElectronNumberConst(handle, meta) & + bind(C, name='ConfigurationsConfigurationGetByElectronNumberConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: ConfigurationsConfigurationGetByElectronNumberConst +end function ConfigurationsConfigurationGetByElectronNumberConst + +!! Get, by electronNumber, non-const +function ConfigurationsConfigurationGetByElectronNumber(handle, meta) & + bind(C, name='ConfigurationsConfigurationGetByElectronNumber') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: ConfigurationsConfigurationGetByElectronNumber +end function ConfigurationsConfigurationGetByElectronNumber + +!! Set, by electronNumber +subroutine ConfigurationsConfigurationSetByElectronNumber(handle, meta, fieldHandle) & + bind(C, name='ConfigurationsConfigurationSetByElectronNumber') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ConfigurationsConfigurationSetByElectronNumber + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalConfigurations diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Constant1d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Constant1d.f03 new file mode 100644 index 000000000..88b108f5d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Constant1d.f03 @@ -0,0 +1,325 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalConstant1d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Constant1dDefaultConst() & + bind(C, name='Constant1dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Constant1dDefaultConst +end function Constant1dDefaultConst + +!! Create, default, non-const +function Constant1dDefault() & + bind(C, name='Constant1dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Constant1dDefault +end function Constant1dDefault + +!! Create, general, const +function Constant1dCreateConst( & + label, & + value, & + domainMin, & + domainMax, & + axes, & + labelSize & +) & + bind(C, name='Constant1dCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: value + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + type(c_ptr), intent(in), value :: axes + type(c_ptr) :: Constant1dCreateConst +end function Constant1dCreateConst + +!! Create, general, non-const +function Constant1dCreate( & + label, & + value, & + domainMin, & + domainMax, & + axes, & + labelSize & +) & + bind(C, name='Constant1dCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: value + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + type(c_ptr), intent(in), value :: axes + type(c_ptr) :: Constant1dCreate +end function Constant1dCreate + +!! Assign +subroutine Constant1dAssign(handleLHS, handleRHS) & + bind(C, name='Constant1dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Constant1dAssign + +!! Delete +subroutine Constant1dDelete(handle) & + bind(C, name='Constant1dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Constant1dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Constant1dRead(handle, filename, filenameSize) & + bind(C, name='Constant1dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Constant1dRead +end function Constant1dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Constant1dWrite(handle, filename, filenameSize) & + bind(C, name='Constant1dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Constant1dWrite +end function Constant1dWrite + +!! Print to standard output, in our prettyprinting format +function Constant1dPrint(handle) & + bind(C, name='Constant1dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Constant1dPrint +end function Constant1dPrint + +!! Print to standard output, as XML +function Constant1dPrintXML(handle) & + bind(C, name='Constant1dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Constant1dPrintXML +end function Constant1dPrintXML + +!! Print to standard output, as JSON +function Constant1dPrintJSON(handle) & + bind(C, name='Constant1dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Constant1dPrintJSON +end function Constant1dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function Constant1dLabelHas(handle) & + bind(C, name='Constant1dLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Constant1dLabelHas +end function Constant1dLabelHas + +!! Get +function Constant1dLabelGet(handle) & + bind(C, name='Constant1dLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Constant1dLabelGet +end function Constant1dLabelGet + +!! Set +subroutine Constant1dLabelSet(handle, label, labelSize) & + bind(C, name='Constant1dLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine Constant1dLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function Constant1dValueHas(handle) & + bind(C, name='Constant1dValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Constant1dValueHas +end function Constant1dValueHas + +!! Get +function Constant1dValueGet(handle) & + bind(C, name='Constant1dValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: Constant1dValueGet +end function Constant1dValueGet + +!! Set +subroutine Constant1dValueSet(handle, value) & + bind(C, name='Constant1dValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine Constant1dValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMin +!! ----------------------------------------------------------------------------- + +!! Has +function Constant1dDomainMinHas(handle) & + bind(C, name='Constant1dDomainMinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Constant1dDomainMinHas +end function Constant1dDomainMinHas + +!! Get +function Constant1dDomainMinGet(handle) & + bind(C, name='Constant1dDomainMinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: Constant1dDomainMinGet +end function Constant1dDomainMinGet + +!! Set +subroutine Constant1dDomainMinSet(handle, domainMin) & + bind(C, name='Constant1dDomainMinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMin +end subroutine Constant1dDomainMinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMax +!! ----------------------------------------------------------------------------- + +!! Has +function Constant1dDomainMaxHas(handle) & + bind(C, name='Constant1dDomainMaxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Constant1dDomainMaxHas +end function Constant1dDomainMaxHas + +!! Get +function Constant1dDomainMaxGet(handle) & + bind(C, name='Constant1dDomainMaxGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: Constant1dDomainMaxGet +end function Constant1dDomainMaxGet + +!! Set +subroutine Constant1dDomainMaxSet(handle, domainMax) & + bind(C, name='Constant1dDomainMaxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMax +end subroutine Constant1dDomainMaxSet + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function Constant1dAxesHas(handle) & + bind(C, name='Constant1dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Constant1dAxesHas +end function Constant1dAxesHas + +!! Get, const +function Constant1dAxesGetConst(handle) & + bind(C, name='Constant1dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Constant1dAxesGetConst +end function Constant1dAxesGetConst + +!! Get, non-const +function Constant1dAxesGet(handle) & + bind(C, name='Constant1dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Constant1dAxesGet +end function Constant1dAxesGet + +!! Set +subroutine Constant1dAxesSet(handle, fieldHandle) & + bind(C, name='Constant1dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Constant1dAxesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalConstant1d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Continuum.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Continuum.f03 new file mode 100644 index 000000000..3449984d8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Continuum.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalContinuum +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ContinuumDefaultConst() & + bind(C, name='ContinuumDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ContinuumDefaultConst +end function ContinuumDefaultConst + +!! Create, default, non-const +function ContinuumDefault() & + bind(C, name='ContinuumDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ContinuumDefault +end function ContinuumDefault + +!! Create, general, const +function ContinuumCreateConst( & + XYs1d & +) & + bind(C, name='ContinuumCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: ContinuumCreateConst +end function ContinuumCreateConst + +!! Create, general, non-const +function ContinuumCreate( & + XYs1d & +) & + bind(C, name='ContinuumCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: ContinuumCreate +end function ContinuumCreate + +!! Assign +subroutine ContinuumAssign(handleLHS, handleRHS) & + bind(C, name='ContinuumAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ContinuumAssign + +!! Delete +subroutine ContinuumDelete(handle) & + bind(C, name='ContinuumDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ContinuumDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ContinuumRead(handle, filename, filenameSize) & + bind(C, name='ContinuumRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ContinuumRead +end function ContinuumRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ContinuumWrite(handle, filename, filenameSize) & + bind(C, name='ContinuumWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ContinuumWrite +end function ContinuumWrite + +!! Print to standard output, in our prettyprinting format +function ContinuumPrint(handle) & + bind(C, name='ContinuumPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ContinuumPrint +end function ContinuumPrint + +!! Print to standard output, as XML +function ContinuumPrintXML(handle) & + bind(C, name='ContinuumPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ContinuumPrintXML +end function ContinuumPrintXML + +!! Print to standard output, as JSON +function ContinuumPrintJSON(handle) & + bind(C, name='ContinuumPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ContinuumPrintJSON +end function ContinuumPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function ContinuumXYs1dHas(handle) & + bind(C, name='ContinuumXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ContinuumXYs1dHas +end function ContinuumXYs1dHas + +!! Get, const +function ContinuumXYs1dGetConst(handle) & + bind(C, name='ContinuumXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ContinuumXYs1dGetConst +end function ContinuumXYs1dGetConst + +!! Get, non-const +function ContinuumXYs1dGet(handle) & + bind(C, name='ContinuumXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ContinuumXYs1dGet +end function ContinuumXYs1dGet + +!! Set +subroutine ContinuumXYs1dSet(handle, fieldHandle) & + bind(C, name='ContinuumXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ContinuumXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalContinuum diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Conversion.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Conversion.f03 new file mode 100644 index 000000000..2e97e4472 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Conversion.f03 @@ -0,0 +1,213 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalConversion +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ConversionDefaultConst() & + bind(C, name='ConversionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ConversionDefaultConst +end function ConversionDefaultConst + +!! Create, default, non-const +function ConversionDefault() & + bind(C, name='ConversionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ConversionDefault +end function ConversionDefault + +!! Create, general, const +function ConversionCreateConst( & + flags, & + href, & + flagsSize, & + hrefSize & +) & + bind(C, name='ConversionCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: flagsSize + character(c_char), intent(in) :: flags(flagsSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: ConversionCreateConst +end function ConversionCreateConst + +!! Create, general, non-const +function ConversionCreate( & + flags, & + href, & + flagsSize, & + hrefSize & +) & + bind(C, name='ConversionCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: flagsSize + character(c_char), intent(in) :: flags(flagsSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: ConversionCreate +end function ConversionCreate + +!! Assign +subroutine ConversionAssign(handleLHS, handleRHS) & + bind(C, name='ConversionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ConversionAssign + +!! Delete +subroutine ConversionDelete(handle) & + bind(C, name='ConversionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ConversionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ConversionRead(handle, filename, filenameSize) & + bind(C, name='ConversionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ConversionRead +end function ConversionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ConversionWrite(handle, filename, filenameSize) & + bind(C, name='ConversionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ConversionWrite +end function ConversionWrite + +!! Print to standard output, in our prettyprinting format +function ConversionPrint(handle) & + bind(C, name='ConversionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConversionPrint +end function ConversionPrint + +!! Print to standard output, as XML +function ConversionPrintXML(handle) & + bind(C, name='ConversionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConversionPrintXML +end function ConversionPrintXML + +!! Print to standard output, as JSON +function ConversionPrintJSON(handle) & + bind(C, name='ConversionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConversionPrintJSON +end function ConversionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: flags +!! ----------------------------------------------------------------------------- + +!! Has +function ConversionFlagsHas(handle) & + bind(C, name='ConversionFlagsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConversionFlagsHas +end function ConversionFlagsHas + +!! Get +function ConversionFlagsGet(handle) & + bind(C, name='ConversionFlagsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ConversionFlagsGet +end function ConversionFlagsGet + +!! Set +subroutine ConversionFlagsSet(handle, flags, flagsSize) & + bind(C, name='ConversionFlagsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: flagsSize + character(c_char), intent(in) :: flags(flagsSize) +end subroutine ConversionFlagsSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function ConversionHrefHas(handle) & + bind(C, name='ConversionHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ConversionHrefHas +end function ConversionHrefHas + +!! Get +function ConversionHrefGet(handle) & + bind(C, name='ConversionHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ConversionHrefGet +end function ConversionHrefGet + +!! Set +subroutine ConversionHrefSet(handle, href, hrefSize) & + bind(C, name='ConversionHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine ConversionHrefSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalConversion diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CoulombPlusNuclearElastic.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CoulombPlusNuclearElastic.f03 new file mode 100644 index 000000000..b3a03e573 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CoulombPlusNuclearElastic.f03 @@ -0,0 +1,466 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalCoulombPlusNuclearElastic +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CoulombPlusNuclearElasticDefaultConst() & + bind(C, name='CoulombPlusNuclearElasticDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CoulombPlusNuclearElasticDefaultConst +end function CoulombPlusNuclearElasticDefaultConst + +!! Create, default, non-const +function CoulombPlusNuclearElasticDefault() & + bind(C, name='CoulombPlusNuclearElasticDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CoulombPlusNuclearElasticDefault +end function CoulombPlusNuclearElasticDefault + +!! Create, general, const +function CoulombPlusNuclearElasticCreateConst( & + label, & + href, & + pid, & + productFrame, & + identicalParticles, & + RutherfordScattering, & + nuclearAmplitudeExpansion, & + nuclearPlusInterference, & + labelSize, & + hrefSize, & + pidSize, & + productFrameSize & +) & + bind(C, name='CoulombPlusNuclearElasticCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + logical(c_bool), intent(in), value :: identicalParticles + type(c_ptr), intent(in), value :: RutherfordScattering + type(c_ptr), intent(in), value :: nuclearAmplitudeExpansion + type(c_ptr), intent(in), value :: nuclearPlusInterference + type(c_ptr) :: CoulombPlusNuclearElasticCreateConst +end function CoulombPlusNuclearElasticCreateConst + +!! Create, general, non-const +function CoulombPlusNuclearElasticCreate( & + label, & + href, & + pid, & + productFrame, & + identicalParticles, & + RutherfordScattering, & + nuclearAmplitudeExpansion, & + nuclearPlusInterference, & + labelSize, & + hrefSize, & + pidSize, & + productFrameSize & +) & + bind(C, name='CoulombPlusNuclearElasticCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + logical(c_bool), intent(in), value :: identicalParticles + type(c_ptr), intent(in), value :: RutherfordScattering + type(c_ptr), intent(in), value :: nuclearAmplitudeExpansion + type(c_ptr), intent(in), value :: nuclearPlusInterference + type(c_ptr) :: CoulombPlusNuclearElasticCreate +end function CoulombPlusNuclearElasticCreate + +!! Assign +subroutine CoulombPlusNuclearElasticAssign(handleLHS, handleRHS) & + bind(C, name='CoulombPlusNuclearElasticAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CoulombPlusNuclearElasticAssign + +!! Delete +subroutine CoulombPlusNuclearElasticDelete(handle) & + bind(C, name='CoulombPlusNuclearElasticDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CoulombPlusNuclearElasticDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CoulombPlusNuclearElasticRead(handle, filename, filenameSize) & + bind(C, name='CoulombPlusNuclearElasticRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CoulombPlusNuclearElasticRead +end function CoulombPlusNuclearElasticRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CoulombPlusNuclearElasticWrite(handle, filename, filenameSize) & + bind(C, name='CoulombPlusNuclearElasticWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CoulombPlusNuclearElasticWrite +end function CoulombPlusNuclearElasticWrite + +!! Print to standard output, in our prettyprinting format +function CoulombPlusNuclearElasticPrint(handle) & + bind(C, name='CoulombPlusNuclearElasticPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoulombPlusNuclearElasticPrint +end function CoulombPlusNuclearElasticPrint + +!! Print to standard output, as XML +function CoulombPlusNuclearElasticPrintXML(handle) & + bind(C, name='CoulombPlusNuclearElasticPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoulombPlusNuclearElasticPrintXML +end function CoulombPlusNuclearElasticPrintXML + +!! Print to standard output, as JSON +function CoulombPlusNuclearElasticPrintJSON(handle) & + bind(C, name='CoulombPlusNuclearElasticPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoulombPlusNuclearElasticPrintJSON +end function CoulombPlusNuclearElasticPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function CoulombPlusNuclearElasticLabelHas(handle) & + bind(C, name='CoulombPlusNuclearElasticLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoulombPlusNuclearElasticLabelHas +end function CoulombPlusNuclearElasticLabelHas + +!! Get +function CoulombPlusNuclearElasticLabelGet(handle) & + bind(C, name='CoulombPlusNuclearElasticLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoulombPlusNuclearElasticLabelGet +end function CoulombPlusNuclearElasticLabelGet + +!! Set +subroutine CoulombPlusNuclearElasticLabelSet(handle, label, labelSize) & + bind(C, name='CoulombPlusNuclearElasticLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine CoulombPlusNuclearElasticLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function CoulombPlusNuclearElasticHrefHas(handle) & + bind(C, name='CoulombPlusNuclearElasticHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoulombPlusNuclearElasticHrefHas +end function CoulombPlusNuclearElasticHrefHas + +!! Get +function CoulombPlusNuclearElasticHrefGet(handle) & + bind(C, name='CoulombPlusNuclearElasticHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoulombPlusNuclearElasticHrefGet +end function CoulombPlusNuclearElasticHrefGet + +!! Set +subroutine CoulombPlusNuclearElasticHrefSet(handle, href, hrefSize) & + bind(C, name='CoulombPlusNuclearElasticHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine CoulombPlusNuclearElasticHrefSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function CoulombPlusNuclearElasticPidHas(handle) & + bind(C, name='CoulombPlusNuclearElasticPidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoulombPlusNuclearElasticPidHas +end function CoulombPlusNuclearElasticPidHas + +!! Get +function CoulombPlusNuclearElasticPidGet(handle) & + bind(C, name='CoulombPlusNuclearElasticPidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoulombPlusNuclearElasticPidGet +end function CoulombPlusNuclearElasticPidGet + +!! Set +subroutine CoulombPlusNuclearElasticPidSet(handle, pid, pidSize) & + bind(C, name='CoulombPlusNuclearElasticPidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine CoulombPlusNuclearElasticPidSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function CoulombPlusNuclearElasticProductFrameHas(handle) & + bind(C, name='CoulombPlusNuclearElasticProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoulombPlusNuclearElasticProductFrameHas +end function CoulombPlusNuclearElasticProductFrameHas + +!! Get +function CoulombPlusNuclearElasticProductFrameGet(handle) & + bind(C, name='CoulombPlusNuclearElasticProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoulombPlusNuclearElasticProductFrameGet +end function CoulombPlusNuclearElasticProductFrameGet + +!! Set +subroutine CoulombPlusNuclearElasticProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='CoulombPlusNuclearElasticProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine CoulombPlusNuclearElasticProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: identicalParticles +!! ----------------------------------------------------------------------------- + +!! Has +function CoulombPlusNuclearElasticIdenticalParticlesHas(handle) & + bind(C, name='CoulombPlusNuclearElasticIdenticalParticlesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoulombPlusNuclearElasticIdenticalParticlesHas +end function CoulombPlusNuclearElasticIdenticalParticlesHas + +!! Get +function CoulombPlusNuclearElasticIdenticalParticlesGet(handle) & + bind(C, name='CoulombPlusNuclearElasticIdenticalParticlesGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: CoulombPlusNuclearElasticIdenticalParticlesGet +end function CoulombPlusNuclearElasticIdenticalParticlesGet + +!! Set +subroutine CoulombPlusNuclearElasticIdenticalParticlesSet(handle, identicalParticles) & + bind(C, name='CoulombPlusNuclearElasticIdenticalParticlesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: identicalParticles +end subroutine CoulombPlusNuclearElasticIdenticalParticlesSet + + +!! ----------------------------------------------------------------------------- +!! Child: RutherfordScattering +!! ----------------------------------------------------------------------------- + +!! Has +function CoulombPlusNuclearElasticRutherfordScatteringHas(handle) & + bind(C, name='CoulombPlusNuclearElasticRutherfordScatteringHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoulombPlusNuclearElasticRutherfordScatteringHas +end function CoulombPlusNuclearElasticRutherfordScatteringHas + +!! Get, const +function CoulombPlusNuclearElasticRutherfordScatteringGetConst(handle) & + bind(C, name='CoulombPlusNuclearElasticRutherfordScatteringGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoulombPlusNuclearElasticRutherfordScatteringGetConst +end function CoulombPlusNuclearElasticRutherfordScatteringGetConst + +!! Get, non-const +function CoulombPlusNuclearElasticRutherfordScatteringGet(handle) & + bind(C, name='CoulombPlusNuclearElasticRutherfordScatteringGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CoulombPlusNuclearElasticRutherfordScatteringGet +end function CoulombPlusNuclearElasticRutherfordScatteringGet + +!! Set +subroutine CoulombPlusNuclearElasticRutherfordScatteringSet(handle, fieldHandle) & + bind(C, name='CoulombPlusNuclearElasticRutherfordScatteringSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CoulombPlusNuclearElasticRutherfordScatteringSet + + +!! ----------------------------------------------------------------------------- +!! Child: nuclearAmplitudeExpansion +!! ----------------------------------------------------------------------------- + +!! Has +function CoulombPlusNuclearElasticNuclearAmplitudeExpansionHas(handle) & + bind(C, name='CoulombPlusNuclearElasticNuclearAmplitudeExpansionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoulombPlusNuclearElasticNuclearAmplitudeExpansionHas +end function CoulombPlusNuclearElasticNuclearAmplitudeExpansionHas + +!! Get, const +function CoulombPlusNuclearElasticNuclearAmplitudeExpansionGetConst(handle) & + bind(C, name='CoulombPlusNuclearElasticNuclearAmplitudeExpansionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoulombPlusNuclearElasticNuclearAmplitudeExpansionGetConst +end function CoulombPlusNuclearElasticNuclearAmplitudeExpansionGetConst + +!! Get, non-const +function CoulombPlusNuclearElasticNuclearAmplitudeExpansionGet(handle) & + bind(C, name='CoulombPlusNuclearElasticNuclearAmplitudeExpansionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CoulombPlusNuclearElasticNuclearAmplitudeExpansionGet +end function CoulombPlusNuclearElasticNuclearAmplitudeExpansionGet + +!! Set +subroutine CoulombPlusNuclearElasticNuclearAmplitudeExpansionSet(handle, fieldHandle) & + bind(C, name='CoulombPlusNuclearElasticNuclearAmplitudeExpansionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CoulombPlusNuclearElasticNuclearAmplitudeExpansionSet + + +!! ----------------------------------------------------------------------------- +!! Child: nuclearPlusInterference +!! ----------------------------------------------------------------------------- + +!! Has +function CoulombPlusNuclearElasticNuclearPlusInterferenceHas(handle) & + bind(C, name='CoulombPlusNuclearElasticNuclearPlusInterferenceHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CoulombPlusNuclearElasticNuclearPlusInterferenceHas +end function CoulombPlusNuclearElasticNuclearPlusInterferenceHas + +!! Get, const +function CoulombPlusNuclearElasticNuclearPlusInterferenceGetConst(handle) & + bind(C, name='CoulombPlusNuclearElasticNuclearPlusInterferenceGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CoulombPlusNuclearElasticNuclearPlusInterferenceGetConst +end function CoulombPlusNuclearElasticNuclearPlusInterferenceGetConst + +!! Get, non-const +function CoulombPlusNuclearElasticNuclearPlusInterferenceGet(handle) & + bind(C, name='CoulombPlusNuclearElasticNuclearPlusInterferenceGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CoulombPlusNuclearElasticNuclearPlusInterferenceGet +end function CoulombPlusNuclearElasticNuclearPlusInterferenceGet + +!! Set +subroutine CoulombPlusNuclearElasticNuclearPlusInterferenceSet(handle, fieldHandle) & + bind(C, name='CoulombPlusNuclearElasticNuclearPlusInterferenceSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CoulombPlusNuclearElasticNuclearPlusInterferenceSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalCoulombPlusNuclearElastic diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Covariance.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Covariance.f03 new file mode 100644 index 000000000..8b57fa858 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Covariance.f03 @@ -0,0 +1,258 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalCovariance +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CovarianceDefaultConst() & + bind(C, name='CovarianceDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CovarianceDefaultConst +end function CovarianceDefaultConst + +!! Create, default, non-const +function CovarianceDefault() & + bind(C, name='CovarianceDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CovarianceDefault +end function CovarianceDefault + +!! Create, general, const +function CovarianceCreateConst( & + label, & + href, & + array, & + labelSize, & + hrefSize & +) & + bind(C, name='CovarianceCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr), intent(in), value :: array + type(c_ptr) :: CovarianceCreateConst +end function CovarianceCreateConst + +!! Create, general, non-const +function CovarianceCreate( & + label, & + href, & + array, & + labelSize, & + hrefSize & +) & + bind(C, name='CovarianceCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr), intent(in), value :: array + type(c_ptr) :: CovarianceCreate +end function CovarianceCreate + +!! Assign +subroutine CovarianceAssign(handleLHS, handleRHS) & + bind(C, name='CovarianceAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CovarianceAssign + +!! Delete +subroutine CovarianceDelete(handle) & + bind(C, name='CovarianceDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CovarianceDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CovarianceRead(handle, filename, filenameSize) & + bind(C, name='CovarianceRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CovarianceRead +end function CovarianceRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CovarianceWrite(handle, filename, filenameSize) & + bind(C, name='CovarianceWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CovarianceWrite +end function CovarianceWrite + +!! Print to standard output, in our prettyprinting format +function CovariancePrint(handle) & + bind(C, name='CovariancePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovariancePrint +end function CovariancePrint + +!! Print to standard output, as XML +function CovariancePrintXML(handle) & + bind(C, name='CovariancePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovariancePrintXML +end function CovariancePrintXML + +!! Print to standard output, as JSON +function CovariancePrintJSON(handle) & + bind(C, name='CovariancePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovariancePrintJSON +end function CovariancePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceLabelHas(handle) & + bind(C, name='CovarianceLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceLabelHas +end function CovarianceLabelHas + +!! Get +function CovarianceLabelGet(handle) & + bind(C, name='CovarianceLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceLabelGet +end function CovarianceLabelGet + +!! Set +subroutine CovarianceLabelSet(handle, label, labelSize) & + bind(C, name='CovarianceLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine CovarianceLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceHrefHas(handle) & + bind(C, name='CovarianceHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceHrefHas +end function CovarianceHrefHas + +!! Get +function CovarianceHrefGet(handle) & + bind(C, name='CovarianceHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceHrefGet +end function CovarianceHrefGet + +!! Set +subroutine CovarianceHrefSet(handle, href, hrefSize) & + bind(C, name='CovarianceHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine CovarianceHrefSet + + +!! ----------------------------------------------------------------------------- +!! Child: array +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceArrayHas(handle) & + bind(C, name='CovarianceArrayHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceArrayHas +end function CovarianceArrayHas + +!! Get, const +function CovarianceArrayGetConst(handle) & + bind(C, name='CovarianceArrayGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceArrayGetConst +end function CovarianceArrayGetConst + +!! Get, non-const +function CovarianceArrayGet(handle) & + bind(C, name='CovarianceArrayGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CovarianceArrayGet +end function CovarianceArrayGet + +!! Set +subroutine CovarianceArraySet(handle, fieldHandle) & + bind(C, name='CovarianceArraySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceArraySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalCovariance diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CovarianceMatrix.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CovarianceMatrix.f03 new file mode 100644 index 000000000..8509999d9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CovarianceMatrix.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalCovarianceMatrix +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CovarianceMatrixDefaultConst() & + bind(C, name='CovarianceMatrixDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CovarianceMatrixDefaultConst +end function CovarianceMatrixDefaultConst + +!! Create, default, non-const +function CovarianceMatrixDefault() & + bind(C, name='CovarianceMatrixDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CovarianceMatrixDefault +end function CovarianceMatrixDefault + +!! Create, general, const +function CovarianceMatrixCreateConst( & + label, & + type1, & + productFrame, & + gridded2d, & + labelSize, & + type1Size, & + productFrameSize & +) & + bind(C, name='CovarianceMatrixCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: gridded2d + type(c_ptr) :: CovarianceMatrixCreateConst +end function CovarianceMatrixCreateConst + +!! Create, general, non-const +function CovarianceMatrixCreate( & + label, & + type1, & + productFrame, & + gridded2d, & + labelSize, & + type1Size, & + productFrameSize & +) & + bind(C, name='CovarianceMatrixCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: gridded2d + type(c_ptr) :: CovarianceMatrixCreate +end function CovarianceMatrixCreate + +!! Assign +subroutine CovarianceMatrixAssign(handleLHS, handleRHS) & + bind(C, name='CovarianceMatrixAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CovarianceMatrixAssign + +!! Delete +subroutine CovarianceMatrixDelete(handle) & + bind(C, name='CovarianceMatrixDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CovarianceMatrixDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CovarianceMatrixRead(handle, filename, filenameSize) & + bind(C, name='CovarianceMatrixRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CovarianceMatrixRead +end function CovarianceMatrixRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CovarianceMatrixWrite(handle, filename, filenameSize) & + bind(C, name='CovarianceMatrixWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CovarianceMatrixWrite +end function CovarianceMatrixWrite + +!! Print to standard output, in our prettyprinting format +function CovarianceMatrixPrint(handle) & + bind(C, name='CovarianceMatrixPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceMatrixPrint +end function CovarianceMatrixPrint + +!! Print to standard output, as XML +function CovarianceMatrixPrintXML(handle) & + bind(C, name='CovarianceMatrixPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceMatrixPrintXML +end function CovarianceMatrixPrintXML + +!! Print to standard output, as JSON +function CovarianceMatrixPrintJSON(handle) & + bind(C, name='CovarianceMatrixPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceMatrixPrintJSON +end function CovarianceMatrixPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceMatrixLabelHas(handle) & + bind(C, name='CovarianceMatrixLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceMatrixLabelHas +end function CovarianceMatrixLabelHas + +!! Get +function CovarianceMatrixLabelGet(handle) & + bind(C, name='CovarianceMatrixLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceMatrixLabelGet +end function CovarianceMatrixLabelGet + +!! Set +subroutine CovarianceMatrixLabelSet(handle, label, labelSize) & + bind(C, name='CovarianceMatrixLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine CovarianceMatrixLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: type +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceMatrixTypeHas(handle) & + bind(C, name='CovarianceMatrixTypeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceMatrixTypeHas +end function CovarianceMatrixTypeHas + +!! Get +function CovarianceMatrixTypeGet(handle) & + bind(C, name='CovarianceMatrixTypeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceMatrixTypeGet +end function CovarianceMatrixTypeGet + +!! Set +subroutine CovarianceMatrixTypeSet(handle, type1, type1Size) & + bind(C, name='CovarianceMatrixTypeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) +end subroutine CovarianceMatrixTypeSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceMatrixProductFrameHas(handle) & + bind(C, name='CovarianceMatrixProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceMatrixProductFrameHas +end function CovarianceMatrixProductFrameHas + +!! Get +function CovarianceMatrixProductFrameGet(handle) & + bind(C, name='CovarianceMatrixProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceMatrixProductFrameGet +end function CovarianceMatrixProductFrameGet + +!! Set +subroutine CovarianceMatrixProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='CovarianceMatrixProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine CovarianceMatrixProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Child: gridded2d +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceMatrixGridded2dHas(handle) & + bind(C, name='CovarianceMatrixGridded2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceMatrixGridded2dHas +end function CovarianceMatrixGridded2dHas + +!! Get, const +function CovarianceMatrixGridded2dGetConst(handle) & + bind(C, name='CovarianceMatrixGridded2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceMatrixGridded2dGetConst +end function CovarianceMatrixGridded2dGetConst + +!! Get, non-const +function CovarianceMatrixGridded2dGet(handle) & + bind(C, name='CovarianceMatrixGridded2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CovarianceMatrixGridded2dGet +end function CovarianceMatrixGridded2dGet + +!! Set +subroutine CovarianceMatrixGridded2dSet(handle, fieldHandle) & + bind(C, name='CovarianceMatrixGridded2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceMatrixGridded2dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalCovarianceMatrix diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CovarianceSection.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CovarianceSection.f03 new file mode 100644 index 000000000..86b9c91a2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CovarianceSection.f03 @@ -0,0 +1,433 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalCovarianceSection +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CovarianceSectionDefaultConst() & + bind(C, name='CovarianceSectionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CovarianceSectionDefaultConst +end function CovarianceSectionDefaultConst + +!! Create, default, non-const +function CovarianceSectionDefault() & + bind(C, name='CovarianceSectionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CovarianceSectionDefault +end function CovarianceSectionDefault + +!! Create, general, const +function CovarianceSectionCreateConst( & + label, & + crossTerm, & + rowData, & + columnData, & + covarianceMatrix, & + mixed, & + sum, & + labelSize & +) & + bind(C, name='CovarianceSectionCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + logical(c_bool), intent(in), value :: crossTerm + type(c_ptr), intent(in), value :: rowData + type(c_ptr), intent(in), value :: columnData + type(c_ptr), intent(in), value :: covarianceMatrix + type(c_ptr), intent(in), value :: mixed + type(c_ptr), intent(in), value :: sum + type(c_ptr) :: CovarianceSectionCreateConst +end function CovarianceSectionCreateConst + +!! Create, general, non-const +function CovarianceSectionCreate( & + label, & + crossTerm, & + rowData, & + columnData, & + covarianceMatrix, & + mixed, & + sum, & + labelSize & +) & + bind(C, name='CovarianceSectionCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + logical(c_bool), intent(in), value :: crossTerm + type(c_ptr), intent(in), value :: rowData + type(c_ptr), intent(in), value :: columnData + type(c_ptr), intent(in), value :: covarianceMatrix + type(c_ptr), intent(in), value :: mixed + type(c_ptr), intent(in), value :: sum + type(c_ptr) :: CovarianceSectionCreate +end function CovarianceSectionCreate + +!! Assign +subroutine CovarianceSectionAssign(handleLHS, handleRHS) & + bind(C, name='CovarianceSectionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CovarianceSectionAssign + +!! Delete +subroutine CovarianceSectionDelete(handle) & + bind(C, name='CovarianceSectionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CovarianceSectionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CovarianceSectionRead(handle, filename, filenameSize) & + bind(C, name='CovarianceSectionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CovarianceSectionRead +end function CovarianceSectionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CovarianceSectionWrite(handle, filename, filenameSize) & + bind(C, name='CovarianceSectionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CovarianceSectionWrite +end function CovarianceSectionWrite + +!! Print to standard output, in our prettyprinting format +function CovarianceSectionPrint(handle) & + bind(C, name='CovarianceSectionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionPrint +end function CovarianceSectionPrint + +!! Print to standard output, as XML +function CovarianceSectionPrintXML(handle) & + bind(C, name='CovarianceSectionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionPrintXML +end function CovarianceSectionPrintXML + +!! Print to standard output, as JSON +function CovarianceSectionPrintJSON(handle) & + bind(C, name='CovarianceSectionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionPrintJSON +end function CovarianceSectionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSectionLabelHas(handle) & + bind(C, name='CovarianceSectionLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionLabelHas +end function CovarianceSectionLabelHas + +!! Get +function CovarianceSectionLabelGet(handle) & + bind(C, name='CovarianceSectionLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSectionLabelGet +end function CovarianceSectionLabelGet + +!! Set +subroutine CovarianceSectionLabelSet(handle, label, labelSize) & + bind(C, name='CovarianceSectionLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine CovarianceSectionLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: crossTerm +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSectionCrossTermHas(handle) & + bind(C, name='CovarianceSectionCrossTermHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionCrossTermHas +end function CovarianceSectionCrossTermHas + +!! Get +function CovarianceSectionCrossTermGet(handle) & + bind(C, name='CovarianceSectionCrossTermGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: CovarianceSectionCrossTermGet +end function CovarianceSectionCrossTermGet + +!! Set +subroutine CovarianceSectionCrossTermSet(handle, crossTerm) & + bind(C, name='CovarianceSectionCrossTermSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: crossTerm +end subroutine CovarianceSectionCrossTermSet + + +!! ----------------------------------------------------------------------------- +!! Child: rowData +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSectionRowDataHas(handle) & + bind(C, name='CovarianceSectionRowDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionRowDataHas +end function CovarianceSectionRowDataHas + +!! Get, const +function CovarianceSectionRowDataGetConst(handle) & + bind(C, name='CovarianceSectionRowDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSectionRowDataGetConst +end function CovarianceSectionRowDataGetConst + +!! Get, non-const +function CovarianceSectionRowDataGet(handle) & + bind(C, name='CovarianceSectionRowDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CovarianceSectionRowDataGet +end function CovarianceSectionRowDataGet + +!! Set +subroutine CovarianceSectionRowDataSet(handle, fieldHandle) & + bind(C, name='CovarianceSectionRowDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSectionRowDataSet + + +!! ----------------------------------------------------------------------------- +!! Child: columnData +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSectionColumnDataHas(handle) & + bind(C, name='CovarianceSectionColumnDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionColumnDataHas +end function CovarianceSectionColumnDataHas + +!! Get, const +function CovarianceSectionColumnDataGetConst(handle) & + bind(C, name='CovarianceSectionColumnDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSectionColumnDataGetConst +end function CovarianceSectionColumnDataGetConst + +!! Get, non-const +function CovarianceSectionColumnDataGet(handle) & + bind(C, name='CovarianceSectionColumnDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CovarianceSectionColumnDataGet +end function CovarianceSectionColumnDataGet + +!! Set +subroutine CovarianceSectionColumnDataSet(handle, fieldHandle) & + bind(C, name='CovarianceSectionColumnDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSectionColumnDataSet + + +!! ----------------------------------------------------------------------------- +!! Child: covarianceMatrix +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSectionCovarianceMatrixHas(handle) & + bind(C, name='CovarianceSectionCovarianceMatrixHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionCovarianceMatrixHas +end function CovarianceSectionCovarianceMatrixHas + +!! Get, const +function CovarianceSectionCovarianceMatrixGetConst(handle) & + bind(C, name='CovarianceSectionCovarianceMatrixGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSectionCovarianceMatrixGetConst +end function CovarianceSectionCovarianceMatrixGetConst + +!! Get, non-const +function CovarianceSectionCovarianceMatrixGet(handle) & + bind(C, name='CovarianceSectionCovarianceMatrixGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CovarianceSectionCovarianceMatrixGet +end function CovarianceSectionCovarianceMatrixGet + +!! Set +subroutine CovarianceSectionCovarianceMatrixSet(handle, fieldHandle) & + bind(C, name='CovarianceSectionCovarianceMatrixSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSectionCovarianceMatrixSet + + +!! ----------------------------------------------------------------------------- +!! Child: mixed +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSectionMixedHas(handle) & + bind(C, name='CovarianceSectionMixedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionMixedHas +end function CovarianceSectionMixedHas + +!! Get, const +function CovarianceSectionMixedGetConst(handle) & + bind(C, name='CovarianceSectionMixedGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSectionMixedGetConst +end function CovarianceSectionMixedGetConst + +!! Get, non-const +function CovarianceSectionMixedGet(handle) & + bind(C, name='CovarianceSectionMixedGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CovarianceSectionMixedGet +end function CovarianceSectionMixedGet + +!! Set +subroutine CovarianceSectionMixedSet(handle, fieldHandle) & + bind(C, name='CovarianceSectionMixedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSectionMixedSet + + +!! ----------------------------------------------------------------------------- +!! Child: sum +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSectionSumHas(handle) & + bind(C, name='CovarianceSectionSumHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionSumHas +end function CovarianceSectionSumHas + +!! Get, const +function CovarianceSectionSumGetConst(handle) & + bind(C, name='CovarianceSectionSumGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSectionSumGetConst +end function CovarianceSectionSumGetConst + +!! Get, non-const +function CovarianceSectionSumGet(handle) & + bind(C, name='CovarianceSectionSumGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CovarianceSectionSumGet +end function CovarianceSectionSumGet + +!! Set +subroutine CovarianceSectionSumSet(handle, fieldHandle) & + bind(C, name='CovarianceSectionSumSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSectionSumSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalCovarianceSection diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CovarianceSections.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CovarianceSections.f03 new file mode 100644 index 000000000..2dc11bcaa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CovarianceSections.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalCovarianceSections +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CovarianceSectionsDefaultConst() & + bind(C, name='CovarianceSectionsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CovarianceSectionsDefaultConst +end function CovarianceSectionsDefaultConst + +!! Create, default, non-const +function CovarianceSectionsDefault() & + bind(C, name='CovarianceSectionsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CovarianceSectionsDefault +end function CovarianceSectionsDefault + +!! Create, general, const +function CovarianceSectionsCreateConst( & + covarianceSection, covarianceSectionSize & +) & + bind(C, name='CovarianceSectionsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: covarianceSectionSize + type(c_ptr), intent(in) :: covarianceSection(covarianceSectionSize) + type(c_ptr) :: CovarianceSectionsCreateConst +end function CovarianceSectionsCreateConst + +!! Create, general, non-const +function CovarianceSectionsCreate( & + covarianceSection, covarianceSectionSize & +) & + bind(C, name='CovarianceSectionsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: covarianceSectionSize + type(c_ptr), intent(in) :: covarianceSection(covarianceSectionSize) + type(c_ptr) :: CovarianceSectionsCreate +end function CovarianceSectionsCreate + +!! Assign +subroutine CovarianceSectionsAssign(handleLHS, handleRHS) & + bind(C, name='CovarianceSectionsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CovarianceSectionsAssign + +!! Delete +subroutine CovarianceSectionsDelete(handle) & + bind(C, name='CovarianceSectionsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CovarianceSectionsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CovarianceSectionsRead(handle, filename, filenameSize) & + bind(C, name='CovarianceSectionsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CovarianceSectionsRead +end function CovarianceSectionsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CovarianceSectionsWrite(handle, filename, filenameSize) & + bind(C, name='CovarianceSectionsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CovarianceSectionsWrite +end function CovarianceSectionsWrite + +!! Print to standard output, in our prettyprinting format +function CovarianceSectionsPrint(handle) & + bind(C, name='CovarianceSectionsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionsPrint +end function CovarianceSectionsPrint + +!! Print to standard output, as XML +function CovarianceSectionsPrintXML(handle) & + bind(C, name='CovarianceSectionsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionsPrintXML +end function CovarianceSectionsPrintXML + +!! Print to standard output, as JSON +function CovarianceSectionsPrintJSON(handle) & + bind(C, name='CovarianceSectionsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionsPrintJSON +end function CovarianceSectionsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: covarianceSection +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSectionsCovarianceSectionHas(handle) & + bind(C, name='CovarianceSectionsCovarianceSectionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSectionsCovarianceSectionHas +end function CovarianceSectionsCovarianceSectionHas + +!! Clear +subroutine CovarianceSectionsCovarianceSectionClear(handle) & + bind(C, name='CovarianceSectionsCovarianceSectionClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CovarianceSectionsCovarianceSectionClear + +!! Size +function CovarianceSectionsCovarianceSectionSize(handle) & + bind(C, name='CovarianceSectionsCovarianceSectionSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: CovarianceSectionsCovarianceSectionSize +end function CovarianceSectionsCovarianceSectionSize + +!! Add +subroutine CovarianceSectionsCovarianceSectionAdd(handle, fieldHandle) & + bind(C, name='CovarianceSectionsCovarianceSectionAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSectionsCovarianceSectionAdd + +!! Get, by index \in [0,size), const +function CovarianceSectionsCovarianceSectionGetConst(handle, index) & + bind(C, name='CovarianceSectionsCovarianceSectionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: CovarianceSectionsCovarianceSectionGetConst +end function CovarianceSectionsCovarianceSectionGetConst + +!! Get, by index \in [0,size), non-const +function CovarianceSectionsCovarianceSectionGet(handle, index) & + bind(C, name='CovarianceSectionsCovarianceSectionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: CovarianceSectionsCovarianceSectionGet +end function CovarianceSectionsCovarianceSectionGet + +!! Set, by index \in [0,size) +subroutine CovarianceSectionsCovarianceSectionSet(handle, index, fieldHandle) & + bind(C, name='CovarianceSectionsCovarianceSectionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSectionsCovarianceSectionSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function CovarianceSectionsCovarianceSectionHasByLabel(handle, meta, metaSize) & + bind(C, name='CovarianceSectionsCovarianceSectionHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: CovarianceSectionsCovarianceSectionHasByLabel +end function CovarianceSectionsCovarianceSectionHasByLabel + +!! Get, by label, const +function CovarianceSectionsCovarianceSectionGetByLabelConst(handle, meta, metaSize) & + bind(C, name='CovarianceSectionsCovarianceSectionGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: CovarianceSectionsCovarianceSectionGetByLabelConst +end function CovarianceSectionsCovarianceSectionGetByLabelConst + +!! Get, by label, non-const +function CovarianceSectionsCovarianceSectionGetByLabel(handle, meta, metaSize) & + bind(C, name='CovarianceSectionsCovarianceSectionGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: CovarianceSectionsCovarianceSectionGetByLabel +end function CovarianceSectionsCovarianceSectionGetByLabel + +!! Set, by label +subroutine CovarianceSectionsCovarianceSectionSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='CovarianceSectionsCovarianceSectionSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSectionsCovarianceSectionSetByLabel + +!! ------------------------ +!! Re: metadatum crossTerm +!! ------------------------ + +!! Has, by crossTerm +function CovarianceSectionsCovarianceSectionHasByCrossTerm(handle, meta) & + bind(C, name='CovarianceSectionsCovarianceSectionHasByCrossTerm') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool), intent(in), value :: meta + integer(c_int) :: CovarianceSectionsCovarianceSectionHasByCrossTerm +end function CovarianceSectionsCovarianceSectionHasByCrossTerm + +!! Get, by crossTerm, const +function CovarianceSectionsCovarianceSectionGetByCrossTermConst(handle, meta) & + bind(C, name='CovarianceSectionsCovarianceSectionGetByCrossTermConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr) :: CovarianceSectionsCovarianceSectionGetByCrossTermConst +end function CovarianceSectionsCovarianceSectionGetByCrossTermConst + +!! Get, by crossTerm, non-const +function CovarianceSectionsCovarianceSectionGetByCrossTerm(handle, meta) & + bind(C, name='CovarianceSectionsCovarianceSectionGetByCrossTerm') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr) :: CovarianceSectionsCovarianceSectionGetByCrossTerm +end function CovarianceSectionsCovarianceSectionGetByCrossTerm + +!! Set, by crossTerm +subroutine CovarianceSectionsCovarianceSectionSetByCrossTerm(handle, meta, fieldHandle) & + bind(C, name='CovarianceSectionsCovarianceSectionSetByCrossTerm') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSectionsCovarianceSectionSetByCrossTerm + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalCovarianceSections diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSection.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSection.f03 new file mode 100644 index 000000000..8ddc22af3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSection.f03 @@ -0,0 +1,401 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalCrossSection +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CrossSectionDefaultConst() & + bind(C, name='CrossSectionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionDefaultConst +end function CrossSectionDefaultConst + +!! Create, default, non-const +function CrossSectionDefault() & + bind(C, name='CrossSectionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionDefault +end function CrossSectionDefault + +!! Create, general, const +function CrossSectionCreateConst( & + XYs1d, & + regions1d, & + reference, & + resonancesWithBackground, & + CoulombPlusNuclearElastic, & + thermalNeutronScatteringLaw1d & +) & + bind(C, name='CrossSectionCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr), intent(in), value :: reference + type(c_ptr), intent(in), value :: resonancesWithBackground + type(c_ptr), intent(in), value :: CoulombPlusNuclearElastic + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw1d + type(c_ptr) :: CrossSectionCreateConst +end function CrossSectionCreateConst + +!! Create, general, non-const +function CrossSectionCreate( & + XYs1d, & + regions1d, & + reference, & + resonancesWithBackground, & + CoulombPlusNuclearElastic, & + thermalNeutronScatteringLaw1d & +) & + bind(C, name='CrossSectionCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr), intent(in), value :: reference + type(c_ptr), intent(in), value :: resonancesWithBackground + type(c_ptr), intent(in), value :: CoulombPlusNuclearElastic + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw1d + type(c_ptr) :: CrossSectionCreate +end function CrossSectionCreate + +!! Assign +subroutine CrossSectionAssign(handleLHS, handleRHS) & + bind(C, name='CrossSectionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CrossSectionAssign + +!! Delete +subroutine CrossSectionDelete(handle) & + bind(C, name='CrossSectionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CrossSectionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CrossSectionRead(handle, filename, filenameSize) & + bind(C, name='CrossSectionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionRead +end function CrossSectionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CrossSectionWrite(handle, filename, filenameSize) & + bind(C, name='CrossSectionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionWrite +end function CrossSectionWrite + +!! Print to standard output, in our prettyprinting format +function CrossSectionPrint(handle) & + bind(C, name='CrossSectionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionPrint +end function CrossSectionPrint + +!! Print to standard output, as XML +function CrossSectionPrintXML(handle) & + bind(C, name='CrossSectionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionPrintXML +end function CrossSectionPrintXML + +!! Print to standard output, as JSON +function CrossSectionPrintJSON(handle) & + bind(C, name='CrossSectionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionPrintJSON +end function CrossSectionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionXYs1dHas(handle) & + bind(C, name='CrossSectionXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionXYs1dHas +end function CrossSectionXYs1dHas + +!! Get, const +function CrossSectionXYs1dGetConst(handle) & + bind(C, name='CrossSectionXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionXYs1dGetConst +end function CrossSectionXYs1dGetConst + +!! Get, non-const +function CrossSectionXYs1dGet(handle) & + bind(C, name='CrossSectionXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionXYs1dGet +end function CrossSectionXYs1dGet + +!! Set +subroutine CrossSectionXYs1dSet(handle, fieldHandle) & + bind(C, name='CrossSectionXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: regions1d +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionRegions1dHas(handle) & + bind(C, name='CrossSectionRegions1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionRegions1dHas +end function CrossSectionRegions1dHas + +!! Get, const +function CrossSectionRegions1dGetConst(handle) & + bind(C, name='CrossSectionRegions1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionRegions1dGetConst +end function CrossSectionRegions1dGetConst + +!! Get, non-const +function CrossSectionRegions1dGet(handle) & + bind(C, name='CrossSectionRegions1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionRegions1dGet +end function CrossSectionRegions1dGet + +!! Set +subroutine CrossSectionRegions1dSet(handle, fieldHandle) & + bind(C, name='CrossSectionRegions1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionRegions1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: reference +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionReferenceHas(handle) & + bind(C, name='CrossSectionReferenceHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionReferenceHas +end function CrossSectionReferenceHas + +!! Get, const +function CrossSectionReferenceGetConst(handle) & + bind(C, name='CrossSectionReferenceGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionReferenceGetConst +end function CrossSectionReferenceGetConst + +!! Get, non-const +function CrossSectionReferenceGet(handle) & + bind(C, name='CrossSectionReferenceGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionReferenceGet +end function CrossSectionReferenceGet + +!! Set +subroutine CrossSectionReferenceSet(handle, fieldHandle) & + bind(C, name='CrossSectionReferenceSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionReferenceSet + + +!! ----------------------------------------------------------------------------- +!! Child: resonancesWithBackground +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionResonancesWithBackgroundHas(handle) & + bind(C, name='CrossSectionResonancesWithBackgroundHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionResonancesWithBackgroundHas +end function CrossSectionResonancesWithBackgroundHas + +!! Get, const +function CrossSectionResonancesWithBackgroundGetConst(handle) & + bind(C, name='CrossSectionResonancesWithBackgroundGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionResonancesWithBackgroundGetConst +end function CrossSectionResonancesWithBackgroundGetConst + +!! Get, non-const +function CrossSectionResonancesWithBackgroundGet(handle) & + bind(C, name='CrossSectionResonancesWithBackgroundGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionResonancesWithBackgroundGet +end function CrossSectionResonancesWithBackgroundGet + +!! Set +subroutine CrossSectionResonancesWithBackgroundSet(handle, fieldHandle) & + bind(C, name='CrossSectionResonancesWithBackgroundSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionResonancesWithBackgroundSet + + +!! ----------------------------------------------------------------------------- +!! Child: CoulombPlusNuclearElastic +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionCoulombPlusNuclearElasticHas(handle) & + bind(C, name='CrossSectionCoulombPlusNuclearElasticHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionCoulombPlusNuclearElasticHas +end function CrossSectionCoulombPlusNuclearElasticHas + +!! Get, const +function CrossSectionCoulombPlusNuclearElasticGetConst(handle) & + bind(C, name='CrossSectionCoulombPlusNuclearElasticGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionCoulombPlusNuclearElasticGetConst +end function CrossSectionCoulombPlusNuclearElasticGetConst + +!! Get, non-const +function CrossSectionCoulombPlusNuclearElasticGet(handle) & + bind(C, name='CrossSectionCoulombPlusNuclearElasticGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionCoulombPlusNuclearElasticGet +end function CrossSectionCoulombPlusNuclearElasticGet + +!! Set +subroutine CrossSectionCoulombPlusNuclearElasticSet(handle, fieldHandle) & + bind(C, name='CrossSectionCoulombPlusNuclearElasticSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionCoulombPlusNuclearElasticSet + + +!! ----------------------------------------------------------------------------- +!! Child: thermalNeutronScatteringLaw1d +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionThermalNeutronScatteringLaw1dHas(handle) & + bind(C, name='CrossSectionThermalNeutronScatteringLaw1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionThermalNeutronScatteringLaw1dHas +end function CrossSectionThermalNeutronScatteringLaw1dHas + +!! Get, const +function CrossSectionThermalNeutronScatteringLaw1dGetConst(handle) & + bind(C, name='CrossSectionThermalNeutronScatteringLaw1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionThermalNeutronScatteringLaw1dGetConst +end function CrossSectionThermalNeutronScatteringLaw1dGetConst + +!! Get, non-const +function CrossSectionThermalNeutronScatteringLaw1dGet(handle) & + bind(C, name='CrossSectionThermalNeutronScatteringLaw1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionThermalNeutronScatteringLaw1dGet +end function CrossSectionThermalNeutronScatteringLaw1dGet + +!! Set +subroutine CrossSectionThermalNeutronScatteringLaw1dSet(handle, fieldHandle) & + bind(C, name='CrossSectionThermalNeutronScatteringLaw1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionThermalNeutronScatteringLaw1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalCrossSection diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSectionReconstructed.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSectionReconstructed.f03 new file mode 100644 index 000000000..ce523b36d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSectionReconstructed.f03 @@ -0,0 +1,254 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalCrossSectionReconstructed +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CrossSectionReconstructedDefaultConst() & + bind(C, name='CrossSectionReconstructedDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionReconstructedDefaultConst +end function CrossSectionReconstructedDefaultConst + +!! Create, default, non-const +function CrossSectionReconstructedDefault() & + bind(C, name='CrossSectionReconstructedDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionReconstructedDefault +end function CrossSectionReconstructedDefault + +!! Create, general, const +function CrossSectionReconstructedCreateConst( & + label, & + derivedFrom, & + date, & + labelSize, & + derivedFromSize, & + dateSize & +) & + bind(C, name='CrossSectionReconstructedCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: derivedFromSize + character(c_char), intent(in) :: derivedFrom(derivedFromSize) + integer(c_size_t), intent(in), value :: dateSize + character(c_char), intent(in) :: date(dateSize) + type(c_ptr) :: CrossSectionReconstructedCreateConst +end function CrossSectionReconstructedCreateConst + +!! Create, general, non-const +function CrossSectionReconstructedCreate( & + label, & + derivedFrom, & + date, & + labelSize, & + derivedFromSize, & + dateSize & +) & + bind(C, name='CrossSectionReconstructedCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: derivedFromSize + character(c_char), intent(in) :: derivedFrom(derivedFromSize) + integer(c_size_t), intent(in), value :: dateSize + character(c_char), intent(in) :: date(dateSize) + type(c_ptr) :: CrossSectionReconstructedCreate +end function CrossSectionReconstructedCreate + +!! Assign +subroutine CrossSectionReconstructedAssign(handleLHS, handleRHS) & + bind(C, name='CrossSectionReconstructedAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CrossSectionReconstructedAssign + +!! Delete +subroutine CrossSectionReconstructedDelete(handle) & + bind(C, name='CrossSectionReconstructedDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CrossSectionReconstructedDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CrossSectionReconstructedRead(handle, filename, filenameSize) & + bind(C, name='CrossSectionReconstructedRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionReconstructedRead +end function CrossSectionReconstructedRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CrossSectionReconstructedWrite(handle, filename, filenameSize) & + bind(C, name='CrossSectionReconstructedWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionReconstructedWrite +end function CrossSectionReconstructedWrite + +!! Print to standard output, in our prettyprinting format +function CrossSectionReconstructedPrint(handle) & + bind(C, name='CrossSectionReconstructedPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionReconstructedPrint +end function CrossSectionReconstructedPrint + +!! Print to standard output, as XML +function CrossSectionReconstructedPrintXML(handle) & + bind(C, name='CrossSectionReconstructedPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionReconstructedPrintXML +end function CrossSectionReconstructedPrintXML + +!! Print to standard output, as JSON +function CrossSectionReconstructedPrintJSON(handle) & + bind(C, name='CrossSectionReconstructedPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionReconstructedPrintJSON +end function CrossSectionReconstructedPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionReconstructedLabelHas(handle) & + bind(C, name='CrossSectionReconstructedLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionReconstructedLabelHas +end function CrossSectionReconstructedLabelHas + +!! Get +function CrossSectionReconstructedLabelGet(handle) & + bind(C, name='CrossSectionReconstructedLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionReconstructedLabelGet +end function CrossSectionReconstructedLabelGet + +!! Set +subroutine CrossSectionReconstructedLabelSet(handle, label, labelSize) & + bind(C, name='CrossSectionReconstructedLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine CrossSectionReconstructedLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: derivedFrom +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionReconstructedDerivedFromHas(handle) & + bind(C, name='CrossSectionReconstructedDerivedFromHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionReconstructedDerivedFromHas +end function CrossSectionReconstructedDerivedFromHas + +!! Get +function CrossSectionReconstructedDerivedFromGet(handle) & + bind(C, name='CrossSectionReconstructedDerivedFromGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionReconstructedDerivedFromGet +end function CrossSectionReconstructedDerivedFromGet + +!! Set +subroutine CrossSectionReconstructedDerivedFromSet(handle, derivedFrom, derivedFromSize) & + bind(C, name='CrossSectionReconstructedDerivedFromSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: derivedFromSize + character(c_char), intent(in) :: derivedFrom(derivedFromSize) +end subroutine CrossSectionReconstructedDerivedFromSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: date +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionReconstructedDateHas(handle) & + bind(C, name='CrossSectionReconstructedDateHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionReconstructedDateHas +end function CrossSectionReconstructedDateHas + +!! Get +function CrossSectionReconstructedDateGet(handle) & + bind(C, name='CrossSectionReconstructedDateGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionReconstructedDateGet +end function CrossSectionReconstructedDateGet + +!! Set +subroutine CrossSectionReconstructedDateSet(handle, date, dateSize) & + bind(C, name='CrossSectionReconstructedDateSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: dateSize + character(c_char), intent(in) :: date(dateSize) +end subroutine CrossSectionReconstructedDateSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalCrossSectionReconstructed diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSectionSum.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSectionSum.f03 new file mode 100644 index 000000000..7b2860f9a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSectionSum.f03 @@ -0,0 +1,343 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalCrossSectionSum +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CrossSectionSumDefaultConst() & + bind(C, name='CrossSectionSumDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionSumDefaultConst +end function CrossSectionSumDefaultConst + +!! Create, default, non-const +function CrossSectionSumDefault() & + bind(C, name='CrossSectionSumDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionSumDefault +end function CrossSectionSumDefault + +!! Create, general, const +function CrossSectionSumCreateConst( & + label, & + ENDF_MT, & + summands, & + Q, & + crossSection, & + labelSize & +) & + bind(C, name='CrossSectionSumCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + type(c_ptr), intent(in), value :: summands + type(c_ptr), intent(in), value :: Q + type(c_ptr), intent(in), value :: crossSection + type(c_ptr) :: CrossSectionSumCreateConst +end function CrossSectionSumCreateConst + +!! Create, general, non-const +function CrossSectionSumCreate( & + label, & + ENDF_MT, & + summands, & + Q, & + crossSection, & + labelSize & +) & + bind(C, name='CrossSectionSumCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + type(c_ptr), intent(in), value :: summands + type(c_ptr), intent(in), value :: Q + type(c_ptr), intent(in), value :: crossSection + type(c_ptr) :: CrossSectionSumCreate +end function CrossSectionSumCreate + +!! Assign +subroutine CrossSectionSumAssign(handleLHS, handleRHS) & + bind(C, name='CrossSectionSumAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CrossSectionSumAssign + +!! Delete +subroutine CrossSectionSumDelete(handle) & + bind(C, name='CrossSectionSumDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CrossSectionSumDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CrossSectionSumRead(handle, filename, filenameSize) & + bind(C, name='CrossSectionSumRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionSumRead +end function CrossSectionSumRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CrossSectionSumWrite(handle, filename, filenameSize) & + bind(C, name='CrossSectionSumWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionSumWrite +end function CrossSectionSumWrite + +!! Print to standard output, in our prettyprinting format +function CrossSectionSumPrint(handle) & + bind(C, name='CrossSectionSumPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumPrint +end function CrossSectionSumPrint + +!! Print to standard output, as XML +function CrossSectionSumPrintXML(handle) & + bind(C, name='CrossSectionSumPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumPrintXML +end function CrossSectionSumPrintXML + +!! Print to standard output, as JSON +function CrossSectionSumPrintJSON(handle) & + bind(C, name='CrossSectionSumPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumPrintJSON +end function CrossSectionSumPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionSumLabelHas(handle) & + bind(C, name='CrossSectionSumLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumLabelHas +end function CrossSectionSumLabelHas + +!! Get +function CrossSectionSumLabelGet(handle) & + bind(C, name='CrossSectionSumLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionSumLabelGet +end function CrossSectionSumLabelGet + +!! Set +subroutine CrossSectionSumLabelSet(handle, label, labelSize) & + bind(C, name='CrossSectionSumLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine CrossSectionSumLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: ENDF_MT +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionSumENDFMTHas(handle) & + bind(C, name='CrossSectionSumENDFMTHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumENDFMTHas +end function CrossSectionSumENDFMTHas + +!! Get +function CrossSectionSumENDFMTGet(handle) & + bind(C, name='CrossSectionSumENDFMTGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumENDFMTGet +end function CrossSectionSumENDFMTGet + +!! Set +subroutine CrossSectionSumENDFMTSet(handle, ENDF_MT) & + bind(C, name='CrossSectionSumENDFMTSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: ENDF_MT +end subroutine CrossSectionSumENDFMTSet + + +!! ----------------------------------------------------------------------------- +!! Child: summands +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionSumSummandsHas(handle) & + bind(C, name='CrossSectionSumSummandsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumSummandsHas +end function CrossSectionSumSummandsHas + +!! Get, const +function CrossSectionSumSummandsGetConst(handle) & + bind(C, name='CrossSectionSumSummandsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionSumSummandsGetConst +end function CrossSectionSumSummandsGetConst + +!! Get, non-const +function CrossSectionSumSummandsGet(handle) & + bind(C, name='CrossSectionSumSummandsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionSumSummandsGet +end function CrossSectionSumSummandsGet + +!! Set +subroutine CrossSectionSumSummandsSet(handle, fieldHandle) & + bind(C, name='CrossSectionSumSummandsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionSumSummandsSet + + +!! ----------------------------------------------------------------------------- +!! Child: Q +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionSumQHas(handle) & + bind(C, name='CrossSectionSumQHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumQHas +end function CrossSectionSumQHas + +!! Get, const +function CrossSectionSumQGetConst(handle) & + bind(C, name='CrossSectionSumQGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionSumQGetConst +end function CrossSectionSumQGetConst + +!! Get, non-const +function CrossSectionSumQGet(handle) & + bind(C, name='CrossSectionSumQGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionSumQGet +end function CrossSectionSumQGet + +!! Set +subroutine CrossSectionSumQSet(handle, fieldHandle) & + bind(C, name='CrossSectionSumQSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionSumQSet + + +!! ----------------------------------------------------------------------------- +!! Child: crossSection +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionSumCrossSectionHas(handle) & + bind(C, name='CrossSectionSumCrossSectionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumCrossSectionHas +end function CrossSectionSumCrossSectionHas + +!! Get, const +function CrossSectionSumCrossSectionGetConst(handle) & + bind(C, name='CrossSectionSumCrossSectionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionSumCrossSectionGetConst +end function CrossSectionSumCrossSectionGetConst + +!! Get, non-const +function CrossSectionSumCrossSectionGet(handle) & + bind(C, name='CrossSectionSumCrossSectionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionSumCrossSectionGet +end function CrossSectionSumCrossSectionGet + +!! Set +subroutine CrossSectionSumCrossSectionSet(handle, fieldHandle) & + bind(C, name='CrossSectionSumCrossSectionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionSumCrossSectionSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalCrossSectionSum diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSectionSums.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSectionSums.f03 new file mode 100644 index 000000000..715790e81 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/CrossSectionSums.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalCrossSectionSums +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CrossSectionSumsDefaultConst() & + bind(C, name='CrossSectionSumsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionSumsDefaultConst +end function CrossSectionSumsDefaultConst + +!! Create, default, non-const +function CrossSectionSumsDefault() & + bind(C, name='CrossSectionSumsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionSumsDefault +end function CrossSectionSumsDefault + +!! Create, general, const +function CrossSectionSumsCreateConst( & + crossSectionSum, crossSectionSumSize & +) & + bind(C, name='CrossSectionSumsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: crossSectionSumSize + type(c_ptr), intent(in) :: crossSectionSum(crossSectionSumSize) + type(c_ptr) :: CrossSectionSumsCreateConst +end function CrossSectionSumsCreateConst + +!! Create, general, non-const +function CrossSectionSumsCreate( & + crossSectionSum, crossSectionSumSize & +) & + bind(C, name='CrossSectionSumsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: crossSectionSumSize + type(c_ptr), intent(in) :: crossSectionSum(crossSectionSumSize) + type(c_ptr) :: CrossSectionSumsCreate +end function CrossSectionSumsCreate + +!! Assign +subroutine CrossSectionSumsAssign(handleLHS, handleRHS) & + bind(C, name='CrossSectionSumsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CrossSectionSumsAssign + +!! Delete +subroutine CrossSectionSumsDelete(handle) & + bind(C, name='CrossSectionSumsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CrossSectionSumsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CrossSectionSumsRead(handle, filename, filenameSize) & + bind(C, name='CrossSectionSumsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionSumsRead +end function CrossSectionSumsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CrossSectionSumsWrite(handle, filename, filenameSize) & + bind(C, name='CrossSectionSumsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionSumsWrite +end function CrossSectionSumsWrite + +!! Print to standard output, in our prettyprinting format +function CrossSectionSumsPrint(handle) & + bind(C, name='CrossSectionSumsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumsPrint +end function CrossSectionSumsPrint + +!! Print to standard output, as XML +function CrossSectionSumsPrintXML(handle) & + bind(C, name='CrossSectionSumsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumsPrintXML +end function CrossSectionSumsPrintXML + +!! Print to standard output, as JSON +function CrossSectionSumsPrintJSON(handle) & + bind(C, name='CrossSectionSumsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumsPrintJSON +end function CrossSectionSumsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: crossSectionSum +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionSumsCrossSectionSumHas(handle) & + bind(C, name='CrossSectionSumsCrossSectionSumHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionSumsCrossSectionSumHas +end function CrossSectionSumsCrossSectionSumHas + +!! Clear +subroutine CrossSectionSumsCrossSectionSumClear(handle) & + bind(C, name='CrossSectionSumsCrossSectionSumClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CrossSectionSumsCrossSectionSumClear + +!! Size +function CrossSectionSumsCrossSectionSumSize(handle) & + bind(C, name='CrossSectionSumsCrossSectionSumSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: CrossSectionSumsCrossSectionSumSize +end function CrossSectionSumsCrossSectionSumSize + +!! Add +subroutine CrossSectionSumsCrossSectionSumAdd(handle, fieldHandle) & + bind(C, name='CrossSectionSumsCrossSectionSumAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionSumsCrossSectionSumAdd + +!! Get, by index \in [0,size), const +function CrossSectionSumsCrossSectionSumGetConst(handle, index) & + bind(C, name='CrossSectionSumsCrossSectionSumGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: CrossSectionSumsCrossSectionSumGetConst +end function CrossSectionSumsCrossSectionSumGetConst + +!! Get, by index \in [0,size), non-const +function CrossSectionSumsCrossSectionSumGet(handle, index) & + bind(C, name='CrossSectionSumsCrossSectionSumGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: CrossSectionSumsCrossSectionSumGet +end function CrossSectionSumsCrossSectionSumGet + +!! Set, by index \in [0,size) +subroutine CrossSectionSumsCrossSectionSumSet(handle, index, fieldHandle) & + bind(C, name='CrossSectionSumsCrossSectionSumSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionSumsCrossSectionSumSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function CrossSectionSumsCrossSectionSumHasByLabel(handle, meta, metaSize) & + bind(C, name='CrossSectionSumsCrossSectionSumHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: CrossSectionSumsCrossSectionSumHasByLabel +end function CrossSectionSumsCrossSectionSumHasByLabel + +!! Get, by label, const +function CrossSectionSumsCrossSectionSumGetByLabelConst(handle, meta, metaSize) & + bind(C, name='CrossSectionSumsCrossSectionSumGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: CrossSectionSumsCrossSectionSumGetByLabelConst +end function CrossSectionSumsCrossSectionSumGetByLabelConst + +!! Get, by label, non-const +function CrossSectionSumsCrossSectionSumGetByLabel(handle, meta, metaSize) & + bind(C, name='CrossSectionSumsCrossSectionSumGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: CrossSectionSumsCrossSectionSumGetByLabel +end function CrossSectionSumsCrossSectionSumGetByLabel + +!! Set, by label +subroutine CrossSectionSumsCrossSectionSumSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='CrossSectionSumsCrossSectionSumSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionSumsCrossSectionSumSetByLabel + +!! ------------------------ +!! Re: metadatum ENDF_MT +!! ------------------------ + +!! Has, by ENDF_MT +function CrossSectionSumsCrossSectionSumHasByENDFMT(handle, meta) & + bind(C, name='CrossSectionSumsCrossSectionSumHasByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: CrossSectionSumsCrossSectionSumHasByENDFMT +end function CrossSectionSumsCrossSectionSumHasByENDFMT + +!! Get, by ENDF_MT, const +function CrossSectionSumsCrossSectionSumGetByENDFMTConst(handle, meta) & + bind(C, name='CrossSectionSumsCrossSectionSumGetByENDFMTConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: CrossSectionSumsCrossSectionSumGetByENDFMTConst +end function CrossSectionSumsCrossSectionSumGetByENDFMTConst + +!! Get, by ENDF_MT, non-const +function CrossSectionSumsCrossSectionSumGetByENDFMT(handle, meta) & + bind(C, name='CrossSectionSumsCrossSectionSumGetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: CrossSectionSumsCrossSectionSumGetByENDFMT +end function CrossSectionSumsCrossSectionSumGetByENDFMT + +!! Set, by ENDF_MT +subroutine CrossSectionSumsCrossSectionSumSetByENDFMT(handle, meta, fieldHandle) & + bind(C, name='CrossSectionSumsCrossSectionSumSetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionSumsCrossSectionSumSetByENDFMT + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalCrossSectionSums diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Data.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Data.f03 new file mode 100644 index 000000000..8cf001250 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Data.f03 @@ -0,0 +1,203 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalData +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DataDefaultConst() & + bind(C, name='DataDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DataDefaultConst +end function DataDefaultConst + +!! Create, default, non-const +function DataDefault() & + bind(C, name='DataDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DataDefault +end function DataDefault + +!! Create, general, const +function DataCreateConst( & +) & + bind(C, name='DataCreateConst') + use iso_c_binding + implicit none + type(c_ptr) :: DataCreateConst +end function DataCreateConst + +!! Create, general, non-const +function DataCreate( & +) & + bind(C, name='DataCreate') + use iso_c_binding + implicit none + type(c_ptr) :: DataCreate +end function DataCreate + +!! Assign +subroutine DataAssign(handleLHS, handleRHS) & + bind(C, name='DataAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DataAssign + +!! Delete +subroutine DataDelete(handle) & + bind(C, name='DataDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DataDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DataRead(handle, filename, filenameSize) & + bind(C, name='DataRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DataRead +end function DataRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DataWrite(handle, filename, filenameSize) & + bind(C, name='DataWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DataWrite +end function DataWrite + +!! Print to standard output, in our prettyprinting format +function DataPrint(handle) & + bind(C, name='DataPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DataPrint +end function DataPrint + +!! Print to standard output, as XML +function DataPrintXML(handle) & + bind(C, name='DataPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DataPrintXML +end function DataPrintXML + +!! Print to standard output, as JSON +function DataPrintJSON(handle) & + bind(C, name='DataPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DataPrintJSON +end function DataPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Data vector +!! ----------------------------------------------------------------------------- + +!! Clear +subroutine DataDoublesClear(handle) & + bind(C, name='DataDoublesClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DataDoublesClear + +!! Get size +function DataDoublesSize(handle) & + bind(C, name='DataDoublesSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: DataDoublesSize +end function DataDoublesSize + +!! Get value +!! By index \in [0,size) +function DataDoublesGet(handle, arrayIndex) & + bind(C, name='DataDoublesGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + real(c_double) :: DataDoublesGet +end function DataDoublesGet + +!! Set value +!! By index \in [0,size) +subroutine DataDoublesSet(handle, arrayIndex, valueAtIndex) & + bind(C, name='DataDoublesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + real(c_double), intent(in), value :: valueAtIndex +end subroutine DataDoublesSet + +!! Get pointer to existing values, const +function DataDoublesGetArrayConst(handle) & + bind(C, name='DataDoublesGetArrayConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DataDoublesGetArrayConst +end function DataDoublesGetArrayConst + +!! Get pointer to existing values, non-const +function DataDoublesGetArray(handle) & + bind(C, name='DataDoublesGetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DataDoublesGetArray +end function DataDoublesGetArray + +!! Set completely new values and size +subroutine DataDoublesSetArray(handle, values, valuesSize) & + bind(C, name='DataDoublesSetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: valuesSize + real(c_double), intent(in) :: values(valuesSize) +end subroutine DataDoublesSetArray + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalData diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Date.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Date.f03 new file mode 100644 index 000000000..87456e95b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Date.f03 @@ -0,0 +1,213 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDate +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DateDefaultConst() & + bind(C, name='DateDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DateDefaultConst +end function DateDefaultConst + +!! Create, default, non-const +function DateDefault() & + bind(C, name='DateDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DateDefault +end function DateDefault + +!! Create, general, const +function DateCreateConst( & + value, & + dateType, & + valueSize, & + dateTypeSize & +) & + bind(C, name='DateCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: valueSize + character(c_char), intent(in) :: value(valueSize) + integer(c_size_t), intent(in), value :: dateTypeSize + character(c_char), intent(in) :: dateType(dateTypeSize) + type(c_ptr) :: DateCreateConst +end function DateCreateConst + +!! Create, general, non-const +function DateCreate( & + value, & + dateType, & + valueSize, & + dateTypeSize & +) & + bind(C, name='DateCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: valueSize + character(c_char), intent(in) :: value(valueSize) + integer(c_size_t), intent(in), value :: dateTypeSize + character(c_char), intent(in) :: dateType(dateTypeSize) + type(c_ptr) :: DateCreate +end function DateCreate + +!! Assign +subroutine DateAssign(handleLHS, handleRHS) & + bind(C, name='DateAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DateAssign + +!! Delete +subroutine DateDelete(handle) & + bind(C, name='DateDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DateDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DateRead(handle, filename, filenameSize) & + bind(C, name='DateRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DateRead +end function DateRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DateWrite(handle, filename, filenameSize) & + bind(C, name='DateWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DateWrite +end function DateWrite + +!! Print to standard output, in our prettyprinting format +function DatePrint(handle) & + bind(C, name='DatePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DatePrint +end function DatePrint + +!! Print to standard output, as XML +function DatePrintXML(handle) & + bind(C, name='DatePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DatePrintXML +end function DatePrintXML + +!! Print to standard output, as JSON +function DatePrintJSON(handle) & + bind(C, name='DatePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DatePrintJSON +end function DatePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function DateValueHas(handle) & + bind(C, name='DateValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DateValueHas +end function DateValueHas + +!! Get +function DateValueGet(handle) & + bind(C, name='DateValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DateValueGet +end function DateValueGet + +!! Set +subroutine DateValueSet(handle, value, valueSize) & + bind(C, name='DateValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: valueSize + character(c_char), intent(in) :: value(valueSize) +end subroutine DateValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: dateType +!! ----------------------------------------------------------------------------- + +!! Has +function DateDateTypeHas(handle) & + bind(C, name='DateDateTypeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DateDateTypeHas +end function DateDateTypeHas + +!! Get +function DateDateTypeGet(handle) & + bind(C, name='DateDateTypeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DateDateTypeGet +end function DateDateTypeGet + +!! Set +subroutine DateDateTypeSet(handle, dateType, dateTypeSize) & + bind(C, name='DateDateTypeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: dateTypeSize + character(c_char), intent(in) :: dateType(dateTypeSize) +end subroutine DateDateTypeSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDate diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Dates.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Dates.f03 new file mode 100644 index 000000000..809ecd852 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Dates.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDates +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DatesDefaultConst() & + bind(C, name='DatesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DatesDefaultConst +end function DatesDefaultConst + +!! Create, default, non-const +function DatesDefault() & + bind(C, name='DatesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DatesDefault +end function DatesDefault + +!! Create, general, const +function DatesCreateConst( & + date, dateSize & +) & + bind(C, name='DatesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: dateSize + type(c_ptr), intent(in) :: date(dateSize) + type(c_ptr) :: DatesCreateConst +end function DatesCreateConst + +!! Create, general, non-const +function DatesCreate( & + date, dateSize & +) & + bind(C, name='DatesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: dateSize + type(c_ptr), intent(in) :: date(dateSize) + type(c_ptr) :: DatesCreate +end function DatesCreate + +!! Assign +subroutine DatesAssign(handleLHS, handleRHS) & + bind(C, name='DatesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DatesAssign + +!! Delete +subroutine DatesDelete(handle) & + bind(C, name='DatesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DatesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DatesRead(handle, filename, filenameSize) & + bind(C, name='DatesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DatesRead +end function DatesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DatesWrite(handle, filename, filenameSize) & + bind(C, name='DatesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DatesWrite +end function DatesWrite + +!! Print to standard output, in our prettyprinting format +function DatesPrint(handle) & + bind(C, name='DatesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DatesPrint +end function DatesPrint + +!! Print to standard output, as XML +function DatesPrintXML(handle) & + bind(C, name='DatesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DatesPrintXML +end function DatesPrintXML + +!! Print to standard output, as JSON +function DatesPrintJSON(handle) & + bind(C, name='DatesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DatesPrintJSON +end function DatesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: date +!! ----------------------------------------------------------------------------- + +!! Has +function DatesDateHas(handle) & + bind(C, name='DatesDateHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DatesDateHas +end function DatesDateHas + +!! Clear +subroutine DatesDateClear(handle) & + bind(C, name='DatesDateClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DatesDateClear + +!! Size +function DatesDateSize(handle) & + bind(C, name='DatesDateSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: DatesDateSize +end function DatesDateSize + +!! Add +subroutine DatesDateAdd(handle, fieldHandle) & + bind(C, name='DatesDateAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DatesDateAdd + +!! Get, by index \in [0,size), const +function DatesDateGetConst(handle, index) & + bind(C, name='DatesDateGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: DatesDateGetConst +end function DatesDateGetConst + +!! Get, by index \in [0,size), non-const +function DatesDateGet(handle, index) & + bind(C, name='DatesDateGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: DatesDateGet +end function DatesDateGet + +!! Set, by index \in [0,size) +subroutine DatesDateSet(handle, index, fieldHandle) & + bind(C, name='DatesDateSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DatesDateSet + +!! ------------------------ +!! Re: metadatum value +!! ------------------------ + +!! Has, by value +function DatesDateHasByValue(handle, meta, metaSize) & + bind(C, name='DatesDateHasByValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: DatesDateHasByValue +end function DatesDateHasByValue + +!! Get, by value, const +function DatesDateGetByValueConst(handle, meta, metaSize) & + bind(C, name='DatesDateGetByValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DatesDateGetByValueConst +end function DatesDateGetByValueConst + +!! Get, by value, non-const +function DatesDateGetByValue(handle, meta, metaSize) & + bind(C, name='DatesDateGetByValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DatesDateGetByValue +end function DatesDateGetByValue + +!! Set, by value +subroutine DatesDateSetByValue(handle, meta, metaSize, fieldHandle) & + bind(C, name='DatesDateSetByValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DatesDateSetByValue + +!! ------------------------ +!! Re: metadatum dateType +!! ------------------------ + +!! Has, by dateType +function DatesDateHasByDateType(handle, meta, metaSize) & + bind(C, name='DatesDateHasByDateType') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: DatesDateHasByDateType +end function DatesDateHasByDateType + +!! Get, by dateType, const +function DatesDateGetByDateTypeConst(handle, meta, metaSize) & + bind(C, name='DatesDateGetByDateTypeConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DatesDateGetByDateTypeConst +end function DatesDateGetByDateTypeConst + +!! Get, by dateType, non-const +function DatesDateGetByDateType(handle, meta, metaSize) & + bind(C, name='DatesDateGetByDateType') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DatesDateGetByDateType +end function DatesDateGetByDateType + +!! Set, by dateType +subroutine DatesDateSetByDateType(handle, meta, metaSize, fieldHandle) & + bind(C, name='DatesDateSetByDateType') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DatesDateSetByDateType + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDates diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DebyeWallerIntegral.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DebyeWallerIntegral.f03 new file mode 100644 index 000000000..ae91e5b2f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DebyeWallerIntegral.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDebyeWallerIntegral +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DebyeWallerIntegralDefaultConst() & + bind(C, name='DebyeWallerIntegralDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DebyeWallerIntegralDefaultConst +end function DebyeWallerIntegralDefaultConst + +!! Create, default, non-const +function DebyeWallerIntegralDefault() & + bind(C, name='DebyeWallerIntegralDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DebyeWallerIntegralDefault +end function DebyeWallerIntegralDefault + +!! Create, general, const +function DebyeWallerIntegralCreateConst( & + XYs1d & +) & + bind(C, name='DebyeWallerIntegralCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: DebyeWallerIntegralCreateConst +end function DebyeWallerIntegralCreateConst + +!! Create, general, non-const +function DebyeWallerIntegralCreate( & + XYs1d & +) & + bind(C, name='DebyeWallerIntegralCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: DebyeWallerIntegralCreate +end function DebyeWallerIntegralCreate + +!! Assign +subroutine DebyeWallerIntegralAssign(handleLHS, handleRHS) & + bind(C, name='DebyeWallerIntegralAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DebyeWallerIntegralAssign + +!! Delete +subroutine DebyeWallerIntegralDelete(handle) & + bind(C, name='DebyeWallerIntegralDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DebyeWallerIntegralDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DebyeWallerIntegralRead(handle, filename, filenameSize) & + bind(C, name='DebyeWallerIntegralRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DebyeWallerIntegralRead +end function DebyeWallerIntegralRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DebyeWallerIntegralWrite(handle, filename, filenameSize) & + bind(C, name='DebyeWallerIntegralWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DebyeWallerIntegralWrite +end function DebyeWallerIntegralWrite + +!! Print to standard output, in our prettyprinting format +function DebyeWallerIntegralPrint(handle) & + bind(C, name='DebyeWallerIntegralPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DebyeWallerIntegralPrint +end function DebyeWallerIntegralPrint + +!! Print to standard output, as XML +function DebyeWallerIntegralPrintXML(handle) & + bind(C, name='DebyeWallerIntegralPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DebyeWallerIntegralPrintXML +end function DebyeWallerIntegralPrintXML + +!! Print to standard output, as JSON +function DebyeWallerIntegralPrintJSON(handle) & + bind(C, name='DebyeWallerIntegralPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DebyeWallerIntegralPrintJSON +end function DebyeWallerIntegralPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function DebyeWallerIntegralXYs1dHas(handle) & + bind(C, name='DebyeWallerIntegralXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DebyeWallerIntegralXYs1dHas +end function DebyeWallerIntegralXYs1dHas + +!! Get, const +function DebyeWallerIntegralXYs1dGetConst(handle) & + bind(C, name='DebyeWallerIntegralXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DebyeWallerIntegralXYs1dGetConst +end function DebyeWallerIntegralXYs1dGetConst + +!! Get, non-const +function DebyeWallerIntegralXYs1dGet(handle) & + bind(C, name='DebyeWallerIntegralXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DebyeWallerIntegralXYs1dGet +end function DebyeWallerIntegralXYs1dGet + +!! Set +subroutine DebyeWallerIntegralXYs1dSet(handle, fieldHandle) & + bind(C, name='DebyeWallerIntegralXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DebyeWallerIntegralXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDebyeWallerIntegral diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Decay.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Decay.f03 new file mode 100644 index 000000000..9c80d8dc0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Decay.f03 @@ -0,0 +1,289 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDecay +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DecayDefaultConst() & + bind(C, name='DecayDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DecayDefaultConst +end function DecayDefaultConst + +!! Create, default, non-const +function DecayDefault() & + bind(C, name='DecayDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DecayDefault +end function DecayDefault + +!! Create, general, const +function DecayCreateConst( & + index, & + mode, & + complete, & + products, & + modeSize & +) & + bind(C, name='DecayCreateConst') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: modeSize + character(c_char), intent(in) :: mode(modeSize) + logical(c_bool), intent(in), value :: complete + type(c_ptr), intent(in), value :: products + type(c_ptr) :: DecayCreateConst +end function DecayCreateConst + +!! Create, general, non-const +function DecayCreate( & + index, & + mode, & + complete, & + products, & + modeSize & +) & + bind(C, name='DecayCreate') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: modeSize + character(c_char), intent(in) :: mode(modeSize) + logical(c_bool), intent(in), value :: complete + type(c_ptr), intent(in), value :: products + type(c_ptr) :: DecayCreate +end function DecayCreate + +!! Assign +subroutine DecayAssign(handleLHS, handleRHS) & + bind(C, name='DecayAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DecayAssign + +!! Delete +subroutine DecayDelete(handle) & + bind(C, name='DecayDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DecayDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DecayRead(handle, filename, filenameSize) & + bind(C, name='DecayRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DecayRead +end function DecayRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DecayWrite(handle, filename, filenameSize) & + bind(C, name='DecayWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DecayWrite +end function DecayWrite + +!! Print to standard output, in our prettyprinting format +function DecayPrint(handle) & + bind(C, name='DecayPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayPrint +end function DecayPrint + +!! Print to standard output, as XML +function DecayPrintXML(handle) & + bind(C, name='DecayPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayPrintXML +end function DecayPrintXML + +!! Print to standard output, as JSON +function DecayPrintJSON(handle) & + bind(C, name='DecayPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayPrintJSON +end function DecayPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: index +!! ----------------------------------------------------------------------------- + +!! Has +function DecayIndexHas(handle) & + bind(C, name='DecayIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayIndexHas +end function DecayIndexHas + +!! Get +function DecayIndexGet(handle) & + bind(C, name='DecayIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayIndexGet +end function DecayIndexGet + +!! Set +subroutine DecayIndexSet(handle, index) & + bind(C, name='DecayIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: index +end subroutine DecayIndexSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: mode +!! ----------------------------------------------------------------------------- + +!! Has +function DecayModeHas(handle) & + bind(C, name='DecayModeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModeHas +end function DecayModeHas + +!! Get +function DecayModeGet(handle) & + bind(C, name='DecayModeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DecayModeGet +end function DecayModeGet + +!! Set +subroutine DecayModeSet(handle, mode, modeSize) & + bind(C, name='DecayModeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: modeSize + character(c_char), intent(in) :: mode(modeSize) +end subroutine DecayModeSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: complete +!! ----------------------------------------------------------------------------- + +!! Has +function DecayCompleteHas(handle) & + bind(C, name='DecayCompleteHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayCompleteHas +end function DecayCompleteHas + +!! Get +function DecayCompleteGet(handle) & + bind(C, name='DecayCompleteGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: DecayCompleteGet +end function DecayCompleteGet + +!! Set +subroutine DecayCompleteSet(handle, complete) & + bind(C, name='DecayCompleteSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: complete +end subroutine DecayCompleteSet + + +!! ----------------------------------------------------------------------------- +!! Child: products +!! ----------------------------------------------------------------------------- + +!! Has +function DecayProductsHas(handle) & + bind(C, name='DecayProductsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayProductsHas +end function DecayProductsHas + +!! Get, const +function DecayProductsGetConst(handle) & + bind(C, name='DecayProductsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DecayProductsGetConst +end function DecayProductsGetConst + +!! Get, non-const +function DecayProductsGet(handle) & + bind(C, name='DecayProductsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DecayProductsGet +end function DecayProductsGet + +!! Set +subroutine DecayProductsSet(handle, fieldHandle) & + bind(C, name='DecayProductsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayProductsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDecay diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayData.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayData.f03 new file mode 100644 index 000000000..0ea86fde6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayData.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDecayData +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DecayDataDefaultConst() & + bind(C, name='DecayDataDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DecayDataDefaultConst +end function DecayDataDefaultConst + +!! Create, default, non-const +function DecayDataDefault() & + bind(C, name='DecayDataDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DecayDataDefault +end function DecayDataDefault + +!! Create, general, const +function DecayDataCreateConst( & + decayModes, & + averageEnergies & +) & + bind(C, name='DecayDataCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: decayModes + type(c_ptr), intent(in), value :: averageEnergies + type(c_ptr) :: DecayDataCreateConst +end function DecayDataCreateConst + +!! Create, general, non-const +function DecayDataCreate( & + decayModes, & + averageEnergies & +) & + bind(C, name='DecayDataCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: decayModes + type(c_ptr), intent(in), value :: averageEnergies + type(c_ptr) :: DecayDataCreate +end function DecayDataCreate + +!! Assign +subroutine DecayDataAssign(handleLHS, handleRHS) & + bind(C, name='DecayDataAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DecayDataAssign + +!! Delete +subroutine DecayDataDelete(handle) & + bind(C, name='DecayDataDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DecayDataDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DecayDataRead(handle, filename, filenameSize) & + bind(C, name='DecayDataRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DecayDataRead +end function DecayDataRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DecayDataWrite(handle, filename, filenameSize) & + bind(C, name='DecayDataWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DecayDataWrite +end function DecayDataWrite + +!! Print to standard output, in our prettyprinting format +function DecayDataPrint(handle) & + bind(C, name='DecayDataPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayDataPrint +end function DecayDataPrint + +!! Print to standard output, as XML +function DecayDataPrintXML(handle) & + bind(C, name='DecayDataPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayDataPrintXML +end function DecayDataPrintXML + +!! Print to standard output, as JSON +function DecayDataPrintJSON(handle) & + bind(C, name='DecayDataPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayDataPrintJSON +end function DecayDataPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: decayModes +!! ----------------------------------------------------------------------------- + +!! Has +function DecayDataDecayModesHas(handle) & + bind(C, name='DecayDataDecayModesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayDataDecayModesHas +end function DecayDataDecayModesHas + +!! Get, const +function DecayDataDecayModesGetConst(handle) & + bind(C, name='DecayDataDecayModesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DecayDataDecayModesGetConst +end function DecayDataDecayModesGetConst + +!! Get, non-const +function DecayDataDecayModesGet(handle) & + bind(C, name='DecayDataDecayModesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DecayDataDecayModesGet +end function DecayDataDecayModesGet + +!! Set +subroutine DecayDataDecayModesSet(handle, fieldHandle) & + bind(C, name='DecayDataDecayModesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayDataDecayModesSet + + +!! ----------------------------------------------------------------------------- +!! Child: averageEnergies +!! ----------------------------------------------------------------------------- + +!! Has +function DecayDataAverageEnergiesHas(handle) & + bind(C, name='DecayDataAverageEnergiesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayDataAverageEnergiesHas +end function DecayDataAverageEnergiesHas + +!! Get, const +function DecayDataAverageEnergiesGetConst(handle) & + bind(C, name='DecayDataAverageEnergiesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DecayDataAverageEnergiesGetConst +end function DecayDataAverageEnergiesGetConst + +!! Get, non-const +function DecayDataAverageEnergiesGet(handle) & + bind(C, name='DecayDataAverageEnergiesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DecayDataAverageEnergiesGet +end function DecayDataAverageEnergiesGet + +!! Set +subroutine DecayDataAverageEnergiesSet(handle, fieldHandle) & + bind(C, name='DecayDataAverageEnergiesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayDataAverageEnergiesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDecayData diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayMode.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayMode.f03 new file mode 100644 index 000000000..b97af6f3c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayMode.f03 @@ -0,0 +1,438 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDecayMode +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DecayModeDefaultConst() & + bind(C, name='DecayModeDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DecayModeDefaultConst +end function DecayModeDefaultConst + +!! Create, default, non-const +function DecayModeDefault() & + bind(C, name='DecayModeDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DecayModeDefault +end function DecayModeDefault + +!! Create, general, const +function DecayModeCreateConst( & + label, & + mode, & + probability, & + decayPath, & + photonEmissionProbabilities, & + Q, & + spectra, & + labelSize, & + modeSize & +) & + bind(C, name='DecayModeCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: modeSize + character(c_char), intent(in) :: mode(modeSize) + type(c_ptr), intent(in), value :: probability + type(c_ptr), intent(in), value :: decayPath + type(c_ptr), intent(in), value :: photonEmissionProbabilities + type(c_ptr), intent(in), value :: Q + type(c_ptr), intent(in), value :: spectra + type(c_ptr) :: DecayModeCreateConst +end function DecayModeCreateConst + +!! Create, general, non-const +function DecayModeCreate( & + label, & + mode, & + probability, & + decayPath, & + photonEmissionProbabilities, & + Q, & + spectra, & + labelSize, & + modeSize & +) & + bind(C, name='DecayModeCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: modeSize + character(c_char), intent(in) :: mode(modeSize) + type(c_ptr), intent(in), value :: probability + type(c_ptr), intent(in), value :: decayPath + type(c_ptr), intent(in), value :: photonEmissionProbabilities + type(c_ptr), intent(in), value :: Q + type(c_ptr), intent(in), value :: spectra + type(c_ptr) :: DecayModeCreate +end function DecayModeCreate + +!! Assign +subroutine DecayModeAssign(handleLHS, handleRHS) & + bind(C, name='DecayModeAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DecayModeAssign + +!! Delete +subroutine DecayModeDelete(handle) & + bind(C, name='DecayModeDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DecayModeDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DecayModeRead(handle, filename, filenameSize) & + bind(C, name='DecayModeRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DecayModeRead +end function DecayModeRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DecayModeWrite(handle, filename, filenameSize) & + bind(C, name='DecayModeWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DecayModeWrite +end function DecayModeWrite + +!! Print to standard output, in our prettyprinting format +function DecayModePrint(handle) & + bind(C, name='DecayModePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModePrint +end function DecayModePrint + +!! Print to standard output, as XML +function DecayModePrintXML(handle) & + bind(C, name='DecayModePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModePrintXML +end function DecayModePrintXML + +!! Print to standard output, as JSON +function DecayModePrintJSON(handle) & + bind(C, name='DecayModePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModePrintJSON +end function DecayModePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function DecayModeLabelHas(handle) & + bind(C, name='DecayModeLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModeLabelHas +end function DecayModeLabelHas + +!! Get +function DecayModeLabelGet(handle) & + bind(C, name='DecayModeLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DecayModeLabelGet +end function DecayModeLabelGet + +!! Set +subroutine DecayModeLabelSet(handle, label, labelSize) & + bind(C, name='DecayModeLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine DecayModeLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: mode +!! ----------------------------------------------------------------------------- + +!! Has +function DecayModeModeHas(handle) & + bind(C, name='DecayModeModeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModeModeHas +end function DecayModeModeHas + +!! Get +function DecayModeModeGet(handle) & + bind(C, name='DecayModeModeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DecayModeModeGet +end function DecayModeModeGet + +!! Set +subroutine DecayModeModeSet(handle, mode, modeSize) & + bind(C, name='DecayModeModeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: modeSize + character(c_char), intent(in) :: mode(modeSize) +end subroutine DecayModeModeSet + + +!! ----------------------------------------------------------------------------- +!! Child: probability +!! ----------------------------------------------------------------------------- + +!! Has +function DecayModeProbabilityHas(handle) & + bind(C, name='DecayModeProbabilityHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModeProbabilityHas +end function DecayModeProbabilityHas + +!! Get, const +function DecayModeProbabilityGetConst(handle) & + bind(C, name='DecayModeProbabilityGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DecayModeProbabilityGetConst +end function DecayModeProbabilityGetConst + +!! Get, non-const +function DecayModeProbabilityGet(handle) & + bind(C, name='DecayModeProbabilityGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DecayModeProbabilityGet +end function DecayModeProbabilityGet + +!! Set +subroutine DecayModeProbabilitySet(handle, fieldHandle) & + bind(C, name='DecayModeProbabilitySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayModeProbabilitySet + + +!! ----------------------------------------------------------------------------- +!! Child: decayPath +!! ----------------------------------------------------------------------------- + +!! Has +function DecayModeDecayPathHas(handle) & + bind(C, name='DecayModeDecayPathHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModeDecayPathHas +end function DecayModeDecayPathHas + +!! Get, const +function DecayModeDecayPathGetConst(handle) & + bind(C, name='DecayModeDecayPathGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DecayModeDecayPathGetConst +end function DecayModeDecayPathGetConst + +!! Get, non-const +function DecayModeDecayPathGet(handle) & + bind(C, name='DecayModeDecayPathGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DecayModeDecayPathGet +end function DecayModeDecayPathGet + +!! Set +subroutine DecayModeDecayPathSet(handle, fieldHandle) & + bind(C, name='DecayModeDecayPathSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayModeDecayPathSet + + +!! ----------------------------------------------------------------------------- +!! Child: photonEmissionProbabilities +!! ----------------------------------------------------------------------------- + +!! Has +function DecayModePhotonEmissionProbabilitiesHas(handle) & + bind(C, name='DecayModePhotonEmissionProbabilitiesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModePhotonEmissionProbabilitiesHas +end function DecayModePhotonEmissionProbabilitiesHas + +!! Get, const +function DecayModePhotonEmissionProbabilitiesGetConst(handle) & + bind(C, name='DecayModePhotonEmissionProbabilitiesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DecayModePhotonEmissionProbabilitiesGetConst +end function DecayModePhotonEmissionProbabilitiesGetConst + +!! Get, non-const +function DecayModePhotonEmissionProbabilitiesGet(handle) & + bind(C, name='DecayModePhotonEmissionProbabilitiesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DecayModePhotonEmissionProbabilitiesGet +end function DecayModePhotonEmissionProbabilitiesGet + +!! Set +subroutine DecayModePhotonEmissionProbabilitiesSet(handle, fieldHandle) & + bind(C, name='DecayModePhotonEmissionProbabilitiesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayModePhotonEmissionProbabilitiesSet + + +!! ----------------------------------------------------------------------------- +!! Child: Q +!! ----------------------------------------------------------------------------- + +!! Has +function DecayModeQHas(handle) & + bind(C, name='DecayModeQHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModeQHas +end function DecayModeQHas + +!! Get, const +function DecayModeQGetConst(handle) & + bind(C, name='DecayModeQGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DecayModeQGetConst +end function DecayModeQGetConst + +!! Get, non-const +function DecayModeQGet(handle) & + bind(C, name='DecayModeQGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DecayModeQGet +end function DecayModeQGet + +!! Set +subroutine DecayModeQSet(handle, fieldHandle) & + bind(C, name='DecayModeQSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayModeQSet + + +!! ----------------------------------------------------------------------------- +!! Child: spectra +!! ----------------------------------------------------------------------------- + +!! Has +function DecayModeSpectraHas(handle) & + bind(C, name='DecayModeSpectraHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModeSpectraHas +end function DecayModeSpectraHas + +!! Get, const +function DecayModeSpectraGetConst(handle) & + bind(C, name='DecayModeSpectraGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DecayModeSpectraGetConst +end function DecayModeSpectraGetConst + +!! Get, non-const +function DecayModeSpectraGet(handle) & + bind(C, name='DecayModeSpectraGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DecayModeSpectraGet +end function DecayModeSpectraGet + +!! Set +subroutine DecayModeSpectraSet(handle, fieldHandle) & + bind(C, name='DecayModeSpectraSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayModeSpectraSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDecayMode diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayModes.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayModes.f03 new file mode 100644 index 000000000..e77b28867 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayModes.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDecayModes +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DecayModesDefaultConst() & + bind(C, name='DecayModesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DecayModesDefaultConst +end function DecayModesDefaultConst + +!! Create, default, non-const +function DecayModesDefault() & + bind(C, name='DecayModesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DecayModesDefault +end function DecayModesDefault + +!! Create, general, const +function DecayModesCreateConst( & + decayMode, decayModeSize & +) & + bind(C, name='DecayModesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: decayModeSize + type(c_ptr), intent(in) :: decayMode(decayModeSize) + type(c_ptr) :: DecayModesCreateConst +end function DecayModesCreateConst + +!! Create, general, non-const +function DecayModesCreate( & + decayMode, decayModeSize & +) & + bind(C, name='DecayModesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: decayModeSize + type(c_ptr), intent(in) :: decayMode(decayModeSize) + type(c_ptr) :: DecayModesCreate +end function DecayModesCreate + +!! Assign +subroutine DecayModesAssign(handleLHS, handleRHS) & + bind(C, name='DecayModesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DecayModesAssign + +!! Delete +subroutine DecayModesDelete(handle) & + bind(C, name='DecayModesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DecayModesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DecayModesRead(handle, filename, filenameSize) & + bind(C, name='DecayModesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DecayModesRead +end function DecayModesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DecayModesWrite(handle, filename, filenameSize) & + bind(C, name='DecayModesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DecayModesWrite +end function DecayModesWrite + +!! Print to standard output, in our prettyprinting format +function DecayModesPrint(handle) & + bind(C, name='DecayModesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModesPrint +end function DecayModesPrint + +!! Print to standard output, as XML +function DecayModesPrintXML(handle) & + bind(C, name='DecayModesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModesPrintXML +end function DecayModesPrintXML + +!! Print to standard output, as JSON +function DecayModesPrintJSON(handle) & + bind(C, name='DecayModesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModesPrintJSON +end function DecayModesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: decayMode +!! ----------------------------------------------------------------------------- + +!! Has +function DecayModesDecayModeHas(handle) & + bind(C, name='DecayModesDecayModeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayModesDecayModeHas +end function DecayModesDecayModeHas + +!! Clear +subroutine DecayModesDecayModeClear(handle) & + bind(C, name='DecayModesDecayModeClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DecayModesDecayModeClear + +!! Size +function DecayModesDecayModeSize(handle) & + bind(C, name='DecayModesDecayModeSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: DecayModesDecayModeSize +end function DecayModesDecayModeSize + +!! Add +subroutine DecayModesDecayModeAdd(handle, fieldHandle) & + bind(C, name='DecayModesDecayModeAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayModesDecayModeAdd + +!! Get, by index \in [0,size), const +function DecayModesDecayModeGetConst(handle, index) & + bind(C, name='DecayModesDecayModeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: DecayModesDecayModeGetConst +end function DecayModesDecayModeGetConst + +!! Get, by index \in [0,size), non-const +function DecayModesDecayModeGet(handle, index) & + bind(C, name='DecayModesDecayModeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: DecayModesDecayModeGet +end function DecayModesDecayModeGet + +!! Set, by index \in [0,size) +subroutine DecayModesDecayModeSet(handle, index, fieldHandle) & + bind(C, name='DecayModesDecayModeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayModesDecayModeSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function DecayModesDecayModeHasByLabel(handle, meta, metaSize) & + bind(C, name='DecayModesDecayModeHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: DecayModesDecayModeHasByLabel +end function DecayModesDecayModeHasByLabel + +!! Get, by label, const +function DecayModesDecayModeGetByLabelConst(handle, meta, metaSize) & + bind(C, name='DecayModesDecayModeGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DecayModesDecayModeGetByLabelConst +end function DecayModesDecayModeGetByLabelConst + +!! Get, by label, non-const +function DecayModesDecayModeGetByLabel(handle, meta, metaSize) & + bind(C, name='DecayModesDecayModeGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DecayModesDecayModeGetByLabel +end function DecayModesDecayModeGetByLabel + +!! Set, by label +subroutine DecayModesDecayModeSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='DecayModesDecayModeSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayModesDecayModeSetByLabel + +!! ------------------------ +!! Re: metadatum mode +!! ------------------------ + +!! Has, by mode +function DecayModesDecayModeHasByMode(handle, meta, metaSize) & + bind(C, name='DecayModesDecayModeHasByMode') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: DecayModesDecayModeHasByMode +end function DecayModesDecayModeHasByMode + +!! Get, by mode, const +function DecayModesDecayModeGetByModeConst(handle, meta, metaSize) & + bind(C, name='DecayModesDecayModeGetByModeConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DecayModesDecayModeGetByModeConst +end function DecayModesDecayModeGetByModeConst + +!! Get, by mode, non-const +function DecayModesDecayModeGetByMode(handle, meta, metaSize) & + bind(C, name='DecayModesDecayModeGetByMode') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DecayModesDecayModeGetByMode +end function DecayModesDecayModeGetByMode + +!! Set, by mode +subroutine DecayModesDecayModeSetByMode(handle, meta, metaSize, fieldHandle) & + bind(C, name='DecayModesDecayModeSetByMode') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayModesDecayModeSetByMode + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDecayModes diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayPath.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayPath.f03 new file mode 100644 index 000000000..0bbaff008 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DecayPath.f03 @@ -0,0 +1,343 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDecayPath +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DecayPathDefaultConst() & + bind(C, name='DecayPathDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DecayPathDefaultConst +end function DecayPathDefaultConst + +!! Create, default, non-const +function DecayPathDefault() & + bind(C, name='DecayPathDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DecayPathDefault +end function DecayPathDefault + +!! Create, general, const +function DecayPathCreateConst( & + decay, decaySize & +) & + bind(C, name='DecayPathCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: decaySize + type(c_ptr), intent(in) :: decay(decaySize) + type(c_ptr) :: DecayPathCreateConst +end function DecayPathCreateConst + +!! Create, general, non-const +function DecayPathCreate( & + decay, decaySize & +) & + bind(C, name='DecayPathCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: decaySize + type(c_ptr), intent(in) :: decay(decaySize) + type(c_ptr) :: DecayPathCreate +end function DecayPathCreate + +!! Assign +subroutine DecayPathAssign(handleLHS, handleRHS) & + bind(C, name='DecayPathAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DecayPathAssign + +!! Delete +subroutine DecayPathDelete(handle) & + bind(C, name='DecayPathDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DecayPathDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DecayPathRead(handle, filename, filenameSize) & + bind(C, name='DecayPathRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DecayPathRead +end function DecayPathRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DecayPathWrite(handle, filename, filenameSize) & + bind(C, name='DecayPathWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DecayPathWrite +end function DecayPathWrite + +!! Print to standard output, in our prettyprinting format +function DecayPathPrint(handle) & + bind(C, name='DecayPathPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayPathPrint +end function DecayPathPrint + +!! Print to standard output, as XML +function DecayPathPrintXML(handle) & + bind(C, name='DecayPathPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayPathPrintXML +end function DecayPathPrintXML + +!! Print to standard output, as JSON +function DecayPathPrintJSON(handle) & + bind(C, name='DecayPathPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayPathPrintJSON +end function DecayPathPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: decay +!! ----------------------------------------------------------------------------- + +!! Has +function DecayPathDecayHas(handle) & + bind(C, name='DecayPathDecayHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DecayPathDecayHas +end function DecayPathDecayHas + +!! Clear +subroutine DecayPathDecayClear(handle) & + bind(C, name='DecayPathDecayClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DecayPathDecayClear + +!! Size +function DecayPathDecaySize(handle) & + bind(C, name='DecayPathDecaySize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: DecayPathDecaySize +end function DecayPathDecaySize + +!! Add +subroutine DecayPathDecayAdd(handle, fieldHandle) & + bind(C, name='DecayPathDecayAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayPathDecayAdd + +!! Get, by index \in [0,size), const +function DecayPathDecayGetConst(handle, index) & + bind(C, name='DecayPathDecayGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: DecayPathDecayGetConst +end function DecayPathDecayGetConst + +!! Get, by index \in [0,size), non-const +function DecayPathDecayGet(handle, index) & + bind(C, name='DecayPathDecayGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: DecayPathDecayGet +end function DecayPathDecayGet + +!! Set, by index \in [0,size) +subroutine DecayPathDecaySet(handle, index, fieldHandle) & + bind(C, name='DecayPathDecaySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayPathDecaySet + +!! ------------------------ +!! Re: metadatum index +!! ------------------------ + +!! Has, by index +function DecayPathDecayHasByIndex(handle, meta) & + bind(C, name='DecayPathDecayHasByIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: DecayPathDecayHasByIndex +end function DecayPathDecayHasByIndex + +!! Get, by index, const +function DecayPathDecayGetByIndexConst(handle, meta) & + bind(C, name='DecayPathDecayGetByIndexConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: DecayPathDecayGetByIndexConst +end function DecayPathDecayGetByIndexConst + +!! Get, by index, non-const +function DecayPathDecayGetByIndex(handle, meta) & + bind(C, name='DecayPathDecayGetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: DecayPathDecayGetByIndex +end function DecayPathDecayGetByIndex + +!! Set, by index +subroutine DecayPathDecaySetByIndex(handle, meta, fieldHandle) & + bind(C, name='DecayPathDecaySetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayPathDecaySetByIndex + +!! ------------------------ +!! Re: metadatum mode +!! ------------------------ + +!! Has, by mode +function DecayPathDecayHasByMode(handle, meta, metaSize) & + bind(C, name='DecayPathDecayHasByMode') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: DecayPathDecayHasByMode +end function DecayPathDecayHasByMode + +!! Get, by mode, const +function DecayPathDecayGetByModeConst(handle, meta, metaSize) & + bind(C, name='DecayPathDecayGetByModeConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DecayPathDecayGetByModeConst +end function DecayPathDecayGetByModeConst + +!! Get, by mode, non-const +function DecayPathDecayGetByMode(handle, meta, metaSize) & + bind(C, name='DecayPathDecayGetByMode') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DecayPathDecayGetByMode +end function DecayPathDecayGetByMode + +!! Set, by mode +subroutine DecayPathDecaySetByMode(handle, meta, metaSize, fieldHandle) & + bind(C, name='DecayPathDecaySetByMode') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayPathDecaySetByMode + +!! ------------------------ +!! Re: metadatum complete +!! ------------------------ + +!! Has, by complete +function DecayPathDecayHasByComplete(handle, meta) & + bind(C, name='DecayPathDecayHasByComplete') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool), intent(in), value :: meta + integer(c_int) :: DecayPathDecayHasByComplete +end function DecayPathDecayHasByComplete + +!! Get, by complete, const +function DecayPathDecayGetByCompleteConst(handle, meta) & + bind(C, name='DecayPathDecayGetByCompleteConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr) :: DecayPathDecayGetByCompleteConst +end function DecayPathDecayGetByCompleteConst + +!! Get, by complete, non-const +function DecayPathDecayGetByComplete(handle, meta) & + bind(C, name='DecayPathDecayGetByComplete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr) :: DecayPathDecayGetByComplete +end function DecayPathDecayGetByComplete + +!! Set, by complete +subroutine DecayPathDecaySetByComplete(handle, meta, fieldHandle) & + bind(C, name='DecayPathDecaySetByComplete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DecayPathDecaySetByComplete + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDecayPath diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedBetaEnergy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedBetaEnergy.f03 new file mode 100644 index 000000000..07a5a3cb9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedBetaEnergy.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDelayedBetaEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DelayedBetaEnergyDefaultConst() & + bind(C, name='DelayedBetaEnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DelayedBetaEnergyDefaultConst +end function DelayedBetaEnergyDefaultConst + +!! Create, default, non-const +function DelayedBetaEnergyDefault() & + bind(C, name='DelayedBetaEnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DelayedBetaEnergyDefault +end function DelayedBetaEnergyDefault + +!! Create, general, const +function DelayedBetaEnergyCreateConst( & + polynomial1d & +) & + bind(C, name='DelayedBetaEnergyCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: DelayedBetaEnergyCreateConst +end function DelayedBetaEnergyCreateConst + +!! Create, general, non-const +function DelayedBetaEnergyCreate( & + polynomial1d & +) & + bind(C, name='DelayedBetaEnergyCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: DelayedBetaEnergyCreate +end function DelayedBetaEnergyCreate + +!! Assign +subroutine DelayedBetaEnergyAssign(handleLHS, handleRHS) & + bind(C, name='DelayedBetaEnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DelayedBetaEnergyAssign + +!! Delete +subroutine DelayedBetaEnergyDelete(handle) & + bind(C, name='DelayedBetaEnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DelayedBetaEnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DelayedBetaEnergyRead(handle, filename, filenameSize) & + bind(C, name='DelayedBetaEnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DelayedBetaEnergyRead +end function DelayedBetaEnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DelayedBetaEnergyWrite(handle, filename, filenameSize) & + bind(C, name='DelayedBetaEnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DelayedBetaEnergyWrite +end function DelayedBetaEnergyWrite + +!! Print to standard output, in our prettyprinting format +function DelayedBetaEnergyPrint(handle) & + bind(C, name='DelayedBetaEnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedBetaEnergyPrint +end function DelayedBetaEnergyPrint + +!! Print to standard output, as XML +function DelayedBetaEnergyPrintXML(handle) & + bind(C, name='DelayedBetaEnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedBetaEnergyPrintXML +end function DelayedBetaEnergyPrintXML + +!! Print to standard output, as JSON +function DelayedBetaEnergyPrintJSON(handle) & + bind(C, name='DelayedBetaEnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedBetaEnergyPrintJSON +end function DelayedBetaEnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: polynomial1d +!! ----------------------------------------------------------------------------- + +!! Has +function DelayedBetaEnergyPolynomial1dHas(handle) & + bind(C, name='DelayedBetaEnergyPolynomial1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedBetaEnergyPolynomial1dHas +end function DelayedBetaEnergyPolynomial1dHas + +!! Get, const +function DelayedBetaEnergyPolynomial1dGetConst(handle) & + bind(C, name='DelayedBetaEnergyPolynomial1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DelayedBetaEnergyPolynomial1dGetConst +end function DelayedBetaEnergyPolynomial1dGetConst + +!! Get, non-const +function DelayedBetaEnergyPolynomial1dGet(handle) & + bind(C, name='DelayedBetaEnergyPolynomial1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DelayedBetaEnergyPolynomial1dGet +end function DelayedBetaEnergyPolynomial1dGet + +!! Set +subroutine DelayedBetaEnergyPolynomial1dSet(handle, fieldHandle) & + bind(C, name='DelayedBetaEnergyPolynomial1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DelayedBetaEnergyPolynomial1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDelayedBetaEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedGammaEnergy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedGammaEnergy.f03 new file mode 100644 index 000000000..4fdcdca03 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedGammaEnergy.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDelayedGammaEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DelayedGammaEnergyDefaultConst() & + bind(C, name='DelayedGammaEnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DelayedGammaEnergyDefaultConst +end function DelayedGammaEnergyDefaultConst + +!! Create, default, non-const +function DelayedGammaEnergyDefault() & + bind(C, name='DelayedGammaEnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DelayedGammaEnergyDefault +end function DelayedGammaEnergyDefault + +!! Create, general, const +function DelayedGammaEnergyCreateConst( & + polynomial1d & +) & + bind(C, name='DelayedGammaEnergyCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: DelayedGammaEnergyCreateConst +end function DelayedGammaEnergyCreateConst + +!! Create, general, non-const +function DelayedGammaEnergyCreate( & + polynomial1d & +) & + bind(C, name='DelayedGammaEnergyCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: DelayedGammaEnergyCreate +end function DelayedGammaEnergyCreate + +!! Assign +subroutine DelayedGammaEnergyAssign(handleLHS, handleRHS) & + bind(C, name='DelayedGammaEnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DelayedGammaEnergyAssign + +!! Delete +subroutine DelayedGammaEnergyDelete(handle) & + bind(C, name='DelayedGammaEnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DelayedGammaEnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DelayedGammaEnergyRead(handle, filename, filenameSize) & + bind(C, name='DelayedGammaEnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DelayedGammaEnergyRead +end function DelayedGammaEnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DelayedGammaEnergyWrite(handle, filename, filenameSize) & + bind(C, name='DelayedGammaEnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DelayedGammaEnergyWrite +end function DelayedGammaEnergyWrite + +!! Print to standard output, in our prettyprinting format +function DelayedGammaEnergyPrint(handle) & + bind(C, name='DelayedGammaEnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedGammaEnergyPrint +end function DelayedGammaEnergyPrint + +!! Print to standard output, as XML +function DelayedGammaEnergyPrintXML(handle) & + bind(C, name='DelayedGammaEnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedGammaEnergyPrintXML +end function DelayedGammaEnergyPrintXML + +!! Print to standard output, as JSON +function DelayedGammaEnergyPrintJSON(handle) & + bind(C, name='DelayedGammaEnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedGammaEnergyPrintJSON +end function DelayedGammaEnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: polynomial1d +!! ----------------------------------------------------------------------------- + +!! Has +function DelayedGammaEnergyPolynomial1dHas(handle) & + bind(C, name='DelayedGammaEnergyPolynomial1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedGammaEnergyPolynomial1dHas +end function DelayedGammaEnergyPolynomial1dHas + +!! Get, const +function DelayedGammaEnergyPolynomial1dGetConst(handle) & + bind(C, name='DelayedGammaEnergyPolynomial1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DelayedGammaEnergyPolynomial1dGetConst +end function DelayedGammaEnergyPolynomial1dGetConst + +!! Get, non-const +function DelayedGammaEnergyPolynomial1dGet(handle) & + bind(C, name='DelayedGammaEnergyPolynomial1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DelayedGammaEnergyPolynomial1dGet +end function DelayedGammaEnergyPolynomial1dGet + +!! Set +subroutine DelayedGammaEnergyPolynomial1dSet(handle, fieldHandle) & + bind(C, name='DelayedGammaEnergyPolynomial1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DelayedGammaEnergyPolynomial1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDelayedGammaEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedNeutron.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedNeutron.f03 new file mode 100644 index 000000000..6588a0392 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedNeutron.f03 @@ -0,0 +1,262 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDelayedNeutron +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DelayedNeutronDefaultConst() & + bind(C, name='DelayedNeutronDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DelayedNeutronDefaultConst +end function DelayedNeutronDefaultConst + +!! Create, default, non-const +function DelayedNeutronDefault() & + bind(C, name='DelayedNeutronDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DelayedNeutronDefault +end function DelayedNeutronDefault + +!! Create, general, const +function DelayedNeutronCreateConst( & + label, & + rate, & + product, & + labelSize & +) & + bind(C, name='DelayedNeutronCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: rate + type(c_ptr), intent(in), value :: product + type(c_ptr) :: DelayedNeutronCreateConst +end function DelayedNeutronCreateConst + +!! Create, general, non-const +function DelayedNeutronCreate( & + label, & + rate, & + product, & + labelSize & +) & + bind(C, name='DelayedNeutronCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: rate + type(c_ptr), intent(in), value :: product + type(c_ptr) :: DelayedNeutronCreate +end function DelayedNeutronCreate + +!! Assign +subroutine DelayedNeutronAssign(handleLHS, handleRHS) & + bind(C, name='DelayedNeutronAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DelayedNeutronAssign + +!! Delete +subroutine DelayedNeutronDelete(handle) & + bind(C, name='DelayedNeutronDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DelayedNeutronDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DelayedNeutronRead(handle, filename, filenameSize) & + bind(C, name='DelayedNeutronRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DelayedNeutronRead +end function DelayedNeutronRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DelayedNeutronWrite(handle, filename, filenameSize) & + bind(C, name='DelayedNeutronWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DelayedNeutronWrite +end function DelayedNeutronWrite + +!! Print to standard output, in our prettyprinting format +function DelayedNeutronPrint(handle) & + bind(C, name='DelayedNeutronPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronPrint +end function DelayedNeutronPrint + +!! Print to standard output, as XML +function DelayedNeutronPrintXML(handle) & + bind(C, name='DelayedNeutronPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronPrintXML +end function DelayedNeutronPrintXML + +!! Print to standard output, as JSON +function DelayedNeutronPrintJSON(handle) & + bind(C, name='DelayedNeutronPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronPrintJSON +end function DelayedNeutronPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function DelayedNeutronLabelHas(handle) & + bind(C, name='DelayedNeutronLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronLabelHas +end function DelayedNeutronLabelHas + +!! Get +function DelayedNeutronLabelGet(handle) & + bind(C, name='DelayedNeutronLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DelayedNeutronLabelGet +end function DelayedNeutronLabelGet + +!! Set +subroutine DelayedNeutronLabelSet(handle, label, labelSize) & + bind(C, name='DelayedNeutronLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine DelayedNeutronLabelSet + + +!! ----------------------------------------------------------------------------- +!! Child: rate +!! ----------------------------------------------------------------------------- + +!! Has +function DelayedNeutronRateHas(handle) & + bind(C, name='DelayedNeutronRateHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronRateHas +end function DelayedNeutronRateHas + +!! Get, const +function DelayedNeutronRateGetConst(handle) & + bind(C, name='DelayedNeutronRateGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DelayedNeutronRateGetConst +end function DelayedNeutronRateGetConst + +!! Get, non-const +function DelayedNeutronRateGet(handle) & + bind(C, name='DelayedNeutronRateGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DelayedNeutronRateGet +end function DelayedNeutronRateGet + +!! Set +subroutine DelayedNeutronRateSet(handle, fieldHandle) & + bind(C, name='DelayedNeutronRateSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DelayedNeutronRateSet + + +!! ----------------------------------------------------------------------------- +!! Child: product +!! ----------------------------------------------------------------------------- + +!! Has +function DelayedNeutronProductHas(handle) & + bind(C, name='DelayedNeutronProductHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronProductHas +end function DelayedNeutronProductHas + +!! Get, const +function DelayedNeutronProductGetConst(handle) & + bind(C, name='DelayedNeutronProductGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DelayedNeutronProductGetConst +end function DelayedNeutronProductGetConst + +!! Get, non-const +function DelayedNeutronProductGet(handle) & + bind(C, name='DelayedNeutronProductGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DelayedNeutronProductGet +end function DelayedNeutronProductGet + +!! Set +subroutine DelayedNeutronProductSet(handle, fieldHandle) & + bind(C, name='DelayedNeutronProductSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DelayedNeutronProductSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDelayedNeutron diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedNeutronKE.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedNeutronKE.f03 new file mode 100644 index 000000000..7d8dcc146 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedNeutronKE.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDelayedNeutronKE +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DelayedNeutronKEDefaultConst() & + bind(C, name='DelayedNeutronKEDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DelayedNeutronKEDefaultConst +end function DelayedNeutronKEDefaultConst + +!! Create, default, non-const +function DelayedNeutronKEDefault() & + bind(C, name='DelayedNeutronKEDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DelayedNeutronKEDefault +end function DelayedNeutronKEDefault + +!! Create, general, const +function DelayedNeutronKECreateConst( & + polynomial1d, & + XYs1d & +) & + bind(C, name='DelayedNeutronKECreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: DelayedNeutronKECreateConst +end function DelayedNeutronKECreateConst + +!! Create, general, non-const +function DelayedNeutronKECreate( & + polynomial1d, & + XYs1d & +) & + bind(C, name='DelayedNeutronKECreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: DelayedNeutronKECreate +end function DelayedNeutronKECreate + +!! Assign +subroutine DelayedNeutronKEAssign(handleLHS, handleRHS) & + bind(C, name='DelayedNeutronKEAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DelayedNeutronKEAssign + +!! Delete +subroutine DelayedNeutronKEDelete(handle) & + bind(C, name='DelayedNeutronKEDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DelayedNeutronKEDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DelayedNeutronKERead(handle, filename, filenameSize) & + bind(C, name='DelayedNeutronKERead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DelayedNeutronKERead +end function DelayedNeutronKERead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DelayedNeutronKEWrite(handle, filename, filenameSize) & + bind(C, name='DelayedNeutronKEWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DelayedNeutronKEWrite +end function DelayedNeutronKEWrite + +!! Print to standard output, in our prettyprinting format +function DelayedNeutronKEPrint(handle) & + bind(C, name='DelayedNeutronKEPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronKEPrint +end function DelayedNeutronKEPrint + +!! Print to standard output, as XML +function DelayedNeutronKEPrintXML(handle) & + bind(C, name='DelayedNeutronKEPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronKEPrintXML +end function DelayedNeutronKEPrintXML + +!! Print to standard output, as JSON +function DelayedNeutronKEPrintJSON(handle) & + bind(C, name='DelayedNeutronKEPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronKEPrintJSON +end function DelayedNeutronKEPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: polynomial1d +!! ----------------------------------------------------------------------------- + +!! Has +function DelayedNeutronKEPolynomial1dHas(handle) & + bind(C, name='DelayedNeutronKEPolynomial1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronKEPolynomial1dHas +end function DelayedNeutronKEPolynomial1dHas + +!! Get, const +function DelayedNeutronKEPolynomial1dGetConst(handle) & + bind(C, name='DelayedNeutronKEPolynomial1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DelayedNeutronKEPolynomial1dGetConst +end function DelayedNeutronKEPolynomial1dGetConst + +!! Get, non-const +function DelayedNeutronKEPolynomial1dGet(handle) & + bind(C, name='DelayedNeutronKEPolynomial1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DelayedNeutronKEPolynomial1dGet +end function DelayedNeutronKEPolynomial1dGet + +!! Set +subroutine DelayedNeutronKEPolynomial1dSet(handle, fieldHandle) & + bind(C, name='DelayedNeutronKEPolynomial1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DelayedNeutronKEPolynomial1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function DelayedNeutronKEXYs1dHas(handle) & + bind(C, name='DelayedNeutronKEXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronKEXYs1dHas +end function DelayedNeutronKEXYs1dHas + +!! Get, const +function DelayedNeutronKEXYs1dGetConst(handle) & + bind(C, name='DelayedNeutronKEXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DelayedNeutronKEXYs1dGetConst +end function DelayedNeutronKEXYs1dGetConst + +!! Get, non-const +function DelayedNeutronKEXYs1dGet(handle) & + bind(C, name='DelayedNeutronKEXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DelayedNeutronKEXYs1dGet +end function DelayedNeutronKEXYs1dGet + +!! Set +subroutine DelayedNeutronKEXYs1dSet(handle, fieldHandle) & + bind(C, name='DelayedNeutronKEXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DelayedNeutronKEXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDelayedNeutronKE diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedNeutrons.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedNeutrons.f03 new file mode 100644 index 000000000..aa82b7b77 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DelayedNeutrons.f03 @@ -0,0 +1,255 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDelayedNeutrons +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DelayedNeutronsDefaultConst() & + bind(C, name='DelayedNeutronsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DelayedNeutronsDefaultConst +end function DelayedNeutronsDefaultConst + +!! Create, default, non-const +function DelayedNeutronsDefault() & + bind(C, name='DelayedNeutronsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DelayedNeutronsDefault +end function DelayedNeutronsDefault + +!! Create, general, const +function DelayedNeutronsCreateConst( & + delayedNeutron, delayedNeutronSize & +) & + bind(C, name='DelayedNeutronsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: delayedNeutronSize + type(c_ptr), intent(in) :: delayedNeutron(delayedNeutronSize) + type(c_ptr) :: DelayedNeutronsCreateConst +end function DelayedNeutronsCreateConst + +!! Create, general, non-const +function DelayedNeutronsCreate( & + delayedNeutron, delayedNeutronSize & +) & + bind(C, name='DelayedNeutronsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: delayedNeutronSize + type(c_ptr), intent(in) :: delayedNeutron(delayedNeutronSize) + type(c_ptr) :: DelayedNeutronsCreate +end function DelayedNeutronsCreate + +!! Assign +subroutine DelayedNeutronsAssign(handleLHS, handleRHS) & + bind(C, name='DelayedNeutronsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DelayedNeutronsAssign + +!! Delete +subroutine DelayedNeutronsDelete(handle) & + bind(C, name='DelayedNeutronsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DelayedNeutronsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DelayedNeutronsRead(handle, filename, filenameSize) & + bind(C, name='DelayedNeutronsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DelayedNeutronsRead +end function DelayedNeutronsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DelayedNeutronsWrite(handle, filename, filenameSize) & + bind(C, name='DelayedNeutronsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DelayedNeutronsWrite +end function DelayedNeutronsWrite + +!! Print to standard output, in our prettyprinting format +function DelayedNeutronsPrint(handle) & + bind(C, name='DelayedNeutronsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronsPrint +end function DelayedNeutronsPrint + +!! Print to standard output, as XML +function DelayedNeutronsPrintXML(handle) & + bind(C, name='DelayedNeutronsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronsPrintXML +end function DelayedNeutronsPrintXML + +!! Print to standard output, as JSON +function DelayedNeutronsPrintJSON(handle) & + bind(C, name='DelayedNeutronsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronsPrintJSON +end function DelayedNeutronsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: delayedNeutron +!! ----------------------------------------------------------------------------- + +!! Has +function DelayedNeutronsDelayedNeutronHas(handle) & + bind(C, name='DelayedNeutronsDelayedNeutronHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DelayedNeutronsDelayedNeutronHas +end function DelayedNeutronsDelayedNeutronHas + +!! Clear +subroutine DelayedNeutronsDelayedNeutronClear(handle) & + bind(C, name='DelayedNeutronsDelayedNeutronClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DelayedNeutronsDelayedNeutronClear + +!! Size +function DelayedNeutronsDelayedNeutronSize(handle) & + bind(C, name='DelayedNeutronsDelayedNeutronSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: DelayedNeutronsDelayedNeutronSize +end function DelayedNeutronsDelayedNeutronSize + +!! Add +subroutine DelayedNeutronsDelayedNeutronAdd(handle, fieldHandle) & + bind(C, name='DelayedNeutronsDelayedNeutronAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DelayedNeutronsDelayedNeutronAdd + +!! Get, by index \in [0,size), const +function DelayedNeutronsDelayedNeutronGetConst(handle, index) & + bind(C, name='DelayedNeutronsDelayedNeutronGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: DelayedNeutronsDelayedNeutronGetConst +end function DelayedNeutronsDelayedNeutronGetConst + +!! Get, by index \in [0,size), non-const +function DelayedNeutronsDelayedNeutronGet(handle, index) & + bind(C, name='DelayedNeutronsDelayedNeutronGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: DelayedNeutronsDelayedNeutronGet +end function DelayedNeutronsDelayedNeutronGet + +!! Set, by index \in [0,size) +subroutine DelayedNeutronsDelayedNeutronSet(handle, index, fieldHandle) & + bind(C, name='DelayedNeutronsDelayedNeutronSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DelayedNeutronsDelayedNeutronSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function DelayedNeutronsDelayedNeutronHasByLabel(handle, meta, metaSize) & + bind(C, name='DelayedNeutronsDelayedNeutronHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: DelayedNeutronsDelayedNeutronHasByLabel +end function DelayedNeutronsDelayedNeutronHasByLabel + +!! Get, by label, const +function DelayedNeutronsDelayedNeutronGetByLabelConst(handle, meta, metaSize) & + bind(C, name='DelayedNeutronsDelayedNeutronGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DelayedNeutronsDelayedNeutronGetByLabelConst +end function DelayedNeutronsDelayedNeutronGetByLabelConst + +!! Get, by label, non-const +function DelayedNeutronsDelayedNeutronGetByLabel(handle, meta, metaSize) & + bind(C, name='DelayedNeutronsDelayedNeutronGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: DelayedNeutronsDelayedNeutronGetByLabel +end function DelayedNeutronsDelayedNeutronGetByLabel + +!! Set, by label +subroutine DelayedNeutronsDelayedNeutronSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='DelayedNeutronsDelayedNeutronSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DelayedNeutronsDelayedNeutronSetByLabel + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDelayedNeutrons diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Discrete.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Discrete.f03 new file mode 100644 index 000000000..fbb48982a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Discrete.f03 @@ -0,0 +1,352 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDiscrete +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DiscreteDefaultConst() & + bind(C, name='DiscreteDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DiscreteDefaultConst +end function DiscreteDefaultConst + +!! Create, default, non-const +function DiscreteDefault() & + bind(C, name='DiscreteDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DiscreteDefault +end function DiscreteDefault + +!! Create, general, const +function DiscreteCreateConst( & + type1, & + intensity, & + energy, & + internalConversionCoefficients, & + positronEmissionIntensity, & + type1Size & +) & + bind(C, name='DiscreteCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) + type(c_ptr), intent(in), value :: intensity + type(c_ptr), intent(in), value :: energy + type(c_ptr), intent(in), value :: internalConversionCoefficients + type(c_ptr), intent(in), value :: positronEmissionIntensity + type(c_ptr) :: DiscreteCreateConst +end function DiscreteCreateConst + +!! Create, general, non-const +function DiscreteCreate( & + type1, & + intensity, & + energy, & + internalConversionCoefficients, & + positronEmissionIntensity, & + type1Size & +) & + bind(C, name='DiscreteCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) + type(c_ptr), intent(in), value :: intensity + type(c_ptr), intent(in), value :: energy + type(c_ptr), intent(in), value :: internalConversionCoefficients + type(c_ptr), intent(in), value :: positronEmissionIntensity + type(c_ptr) :: DiscreteCreate +end function DiscreteCreate + +!! Assign +subroutine DiscreteAssign(handleLHS, handleRHS) & + bind(C, name='DiscreteAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DiscreteAssign + +!! Delete +subroutine DiscreteDelete(handle) & + bind(C, name='DiscreteDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DiscreteDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DiscreteRead(handle, filename, filenameSize) & + bind(C, name='DiscreteRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DiscreteRead +end function DiscreteRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DiscreteWrite(handle, filename, filenameSize) & + bind(C, name='DiscreteWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DiscreteWrite +end function DiscreteWrite + +!! Print to standard output, in our prettyprinting format +function DiscretePrint(handle) & + bind(C, name='DiscretePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscretePrint +end function DiscretePrint + +!! Print to standard output, as XML +function DiscretePrintXML(handle) & + bind(C, name='DiscretePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscretePrintXML +end function DiscretePrintXML + +!! Print to standard output, as JSON +function DiscretePrintJSON(handle) & + bind(C, name='DiscretePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscretePrintJSON +end function DiscretePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: type +!! ----------------------------------------------------------------------------- + +!! Has +function DiscreteTypeHas(handle) & + bind(C, name='DiscreteTypeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscreteTypeHas +end function DiscreteTypeHas + +!! Get +function DiscreteTypeGet(handle) & + bind(C, name='DiscreteTypeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DiscreteTypeGet +end function DiscreteTypeGet + +!! Set +subroutine DiscreteTypeSet(handle, type1, type1Size) & + bind(C, name='DiscreteTypeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) +end subroutine DiscreteTypeSet + + +!! ----------------------------------------------------------------------------- +!! Child: intensity +!! ----------------------------------------------------------------------------- + +!! Has +function DiscreteIntensityHas(handle) & + bind(C, name='DiscreteIntensityHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscreteIntensityHas +end function DiscreteIntensityHas + +!! Get, const +function DiscreteIntensityGetConst(handle) & + bind(C, name='DiscreteIntensityGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DiscreteIntensityGetConst +end function DiscreteIntensityGetConst + +!! Get, non-const +function DiscreteIntensityGet(handle) & + bind(C, name='DiscreteIntensityGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DiscreteIntensityGet +end function DiscreteIntensityGet + +!! Set +subroutine DiscreteIntensitySet(handle, fieldHandle) & + bind(C, name='DiscreteIntensitySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DiscreteIntensitySet + + +!! ----------------------------------------------------------------------------- +!! Child: energy +!! ----------------------------------------------------------------------------- + +!! Has +function DiscreteEnergyHas(handle) & + bind(C, name='DiscreteEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscreteEnergyHas +end function DiscreteEnergyHas + +!! Get, const +function DiscreteEnergyGetConst(handle) & + bind(C, name='DiscreteEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DiscreteEnergyGetConst +end function DiscreteEnergyGetConst + +!! Get, non-const +function DiscreteEnergyGet(handle) & + bind(C, name='DiscreteEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DiscreteEnergyGet +end function DiscreteEnergyGet + +!! Set +subroutine DiscreteEnergySet(handle, fieldHandle) & + bind(C, name='DiscreteEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DiscreteEnergySet + + +!! ----------------------------------------------------------------------------- +!! Child: internalConversionCoefficients +!! ----------------------------------------------------------------------------- + +!! Has +function DiscreteInternalConversionCoefficientsHas(handle) & + bind(C, name='DiscreteInternalConversionCoefficientsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscreteInternalConversionCoefficientsHas +end function DiscreteInternalConversionCoefficientsHas + +!! Get, const +function DiscreteInternalConversionCoefficientsGetConst(handle) & + bind(C, name='DiscreteInternalConversionCoefficientsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DiscreteInternalConversionCoefficientsGetConst +end function DiscreteInternalConversionCoefficientsGetConst + +!! Get, non-const +function DiscreteInternalConversionCoefficientsGet(handle) & + bind(C, name='DiscreteInternalConversionCoefficientsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DiscreteInternalConversionCoefficientsGet +end function DiscreteInternalConversionCoefficientsGet + +!! Set +subroutine DiscreteInternalConversionCoefficientsSet(handle, fieldHandle) & + bind(C, name='DiscreteInternalConversionCoefficientsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DiscreteInternalConversionCoefficientsSet + + +!! ----------------------------------------------------------------------------- +!! Child: positronEmissionIntensity +!! ----------------------------------------------------------------------------- + +!! Has +function DiscretePositronEmissionIntensityHas(handle) & + bind(C, name='DiscretePositronEmissionIntensityHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscretePositronEmissionIntensityHas +end function DiscretePositronEmissionIntensityHas + +!! Get, const +function DiscretePositronEmissionIntensityGetConst(handle) & + bind(C, name='DiscretePositronEmissionIntensityGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DiscretePositronEmissionIntensityGetConst +end function DiscretePositronEmissionIntensityGetConst + +!! Get, non-const +function DiscretePositronEmissionIntensityGet(handle) & + bind(C, name='DiscretePositronEmissionIntensityGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DiscretePositronEmissionIntensityGet +end function DiscretePositronEmissionIntensityGet + +!! Set +subroutine DiscretePositronEmissionIntensitySet(handle, fieldHandle) & + bind(C, name='DiscretePositronEmissionIntensitySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DiscretePositronEmissionIntensitySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDiscrete diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DiscreteGamma.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DiscreteGamma.f03 new file mode 100644 index 000000000..16a33b99d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DiscreteGamma.f03 @@ -0,0 +1,284 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDiscreteGamma +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DiscreteGammaDefaultConst() & + bind(C, name='DiscreteGammaDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DiscreteGammaDefaultConst +end function DiscreteGammaDefaultConst + +!! Create, default, non-const +function DiscreteGammaDefault() & + bind(C, name='DiscreteGammaDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DiscreteGammaDefault +end function DiscreteGammaDefault + +!! Create, general, const +function DiscreteGammaCreateConst( & + value, & + domainMin, & + domainMax, & + axes & +) & + bind(C, name='DiscreteGammaCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + type(c_ptr), intent(in), value :: axes + type(c_ptr) :: DiscreteGammaCreateConst +end function DiscreteGammaCreateConst + +!! Create, general, non-const +function DiscreteGammaCreate( & + value, & + domainMin, & + domainMax, & + axes & +) & + bind(C, name='DiscreteGammaCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + type(c_ptr), intent(in), value :: axes + type(c_ptr) :: DiscreteGammaCreate +end function DiscreteGammaCreate + +!! Assign +subroutine DiscreteGammaAssign(handleLHS, handleRHS) & + bind(C, name='DiscreteGammaAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DiscreteGammaAssign + +!! Delete +subroutine DiscreteGammaDelete(handle) & + bind(C, name='DiscreteGammaDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DiscreteGammaDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DiscreteGammaRead(handle, filename, filenameSize) & + bind(C, name='DiscreteGammaRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DiscreteGammaRead +end function DiscreteGammaRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DiscreteGammaWrite(handle, filename, filenameSize) & + bind(C, name='DiscreteGammaWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DiscreteGammaWrite +end function DiscreteGammaWrite + +!! Print to standard output, in our prettyprinting format +function DiscreteGammaPrint(handle) & + bind(C, name='DiscreteGammaPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscreteGammaPrint +end function DiscreteGammaPrint + +!! Print to standard output, as XML +function DiscreteGammaPrintXML(handle) & + bind(C, name='DiscreteGammaPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscreteGammaPrintXML +end function DiscreteGammaPrintXML + +!! Print to standard output, as JSON +function DiscreteGammaPrintJSON(handle) & + bind(C, name='DiscreteGammaPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscreteGammaPrintJSON +end function DiscreteGammaPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function DiscreteGammaValueHas(handle) & + bind(C, name='DiscreteGammaValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscreteGammaValueHas +end function DiscreteGammaValueHas + +!! Get +function DiscreteGammaValueGet(handle) & + bind(C, name='DiscreteGammaValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: DiscreteGammaValueGet +end function DiscreteGammaValueGet + +!! Set +subroutine DiscreteGammaValueSet(handle, value) & + bind(C, name='DiscreteGammaValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine DiscreteGammaValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMin +!! ----------------------------------------------------------------------------- + +!! Has +function DiscreteGammaDomainMinHas(handle) & + bind(C, name='DiscreteGammaDomainMinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscreteGammaDomainMinHas +end function DiscreteGammaDomainMinHas + +!! Get +function DiscreteGammaDomainMinGet(handle) & + bind(C, name='DiscreteGammaDomainMinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: DiscreteGammaDomainMinGet +end function DiscreteGammaDomainMinGet + +!! Set +subroutine DiscreteGammaDomainMinSet(handle, domainMin) & + bind(C, name='DiscreteGammaDomainMinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMin +end subroutine DiscreteGammaDomainMinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMax +!! ----------------------------------------------------------------------------- + +!! Has +function DiscreteGammaDomainMaxHas(handle) & + bind(C, name='DiscreteGammaDomainMaxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscreteGammaDomainMaxHas +end function DiscreteGammaDomainMaxHas + +!! Get +function DiscreteGammaDomainMaxGet(handle) & + bind(C, name='DiscreteGammaDomainMaxGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: DiscreteGammaDomainMaxGet +end function DiscreteGammaDomainMaxGet + +!! Set +subroutine DiscreteGammaDomainMaxSet(handle, domainMax) & + bind(C, name='DiscreteGammaDomainMaxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMax +end subroutine DiscreteGammaDomainMaxSet + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function DiscreteGammaAxesHas(handle) & + bind(C, name='DiscreteGammaAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DiscreteGammaAxesHas +end function DiscreteGammaAxesHas + +!! Get, const +function DiscreteGammaAxesGetConst(handle) & + bind(C, name='DiscreteGammaAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DiscreteGammaAxesGetConst +end function DiscreteGammaAxesGetConst + +!! Get, non-const +function DiscreteGammaAxesGet(handle) & + bind(C, name='DiscreteGammaAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DiscreteGammaAxesGet +end function DiscreteGammaAxesGet + +!! Set +subroutine DiscreteGammaAxesSet(handle, fieldHandle) & + bind(C, name='DiscreteGammaAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DiscreteGammaAxesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDiscreteGamma diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Distribution.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Distribution.f03 new file mode 100644 index 000000000..dae154cc3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Distribution.f03 @@ -0,0 +1,626 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDistribution +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DistributionDefaultConst() & + bind(C, name='DistributionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DistributionDefaultConst +end function DistributionDefaultConst + +!! Create, default, non-const +function DistributionDefault() & + bind(C, name='DistributionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DistributionDefault +end function DistributionDefault + +!! Create, general, const +function DistributionCreateConst( & + thermalNeutronScatteringLaw, & + uncorrelated, & + unspecified, & + branching3d, & + angularTwoBody, & + energyAngular, & + KalbachMann, & + angularEnergy, & + CoulombPlusNuclearElastic, & + coherentPhotonScattering, & + incoherentPhotonScattering & +) & + bind(C, name='DistributionCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw + type(c_ptr), intent(in), value :: uncorrelated + type(c_ptr), intent(in), value :: unspecified + type(c_ptr), intent(in), value :: branching3d + type(c_ptr), intent(in), value :: angularTwoBody + type(c_ptr), intent(in), value :: energyAngular + type(c_ptr), intent(in), value :: KalbachMann + type(c_ptr), intent(in), value :: angularEnergy + type(c_ptr), intent(in), value :: CoulombPlusNuclearElastic + type(c_ptr), intent(in), value :: coherentPhotonScattering + type(c_ptr), intent(in), value :: incoherentPhotonScattering + type(c_ptr) :: DistributionCreateConst +end function DistributionCreateConst + +!! Create, general, non-const +function DistributionCreate( & + thermalNeutronScatteringLaw, & + uncorrelated, & + unspecified, & + branching3d, & + angularTwoBody, & + energyAngular, & + KalbachMann, & + angularEnergy, & + CoulombPlusNuclearElastic, & + coherentPhotonScattering, & + incoherentPhotonScattering & +) & + bind(C, name='DistributionCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw + type(c_ptr), intent(in), value :: uncorrelated + type(c_ptr), intent(in), value :: unspecified + type(c_ptr), intent(in), value :: branching3d + type(c_ptr), intent(in), value :: angularTwoBody + type(c_ptr), intent(in), value :: energyAngular + type(c_ptr), intent(in), value :: KalbachMann + type(c_ptr), intent(in), value :: angularEnergy + type(c_ptr), intent(in), value :: CoulombPlusNuclearElastic + type(c_ptr), intent(in), value :: coherentPhotonScattering + type(c_ptr), intent(in), value :: incoherentPhotonScattering + type(c_ptr) :: DistributionCreate +end function DistributionCreate + +!! Assign +subroutine DistributionAssign(handleLHS, handleRHS) & + bind(C, name='DistributionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DistributionAssign + +!! Delete +subroutine DistributionDelete(handle) & + bind(C, name='DistributionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DistributionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DistributionRead(handle, filename, filenameSize) & + bind(C, name='DistributionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DistributionRead +end function DistributionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DistributionWrite(handle, filename, filenameSize) & + bind(C, name='DistributionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DistributionWrite +end function DistributionWrite + +!! Print to standard output, in our prettyprinting format +function DistributionPrint(handle) & + bind(C, name='DistributionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionPrint +end function DistributionPrint + +!! Print to standard output, as XML +function DistributionPrintXML(handle) & + bind(C, name='DistributionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionPrintXML +end function DistributionPrintXML + +!! Print to standard output, as JSON +function DistributionPrintJSON(handle) & + bind(C, name='DistributionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionPrintJSON +end function DistributionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: thermalNeutronScatteringLaw +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionThermalNeutronScatteringLawHas(handle) & + bind(C, name='DistributionThermalNeutronScatteringLawHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionThermalNeutronScatteringLawHas +end function DistributionThermalNeutronScatteringLawHas + +!! Get, const +function DistributionThermalNeutronScatteringLawGetConst(handle) & + bind(C, name='DistributionThermalNeutronScatteringLawGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionThermalNeutronScatteringLawGetConst +end function DistributionThermalNeutronScatteringLawGetConst + +!! Get, non-const +function DistributionThermalNeutronScatteringLawGet(handle) & + bind(C, name='DistributionThermalNeutronScatteringLawGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionThermalNeutronScatteringLawGet +end function DistributionThermalNeutronScatteringLawGet + +!! Set +subroutine DistributionThermalNeutronScatteringLawSet(handle, fieldHandle) & + bind(C, name='DistributionThermalNeutronScatteringLawSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionThermalNeutronScatteringLawSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncorrelated +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionUncorrelatedHas(handle) & + bind(C, name='DistributionUncorrelatedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionUncorrelatedHas +end function DistributionUncorrelatedHas + +!! Get, const +function DistributionUncorrelatedGetConst(handle) & + bind(C, name='DistributionUncorrelatedGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionUncorrelatedGetConst +end function DistributionUncorrelatedGetConst + +!! Get, non-const +function DistributionUncorrelatedGet(handle) & + bind(C, name='DistributionUncorrelatedGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionUncorrelatedGet +end function DistributionUncorrelatedGet + +!! Set +subroutine DistributionUncorrelatedSet(handle, fieldHandle) & + bind(C, name='DistributionUncorrelatedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionUncorrelatedSet + + +!! ----------------------------------------------------------------------------- +!! Child: unspecified +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionUnspecifiedHas(handle) & + bind(C, name='DistributionUnspecifiedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionUnspecifiedHas +end function DistributionUnspecifiedHas + +!! Get, const +function DistributionUnspecifiedGetConst(handle) & + bind(C, name='DistributionUnspecifiedGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionUnspecifiedGetConst +end function DistributionUnspecifiedGetConst + +!! Get, non-const +function DistributionUnspecifiedGet(handle) & + bind(C, name='DistributionUnspecifiedGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionUnspecifiedGet +end function DistributionUnspecifiedGet + +!! Set +subroutine DistributionUnspecifiedSet(handle, fieldHandle) & + bind(C, name='DistributionUnspecifiedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionUnspecifiedSet + + +!! ----------------------------------------------------------------------------- +!! Child: branching3d +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionBranching3dHas(handle) & + bind(C, name='DistributionBranching3dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionBranching3dHas +end function DistributionBranching3dHas + +!! Get, const +function DistributionBranching3dGetConst(handle) & + bind(C, name='DistributionBranching3dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionBranching3dGetConst +end function DistributionBranching3dGetConst + +!! Get, non-const +function DistributionBranching3dGet(handle) & + bind(C, name='DistributionBranching3dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionBranching3dGet +end function DistributionBranching3dGet + +!! Set +subroutine DistributionBranching3dSet(handle, fieldHandle) & + bind(C, name='DistributionBranching3dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionBranching3dSet + + +!! ----------------------------------------------------------------------------- +!! Child: angularTwoBody +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionAngularTwoBodyHas(handle) & + bind(C, name='DistributionAngularTwoBodyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionAngularTwoBodyHas +end function DistributionAngularTwoBodyHas + +!! Get, const +function DistributionAngularTwoBodyGetConst(handle) & + bind(C, name='DistributionAngularTwoBodyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionAngularTwoBodyGetConst +end function DistributionAngularTwoBodyGetConst + +!! Get, non-const +function DistributionAngularTwoBodyGet(handle) & + bind(C, name='DistributionAngularTwoBodyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionAngularTwoBodyGet +end function DistributionAngularTwoBodyGet + +!! Set +subroutine DistributionAngularTwoBodySet(handle, fieldHandle) & + bind(C, name='DistributionAngularTwoBodySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionAngularTwoBodySet + + +!! ----------------------------------------------------------------------------- +!! Child: energyAngular +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionEnergyAngularHas(handle) & + bind(C, name='DistributionEnergyAngularHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionEnergyAngularHas +end function DistributionEnergyAngularHas + +!! Get, const +function DistributionEnergyAngularGetConst(handle) & + bind(C, name='DistributionEnergyAngularGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionEnergyAngularGetConst +end function DistributionEnergyAngularGetConst + +!! Get, non-const +function DistributionEnergyAngularGet(handle) & + bind(C, name='DistributionEnergyAngularGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionEnergyAngularGet +end function DistributionEnergyAngularGet + +!! Set +subroutine DistributionEnergyAngularSet(handle, fieldHandle) & + bind(C, name='DistributionEnergyAngularSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionEnergyAngularSet + + +!! ----------------------------------------------------------------------------- +!! Child: KalbachMann +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionKalbachMannHas(handle) & + bind(C, name='DistributionKalbachMannHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionKalbachMannHas +end function DistributionKalbachMannHas + +!! Get, const +function DistributionKalbachMannGetConst(handle) & + bind(C, name='DistributionKalbachMannGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionKalbachMannGetConst +end function DistributionKalbachMannGetConst + +!! Get, non-const +function DistributionKalbachMannGet(handle) & + bind(C, name='DistributionKalbachMannGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionKalbachMannGet +end function DistributionKalbachMannGet + +!! Set +subroutine DistributionKalbachMannSet(handle, fieldHandle) & + bind(C, name='DistributionKalbachMannSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionKalbachMannSet + + +!! ----------------------------------------------------------------------------- +!! Child: angularEnergy +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionAngularEnergyHas(handle) & + bind(C, name='DistributionAngularEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionAngularEnergyHas +end function DistributionAngularEnergyHas + +!! Get, const +function DistributionAngularEnergyGetConst(handle) & + bind(C, name='DistributionAngularEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionAngularEnergyGetConst +end function DistributionAngularEnergyGetConst + +!! Get, non-const +function DistributionAngularEnergyGet(handle) & + bind(C, name='DistributionAngularEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionAngularEnergyGet +end function DistributionAngularEnergyGet + +!! Set +subroutine DistributionAngularEnergySet(handle, fieldHandle) & + bind(C, name='DistributionAngularEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionAngularEnergySet + + +!! ----------------------------------------------------------------------------- +!! Child: CoulombPlusNuclearElastic +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionCoulombPlusNuclearElasticHas(handle) & + bind(C, name='DistributionCoulombPlusNuclearElasticHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionCoulombPlusNuclearElasticHas +end function DistributionCoulombPlusNuclearElasticHas + +!! Get, const +function DistributionCoulombPlusNuclearElasticGetConst(handle) & + bind(C, name='DistributionCoulombPlusNuclearElasticGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionCoulombPlusNuclearElasticGetConst +end function DistributionCoulombPlusNuclearElasticGetConst + +!! Get, non-const +function DistributionCoulombPlusNuclearElasticGet(handle) & + bind(C, name='DistributionCoulombPlusNuclearElasticGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionCoulombPlusNuclearElasticGet +end function DistributionCoulombPlusNuclearElasticGet + +!! Set +subroutine DistributionCoulombPlusNuclearElasticSet(handle, fieldHandle) & + bind(C, name='DistributionCoulombPlusNuclearElasticSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionCoulombPlusNuclearElasticSet + + +!! ----------------------------------------------------------------------------- +!! Child: coherentPhotonScattering +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionCoherentPhotonScatteringHas(handle) & + bind(C, name='DistributionCoherentPhotonScatteringHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionCoherentPhotonScatteringHas +end function DistributionCoherentPhotonScatteringHas + +!! Get, const +function DistributionCoherentPhotonScatteringGetConst(handle) & + bind(C, name='DistributionCoherentPhotonScatteringGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionCoherentPhotonScatteringGetConst +end function DistributionCoherentPhotonScatteringGetConst + +!! Get, non-const +function DistributionCoherentPhotonScatteringGet(handle) & + bind(C, name='DistributionCoherentPhotonScatteringGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionCoherentPhotonScatteringGet +end function DistributionCoherentPhotonScatteringGet + +!! Set +subroutine DistributionCoherentPhotonScatteringSet(handle, fieldHandle) & + bind(C, name='DistributionCoherentPhotonScatteringSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionCoherentPhotonScatteringSet + + +!! ----------------------------------------------------------------------------- +!! Child: incoherentPhotonScattering +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionIncoherentPhotonScatteringHas(handle) & + bind(C, name='DistributionIncoherentPhotonScatteringHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionIncoherentPhotonScatteringHas +end function DistributionIncoherentPhotonScatteringHas + +!! Get, const +function DistributionIncoherentPhotonScatteringGetConst(handle) & + bind(C, name='DistributionIncoherentPhotonScatteringGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionIncoherentPhotonScatteringGetConst +end function DistributionIncoherentPhotonScatteringGetConst + +!! Get, non-const +function DistributionIncoherentPhotonScatteringGet(handle) & + bind(C, name='DistributionIncoherentPhotonScatteringGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionIncoherentPhotonScatteringGet +end function DistributionIncoherentPhotonScatteringGet + +!! Set +subroutine DistributionIncoherentPhotonScatteringSet(handle, fieldHandle) & + bind(C, name='DistributionIncoherentPhotonScatteringSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionIncoherentPhotonScatteringSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDistribution diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Documentation.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Documentation.f03 new file mode 100644 index 000000000..498ee9684 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Documentation.f03 @@ -0,0 +1,356 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDocumentation +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DocumentationDefaultConst() & + bind(C, name='DocumentationDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DocumentationDefaultConst +end function DocumentationDefaultConst + +!! Create, default, non-const +function DocumentationDefault() & + bind(C, name='DocumentationDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DocumentationDefault +end function DocumentationDefault + +!! Create, general, const +function DocumentationCreateConst( & + authors, & + dates, & + title, & + body, & + endfCompatible & +) & + bind(C, name='DocumentationCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: authors + type(c_ptr), intent(in), value :: dates + type(c_ptr), intent(in), value :: title + type(c_ptr), intent(in), value :: body + type(c_ptr), intent(in), value :: endfCompatible + type(c_ptr) :: DocumentationCreateConst +end function DocumentationCreateConst + +!! Create, general, non-const +function DocumentationCreate( & + authors, & + dates, & + title, & + body, & + endfCompatible & +) & + bind(C, name='DocumentationCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: authors + type(c_ptr), intent(in), value :: dates + type(c_ptr), intent(in), value :: title + type(c_ptr), intent(in), value :: body + type(c_ptr), intent(in), value :: endfCompatible + type(c_ptr) :: DocumentationCreate +end function DocumentationCreate + +!! Assign +subroutine DocumentationAssign(handleLHS, handleRHS) & + bind(C, name='DocumentationAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DocumentationAssign + +!! Delete +subroutine DocumentationDelete(handle) & + bind(C, name='DocumentationDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DocumentationDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DocumentationRead(handle, filename, filenameSize) & + bind(C, name='DocumentationRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DocumentationRead +end function DocumentationRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DocumentationWrite(handle, filename, filenameSize) & + bind(C, name='DocumentationWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DocumentationWrite +end function DocumentationWrite + +!! Print to standard output, in our prettyprinting format +function DocumentationPrint(handle) & + bind(C, name='DocumentationPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DocumentationPrint +end function DocumentationPrint + +!! Print to standard output, as XML +function DocumentationPrintXML(handle) & + bind(C, name='DocumentationPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DocumentationPrintXML +end function DocumentationPrintXML + +!! Print to standard output, as JSON +function DocumentationPrintJSON(handle) & + bind(C, name='DocumentationPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DocumentationPrintJSON +end function DocumentationPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: authors +!! ----------------------------------------------------------------------------- + +!! Has +function DocumentationAuthorsHas(handle) & + bind(C, name='DocumentationAuthorsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DocumentationAuthorsHas +end function DocumentationAuthorsHas + +!! Get, const +function DocumentationAuthorsGetConst(handle) & + bind(C, name='DocumentationAuthorsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DocumentationAuthorsGetConst +end function DocumentationAuthorsGetConst + +!! Get, non-const +function DocumentationAuthorsGet(handle) & + bind(C, name='DocumentationAuthorsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DocumentationAuthorsGet +end function DocumentationAuthorsGet + +!! Set +subroutine DocumentationAuthorsSet(handle, fieldHandle) & + bind(C, name='DocumentationAuthorsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DocumentationAuthorsSet + + +!! ----------------------------------------------------------------------------- +!! Child: dates +!! ----------------------------------------------------------------------------- + +!! Has +function DocumentationDatesHas(handle) & + bind(C, name='DocumentationDatesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DocumentationDatesHas +end function DocumentationDatesHas + +!! Get, const +function DocumentationDatesGetConst(handle) & + bind(C, name='DocumentationDatesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DocumentationDatesGetConst +end function DocumentationDatesGetConst + +!! Get, non-const +function DocumentationDatesGet(handle) & + bind(C, name='DocumentationDatesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DocumentationDatesGet +end function DocumentationDatesGet + +!! Set +subroutine DocumentationDatesSet(handle, fieldHandle) & + bind(C, name='DocumentationDatesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DocumentationDatesSet + + +!! ----------------------------------------------------------------------------- +!! Child: title +!! ----------------------------------------------------------------------------- + +!! Has +function DocumentationTitleHas(handle) & + bind(C, name='DocumentationTitleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DocumentationTitleHas +end function DocumentationTitleHas + +!! Get, const +function DocumentationTitleGetConst(handle) & + bind(C, name='DocumentationTitleGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DocumentationTitleGetConst +end function DocumentationTitleGetConst + +!! Get, non-const +function DocumentationTitleGet(handle) & + bind(C, name='DocumentationTitleGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DocumentationTitleGet +end function DocumentationTitleGet + +!! Set +subroutine DocumentationTitleSet(handle, fieldHandle) & + bind(C, name='DocumentationTitleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DocumentationTitleSet + + +!! ----------------------------------------------------------------------------- +!! Child: body +!! ----------------------------------------------------------------------------- + +!! Has +function DocumentationBodyHas(handle) & + bind(C, name='DocumentationBodyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DocumentationBodyHas +end function DocumentationBodyHas + +!! Get, const +function DocumentationBodyGetConst(handle) & + bind(C, name='DocumentationBodyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DocumentationBodyGetConst +end function DocumentationBodyGetConst + +!! Get, non-const +function DocumentationBodyGet(handle) & + bind(C, name='DocumentationBodyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DocumentationBodyGet +end function DocumentationBodyGet + +!! Set +subroutine DocumentationBodySet(handle, fieldHandle) & + bind(C, name='DocumentationBodySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DocumentationBodySet + + +!! ----------------------------------------------------------------------------- +!! Child: endfCompatible +!! ----------------------------------------------------------------------------- + +!! Has +function DocumentationEndfCompatibleHas(handle) & + bind(C, name='DocumentationEndfCompatibleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DocumentationEndfCompatibleHas +end function DocumentationEndfCompatibleHas + +!! Get, const +function DocumentationEndfCompatibleGetConst(handle) & + bind(C, name='DocumentationEndfCompatibleGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DocumentationEndfCompatibleGetConst +end function DocumentationEndfCompatibleGetConst + +!! Get, non-const +function DocumentationEndfCompatibleGet(handle) & + bind(C, name='DocumentationEndfCompatibleGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DocumentationEndfCompatibleGet +end function DocumentationEndfCompatibleGet + +!! Set +subroutine DocumentationEndfCompatibleSet(handle, fieldHandle) & + bind(C, name='DocumentationEndfCompatibleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DocumentationEndfCompatibleSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDocumentation diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Double.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Double.f03 new file mode 100644 index 000000000..f089c8f31 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Double.f03 @@ -0,0 +1,294 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDouble +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DoubleDefaultConst() & + bind(C, name='DoubleDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DoubleDefaultConst +end function DoubleDefaultConst + +!! Create, default, non-const +function DoubleDefault() & + bind(C, name='DoubleDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DoubleDefault +end function DoubleDefault + +!! Create, general, const +function DoubleCreateConst( & + label, & + value, & + unit, & + uncertainty, & + labelSize, & + unitSize & +) & + bind(C, name='DoubleCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: DoubleCreateConst +end function DoubleCreateConst + +!! Create, general, non-const +function DoubleCreate( & + label, & + value, & + unit, & + uncertainty, & + labelSize, & + unitSize & +) & + bind(C, name='DoubleCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: DoubleCreate +end function DoubleCreate + +!! Assign +subroutine DoubleAssign(handleLHS, handleRHS) & + bind(C, name='DoubleAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DoubleAssign + +!! Delete +subroutine DoubleDelete(handle) & + bind(C, name='DoubleDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DoubleDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DoubleRead(handle, filename, filenameSize) & + bind(C, name='DoubleRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DoubleRead +end function DoubleRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DoubleWrite(handle, filename, filenameSize) & + bind(C, name='DoubleWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DoubleWrite +end function DoubleWrite + +!! Print to standard output, in our prettyprinting format +function DoublePrint(handle) & + bind(C, name='DoublePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoublePrint +end function DoublePrint + +!! Print to standard output, as XML +function DoublePrintXML(handle) & + bind(C, name='DoublePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoublePrintXML +end function DoublePrintXML + +!! Print to standard output, as JSON +function DoublePrintJSON(handle) & + bind(C, name='DoublePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoublePrintJSON +end function DoublePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function DoubleLabelHas(handle) & + bind(C, name='DoubleLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleLabelHas +end function DoubleLabelHas + +!! Get +function DoubleLabelGet(handle) & + bind(C, name='DoubleLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DoubleLabelGet +end function DoubleLabelGet + +!! Set +subroutine DoubleLabelSet(handle, label, labelSize) & + bind(C, name='DoubleLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine DoubleLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function DoubleValueHas(handle) & + bind(C, name='DoubleValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleValueHas +end function DoubleValueHas + +!! Get +function DoubleValueGet(handle) & + bind(C, name='DoubleValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: DoubleValueGet +end function DoubleValueGet + +!! Set +subroutine DoubleValueSet(handle, value) & + bind(C, name='DoubleValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine DoubleValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function DoubleUnitHas(handle) & + bind(C, name='DoubleUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleUnitHas +end function DoubleUnitHas + +!! Get +function DoubleUnitGet(handle) & + bind(C, name='DoubleUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DoubleUnitGet +end function DoubleUnitGet + +!! Set +subroutine DoubleUnitSet(handle, unit, unitSize) & + bind(C, name='DoubleUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine DoubleUnitSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function DoubleUncertaintyHas(handle) & + bind(C, name='DoubleUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleUncertaintyHas +end function DoubleUncertaintyHas + +!! Get, const +function DoubleUncertaintyGetConst(handle) & + bind(C, name='DoubleUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DoubleUncertaintyGetConst +end function DoubleUncertaintyGetConst + +!! Get, non-const +function DoubleUncertaintyGet(handle) & + bind(C, name='DoubleUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DoubleUncertaintyGet +end function DoubleUncertaintyGet + +!! Set +subroutine DoubleUncertaintySet(handle, fieldHandle) & + bind(C, name='DoubleUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DoubleUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDouble diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DoubleDifferentialCrossSection.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DoubleDifferentialCrossSection.f03 new file mode 100644 index 000000000..a92e8530f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/DoubleDifferentialCrossSection.f03 @@ -0,0 +1,401 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalDoubleDifferentialCrossSection +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DoubleDifferentialCrossSectionDefaultConst() & + bind(C, name='DoubleDifferentialCrossSectionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DoubleDifferentialCrossSectionDefaultConst +end function DoubleDifferentialCrossSectionDefaultConst + +!! Create, default, non-const +function DoubleDifferentialCrossSectionDefault() & + bind(C, name='DoubleDifferentialCrossSectionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DoubleDifferentialCrossSectionDefault +end function DoubleDifferentialCrossSectionDefault + +!! Create, general, const +function DoubleDifferentialCrossSectionCreateConst( & + CoulombPlusNuclearElastic, & + coherentPhotonScattering, & + incoherentPhotonScattering, & + thermalNeutronScatteringLaw_coherentElastic, & + thermalNeutronScatteringLaw_incoherentElastic, & + thermalNeutronScatteringLaw_incoherentInelastic & +) & + bind(C, name='DoubleDifferentialCrossSectionCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: CoulombPlusNuclearElastic + type(c_ptr), intent(in), value :: coherentPhotonScattering + type(c_ptr), intent(in), value :: incoherentPhotonScattering + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw_coherentElastic + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw_incoherentElastic + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw_incoherentInelastic + type(c_ptr) :: DoubleDifferentialCrossSectionCreateConst +end function DoubleDifferentialCrossSectionCreateConst + +!! Create, general, non-const +function DoubleDifferentialCrossSectionCreate( & + CoulombPlusNuclearElastic, & + coherentPhotonScattering, & + incoherentPhotonScattering, & + thermalNeutronScatteringLaw_coherentElastic, & + thermalNeutronScatteringLaw_incoherentElastic, & + thermalNeutronScatteringLaw_incoherentInelastic & +) & + bind(C, name='DoubleDifferentialCrossSectionCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: CoulombPlusNuclearElastic + type(c_ptr), intent(in), value :: coherentPhotonScattering + type(c_ptr), intent(in), value :: incoherentPhotonScattering + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw_coherentElastic + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw_incoherentElastic + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw_incoherentInelastic + type(c_ptr) :: DoubleDifferentialCrossSectionCreate +end function DoubleDifferentialCrossSectionCreate + +!! Assign +subroutine DoubleDifferentialCrossSectionAssign(handleLHS, handleRHS) & + bind(C, name='DoubleDifferentialCrossSectionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DoubleDifferentialCrossSectionAssign + +!! Delete +subroutine DoubleDifferentialCrossSectionDelete(handle) & + bind(C, name='DoubleDifferentialCrossSectionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DoubleDifferentialCrossSectionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DoubleDifferentialCrossSectionRead(handle, filename, filenameSize) & + bind(C, name='DoubleDifferentialCrossSectionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DoubleDifferentialCrossSectionRead +end function DoubleDifferentialCrossSectionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DoubleDifferentialCrossSectionWrite(handle, filename, filenameSize) & + bind(C, name='DoubleDifferentialCrossSectionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DoubleDifferentialCrossSectionWrite +end function DoubleDifferentialCrossSectionWrite + +!! Print to standard output, in our prettyprinting format +function DoubleDifferentialCrossSectionPrint(handle) & + bind(C, name='DoubleDifferentialCrossSectionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleDifferentialCrossSectionPrint +end function DoubleDifferentialCrossSectionPrint + +!! Print to standard output, as XML +function DoubleDifferentialCrossSectionPrintXML(handle) & + bind(C, name='DoubleDifferentialCrossSectionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleDifferentialCrossSectionPrintXML +end function DoubleDifferentialCrossSectionPrintXML + +!! Print to standard output, as JSON +function DoubleDifferentialCrossSectionPrintJSON(handle) & + bind(C, name='DoubleDifferentialCrossSectionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleDifferentialCrossSectionPrintJSON +end function DoubleDifferentialCrossSectionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: CoulombPlusNuclearElastic +!! ----------------------------------------------------------------------------- + +!! Has +function DoubleDifferentialCrossSectionCoulombPlusNuclearElasticHas(handle) & + bind(C, name='DoubleDifferentialCrossSectionCoulombPlusNuclearElasticHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleDifferentialCrossSectionCoulombPlusNuclearElasticHas +end function DoubleDifferentialCrossSectionCoulombPlusNuclearElasticHas + +!! Get, const +function DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGetConst(handle) & + bind(C, name='DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGetConst +end function DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGetConst + +!! Get, non-const +function DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGet(handle) & + bind(C, name='DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGet +end function DoubleDifferentialCrossSectionCoulombPlusNuclearElasticGet + +!! Set +subroutine DoubleDifferentialCrossSectionCoulombPlusNuclearElasticSet(handle, fieldHandle) & + bind(C, name='DoubleDifferentialCrossSectionCoulombPlusNuclearElasticSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DoubleDifferentialCrossSectionCoulombPlusNuclearElasticSet + + +!! ----------------------------------------------------------------------------- +!! Child: coherentPhotonScattering +!! ----------------------------------------------------------------------------- + +!! Has +function DoubleDifferentialCrossSectionCoherentPhotonScatteringHas(handle) & + bind(C, name='DoubleDifferentialCrossSectionCoherentPhotonScatteringHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleDifferentialCrossSectionCoherentPhotonScatteringHas +end function DoubleDifferentialCrossSectionCoherentPhotonScatteringHas + +!! Get, const +function DoubleDifferentialCrossSectionCoherentPhotonScatteringGetConst(handle) & + bind(C, name='DoubleDifferentialCrossSectionCoherentPhotonScatteringGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionCoherentPhotonScatteringGetConst +end function DoubleDifferentialCrossSectionCoherentPhotonScatteringGetConst + +!! Get, non-const +function DoubleDifferentialCrossSectionCoherentPhotonScatteringGet(handle) & + bind(C, name='DoubleDifferentialCrossSectionCoherentPhotonScatteringGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionCoherentPhotonScatteringGet +end function DoubleDifferentialCrossSectionCoherentPhotonScatteringGet + +!! Set +subroutine DoubleDifferentialCrossSectionCoherentPhotonScatteringSet(handle, fieldHandle) & + bind(C, name='DoubleDifferentialCrossSectionCoherentPhotonScatteringSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DoubleDifferentialCrossSectionCoherentPhotonScatteringSet + + +!! ----------------------------------------------------------------------------- +!! Child: incoherentPhotonScattering +!! ----------------------------------------------------------------------------- + +!! Has +function DoubleDifferentialCrossSectionIncoherentPhotonScatteringHas(handle) & + bind(C, name='DoubleDifferentialCrossSectionIncoherentPhotonScatteringHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleDifferentialCrossSectionIncoherentPhotonScatteringHas +end function DoubleDifferentialCrossSectionIncoherentPhotonScatteringHas + +!! Get, const +function DoubleDifferentialCrossSectionIncoherentPhotonScatteringGetConst(handle) & + bind(C, name='DoubleDifferentialCrossSectionIncoherentPhotonScatteringGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionIncoherentPhotonScatteringGetConst +end function DoubleDifferentialCrossSectionIncoherentPhotonScatteringGetConst + +!! Get, non-const +function DoubleDifferentialCrossSectionIncoherentPhotonScatteringGet(handle) & + bind(C, name='DoubleDifferentialCrossSectionIncoherentPhotonScatteringGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionIncoherentPhotonScatteringGet +end function DoubleDifferentialCrossSectionIncoherentPhotonScatteringGet + +!! Set +subroutine DoubleDifferentialCrossSectionIncoherentPhotonScatteringSet(handle, fieldHandle) & + bind(C, name='DoubleDifferentialCrossSectionIncoherentPhotonScatteringSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DoubleDifferentialCrossSectionIncoherentPhotonScatteringSet + + +!! ----------------------------------------------------------------------------- +!! Child: thermalNeutronScatteringLaw_coherentElastic +!! ----------------------------------------------------------------------------- + +!! Has +function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticHas(handle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticHas +end function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticHas + +!! Get, const +function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGetConst(handle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGetConst +end function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGetConst + +!! Get, non-const +function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGet(handle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGet +end function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticGet + +!! Set +subroutine DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticSet(handle, fieldHandle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_coherentElasticSet + + +!! ----------------------------------------------------------------------------- +!! Child: thermalNeutronScatteringLaw_incoherentElastic +!! ----------------------------------------------------------------------------- + +!! Has +function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticHas(handle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticHas +end function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticHas + +!! Get, const +function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGetConst(handle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGetConst +end function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGetConst + +!! Get, non-const +function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGet(handle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGet +end function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticGet + +!! Set +subroutine DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticSet(handle, fieldHandle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentElasticSet + + +!! ----------------------------------------------------------------------------- +!! Child: thermalNeutronScatteringLaw_incoherentInelastic +!! ----------------------------------------------------------------------------- + +!! Has +function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticHas(handle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticHas +end function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticHas + +!! Get, const +function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGetConst(handle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGetConst +end function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGetConst + +!! Get, non-const +function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGet(handle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGet +end function DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticGet + +!! Set +subroutine DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticSet(handle, fieldHandle) & + bind(C, name='DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DoubleDifferentialCrossSectionThermalNeutronScatteringLaw_incoherentInelasticSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalDoubleDifferentialCrossSection diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EFH.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EFH.f03 new file mode 100644 index 000000000..a8532ccb5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EFH.f03 @@ -0,0 +1,208 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalEFH +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function EFHDefaultConst() & + bind(C, name='EFHDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: EFHDefaultConst +end function EFHDefaultConst + +!! Create, default, non-const +function EFHDefault() & + bind(C, name='EFHDefault') + use iso_c_binding + implicit none + type(c_ptr) :: EFHDefault +end function EFHDefault + +!! Create, general, const +function EFHCreateConst( & + value, & + unit, & + unitSize & +) & + bind(C, name='EFHCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: EFHCreateConst +end function EFHCreateConst + +!! Create, general, non-const +function EFHCreate( & + value, & + unit, & + unitSize & +) & + bind(C, name='EFHCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: EFHCreate +end function EFHCreate + +!! Assign +subroutine EFHAssign(handleLHS, handleRHS) & + bind(C, name='EFHAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine EFHAssign + +!! Delete +subroutine EFHDelete(handle) & + bind(C, name='EFHDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine EFHDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function EFHRead(handle, filename, filenameSize) & + bind(C, name='EFHRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EFHRead +end function EFHRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function EFHWrite(handle, filename, filenameSize) & + bind(C, name='EFHWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EFHWrite +end function EFHWrite + +!! Print to standard output, in our prettyprinting format +function EFHPrint(handle) & + bind(C, name='EFHPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EFHPrint +end function EFHPrint + +!! Print to standard output, as XML +function EFHPrintXML(handle) & + bind(C, name='EFHPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EFHPrintXML +end function EFHPrintXML + +!! Print to standard output, as JSON +function EFHPrintJSON(handle) & + bind(C, name='EFHPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EFHPrintJSON +end function EFHPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function EFHValueHas(handle) & + bind(C, name='EFHValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EFHValueHas +end function EFHValueHas + +!! Get +function EFHValueGet(handle) & + bind(C, name='EFHValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: EFHValueGet +end function EFHValueGet + +!! Set +subroutine EFHValueSet(handle, value) & + bind(C, name='EFHValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine EFHValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function EFHUnitHas(handle) & + bind(C, name='EFHUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EFHUnitHas +end function EFHUnitHas + +!! Get +function EFHUnitGet(handle) & + bind(C, name='EFHUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EFHUnitGet +end function EFHUnitGet + +!! Set +subroutine EFHUnitSet(handle, unit, unitSize) & + bind(C, name='EFHUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine EFHUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalEFH diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EFL.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EFL.f03 new file mode 100644 index 000000000..98b21910a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EFL.f03 @@ -0,0 +1,208 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalEFL +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function EFLDefaultConst() & + bind(C, name='EFLDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: EFLDefaultConst +end function EFLDefaultConst + +!! Create, default, non-const +function EFLDefault() & + bind(C, name='EFLDefault') + use iso_c_binding + implicit none + type(c_ptr) :: EFLDefault +end function EFLDefault + +!! Create, general, const +function EFLCreateConst( & + value, & + unit, & + unitSize & +) & + bind(C, name='EFLCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: EFLCreateConst +end function EFLCreateConst + +!! Create, general, non-const +function EFLCreate( & + value, & + unit, & + unitSize & +) & + bind(C, name='EFLCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: EFLCreate +end function EFLCreate + +!! Assign +subroutine EFLAssign(handleLHS, handleRHS) & + bind(C, name='EFLAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine EFLAssign + +!! Delete +subroutine EFLDelete(handle) & + bind(C, name='EFLDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine EFLDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function EFLRead(handle, filename, filenameSize) & + bind(C, name='EFLRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EFLRead +end function EFLRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function EFLWrite(handle, filename, filenameSize) & + bind(C, name='EFLWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EFLWrite +end function EFLWrite + +!! Print to standard output, in our prettyprinting format +function EFLPrint(handle) & + bind(C, name='EFLPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EFLPrint +end function EFLPrint + +!! Print to standard output, as XML +function EFLPrintXML(handle) & + bind(C, name='EFLPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EFLPrintXML +end function EFLPrintXML + +!! Print to standard output, as JSON +function EFLPrintJSON(handle) & + bind(C, name='EFLPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EFLPrintJSON +end function EFLPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function EFLValueHas(handle) & + bind(C, name='EFLValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EFLValueHas +end function EFLValueHas + +!! Get +function EFLValueGet(handle) & + bind(C, name='EFLValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: EFLValueGet +end function EFLValueGet + +!! Set +subroutine EFLValueSet(handle, value) & + bind(C, name='EFLValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine EFLValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function EFLUnitHas(handle) & + bind(C, name='EFLUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EFLUnitHas +end function EFLUnitHas + +!! Get +function EFLUnitGet(handle) & + bind(C, name='EFLUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EFLUnitGet +end function EFLUnitGet + +!! Set +subroutine EFLUnitSet(handle, unit, unitSize) & + bind(C, name='EFLUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine EFLUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalEFL diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ENDFconversionFlags.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ENDFconversionFlags.f03 new file mode 100644 index 000000000..1bb7bbb11 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ENDFconversionFlags.f03 @@ -0,0 +1,385 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalENDFconversionFlags +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ENDFconversionFlagsDefaultConst() & + bind(C, name='ENDFconversionFlagsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ENDFconversionFlagsDefaultConst +end function ENDFconversionFlagsDefaultConst + +!! Create, default, non-const +function ENDFconversionFlagsDefault() & + bind(C, name='ENDFconversionFlagsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ENDFconversionFlagsDefault +end function ENDFconversionFlagsDefault + +!! Create, general, const +function ENDFconversionFlagsCreateConst( & + flags, & + href, & + conversion, conversionSize, & + flagsSize, & + hrefSize & +) & + bind(C, name='ENDFconversionFlagsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: flagsSize + character(c_char), intent(in) :: flags(flagsSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + integer(c_size_t), intent(in), value :: conversionSize + type(c_ptr), intent(in) :: conversion(conversionSize) + type(c_ptr) :: ENDFconversionFlagsCreateConst +end function ENDFconversionFlagsCreateConst + +!! Create, general, non-const +function ENDFconversionFlagsCreate( & + flags, & + href, & + conversion, conversionSize, & + flagsSize, & + hrefSize & +) & + bind(C, name='ENDFconversionFlagsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: flagsSize + character(c_char), intent(in) :: flags(flagsSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + integer(c_size_t), intent(in), value :: conversionSize + type(c_ptr), intent(in) :: conversion(conversionSize) + type(c_ptr) :: ENDFconversionFlagsCreate +end function ENDFconversionFlagsCreate + +!! Assign +subroutine ENDFconversionFlagsAssign(handleLHS, handleRHS) & + bind(C, name='ENDFconversionFlagsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ENDFconversionFlagsAssign + +!! Delete +subroutine ENDFconversionFlagsDelete(handle) & + bind(C, name='ENDFconversionFlagsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ENDFconversionFlagsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ENDFconversionFlagsRead(handle, filename, filenameSize) & + bind(C, name='ENDFconversionFlagsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ENDFconversionFlagsRead +end function ENDFconversionFlagsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ENDFconversionFlagsWrite(handle, filename, filenameSize) & + bind(C, name='ENDFconversionFlagsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ENDFconversionFlagsWrite +end function ENDFconversionFlagsWrite + +!! Print to standard output, in our prettyprinting format +function ENDFconversionFlagsPrint(handle) & + bind(C, name='ENDFconversionFlagsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ENDFconversionFlagsPrint +end function ENDFconversionFlagsPrint + +!! Print to standard output, as XML +function ENDFconversionFlagsPrintXML(handle) & + bind(C, name='ENDFconversionFlagsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ENDFconversionFlagsPrintXML +end function ENDFconversionFlagsPrintXML + +!! Print to standard output, as JSON +function ENDFconversionFlagsPrintJSON(handle) & + bind(C, name='ENDFconversionFlagsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ENDFconversionFlagsPrintJSON +end function ENDFconversionFlagsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: flags +!! ----------------------------------------------------------------------------- + +!! Has +function ENDFconversionFlagsFlagsHas(handle) & + bind(C, name='ENDFconversionFlagsFlagsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ENDFconversionFlagsFlagsHas +end function ENDFconversionFlagsFlagsHas + +!! Get +function ENDFconversionFlagsFlagsGet(handle) & + bind(C, name='ENDFconversionFlagsFlagsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ENDFconversionFlagsFlagsGet +end function ENDFconversionFlagsFlagsGet + +!! Set +subroutine ENDFconversionFlagsFlagsSet(handle, flags, flagsSize) & + bind(C, name='ENDFconversionFlagsFlagsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: flagsSize + character(c_char), intent(in) :: flags(flagsSize) +end subroutine ENDFconversionFlagsFlagsSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function ENDFconversionFlagsHrefHas(handle) & + bind(C, name='ENDFconversionFlagsHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ENDFconversionFlagsHrefHas +end function ENDFconversionFlagsHrefHas + +!! Get +function ENDFconversionFlagsHrefGet(handle) & + bind(C, name='ENDFconversionFlagsHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ENDFconversionFlagsHrefGet +end function ENDFconversionFlagsHrefGet + +!! Set +subroutine ENDFconversionFlagsHrefSet(handle, href, hrefSize) & + bind(C, name='ENDFconversionFlagsHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine ENDFconversionFlagsHrefSet + + +!! ----------------------------------------------------------------------------- +!! Child: conversion +!! ----------------------------------------------------------------------------- + +!! Has +function ENDFconversionFlagsConversionHas(handle) & + bind(C, name='ENDFconversionFlagsConversionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ENDFconversionFlagsConversionHas +end function ENDFconversionFlagsConversionHas + +!! Clear +subroutine ENDFconversionFlagsConversionClear(handle) & + bind(C, name='ENDFconversionFlagsConversionClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ENDFconversionFlagsConversionClear + +!! Size +function ENDFconversionFlagsConversionSize(handle) & + bind(C, name='ENDFconversionFlagsConversionSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ENDFconversionFlagsConversionSize +end function ENDFconversionFlagsConversionSize + +!! Add +subroutine ENDFconversionFlagsConversionAdd(handle, fieldHandle) & + bind(C, name='ENDFconversionFlagsConversionAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ENDFconversionFlagsConversionAdd + +!! Get, by index \in [0,size), const +function ENDFconversionFlagsConversionGetConst(handle, index) & + bind(C, name='ENDFconversionFlagsConversionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ENDFconversionFlagsConversionGetConst +end function ENDFconversionFlagsConversionGetConst + +!! Get, by index \in [0,size), non-const +function ENDFconversionFlagsConversionGet(handle, index) & + bind(C, name='ENDFconversionFlagsConversionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ENDFconversionFlagsConversionGet +end function ENDFconversionFlagsConversionGet + +!! Set, by index \in [0,size) +subroutine ENDFconversionFlagsConversionSet(handle, index, fieldHandle) & + bind(C, name='ENDFconversionFlagsConversionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ENDFconversionFlagsConversionSet + +!! ------------------------ +!! Re: metadatum flags +!! ------------------------ + +!! Has, by flags +function ENDFconversionFlagsConversionHasByFlags(handle, meta, metaSize) & + bind(C, name='ENDFconversionFlagsConversionHasByFlags') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ENDFconversionFlagsConversionHasByFlags +end function ENDFconversionFlagsConversionHasByFlags + +!! Get, by flags, const +function ENDFconversionFlagsConversionGetByFlagsConst(handle, meta, metaSize) & + bind(C, name='ENDFconversionFlagsConversionGetByFlagsConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ENDFconversionFlagsConversionGetByFlagsConst +end function ENDFconversionFlagsConversionGetByFlagsConst + +!! Get, by flags, non-const +function ENDFconversionFlagsConversionGetByFlags(handle, meta, metaSize) & + bind(C, name='ENDFconversionFlagsConversionGetByFlags') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ENDFconversionFlagsConversionGetByFlags +end function ENDFconversionFlagsConversionGetByFlags + +!! Set, by flags +subroutine ENDFconversionFlagsConversionSetByFlags(handle, meta, metaSize, fieldHandle) & + bind(C, name='ENDFconversionFlagsConversionSetByFlags') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ENDFconversionFlagsConversionSetByFlags + +!! ------------------------ +!! Re: metadatum href +!! ------------------------ + +!! Has, by href +function ENDFconversionFlagsConversionHasByHref(handle, meta, metaSize) & + bind(C, name='ENDFconversionFlagsConversionHasByHref') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ENDFconversionFlagsConversionHasByHref +end function ENDFconversionFlagsConversionHasByHref + +!! Get, by href, const +function ENDFconversionFlagsConversionGetByHrefConst(handle, meta, metaSize) & + bind(C, name='ENDFconversionFlagsConversionGetByHrefConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ENDFconversionFlagsConversionGetByHrefConst +end function ENDFconversionFlagsConversionGetByHrefConst + +!! Get, by href, non-const +function ENDFconversionFlagsConversionGetByHref(handle, meta, metaSize) & + bind(C, name='ENDFconversionFlagsConversionGetByHref') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ENDFconversionFlagsConversionGetByHref +end function ENDFconversionFlagsConversionGetByHref + +!! Set, by href +subroutine ENDFconversionFlagsConversionSetByHref(handle, meta, metaSize, fieldHandle) & + bind(C, name='ENDFconversionFlagsConversionSetByHref') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ENDFconversionFlagsConversionSetByHref + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalENDFconversionFlags diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/E_critical.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/E_critical.f03 new file mode 100644 index 000000000..5552e3aa4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/E_critical.f03 @@ -0,0 +1,208 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalE_critical +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function E_criticalDefaultConst() & + bind(C, name='E_criticalDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: E_criticalDefaultConst +end function E_criticalDefaultConst + +!! Create, default, non-const +function E_criticalDefault() & + bind(C, name='E_criticalDefault') + use iso_c_binding + implicit none + type(c_ptr) :: E_criticalDefault +end function E_criticalDefault + +!! Create, general, const +function E_criticalCreateConst( & + value, & + unit, & + unitSize & +) & + bind(C, name='E_criticalCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: E_criticalCreateConst +end function E_criticalCreateConst + +!! Create, general, non-const +function E_criticalCreate( & + value, & + unit, & + unitSize & +) & + bind(C, name='E_criticalCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: E_criticalCreate +end function E_criticalCreate + +!! Assign +subroutine E_criticalAssign(handleLHS, handleRHS) & + bind(C, name='E_criticalAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine E_criticalAssign + +!! Delete +subroutine E_criticalDelete(handle) & + bind(C, name='E_criticalDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine E_criticalDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function E_criticalRead(handle, filename, filenameSize) & + bind(C, name='E_criticalRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: E_criticalRead +end function E_criticalRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function E_criticalWrite(handle, filename, filenameSize) & + bind(C, name='E_criticalWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: E_criticalWrite +end function E_criticalWrite + +!! Print to standard output, in our prettyprinting format +function E_criticalPrint(handle) & + bind(C, name='E_criticalPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: E_criticalPrint +end function E_criticalPrint + +!! Print to standard output, as XML +function E_criticalPrintXML(handle) & + bind(C, name='E_criticalPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: E_criticalPrintXML +end function E_criticalPrintXML + +!! Print to standard output, as JSON +function E_criticalPrintJSON(handle) & + bind(C, name='E_criticalPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: E_criticalPrintJSON +end function E_criticalPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function E_criticalValueHas(handle) & + bind(C, name='E_criticalValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: E_criticalValueHas +end function E_criticalValueHas + +!! Get +function E_criticalValueGet(handle) & + bind(C, name='E_criticalValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: E_criticalValueGet +end function E_criticalValueGet + +!! Set +subroutine E_criticalValueSet(handle, value) & + bind(C, name='E_criticalValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine E_criticalValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function E_criticalUnitHas(handle) & + bind(C, name='E_criticalUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: E_criticalUnitHas +end function E_criticalUnitHas + +!! Get +function E_criticalUnitGet(handle) & + bind(C, name='E_criticalUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: E_criticalUnitGet +end function E_criticalUnitGet + +!! Set +subroutine E_criticalUnitSet(handle, unit, unitSize) & + bind(C, name='E_criticalUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine E_criticalUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalE_critical diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/E_max.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/E_max.f03 new file mode 100644 index 000000000..86d0a4cea --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/E_max.f03 @@ -0,0 +1,208 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalE_max +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function E_maxDefaultConst() & + bind(C, name='E_maxDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: E_maxDefaultConst +end function E_maxDefaultConst + +!! Create, default, non-const +function E_maxDefault() & + bind(C, name='E_maxDefault') + use iso_c_binding + implicit none + type(c_ptr) :: E_maxDefault +end function E_maxDefault + +!! Create, general, const +function E_maxCreateConst( & + value, & + unit, & + unitSize & +) & + bind(C, name='E_maxCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: E_maxCreateConst +end function E_maxCreateConst + +!! Create, general, non-const +function E_maxCreate( & + value, & + unit, & + unitSize & +) & + bind(C, name='E_maxCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: E_maxCreate +end function E_maxCreate + +!! Assign +subroutine E_maxAssign(handleLHS, handleRHS) & + bind(C, name='E_maxAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine E_maxAssign + +!! Delete +subroutine E_maxDelete(handle) & + bind(C, name='E_maxDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine E_maxDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function E_maxRead(handle, filename, filenameSize) & + bind(C, name='E_maxRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: E_maxRead +end function E_maxRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function E_maxWrite(handle, filename, filenameSize) & + bind(C, name='E_maxWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: E_maxWrite +end function E_maxWrite + +!! Print to standard output, in our prettyprinting format +function E_maxPrint(handle) & + bind(C, name='E_maxPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: E_maxPrint +end function E_maxPrint + +!! Print to standard output, as XML +function E_maxPrintXML(handle) & + bind(C, name='E_maxPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: E_maxPrintXML +end function E_maxPrintXML + +!! Print to standard output, as JSON +function E_maxPrintJSON(handle) & + bind(C, name='E_maxPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: E_maxPrintJSON +end function E_maxPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function E_maxValueHas(handle) & + bind(C, name='E_maxValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: E_maxValueHas +end function E_maxValueHas + +!! Get +function E_maxValueGet(handle) & + bind(C, name='E_maxValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: E_maxValueGet +end function E_maxValueGet + +!! Set +subroutine E_maxValueSet(handle, value) & + bind(C, name='E_maxValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine E_maxValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function E_maxUnitHas(handle) & + bind(C, name='E_maxUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: E_maxUnitHas +end function E_maxUnitHas + +!! Get +function E_maxUnitGet(handle) & + bind(C, name='E_maxUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: E_maxUnitGet +end function E_maxUnitGet + +!! Set +subroutine E_maxUnitSet(handle, unit, unitSize) & + bind(C, name='E_maxUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine E_maxUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalE_max diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ElapsedTime.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ElapsedTime.f03 new file mode 100644 index 000000000..8bac482d7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ElapsedTime.f03 @@ -0,0 +1,307 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalElapsedTime +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ElapsedTimeDefaultConst() & + bind(C, name='ElapsedTimeDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ElapsedTimeDefaultConst +end function ElapsedTimeDefaultConst + +!! Create, default, non-const +function ElapsedTimeDefault() & + bind(C, name='ElapsedTimeDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ElapsedTimeDefault +end function ElapsedTimeDefault + +!! Create, general, const +function ElapsedTimeCreateConst( & + label, & + time, & + yields, & + incidentEnergies, & + labelSize & +) & + bind(C, name='ElapsedTimeCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: time + type(c_ptr), intent(in), value :: yields + type(c_ptr), intent(in), value :: incidentEnergies + type(c_ptr) :: ElapsedTimeCreateConst +end function ElapsedTimeCreateConst + +!! Create, general, non-const +function ElapsedTimeCreate( & + label, & + time, & + yields, & + incidentEnergies, & + labelSize & +) & + bind(C, name='ElapsedTimeCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: time + type(c_ptr), intent(in), value :: yields + type(c_ptr), intent(in), value :: incidentEnergies + type(c_ptr) :: ElapsedTimeCreate +end function ElapsedTimeCreate + +!! Assign +subroutine ElapsedTimeAssign(handleLHS, handleRHS) & + bind(C, name='ElapsedTimeAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ElapsedTimeAssign + +!! Delete +subroutine ElapsedTimeDelete(handle) & + bind(C, name='ElapsedTimeDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ElapsedTimeDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ElapsedTimeRead(handle, filename, filenameSize) & + bind(C, name='ElapsedTimeRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ElapsedTimeRead +end function ElapsedTimeRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ElapsedTimeWrite(handle, filename, filenameSize) & + bind(C, name='ElapsedTimeWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ElapsedTimeWrite +end function ElapsedTimeWrite + +!! Print to standard output, in our prettyprinting format +function ElapsedTimePrint(handle) & + bind(C, name='ElapsedTimePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ElapsedTimePrint +end function ElapsedTimePrint + +!! Print to standard output, as XML +function ElapsedTimePrintXML(handle) & + bind(C, name='ElapsedTimePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ElapsedTimePrintXML +end function ElapsedTimePrintXML + +!! Print to standard output, as JSON +function ElapsedTimePrintJSON(handle) & + bind(C, name='ElapsedTimePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ElapsedTimePrintJSON +end function ElapsedTimePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ElapsedTimeLabelHas(handle) & + bind(C, name='ElapsedTimeLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ElapsedTimeLabelHas +end function ElapsedTimeLabelHas + +!! Get +function ElapsedTimeLabelGet(handle) & + bind(C, name='ElapsedTimeLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ElapsedTimeLabelGet +end function ElapsedTimeLabelGet + +!! Set +subroutine ElapsedTimeLabelSet(handle, label, labelSize) & + bind(C, name='ElapsedTimeLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ElapsedTimeLabelSet + + +!! ----------------------------------------------------------------------------- +!! Child: time +!! ----------------------------------------------------------------------------- + +!! Has +function ElapsedTimeTimeHas(handle) & + bind(C, name='ElapsedTimeTimeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ElapsedTimeTimeHas +end function ElapsedTimeTimeHas + +!! Get, const +function ElapsedTimeTimeGetConst(handle) & + bind(C, name='ElapsedTimeTimeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ElapsedTimeTimeGetConst +end function ElapsedTimeTimeGetConst + +!! Get, non-const +function ElapsedTimeTimeGet(handle) & + bind(C, name='ElapsedTimeTimeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ElapsedTimeTimeGet +end function ElapsedTimeTimeGet + +!! Set +subroutine ElapsedTimeTimeSet(handle, fieldHandle) & + bind(C, name='ElapsedTimeTimeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ElapsedTimeTimeSet + + +!! ----------------------------------------------------------------------------- +!! Child: yields +!! ----------------------------------------------------------------------------- + +!! Has +function ElapsedTimeYieldsHas(handle) & + bind(C, name='ElapsedTimeYieldsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ElapsedTimeYieldsHas +end function ElapsedTimeYieldsHas + +!! Get, const +function ElapsedTimeYieldsGetConst(handle) & + bind(C, name='ElapsedTimeYieldsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ElapsedTimeYieldsGetConst +end function ElapsedTimeYieldsGetConst + +!! Get, non-const +function ElapsedTimeYieldsGet(handle) & + bind(C, name='ElapsedTimeYieldsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ElapsedTimeYieldsGet +end function ElapsedTimeYieldsGet + +!! Set +subroutine ElapsedTimeYieldsSet(handle, fieldHandle) & + bind(C, name='ElapsedTimeYieldsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ElapsedTimeYieldsSet + + +!! ----------------------------------------------------------------------------- +!! Child: incidentEnergies +!! ----------------------------------------------------------------------------- + +!! Has +function ElapsedTimeIncidentEnergiesHas(handle) & + bind(C, name='ElapsedTimeIncidentEnergiesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ElapsedTimeIncidentEnergiesHas +end function ElapsedTimeIncidentEnergiesHas + +!! Get, const +function ElapsedTimeIncidentEnergiesGetConst(handle) & + bind(C, name='ElapsedTimeIncidentEnergiesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ElapsedTimeIncidentEnergiesGetConst +end function ElapsedTimeIncidentEnergiesGetConst + +!! Get, non-const +function ElapsedTimeIncidentEnergiesGet(handle) & + bind(C, name='ElapsedTimeIncidentEnergiesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ElapsedTimeIncidentEnergiesGet +end function ElapsedTimeIncidentEnergiesGet + +!! Set +subroutine ElapsedTimeIncidentEnergiesSet(handle, fieldHandle) & + bind(C, name='ElapsedTimeIncidentEnergiesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ElapsedTimeIncidentEnergiesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalElapsedTime diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ElapsedTimes.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ElapsedTimes.f03 new file mode 100644 index 000000000..010bd253f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ElapsedTimes.f03 @@ -0,0 +1,255 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalElapsedTimes +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ElapsedTimesDefaultConst() & + bind(C, name='ElapsedTimesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ElapsedTimesDefaultConst +end function ElapsedTimesDefaultConst + +!! Create, default, non-const +function ElapsedTimesDefault() & + bind(C, name='ElapsedTimesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ElapsedTimesDefault +end function ElapsedTimesDefault + +!! Create, general, const +function ElapsedTimesCreateConst( & + elapsedTime, elapsedTimeSize & +) & + bind(C, name='ElapsedTimesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: elapsedTimeSize + type(c_ptr), intent(in) :: elapsedTime(elapsedTimeSize) + type(c_ptr) :: ElapsedTimesCreateConst +end function ElapsedTimesCreateConst + +!! Create, general, non-const +function ElapsedTimesCreate( & + elapsedTime, elapsedTimeSize & +) & + bind(C, name='ElapsedTimesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: elapsedTimeSize + type(c_ptr), intent(in) :: elapsedTime(elapsedTimeSize) + type(c_ptr) :: ElapsedTimesCreate +end function ElapsedTimesCreate + +!! Assign +subroutine ElapsedTimesAssign(handleLHS, handleRHS) & + bind(C, name='ElapsedTimesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ElapsedTimesAssign + +!! Delete +subroutine ElapsedTimesDelete(handle) & + bind(C, name='ElapsedTimesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ElapsedTimesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ElapsedTimesRead(handle, filename, filenameSize) & + bind(C, name='ElapsedTimesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ElapsedTimesRead +end function ElapsedTimesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ElapsedTimesWrite(handle, filename, filenameSize) & + bind(C, name='ElapsedTimesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ElapsedTimesWrite +end function ElapsedTimesWrite + +!! Print to standard output, in our prettyprinting format +function ElapsedTimesPrint(handle) & + bind(C, name='ElapsedTimesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ElapsedTimesPrint +end function ElapsedTimesPrint + +!! Print to standard output, as XML +function ElapsedTimesPrintXML(handle) & + bind(C, name='ElapsedTimesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ElapsedTimesPrintXML +end function ElapsedTimesPrintXML + +!! Print to standard output, as JSON +function ElapsedTimesPrintJSON(handle) & + bind(C, name='ElapsedTimesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ElapsedTimesPrintJSON +end function ElapsedTimesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: elapsedTime +!! ----------------------------------------------------------------------------- + +!! Has +function ElapsedTimesElapsedTimeHas(handle) & + bind(C, name='ElapsedTimesElapsedTimeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ElapsedTimesElapsedTimeHas +end function ElapsedTimesElapsedTimeHas + +!! Clear +subroutine ElapsedTimesElapsedTimeClear(handle) & + bind(C, name='ElapsedTimesElapsedTimeClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ElapsedTimesElapsedTimeClear + +!! Size +function ElapsedTimesElapsedTimeSize(handle) & + bind(C, name='ElapsedTimesElapsedTimeSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ElapsedTimesElapsedTimeSize +end function ElapsedTimesElapsedTimeSize + +!! Add +subroutine ElapsedTimesElapsedTimeAdd(handle, fieldHandle) & + bind(C, name='ElapsedTimesElapsedTimeAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ElapsedTimesElapsedTimeAdd + +!! Get, by index \in [0,size), const +function ElapsedTimesElapsedTimeGetConst(handle, index) & + bind(C, name='ElapsedTimesElapsedTimeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ElapsedTimesElapsedTimeGetConst +end function ElapsedTimesElapsedTimeGetConst + +!! Get, by index \in [0,size), non-const +function ElapsedTimesElapsedTimeGet(handle, index) & + bind(C, name='ElapsedTimesElapsedTimeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ElapsedTimesElapsedTimeGet +end function ElapsedTimesElapsedTimeGet + +!! Set, by index \in [0,size) +subroutine ElapsedTimesElapsedTimeSet(handle, index, fieldHandle) & + bind(C, name='ElapsedTimesElapsedTimeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ElapsedTimesElapsedTimeSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ElapsedTimesElapsedTimeHasByLabel(handle, meta, metaSize) & + bind(C, name='ElapsedTimesElapsedTimeHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ElapsedTimesElapsedTimeHasByLabel +end function ElapsedTimesElapsedTimeHasByLabel + +!! Get, by label, const +function ElapsedTimesElapsedTimeGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ElapsedTimesElapsedTimeGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ElapsedTimesElapsedTimeGetByLabelConst +end function ElapsedTimesElapsedTimeGetByLabelConst + +!! Get, by label, non-const +function ElapsedTimesElapsedTimeGetByLabel(handle, meta, metaSize) & + bind(C, name='ElapsedTimesElapsedTimeGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ElapsedTimesElapsedTimeGetByLabel +end function ElapsedTimesElapsedTimeGetByLabel + +!! Set, by label +subroutine ElapsedTimesElapsedTimeSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ElapsedTimesElapsedTimeSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ElapsedTimesElapsedTimeSetByLabel + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalElapsedTimes diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EndfCompatible.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EndfCompatible.f03 new file mode 100644 index 000000000..d5d7fff81 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EndfCompatible.f03 @@ -0,0 +1,131 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalEndfCompatible +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function EndfCompatibleDefaultConst() & + bind(C, name='EndfCompatibleDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: EndfCompatibleDefaultConst +end function EndfCompatibleDefaultConst + +!! Create, default, non-const +function EndfCompatibleDefault() & + bind(C, name='EndfCompatibleDefault') + use iso_c_binding + implicit none + type(c_ptr) :: EndfCompatibleDefault +end function EndfCompatibleDefault + +!! Create, general, const +function EndfCompatibleCreateConst( & +) & + bind(C, name='EndfCompatibleCreateConst') + use iso_c_binding + implicit none + type(c_ptr) :: EndfCompatibleCreateConst +end function EndfCompatibleCreateConst + +!! Create, general, non-const +function EndfCompatibleCreate( & +) & + bind(C, name='EndfCompatibleCreate') + use iso_c_binding + implicit none + type(c_ptr) :: EndfCompatibleCreate +end function EndfCompatibleCreate + +!! Assign +subroutine EndfCompatibleAssign(handleLHS, handleRHS) & + bind(C, name='EndfCompatibleAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine EndfCompatibleAssign + +!! Delete +subroutine EndfCompatibleDelete(handle) & + bind(C, name='EndfCompatibleDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine EndfCompatibleDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function EndfCompatibleRead(handle, filename, filenameSize) & + bind(C, name='EndfCompatibleRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EndfCompatibleRead +end function EndfCompatibleRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function EndfCompatibleWrite(handle, filename, filenameSize) & + bind(C, name='EndfCompatibleWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EndfCompatibleWrite +end function EndfCompatibleWrite + +!! Print to standard output, in our prettyprinting format +function EndfCompatiblePrint(handle) & + bind(C, name='EndfCompatiblePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EndfCompatiblePrint +end function EndfCompatiblePrint + +!! Print to standard output, as XML +function EndfCompatiblePrintXML(handle) & + bind(C, name='EndfCompatiblePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EndfCompatiblePrintXML +end function EndfCompatiblePrintXML + +!! Print to standard output, as JSON +function EndfCompatiblePrintJSON(handle) & + bind(C, name='EndfCompatiblePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EndfCompatiblePrintJSON +end function EndfCompatiblePrintJSON + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalEndfCompatible diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Energy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Energy.f03 new file mode 100644 index 000000000..36205d03a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Energy.f03 @@ -0,0 +1,703 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function EnergyDefaultConst() & + bind(C, name='EnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: EnergyDefaultConst +end function EnergyDefaultConst + +!! Create, default, non-const +function EnergyDefault() & + bind(C, name='EnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: EnergyDefault +end function EnergyDefault + +!! Create, general, const +function EnergyCreateConst( & + value, & + unit, & + Double, & + uncertainty, & + NBodyPhaseSpace, & + primaryGamma, & + discreteGamma, & + XYs2d, & + generalEvaporation, & + evaporation, & + weightedFunctionals, & + simpleMaxwellianFission, & + MadlandNix, & + unitSize & +) & + bind(C, name='EnergyCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr), intent(in), value :: Double + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr), intent(in), value :: NBodyPhaseSpace + type(c_ptr), intent(in), value :: primaryGamma + type(c_ptr), intent(in), value :: discreteGamma + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr), intent(in), value :: generalEvaporation + type(c_ptr), intent(in), value :: evaporation + type(c_ptr), intent(in), value :: weightedFunctionals + type(c_ptr), intent(in), value :: simpleMaxwellianFission + type(c_ptr), intent(in), value :: MadlandNix + type(c_ptr) :: EnergyCreateConst +end function EnergyCreateConst + +!! Create, general, non-const +function EnergyCreate( & + value, & + unit, & + Double, & + uncertainty, & + NBodyPhaseSpace, & + primaryGamma, & + discreteGamma, & + XYs2d, & + generalEvaporation, & + evaporation, & + weightedFunctionals, & + simpleMaxwellianFission, & + MadlandNix, & + unitSize & +) & + bind(C, name='EnergyCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr), intent(in), value :: Double + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr), intent(in), value :: NBodyPhaseSpace + type(c_ptr), intent(in), value :: primaryGamma + type(c_ptr), intent(in), value :: discreteGamma + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr), intent(in), value :: generalEvaporation + type(c_ptr), intent(in), value :: evaporation + type(c_ptr), intent(in), value :: weightedFunctionals + type(c_ptr), intent(in), value :: simpleMaxwellianFission + type(c_ptr), intent(in), value :: MadlandNix + type(c_ptr) :: EnergyCreate +end function EnergyCreate + +!! Assign +subroutine EnergyAssign(handleLHS, handleRHS) & + bind(C, name='EnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine EnergyAssign + +!! Delete +subroutine EnergyDelete(handle) & + bind(C, name='EnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine EnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function EnergyRead(handle, filename, filenameSize) & + bind(C, name='EnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EnergyRead +end function EnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function EnergyWrite(handle, filename, filenameSize) & + bind(C, name='EnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EnergyWrite +end function EnergyWrite + +!! Print to standard output, in our prettyprinting format +function EnergyPrint(handle) & + bind(C, name='EnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyPrint +end function EnergyPrint + +!! Print to standard output, as XML +function EnergyPrintXML(handle) & + bind(C, name='EnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyPrintXML +end function EnergyPrintXML + +!! Print to standard output, as JSON +function EnergyPrintJSON(handle) & + bind(C, name='EnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyPrintJSON +end function EnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyValueHas(handle) & + bind(C, name='EnergyValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyValueHas +end function EnergyValueHas + +!! Get +function EnergyValueGet(handle) & + bind(C, name='EnergyValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: EnergyValueGet +end function EnergyValueGet + +!! Set +subroutine EnergyValueSet(handle, value) & + bind(C, name='EnergyValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine EnergyValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyUnitHas(handle) & + bind(C, name='EnergyUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyUnitHas +end function EnergyUnitHas + +!! Get +function EnergyUnitGet(handle) & + bind(C, name='EnergyUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyUnitGet +end function EnergyUnitGet + +!! Set +subroutine EnergyUnitSet(handle, unit, unitSize) & + bind(C, name='EnergyUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine EnergyUnitSet + + +!! ----------------------------------------------------------------------------- +!! Child: Double +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyDoubleHas(handle) & + bind(C, name='EnergyDoubleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyDoubleHas +end function EnergyDoubleHas + +!! Get, const +function EnergyDoubleGetConst(handle) & + bind(C, name='EnergyDoubleGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyDoubleGetConst +end function EnergyDoubleGetConst + +!! Get, non-const +function EnergyDoubleGet(handle) & + bind(C, name='EnergyDoubleGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergyDoubleGet +end function EnergyDoubleGet + +!! Set +subroutine EnergyDoubleSet(handle, fieldHandle) & + bind(C, name='EnergyDoubleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergyDoubleSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyUncertaintyHas(handle) & + bind(C, name='EnergyUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyUncertaintyHas +end function EnergyUncertaintyHas + +!! Get, const +function EnergyUncertaintyGetConst(handle) & + bind(C, name='EnergyUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyUncertaintyGetConst +end function EnergyUncertaintyGetConst + +!! Get, non-const +function EnergyUncertaintyGet(handle) & + bind(C, name='EnergyUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergyUncertaintyGet +end function EnergyUncertaintyGet + +!! Set +subroutine EnergyUncertaintySet(handle, fieldHandle) & + bind(C, name='EnergyUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergyUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! Child: NBodyPhaseSpace +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyNBodyPhaseSpaceHas(handle) & + bind(C, name='EnergyNBodyPhaseSpaceHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyNBodyPhaseSpaceHas +end function EnergyNBodyPhaseSpaceHas + +!! Get, const +function EnergyNBodyPhaseSpaceGetConst(handle) & + bind(C, name='EnergyNBodyPhaseSpaceGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyNBodyPhaseSpaceGetConst +end function EnergyNBodyPhaseSpaceGetConst + +!! Get, non-const +function EnergyNBodyPhaseSpaceGet(handle) & + bind(C, name='EnergyNBodyPhaseSpaceGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergyNBodyPhaseSpaceGet +end function EnergyNBodyPhaseSpaceGet + +!! Set +subroutine EnergyNBodyPhaseSpaceSet(handle, fieldHandle) & + bind(C, name='EnergyNBodyPhaseSpaceSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergyNBodyPhaseSpaceSet + + +!! ----------------------------------------------------------------------------- +!! Child: primaryGamma +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyPrimaryGammaHas(handle) & + bind(C, name='EnergyPrimaryGammaHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyPrimaryGammaHas +end function EnergyPrimaryGammaHas + +!! Get, const +function EnergyPrimaryGammaGetConst(handle) & + bind(C, name='EnergyPrimaryGammaGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyPrimaryGammaGetConst +end function EnergyPrimaryGammaGetConst + +!! Get, non-const +function EnergyPrimaryGammaGet(handle) & + bind(C, name='EnergyPrimaryGammaGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergyPrimaryGammaGet +end function EnergyPrimaryGammaGet + +!! Set +subroutine EnergyPrimaryGammaSet(handle, fieldHandle) & + bind(C, name='EnergyPrimaryGammaSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergyPrimaryGammaSet + + +!! ----------------------------------------------------------------------------- +!! Child: discreteGamma +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyDiscreteGammaHas(handle) & + bind(C, name='EnergyDiscreteGammaHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyDiscreteGammaHas +end function EnergyDiscreteGammaHas + +!! Get, const +function EnergyDiscreteGammaGetConst(handle) & + bind(C, name='EnergyDiscreteGammaGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyDiscreteGammaGetConst +end function EnergyDiscreteGammaGetConst + +!! Get, non-const +function EnergyDiscreteGammaGet(handle) & + bind(C, name='EnergyDiscreteGammaGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergyDiscreteGammaGet +end function EnergyDiscreteGammaGet + +!! Set +subroutine EnergyDiscreteGammaSet(handle, fieldHandle) & + bind(C, name='EnergyDiscreteGammaSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergyDiscreteGammaSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs2d +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyXYs2dHas(handle) & + bind(C, name='EnergyXYs2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyXYs2dHas +end function EnergyXYs2dHas + +!! Get, const +function EnergyXYs2dGetConst(handle) & + bind(C, name='EnergyXYs2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyXYs2dGetConst +end function EnergyXYs2dGetConst + +!! Get, non-const +function EnergyXYs2dGet(handle) & + bind(C, name='EnergyXYs2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergyXYs2dGet +end function EnergyXYs2dGet + +!! Set +subroutine EnergyXYs2dSet(handle, fieldHandle) & + bind(C, name='EnergyXYs2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergyXYs2dSet + + +!! ----------------------------------------------------------------------------- +!! Child: generalEvaporation +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyGeneralEvaporationHas(handle) & + bind(C, name='EnergyGeneralEvaporationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyGeneralEvaporationHas +end function EnergyGeneralEvaporationHas + +!! Get, const +function EnergyGeneralEvaporationGetConst(handle) & + bind(C, name='EnergyGeneralEvaporationGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyGeneralEvaporationGetConst +end function EnergyGeneralEvaporationGetConst + +!! Get, non-const +function EnergyGeneralEvaporationGet(handle) & + bind(C, name='EnergyGeneralEvaporationGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergyGeneralEvaporationGet +end function EnergyGeneralEvaporationGet + +!! Set +subroutine EnergyGeneralEvaporationSet(handle, fieldHandle) & + bind(C, name='EnergyGeneralEvaporationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergyGeneralEvaporationSet + + +!! ----------------------------------------------------------------------------- +!! Child: evaporation +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyEvaporationHas(handle) & + bind(C, name='EnergyEvaporationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyEvaporationHas +end function EnergyEvaporationHas + +!! Get, const +function EnergyEvaporationGetConst(handle) & + bind(C, name='EnergyEvaporationGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyEvaporationGetConst +end function EnergyEvaporationGetConst + +!! Get, non-const +function EnergyEvaporationGet(handle) & + bind(C, name='EnergyEvaporationGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergyEvaporationGet +end function EnergyEvaporationGet + +!! Set +subroutine EnergyEvaporationSet(handle, fieldHandle) & + bind(C, name='EnergyEvaporationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergyEvaporationSet + + +!! ----------------------------------------------------------------------------- +!! Child: weightedFunctionals +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyWeightedFunctionalsHas(handle) & + bind(C, name='EnergyWeightedFunctionalsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyWeightedFunctionalsHas +end function EnergyWeightedFunctionalsHas + +!! Get, const +function EnergyWeightedFunctionalsGetConst(handle) & + bind(C, name='EnergyWeightedFunctionalsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyWeightedFunctionalsGetConst +end function EnergyWeightedFunctionalsGetConst + +!! Get, non-const +function EnergyWeightedFunctionalsGet(handle) & + bind(C, name='EnergyWeightedFunctionalsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergyWeightedFunctionalsGet +end function EnergyWeightedFunctionalsGet + +!! Set +subroutine EnergyWeightedFunctionalsSet(handle, fieldHandle) & + bind(C, name='EnergyWeightedFunctionalsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergyWeightedFunctionalsSet + + +!! ----------------------------------------------------------------------------- +!! Child: simpleMaxwellianFission +!! ----------------------------------------------------------------------------- + +!! Has +function EnergySimpleMaxwellianFissionHas(handle) & + bind(C, name='EnergySimpleMaxwellianFissionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergySimpleMaxwellianFissionHas +end function EnergySimpleMaxwellianFissionHas + +!! Get, const +function EnergySimpleMaxwellianFissionGetConst(handle) & + bind(C, name='EnergySimpleMaxwellianFissionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergySimpleMaxwellianFissionGetConst +end function EnergySimpleMaxwellianFissionGetConst + +!! Get, non-const +function EnergySimpleMaxwellianFissionGet(handle) & + bind(C, name='EnergySimpleMaxwellianFissionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergySimpleMaxwellianFissionGet +end function EnergySimpleMaxwellianFissionGet + +!! Set +subroutine EnergySimpleMaxwellianFissionSet(handle, fieldHandle) & + bind(C, name='EnergySimpleMaxwellianFissionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergySimpleMaxwellianFissionSet + + +!! ----------------------------------------------------------------------------- +!! Child: MadlandNix +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyMadlandNixHas(handle) & + bind(C, name='EnergyMadlandNixHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyMadlandNixHas +end function EnergyMadlandNixHas + +!! Get, const +function EnergyMadlandNixGetConst(handle) & + bind(C, name='EnergyMadlandNixGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyMadlandNixGetConst +end function EnergyMadlandNixGetConst + +!! Get, non-const +function EnergyMadlandNixGet(handle) & + bind(C, name='EnergyMadlandNixGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergyMadlandNixGet +end function EnergyMadlandNixGet + +!! Set +subroutine EnergyMadlandNixSet(handle, fieldHandle) & + bind(C, name='EnergyMadlandNixSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergyMadlandNixSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EnergyAngular.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EnergyAngular.f03 new file mode 100644 index 000000000..216db47b3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/EnergyAngular.f03 @@ -0,0 +1,258 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalEnergyAngular +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function EnergyAngularDefaultConst() & + bind(C, name='EnergyAngularDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: EnergyAngularDefaultConst +end function EnergyAngularDefaultConst + +!! Create, default, non-const +function EnergyAngularDefault() & + bind(C, name='EnergyAngularDefault') + use iso_c_binding + implicit none + type(c_ptr) :: EnergyAngularDefault +end function EnergyAngularDefault + +!! Create, general, const +function EnergyAngularCreateConst( & + label, & + productFrame, & + XYs3d, & + labelSize, & + productFrameSize & +) & + bind(C, name='EnergyAngularCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: XYs3d + type(c_ptr) :: EnergyAngularCreateConst +end function EnergyAngularCreateConst + +!! Create, general, non-const +function EnergyAngularCreate( & + label, & + productFrame, & + XYs3d, & + labelSize, & + productFrameSize & +) & + bind(C, name='EnergyAngularCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: XYs3d + type(c_ptr) :: EnergyAngularCreate +end function EnergyAngularCreate + +!! Assign +subroutine EnergyAngularAssign(handleLHS, handleRHS) & + bind(C, name='EnergyAngularAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine EnergyAngularAssign + +!! Delete +subroutine EnergyAngularDelete(handle) & + bind(C, name='EnergyAngularDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine EnergyAngularDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function EnergyAngularRead(handle, filename, filenameSize) & + bind(C, name='EnergyAngularRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EnergyAngularRead +end function EnergyAngularRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function EnergyAngularWrite(handle, filename, filenameSize) & + bind(C, name='EnergyAngularWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EnergyAngularWrite +end function EnergyAngularWrite + +!! Print to standard output, in our prettyprinting format +function EnergyAngularPrint(handle) & + bind(C, name='EnergyAngularPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyAngularPrint +end function EnergyAngularPrint + +!! Print to standard output, as XML +function EnergyAngularPrintXML(handle) & + bind(C, name='EnergyAngularPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyAngularPrintXML +end function EnergyAngularPrintXML + +!! Print to standard output, as JSON +function EnergyAngularPrintJSON(handle) & + bind(C, name='EnergyAngularPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyAngularPrintJSON +end function EnergyAngularPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyAngularLabelHas(handle) & + bind(C, name='EnergyAngularLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyAngularLabelHas +end function EnergyAngularLabelHas + +!! Get +function EnergyAngularLabelGet(handle) & + bind(C, name='EnergyAngularLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyAngularLabelGet +end function EnergyAngularLabelGet + +!! Set +subroutine EnergyAngularLabelSet(handle, label, labelSize) & + bind(C, name='EnergyAngularLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine EnergyAngularLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyAngularProductFrameHas(handle) & + bind(C, name='EnergyAngularProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyAngularProductFrameHas +end function EnergyAngularProductFrameHas + +!! Get +function EnergyAngularProductFrameGet(handle) & + bind(C, name='EnergyAngularProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyAngularProductFrameGet +end function EnergyAngularProductFrameGet + +!! Set +subroutine EnergyAngularProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='EnergyAngularProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine EnergyAngularProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs3d +!! ----------------------------------------------------------------------------- + +!! Has +function EnergyAngularXYs3dHas(handle) & + bind(C, name='EnergyAngularXYs3dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EnergyAngularXYs3dHas +end function EnergyAngularXYs3dHas + +!! Get, const +function EnergyAngularXYs3dGetConst(handle) & + bind(C, name='EnergyAngularXYs3dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EnergyAngularXYs3dGetConst +end function EnergyAngularXYs3dGetConst + +!! Get, non-const +function EnergyAngularXYs3dGet(handle) & + bind(C, name='EnergyAngularXYs3dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EnergyAngularXYs3dGet +end function EnergyAngularXYs3dGet + +!! Set +subroutine EnergyAngularXYs3dSet(handle, fieldHandle) & + bind(C, name='EnergyAngularXYs3dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EnergyAngularXYs3dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalEnergyAngular diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Evaluated.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Evaluated.f03 new file mode 100644 index 000000000..605e12d55 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Evaluated.f03 @@ -0,0 +1,430 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalEvaluated +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function EvaluatedDefaultConst() & + bind(C, name='EvaluatedDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: EvaluatedDefaultConst +end function EvaluatedDefaultConst + +!! Create, default, non-const +function EvaluatedDefault() & + bind(C, name='EvaluatedDefault') + use iso_c_binding + implicit none + type(c_ptr) :: EvaluatedDefault +end function EvaluatedDefault + +!! Create, general, const +function EvaluatedCreateConst( & + label, & + date, & + library, & + version, & + documentation, & + temperature, & + projectileEnergyDomain, & + labelSize, & + dateSize, & + librarySize, & + versionSize & +) & + bind(C, name='EvaluatedCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: dateSize + character(c_char), intent(in) :: date(dateSize) + integer(c_size_t), intent(in), value :: librarySize + character(c_char), intent(in) :: library(librarySize) + integer(c_size_t), intent(in), value :: versionSize + character(c_char), intent(in) :: version(versionSize) + type(c_ptr), intent(in), value :: documentation + type(c_ptr), intent(in), value :: temperature + type(c_ptr), intent(in), value :: projectileEnergyDomain + type(c_ptr) :: EvaluatedCreateConst +end function EvaluatedCreateConst + +!! Create, general, non-const +function EvaluatedCreate( & + label, & + date, & + library, & + version, & + documentation, & + temperature, & + projectileEnergyDomain, & + labelSize, & + dateSize, & + librarySize, & + versionSize & +) & + bind(C, name='EvaluatedCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: dateSize + character(c_char), intent(in) :: date(dateSize) + integer(c_size_t), intent(in), value :: librarySize + character(c_char), intent(in) :: library(librarySize) + integer(c_size_t), intent(in), value :: versionSize + character(c_char), intent(in) :: version(versionSize) + type(c_ptr), intent(in), value :: documentation + type(c_ptr), intent(in), value :: temperature + type(c_ptr), intent(in), value :: projectileEnergyDomain + type(c_ptr) :: EvaluatedCreate +end function EvaluatedCreate + +!! Assign +subroutine EvaluatedAssign(handleLHS, handleRHS) & + bind(C, name='EvaluatedAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine EvaluatedAssign + +!! Delete +subroutine EvaluatedDelete(handle) & + bind(C, name='EvaluatedDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine EvaluatedDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function EvaluatedRead(handle, filename, filenameSize) & + bind(C, name='EvaluatedRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EvaluatedRead +end function EvaluatedRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function EvaluatedWrite(handle, filename, filenameSize) & + bind(C, name='EvaluatedWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EvaluatedWrite +end function EvaluatedWrite + +!! Print to standard output, in our prettyprinting format +function EvaluatedPrint(handle) & + bind(C, name='EvaluatedPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaluatedPrint +end function EvaluatedPrint + +!! Print to standard output, as XML +function EvaluatedPrintXML(handle) & + bind(C, name='EvaluatedPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaluatedPrintXML +end function EvaluatedPrintXML + +!! Print to standard output, as JSON +function EvaluatedPrintJSON(handle) & + bind(C, name='EvaluatedPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaluatedPrintJSON +end function EvaluatedPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function EvaluatedLabelHas(handle) & + bind(C, name='EvaluatedLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaluatedLabelHas +end function EvaluatedLabelHas + +!! Get +function EvaluatedLabelGet(handle) & + bind(C, name='EvaluatedLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EvaluatedLabelGet +end function EvaluatedLabelGet + +!! Set +subroutine EvaluatedLabelSet(handle, label, labelSize) & + bind(C, name='EvaluatedLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine EvaluatedLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: date +!! ----------------------------------------------------------------------------- + +!! Has +function EvaluatedDateHas(handle) & + bind(C, name='EvaluatedDateHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaluatedDateHas +end function EvaluatedDateHas + +!! Get +function EvaluatedDateGet(handle) & + bind(C, name='EvaluatedDateGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EvaluatedDateGet +end function EvaluatedDateGet + +!! Set +subroutine EvaluatedDateSet(handle, date, dateSize) & + bind(C, name='EvaluatedDateSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: dateSize + character(c_char), intent(in) :: date(dateSize) +end subroutine EvaluatedDateSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: library +!! ----------------------------------------------------------------------------- + +!! Has +function EvaluatedLibraryHas(handle) & + bind(C, name='EvaluatedLibraryHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaluatedLibraryHas +end function EvaluatedLibraryHas + +!! Get +function EvaluatedLibraryGet(handle) & + bind(C, name='EvaluatedLibraryGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EvaluatedLibraryGet +end function EvaluatedLibraryGet + +!! Set +subroutine EvaluatedLibrarySet(handle, library, librarySize) & + bind(C, name='EvaluatedLibrarySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: librarySize + character(c_char), intent(in) :: library(librarySize) +end subroutine EvaluatedLibrarySet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: version +!! ----------------------------------------------------------------------------- + +!! Has +function EvaluatedVersionHas(handle) & + bind(C, name='EvaluatedVersionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaluatedVersionHas +end function EvaluatedVersionHas + +!! Get +function EvaluatedVersionGet(handle) & + bind(C, name='EvaluatedVersionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EvaluatedVersionGet +end function EvaluatedVersionGet + +!! Set +subroutine EvaluatedVersionSet(handle, version, versionSize) & + bind(C, name='EvaluatedVersionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: versionSize + character(c_char), intent(in) :: version(versionSize) +end subroutine EvaluatedVersionSet + + +!! ----------------------------------------------------------------------------- +!! Child: documentation +!! ----------------------------------------------------------------------------- + +!! Has +function EvaluatedDocumentationHas(handle) & + bind(C, name='EvaluatedDocumentationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaluatedDocumentationHas +end function EvaluatedDocumentationHas + +!! Get, const +function EvaluatedDocumentationGetConst(handle) & + bind(C, name='EvaluatedDocumentationGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EvaluatedDocumentationGetConst +end function EvaluatedDocumentationGetConst + +!! Get, non-const +function EvaluatedDocumentationGet(handle) & + bind(C, name='EvaluatedDocumentationGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EvaluatedDocumentationGet +end function EvaluatedDocumentationGet + +!! Set +subroutine EvaluatedDocumentationSet(handle, fieldHandle) & + bind(C, name='EvaluatedDocumentationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EvaluatedDocumentationSet + + +!! ----------------------------------------------------------------------------- +!! Child: temperature +!! ----------------------------------------------------------------------------- + +!! Has +function EvaluatedTemperatureHas(handle) & + bind(C, name='EvaluatedTemperatureHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaluatedTemperatureHas +end function EvaluatedTemperatureHas + +!! Get, const +function EvaluatedTemperatureGetConst(handle) & + bind(C, name='EvaluatedTemperatureGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EvaluatedTemperatureGetConst +end function EvaluatedTemperatureGetConst + +!! Get, non-const +function EvaluatedTemperatureGet(handle) & + bind(C, name='EvaluatedTemperatureGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EvaluatedTemperatureGet +end function EvaluatedTemperatureGet + +!! Set +subroutine EvaluatedTemperatureSet(handle, fieldHandle) & + bind(C, name='EvaluatedTemperatureSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EvaluatedTemperatureSet + + +!! ----------------------------------------------------------------------------- +!! Child: projectileEnergyDomain +!! ----------------------------------------------------------------------------- + +!! Has +function EvaluatedProjectileEnergyDomainHas(handle) & + bind(C, name='EvaluatedProjectileEnergyDomainHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaluatedProjectileEnergyDomainHas +end function EvaluatedProjectileEnergyDomainHas + +!! Get, const +function EvaluatedProjectileEnergyDomainGetConst(handle) & + bind(C, name='EvaluatedProjectileEnergyDomainGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EvaluatedProjectileEnergyDomainGetConst +end function EvaluatedProjectileEnergyDomainGetConst + +!! Get, non-const +function EvaluatedProjectileEnergyDomainGet(handle) & + bind(C, name='EvaluatedProjectileEnergyDomainGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EvaluatedProjectileEnergyDomainGet +end function EvaluatedProjectileEnergyDomainGet + +!! Set +subroutine EvaluatedProjectileEnergyDomainSet(handle, fieldHandle) & + bind(C, name='EvaluatedProjectileEnergyDomainSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EvaluatedProjectileEnergyDomainSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalEvaluated diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Evaporation.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Evaporation.f03 new file mode 100644 index 000000000..3c6458ff5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Evaporation.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalEvaporation +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function EvaporationDefaultConst() & + bind(C, name='EvaporationDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: EvaporationDefaultConst +end function EvaporationDefaultConst + +!! Create, default, non-const +function EvaporationDefault() & + bind(C, name='EvaporationDefault') + use iso_c_binding + implicit none + type(c_ptr) :: EvaporationDefault +end function EvaporationDefault + +!! Create, general, const +function EvaporationCreateConst( & + U, & + theta & +) & + bind(C, name='EvaporationCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: U + type(c_ptr), intent(in), value :: theta + type(c_ptr) :: EvaporationCreateConst +end function EvaporationCreateConst + +!! Create, general, non-const +function EvaporationCreate( & + U, & + theta & +) & + bind(C, name='EvaporationCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: U + type(c_ptr), intent(in), value :: theta + type(c_ptr) :: EvaporationCreate +end function EvaporationCreate + +!! Assign +subroutine EvaporationAssign(handleLHS, handleRHS) & + bind(C, name='EvaporationAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine EvaporationAssign + +!! Delete +subroutine EvaporationDelete(handle) & + bind(C, name='EvaporationDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine EvaporationDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function EvaporationRead(handle, filename, filenameSize) & + bind(C, name='EvaporationRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EvaporationRead +end function EvaporationRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function EvaporationWrite(handle, filename, filenameSize) & + bind(C, name='EvaporationWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: EvaporationWrite +end function EvaporationWrite + +!! Print to standard output, in our prettyprinting format +function EvaporationPrint(handle) & + bind(C, name='EvaporationPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaporationPrint +end function EvaporationPrint + +!! Print to standard output, as XML +function EvaporationPrintXML(handle) & + bind(C, name='EvaporationPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaporationPrintXML +end function EvaporationPrintXML + +!! Print to standard output, as JSON +function EvaporationPrintJSON(handle) & + bind(C, name='EvaporationPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaporationPrintJSON +end function EvaporationPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: U +!! ----------------------------------------------------------------------------- + +!! Has +function EvaporationUHas(handle) & + bind(C, name='EvaporationUHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaporationUHas +end function EvaporationUHas + +!! Get, const +function EvaporationUGetConst(handle) & + bind(C, name='EvaporationUGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EvaporationUGetConst +end function EvaporationUGetConst + +!! Get, non-const +function EvaporationUGet(handle) & + bind(C, name='EvaporationUGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EvaporationUGet +end function EvaporationUGet + +!! Set +subroutine EvaporationUSet(handle, fieldHandle) & + bind(C, name='EvaporationUSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EvaporationUSet + + +!! ----------------------------------------------------------------------------- +!! Child: theta +!! ----------------------------------------------------------------------------- + +!! Has +function EvaporationThetaHas(handle) & + bind(C, name='EvaporationThetaHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: EvaporationThetaHas +end function EvaporationThetaHas + +!! Get, const +function EvaporationThetaGetConst(handle) & + bind(C, name='EvaporationThetaGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: EvaporationThetaGetConst +end function EvaporationThetaGetConst + +!! Get, non-const +function EvaporationThetaGet(handle) & + bind(C, name='EvaporationThetaGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: EvaporationThetaGet +end function EvaporationThetaGet + +!! Set +subroutine EvaporationThetaSet(handle, fieldHandle) & + bind(C, name='EvaporationThetaSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine EvaporationThetaSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalEvaporation diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ExternalFile.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ExternalFile.f03 new file mode 100644 index 000000000..65a0b35c2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ExternalFile.f03 @@ -0,0 +1,295 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalExternalFile +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ExternalFileDefaultConst() & + bind(C, name='ExternalFileDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ExternalFileDefaultConst +end function ExternalFileDefaultConst + +!! Create, default, non-const +function ExternalFileDefault() & + bind(C, name='ExternalFileDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ExternalFileDefault +end function ExternalFileDefault + +!! Create, general, const +function ExternalFileCreateConst( & + label, & + path, & + checksum, & + algorithm, & + labelSize, & + pathSize, & + checksumSize, & + algorithmSize & +) & + bind(C, name='ExternalFileCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pathSize + character(c_char), intent(in) :: path(pathSize) + integer(c_size_t), intent(in), value :: checksumSize + character(c_char), intent(in) :: checksum(checksumSize) + integer(c_size_t), intent(in), value :: algorithmSize + character(c_char), intent(in) :: algorithm(algorithmSize) + type(c_ptr) :: ExternalFileCreateConst +end function ExternalFileCreateConst + +!! Create, general, non-const +function ExternalFileCreate( & + label, & + path, & + checksum, & + algorithm, & + labelSize, & + pathSize, & + checksumSize, & + algorithmSize & +) & + bind(C, name='ExternalFileCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pathSize + character(c_char), intent(in) :: path(pathSize) + integer(c_size_t), intent(in), value :: checksumSize + character(c_char), intent(in) :: checksum(checksumSize) + integer(c_size_t), intent(in), value :: algorithmSize + character(c_char), intent(in) :: algorithm(algorithmSize) + type(c_ptr) :: ExternalFileCreate +end function ExternalFileCreate + +!! Assign +subroutine ExternalFileAssign(handleLHS, handleRHS) & + bind(C, name='ExternalFileAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ExternalFileAssign + +!! Delete +subroutine ExternalFileDelete(handle) & + bind(C, name='ExternalFileDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ExternalFileDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ExternalFileRead(handle, filename, filenameSize) & + bind(C, name='ExternalFileRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ExternalFileRead +end function ExternalFileRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ExternalFileWrite(handle, filename, filenameSize) & + bind(C, name='ExternalFileWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ExternalFileWrite +end function ExternalFileWrite + +!! Print to standard output, in our prettyprinting format +function ExternalFilePrint(handle) & + bind(C, name='ExternalFilePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ExternalFilePrint +end function ExternalFilePrint + +!! Print to standard output, as XML +function ExternalFilePrintXML(handle) & + bind(C, name='ExternalFilePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ExternalFilePrintXML +end function ExternalFilePrintXML + +!! Print to standard output, as JSON +function ExternalFilePrintJSON(handle) & + bind(C, name='ExternalFilePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ExternalFilePrintJSON +end function ExternalFilePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ExternalFileLabelHas(handle) & + bind(C, name='ExternalFileLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ExternalFileLabelHas +end function ExternalFileLabelHas + +!! Get +function ExternalFileLabelGet(handle) & + bind(C, name='ExternalFileLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ExternalFileLabelGet +end function ExternalFileLabelGet + +!! Set +subroutine ExternalFileLabelSet(handle, label, labelSize) & + bind(C, name='ExternalFileLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ExternalFileLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: path +!! ----------------------------------------------------------------------------- + +!! Has +function ExternalFilePathHas(handle) & + bind(C, name='ExternalFilePathHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ExternalFilePathHas +end function ExternalFilePathHas + +!! Get +function ExternalFilePathGet(handle) & + bind(C, name='ExternalFilePathGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ExternalFilePathGet +end function ExternalFilePathGet + +!! Set +subroutine ExternalFilePathSet(handle, path, pathSize) & + bind(C, name='ExternalFilePathSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pathSize + character(c_char), intent(in) :: path(pathSize) +end subroutine ExternalFilePathSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: checksum +!! ----------------------------------------------------------------------------- + +!! Has +function ExternalFileChecksumHas(handle) & + bind(C, name='ExternalFileChecksumHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ExternalFileChecksumHas +end function ExternalFileChecksumHas + +!! Get +function ExternalFileChecksumGet(handle) & + bind(C, name='ExternalFileChecksumGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ExternalFileChecksumGet +end function ExternalFileChecksumGet + +!! Set +subroutine ExternalFileChecksumSet(handle, checksum, checksumSize) & + bind(C, name='ExternalFileChecksumSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: checksumSize + character(c_char), intent(in) :: checksum(checksumSize) +end subroutine ExternalFileChecksumSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: algorithm +!! ----------------------------------------------------------------------------- + +!! Has +function ExternalFileAlgorithmHas(handle) & + bind(C, name='ExternalFileAlgorithmHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ExternalFileAlgorithmHas +end function ExternalFileAlgorithmHas + +!! Get +function ExternalFileAlgorithmGet(handle) & + bind(C, name='ExternalFileAlgorithmGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ExternalFileAlgorithmGet +end function ExternalFileAlgorithmGet + +!! Set +subroutine ExternalFileAlgorithmSet(handle, algorithm, algorithmSize) & + bind(C, name='ExternalFileAlgorithmSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: algorithmSize + character(c_char), intent(in) :: algorithm(algorithmSize) +end subroutine ExternalFileAlgorithmSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalExternalFile diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ExternalFiles.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ExternalFiles.f03 new file mode 100644 index 000000000..8dd7cdbc0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ExternalFiles.f03 @@ -0,0 +1,399 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalExternalFiles +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ExternalFilesDefaultConst() & + bind(C, name='ExternalFilesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ExternalFilesDefaultConst +end function ExternalFilesDefaultConst + +!! Create, default, non-const +function ExternalFilesDefault() & + bind(C, name='ExternalFilesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ExternalFilesDefault +end function ExternalFilesDefault + +!! Create, general, const +function ExternalFilesCreateConst( & + externalFile, externalFileSize & +) & + bind(C, name='ExternalFilesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: externalFileSize + type(c_ptr), intent(in) :: externalFile(externalFileSize) + type(c_ptr) :: ExternalFilesCreateConst +end function ExternalFilesCreateConst + +!! Create, general, non-const +function ExternalFilesCreate( & + externalFile, externalFileSize & +) & + bind(C, name='ExternalFilesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: externalFileSize + type(c_ptr), intent(in) :: externalFile(externalFileSize) + type(c_ptr) :: ExternalFilesCreate +end function ExternalFilesCreate + +!! Assign +subroutine ExternalFilesAssign(handleLHS, handleRHS) & + bind(C, name='ExternalFilesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ExternalFilesAssign + +!! Delete +subroutine ExternalFilesDelete(handle) & + bind(C, name='ExternalFilesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ExternalFilesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ExternalFilesRead(handle, filename, filenameSize) & + bind(C, name='ExternalFilesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ExternalFilesRead +end function ExternalFilesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ExternalFilesWrite(handle, filename, filenameSize) & + bind(C, name='ExternalFilesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ExternalFilesWrite +end function ExternalFilesWrite + +!! Print to standard output, in our prettyprinting format +function ExternalFilesPrint(handle) & + bind(C, name='ExternalFilesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ExternalFilesPrint +end function ExternalFilesPrint + +!! Print to standard output, as XML +function ExternalFilesPrintXML(handle) & + bind(C, name='ExternalFilesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ExternalFilesPrintXML +end function ExternalFilesPrintXML + +!! Print to standard output, as JSON +function ExternalFilesPrintJSON(handle) & + bind(C, name='ExternalFilesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ExternalFilesPrintJSON +end function ExternalFilesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: externalFile +!! ----------------------------------------------------------------------------- + +!! Has +function ExternalFilesExternalFileHas(handle) & + bind(C, name='ExternalFilesExternalFileHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ExternalFilesExternalFileHas +end function ExternalFilesExternalFileHas + +!! Clear +subroutine ExternalFilesExternalFileClear(handle) & + bind(C, name='ExternalFilesExternalFileClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ExternalFilesExternalFileClear + +!! Size +function ExternalFilesExternalFileSize(handle) & + bind(C, name='ExternalFilesExternalFileSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ExternalFilesExternalFileSize +end function ExternalFilesExternalFileSize + +!! Add +subroutine ExternalFilesExternalFileAdd(handle, fieldHandle) & + bind(C, name='ExternalFilesExternalFileAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ExternalFilesExternalFileAdd + +!! Get, by index \in [0,size), const +function ExternalFilesExternalFileGetConst(handle, index) & + bind(C, name='ExternalFilesExternalFileGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ExternalFilesExternalFileGetConst +end function ExternalFilesExternalFileGetConst + +!! Get, by index \in [0,size), non-const +function ExternalFilesExternalFileGet(handle, index) & + bind(C, name='ExternalFilesExternalFileGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ExternalFilesExternalFileGet +end function ExternalFilesExternalFileGet + +!! Set, by index \in [0,size) +subroutine ExternalFilesExternalFileSet(handle, index, fieldHandle) & + bind(C, name='ExternalFilesExternalFileSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ExternalFilesExternalFileSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ExternalFilesExternalFileHasByLabel(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ExternalFilesExternalFileHasByLabel +end function ExternalFilesExternalFileHasByLabel + +!! Get, by label, const +function ExternalFilesExternalFileGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ExternalFilesExternalFileGetByLabelConst +end function ExternalFilesExternalFileGetByLabelConst + +!! Get, by label, non-const +function ExternalFilesExternalFileGetByLabel(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ExternalFilesExternalFileGetByLabel +end function ExternalFilesExternalFileGetByLabel + +!! Set, by label +subroutine ExternalFilesExternalFileSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ExternalFilesExternalFileSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ExternalFilesExternalFileSetByLabel + +!! ------------------------ +!! Re: metadatum path +!! ------------------------ + +!! Has, by path +function ExternalFilesExternalFileHasByPath(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileHasByPath') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ExternalFilesExternalFileHasByPath +end function ExternalFilesExternalFileHasByPath + +!! Get, by path, const +function ExternalFilesExternalFileGetByPathConst(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileGetByPathConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ExternalFilesExternalFileGetByPathConst +end function ExternalFilesExternalFileGetByPathConst + +!! Get, by path, non-const +function ExternalFilesExternalFileGetByPath(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileGetByPath') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ExternalFilesExternalFileGetByPath +end function ExternalFilesExternalFileGetByPath + +!! Set, by path +subroutine ExternalFilesExternalFileSetByPath(handle, meta, metaSize, fieldHandle) & + bind(C, name='ExternalFilesExternalFileSetByPath') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ExternalFilesExternalFileSetByPath + +!! ------------------------ +!! Re: metadatum checksum +!! ------------------------ + +!! Has, by checksum +function ExternalFilesExternalFileHasByChecksum(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileHasByChecksum') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ExternalFilesExternalFileHasByChecksum +end function ExternalFilesExternalFileHasByChecksum + +!! Get, by checksum, const +function ExternalFilesExternalFileGetByChecksumConst(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileGetByChecksumConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ExternalFilesExternalFileGetByChecksumConst +end function ExternalFilesExternalFileGetByChecksumConst + +!! Get, by checksum, non-const +function ExternalFilesExternalFileGetByChecksum(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileGetByChecksum') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ExternalFilesExternalFileGetByChecksum +end function ExternalFilesExternalFileGetByChecksum + +!! Set, by checksum +subroutine ExternalFilesExternalFileSetByChecksum(handle, meta, metaSize, fieldHandle) & + bind(C, name='ExternalFilesExternalFileSetByChecksum') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ExternalFilesExternalFileSetByChecksum + +!! ------------------------ +!! Re: metadatum algorithm +!! ------------------------ + +!! Has, by algorithm +function ExternalFilesExternalFileHasByAlgorithm(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileHasByAlgorithm') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ExternalFilesExternalFileHasByAlgorithm +end function ExternalFilesExternalFileHasByAlgorithm + +!! Get, by algorithm, const +function ExternalFilesExternalFileGetByAlgorithmConst(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileGetByAlgorithmConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ExternalFilesExternalFileGetByAlgorithmConst +end function ExternalFilesExternalFileGetByAlgorithmConst + +!! Get, by algorithm, non-const +function ExternalFilesExternalFileGetByAlgorithm(handle, meta, metaSize) & + bind(C, name='ExternalFilesExternalFileGetByAlgorithm') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ExternalFilesExternalFileGetByAlgorithm +end function ExternalFilesExternalFileGetByAlgorithm + +!! Set, by algorithm +subroutine ExternalFilesExternalFileSetByAlgorithm(handle, meta, metaSize, fieldHandle) & + bind(C, name='ExternalFilesExternalFileSetByAlgorithm') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ExternalFilesExternalFileSetByAlgorithm + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalExternalFiles diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/F.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/F.f03 new file mode 100644 index 000000000..084ee6e66 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/F.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalF +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function FDefaultConst() & + bind(C, name='FDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: FDefaultConst +end function FDefaultConst + +!! Create, default, non-const +function FDefault() & + bind(C, name='FDefault') + use iso_c_binding + implicit none + type(c_ptr) :: FDefault +end function FDefault + +!! Create, general, const +function FCreateConst( & + XYs2d & +) & + bind(C, name='FCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: FCreateConst +end function FCreateConst + +!! Create, general, non-const +function FCreate( & + XYs2d & +) & + bind(C, name='FCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: FCreate +end function FCreate + +!! Assign +subroutine FAssign(handleLHS, handleRHS) & + bind(C, name='FAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine FAssign + +!! Delete +subroutine FDelete(handle) & + bind(C, name='FDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function FRead(handle, filename, filenameSize) & + bind(C, name='FRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FRead +end function FRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function FWrite(handle, filename, filenameSize) & + bind(C, name='FWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FWrite +end function FWrite + +!! Print to standard output, in our prettyprinting format +function FPrint(handle) & + bind(C, name='FPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FPrint +end function FPrint + +!! Print to standard output, as XML +function FPrintXML(handle) & + bind(C, name='FPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FPrintXML +end function FPrintXML + +!! Print to standard output, as JSON +function FPrintJSON(handle) & + bind(C, name='FPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FPrintJSON +end function FPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs2d +!! ----------------------------------------------------------------------------- + +!! Has +function FXYs2dHas(handle) & + bind(C, name='FXYs2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FXYs2dHas +end function FXYs2dHas + +!! Get, const +function FXYs2dGetConst(handle) & + bind(C, name='FXYs2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FXYs2dGetConst +end function FXYs2dGetConst + +!! Get, non-const +function FXYs2dGet(handle) & + bind(C, name='FXYs2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FXYs2dGet +end function FXYs2dGet + +!! Set +subroutine FXYs2dSet(handle, fieldHandle) & + bind(C, name='FXYs2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FXYs2dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalF diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FastRegion.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FastRegion.f03 new file mode 100644 index 000000000..1b2f42c8f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FastRegion.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalFastRegion +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function FastRegionDefaultConst() & + bind(C, name='FastRegionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: FastRegionDefaultConst +end function FastRegionDefaultConst + +!! Create, default, non-const +function FastRegionDefault() & + bind(C, name='FastRegionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: FastRegionDefault +end function FastRegionDefault + +!! Create, general, const +function FastRegionCreateConst( & + XYs1d, & + regions1d & +) & + bind(C, name='FastRegionCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr) :: FastRegionCreateConst +end function FastRegionCreateConst + +!! Create, general, non-const +function FastRegionCreate( & + XYs1d, & + regions1d & +) & + bind(C, name='FastRegionCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr) :: FastRegionCreate +end function FastRegionCreate + +!! Assign +subroutine FastRegionAssign(handleLHS, handleRHS) & + bind(C, name='FastRegionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine FastRegionAssign + +!! Delete +subroutine FastRegionDelete(handle) & + bind(C, name='FastRegionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FastRegionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function FastRegionRead(handle, filename, filenameSize) & + bind(C, name='FastRegionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FastRegionRead +end function FastRegionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function FastRegionWrite(handle, filename, filenameSize) & + bind(C, name='FastRegionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FastRegionWrite +end function FastRegionWrite + +!! Print to standard output, in our prettyprinting format +function FastRegionPrint(handle) & + bind(C, name='FastRegionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FastRegionPrint +end function FastRegionPrint + +!! Print to standard output, as XML +function FastRegionPrintXML(handle) & + bind(C, name='FastRegionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FastRegionPrintXML +end function FastRegionPrintXML + +!! Print to standard output, as JSON +function FastRegionPrintJSON(handle) & + bind(C, name='FastRegionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FastRegionPrintJSON +end function FastRegionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function FastRegionXYs1dHas(handle) & + bind(C, name='FastRegionXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FastRegionXYs1dHas +end function FastRegionXYs1dHas + +!! Get, const +function FastRegionXYs1dGetConst(handle) & + bind(C, name='FastRegionXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FastRegionXYs1dGetConst +end function FastRegionXYs1dGetConst + +!! Get, non-const +function FastRegionXYs1dGet(handle) & + bind(C, name='FastRegionXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FastRegionXYs1dGet +end function FastRegionXYs1dGet + +!! Set +subroutine FastRegionXYs1dSet(handle, fieldHandle) & + bind(C, name='FastRegionXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FastRegionXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: regions1d +!! ----------------------------------------------------------------------------- + +!! Has +function FastRegionRegions1dHas(handle) & + bind(C, name='FastRegionRegions1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FastRegionRegions1dHas +end function FastRegionRegions1dHas + +!! Get, const +function FastRegionRegions1dGetConst(handle) & + bind(C, name='FastRegionRegions1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FastRegionRegions1dGetConst +end function FastRegionRegions1dGetConst + +!! Get, non-const +function FastRegionRegions1dGet(handle) & + bind(C, name='FastRegionRegions1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FastRegionRegions1dGet +end function FastRegionRegions1dGet + +!! Set +subroutine FastRegionRegions1dSet(handle, fieldHandle) & + bind(C, name='FastRegionRegions1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FastRegionRegions1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalFastRegion diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionComponent.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionComponent.f03 new file mode 100644 index 000000000..1d6fd0bba --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionComponent.f03 @@ -0,0 +1,339 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalFissionComponent +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function FissionComponentDefaultConst() & + bind(C, name='FissionComponentDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: FissionComponentDefaultConst +end function FissionComponentDefaultConst + +!! Create, default, non-const +function FissionComponentDefault() & + bind(C, name='FissionComponentDefault') + use iso_c_binding + implicit none + type(c_ptr) :: FissionComponentDefault +end function FissionComponentDefault + +!! Create, general, const +function FissionComponentCreateConst( & + label, & + ENDF_MT, & + fissionGenre, & + crossSection, & + outputChannel, & + labelSize, & + fissionGenreSize & +) & + bind(C, name='FissionComponentCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + integer(c_size_t), intent(in), value :: fissionGenreSize + character(c_char), intent(in) :: fissionGenre(fissionGenreSize) + type(c_ptr), intent(in), value :: crossSection + type(c_ptr), intent(in), value :: outputChannel + type(c_ptr) :: FissionComponentCreateConst +end function FissionComponentCreateConst + +!! Create, general, non-const +function FissionComponentCreate( & + label, & + ENDF_MT, & + fissionGenre, & + crossSection, & + outputChannel, & + labelSize, & + fissionGenreSize & +) & + bind(C, name='FissionComponentCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + integer(c_size_t), intent(in), value :: fissionGenreSize + character(c_char), intent(in) :: fissionGenre(fissionGenreSize) + type(c_ptr), intent(in), value :: crossSection + type(c_ptr), intent(in), value :: outputChannel + type(c_ptr) :: FissionComponentCreate +end function FissionComponentCreate + +!! Assign +subroutine FissionComponentAssign(handleLHS, handleRHS) & + bind(C, name='FissionComponentAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine FissionComponentAssign + +!! Delete +subroutine FissionComponentDelete(handle) & + bind(C, name='FissionComponentDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FissionComponentDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function FissionComponentRead(handle, filename, filenameSize) & + bind(C, name='FissionComponentRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FissionComponentRead +end function FissionComponentRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function FissionComponentWrite(handle, filename, filenameSize) & + bind(C, name='FissionComponentWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FissionComponentWrite +end function FissionComponentWrite + +!! Print to standard output, in our prettyprinting format +function FissionComponentPrint(handle) & + bind(C, name='FissionComponentPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentPrint +end function FissionComponentPrint + +!! Print to standard output, as XML +function FissionComponentPrintXML(handle) & + bind(C, name='FissionComponentPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentPrintXML +end function FissionComponentPrintXML + +!! Print to standard output, as JSON +function FissionComponentPrintJSON(handle) & + bind(C, name='FissionComponentPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentPrintJSON +end function FissionComponentPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function FissionComponentLabelHas(handle) & + bind(C, name='FissionComponentLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentLabelHas +end function FissionComponentLabelHas + +!! Get +function FissionComponentLabelGet(handle) & + bind(C, name='FissionComponentLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionComponentLabelGet +end function FissionComponentLabelGet + +!! Set +subroutine FissionComponentLabelSet(handle, label, labelSize) & + bind(C, name='FissionComponentLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine FissionComponentLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: ENDF_MT +!! ----------------------------------------------------------------------------- + +!! Has +function FissionComponentENDFMTHas(handle) & + bind(C, name='FissionComponentENDFMTHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentENDFMTHas +end function FissionComponentENDFMTHas + +!! Get +function FissionComponentENDFMTGet(handle) & + bind(C, name='FissionComponentENDFMTGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentENDFMTGet +end function FissionComponentENDFMTGet + +!! Set +subroutine FissionComponentENDFMTSet(handle, ENDF_MT) & + bind(C, name='FissionComponentENDFMTSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: ENDF_MT +end subroutine FissionComponentENDFMTSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: fissionGenre +!! ----------------------------------------------------------------------------- + +!! Has +function FissionComponentFissionGenreHas(handle) & + bind(C, name='FissionComponentFissionGenreHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentFissionGenreHas +end function FissionComponentFissionGenreHas + +!! Get +function FissionComponentFissionGenreGet(handle) & + bind(C, name='FissionComponentFissionGenreGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionComponentFissionGenreGet +end function FissionComponentFissionGenreGet + +!! Set +subroutine FissionComponentFissionGenreSet(handle, fissionGenre, fissionGenreSize) & + bind(C, name='FissionComponentFissionGenreSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: fissionGenreSize + character(c_char), intent(in) :: fissionGenre(fissionGenreSize) +end subroutine FissionComponentFissionGenreSet + + +!! ----------------------------------------------------------------------------- +!! Child: crossSection +!! ----------------------------------------------------------------------------- + +!! Has +function FissionComponentCrossSectionHas(handle) & + bind(C, name='FissionComponentCrossSectionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentCrossSectionHas +end function FissionComponentCrossSectionHas + +!! Get, const +function FissionComponentCrossSectionGetConst(handle) & + bind(C, name='FissionComponentCrossSectionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionComponentCrossSectionGetConst +end function FissionComponentCrossSectionGetConst + +!! Get, non-const +function FissionComponentCrossSectionGet(handle) & + bind(C, name='FissionComponentCrossSectionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionComponentCrossSectionGet +end function FissionComponentCrossSectionGet + +!! Set +subroutine FissionComponentCrossSectionSet(handle, fieldHandle) & + bind(C, name='FissionComponentCrossSectionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionComponentCrossSectionSet + + +!! ----------------------------------------------------------------------------- +!! Child: outputChannel +!! ----------------------------------------------------------------------------- + +!! Has +function FissionComponentOutputChannelHas(handle) & + bind(C, name='FissionComponentOutputChannelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentOutputChannelHas +end function FissionComponentOutputChannelHas + +!! Get, const +function FissionComponentOutputChannelGetConst(handle) & + bind(C, name='FissionComponentOutputChannelGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionComponentOutputChannelGetConst +end function FissionComponentOutputChannelGetConst + +!! Get, non-const +function FissionComponentOutputChannelGet(handle) & + bind(C, name='FissionComponentOutputChannelGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionComponentOutputChannelGet +end function FissionComponentOutputChannelGet + +!! Set +subroutine FissionComponentOutputChannelSet(handle, fieldHandle) & + bind(C, name='FissionComponentOutputChannelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionComponentOutputChannelSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalFissionComponent diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionComponents.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionComponents.f03 new file mode 100644 index 000000000..db2f890a5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionComponents.f03 @@ -0,0 +1,347 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalFissionComponents +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function FissionComponentsDefaultConst() & + bind(C, name='FissionComponentsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: FissionComponentsDefaultConst +end function FissionComponentsDefaultConst + +!! Create, default, non-const +function FissionComponentsDefault() & + bind(C, name='FissionComponentsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: FissionComponentsDefault +end function FissionComponentsDefault + +!! Create, general, const +function FissionComponentsCreateConst( & + fissionComponent, fissionComponentSize & +) & + bind(C, name='FissionComponentsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: fissionComponentSize + type(c_ptr), intent(in) :: fissionComponent(fissionComponentSize) + type(c_ptr) :: FissionComponentsCreateConst +end function FissionComponentsCreateConst + +!! Create, general, non-const +function FissionComponentsCreate( & + fissionComponent, fissionComponentSize & +) & + bind(C, name='FissionComponentsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: fissionComponentSize + type(c_ptr), intent(in) :: fissionComponent(fissionComponentSize) + type(c_ptr) :: FissionComponentsCreate +end function FissionComponentsCreate + +!! Assign +subroutine FissionComponentsAssign(handleLHS, handleRHS) & + bind(C, name='FissionComponentsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine FissionComponentsAssign + +!! Delete +subroutine FissionComponentsDelete(handle) & + bind(C, name='FissionComponentsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FissionComponentsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function FissionComponentsRead(handle, filename, filenameSize) & + bind(C, name='FissionComponentsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FissionComponentsRead +end function FissionComponentsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function FissionComponentsWrite(handle, filename, filenameSize) & + bind(C, name='FissionComponentsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FissionComponentsWrite +end function FissionComponentsWrite + +!! Print to standard output, in our prettyprinting format +function FissionComponentsPrint(handle) & + bind(C, name='FissionComponentsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentsPrint +end function FissionComponentsPrint + +!! Print to standard output, as XML +function FissionComponentsPrintXML(handle) & + bind(C, name='FissionComponentsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentsPrintXML +end function FissionComponentsPrintXML + +!! Print to standard output, as JSON +function FissionComponentsPrintJSON(handle) & + bind(C, name='FissionComponentsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentsPrintJSON +end function FissionComponentsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: fissionComponent +!! ----------------------------------------------------------------------------- + +!! Has +function FissionComponentsFissionComponentHas(handle) & + bind(C, name='FissionComponentsFissionComponentHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionComponentsFissionComponentHas +end function FissionComponentsFissionComponentHas + +!! Clear +subroutine FissionComponentsFissionComponentClear(handle) & + bind(C, name='FissionComponentsFissionComponentClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FissionComponentsFissionComponentClear + +!! Size +function FissionComponentsFissionComponentSize(handle) & + bind(C, name='FissionComponentsFissionComponentSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: FissionComponentsFissionComponentSize +end function FissionComponentsFissionComponentSize + +!! Add +subroutine FissionComponentsFissionComponentAdd(handle, fieldHandle) & + bind(C, name='FissionComponentsFissionComponentAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionComponentsFissionComponentAdd + +!! Get, by index \in [0,size), const +function FissionComponentsFissionComponentGetConst(handle, index) & + bind(C, name='FissionComponentsFissionComponentGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: FissionComponentsFissionComponentGetConst +end function FissionComponentsFissionComponentGetConst + +!! Get, by index \in [0,size), non-const +function FissionComponentsFissionComponentGet(handle, index) & + bind(C, name='FissionComponentsFissionComponentGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: FissionComponentsFissionComponentGet +end function FissionComponentsFissionComponentGet + +!! Set, by index \in [0,size) +subroutine FissionComponentsFissionComponentSet(handle, index, fieldHandle) & + bind(C, name='FissionComponentsFissionComponentSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionComponentsFissionComponentSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function FissionComponentsFissionComponentHasByLabel(handle, meta, metaSize) & + bind(C, name='FissionComponentsFissionComponentHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: FissionComponentsFissionComponentHasByLabel +end function FissionComponentsFissionComponentHasByLabel + +!! Get, by label, const +function FissionComponentsFissionComponentGetByLabelConst(handle, meta, metaSize) & + bind(C, name='FissionComponentsFissionComponentGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: FissionComponentsFissionComponentGetByLabelConst +end function FissionComponentsFissionComponentGetByLabelConst + +!! Get, by label, non-const +function FissionComponentsFissionComponentGetByLabel(handle, meta, metaSize) & + bind(C, name='FissionComponentsFissionComponentGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: FissionComponentsFissionComponentGetByLabel +end function FissionComponentsFissionComponentGetByLabel + +!! Set, by label +subroutine FissionComponentsFissionComponentSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='FissionComponentsFissionComponentSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionComponentsFissionComponentSetByLabel + +!! ------------------------ +!! Re: metadatum ENDF_MT +!! ------------------------ + +!! Has, by ENDF_MT +function FissionComponentsFissionComponentHasByENDFMT(handle, meta) & + bind(C, name='FissionComponentsFissionComponentHasByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: FissionComponentsFissionComponentHasByENDFMT +end function FissionComponentsFissionComponentHasByENDFMT + +!! Get, by ENDF_MT, const +function FissionComponentsFissionComponentGetByENDFMTConst(handle, meta) & + bind(C, name='FissionComponentsFissionComponentGetByENDFMTConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: FissionComponentsFissionComponentGetByENDFMTConst +end function FissionComponentsFissionComponentGetByENDFMTConst + +!! Get, by ENDF_MT, non-const +function FissionComponentsFissionComponentGetByENDFMT(handle, meta) & + bind(C, name='FissionComponentsFissionComponentGetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: FissionComponentsFissionComponentGetByENDFMT +end function FissionComponentsFissionComponentGetByENDFMT + +!! Set, by ENDF_MT +subroutine FissionComponentsFissionComponentSetByENDFMT(handle, meta, fieldHandle) & + bind(C, name='FissionComponentsFissionComponentSetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionComponentsFissionComponentSetByENDFMT + +!! ------------------------ +!! Re: metadatum fissionGenre +!! ------------------------ + +!! Has, by fissionGenre +function FissionComponentsFissionComponentHasByFissionGenre(handle, meta, metaSize) & + bind(C, name='FissionComponentsFissionComponentHasByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: FissionComponentsFissionComponentHasByFissionGenre +end function FissionComponentsFissionComponentHasByFissionGenre + +!! Get, by fissionGenre, const +function FissionComponentsFissionComponentGetByFissionGenreConst(handle, meta, metaSize) & + bind(C, name='FissionComponentsFissionComponentGetByFissionGenreConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: FissionComponentsFissionComponentGetByFissionGenreConst +end function FissionComponentsFissionComponentGetByFissionGenreConst + +!! Get, by fissionGenre, non-const +function FissionComponentsFissionComponentGetByFissionGenre(handle, meta, metaSize) & + bind(C, name='FissionComponentsFissionComponentGetByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: FissionComponentsFissionComponentGetByFissionGenre +end function FissionComponentsFissionComponentGetByFissionGenre + +!! Set, by fissionGenre +subroutine FissionComponentsFissionComponentSetByFissionGenre(handle, meta, metaSize, fieldHandle) & + bind(C, name='FissionComponentsFissionComponentSetByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionComponentsFissionComponentSetByFissionGenre + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalFissionComponents diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionEnergyRelease.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionEnergyRelease.f03 new file mode 100644 index 000000000..6065c6441 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionEnergyRelease.f03 @@ -0,0 +1,577 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalFissionEnergyRelease +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function FissionEnergyReleaseDefaultConst() & + bind(C, name='FissionEnergyReleaseDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: FissionEnergyReleaseDefaultConst +end function FissionEnergyReleaseDefaultConst + +!! Create, default, non-const +function FissionEnergyReleaseDefault() & + bind(C, name='FissionEnergyReleaseDefault') + use iso_c_binding + implicit none + type(c_ptr) :: FissionEnergyReleaseDefault +end function FissionEnergyReleaseDefault + +!! Create, general, const +function FissionEnergyReleaseCreateConst( & + label, & + promptProductKE, & + promptNeutronKE, & + delayedNeutronKE, & + promptGammaEnergy, & + delayedGammaEnergy, & + delayedBetaEnergy, & + neutrinoEnergy, & + nonNeutrinoEnergy, & + totalEnergy, & + labelSize & +) & + bind(C, name='FissionEnergyReleaseCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: promptProductKE + type(c_ptr), intent(in), value :: promptNeutronKE + type(c_ptr), intent(in), value :: delayedNeutronKE + type(c_ptr), intent(in), value :: promptGammaEnergy + type(c_ptr), intent(in), value :: delayedGammaEnergy + type(c_ptr), intent(in), value :: delayedBetaEnergy + type(c_ptr), intent(in), value :: neutrinoEnergy + type(c_ptr), intent(in), value :: nonNeutrinoEnergy + type(c_ptr), intent(in), value :: totalEnergy + type(c_ptr) :: FissionEnergyReleaseCreateConst +end function FissionEnergyReleaseCreateConst + +!! Create, general, non-const +function FissionEnergyReleaseCreate( & + label, & + promptProductKE, & + promptNeutronKE, & + delayedNeutronKE, & + promptGammaEnergy, & + delayedGammaEnergy, & + delayedBetaEnergy, & + neutrinoEnergy, & + nonNeutrinoEnergy, & + totalEnergy, & + labelSize & +) & + bind(C, name='FissionEnergyReleaseCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: promptProductKE + type(c_ptr), intent(in), value :: promptNeutronKE + type(c_ptr), intent(in), value :: delayedNeutronKE + type(c_ptr), intent(in), value :: promptGammaEnergy + type(c_ptr), intent(in), value :: delayedGammaEnergy + type(c_ptr), intent(in), value :: delayedBetaEnergy + type(c_ptr), intent(in), value :: neutrinoEnergy + type(c_ptr), intent(in), value :: nonNeutrinoEnergy + type(c_ptr), intent(in), value :: totalEnergy + type(c_ptr) :: FissionEnergyReleaseCreate +end function FissionEnergyReleaseCreate + +!! Assign +subroutine FissionEnergyReleaseAssign(handleLHS, handleRHS) & + bind(C, name='FissionEnergyReleaseAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine FissionEnergyReleaseAssign + +!! Delete +subroutine FissionEnergyReleaseDelete(handle) & + bind(C, name='FissionEnergyReleaseDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FissionEnergyReleaseDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function FissionEnergyReleaseRead(handle, filename, filenameSize) & + bind(C, name='FissionEnergyReleaseRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FissionEnergyReleaseRead +end function FissionEnergyReleaseRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function FissionEnergyReleaseWrite(handle, filename, filenameSize) & + bind(C, name='FissionEnergyReleaseWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FissionEnergyReleaseWrite +end function FissionEnergyReleaseWrite + +!! Print to standard output, in our prettyprinting format +function FissionEnergyReleasePrint(handle) & + bind(C, name='FissionEnergyReleasePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleasePrint +end function FissionEnergyReleasePrint + +!! Print to standard output, as XML +function FissionEnergyReleasePrintXML(handle) & + bind(C, name='FissionEnergyReleasePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleasePrintXML +end function FissionEnergyReleasePrintXML + +!! Print to standard output, as JSON +function FissionEnergyReleasePrintJSON(handle) & + bind(C, name='FissionEnergyReleasePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleasePrintJSON +end function FissionEnergyReleasePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function FissionEnergyReleaseLabelHas(handle) & + bind(C, name='FissionEnergyReleaseLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleaseLabelHas +end function FissionEnergyReleaseLabelHas + +!! Get +function FissionEnergyReleaseLabelGet(handle) & + bind(C, name='FissionEnergyReleaseLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionEnergyReleaseLabelGet +end function FissionEnergyReleaseLabelGet + +!! Set +subroutine FissionEnergyReleaseLabelSet(handle, label, labelSize) & + bind(C, name='FissionEnergyReleaseLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine FissionEnergyReleaseLabelSet + + +!! ----------------------------------------------------------------------------- +!! Child: promptProductKE +!! ----------------------------------------------------------------------------- + +!! Has +function FissionEnergyReleasePromptProductKEHas(handle) & + bind(C, name='FissionEnergyReleasePromptProductKEHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleasePromptProductKEHas +end function FissionEnergyReleasePromptProductKEHas + +!! Get, const +function FissionEnergyReleasePromptProductKEGetConst(handle) & + bind(C, name='FissionEnergyReleasePromptProductKEGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionEnergyReleasePromptProductKEGetConst +end function FissionEnergyReleasePromptProductKEGetConst + +!! Get, non-const +function FissionEnergyReleasePromptProductKEGet(handle) & + bind(C, name='FissionEnergyReleasePromptProductKEGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionEnergyReleasePromptProductKEGet +end function FissionEnergyReleasePromptProductKEGet + +!! Set +subroutine FissionEnergyReleasePromptProductKESet(handle, fieldHandle) & + bind(C, name='FissionEnergyReleasePromptProductKESet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleasePromptProductKESet + + +!! ----------------------------------------------------------------------------- +!! Child: promptNeutronKE +!! ----------------------------------------------------------------------------- + +!! Has +function FissionEnergyReleasePromptNeutronKEHas(handle) & + bind(C, name='FissionEnergyReleasePromptNeutronKEHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleasePromptNeutronKEHas +end function FissionEnergyReleasePromptNeutronKEHas + +!! Get, const +function FissionEnergyReleasePromptNeutronKEGetConst(handle) & + bind(C, name='FissionEnergyReleasePromptNeutronKEGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionEnergyReleasePromptNeutronKEGetConst +end function FissionEnergyReleasePromptNeutronKEGetConst + +!! Get, non-const +function FissionEnergyReleasePromptNeutronKEGet(handle) & + bind(C, name='FissionEnergyReleasePromptNeutronKEGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionEnergyReleasePromptNeutronKEGet +end function FissionEnergyReleasePromptNeutronKEGet + +!! Set +subroutine FissionEnergyReleasePromptNeutronKESet(handle, fieldHandle) & + bind(C, name='FissionEnergyReleasePromptNeutronKESet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleasePromptNeutronKESet + + +!! ----------------------------------------------------------------------------- +!! Child: delayedNeutronKE +!! ----------------------------------------------------------------------------- + +!! Has +function FissionEnergyReleaseDelayedNeutronKEHas(handle) & + bind(C, name='FissionEnergyReleaseDelayedNeutronKEHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleaseDelayedNeutronKEHas +end function FissionEnergyReleaseDelayedNeutronKEHas + +!! Get, const +function FissionEnergyReleaseDelayedNeutronKEGetConst(handle) & + bind(C, name='FissionEnergyReleaseDelayedNeutronKEGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionEnergyReleaseDelayedNeutronKEGetConst +end function FissionEnergyReleaseDelayedNeutronKEGetConst + +!! Get, non-const +function FissionEnergyReleaseDelayedNeutronKEGet(handle) & + bind(C, name='FissionEnergyReleaseDelayedNeutronKEGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionEnergyReleaseDelayedNeutronKEGet +end function FissionEnergyReleaseDelayedNeutronKEGet + +!! Set +subroutine FissionEnergyReleaseDelayedNeutronKESet(handle, fieldHandle) & + bind(C, name='FissionEnergyReleaseDelayedNeutronKESet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleaseDelayedNeutronKESet + + +!! ----------------------------------------------------------------------------- +!! Child: promptGammaEnergy +!! ----------------------------------------------------------------------------- + +!! Has +function FissionEnergyReleasePromptGammaEnergyHas(handle) & + bind(C, name='FissionEnergyReleasePromptGammaEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleasePromptGammaEnergyHas +end function FissionEnergyReleasePromptGammaEnergyHas + +!! Get, const +function FissionEnergyReleasePromptGammaEnergyGetConst(handle) & + bind(C, name='FissionEnergyReleasePromptGammaEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionEnergyReleasePromptGammaEnergyGetConst +end function FissionEnergyReleasePromptGammaEnergyGetConst + +!! Get, non-const +function FissionEnergyReleasePromptGammaEnergyGet(handle) & + bind(C, name='FissionEnergyReleasePromptGammaEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionEnergyReleasePromptGammaEnergyGet +end function FissionEnergyReleasePromptGammaEnergyGet + +!! Set +subroutine FissionEnergyReleasePromptGammaEnergySet(handle, fieldHandle) & + bind(C, name='FissionEnergyReleasePromptGammaEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleasePromptGammaEnergySet + + +!! ----------------------------------------------------------------------------- +!! Child: delayedGammaEnergy +!! ----------------------------------------------------------------------------- + +!! Has +function FissionEnergyReleaseDelayedGammaEnergyHas(handle) & + bind(C, name='FissionEnergyReleaseDelayedGammaEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleaseDelayedGammaEnergyHas +end function FissionEnergyReleaseDelayedGammaEnergyHas + +!! Get, const +function FissionEnergyReleaseDelayedGammaEnergyGetConst(handle) & + bind(C, name='FissionEnergyReleaseDelayedGammaEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionEnergyReleaseDelayedGammaEnergyGetConst +end function FissionEnergyReleaseDelayedGammaEnergyGetConst + +!! Get, non-const +function FissionEnergyReleaseDelayedGammaEnergyGet(handle) & + bind(C, name='FissionEnergyReleaseDelayedGammaEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionEnergyReleaseDelayedGammaEnergyGet +end function FissionEnergyReleaseDelayedGammaEnergyGet + +!! Set +subroutine FissionEnergyReleaseDelayedGammaEnergySet(handle, fieldHandle) & + bind(C, name='FissionEnergyReleaseDelayedGammaEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleaseDelayedGammaEnergySet + + +!! ----------------------------------------------------------------------------- +!! Child: delayedBetaEnergy +!! ----------------------------------------------------------------------------- + +!! Has +function FissionEnergyReleaseDelayedBetaEnergyHas(handle) & + bind(C, name='FissionEnergyReleaseDelayedBetaEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleaseDelayedBetaEnergyHas +end function FissionEnergyReleaseDelayedBetaEnergyHas + +!! Get, const +function FissionEnergyReleaseDelayedBetaEnergyGetConst(handle) & + bind(C, name='FissionEnergyReleaseDelayedBetaEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionEnergyReleaseDelayedBetaEnergyGetConst +end function FissionEnergyReleaseDelayedBetaEnergyGetConst + +!! Get, non-const +function FissionEnergyReleaseDelayedBetaEnergyGet(handle) & + bind(C, name='FissionEnergyReleaseDelayedBetaEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionEnergyReleaseDelayedBetaEnergyGet +end function FissionEnergyReleaseDelayedBetaEnergyGet + +!! Set +subroutine FissionEnergyReleaseDelayedBetaEnergySet(handle, fieldHandle) & + bind(C, name='FissionEnergyReleaseDelayedBetaEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleaseDelayedBetaEnergySet + + +!! ----------------------------------------------------------------------------- +!! Child: neutrinoEnergy +!! ----------------------------------------------------------------------------- + +!! Has +function FissionEnergyReleaseNeutrinoEnergyHas(handle) & + bind(C, name='FissionEnergyReleaseNeutrinoEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleaseNeutrinoEnergyHas +end function FissionEnergyReleaseNeutrinoEnergyHas + +!! Get, const +function FissionEnergyReleaseNeutrinoEnergyGetConst(handle) & + bind(C, name='FissionEnergyReleaseNeutrinoEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionEnergyReleaseNeutrinoEnergyGetConst +end function FissionEnergyReleaseNeutrinoEnergyGetConst + +!! Get, non-const +function FissionEnergyReleaseNeutrinoEnergyGet(handle) & + bind(C, name='FissionEnergyReleaseNeutrinoEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionEnergyReleaseNeutrinoEnergyGet +end function FissionEnergyReleaseNeutrinoEnergyGet + +!! Set +subroutine FissionEnergyReleaseNeutrinoEnergySet(handle, fieldHandle) & + bind(C, name='FissionEnergyReleaseNeutrinoEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleaseNeutrinoEnergySet + + +!! ----------------------------------------------------------------------------- +!! Child: nonNeutrinoEnergy +!! ----------------------------------------------------------------------------- + +!! Has +function FissionEnergyReleaseNonNeutrinoEnergyHas(handle) & + bind(C, name='FissionEnergyReleaseNonNeutrinoEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleaseNonNeutrinoEnergyHas +end function FissionEnergyReleaseNonNeutrinoEnergyHas + +!! Get, const +function FissionEnergyReleaseNonNeutrinoEnergyGetConst(handle) & + bind(C, name='FissionEnergyReleaseNonNeutrinoEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionEnergyReleaseNonNeutrinoEnergyGetConst +end function FissionEnergyReleaseNonNeutrinoEnergyGetConst + +!! Get, non-const +function FissionEnergyReleaseNonNeutrinoEnergyGet(handle) & + bind(C, name='FissionEnergyReleaseNonNeutrinoEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionEnergyReleaseNonNeutrinoEnergyGet +end function FissionEnergyReleaseNonNeutrinoEnergyGet + +!! Set +subroutine FissionEnergyReleaseNonNeutrinoEnergySet(handle, fieldHandle) & + bind(C, name='FissionEnergyReleaseNonNeutrinoEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleaseNonNeutrinoEnergySet + + +!! ----------------------------------------------------------------------------- +!! Child: totalEnergy +!! ----------------------------------------------------------------------------- + +!! Has +function FissionEnergyReleaseTotalEnergyHas(handle) & + bind(C, name='FissionEnergyReleaseTotalEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleaseTotalEnergyHas +end function FissionEnergyReleaseTotalEnergyHas + +!! Get, const +function FissionEnergyReleaseTotalEnergyGetConst(handle) & + bind(C, name='FissionEnergyReleaseTotalEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionEnergyReleaseTotalEnergyGetConst +end function FissionEnergyReleaseTotalEnergyGetConst + +!! Get, non-const +function FissionEnergyReleaseTotalEnergyGet(handle) & + bind(C, name='FissionEnergyReleaseTotalEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionEnergyReleaseTotalEnergyGet +end function FissionEnergyReleaseTotalEnergyGet + +!! Set +subroutine FissionEnergyReleaseTotalEnergySet(handle, fieldHandle) & + bind(C, name='FissionEnergyReleaseTotalEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleaseTotalEnergySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalFissionEnergyRelease diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionEnergyReleases.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionEnergyReleases.f03 new file mode 100644 index 000000000..32d0d41e5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FissionEnergyReleases.f03 @@ -0,0 +1,255 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalFissionEnergyReleases +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function FissionEnergyReleasesDefaultConst() & + bind(C, name='FissionEnergyReleasesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: FissionEnergyReleasesDefaultConst +end function FissionEnergyReleasesDefaultConst + +!! Create, default, non-const +function FissionEnergyReleasesDefault() & + bind(C, name='FissionEnergyReleasesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: FissionEnergyReleasesDefault +end function FissionEnergyReleasesDefault + +!! Create, general, const +function FissionEnergyReleasesCreateConst( & + fissionEnergyRelease, fissionEnergyReleaseSize & +) & + bind(C, name='FissionEnergyReleasesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: fissionEnergyReleaseSize + type(c_ptr), intent(in) :: fissionEnergyRelease(fissionEnergyReleaseSize) + type(c_ptr) :: FissionEnergyReleasesCreateConst +end function FissionEnergyReleasesCreateConst + +!! Create, general, non-const +function FissionEnergyReleasesCreate( & + fissionEnergyRelease, fissionEnergyReleaseSize & +) & + bind(C, name='FissionEnergyReleasesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: fissionEnergyReleaseSize + type(c_ptr), intent(in) :: fissionEnergyRelease(fissionEnergyReleaseSize) + type(c_ptr) :: FissionEnergyReleasesCreate +end function FissionEnergyReleasesCreate + +!! Assign +subroutine FissionEnergyReleasesAssign(handleLHS, handleRHS) & + bind(C, name='FissionEnergyReleasesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine FissionEnergyReleasesAssign + +!! Delete +subroutine FissionEnergyReleasesDelete(handle) & + bind(C, name='FissionEnergyReleasesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FissionEnergyReleasesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function FissionEnergyReleasesRead(handle, filename, filenameSize) & + bind(C, name='FissionEnergyReleasesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FissionEnergyReleasesRead +end function FissionEnergyReleasesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function FissionEnergyReleasesWrite(handle, filename, filenameSize) & + bind(C, name='FissionEnergyReleasesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FissionEnergyReleasesWrite +end function FissionEnergyReleasesWrite + +!! Print to standard output, in our prettyprinting format +function FissionEnergyReleasesPrint(handle) & + bind(C, name='FissionEnergyReleasesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleasesPrint +end function FissionEnergyReleasesPrint + +!! Print to standard output, as XML +function FissionEnergyReleasesPrintXML(handle) & + bind(C, name='FissionEnergyReleasesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleasesPrintXML +end function FissionEnergyReleasesPrintXML + +!! Print to standard output, as JSON +function FissionEnergyReleasesPrintJSON(handle) & + bind(C, name='FissionEnergyReleasesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleasesPrintJSON +end function FissionEnergyReleasesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: fissionEnergyRelease +!! ----------------------------------------------------------------------------- + +!! Has +function FissionEnergyReleasesFissionEnergyReleaseHas(handle) & + bind(C, name='FissionEnergyReleasesFissionEnergyReleaseHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionEnergyReleasesFissionEnergyReleaseHas +end function FissionEnergyReleasesFissionEnergyReleaseHas + +!! Clear +subroutine FissionEnergyReleasesFissionEnergyReleaseClear(handle) & + bind(C, name='FissionEnergyReleasesFissionEnergyReleaseClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FissionEnergyReleasesFissionEnergyReleaseClear + +!! Size +function FissionEnergyReleasesFissionEnergyReleaseSize(handle) & + bind(C, name='FissionEnergyReleasesFissionEnergyReleaseSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: FissionEnergyReleasesFissionEnergyReleaseSize +end function FissionEnergyReleasesFissionEnergyReleaseSize + +!! Add +subroutine FissionEnergyReleasesFissionEnergyReleaseAdd(handle, fieldHandle) & + bind(C, name='FissionEnergyReleasesFissionEnergyReleaseAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleasesFissionEnergyReleaseAdd + +!! Get, by index \in [0,size), const +function FissionEnergyReleasesFissionEnergyReleaseGetConst(handle, index) & + bind(C, name='FissionEnergyReleasesFissionEnergyReleaseGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: FissionEnergyReleasesFissionEnergyReleaseGetConst +end function FissionEnergyReleasesFissionEnergyReleaseGetConst + +!! Get, by index \in [0,size), non-const +function FissionEnergyReleasesFissionEnergyReleaseGet(handle, index) & + bind(C, name='FissionEnergyReleasesFissionEnergyReleaseGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: FissionEnergyReleasesFissionEnergyReleaseGet +end function FissionEnergyReleasesFissionEnergyReleaseGet + +!! Set, by index \in [0,size) +subroutine FissionEnergyReleasesFissionEnergyReleaseSet(handle, index, fieldHandle) & + bind(C, name='FissionEnergyReleasesFissionEnergyReleaseSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleasesFissionEnergyReleaseSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function FissionEnergyReleasesFissionEnergyReleaseHasByLabel(handle, meta, metaSize) & + bind(C, name='FissionEnergyReleasesFissionEnergyReleaseHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: FissionEnergyReleasesFissionEnergyReleaseHasByLabel +end function FissionEnergyReleasesFissionEnergyReleaseHasByLabel + +!! Get, by label, const +function FissionEnergyReleasesFissionEnergyReleaseGetByLabelConst(handle, meta, metaSize) & + bind(C, name='FissionEnergyReleasesFissionEnergyReleaseGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: FissionEnergyReleasesFissionEnergyReleaseGetByLabelConst +end function FissionEnergyReleasesFissionEnergyReleaseGetByLabelConst + +!! Get, by label, non-const +function FissionEnergyReleasesFissionEnergyReleaseGetByLabel(handle, meta, metaSize) & + bind(C, name='FissionEnergyReleasesFissionEnergyReleaseGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: FissionEnergyReleasesFissionEnergyReleaseGetByLabel +end function FissionEnergyReleasesFissionEnergyReleaseGetByLabel + +!! Set, by label +subroutine FissionEnergyReleasesFissionEnergyReleaseSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='FissionEnergyReleasesFissionEnergyReleaseSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionEnergyReleasesFissionEnergyReleaseSetByLabel + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalFissionEnergyReleases diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FormFactor.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FormFactor.f03 new file mode 100644 index 000000000..5f66e1460 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FormFactor.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalFormFactor +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function FormFactorDefaultConst() & + bind(C, name='FormFactorDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: FormFactorDefaultConst +end function FormFactorDefaultConst + +!! Create, default, non-const +function FormFactorDefault() & + bind(C, name='FormFactorDefault') + use iso_c_binding + implicit none + type(c_ptr) :: FormFactorDefault +end function FormFactorDefault + +!! Create, general, const +function FormFactorCreateConst( & + XYs1d & +) & + bind(C, name='FormFactorCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: FormFactorCreateConst +end function FormFactorCreateConst + +!! Create, general, non-const +function FormFactorCreate( & + XYs1d & +) & + bind(C, name='FormFactorCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: FormFactorCreate +end function FormFactorCreate + +!! Assign +subroutine FormFactorAssign(handleLHS, handleRHS) & + bind(C, name='FormFactorAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine FormFactorAssign + +!! Delete +subroutine FormFactorDelete(handle) & + bind(C, name='FormFactorDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FormFactorDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function FormFactorRead(handle, filename, filenameSize) & + bind(C, name='FormFactorRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FormFactorRead +end function FormFactorRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function FormFactorWrite(handle, filename, filenameSize) & + bind(C, name='FormFactorWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FormFactorWrite +end function FormFactorWrite + +!! Print to standard output, in our prettyprinting format +function FormFactorPrint(handle) & + bind(C, name='FormFactorPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FormFactorPrint +end function FormFactorPrint + +!! Print to standard output, as XML +function FormFactorPrintXML(handle) & + bind(C, name='FormFactorPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FormFactorPrintXML +end function FormFactorPrintXML + +!! Print to standard output, as JSON +function FormFactorPrintJSON(handle) & + bind(C, name='FormFactorPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FormFactorPrintJSON +end function FormFactorPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function FormFactorXYs1dHas(handle) & + bind(C, name='FormFactorXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FormFactorXYs1dHas +end function FormFactorXYs1dHas + +!! Get, const +function FormFactorXYs1dGetConst(handle) & + bind(C, name='FormFactorXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FormFactorXYs1dGetConst +end function FormFactorXYs1dGetConst + +!! Get, non-const +function FormFactorXYs1dGet(handle) & + bind(C, name='FormFactorXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FormFactorXYs1dGet +end function FormFactorXYs1dGet + +!! Set +subroutine FormFactorXYs1dSet(handle, fieldHandle) & + bind(C, name='FormFactorXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FormFactorXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalFormFactor diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Fraction.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Fraction.f03 new file mode 100644 index 000000000..3f916198f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Fraction.f03 @@ -0,0 +1,254 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalFraction +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function FractionDefaultConst() & + bind(C, name='FractionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: FractionDefaultConst +end function FractionDefaultConst + +!! Create, default, non-const +function FractionDefault() & + bind(C, name='FractionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: FractionDefault +end function FractionDefault + +!! Create, general, const +function FractionCreateConst( & + label, & + value, & + unit, & + labelSize, & + valueSize, & + unitSize & +) & + bind(C, name='FractionCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: valueSize + character(c_char), intent(in) :: value(valueSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: FractionCreateConst +end function FractionCreateConst + +!! Create, general, non-const +function FractionCreate( & + label, & + value, & + unit, & + labelSize, & + valueSize, & + unitSize & +) & + bind(C, name='FractionCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: valueSize + character(c_char), intent(in) :: value(valueSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: FractionCreate +end function FractionCreate + +!! Assign +subroutine FractionAssign(handleLHS, handleRHS) & + bind(C, name='FractionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine FractionAssign + +!! Delete +subroutine FractionDelete(handle) & + bind(C, name='FractionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FractionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function FractionRead(handle, filename, filenameSize) & + bind(C, name='FractionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FractionRead +end function FractionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function FractionWrite(handle, filename, filenameSize) & + bind(C, name='FractionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FractionWrite +end function FractionWrite + +!! Print to standard output, in our prettyprinting format +function FractionPrint(handle) & + bind(C, name='FractionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FractionPrint +end function FractionPrint + +!! Print to standard output, as XML +function FractionPrintXML(handle) & + bind(C, name='FractionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FractionPrintXML +end function FractionPrintXML + +!! Print to standard output, as JSON +function FractionPrintJSON(handle) & + bind(C, name='FractionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FractionPrintJSON +end function FractionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function FractionLabelHas(handle) & + bind(C, name='FractionLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FractionLabelHas +end function FractionLabelHas + +!! Get +function FractionLabelGet(handle) & + bind(C, name='FractionLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FractionLabelGet +end function FractionLabelGet + +!! Set +subroutine FractionLabelSet(handle, label, labelSize) & + bind(C, name='FractionLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine FractionLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function FractionValueHas(handle) & + bind(C, name='FractionValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FractionValueHas +end function FractionValueHas + +!! Get +function FractionValueGet(handle) & + bind(C, name='FractionValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FractionValueGet +end function FractionValueGet + +!! Set +subroutine FractionValueSet(handle, value, valueSize) & + bind(C, name='FractionValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: valueSize + character(c_char), intent(in) :: value(valueSize) +end subroutine FractionValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function FractionUnitHas(handle) & + bind(C, name='FractionUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FractionUnitHas +end function FractionUnitHas + +!! Get +function FractionUnitGet(handle) & + bind(C, name='FractionUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FractionUnitGet +end function FractionUnitGet + +!! Set +subroutine FractionUnitSet(handle, unit, unitSize) & + bind(C, name='FractionUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine FractionUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalFraction diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FreeGasApproximation.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FreeGasApproximation.f03 new file mode 100644 index 000000000..b2b73f295 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/FreeGasApproximation.f03 @@ -0,0 +1,131 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalFreeGasApproximation +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function FreeGasApproximationDefaultConst() & + bind(C, name='FreeGasApproximationDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: FreeGasApproximationDefaultConst +end function FreeGasApproximationDefaultConst + +!! Create, default, non-const +function FreeGasApproximationDefault() & + bind(C, name='FreeGasApproximationDefault') + use iso_c_binding + implicit none + type(c_ptr) :: FreeGasApproximationDefault +end function FreeGasApproximationDefault + +!! Create, general, const +function FreeGasApproximationCreateConst( & +) & + bind(C, name='FreeGasApproximationCreateConst') + use iso_c_binding + implicit none + type(c_ptr) :: FreeGasApproximationCreateConst +end function FreeGasApproximationCreateConst + +!! Create, general, non-const +function FreeGasApproximationCreate( & +) & + bind(C, name='FreeGasApproximationCreate') + use iso_c_binding + implicit none + type(c_ptr) :: FreeGasApproximationCreate +end function FreeGasApproximationCreate + +!! Assign +subroutine FreeGasApproximationAssign(handleLHS, handleRHS) & + bind(C, name='FreeGasApproximationAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine FreeGasApproximationAssign + +!! Delete +subroutine FreeGasApproximationDelete(handle) & + bind(C, name='FreeGasApproximationDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FreeGasApproximationDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function FreeGasApproximationRead(handle, filename, filenameSize) & + bind(C, name='FreeGasApproximationRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FreeGasApproximationRead +end function FreeGasApproximationRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function FreeGasApproximationWrite(handle, filename, filenameSize) & + bind(C, name='FreeGasApproximationWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FreeGasApproximationWrite +end function FreeGasApproximationWrite + +!! Print to standard output, in our prettyprinting format +function FreeGasApproximationPrint(handle) & + bind(C, name='FreeGasApproximationPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FreeGasApproximationPrint +end function FreeGasApproximationPrint + +!! Print to standard output, as XML +function FreeGasApproximationPrintXML(handle) & + bind(C, name='FreeGasApproximationPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FreeGasApproximationPrintXML +end function FreeGasApproximationPrintXML + +!! Print to standard output, as JSON +function FreeGasApproximationPrintJSON(handle) & + bind(C, name='FreeGasApproximationPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FreeGasApproximationPrintJSON +end function FreeGasApproximationPrintJSON + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalFreeGasApproximation diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Function1ds.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Function1ds.f03 new file mode 100644 index 000000000..9d63daa3d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Function1ds.f03 @@ -0,0 +1,679 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalFunction1ds +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Function1dsDefaultConst() & + bind(C, name='Function1dsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Function1dsDefaultConst +end function Function1dsDefaultConst + +!! Create, default, non-const +function Function1dsDefault() & + bind(C, name='Function1dsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Function1dsDefault +end function Function1dsDefault + +!! Create, general, const +function Function1dsCreateConst( & + Legendre, LegendreSize, & + XYs1d, XYs1dSize, & + regions1d, regions1dSize & +) & + bind(C, name='Function1dsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: LegendreSize + type(c_ptr), intent(in) :: Legendre(LegendreSize) + integer(c_size_t), intent(in), value :: XYs1dSize + type(c_ptr), intent(in) :: XYs1d(XYs1dSize) + integer(c_size_t), intent(in), value :: regions1dSize + type(c_ptr), intent(in) :: regions1d(regions1dSize) + type(c_ptr) :: Function1dsCreateConst +end function Function1dsCreateConst + +!! Create, general, non-const +function Function1dsCreate( & + Legendre, LegendreSize, & + XYs1d, XYs1dSize, & + regions1d, regions1dSize & +) & + bind(C, name='Function1dsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: LegendreSize + type(c_ptr), intent(in) :: Legendre(LegendreSize) + integer(c_size_t), intent(in), value :: XYs1dSize + type(c_ptr), intent(in) :: XYs1d(XYs1dSize) + integer(c_size_t), intent(in), value :: regions1dSize + type(c_ptr), intent(in) :: regions1d(regions1dSize) + type(c_ptr) :: Function1dsCreate +end function Function1dsCreate + +!! Assign +subroutine Function1dsAssign(handleLHS, handleRHS) & + bind(C, name='Function1dsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Function1dsAssign + +!! Delete +subroutine Function1dsDelete(handle) & + bind(C, name='Function1dsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Function1dsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Function1dsRead(handle, filename, filenameSize) & + bind(C, name='Function1dsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Function1dsRead +end function Function1dsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Function1dsWrite(handle, filename, filenameSize) & + bind(C, name='Function1dsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Function1dsWrite +end function Function1dsWrite + +!! Print to standard output, in our prettyprinting format +function Function1dsPrint(handle) & + bind(C, name='Function1dsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function1dsPrint +end function Function1dsPrint + +!! Print to standard output, as XML +function Function1dsPrintXML(handle) & + bind(C, name='Function1dsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function1dsPrintXML +end function Function1dsPrintXML + +!! Print to standard output, as JSON +function Function1dsPrintJSON(handle) & + bind(C, name='Function1dsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function1dsPrintJSON +end function Function1dsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: Legendre +!! ----------------------------------------------------------------------------- + +!! Has +function Function1dsLegendreHas(handle) & + bind(C, name='Function1dsLegendreHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function1dsLegendreHas +end function Function1dsLegendreHas + +!! Clear +subroutine Function1dsLegendreClear(handle) & + bind(C, name='Function1dsLegendreClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Function1dsLegendreClear + +!! Size +function Function1dsLegendreSize(handle) & + bind(C, name='Function1dsLegendreSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: Function1dsLegendreSize +end function Function1dsLegendreSize + +!! Add +subroutine Function1dsLegendreAdd(handle, fieldHandle) & + bind(C, name='Function1dsLegendreAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsLegendreAdd + +!! Get, by index \in [0,size), const +function Function1dsLegendreGetConst(handle, index) & + bind(C, name='Function1dsLegendreGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function1dsLegendreGetConst +end function Function1dsLegendreGetConst + +!! Get, by index \in [0,size), non-const +function Function1dsLegendreGet(handle, index) & + bind(C, name='Function1dsLegendreGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function1dsLegendreGet +end function Function1dsLegendreGet + +!! Set, by index \in [0,size) +subroutine Function1dsLegendreSet(handle, index, fieldHandle) & + bind(C, name='Function1dsLegendreSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsLegendreSet + +!! ------------------------ +!! Re: metadatum outerDomainValue +!! ------------------------ + +!! Has, by outerDomainValue +function Function1dsLegendreHasByOuterDomainValue(handle, meta) & + bind(C, name='Function1dsLegendreHasByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: Function1dsLegendreHasByOuterDomainValue +end function Function1dsLegendreHasByOuterDomainValue + +!! Get, by outerDomainValue, const +function Function1dsLegendreGetByOuterDomainValueConst(handle, meta) & + bind(C, name='Function1dsLegendreGetByOuterDomainValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function1dsLegendreGetByOuterDomainValueConst +end function Function1dsLegendreGetByOuterDomainValueConst + +!! Get, by outerDomainValue, non-const +function Function1dsLegendreGetByOuterDomainValue(handle, meta) & + bind(C, name='Function1dsLegendreGetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function1dsLegendreGetByOuterDomainValue +end function Function1dsLegendreGetByOuterDomainValue + +!! Set, by outerDomainValue +subroutine Function1dsLegendreSetByOuterDomainValue(handle, meta, fieldHandle) & + bind(C, name='Function1dsLegendreSetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsLegendreSetByOuterDomainValue + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function Function1dsXYs1dHas(handle) & + bind(C, name='Function1dsXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function1dsXYs1dHas +end function Function1dsXYs1dHas + +!! Clear +subroutine Function1dsXYs1dClear(handle) & + bind(C, name='Function1dsXYs1dClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Function1dsXYs1dClear + +!! Size +function Function1dsXYs1dSize(handle) & + bind(C, name='Function1dsXYs1dSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: Function1dsXYs1dSize +end function Function1dsXYs1dSize + +!! Add +subroutine Function1dsXYs1dAdd(handle, fieldHandle) & + bind(C, name='Function1dsXYs1dAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dAdd + +!! Get, by index \in [0,size), const +function Function1dsXYs1dGetConst(handle, index) & + bind(C, name='Function1dsXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function1dsXYs1dGetConst +end function Function1dsXYs1dGetConst + +!! Get, by index \in [0,size), non-const +function Function1dsXYs1dGet(handle, index) & + bind(C, name='Function1dsXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function1dsXYs1dGet +end function Function1dsXYs1dGet + +!! Set, by index \in [0,size) +subroutine Function1dsXYs1dSet(handle, index, fieldHandle) & + bind(C, name='Function1dsXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function Function1dsXYs1dHasByLabel(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: Function1dsXYs1dHasByLabel +end function Function1dsXYs1dHasByLabel + +!! Get, by label, const +function Function1dsXYs1dGetByLabelConst(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function1dsXYs1dGetByLabelConst +end function Function1dsXYs1dGetByLabelConst + +!! Get, by label, non-const +function Function1dsXYs1dGetByLabel(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function1dsXYs1dGetByLabel +end function Function1dsXYs1dGetByLabel + +!! Set, by label +subroutine Function1dsXYs1dSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='Function1dsXYs1dSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dSetByLabel + +!! ------------------------ +!! Re: metadatum index +!! ------------------------ + +!! Has, by index +function Function1dsXYs1dHasByIndex(handle, meta) & + bind(C, name='Function1dsXYs1dHasByIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: Function1dsXYs1dHasByIndex +end function Function1dsXYs1dHasByIndex + +!! Get, by index, const +function Function1dsXYs1dGetByIndexConst(handle, meta) & + bind(C, name='Function1dsXYs1dGetByIndexConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: Function1dsXYs1dGetByIndexConst +end function Function1dsXYs1dGetByIndexConst + +!! Get, by index, non-const +function Function1dsXYs1dGetByIndex(handle, meta) & + bind(C, name='Function1dsXYs1dGetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: Function1dsXYs1dGetByIndex +end function Function1dsXYs1dGetByIndex + +!! Set, by index +subroutine Function1dsXYs1dSetByIndex(handle, meta, fieldHandle) & + bind(C, name='Function1dsXYs1dSetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dSetByIndex + +!! ------------------------ +!! Re: metadatum interpolation +!! ------------------------ + +!! Has, by interpolation +function Function1dsXYs1dHasByInterpolation(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dHasByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: Function1dsXYs1dHasByInterpolation +end function Function1dsXYs1dHasByInterpolation + +!! Get, by interpolation, const +function Function1dsXYs1dGetByInterpolationConst(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dGetByInterpolationConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function1dsXYs1dGetByInterpolationConst +end function Function1dsXYs1dGetByInterpolationConst + +!! Get, by interpolation, non-const +function Function1dsXYs1dGetByInterpolation(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dGetByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function1dsXYs1dGetByInterpolation +end function Function1dsXYs1dGetByInterpolation + +!! Set, by interpolation +subroutine Function1dsXYs1dSetByInterpolation(handle, meta, metaSize, fieldHandle) & + bind(C, name='Function1dsXYs1dSetByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dSetByInterpolation + +!! ------------------------ +!! Re: metadatum outerDomainValue +!! ------------------------ + +!! Has, by outerDomainValue +function Function1dsXYs1dHasByOuterDomainValue(handle, meta) & + bind(C, name='Function1dsXYs1dHasByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: Function1dsXYs1dHasByOuterDomainValue +end function Function1dsXYs1dHasByOuterDomainValue + +!! Get, by outerDomainValue, const +function Function1dsXYs1dGetByOuterDomainValueConst(handle, meta) & + bind(C, name='Function1dsXYs1dGetByOuterDomainValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function1dsXYs1dGetByOuterDomainValueConst +end function Function1dsXYs1dGetByOuterDomainValueConst + +!! Get, by outerDomainValue, non-const +function Function1dsXYs1dGetByOuterDomainValue(handle, meta) & + bind(C, name='Function1dsXYs1dGetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function1dsXYs1dGetByOuterDomainValue +end function Function1dsXYs1dGetByOuterDomainValue + +!! Set, by outerDomainValue +subroutine Function1dsXYs1dSetByOuterDomainValue(handle, meta, fieldHandle) & + bind(C, name='Function1dsXYs1dSetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dSetByOuterDomainValue + + +!! ----------------------------------------------------------------------------- +!! Child: regions1d +!! ----------------------------------------------------------------------------- + +!! Has +function Function1dsRegions1dHas(handle) & + bind(C, name='Function1dsRegions1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function1dsRegions1dHas +end function Function1dsRegions1dHas + +!! Clear +subroutine Function1dsRegions1dClear(handle) & + bind(C, name='Function1dsRegions1dClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Function1dsRegions1dClear + +!! Size +function Function1dsRegions1dSize(handle) & + bind(C, name='Function1dsRegions1dSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: Function1dsRegions1dSize +end function Function1dsRegions1dSize + +!! Add +subroutine Function1dsRegions1dAdd(handle, fieldHandle) & + bind(C, name='Function1dsRegions1dAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsRegions1dAdd + +!! Get, by index \in [0,size), const +function Function1dsRegions1dGetConst(handle, index) & + bind(C, name='Function1dsRegions1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function1dsRegions1dGetConst +end function Function1dsRegions1dGetConst + +!! Get, by index \in [0,size), non-const +function Function1dsRegions1dGet(handle, index) & + bind(C, name='Function1dsRegions1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function1dsRegions1dGet +end function Function1dsRegions1dGet + +!! Set, by index \in [0,size) +subroutine Function1dsRegions1dSet(handle, index, fieldHandle) & + bind(C, name='Function1dsRegions1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsRegions1dSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function Function1dsRegions1dHasByLabel(handle, meta, metaSize) & + bind(C, name='Function1dsRegions1dHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: Function1dsRegions1dHasByLabel +end function Function1dsRegions1dHasByLabel + +!! Get, by label, const +function Function1dsRegions1dGetByLabelConst(handle, meta, metaSize) & + bind(C, name='Function1dsRegions1dGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function1dsRegions1dGetByLabelConst +end function Function1dsRegions1dGetByLabelConst + +!! Get, by label, non-const +function Function1dsRegions1dGetByLabel(handle, meta, metaSize) & + bind(C, name='Function1dsRegions1dGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function1dsRegions1dGetByLabel +end function Function1dsRegions1dGetByLabel + +!! Set, by label +subroutine Function1dsRegions1dSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='Function1dsRegions1dSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsRegions1dSetByLabel + +!! ------------------------ +!! Re: metadatum outerDomainValue +!! ------------------------ + +!! Has, by outerDomainValue +function Function1dsRegions1dHasByOuterDomainValue(handle, meta) & + bind(C, name='Function1dsRegions1dHasByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: Function1dsRegions1dHasByOuterDomainValue +end function Function1dsRegions1dHasByOuterDomainValue + +!! Get, by outerDomainValue, const +function Function1dsRegions1dGetByOuterDomainValueConst(handle, meta) & + bind(C, name='Function1dsRegions1dGetByOuterDomainValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function1dsRegions1dGetByOuterDomainValueConst +end function Function1dsRegions1dGetByOuterDomainValueConst + +!! Get, by outerDomainValue, non-const +function Function1dsRegions1dGetByOuterDomainValue(handle, meta) & + bind(C, name='Function1dsRegions1dGetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function1dsRegions1dGetByOuterDomainValue +end function Function1dsRegions1dGetByOuterDomainValue + +!! Set, by outerDomainValue +subroutine Function1dsRegions1dSetByOuterDomainValue(handle, meta, fieldHandle) & + bind(C, name='Function1dsRegions1dSetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsRegions1dSetByOuterDomainValue + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalFunction1ds diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Function2ds.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Function2ds.f03 new file mode 100644 index 000000000..5799a7098 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Function2ds.f03 @@ -0,0 +1,391 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalFunction2ds +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Function2dsDefaultConst() & + bind(C, name='Function2dsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Function2dsDefaultConst +end function Function2dsDefaultConst + +!! Create, default, non-const +function Function2dsDefault() & + bind(C, name='Function2dsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Function2dsDefault +end function Function2dsDefault + +!! Create, general, const +function Function2dsCreateConst( & + XYs2d, XYs2dSize & +) & + bind(C, name='Function2dsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: XYs2dSize + type(c_ptr), intent(in) :: XYs2d(XYs2dSize) + type(c_ptr) :: Function2dsCreateConst +end function Function2dsCreateConst + +!! Create, general, non-const +function Function2dsCreate( & + XYs2d, XYs2dSize & +) & + bind(C, name='Function2dsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: XYs2dSize + type(c_ptr), intent(in) :: XYs2d(XYs2dSize) + type(c_ptr) :: Function2dsCreate +end function Function2dsCreate + +!! Assign +subroutine Function2dsAssign(handleLHS, handleRHS) & + bind(C, name='Function2dsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Function2dsAssign + +!! Delete +subroutine Function2dsDelete(handle) & + bind(C, name='Function2dsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Function2dsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Function2dsRead(handle, filename, filenameSize) & + bind(C, name='Function2dsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Function2dsRead +end function Function2dsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Function2dsWrite(handle, filename, filenameSize) & + bind(C, name='Function2dsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Function2dsWrite +end function Function2dsWrite + +!! Print to standard output, in our prettyprinting format +function Function2dsPrint(handle) & + bind(C, name='Function2dsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function2dsPrint +end function Function2dsPrint + +!! Print to standard output, as XML +function Function2dsPrintXML(handle) & + bind(C, name='Function2dsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function2dsPrintXML +end function Function2dsPrintXML + +!! Print to standard output, as JSON +function Function2dsPrintJSON(handle) & + bind(C, name='Function2dsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function2dsPrintJSON +end function Function2dsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs2d +!! ----------------------------------------------------------------------------- + +!! Has +function Function2dsXYs2dHas(handle) & + bind(C, name='Function2dsXYs2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function2dsXYs2dHas +end function Function2dsXYs2dHas + +!! Clear +subroutine Function2dsXYs2dClear(handle) & + bind(C, name='Function2dsXYs2dClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Function2dsXYs2dClear + +!! Size +function Function2dsXYs2dSize(handle) & + bind(C, name='Function2dsXYs2dSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: Function2dsXYs2dSize +end function Function2dsXYs2dSize + +!! Add +subroutine Function2dsXYs2dAdd(handle, fieldHandle) & + bind(C, name='Function2dsXYs2dAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function2dsXYs2dAdd + +!! Get, by index \in [0,size), const +function Function2dsXYs2dGetConst(handle, index) & + bind(C, name='Function2dsXYs2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function2dsXYs2dGetConst +end function Function2dsXYs2dGetConst + +!! Get, by index \in [0,size), non-const +function Function2dsXYs2dGet(handle, index) & + bind(C, name='Function2dsXYs2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function2dsXYs2dGet +end function Function2dsXYs2dGet + +!! Set, by index \in [0,size) +subroutine Function2dsXYs2dSet(handle, index, fieldHandle) & + bind(C, name='Function2dsXYs2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function2dsXYs2dSet + +!! ------------------------ +!! Re: metadatum index +!! ------------------------ + +!! Has, by index +function Function2dsXYs2dHasByIndex(handle, meta) & + bind(C, name='Function2dsXYs2dHasByIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: Function2dsXYs2dHasByIndex +end function Function2dsXYs2dHasByIndex + +!! Get, by index, const +function Function2dsXYs2dGetByIndexConst(handle, meta) & + bind(C, name='Function2dsXYs2dGetByIndexConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: Function2dsXYs2dGetByIndexConst +end function Function2dsXYs2dGetByIndexConst + +!! Get, by index, non-const +function Function2dsXYs2dGetByIndex(handle, meta) & + bind(C, name='Function2dsXYs2dGetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: Function2dsXYs2dGetByIndex +end function Function2dsXYs2dGetByIndex + +!! Set, by index +subroutine Function2dsXYs2dSetByIndex(handle, meta, fieldHandle) & + bind(C, name='Function2dsXYs2dSetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function2dsXYs2dSetByIndex + +!! ------------------------ +!! Re: metadatum interpolation +!! ------------------------ + +!! Has, by interpolation +function Function2dsXYs2dHasByInterpolation(handle, meta, metaSize) & + bind(C, name='Function2dsXYs2dHasByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: Function2dsXYs2dHasByInterpolation +end function Function2dsXYs2dHasByInterpolation + +!! Get, by interpolation, const +function Function2dsXYs2dGetByInterpolationConst(handle, meta, metaSize) & + bind(C, name='Function2dsXYs2dGetByInterpolationConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function2dsXYs2dGetByInterpolationConst +end function Function2dsXYs2dGetByInterpolationConst + +!! Get, by interpolation, non-const +function Function2dsXYs2dGetByInterpolation(handle, meta, metaSize) & + bind(C, name='Function2dsXYs2dGetByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function2dsXYs2dGetByInterpolation +end function Function2dsXYs2dGetByInterpolation + +!! Set, by interpolation +subroutine Function2dsXYs2dSetByInterpolation(handle, meta, metaSize, fieldHandle) & + bind(C, name='Function2dsXYs2dSetByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function2dsXYs2dSetByInterpolation + +!! ------------------------ +!! Re: metadatum interpolationQualifier +!! ------------------------ + +!! Has, by interpolationQualifier +function Function2dsXYs2dHasByInterpolationQualifier(handle, meta, metaSize) & + bind(C, name='Function2dsXYs2dHasByInterpolationQualifier') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: Function2dsXYs2dHasByInterpolationQualifier +end function Function2dsXYs2dHasByInterpolationQualifier + +!! Get, by interpolationQualifier, const +function Function2dsXYs2dGetByInterpolationQualifierConst(handle, meta, metaSize) & + bind(C, name='Function2dsXYs2dGetByInterpolationQualifierConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function2dsXYs2dGetByInterpolationQualifierConst +end function Function2dsXYs2dGetByInterpolationQualifierConst + +!! Get, by interpolationQualifier, non-const +function Function2dsXYs2dGetByInterpolationQualifier(handle, meta, metaSize) & + bind(C, name='Function2dsXYs2dGetByInterpolationQualifier') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function2dsXYs2dGetByInterpolationQualifier +end function Function2dsXYs2dGetByInterpolationQualifier + +!! Set, by interpolationQualifier +subroutine Function2dsXYs2dSetByInterpolationQualifier(handle, meta, metaSize, fieldHandle) & + bind(C, name='Function2dsXYs2dSetByInterpolationQualifier') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function2dsXYs2dSetByInterpolationQualifier + +!! ------------------------ +!! Re: metadatum outerDomainValue +!! ------------------------ + +!! Has, by outerDomainValue +function Function2dsXYs2dHasByOuterDomainValue(handle, meta) & + bind(C, name='Function2dsXYs2dHasByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: Function2dsXYs2dHasByOuterDomainValue +end function Function2dsXYs2dHasByOuterDomainValue + +!! Get, by outerDomainValue, const +function Function2dsXYs2dGetByOuterDomainValueConst(handle, meta) & + bind(C, name='Function2dsXYs2dGetByOuterDomainValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function2dsXYs2dGetByOuterDomainValueConst +end function Function2dsXYs2dGetByOuterDomainValueConst + +!! Get, by outerDomainValue, non-const +function Function2dsXYs2dGetByOuterDomainValue(handle, meta) & + bind(C, name='Function2dsXYs2dGetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function2dsXYs2dGetByOuterDomainValue +end function Function2dsXYs2dGetByOuterDomainValue + +!! Set, by outerDomainValue +subroutine Function2dsXYs2dSetByOuterDomainValue(handle, meta, fieldHandle) & + bind(C, name='Function2dsXYs2dSetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function2dsXYs2dSetByOuterDomainValue + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalFunction2ds diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/G.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/G.f03 new file mode 100644 index 000000000..b3f7e2a28 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/G.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalG +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function GDefaultConst() & + bind(C, name='GDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: GDefaultConst +end function GDefaultConst + +!! Create, default, non-const +function GDefault() & + bind(C, name='GDefault') + use iso_c_binding + implicit none + type(c_ptr) :: GDefault +end function GDefault + +!! Create, general, const +function GCreateConst( & + XYs1d & +) & + bind(C, name='GCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: GCreateConst +end function GCreateConst + +!! Create, general, non-const +function GCreate( & + XYs1d & +) & + bind(C, name='GCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: GCreate +end function GCreate + +!! Assign +subroutine GAssign(handleLHS, handleRHS) & + bind(C, name='GAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine GAssign + +!! Delete +subroutine GDelete(handle) & + bind(C, name='GDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine GDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function GRead(handle, filename, filenameSize) & + bind(C, name='GRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GRead +end function GRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function GWrite(handle, filename, filenameSize) & + bind(C, name='GWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GWrite +end function GWrite + +!! Print to standard output, in our prettyprinting format +function GPrint(handle) & + bind(C, name='GPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GPrint +end function GPrint + +!! Print to standard output, as XML +function GPrintXML(handle) & + bind(C, name='GPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GPrintXML +end function GPrintXML + +!! Print to standard output, as JSON +function GPrintJSON(handle) & + bind(C, name='GPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GPrintJSON +end function GPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function GXYs1dHas(handle) & + bind(C, name='GXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GXYs1dHas +end function GXYs1dHas + +!! Get, const +function GXYs1dGetConst(handle) & + bind(C, name='GXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GXYs1dGetConst +end function GXYs1dGetConst + +!! Get, non-const +function GXYs1dGet(handle) & + bind(C, name='GXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: GXYs1dGet +end function GXYs1dGet + +!! Set +subroutine GXYs1dSet(handle, fieldHandle) & + bind(C, name='GXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalG diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/GaugeBoson.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/GaugeBoson.f03 new file mode 100644 index 000000000..178a23563 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/GaugeBoson.f03 @@ -0,0 +1,397 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalGaugeBoson +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function GaugeBosonDefaultConst() & + bind(C, name='GaugeBosonDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: GaugeBosonDefaultConst +end function GaugeBosonDefaultConst + +!! Create, default, non-const +function GaugeBosonDefault() & + bind(C, name='GaugeBosonDefault') + use iso_c_binding + implicit none + type(c_ptr) :: GaugeBosonDefault +end function GaugeBosonDefault + +!! Create, general, const +function GaugeBosonCreateConst( & + id, & + mass, & + spin, & + parity, & + charge, & + halflife, & + idSize & +) & + bind(C, name='GaugeBosonCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: spin + type(c_ptr), intent(in), value :: parity + type(c_ptr), intent(in), value :: charge + type(c_ptr), intent(in), value :: halflife + type(c_ptr) :: GaugeBosonCreateConst +end function GaugeBosonCreateConst + +!! Create, general, non-const +function GaugeBosonCreate( & + id, & + mass, & + spin, & + parity, & + charge, & + halflife, & + idSize & +) & + bind(C, name='GaugeBosonCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: spin + type(c_ptr), intent(in), value :: parity + type(c_ptr), intent(in), value :: charge + type(c_ptr), intent(in), value :: halflife + type(c_ptr) :: GaugeBosonCreate +end function GaugeBosonCreate + +!! Assign +subroutine GaugeBosonAssign(handleLHS, handleRHS) & + bind(C, name='GaugeBosonAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine GaugeBosonAssign + +!! Delete +subroutine GaugeBosonDelete(handle) & + bind(C, name='GaugeBosonDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine GaugeBosonDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function GaugeBosonRead(handle, filename, filenameSize) & + bind(C, name='GaugeBosonRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GaugeBosonRead +end function GaugeBosonRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function GaugeBosonWrite(handle, filename, filenameSize) & + bind(C, name='GaugeBosonWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GaugeBosonWrite +end function GaugeBosonWrite + +!! Print to standard output, in our prettyprinting format +function GaugeBosonPrint(handle) & + bind(C, name='GaugeBosonPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonPrint +end function GaugeBosonPrint + +!! Print to standard output, as XML +function GaugeBosonPrintXML(handle) & + bind(C, name='GaugeBosonPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonPrintXML +end function GaugeBosonPrintXML + +!! Print to standard output, as JSON +function GaugeBosonPrintJSON(handle) & + bind(C, name='GaugeBosonPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonPrintJSON +end function GaugeBosonPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: id +!! ----------------------------------------------------------------------------- + +!! Has +function GaugeBosonIdHas(handle) & + bind(C, name='GaugeBosonIdHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonIdHas +end function GaugeBosonIdHas + +!! Get +function GaugeBosonIdGet(handle) & + bind(C, name='GaugeBosonIdGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GaugeBosonIdGet +end function GaugeBosonIdGet + +!! Set +subroutine GaugeBosonIdSet(handle, id, idSize) & + bind(C, name='GaugeBosonIdSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) +end subroutine GaugeBosonIdSet + + +!! ----------------------------------------------------------------------------- +!! Child: mass +!! ----------------------------------------------------------------------------- + +!! Has +function GaugeBosonMassHas(handle) & + bind(C, name='GaugeBosonMassHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonMassHas +end function GaugeBosonMassHas + +!! Get, const +function GaugeBosonMassGetConst(handle) & + bind(C, name='GaugeBosonMassGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GaugeBosonMassGetConst +end function GaugeBosonMassGetConst + +!! Get, non-const +function GaugeBosonMassGet(handle) & + bind(C, name='GaugeBosonMassGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: GaugeBosonMassGet +end function GaugeBosonMassGet + +!! Set +subroutine GaugeBosonMassSet(handle, fieldHandle) & + bind(C, name='GaugeBosonMassSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GaugeBosonMassSet + + +!! ----------------------------------------------------------------------------- +!! Child: spin +!! ----------------------------------------------------------------------------- + +!! Has +function GaugeBosonSpinHas(handle) & + bind(C, name='GaugeBosonSpinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonSpinHas +end function GaugeBosonSpinHas + +!! Get, const +function GaugeBosonSpinGetConst(handle) & + bind(C, name='GaugeBosonSpinGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GaugeBosonSpinGetConst +end function GaugeBosonSpinGetConst + +!! Get, non-const +function GaugeBosonSpinGet(handle) & + bind(C, name='GaugeBosonSpinGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: GaugeBosonSpinGet +end function GaugeBosonSpinGet + +!! Set +subroutine GaugeBosonSpinSet(handle, fieldHandle) & + bind(C, name='GaugeBosonSpinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GaugeBosonSpinSet + + +!! ----------------------------------------------------------------------------- +!! Child: parity +!! ----------------------------------------------------------------------------- + +!! Has +function GaugeBosonParityHas(handle) & + bind(C, name='GaugeBosonParityHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonParityHas +end function GaugeBosonParityHas + +!! Get, const +function GaugeBosonParityGetConst(handle) & + bind(C, name='GaugeBosonParityGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GaugeBosonParityGetConst +end function GaugeBosonParityGetConst + +!! Get, non-const +function GaugeBosonParityGet(handle) & + bind(C, name='GaugeBosonParityGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: GaugeBosonParityGet +end function GaugeBosonParityGet + +!! Set +subroutine GaugeBosonParitySet(handle, fieldHandle) & + bind(C, name='GaugeBosonParitySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GaugeBosonParitySet + + +!! ----------------------------------------------------------------------------- +!! Child: charge +!! ----------------------------------------------------------------------------- + +!! Has +function GaugeBosonChargeHas(handle) & + bind(C, name='GaugeBosonChargeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonChargeHas +end function GaugeBosonChargeHas + +!! Get, const +function GaugeBosonChargeGetConst(handle) & + bind(C, name='GaugeBosonChargeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GaugeBosonChargeGetConst +end function GaugeBosonChargeGetConst + +!! Get, non-const +function GaugeBosonChargeGet(handle) & + bind(C, name='GaugeBosonChargeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: GaugeBosonChargeGet +end function GaugeBosonChargeGet + +!! Set +subroutine GaugeBosonChargeSet(handle, fieldHandle) & + bind(C, name='GaugeBosonChargeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GaugeBosonChargeSet + + +!! ----------------------------------------------------------------------------- +!! Child: halflife +!! ----------------------------------------------------------------------------- + +!! Has +function GaugeBosonHalflifeHas(handle) & + bind(C, name='GaugeBosonHalflifeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonHalflifeHas +end function GaugeBosonHalflifeHas + +!! Get, const +function GaugeBosonHalflifeGetConst(handle) & + bind(C, name='GaugeBosonHalflifeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GaugeBosonHalflifeGetConst +end function GaugeBosonHalflifeGetConst + +!! Get, non-const +function GaugeBosonHalflifeGet(handle) & + bind(C, name='GaugeBosonHalflifeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: GaugeBosonHalflifeGet +end function GaugeBosonHalflifeGet + +!! Set +subroutine GaugeBosonHalflifeSet(handle, fieldHandle) & + bind(C, name='GaugeBosonHalflifeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GaugeBosonHalflifeSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalGaugeBoson diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/GaugeBosons.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/GaugeBosons.f03 new file mode 100644 index 000000000..9220fe11d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/GaugeBosons.f03 @@ -0,0 +1,255 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalGaugeBosons +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function GaugeBosonsDefaultConst() & + bind(C, name='GaugeBosonsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: GaugeBosonsDefaultConst +end function GaugeBosonsDefaultConst + +!! Create, default, non-const +function GaugeBosonsDefault() & + bind(C, name='GaugeBosonsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: GaugeBosonsDefault +end function GaugeBosonsDefault + +!! Create, general, const +function GaugeBosonsCreateConst( & + gaugeBoson, gaugeBosonSize & +) & + bind(C, name='GaugeBosonsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: gaugeBosonSize + type(c_ptr), intent(in) :: gaugeBoson(gaugeBosonSize) + type(c_ptr) :: GaugeBosonsCreateConst +end function GaugeBosonsCreateConst + +!! Create, general, non-const +function GaugeBosonsCreate( & + gaugeBoson, gaugeBosonSize & +) & + bind(C, name='GaugeBosonsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: gaugeBosonSize + type(c_ptr), intent(in) :: gaugeBoson(gaugeBosonSize) + type(c_ptr) :: GaugeBosonsCreate +end function GaugeBosonsCreate + +!! Assign +subroutine GaugeBosonsAssign(handleLHS, handleRHS) & + bind(C, name='GaugeBosonsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine GaugeBosonsAssign + +!! Delete +subroutine GaugeBosonsDelete(handle) & + bind(C, name='GaugeBosonsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine GaugeBosonsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function GaugeBosonsRead(handle, filename, filenameSize) & + bind(C, name='GaugeBosonsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GaugeBosonsRead +end function GaugeBosonsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function GaugeBosonsWrite(handle, filename, filenameSize) & + bind(C, name='GaugeBosonsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GaugeBosonsWrite +end function GaugeBosonsWrite + +!! Print to standard output, in our prettyprinting format +function GaugeBosonsPrint(handle) & + bind(C, name='GaugeBosonsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonsPrint +end function GaugeBosonsPrint + +!! Print to standard output, as XML +function GaugeBosonsPrintXML(handle) & + bind(C, name='GaugeBosonsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonsPrintXML +end function GaugeBosonsPrintXML + +!! Print to standard output, as JSON +function GaugeBosonsPrintJSON(handle) & + bind(C, name='GaugeBosonsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonsPrintJSON +end function GaugeBosonsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: gaugeBoson +!! ----------------------------------------------------------------------------- + +!! Has +function GaugeBosonsGaugeBosonHas(handle) & + bind(C, name='GaugeBosonsGaugeBosonHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GaugeBosonsGaugeBosonHas +end function GaugeBosonsGaugeBosonHas + +!! Clear +subroutine GaugeBosonsGaugeBosonClear(handle) & + bind(C, name='GaugeBosonsGaugeBosonClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine GaugeBosonsGaugeBosonClear + +!! Size +function GaugeBosonsGaugeBosonSize(handle) & + bind(C, name='GaugeBosonsGaugeBosonSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: GaugeBosonsGaugeBosonSize +end function GaugeBosonsGaugeBosonSize + +!! Add +subroutine GaugeBosonsGaugeBosonAdd(handle, fieldHandle) & + bind(C, name='GaugeBosonsGaugeBosonAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GaugeBosonsGaugeBosonAdd + +!! Get, by index \in [0,size), const +function GaugeBosonsGaugeBosonGetConst(handle, index) & + bind(C, name='GaugeBosonsGaugeBosonGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: GaugeBosonsGaugeBosonGetConst +end function GaugeBosonsGaugeBosonGetConst + +!! Get, by index \in [0,size), non-const +function GaugeBosonsGaugeBosonGet(handle, index) & + bind(C, name='GaugeBosonsGaugeBosonGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: GaugeBosonsGaugeBosonGet +end function GaugeBosonsGaugeBosonGet + +!! Set, by index \in [0,size) +subroutine GaugeBosonsGaugeBosonSet(handle, index, fieldHandle) & + bind(C, name='GaugeBosonsGaugeBosonSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GaugeBosonsGaugeBosonSet + +!! ------------------------ +!! Re: metadatum id +!! ------------------------ + +!! Has, by id +function GaugeBosonsGaugeBosonHasById(handle, meta, metaSize) & + bind(C, name='GaugeBosonsGaugeBosonHasById') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: GaugeBosonsGaugeBosonHasById +end function GaugeBosonsGaugeBosonHasById + +!! Get, by id, const +function GaugeBosonsGaugeBosonGetByIdConst(handle, meta, metaSize) & + bind(C, name='GaugeBosonsGaugeBosonGetByIdConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: GaugeBosonsGaugeBosonGetByIdConst +end function GaugeBosonsGaugeBosonGetByIdConst + +!! Get, by id, non-const +function GaugeBosonsGaugeBosonGetById(handle, meta, metaSize) & + bind(C, name='GaugeBosonsGaugeBosonGetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: GaugeBosonsGaugeBosonGetById +end function GaugeBosonsGaugeBosonGetById + +!! Set, by id +subroutine GaugeBosonsGaugeBosonSetById(handle, meta, metaSize, fieldHandle) & + bind(C, name='GaugeBosonsGaugeBosonSetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GaugeBosonsGaugeBosonSetById + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalGaugeBosons diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/GeneralEvaporation.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/GeneralEvaporation.f03 new file mode 100644 index 000000000..ec46bd785 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/GeneralEvaporation.f03 @@ -0,0 +1,266 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalGeneralEvaporation +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function GeneralEvaporationDefaultConst() & + bind(C, name='GeneralEvaporationDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: GeneralEvaporationDefaultConst +end function GeneralEvaporationDefaultConst + +!! Create, default, non-const +function GeneralEvaporationDefault() & + bind(C, name='GeneralEvaporationDefault') + use iso_c_binding + implicit none + type(c_ptr) :: GeneralEvaporationDefault +end function GeneralEvaporationDefault + +!! Create, general, const +function GeneralEvaporationCreateConst( & + U, & + theta, & + g & +) & + bind(C, name='GeneralEvaporationCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: U + type(c_ptr), intent(in), value :: theta + type(c_ptr), intent(in), value :: g + type(c_ptr) :: GeneralEvaporationCreateConst +end function GeneralEvaporationCreateConst + +!! Create, general, non-const +function GeneralEvaporationCreate( & + U, & + theta, & + g & +) & + bind(C, name='GeneralEvaporationCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: U + type(c_ptr), intent(in), value :: theta + type(c_ptr), intent(in), value :: g + type(c_ptr) :: GeneralEvaporationCreate +end function GeneralEvaporationCreate + +!! Assign +subroutine GeneralEvaporationAssign(handleLHS, handleRHS) & + bind(C, name='GeneralEvaporationAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine GeneralEvaporationAssign + +!! Delete +subroutine GeneralEvaporationDelete(handle) & + bind(C, name='GeneralEvaporationDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine GeneralEvaporationDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function GeneralEvaporationRead(handle, filename, filenameSize) & + bind(C, name='GeneralEvaporationRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GeneralEvaporationRead +end function GeneralEvaporationRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function GeneralEvaporationWrite(handle, filename, filenameSize) & + bind(C, name='GeneralEvaporationWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GeneralEvaporationWrite +end function GeneralEvaporationWrite + +!! Print to standard output, in our prettyprinting format +function GeneralEvaporationPrint(handle) & + bind(C, name='GeneralEvaporationPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GeneralEvaporationPrint +end function GeneralEvaporationPrint + +!! Print to standard output, as XML +function GeneralEvaporationPrintXML(handle) & + bind(C, name='GeneralEvaporationPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GeneralEvaporationPrintXML +end function GeneralEvaporationPrintXML + +!! Print to standard output, as JSON +function GeneralEvaporationPrintJSON(handle) & + bind(C, name='GeneralEvaporationPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GeneralEvaporationPrintJSON +end function GeneralEvaporationPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: U +!! ----------------------------------------------------------------------------- + +!! Has +function GeneralEvaporationUHas(handle) & + bind(C, name='GeneralEvaporationUHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GeneralEvaporationUHas +end function GeneralEvaporationUHas + +!! Get, const +function GeneralEvaporationUGetConst(handle) & + bind(C, name='GeneralEvaporationUGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GeneralEvaporationUGetConst +end function GeneralEvaporationUGetConst + +!! Get, non-const +function GeneralEvaporationUGet(handle) & + bind(C, name='GeneralEvaporationUGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: GeneralEvaporationUGet +end function GeneralEvaporationUGet + +!! Set +subroutine GeneralEvaporationUSet(handle, fieldHandle) & + bind(C, name='GeneralEvaporationUSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GeneralEvaporationUSet + + +!! ----------------------------------------------------------------------------- +!! Child: theta +!! ----------------------------------------------------------------------------- + +!! Has +function GeneralEvaporationThetaHas(handle) & + bind(C, name='GeneralEvaporationThetaHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GeneralEvaporationThetaHas +end function GeneralEvaporationThetaHas + +!! Get, const +function GeneralEvaporationThetaGetConst(handle) & + bind(C, name='GeneralEvaporationThetaGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GeneralEvaporationThetaGetConst +end function GeneralEvaporationThetaGetConst + +!! Get, non-const +function GeneralEvaporationThetaGet(handle) & + bind(C, name='GeneralEvaporationThetaGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: GeneralEvaporationThetaGet +end function GeneralEvaporationThetaGet + +!! Set +subroutine GeneralEvaporationThetaSet(handle, fieldHandle) & + bind(C, name='GeneralEvaporationThetaSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GeneralEvaporationThetaSet + + +!! ----------------------------------------------------------------------------- +!! Child: g +!! ----------------------------------------------------------------------------- + +!! Has +function GeneralEvaporationGHas(handle) & + bind(C, name='GeneralEvaporationGHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GeneralEvaporationGHas +end function GeneralEvaporationGHas + +!! Get, const +function GeneralEvaporationGGetConst(handle) & + bind(C, name='GeneralEvaporationGGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GeneralEvaporationGGetConst +end function GeneralEvaporationGGetConst + +!! Get, non-const +function GeneralEvaporationGGet(handle) & + bind(C, name='GeneralEvaporationGGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: GeneralEvaporationGGet +end function GeneralEvaporationGGet + +!! Set +subroutine GeneralEvaporationGSet(handle, fieldHandle) & + bind(C, name='GeneralEvaporationGSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GeneralEvaporationGSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalGeneralEvaporation diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Grid.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Grid.f03 new file mode 100644 index 000000000..e59723e14 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Grid.f03 @@ -0,0 +1,421 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalGrid +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function GridDefaultConst() & + bind(C, name='GridDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: GridDefaultConst +end function GridDefaultConst + +!! Create, default, non-const +function GridDefault() & + bind(C, name='GridDefault') + use iso_c_binding + implicit none + type(c_ptr) :: GridDefault +end function GridDefault + +!! Create, general, const +function GridCreateConst( & + index, & + label, & + unit, & + style, & + interpolation, & + link, & + values, & + labelSize, & + unitSize, & + styleSize, & + interpolationSize & +) & + bind(C, name='GridCreateConst') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + integer(c_size_t), intent(in), value :: styleSize + character(c_char), intent(in) :: style(styleSize) + integer(c_size_t), intent(in), value :: interpolationSize + character(c_char), intent(in) :: interpolation(interpolationSize) + type(c_ptr), intent(in), value :: link + type(c_ptr), intent(in), value :: values + type(c_ptr) :: GridCreateConst +end function GridCreateConst + +!! Create, general, non-const +function GridCreate( & + index, & + label, & + unit, & + style, & + interpolation, & + link, & + values, & + labelSize, & + unitSize, & + styleSize, & + interpolationSize & +) & + bind(C, name='GridCreate') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + integer(c_size_t), intent(in), value :: styleSize + character(c_char), intent(in) :: style(styleSize) + integer(c_size_t), intent(in), value :: interpolationSize + character(c_char), intent(in) :: interpolation(interpolationSize) + type(c_ptr), intent(in), value :: link + type(c_ptr), intent(in), value :: values + type(c_ptr) :: GridCreate +end function GridCreate + +!! Assign +subroutine GridAssign(handleLHS, handleRHS) & + bind(C, name='GridAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine GridAssign + +!! Delete +subroutine GridDelete(handle) & + bind(C, name='GridDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine GridDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function GridRead(handle, filename, filenameSize) & + bind(C, name='GridRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GridRead +end function GridRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function GridWrite(handle, filename, filenameSize) & + bind(C, name='GridWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: GridWrite +end function GridWrite + +!! Print to standard output, in our prettyprinting format +function GridPrint(handle) & + bind(C, name='GridPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridPrint +end function GridPrint + +!! Print to standard output, as XML +function GridPrintXML(handle) & + bind(C, name='GridPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridPrintXML +end function GridPrintXML + +!! Print to standard output, as JSON +function GridPrintJSON(handle) & + bind(C, name='GridPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridPrintJSON +end function GridPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: index +!! ----------------------------------------------------------------------------- + +!! Has +function GridIndexHas(handle) & + bind(C, name='GridIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridIndexHas +end function GridIndexHas + +!! Get +function GridIndexGet(handle) & + bind(C, name='GridIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridIndexGet +end function GridIndexGet + +!! Set +subroutine GridIndexSet(handle, index) & + bind(C, name='GridIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: index +end subroutine GridIndexSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function GridLabelHas(handle) & + bind(C, name='GridLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridLabelHas +end function GridLabelHas + +!! Get +function GridLabelGet(handle) & + bind(C, name='GridLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GridLabelGet +end function GridLabelGet + +!! Set +subroutine GridLabelSet(handle, label, labelSize) & + bind(C, name='GridLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine GridLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function GridUnitHas(handle) & + bind(C, name='GridUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridUnitHas +end function GridUnitHas + +!! Get +function GridUnitGet(handle) & + bind(C, name='GridUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GridUnitGet +end function GridUnitGet + +!! Set +subroutine GridUnitSet(handle, unit, unitSize) & + bind(C, name='GridUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine GridUnitSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: style +!! ----------------------------------------------------------------------------- + +!! Has +function GridStyleHas(handle) & + bind(C, name='GridStyleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridStyleHas +end function GridStyleHas + +!! Get +function GridStyleGet(handle) & + bind(C, name='GridStyleGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GridStyleGet +end function GridStyleGet + +!! Set +subroutine GridStyleSet(handle, style, styleSize) & + bind(C, name='GridStyleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: styleSize + character(c_char), intent(in) :: style(styleSize) +end subroutine GridStyleSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: interpolation +!! ----------------------------------------------------------------------------- + +!! Has +function GridInterpolationHas(handle) & + bind(C, name='GridInterpolationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridInterpolationHas +end function GridInterpolationHas + +!! Get +function GridInterpolationGet(handle) & + bind(C, name='GridInterpolationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GridInterpolationGet +end function GridInterpolationGet + +!! Set +subroutine GridInterpolationSet(handle, interpolation, interpolationSize) & + bind(C, name='GridInterpolationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: interpolationSize + character(c_char), intent(in) :: interpolation(interpolationSize) +end subroutine GridInterpolationSet + + +!! ----------------------------------------------------------------------------- +!! Child: link +!! ----------------------------------------------------------------------------- + +!! Has +function GridLinkHas(handle) & + bind(C, name='GridLinkHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridLinkHas +end function GridLinkHas + +!! Get, const +function GridLinkGetConst(handle) & + bind(C, name='GridLinkGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GridLinkGetConst +end function GridLinkGetConst + +!! Get, non-const +function GridLinkGet(handle) & + bind(C, name='GridLinkGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: GridLinkGet +end function GridLinkGet + +!! Set +subroutine GridLinkSet(handle, fieldHandle) & + bind(C, name='GridLinkSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GridLinkSet + + +!! ----------------------------------------------------------------------------- +!! Child: values +!! ----------------------------------------------------------------------------- + +!! Has +function GridValuesHas(handle) & + bind(C, name='GridValuesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: GridValuesHas +end function GridValuesHas + +!! Get, const +function GridValuesGetConst(handle) & + bind(C, name='GridValuesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: GridValuesGetConst +end function GridValuesGetConst + +!! Get, non-const +function GridValuesGet(handle) & + bind(C, name='GridValuesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: GridValuesGet +end function GridValuesGet + +!! Set +subroutine GridValuesSet(handle, fieldHandle) & + bind(C, name='GridValuesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine GridValuesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalGrid diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Gridded2d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Gridded2d.f03 new file mode 100644 index 000000000..fd603b8e2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Gridded2d.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalGridded2d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Gridded2dDefaultConst() & + bind(C, name='Gridded2dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Gridded2dDefaultConst +end function Gridded2dDefaultConst + +!! Create, default, non-const +function Gridded2dDefault() & + bind(C, name='Gridded2dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Gridded2dDefault +end function Gridded2dDefault + +!! Create, general, const +function Gridded2dCreateConst( & + axes, & + array & +) & + bind(C, name='Gridded2dCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: array + type(c_ptr) :: Gridded2dCreateConst +end function Gridded2dCreateConst + +!! Create, general, non-const +function Gridded2dCreate( & + axes, & + array & +) & + bind(C, name='Gridded2dCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: array + type(c_ptr) :: Gridded2dCreate +end function Gridded2dCreate + +!! Assign +subroutine Gridded2dAssign(handleLHS, handleRHS) & + bind(C, name='Gridded2dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Gridded2dAssign + +!! Delete +subroutine Gridded2dDelete(handle) & + bind(C, name='Gridded2dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Gridded2dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Gridded2dRead(handle, filename, filenameSize) & + bind(C, name='Gridded2dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Gridded2dRead +end function Gridded2dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Gridded2dWrite(handle, filename, filenameSize) & + bind(C, name='Gridded2dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Gridded2dWrite +end function Gridded2dWrite + +!! Print to standard output, in our prettyprinting format +function Gridded2dPrint(handle) & + bind(C, name='Gridded2dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Gridded2dPrint +end function Gridded2dPrint + +!! Print to standard output, as XML +function Gridded2dPrintXML(handle) & + bind(C, name='Gridded2dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Gridded2dPrintXML +end function Gridded2dPrintXML + +!! Print to standard output, as JSON +function Gridded2dPrintJSON(handle) & + bind(C, name='Gridded2dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Gridded2dPrintJSON +end function Gridded2dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function Gridded2dAxesHas(handle) & + bind(C, name='Gridded2dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Gridded2dAxesHas +end function Gridded2dAxesHas + +!! Get, const +function Gridded2dAxesGetConst(handle) & + bind(C, name='Gridded2dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Gridded2dAxesGetConst +end function Gridded2dAxesGetConst + +!! Get, non-const +function Gridded2dAxesGet(handle) & + bind(C, name='Gridded2dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Gridded2dAxesGet +end function Gridded2dAxesGet + +!! Set +subroutine Gridded2dAxesSet(handle, fieldHandle) & + bind(C, name='Gridded2dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Gridded2dAxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: array +!! ----------------------------------------------------------------------------- + +!! Has +function Gridded2dArrayHas(handle) & + bind(C, name='Gridded2dArrayHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Gridded2dArrayHas +end function Gridded2dArrayHas + +!! Get, const +function Gridded2dArrayGetConst(handle) & + bind(C, name='Gridded2dArrayGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Gridded2dArrayGetConst +end function Gridded2dArrayGetConst + +!! Get, non-const +function Gridded2dArrayGet(handle) & + bind(C, name='Gridded2dArrayGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Gridded2dArrayGet +end function Gridded2dArrayGet + +!! Set +subroutine Gridded2dArraySet(handle, fieldHandle) & + bind(C, name='Gridded2dArraySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Gridded2dArraySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalGridded2d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Gridded3d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Gridded3d.f03 new file mode 100644 index 000000000..c7515174f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Gridded3d.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalGridded3d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Gridded3dDefaultConst() & + bind(C, name='Gridded3dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Gridded3dDefaultConst +end function Gridded3dDefaultConst + +!! Create, default, non-const +function Gridded3dDefault() & + bind(C, name='Gridded3dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Gridded3dDefault +end function Gridded3dDefault + +!! Create, general, const +function Gridded3dCreateConst( & + axes, & + array & +) & + bind(C, name='Gridded3dCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: array + type(c_ptr) :: Gridded3dCreateConst +end function Gridded3dCreateConst + +!! Create, general, non-const +function Gridded3dCreate( & + axes, & + array & +) & + bind(C, name='Gridded3dCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: array + type(c_ptr) :: Gridded3dCreate +end function Gridded3dCreate + +!! Assign +subroutine Gridded3dAssign(handleLHS, handleRHS) & + bind(C, name='Gridded3dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Gridded3dAssign + +!! Delete +subroutine Gridded3dDelete(handle) & + bind(C, name='Gridded3dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Gridded3dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Gridded3dRead(handle, filename, filenameSize) & + bind(C, name='Gridded3dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Gridded3dRead +end function Gridded3dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Gridded3dWrite(handle, filename, filenameSize) & + bind(C, name='Gridded3dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Gridded3dWrite +end function Gridded3dWrite + +!! Print to standard output, in our prettyprinting format +function Gridded3dPrint(handle) & + bind(C, name='Gridded3dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Gridded3dPrint +end function Gridded3dPrint + +!! Print to standard output, as XML +function Gridded3dPrintXML(handle) & + bind(C, name='Gridded3dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Gridded3dPrintXML +end function Gridded3dPrintXML + +!! Print to standard output, as JSON +function Gridded3dPrintJSON(handle) & + bind(C, name='Gridded3dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Gridded3dPrintJSON +end function Gridded3dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function Gridded3dAxesHas(handle) & + bind(C, name='Gridded3dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Gridded3dAxesHas +end function Gridded3dAxesHas + +!! Get, const +function Gridded3dAxesGetConst(handle) & + bind(C, name='Gridded3dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Gridded3dAxesGetConst +end function Gridded3dAxesGetConst + +!! Get, non-const +function Gridded3dAxesGet(handle) & + bind(C, name='Gridded3dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Gridded3dAxesGet +end function Gridded3dAxesGet + +!! Set +subroutine Gridded3dAxesSet(handle, fieldHandle) & + bind(C, name='Gridded3dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Gridded3dAxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: array +!! ----------------------------------------------------------------------------- + +!! Has +function Gridded3dArrayHas(handle) & + bind(C, name='Gridded3dArrayHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Gridded3dArrayHas +end function Gridded3dArrayHas + +!! Get, const +function Gridded3dArrayGetConst(handle) & + bind(C, name='Gridded3dArrayGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Gridded3dArrayGetConst +end function Gridded3dArrayGetConst + +!! Get, non-const +function Gridded3dArrayGet(handle) & + bind(C, name='Gridded3dArrayGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Gridded3dArrayGet +end function Gridded3dArrayGet + +!! Set +subroutine Gridded3dArraySet(handle, fieldHandle) & + bind(C, name='Gridded3dArraySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Gridded3dArraySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalGridded3d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Halflife.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Halflife.f03 new file mode 100644 index 000000000..9b347e4f0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Halflife.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalHalflife +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function HalflifeDefaultConst() & + bind(C, name='HalflifeDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: HalflifeDefaultConst +end function HalflifeDefaultConst + +!! Create, default, non-const +function HalflifeDefault() & + bind(C, name='HalflifeDefault') + use iso_c_binding + implicit none + type(c_ptr) :: HalflifeDefault +end function HalflifeDefault + +!! Create, general, const +function HalflifeCreateConst( & + string, & + Double & +) & + bind(C, name='HalflifeCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: string + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: HalflifeCreateConst +end function HalflifeCreateConst + +!! Create, general, non-const +function HalflifeCreate( & + string, & + Double & +) & + bind(C, name='HalflifeCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: string + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: HalflifeCreate +end function HalflifeCreate + +!! Assign +subroutine HalflifeAssign(handleLHS, handleRHS) & + bind(C, name='HalflifeAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine HalflifeAssign + +!! Delete +subroutine HalflifeDelete(handle) & + bind(C, name='HalflifeDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine HalflifeDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function HalflifeRead(handle, filename, filenameSize) & + bind(C, name='HalflifeRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: HalflifeRead +end function HalflifeRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function HalflifeWrite(handle, filename, filenameSize) & + bind(C, name='HalflifeWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: HalflifeWrite +end function HalflifeWrite + +!! Print to standard output, in our prettyprinting format +function HalflifePrint(handle) & + bind(C, name='HalflifePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: HalflifePrint +end function HalflifePrint + +!! Print to standard output, as XML +function HalflifePrintXML(handle) & + bind(C, name='HalflifePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: HalflifePrintXML +end function HalflifePrintXML + +!! Print to standard output, as JSON +function HalflifePrintJSON(handle) & + bind(C, name='HalflifePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: HalflifePrintJSON +end function HalflifePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: string +!! ----------------------------------------------------------------------------- + +!! Has +function HalflifeStringHas(handle) & + bind(C, name='HalflifeStringHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: HalflifeStringHas +end function HalflifeStringHas + +!! Get, const +function HalflifeStringGetConst(handle) & + bind(C, name='HalflifeStringGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: HalflifeStringGetConst +end function HalflifeStringGetConst + +!! Get, non-const +function HalflifeStringGet(handle) & + bind(C, name='HalflifeStringGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: HalflifeStringGet +end function HalflifeStringGet + +!! Set +subroutine HalflifeStringSet(handle, fieldHandle) & + bind(C, name='HalflifeStringSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine HalflifeStringSet + + +!! ----------------------------------------------------------------------------- +!! Child: Double +!! ----------------------------------------------------------------------------- + +!! Has +function HalflifeDoubleHas(handle) & + bind(C, name='HalflifeDoubleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: HalflifeDoubleHas +end function HalflifeDoubleHas + +!! Get, const +function HalflifeDoubleGetConst(handle) & + bind(C, name='HalflifeDoubleGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: HalflifeDoubleGetConst +end function HalflifeDoubleGetConst + +!! Get, non-const +function HalflifeDoubleGet(handle) & + bind(C, name='HalflifeDoubleGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: HalflifeDoubleGet +end function HalflifeDoubleGet + +!! Set +subroutine HalflifeDoubleSet(handle, fieldHandle) & + bind(C, name='HalflifeDoubleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine HalflifeDoubleSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalHalflife diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/HardSphereRadius.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/HardSphereRadius.f03 new file mode 100644 index 000000000..72e8c29ce --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/HardSphereRadius.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalHardSphereRadius +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function HardSphereRadiusDefaultConst() & + bind(C, name='HardSphereRadiusDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: HardSphereRadiusDefaultConst +end function HardSphereRadiusDefaultConst + +!! Create, default, non-const +function HardSphereRadiusDefault() & + bind(C, name='HardSphereRadiusDefault') + use iso_c_binding + implicit none + type(c_ptr) :: HardSphereRadiusDefault +end function HardSphereRadiusDefault + +!! Create, general, const +function HardSphereRadiusCreateConst( & + constant1d & +) & + bind(C, name='HardSphereRadiusCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: constant1d + type(c_ptr) :: HardSphereRadiusCreateConst +end function HardSphereRadiusCreateConst + +!! Create, general, non-const +function HardSphereRadiusCreate( & + constant1d & +) & + bind(C, name='HardSphereRadiusCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: constant1d + type(c_ptr) :: HardSphereRadiusCreate +end function HardSphereRadiusCreate + +!! Assign +subroutine HardSphereRadiusAssign(handleLHS, handleRHS) & + bind(C, name='HardSphereRadiusAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine HardSphereRadiusAssign + +!! Delete +subroutine HardSphereRadiusDelete(handle) & + bind(C, name='HardSphereRadiusDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine HardSphereRadiusDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function HardSphereRadiusRead(handle, filename, filenameSize) & + bind(C, name='HardSphereRadiusRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: HardSphereRadiusRead +end function HardSphereRadiusRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function HardSphereRadiusWrite(handle, filename, filenameSize) & + bind(C, name='HardSphereRadiusWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: HardSphereRadiusWrite +end function HardSphereRadiusWrite + +!! Print to standard output, in our prettyprinting format +function HardSphereRadiusPrint(handle) & + bind(C, name='HardSphereRadiusPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: HardSphereRadiusPrint +end function HardSphereRadiusPrint + +!! Print to standard output, as XML +function HardSphereRadiusPrintXML(handle) & + bind(C, name='HardSphereRadiusPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: HardSphereRadiusPrintXML +end function HardSphereRadiusPrintXML + +!! Print to standard output, as JSON +function HardSphereRadiusPrintJSON(handle) & + bind(C, name='HardSphereRadiusPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: HardSphereRadiusPrintJSON +end function HardSphereRadiusPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: constant1d +!! ----------------------------------------------------------------------------- + +!! Has +function HardSphereRadiusConstant1dHas(handle) & + bind(C, name='HardSphereRadiusConstant1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: HardSphereRadiusConstant1dHas +end function HardSphereRadiusConstant1dHas + +!! Get, const +function HardSphereRadiusConstant1dGetConst(handle) & + bind(C, name='HardSphereRadiusConstant1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: HardSphereRadiusConstant1dGetConst +end function HardSphereRadiusConstant1dGetConst + +!! Get, non-const +function HardSphereRadiusConstant1dGet(handle) & + bind(C, name='HardSphereRadiusConstant1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: HardSphereRadiusConstant1dGet +end function HardSphereRadiusConstant1dGet + +!! Set +subroutine HardSphereRadiusConstant1dSet(handle, fieldHandle) & + bind(C, name='HardSphereRadiusConstant1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine HardSphereRadiusConstant1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalHardSphereRadius diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ImaginaryAnomalousFactor.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ImaginaryAnomalousFactor.f03 new file mode 100644 index 000000000..b4affdc25 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ImaginaryAnomalousFactor.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalImaginaryAnomalousFactor +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ImaginaryAnomalousFactorDefaultConst() & + bind(C, name='ImaginaryAnomalousFactorDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ImaginaryAnomalousFactorDefaultConst +end function ImaginaryAnomalousFactorDefaultConst + +!! Create, default, non-const +function ImaginaryAnomalousFactorDefault() & + bind(C, name='ImaginaryAnomalousFactorDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ImaginaryAnomalousFactorDefault +end function ImaginaryAnomalousFactorDefault + +!! Create, general, const +function ImaginaryAnomalousFactorCreateConst( & + XYs1d & +) & + bind(C, name='ImaginaryAnomalousFactorCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: ImaginaryAnomalousFactorCreateConst +end function ImaginaryAnomalousFactorCreateConst + +!! Create, general, non-const +function ImaginaryAnomalousFactorCreate( & + XYs1d & +) & + bind(C, name='ImaginaryAnomalousFactorCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: ImaginaryAnomalousFactorCreate +end function ImaginaryAnomalousFactorCreate + +!! Assign +subroutine ImaginaryAnomalousFactorAssign(handleLHS, handleRHS) & + bind(C, name='ImaginaryAnomalousFactorAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ImaginaryAnomalousFactorAssign + +!! Delete +subroutine ImaginaryAnomalousFactorDelete(handle) & + bind(C, name='ImaginaryAnomalousFactorDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ImaginaryAnomalousFactorDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ImaginaryAnomalousFactorRead(handle, filename, filenameSize) & + bind(C, name='ImaginaryAnomalousFactorRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ImaginaryAnomalousFactorRead +end function ImaginaryAnomalousFactorRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ImaginaryAnomalousFactorWrite(handle, filename, filenameSize) & + bind(C, name='ImaginaryAnomalousFactorWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ImaginaryAnomalousFactorWrite +end function ImaginaryAnomalousFactorWrite + +!! Print to standard output, in our prettyprinting format +function ImaginaryAnomalousFactorPrint(handle) & + bind(C, name='ImaginaryAnomalousFactorPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ImaginaryAnomalousFactorPrint +end function ImaginaryAnomalousFactorPrint + +!! Print to standard output, as XML +function ImaginaryAnomalousFactorPrintXML(handle) & + bind(C, name='ImaginaryAnomalousFactorPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ImaginaryAnomalousFactorPrintXML +end function ImaginaryAnomalousFactorPrintXML + +!! Print to standard output, as JSON +function ImaginaryAnomalousFactorPrintJSON(handle) & + bind(C, name='ImaginaryAnomalousFactorPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ImaginaryAnomalousFactorPrintJSON +end function ImaginaryAnomalousFactorPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function ImaginaryAnomalousFactorXYs1dHas(handle) & + bind(C, name='ImaginaryAnomalousFactorXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ImaginaryAnomalousFactorXYs1dHas +end function ImaginaryAnomalousFactorXYs1dHas + +!! Get, const +function ImaginaryAnomalousFactorXYs1dGetConst(handle) & + bind(C, name='ImaginaryAnomalousFactorXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ImaginaryAnomalousFactorXYs1dGetConst +end function ImaginaryAnomalousFactorXYs1dGetConst + +!! Get, non-const +function ImaginaryAnomalousFactorXYs1dGet(handle) & + bind(C, name='ImaginaryAnomalousFactorXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ImaginaryAnomalousFactorXYs1dGet +end function ImaginaryAnomalousFactorXYs1dGet + +!! Set +subroutine ImaginaryAnomalousFactorXYs1dSet(handle, fieldHandle) & + bind(C, name='ImaginaryAnomalousFactorXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ImaginaryAnomalousFactorXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalImaginaryAnomalousFactor diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ImaginaryInterferenceTerm.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ImaginaryInterferenceTerm.f03 new file mode 100644 index 000000000..cf2f82a8c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ImaginaryInterferenceTerm.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalImaginaryInterferenceTerm +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ImaginaryInterferenceTermDefaultConst() & + bind(C, name='ImaginaryInterferenceTermDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ImaginaryInterferenceTermDefaultConst +end function ImaginaryInterferenceTermDefaultConst + +!! Create, default, non-const +function ImaginaryInterferenceTermDefault() & + bind(C, name='ImaginaryInterferenceTermDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ImaginaryInterferenceTermDefault +end function ImaginaryInterferenceTermDefault + +!! Create, general, const +function ImaginaryInterferenceTermCreateConst( & + regions2d, & + XYs2d & +) & + bind(C, name='ImaginaryInterferenceTermCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: regions2d + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: ImaginaryInterferenceTermCreateConst +end function ImaginaryInterferenceTermCreateConst + +!! Create, general, non-const +function ImaginaryInterferenceTermCreate( & + regions2d, & + XYs2d & +) & + bind(C, name='ImaginaryInterferenceTermCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: regions2d + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: ImaginaryInterferenceTermCreate +end function ImaginaryInterferenceTermCreate + +!! Assign +subroutine ImaginaryInterferenceTermAssign(handleLHS, handleRHS) & + bind(C, name='ImaginaryInterferenceTermAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ImaginaryInterferenceTermAssign + +!! Delete +subroutine ImaginaryInterferenceTermDelete(handle) & + bind(C, name='ImaginaryInterferenceTermDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ImaginaryInterferenceTermDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ImaginaryInterferenceTermRead(handle, filename, filenameSize) & + bind(C, name='ImaginaryInterferenceTermRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ImaginaryInterferenceTermRead +end function ImaginaryInterferenceTermRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ImaginaryInterferenceTermWrite(handle, filename, filenameSize) & + bind(C, name='ImaginaryInterferenceTermWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ImaginaryInterferenceTermWrite +end function ImaginaryInterferenceTermWrite + +!! Print to standard output, in our prettyprinting format +function ImaginaryInterferenceTermPrint(handle) & + bind(C, name='ImaginaryInterferenceTermPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ImaginaryInterferenceTermPrint +end function ImaginaryInterferenceTermPrint + +!! Print to standard output, as XML +function ImaginaryInterferenceTermPrintXML(handle) & + bind(C, name='ImaginaryInterferenceTermPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ImaginaryInterferenceTermPrintXML +end function ImaginaryInterferenceTermPrintXML + +!! Print to standard output, as JSON +function ImaginaryInterferenceTermPrintJSON(handle) & + bind(C, name='ImaginaryInterferenceTermPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ImaginaryInterferenceTermPrintJSON +end function ImaginaryInterferenceTermPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: regions2d +!! ----------------------------------------------------------------------------- + +!! Has +function ImaginaryInterferenceTermRegions2dHas(handle) & + bind(C, name='ImaginaryInterferenceTermRegions2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ImaginaryInterferenceTermRegions2dHas +end function ImaginaryInterferenceTermRegions2dHas + +!! Get, const +function ImaginaryInterferenceTermRegions2dGetConst(handle) & + bind(C, name='ImaginaryInterferenceTermRegions2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ImaginaryInterferenceTermRegions2dGetConst +end function ImaginaryInterferenceTermRegions2dGetConst + +!! Get, non-const +function ImaginaryInterferenceTermRegions2dGet(handle) & + bind(C, name='ImaginaryInterferenceTermRegions2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ImaginaryInterferenceTermRegions2dGet +end function ImaginaryInterferenceTermRegions2dGet + +!! Set +subroutine ImaginaryInterferenceTermRegions2dSet(handle, fieldHandle) & + bind(C, name='ImaginaryInterferenceTermRegions2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ImaginaryInterferenceTermRegions2dSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs2d +!! ----------------------------------------------------------------------------- + +!! Has +function ImaginaryInterferenceTermXYs2dHas(handle) & + bind(C, name='ImaginaryInterferenceTermXYs2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ImaginaryInterferenceTermXYs2dHas +end function ImaginaryInterferenceTermXYs2dHas + +!! Get, const +function ImaginaryInterferenceTermXYs2dGetConst(handle) & + bind(C, name='ImaginaryInterferenceTermXYs2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ImaginaryInterferenceTermXYs2dGetConst +end function ImaginaryInterferenceTermXYs2dGetConst + +!! Get, non-const +function ImaginaryInterferenceTermXYs2dGet(handle) & + bind(C, name='ImaginaryInterferenceTermXYs2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ImaginaryInterferenceTermXYs2dGet +end function ImaginaryInterferenceTermXYs2dGet + +!! Set +subroutine ImaginaryInterferenceTermXYs2dSet(handle, fieldHandle) & + bind(C, name='ImaginaryInterferenceTermXYs2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ImaginaryInterferenceTermXYs2dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalImaginaryInterferenceTerm diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncidentEnergies.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncidentEnergies.f03 new file mode 100644 index 000000000..c492eb5d2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncidentEnergies.f03 @@ -0,0 +1,255 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalIncidentEnergies +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function IncidentEnergiesDefaultConst() & + bind(C, name='IncidentEnergiesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: IncidentEnergiesDefaultConst +end function IncidentEnergiesDefaultConst + +!! Create, default, non-const +function IncidentEnergiesDefault() & + bind(C, name='IncidentEnergiesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: IncidentEnergiesDefault +end function IncidentEnergiesDefault + +!! Create, general, const +function IncidentEnergiesCreateConst( & + incidentEnergy, incidentEnergySize & +) & + bind(C, name='IncidentEnergiesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: incidentEnergySize + type(c_ptr), intent(in) :: incidentEnergy(incidentEnergySize) + type(c_ptr) :: IncidentEnergiesCreateConst +end function IncidentEnergiesCreateConst + +!! Create, general, non-const +function IncidentEnergiesCreate( & + incidentEnergy, incidentEnergySize & +) & + bind(C, name='IncidentEnergiesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: incidentEnergySize + type(c_ptr), intent(in) :: incidentEnergy(incidentEnergySize) + type(c_ptr) :: IncidentEnergiesCreate +end function IncidentEnergiesCreate + +!! Assign +subroutine IncidentEnergiesAssign(handleLHS, handleRHS) & + bind(C, name='IncidentEnergiesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine IncidentEnergiesAssign + +!! Delete +subroutine IncidentEnergiesDelete(handle) & + bind(C, name='IncidentEnergiesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine IncidentEnergiesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function IncidentEnergiesRead(handle, filename, filenameSize) & + bind(C, name='IncidentEnergiesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IncidentEnergiesRead +end function IncidentEnergiesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function IncidentEnergiesWrite(handle, filename, filenameSize) & + bind(C, name='IncidentEnergiesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IncidentEnergiesWrite +end function IncidentEnergiesWrite + +!! Print to standard output, in our prettyprinting format +function IncidentEnergiesPrint(handle) & + bind(C, name='IncidentEnergiesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncidentEnergiesPrint +end function IncidentEnergiesPrint + +!! Print to standard output, as XML +function IncidentEnergiesPrintXML(handle) & + bind(C, name='IncidentEnergiesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncidentEnergiesPrintXML +end function IncidentEnergiesPrintXML + +!! Print to standard output, as JSON +function IncidentEnergiesPrintJSON(handle) & + bind(C, name='IncidentEnergiesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncidentEnergiesPrintJSON +end function IncidentEnergiesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: incidentEnergy +!! ----------------------------------------------------------------------------- + +!! Has +function IncidentEnergiesIncidentEnergyHas(handle) & + bind(C, name='IncidentEnergiesIncidentEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncidentEnergiesIncidentEnergyHas +end function IncidentEnergiesIncidentEnergyHas + +!! Clear +subroutine IncidentEnergiesIncidentEnergyClear(handle) & + bind(C, name='IncidentEnergiesIncidentEnergyClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine IncidentEnergiesIncidentEnergyClear + +!! Size +function IncidentEnergiesIncidentEnergySize(handle) & + bind(C, name='IncidentEnergiesIncidentEnergySize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: IncidentEnergiesIncidentEnergySize +end function IncidentEnergiesIncidentEnergySize + +!! Add +subroutine IncidentEnergiesIncidentEnergyAdd(handle, fieldHandle) & + bind(C, name='IncidentEnergiesIncidentEnergyAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IncidentEnergiesIncidentEnergyAdd + +!! Get, by index \in [0,size), const +function IncidentEnergiesIncidentEnergyGetConst(handle, index) & + bind(C, name='IncidentEnergiesIncidentEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: IncidentEnergiesIncidentEnergyGetConst +end function IncidentEnergiesIncidentEnergyGetConst + +!! Get, by index \in [0,size), non-const +function IncidentEnergiesIncidentEnergyGet(handle, index) & + bind(C, name='IncidentEnergiesIncidentEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: IncidentEnergiesIncidentEnergyGet +end function IncidentEnergiesIncidentEnergyGet + +!! Set, by index \in [0,size) +subroutine IncidentEnergiesIncidentEnergySet(handle, index, fieldHandle) & + bind(C, name='IncidentEnergiesIncidentEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IncidentEnergiesIncidentEnergySet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function IncidentEnergiesIncidentEnergyHasByLabel(handle, meta, metaSize) & + bind(C, name='IncidentEnergiesIncidentEnergyHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: IncidentEnergiesIncidentEnergyHasByLabel +end function IncidentEnergiesIncidentEnergyHasByLabel + +!! Get, by label, const +function IncidentEnergiesIncidentEnergyGetByLabelConst(handle, meta, metaSize) & + bind(C, name='IncidentEnergiesIncidentEnergyGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: IncidentEnergiesIncidentEnergyGetByLabelConst +end function IncidentEnergiesIncidentEnergyGetByLabelConst + +!! Get, by label, non-const +function IncidentEnergiesIncidentEnergyGetByLabel(handle, meta, metaSize) & + bind(C, name='IncidentEnergiesIncidentEnergyGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: IncidentEnergiesIncidentEnergyGetByLabel +end function IncidentEnergiesIncidentEnergyGetByLabel + +!! Set, by label +subroutine IncidentEnergiesIncidentEnergySetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='IncidentEnergiesIncidentEnergySetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IncidentEnergiesIncidentEnergySetByLabel + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalIncidentEnergies diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncidentEnergy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncidentEnergy.f03 new file mode 100644 index 000000000..de8dcd030 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncidentEnergy.f03 @@ -0,0 +1,262 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalIncidentEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function IncidentEnergyDefaultConst() & + bind(C, name='IncidentEnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: IncidentEnergyDefaultConst +end function IncidentEnergyDefaultConst + +!! Create, default, non-const +function IncidentEnergyDefault() & + bind(C, name='IncidentEnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: IncidentEnergyDefault +end function IncidentEnergyDefault + +!! Create, general, const +function IncidentEnergyCreateConst( & + label, & + energy, & + yields, & + labelSize & +) & + bind(C, name='IncidentEnergyCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: energy + type(c_ptr), intent(in), value :: yields + type(c_ptr) :: IncidentEnergyCreateConst +end function IncidentEnergyCreateConst + +!! Create, general, non-const +function IncidentEnergyCreate( & + label, & + energy, & + yields, & + labelSize & +) & + bind(C, name='IncidentEnergyCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: energy + type(c_ptr), intent(in), value :: yields + type(c_ptr) :: IncidentEnergyCreate +end function IncidentEnergyCreate + +!! Assign +subroutine IncidentEnergyAssign(handleLHS, handleRHS) & + bind(C, name='IncidentEnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine IncidentEnergyAssign + +!! Delete +subroutine IncidentEnergyDelete(handle) & + bind(C, name='IncidentEnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine IncidentEnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function IncidentEnergyRead(handle, filename, filenameSize) & + bind(C, name='IncidentEnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IncidentEnergyRead +end function IncidentEnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function IncidentEnergyWrite(handle, filename, filenameSize) & + bind(C, name='IncidentEnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IncidentEnergyWrite +end function IncidentEnergyWrite + +!! Print to standard output, in our prettyprinting format +function IncidentEnergyPrint(handle) & + bind(C, name='IncidentEnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncidentEnergyPrint +end function IncidentEnergyPrint + +!! Print to standard output, as XML +function IncidentEnergyPrintXML(handle) & + bind(C, name='IncidentEnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncidentEnergyPrintXML +end function IncidentEnergyPrintXML + +!! Print to standard output, as JSON +function IncidentEnergyPrintJSON(handle) & + bind(C, name='IncidentEnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncidentEnergyPrintJSON +end function IncidentEnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function IncidentEnergyLabelHas(handle) & + bind(C, name='IncidentEnergyLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncidentEnergyLabelHas +end function IncidentEnergyLabelHas + +!! Get +function IncidentEnergyLabelGet(handle) & + bind(C, name='IncidentEnergyLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IncidentEnergyLabelGet +end function IncidentEnergyLabelGet + +!! Set +subroutine IncidentEnergyLabelSet(handle, label, labelSize) & + bind(C, name='IncidentEnergyLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine IncidentEnergyLabelSet + + +!! ----------------------------------------------------------------------------- +!! Child: energy +!! ----------------------------------------------------------------------------- + +!! Has +function IncidentEnergyEnergyHas(handle) & + bind(C, name='IncidentEnergyEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncidentEnergyEnergyHas +end function IncidentEnergyEnergyHas + +!! Get, const +function IncidentEnergyEnergyGetConst(handle) & + bind(C, name='IncidentEnergyEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IncidentEnergyEnergyGetConst +end function IncidentEnergyEnergyGetConst + +!! Get, non-const +function IncidentEnergyEnergyGet(handle) & + bind(C, name='IncidentEnergyEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: IncidentEnergyEnergyGet +end function IncidentEnergyEnergyGet + +!! Set +subroutine IncidentEnergyEnergySet(handle, fieldHandle) & + bind(C, name='IncidentEnergyEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IncidentEnergyEnergySet + + +!! ----------------------------------------------------------------------------- +!! Child: yields +!! ----------------------------------------------------------------------------- + +!! Has +function IncidentEnergyYieldsHas(handle) & + bind(C, name='IncidentEnergyYieldsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncidentEnergyYieldsHas +end function IncidentEnergyYieldsHas + +!! Get, const +function IncidentEnergyYieldsGetConst(handle) & + bind(C, name='IncidentEnergyYieldsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IncidentEnergyYieldsGetConst +end function IncidentEnergyYieldsGetConst + +!! Get, non-const +function IncidentEnergyYieldsGet(handle) & + bind(C, name='IncidentEnergyYieldsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: IncidentEnergyYieldsGet +end function IncidentEnergyYieldsGet + +!! Set +subroutine IncidentEnergyYieldsSet(handle, fieldHandle) & + bind(C, name='IncidentEnergyYieldsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IncidentEnergyYieldsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalIncidentEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncoherentPhotonScattering.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncoherentPhotonScattering.f03 new file mode 100644 index 000000000..0b1bdf24d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncoherentPhotonScattering.f03 @@ -0,0 +1,340 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalIncoherentPhotonScattering +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function IncoherentPhotonScatteringDefaultConst() & + bind(C, name='IncoherentPhotonScatteringDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: IncoherentPhotonScatteringDefaultConst +end function IncoherentPhotonScatteringDefaultConst + +!! Create, default, non-const +function IncoherentPhotonScatteringDefault() & + bind(C, name='IncoherentPhotonScatteringDefault') + use iso_c_binding + implicit none + type(c_ptr) :: IncoherentPhotonScatteringDefault +end function IncoherentPhotonScatteringDefault + +!! Create, general, const +function IncoherentPhotonScatteringCreateConst( & + label, & + href, & + pid, & + productFrame, & + scatteringFactor, & + labelSize, & + hrefSize, & + pidSize, & + productFrameSize & +) & + bind(C, name='IncoherentPhotonScatteringCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: scatteringFactor + type(c_ptr) :: IncoherentPhotonScatteringCreateConst +end function IncoherentPhotonScatteringCreateConst + +!! Create, general, non-const +function IncoherentPhotonScatteringCreate( & + label, & + href, & + pid, & + productFrame, & + scatteringFactor, & + labelSize, & + hrefSize, & + pidSize, & + productFrameSize & +) & + bind(C, name='IncoherentPhotonScatteringCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: scatteringFactor + type(c_ptr) :: IncoherentPhotonScatteringCreate +end function IncoherentPhotonScatteringCreate + +!! Assign +subroutine IncoherentPhotonScatteringAssign(handleLHS, handleRHS) & + bind(C, name='IncoherentPhotonScatteringAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine IncoherentPhotonScatteringAssign + +!! Delete +subroutine IncoherentPhotonScatteringDelete(handle) & + bind(C, name='IncoherentPhotonScatteringDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine IncoherentPhotonScatteringDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function IncoherentPhotonScatteringRead(handle, filename, filenameSize) & + bind(C, name='IncoherentPhotonScatteringRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IncoherentPhotonScatteringRead +end function IncoherentPhotonScatteringRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function IncoherentPhotonScatteringWrite(handle, filename, filenameSize) & + bind(C, name='IncoherentPhotonScatteringWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IncoherentPhotonScatteringWrite +end function IncoherentPhotonScatteringWrite + +!! Print to standard output, in our prettyprinting format +function IncoherentPhotonScatteringPrint(handle) & + bind(C, name='IncoherentPhotonScatteringPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncoherentPhotonScatteringPrint +end function IncoherentPhotonScatteringPrint + +!! Print to standard output, as XML +function IncoherentPhotonScatteringPrintXML(handle) & + bind(C, name='IncoherentPhotonScatteringPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncoherentPhotonScatteringPrintXML +end function IncoherentPhotonScatteringPrintXML + +!! Print to standard output, as JSON +function IncoherentPhotonScatteringPrintJSON(handle) & + bind(C, name='IncoherentPhotonScatteringPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncoherentPhotonScatteringPrintJSON +end function IncoherentPhotonScatteringPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function IncoherentPhotonScatteringLabelHas(handle) & + bind(C, name='IncoherentPhotonScatteringLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncoherentPhotonScatteringLabelHas +end function IncoherentPhotonScatteringLabelHas + +!! Get +function IncoherentPhotonScatteringLabelGet(handle) & + bind(C, name='IncoherentPhotonScatteringLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IncoherentPhotonScatteringLabelGet +end function IncoherentPhotonScatteringLabelGet + +!! Set +subroutine IncoherentPhotonScatteringLabelSet(handle, label, labelSize) & + bind(C, name='IncoherentPhotonScatteringLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine IncoherentPhotonScatteringLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function IncoherentPhotonScatteringHrefHas(handle) & + bind(C, name='IncoherentPhotonScatteringHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncoherentPhotonScatteringHrefHas +end function IncoherentPhotonScatteringHrefHas + +!! Get +function IncoherentPhotonScatteringHrefGet(handle) & + bind(C, name='IncoherentPhotonScatteringHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IncoherentPhotonScatteringHrefGet +end function IncoherentPhotonScatteringHrefGet + +!! Set +subroutine IncoherentPhotonScatteringHrefSet(handle, href, hrefSize) & + bind(C, name='IncoherentPhotonScatteringHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine IncoherentPhotonScatteringHrefSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function IncoherentPhotonScatteringPidHas(handle) & + bind(C, name='IncoherentPhotonScatteringPidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncoherentPhotonScatteringPidHas +end function IncoherentPhotonScatteringPidHas + +!! Get +function IncoherentPhotonScatteringPidGet(handle) & + bind(C, name='IncoherentPhotonScatteringPidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IncoherentPhotonScatteringPidGet +end function IncoherentPhotonScatteringPidGet + +!! Set +subroutine IncoherentPhotonScatteringPidSet(handle, pid, pidSize) & + bind(C, name='IncoherentPhotonScatteringPidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine IncoherentPhotonScatteringPidSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function IncoherentPhotonScatteringProductFrameHas(handle) & + bind(C, name='IncoherentPhotonScatteringProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncoherentPhotonScatteringProductFrameHas +end function IncoherentPhotonScatteringProductFrameHas + +!! Get +function IncoherentPhotonScatteringProductFrameGet(handle) & + bind(C, name='IncoherentPhotonScatteringProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IncoherentPhotonScatteringProductFrameGet +end function IncoherentPhotonScatteringProductFrameGet + +!! Set +subroutine IncoherentPhotonScatteringProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='IncoherentPhotonScatteringProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine IncoherentPhotonScatteringProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Child: scatteringFactor +!! ----------------------------------------------------------------------------- + +!! Has +function IncoherentPhotonScatteringScatteringFactorHas(handle) & + bind(C, name='IncoherentPhotonScatteringScatteringFactorHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncoherentPhotonScatteringScatteringFactorHas +end function IncoherentPhotonScatteringScatteringFactorHas + +!! Get, const +function IncoherentPhotonScatteringScatteringFactorGetConst(handle) & + bind(C, name='IncoherentPhotonScatteringScatteringFactorGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IncoherentPhotonScatteringScatteringFactorGetConst +end function IncoherentPhotonScatteringScatteringFactorGetConst + +!! Get, non-const +function IncoherentPhotonScatteringScatteringFactorGet(handle) & + bind(C, name='IncoherentPhotonScatteringScatteringFactorGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: IncoherentPhotonScatteringScatteringFactorGet +end function IncoherentPhotonScatteringScatteringFactorGet + +!! Set +subroutine IncoherentPhotonScatteringScatteringFactorSet(handle, fieldHandle) & + bind(C, name='IncoherentPhotonScatteringScatteringFactorSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IncoherentPhotonScatteringScatteringFactorSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalIncoherentPhotonScattering diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncompleteReactions.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncompleteReactions.f03 new file mode 100644 index 000000000..451647223 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/IncompleteReactions.f03 @@ -0,0 +1,347 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalIncompleteReactions +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function IncompleteReactionsDefaultConst() & + bind(C, name='IncompleteReactionsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: IncompleteReactionsDefaultConst +end function IncompleteReactionsDefaultConst + +!! Create, default, non-const +function IncompleteReactionsDefault() & + bind(C, name='IncompleteReactionsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: IncompleteReactionsDefault +end function IncompleteReactionsDefault + +!! Create, general, const +function IncompleteReactionsCreateConst( & + reaction, reactionSize & +) & + bind(C, name='IncompleteReactionsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: reactionSize + type(c_ptr), intent(in) :: reaction(reactionSize) + type(c_ptr) :: IncompleteReactionsCreateConst +end function IncompleteReactionsCreateConst + +!! Create, general, non-const +function IncompleteReactionsCreate( & + reaction, reactionSize & +) & + bind(C, name='IncompleteReactionsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: reactionSize + type(c_ptr), intent(in) :: reaction(reactionSize) + type(c_ptr) :: IncompleteReactionsCreate +end function IncompleteReactionsCreate + +!! Assign +subroutine IncompleteReactionsAssign(handleLHS, handleRHS) & + bind(C, name='IncompleteReactionsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine IncompleteReactionsAssign + +!! Delete +subroutine IncompleteReactionsDelete(handle) & + bind(C, name='IncompleteReactionsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine IncompleteReactionsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function IncompleteReactionsRead(handle, filename, filenameSize) & + bind(C, name='IncompleteReactionsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IncompleteReactionsRead +end function IncompleteReactionsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function IncompleteReactionsWrite(handle, filename, filenameSize) & + bind(C, name='IncompleteReactionsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IncompleteReactionsWrite +end function IncompleteReactionsWrite + +!! Print to standard output, in our prettyprinting format +function IncompleteReactionsPrint(handle) & + bind(C, name='IncompleteReactionsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncompleteReactionsPrint +end function IncompleteReactionsPrint + +!! Print to standard output, as XML +function IncompleteReactionsPrintXML(handle) & + bind(C, name='IncompleteReactionsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncompleteReactionsPrintXML +end function IncompleteReactionsPrintXML + +!! Print to standard output, as JSON +function IncompleteReactionsPrintJSON(handle) & + bind(C, name='IncompleteReactionsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncompleteReactionsPrintJSON +end function IncompleteReactionsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: reaction +!! ----------------------------------------------------------------------------- + +!! Has +function IncompleteReactionsReactionHas(handle) & + bind(C, name='IncompleteReactionsReactionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IncompleteReactionsReactionHas +end function IncompleteReactionsReactionHas + +!! Clear +subroutine IncompleteReactionsReactionClear(handle) & + bind(C, name='IncompleteReactionsReactionClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine IncompleteReactionsReactionClear + +!! Size +function IncompleteReactionsReactionSize(handle) & + bind(C, name='IncompleteReactionsReactionSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: IncompleteReactionsReactionSize +end function IncompleteReactionsReactionSize + +!! Add +subroutine IncompleteReactionsReactionAdd(handle, fieldHandle) & + bind(C, name='IncompleteReactionsReactionAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IncompleteReactionsReactionAdd + +!! Get, by index \in [0,size), const +function IncompleteReactionsReactionGetConst(handle, index) & + bind(C, name='IncompleteReactionsReactionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: IncompleteReactionsReactionGetConst +end function IncompleteReactionsReactionGetConst + +!! Get, by index \in [0,size), non-const +function IncompleteReactionsReactionGet(handle, index) & + bind(C, name='IncompleteReactionsReactionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: IncompleteReactionsReactionGet +end function IncompleteReactionsReactionGet + +!! Set, by index \in [0,size) +subroutine IncompleteReactionsReactionSet(handle, index, fieldHandle) & + bind(C, name='IncompleteReactionsReactionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IncompleteReactionsReactionSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function IncompleteReactionsReactionHasByLabel(handle, meta, metaSize) & + bind(C, name='IncompleteReactionsReactionHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: IncompleteReactionsReactionHasByLabel +end function IncompleteReactionsReactionHasByLabel + +!! Get, by label, const +function IncompleteReactionsReactionGetByLabelConst(handle, meta, metaSize) & + bind(C, name='IncompleteReactionsReactionGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: IncompleteReactionsReactionGetByLabelConst +end function IncompleteReactionsReactionGetByLabelConst + +!! Get, by label, non-const +function IncompleteReactionsReactionGetByLabel(handle, meta, metaSize) & + bind(C, name='IncompleteReactionsReactionGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: IncompleteReactionsReactionGetByLabel +end function IncompleteReactionsReactionGetByLabel + +!! Set, by label +subroutine IncompleteReactionsReactionSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='IncompleteReactionsReactionSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IncompleteReactionsReactionSetByLabel + +!! ------------------------ +!! Re: metadatum ENDF_MT +!! ------------------------ + +!! Has, by ENDF_MT +function IncompleteReactionsReactionHasByENDFMT(handle, meta) & + bind(C, name='IncompleteReactionsReactionHasByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: IncompleteReactionsReactionHasByENDFMT +end function IncompleteReactionsReactionHasByENDFMT + +!! Get, by ENDF_MT, const +function IncompleteReactionsReactionGetByENDFMTConst(handle, meta) & + bind(C, name='IncompleteReactionsReactionGetByENDFMTConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: IncompleteReactionsReactionGetByENDFMTConst +end function IncompleteReactionsReactionGetByENDFMTConst + +!! Get, by ENDF_MT, non-const +function IncompleteReactionsReactionGetByENDFMT(handle, meta) & + bind(C, name='IncompleteReactionsReactionGetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: IncompleteReactionsReactionGetByENDFMT +end function IncompleteReactionsReactionGetByENDFMT + +!! Set, by ENDF_MT +subroutine IncompleteReactionsReactionSetByENDFMT(handle, meta, fieldHandle) & + bind(C, name='IncompleteReactionsReactionSetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IncompleteReactionsReactionSetByENDFMT + +!! ------------------------ +!! Re: metadatum fissionGenre +!! ------------------------ + +!! Has, by fissionGenre +function IncompleteReactionsReactionHasByFissionGenre(handle, meta, metaSize) & + bind(C, name='IncompleteReactionsReactionHasByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: IncompleteReactionsReactionHasByFissionGenre +end function IncompleteReactionsReactionHasByFissionGenre + +!! Get, by fissionGenre, const +function IncompleteReactionsReactionGetByFissionGenreConst(handle, meta, metaSize) & + bind(C, name='IncompleteReactionsReactionGetByFissionGenreConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: IncompleteReactionsReactionGetByFissionGenreConst +end function IncompleteReactionsReactionGetByFissionGenreConst + +!! Get, by fissionGenre, non-const +function IncompleteReactionsReactionGetByFissionGenre(handle, meta, metaSize) & + bind(C, name='IncompleteReactionsReactionGetByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: IncompleteReactionsReactionGetByFissionGenre +end function IncompleteReactionsReactionGetByFissionGenre + +!! Set, by fissionGenre +subroutine IncompleteReactionsReactionSetByFissionGenre(handle, meta, metaSize, fieldHandle) & + bind(C, name='IncompleteReactionsReactionSetByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IncompleteReactionsReactionSetByFissionGenre + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalIncompleteReactions diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Institution.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Institution.f03 new file mode 100644 index 000000000..3527c2725 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Institution.f03 @@ -0,0 +1,217 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalInstitution +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function InstitutionDefaultConst() & + bind(C, name='InstitutionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: InstitutionDefaultConst +end function InstitutionDefaultConst + +!! Create, default, non-const +function InstitutionDefault() & + bind(C, name='InstitutionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: InstitutionDefault +end function InstitutionDefault + +!! Create, general, const +function InstitutionCreateConst( & + label, & + ENDFconversionFlags, & + labelSize & +) & + bind(C, name='InstitutionCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: ENDFconversionFlags + type(c_ptr) :: InstitutionCreateConst +end function InstitutionCreateConst + +!! Create, general, non-const +function InstitutionCreate( & + label, & + ENDFconversionFlags, & + labelSize & +) & + bind(C, name='InstitutionCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: ENDFconversionFlags + type(c_ptr) :: InstitutionCreate +end function InstitutionCreate + +!! Assign +subroutine InstitutionAssign(handleLHS, handleRHS) & + bind(C, name='InstitutionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine InstitutionAssign + +!! Delete +subroutine InstitutionDelete(handle) & + bind(C, name='InstitutionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine InstitutionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function InstitutionRead(handle, filename, filenameSize) & + bind(C, name='InstitutionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: InstitutionRead +end function InstitutionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function InstitutionWrite(handle, filename, filenameSize) & + bind(C, name='InstitutionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: InstitutionWrite +end function InstitutionWrite + +!! Print to standard output, in our prettyprinting format +function InstitutionPrint(handle) & + bind(C, name='InstitutionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: InstitutionPrint +end function InstitutionPrint + +!! Print to standard output, as XML +function InstitutionPrintXML(handle) & + bind(C, name='InstitutionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: InstitutionPrintXML +end function InstitutionPrintXML + +!! Print to standard output, as JSON +function InstitutionPrintJSON(handle) & + bind(C, name='InstitutionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: InstitutionPrintJSON +end function InstitutionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function InstitutionLabelHas(handle) & + bind(C, name='InstitutionLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: InstitutionLabelHas +end function InstitutionLabelHas + +!! Get +function InstitutionLabelGet(handle) & + bind(C, name='InstitutionLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: InstitutionLabelGet +end function InstitutionLabelGet + +!! Set +subroutine InstitutionLabelSet(handle, label, labelSize) & + bind(C, name='InstitutionLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine InstitutionLabelSet + + +!! ----------------------------------------------------------------------------- +!! Child: ENDFconversionFlags +!! ----------------------------------------------------------------------------- + +!! Has +function InstitutionENDFconversionFlagsHas(handle) & + bind(C, name='InstitutionENDFconversionFlagsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: InstitutionENDFconversionFlagsHas +end function InstitutionENDFconversionFlagsHas + +!! Get, const +function InstitutionENDFconversionFlagsGetConst(handle) & + bind(C, name='InstitutionENDFconversionFlagsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: InstitutionENDFconversionFlagsGetConst +end function InstitutionENDFconversionFlagsGetConst + +!! Get, non-const +function InstitutionENDFconversionFlagsGet(handle) & + bind(C, name='InstitutionENDFconversionFlagsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: InstitutionENDFconversionFlagsGet +end function InstitutionENDFconversionFlagsGet + +!! Set +subroutine InstitutionENDFconversionFlagsSet(handle, fieldHandle) & + bind(C, name='InstitutionENDFconversionFlagsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine InstitutionENDFconversionFlagsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalInstitution diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Integer.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Integer.f03 new file mode 100644 index 000000000..d3b733fef --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Integer.f03 @@ -0,0 +1,249 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalInteger +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function IntegerDefaultConst() & + bind(C, name='IntegerDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: IntegerDefaultConst +end function IntegerDefaultConst + +!! Create, default, non-const +function IntegerDefault() & + bind(C, name='IntegerDefault') + use iso_c_binding + implicit none + type(c_ptr) :: IntegerDefault +end function IntegerDefault + +!! Create, general, const +function IntegerCreateConst( & + label, & + value, & + unit, & + labelSize, & + unitSize & +) & + bind(C, name='IntegerCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: IntegerCreateConst +end function IntegerCreateConst + +!! Create, general, non-const +function IntegerCreate( & + label, & + value, & + unit, & + labelSize, & + unitSize & +) & + bind(C, name='IntegerCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: IntegerCreate +end function IntegerCreate + +!! Assign +subroutine IntegerAssign(handleLHS, handleRHS) & + bind(C, name='IntegerAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine IntegerAssign + +!! Delete +subroutine IntegerDelete(handle) & + bind(C, name='IntegerDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine IntegerDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function IntegerRead(handle, filename, filenameSize) & + bind(C, name='IntegerRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IntegerRead +end function IntegerRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function IntegerWrite(handle, filename, filenameSize) & + bind(C, name='IntegerWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IntegerWrite +end function IntegerWrite + +!! Print to standard output, in our prettyprinting format +function IntegerPrint(handle) & + bind(C, name='IntegerPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntegerPrint +end function IntegerPrint + +!! Print to standard output, as XML +function IntegerPrintXML(handle) & + bind(C, name='IntegerPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntegerPrintXML +end function IntegerPrintXML + +!! Print to standard output, as JSON +function IntegerPrintJSON(handle) & + bind(C, name='IntegerPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntegerPrintJSON +end function IntegerPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function IntegerLabelHas(handle) & + bind(C, name='IntegerLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntegerLabelHas +end function IntegerLabelHas + +!! Get +function IntegerLabelGet(handle) & + bind(C, name='IntegerLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IntegerLabelGet +end function IntegerLabelGet + +!! Set +subroutine IntegerLabelSet(handle, label, labelSize) & + bind(C, name='IntegerLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine IntegerLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function IntegerValueHas(handle) & + bind(C, name='IntegerValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntegerValueHas +end function IntegerValueHas + +!! Get +function IntegerValueGet(handle) & + bind(C, name='IntegerValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntegerValueGet +end function IntegerValueGet + +!! Set +subroutine IntegerValueSet(handle, value) & + bind(C, name='IntegerValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: value +end subroutine IntegerValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function IntegerUnitHas(handle) & + bind(C, name='IntegerUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntegerUnitHas +end function IntegerUnitHas + +!! Get +function IntegerUnitGet(handle) & + bind(C, name='IntegerUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IntegerUnitGet +end function IntegerUnitGet + +!! Set +subroutine IntegerUnitSet(handle, unit, unitSize) & + bind(C, name='IntegerUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine IntegerUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalInteger diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Intensity.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Intensity.f03 new file mode 100644 index 000000000..dce08ba4d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Intensity.f03 @@ -0,0 +1,212 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalIntensity +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function IntensityDefaultConst() & + bind(C, name='IntensityDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: IntensityDefaultConst +end function IntensityDefaultConst + +!! Create, default, non-const +function IntensityDefault() & + bind(C, name='IntensityDefault') + use iso_c_binding + implicit none + type(c_ptr) :: IntensityDefault +end function IntensityDefault + +!! Create, general, const +function IntensityCreateConst( & + value, & + uncertainty & +) & + bind(C, name='IntensityCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: IntensityCreateConst +end function IntensityCreateConst + +!! Create, general, non-const +function IntensityCreate( & + value, & + uncertainty & +) & + bind(C, name='IntensityCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: IntensityCreate +end function IntensityCreate + +!! Assign +subroutine IntensityAssign(handleLHS, handleRHS) & + bind(C, name='IntensityAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine IntensityAssign + +!! Delete +subroutine IntensityDelete(handle) & + bind(C, name='IntensityDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine IntensityDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function IntensityRead(handle, filename, filenameSize) & + bind(C, name='IntensityRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IntensityRead +end function IntensityRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function IntensityWrite(handle, filename, filenameSize) & + bind(C, name='IntensityWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IntensityWrite +end function IntensityWrite + +!! Print to standard output, in our prettyprinting format +function IntensityPrint(handle) & + bind(C, name='IntensityPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntensityPrint +end function IntensityPrint + +!! Print to standard output, as XML +function IntensityPrintXML(handle) & + bind(C, name='IntensityPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntensityPrintXML +end function IntensityPrintXML + +!! Print to standard output, as JSON +function IntensityPrintJSON(handle) & + bind(C, name='IntensityPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntensityPrintJSON +end function IntensityPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function IntensityValueHas(handle) & + bind(C, name='IntensityValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntensityValueHas +end function IntensityValueHas + +!! Get +function IntensityValueGet(handle) & + bind(C, name='IntensityValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: IntensityValueGet +end function IntensityValueGet + +!! Set +subroutine IntensityValueSet(handle, value) & + bind(C, name='IntensityValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine IntensityValueSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function IntensityUncertaintyHas(handle) & + bind(C, name='IntensityUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IntensityUncertaintyHas +end function IntensityUncertaintyHas + +!! Get, const +function IntensityUncertaintyGetConst(handle) & + bind(C, name='IntensityUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IntensityUncertaintyGetConst +end function IntensityUncertaintyGetConst + +!! Get, non-const +function IntensityUncertaintyGet(handle) & + bind(C, name='IntensityUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: IntensityUncertaintyGet +end function IntensityUncertaintyGet + +!! Set +subroutine IntensityUncertaintySet(handle, fieldHandle) & + bind(C, name='IntensityUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IntensityUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalIntensity diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/InternalConversionCoefficients.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/InternalConversionCoefficients.f03 new file mode 100644 index 000000000..8c4e46305 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/InternalConversionCoefficients.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalInternalConversionCoefficients +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function InternalConversionCoefficientsDefaultConst() & + bind(C, name='InternalConversionCoefficientsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: InternalConversionCoefficientsDefaultConst +end function InternalConversionCoefficientsDefaultConst + +!! Create, default, non-const +function InternalConversionCoefficientsDefault() & + bind(C, name='InternalConversionCoefficientsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: InternalConversionCoefficientsDefault +end function InternalConversionCoefficientsDefault + +!! Create, general, const +function InternalConversionCoefficientsCreateConst( & + shell, shellSize & +) & + bind(C, name='InternalConversionCoefficientsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: shellSize + type(c_ptr), intent(in) :: shell(shellSize) + type(c_ptr) :: InternalConversionCoefficientsCreateConst +end function InternalConversionCoefficientsCreateConst + +!! Create, general, non-const +function InternalConversionCoefficientsCreate( & + shell, shellSize & +) & + bind(C, name='InternalConversionCoefficientsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: shellSize + type(c_ptr), intent(in) :: shell(shellSize) + type(c_ptr) :: InternalConversionCoefficientsCreate +end function InternalConversionCoefficientsCreate + +!! Assign +subroutine InternalConversionCoefficientsAssign(handleLHS, handleRHS) & + bind(C, name='InternalConversionCoefficientsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine InternalConversionCoefficientsAssign + +!! Delete +subroutine InternalConversionCoefficientsDelete(handle) & + bind(C, name='InternalConversionCoefficientsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine InternalConversionCoefficientsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function InternalConversionCoefficientsRead(handle, filename, filenameSize) & + bind(C, name='InternalConversionCoefficientsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: InternalConversionCoefficientsRead +end function InternalConversionCoefficientsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function InternalConversionCoefficientsWrite(handle, filename, filenameSize) & + bind(C, name='InternalConversionCoefficientsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: InternalConversionCoefficientsWrite +end function InternalConversionCoefficientsWrite + +!! Print to standard output, in our prettyprinting format +function InternalConversionCoefficientsPrint(handle) & + bind(C, name='InternalConversionCoefficientsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: InternalConversionCoefficientsPrint +end function InternalConversionCoefficientsPrint + +!! Print to standard output, as XML +function InternalConversionCoefficientsPrintXML(handle) & + bind(C, name='InternalConversionCoefficientsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: InternalConversionCoefficientsPrintXML +end function InternalConversionCoefficientsPrintXML + +!! Print to standard output, as JSON +function InternalConversionCoefficientsPrintJSON(handle) & + bind(C, name='InternalConversionCoefficientsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: InternalConversionCoefficientsPrintJSON +end function InternalConversionCoefficientsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: shell +!! ----------------------------------------------------------------------------- + +!! Has +function InternalConversionCoefficientsShellHas(handle) & + bind(C, name='InternalConversionCoefficientsShellHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: InternalConversionCoefficientsShellHas +end function InternalConversionCoefficientsShellHas + +!! Clear +subroutine InternalConversionCoefficientsShellClear(handle) & + bind(C, name='InternalConversionCoefficientsShellClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine InternalConversionCoefficientsShellClear + +!! Size +function InternalConversionCoefficientsShellSize(handle) & + bind(C, name='InternalConversionCoefficientsShellSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: InternalConversionCoefficientsShellSize +end function InternalConversionCoefficientsShellSize + +!! Add +subroutine InternalConversionCoefficientsShellAdd(handle, fieldHandle) & + bind(C, name='InternalConversionCoefficientsShellAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine InternalConversionCoefficientsShellAdd + +!! Get, by index \in [0,size), const +function InternalConversionCoefficientsShellGetConst(handle, index) & + bind(C, name='InternalConversionCoefficientsShellGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: InternalConversionCoefficientsShellGetConst +end function InternalConversionCoefficientsShellGetConst + +!! Get, by index \in [0,size), non-const +function InternalConversionCoefficientsShellGet(handle, index) & + bind(C, name='InternalConversionCoefficientsShellGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: InternalConversionCoefficientsShellGet +end function InternalConversionCoefficientsShellGet + +!! Set, by index \in [0,size) +subroutine InternalConversionCoefficientsShellSet(handle, index, fieldHandle) & + bind(C, name='InternalConversionCoefficientsShellSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine InternalConversionCoefficientsShellSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function InternalConversionCoefficientsShellHasByLabel(handle, meta, metaSize) & + bind(C, name='InternalConversionCoefficientsShellHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: InternalConversionCoefficientsShellHasByLabel +end function InternalConversionCoefficientsShellHasByLabel + +!! Get, by label, const +function InternalConversionCoefficientsShellGetByLabelConst(handle, meta, metaSize) & + bind(C, name='InternalConversionCoefficientsShellGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: InternalConversionCoefficientsShellGetByLabelConst +end function InternalConversionCoefficientsShellGetByLabelConst + +!! Get, by label, non-const +function InternalConversionCoefficientsShellGetByLabel(handle, meta, metaSize) & + bind(C, name='InternalConversionCoefficientsShellGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: InternalConversionCoefficientsShellGetByLabel +end function InternalConversionCoefficientsShellGetByLabel + +!! Set, by label +subroutine InternalConversionCoefficientsShellSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='InternalConversionCoefficientsShellSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine InternalConversionCoefficientsShellSetByLabel + +!! ------------------------ +!! Re: metadatum value +!! ------------------------ + +!! Has, by value +function InternalConversionCoefficientsShellHasByValue(handle, meta) & + bind(C, name='InternalConversionCoefficientsShellHasByValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: InternalConversionCoefficientsShellHasByValue +end function InternalConversionCoefficientsShellHasByValue + +!! Get, by value, const +function InternalConversionCoefficientsShellGetByValueConst(handle, meta) & + bind(C, name='InternalConversionCoefficientsShellGetByValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: InternalConversionCoefficientsShellGetByValueConst +end function InternalConversionCoefficientsShellGetByValueConst + +!! Get, by value, non-const +function InternalConversionCoefficientsShellGetByValue(handle, meta) & + bind(C, name='InternalConversionCoefficientsShellGetByValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: InternalConversionCoefficientsShellGetByValue +end function InternalConversionCoefficientsShellGetByValue + +!! Set, by value +subroutine InternalConversionCoefficientsShellSetByValue(handle, meta, fieldHandle) & + bind(C, name='InternalConversionCoefficientsShellSetByValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine InternalConversionCoefficientsShellSetByValue + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalInternalConversionCoefficients diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Isotope.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Isotope.f03 new file mode 100644 index 000000000..1b4d6f94e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Isotope.f03 @@ -0,0 +1,253 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalIsotope +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function IsotopeDefaultConst() & + bind(C, name='IsotopeDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: IsotopeDefaultConst +end function IsotopeDefaultConst + +!! Create, default, non-const +function IsotopeDefault() & + bind(C, name='IsotopeDefault') + use iso_c_binding + implicit none + type(c_ptr) :: IsotopeDefault +end function IsotopeDefault + +!! Create, general, const +function IsotopeCreateConst( & + symbol, & + A, & + nuclides, & + symbolSize & +) & + bind(C, name='IsotopeCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: symbolSize + character(c_char), intent(in) :: symbol(symbolSize) + integer(c_int), intent(in), value :: A + type(c_ptr), intent(in), value :: nuclides + type(c_ptr) :: IsotopeCreateConst +end function IsotopeCreateConst + +!! Create, general, non-const +function IsotopeCreate( & + symbol, & + A, & + nuclides, & + symbolSize & +) & + bind(C, name='IsotopeCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: symbolSize + character(c_char), intent(in) :: symbol(symbolSize) + integer(c_int), intent(in), value :: A + type(c_ptr), intent(in), value :: nuclides + type(c_ptr) :: IsotopeCreate +end function IsotopeCreate + +!! Assign +subroutine IsotopeAssign(handleLHS, handleRHS) & + bind(C, name='IsotopeAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine IsotopeAssign + +!! Delete +subroutine IsotopeDelete(handle) & + bind(C, name='IsotopeDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine IsotopeDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function IsotopeRead(handle, filename, filenameSize) & + bind(C, name='IsotopeRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IsotopeRead +end function IsotopeRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function IsotopeWrite(handle, filename, filenameSize) & + bind(C, name='IsotopeWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IsotopeWrite +end function IsotopeWrite + +!! Print to standard output, in our prettyprinting format +function IsotopePrint(handle) & + bind(C, name='IsotopePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IsotopePrint +end function IsotopePrint + +!! Print to standard output, as XML +function IsotopePrintXML(handle) & + bind(C, name='IsotopePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IsotopePrintXML +end function IsotopePrintXML + +!! Print to standard output, as JSON +function IsotopePrintJSON(handle) & + bind(C, name='IsotopePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IsotopePrintJSON +end function IsotopePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: symbol +!! ----------------------------------------------------------------------------- + +!! Has +function IsotopeSymbolHas(handle) & + bind(C, name='IsotopeSymbolHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IsotopeSymbolHas +end function IsotopeSymbolHas + +!! Get +function IsotopeSymbolGet(handle) & + bind(C, name='IsotopeSymbolGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IsotopeSymbolGet +end function IsotopeSymbolGet + +!! Set +subroutine IsotopeSymbolSet(handle, symbol, symbolSize) & + bind(C, name='IsotopeSymbolSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: symbolSize + character(c_char), intent(in) :: symbol(symbolSize) +end subroutine IsotopeSymbolSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: A +!! ----------------------------------------------------------------------------- + +!! Has +function IsotopeAHas(handle) & + bind(C, name='IsotopeAHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IsotopeAHas +end function IsotopeAHas + +!! Get +function IsotopeAGet(handle) & + bind(C, name='IsotopeAGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IsotopeAGet +end function IsotopeAGet + +!! Set +subroutine IsotopeASet(handle, A) & + bind(C, name='IsotopeASet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: A +end subroutine IsotopeASet + + +!! ----------------------------------------------------------------------------- +!! Child: nuclides +!! ----------------------------------------------------------------------------- + +!! Has +function IsotopeNuclidesHas(handle) & + bind(C, name='IsotopeNuclidesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IsotopeNuclidesHas +end function IsotopeNuclidesHas + +!! Get, const +function IsotopeNuclidesGetConst(handle) & + bind(C, name='IsotopeNuclidesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: IsotopeNuclidesGetConst +end function IsotopeNuclidesGetConst + +!! Get, non-const +function IsotopeNuclidesGet(handle) & + bind(C, name='IsotopeNuclidesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: IsotopeNuclidesGet +end function IsotopeNuclidesGet + +!! Set +subroutine IsotopeNuclidesSet(handle, fieldHandle) & + bind(C, name='IsotopeNuclidesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IsotopeNuclidesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalIsotope diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Isotopes.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Isotopes.f03 new file mode 100644 index 000000000..37b081ed1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Isotopes.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalIsotopes +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function IsotopesDefaultConst() & + bind(C, name='IsotopesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: IsotopesDefaultConst +end function IsotopesDefaultConst + +!! Create, default, non-const +function IsotopesDefault() & + bind(C, name='IsotopesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: IsotopesDefault +end function IsotopesDefault + +!! Create, general, const +function IsotopesCreateConst( & + isotope, isotopeSize & +) & + bind(C, name='IsotopesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: isotopeSize + type(c_ptr), intent(in) :: isotope(isotopeSize) + type(c_ptr) :: IsotopesCreateConst +end function IsotopesCreateConst + +!! Create, general, non-const +function IsotopesCreate( & + isotope, isotopeSize & +) & + bind(C, name='IsotopesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: isotopeSize + type(c_ptr), intent(in) :: isotope(isotopeSize) + type(c_ptr) :: IsotopesCreate +end function IsotopesCreate + +!! Assign +subroutine IsotopesAssign(handleLHS, handleRHS) & + bind(C, name='IsotopesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine IsotopesAssign + +!! Delete +subroutine IsotopesDelete(handle) & + bind(C, name='IsotopesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine IsotopesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function IsotopesRead(handle, filename, filenameSize) & + bind(C, name='IsotopesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IsotopesRead +end function IsotopesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function IsotopesWrite(handle, filename, filenameSize) & + bind(C, name='IsotopesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: IsotopesWrite +end function IsotopesWrite + +!! Print to standard output, in our prettyprinting format +function IsotopesPrint(handle) & + bind(C, name='IsotopesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IsotopesPrint +end function IsotopesPrint + +!! Print to standard output, as XML +function IsotopesPrintXML(handle) & + bind(C, name='IsotopesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IsotopesPrintXML +end function IsotopesPrintXML + +!! Print to standard output, as JSON +function IsotopesPrintJSON(handle) & + bind(C, name='IsotopesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IsotopesPrintJSON +end function IsotopesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: isotope +!! ----------------------------------------------------------------------------- + +!! Has +function IsotopesIsotopeHas(handle) & + bind(C, name='IsotopesIsotopeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: IsotopesIsotopeHas +end function IsotopesIsotopeHas + +!! Clear +subroutine IsotopesIsotopeClear(handle) & + bind(C, name='IsotopesIsotopeClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine IsotopesIsotopeClear + +!! Size +function IsotopesIsotopeSize(handle) & + bind(C, name='IsotopesIsotopeSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: IsotopesIsotopeSize +end function IsotopesIsotopeSize + +!! Add +subroutine IsotopesIsotopeAdd(handle, fieldHandle) & + bind(C, name='IsotopesIsotopeAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IsotopesIsotopeAdd + +!! Get, by index \in [0,size), const +function IsotopesIsotopeGetConst(handle, index) & + bind(C, name='IsotopesIsotopeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: IsotopesIsotopeGetConst +end function IsotopesIsotopeGetConst + +!! Get, by index \in [0,size), non-const +function IsotopesIsotopeGet(handle, index) & + bind(C, name='IsotopesIsotopeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: IsotopesIsotopeGet +end function IsotopesIsotopeGet + +!! Set, by index \in [0,size) +subroutine IsotopesIsotopeSet(handle, index, fieldHandle) & + bind(C, name='IsotopesIsotopeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IsotopesIsotopeSet + +!! ------------------------ +!! Re: metadatum symbol +!! ------------------------ + +!! Has, by symbol +function IsotopesIsotopeHasBySymbol(handle, meta, metaSize) & + bind(C, name='IsotopesIsotopeHasBySymbol') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: IsotopesIsotopeHasBySymbol +end function IsotopesIsotopeHasBySymbol + +!! Get, by symbol, const +function IsotopesIsotopeGetBySymbolConst(handle, meta, metaSize) & + bind(C, name='IsotopesIsotopeGetBySymbolConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: IsotopesIsotopeGetBySymbolConst +end function IsotopesIsotopeGetBySymbolConst + +!! Get, by symbol, non-const +function IsotopesIsotopeGetBySymbol(handle, meta, metaSize) & + bind(C, name='IsotopesIsotopeGetBySymbol') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: IsotopesIsotopeGetBySymbol +end function IsotopesIsotopeGetBySymbol + +!! Set, by symbol +subroutine IsotopesIsotopeSetBySymbol(handle, meta, metaSize, fieldHandle) & + bind(C, name='IsotopesIsotopeSetBySymbol') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IsotopesIsotopeSetBySymbol + +!! ------------------------ +!! Re: metadatum A +!! ------------------------ + +!! Has, by A +function IsotopesIsotopeHasByA(handle, meta) & + bind(C, name='IsotopesIsotopeHasByA') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: IsotopesIsotopeHasByA +end function IsotopesIsotopeHasByA + +!! Get, by A, const +function IsotopesIsotopeGetByAConst(handle, meta) & + bind(C, name='IsotopesIsotopeGetByAConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: IsotopesIsotopeGetByAConst +end function IsotopesIsotopeGetByAConst + +!! Get, by A, non-const +function IsotopesIsotopeGetByA(handle, meta) & + bind(C, name='IsotopesIsotopeGetByA') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: IsotopesIsotopeGetByA +end function IsotopesIsotopeGetByA + +!! Set, by A +subroutine IsotopesIsotopeSetByA(handle, meta, fieldHandle) & + bind(C, name='IsotopesIsotopeSetByA') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine IsotopesIsotopeSetByA + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalIsotopes diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Isotropic2d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Isotropic2d.f03 new file mode 100644 index 000000000..164c2b8f1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Isotropic2d.f03 @@ -0,0 +1,131 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalIsotropic2d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Isotropic2dDefaultConst() & + bind(C, name='Isotropic2dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Isotropic2dDefaultConst +end function Isotropic2dDefaultConst + +!! Create, default, non-const +function Isotropic2dDefault() & + bind(C, name='Isotropic2dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Isotropic2dDefault +end function Isotropic2dDefault + +!! Create, general, const +function Isotropic2dCreateConst( & +) & + bind(C, name='Isotropic2dCreateConst') + use iso_c_binding + implicit none + type(c_ptr) :: Isotropic2dCreateConst +end function Isotropic2dCreateConst + +!! Create, general, non-const +function Isotropic2dCreate( & +) & + bind(C, name='Isotropic2dCreate') + use iso_c_binding + implicit none + type(c_ptr) :: Isotropic2dCreate +end function Isotropic2dCreate + +!! Assign +subroutine Isotropic2dAssign(handleLHS, handleRHS) & + bind(C, name='Isotropic2dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Isotropic2dAssign + +!! Delete +subroutine Isotropic2dDelete(handle) & + bind(C, name='Isotropic2dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Isotropic2dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Isotropic2dRead(handle, filename, filenameSize) & + bind(C, name='Isotropic2dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Isotropic2dRead +end function Isotropic2dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Isotropic2dWrite(handle, filename, filenameSize) & + bind(C, name='Isotropic2dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Isotropic2dWrite +end function Isotropic2dWrite + +!! Print to standard output, in our prettyprinting format +function Isotropic2dPrint(handle) & + bind(C, name='Isotropic2dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Isotropic2dPrint +end function Isotropic2dPrint + +!! Print to standard output, as XML +function Isotropic2dPrintXML(handle) & + bind(C, name='Isotropic2dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Isotropic2dPrintXML +end function Isotropic2dPrintXML + +!! Print to standard output, as JSON +function Isotropic2dPrintJSON(handle) & + bind(C, name='Isotropic2dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Isotropic2dPrintJSON +end function Isotropic2dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalIsotropic2d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/J.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/J.f03 new file mode 100644 index 000000000..bbc01b475 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/J.f03 @@ -0,0 +1,298 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalJ +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function JDefaultConst() & + bind(C, name='JDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: JDefaultConst +end function JDefaultConst + +!! Create, default, non-const +function JDefault() & + bind(C, name='JDefault') + use iso_c_binding + implicit none + type(c_ptr) :: JDefault +end function JDefault + +!! Create, general, const +function JCreateConst( & + label, & + value, & + levelSpacing, & + widths, & + labelSize & +) & + bind(C, name='JCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: value + type(c_ptr), intent(in), value :: levelSpacing + type(c_ptr), intent(in), value :: widths + type(c_ptr) :: JCreateConst +end function JCreateConst + +!! Create, general, non-const +function JCreate( & + label, & + value, & + levelSpacing, & + widths, & + labelSize & +) & + bind(C, name='JCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: value + type(c_ptr), intent(in), value :: levelSpacing + type(c_ptr), intent(in), value :: widths + type(c_ptr) :: JCreate +end function JCreate + +!! Assign +subroutine JAssign(handleLHS, handleRHS) & + bind(C, name='JAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine JAssign + +!! Delete +subroutine JDelete(handle) & + bind(C, name='JDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine JDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function JRead(handle, filename, filenameSize) & + bind(C, name='JRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: JRead +end function JRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function JWrite(handle, filename, filenameSize) & + bind(C, name='JWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: JWrite +end function JWrite + +!! Print to standard output, in our prettyprinting format +function JPrint(handle) & + bind(C, name='JPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JPrint +end function JPrint + +!! Print to standard output, as XML +function JPrintXML(handle) & + bind(C, name='JPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JPrintXML +end function JPrintXML + +!! Print to standard output, as JSON +function JPrintJSON(handle) & + bind(C, name='JPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JPrintJSON +end function JPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function JLabelHas(handle) & + bind(C, name='JLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JLabelHas +end function JLabelHas + +!! Get +function JLabelGet(handle) & + bind(C, name='JLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: JLabelGet +end function JLabelGet + +!! Set +subroutine JLabelSet(handle, label, labelSize) & + bind(C, name='JLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine JLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function JValueHas(handle) & + bind(C, name='JValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JValueHas +end function JValueHas + +!! Get +function JValueGet(handle) & + bind(C, name='JValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JValueGet +end function JValueGet + +!! Set +subroutine JValueSet(handle, value) & + bind(C, name='JValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: value +end subroutine JValueSet + + +!! ----------------------------------------------------------------------------- +!! Child: levelSpacing +!! ----------------------------------------------------------------------------- + +!! Has +function JLevelSpacingHas(handle) & + bind(C, name='JLevelSpacingHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JLevelSpacingHas +end function JLevelSpacingHas + +!! Get, const +function JLevelSpacingGetConst(handle) & + bind(C, name='JLevelSpacingGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: JLevelSpacingGetConst +end function JLevelSpacingGetConst + +!! Get, non-const +function JLevelSpacingGet(handle) & + bind(C, name='JLevelSpacingGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: JLevelSpacingGet +end function JLevelSpacingGet + +!! Set +subroutine JLevelSpacingSet(handle, fieldHandle) & + bind(C, name='JLevelSpacingSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine JLevelSpacingSet + + +!! ----------------------------------------------------------------------------- +!! Child: widths +!! ----------------------------------------------------------------------------- + +!! Has +function JWidthsHas(handle) & + bind(C, name='JWidthsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JWidthsHas +end function JWidthsHas + +!! Get, const +function JWidthsGetConst(handle) & + bind(C, name='JWidthsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: JWidthsGetConst +end function JWidthsGetConst + +!! Get, non-const +function JWidthsGet(handle) & + bind(C, name='JWidthsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: JWidthsGet +end function JWidthsGet + +!! Set +subroutine JWidthsSet(handle, fieldHandle) & + bind(C, name='JWidthsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine JWidthsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalJ diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Js.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Js.f03 new file mode 100644 index 000000000..9d8b7b770 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Js.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalJs +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function JsDefaultConst() & + bind(C, name='JsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: JsDefaultConst +end function JsDefaultConst + +!! Create, default, non-const +function JsDefault() & + bind(C, name='JsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: JsDefault +end function JsDefault + +!! Create, general, const +function JsCreateConst( & + J, JSize & +) & + bind(C, name='JsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: JSize + type(c_ptr), intent(in) :: J(JSize) + type(c_ptr) :: JsCreateConst +end function JsCreateConst + +!! Create, general, non-const +function JsCreate( & + J, JSize & +) & + bind(C, name='JsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: JSize + type(c_ptr), intent(in) :: J(JSize) + type(c_ptr) :: JsCreate +end function JsCreate + +!! Assign +subroutine JsAssign(handleLHS, handleRHS) & + bind(C, name='JsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine JsAssign + +!! Delete +subroutine JsDelete(handle) & + bind(C, name='JsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine JsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function JsRead(handle, filename, filenameSize) & + bind(C, name='JsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: JsRead +end function JsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function JsWrite(handle, filename, filenameSize) & + bind(C, name='JsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: JsWrite +end function JsWrite + +!! Print to standard output, in our prettyprinting format +function JsPrint(handle) & + bind(C, name='JsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JsPrint +end function JsPrint + +!! Print to standard output, as XML +function JsPrintXML(handle) & + bind(C, name='JsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JsPrintXML +end function JsPrintXML + +!! Print to standard output, as JSON +function JsPrintJSON(handle) & + bind(C, name='JsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JsPrintJSON +end function JsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: J +!! ----------------------------------------------------------------------------- + +!! Has +function JsJHas(handle) & + bind(C, name='JsJHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: JsJHas +end function JsJHas + +!! Clear +subroutine JsJClear(handle) & + bind(C, name='JsJClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine JsJClear + +!! Size +function JsJSize(handle) & + bind(C, name='JsJSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: JsJSize +end function JsJSize + +!! Add +subroutine JsJAdd(handle, fieldHandle) & + bind(C, name='JsJAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine JsJAdd + +!! Get, by index \in [0,size), const +function JsJGetConst(handle, index) & + bind(C, name='JsJGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: JsJGetConst +end function JsJGetConst + +!! Get, by index \in [0,size), non-const +function JsJGet(handle, index) & + bind(C, name='JsJGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: JsJGet +end function JsJGet + +!! Set, by index \in [0,size) +subroutine JsJSet(handle, index, fieldHandle) & + bind(C, name='JsJSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine JsJSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function JsJHasByLabel(handle, meta, metaSize) & + bind(C, name='JsJHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: JsJHasByLabel +end function JsJHasByLabel + +!! Get, by label, const +function JsJGetByLabelConst(handle, meta, metaSize) & + bind(C, name='JsJGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: JsJGetByLabelConst +end function JsJGetByLabelConst + +!! Get, by label, non-const +function JsJGetByLabel(handle, meta, metaSize) & + bind(C, name='JsJGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: JsJGetByLabel +end function JsJGetByLabel + +!! Set, by label +subroutine JsJSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='JsJSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine JsJSetByLabel + +!! ------------------------ +!! Re: metadatum value +!! ------------------------ + +!! Has, by value +function JsJHasByValue(handle, meta) & + bind(C, name='JsJHasByValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: JsJHasByValue +end function JsJHasByValue + +!! Get, by value, const +function JsJGetByValueConst(handle, meta) & + bind(C, name='JsJGetByValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: JsJGetByValueConst +end function JsJGetByValueConst + +!! Get, by value, non-const +function JsJGetByValue(handle, meta) & + bind(C, name='JsJGetByValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: JsJGetByValue +end function JsJGetByValue + +!! Set, by value +subroutine JsJSetByValue(handle, meta, fieldHandle) & + bind(C, name='JsJSetByValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine JsJSetByValue + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalJs diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/KalbachMann.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/KalbachMann.f03 new file mode 100644 index 000000000..6c818752c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/KalbachMann.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalKalbachMann +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function KalbachMannDefaultConst() & + bind(C, name='KalbachMannDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: KalbachMannDefaultConst +end function KalbachMannDefaultConst + +!! Create, default, non-const +function KalbachMannDefault() & + bind(C, name='KalbachMannDefault') + use iso_c_binding + implicit none + type(c_ptr) :: KalbachMannDefault +end function KalbachMannDefault + +!! Create, general, const +function KalbachMannCreateConst( & + label, & + productFrame, & + f, & + r, & + labelSize, & + productFrameSize & +) & + bind(C, name='KalbachMannCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: f + type(c_ptr), intent(in), value :: r + type(c_ptr) :: KalbachMannCreateConst +end function KalbachMannCreateConst + +!! Create, general, non-const +function KalbachMannCreate( & + label, & + productFrame, & + f, & + r, & + labelSize, & + productFrameSize & +) & + bind(C, name='KalbachMannCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: f + type(c_ptr), intent(in), value :: r + type(c_ptr) :: KalbachMannCreate +end function KalbachMannCreate + +!! Assign +subroutine KalbachMannAssign(handleLHS, handleRHS) & + bind(C, name='KalbachMannAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine KalbachMannAssign + +!! Delete +subroutine KalbachMannDelete(handle) & + bind(C, name='KalbachMannDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine KalbachMannDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function KalbachMannRead(handle, filename, filenameSize) & + bind(C, name='KalbachMannRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: KalbachMannRead +end function KalbachMannRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function KalbachMannWrite(handle, filename, filenameSize) & + bind(C, name='KalbachMannWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: KalbachMannWrite +end function KalbachMannWrite + +!! Print to standard output, in our prettyprinting format +function KalbachMannPrint(handle) & + bind(C, name='KalbachMannPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: KalbachMannPrint +end function KalbachMannPrint + +!! Print to standard output, as XML +function KalbachMannPrintXML(handle) & + bind(C, name='KalbachMannPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: KalbachMannPrintXML +end function KalbachMannPrintXML + +!! Print to standard output, as JSON +function KalbachMannPrintJSON(handle) & + bind(C, name='KalbachMannPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: KalbachMannPrintJSON +end function KalbachMannPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function KalbachMannLabelHas(handle) & + bind(C, name='KalbachMannLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: KalbachMannLabelHas +end function KalbachMannLabelHas + +!! Get +function KalbachMannLabelGet(handle) & + bind(C, name='KalbachMannLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: KalbachMannLabelGet +end function KalbachMannLabelGet + +!! Set +subroutine KalbachMannLabelSet(handle, label, labelSize) & + bind(C, name='KalbachMannLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine KalbachMannLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function KalbachMannProductFrameHas(handle) & + bind(C, name='KalbachMannProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: KalbachMannProductFrameHas +end function KalbachMannProductFrameHas + +!! Get +function KalbachMannProductFrameGet(handle) & + bind(C, name='KalbachMannProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: KalbachMannProductFrameGet +end function KalbachMannProductFrameGet + +!! Set +subroutine KalbachMannProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='KalbachMannProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine KalbachMannProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Child: f +!! ----------------------------------------------------------------------------- + +!! Has +function KalbachMannFHas(handle) & + bind(C, name='KalbachMannFHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: KalbachMannFHas +end function KalbachMannFHas + +!! Get, const +function KalbachMannFGetConst(handle) & + bind(C, name='KalbachMannFGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: KalbachMannFGetConst +end function KalbachMannFGetConst + +!! Get, non-const +function KalbachMannFGet(handle) & + bind(C, name='KalbachMannFGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: KalbachMannFGet +end function KalbachMannFGet + +!! Set +subroutine KalbachMannFSet(handle, fieldHandle) & + bind(C, name='KalbachMannFSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine KalbachMannFSet + + +!! ----------------------------------------------------------------------------- +!! Child: r +!! ----------------------------------------------------------------------------- + +!! Has +function KalbachMannRHas(handle) & + bind(C, name='KalbachMannRHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: KalbachMannRHas +end function KalbachMannRHas + +!! Get, const +function KalbachMannRGetConst(handle) & + bind(C, name='KalbachMannRGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: KalbachMannRGetConst +end function KalbachMannRGetConst + +!! Get, non-const +function KalbachMannRGet(handle) & + bind(C, name='KalbachMannRGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: KalbachMannRGet +end function KalbachMannRGet + +!! Set +subroutine KalbachMannRSet(handle, fieldHandle) & + bind(C, name='KalbachMannRSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine KalbachMannRSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalKalbachMann diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/L.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/L.f03 new file mode 100644 index 000000000..f4f420c42 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/L.f03 @@ -0,0 +1,253 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalL +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function LDefaultConst() & + bind(C, name='LDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: LDefaultConst +end function LDefaultConst + +!! Create, default, non-const +function LDefault() & + bind(C, name='LDefault') + use iso_c_binding + implicit none + type(c_ptr) :: LDefault +end function LDefault + +!! Create, general, const +function LCreateConst( & + label, & + value, & + Js, & + labelSize & +) & + bind(C, name='LCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: value + type(c_ptr), intent(in), value :: Js + type(c_ptr) :: LCreateConst +end function LCreateConst + +!! Create, general, non-const +function LCreate( & + label, & + value, & + Js, & + labelSize & +) & + bind(C, name='LCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: value + type(c_ptr), intent(in), value :: Js + type(c_ptr) :: LCreate +end function LCreate + +!! Assign +subroutine LAssign(handleLHS, handleRHS) & + bind(C, name='LAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine LAssign + +!! Delete +subroutine LDelete(handle) & + bind(C, name='LDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function LRead(handle, filename, filenameSize) & + bind(C, name='LRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LRead +end function LRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function LWrite(handle, filename, filenameSize) & + bind(C, name='LWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LWrite +end function LWrite + +!! Print to standard output, in our prettyprinting format +function LPrint(handle) & + bind(C, name='LPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LPrint +end function LPrint + +!! Print to standard output, as XML +function LPrintXML(handle) & + bind(C, name='LPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LPrintXML +end function LPrintXML + +!! Print to standard output, as JSON +function LPrintJSON(handle) & + bind(C, name='LPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LPrintJSON +end function LPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function LLabelHas(handle) & + bind(C, name='LLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LLabelHas +end function LLabelHas + +!! Get +function LLabelGet(handle) & + bind(C, name='LLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LLabelGet +end function LLabelGet + +!! Set +subroutine LLabelSet(handle, label, labelSize) & + bind(C, name='LLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine LLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function LValueHas(handle) & + bind(C, name='LValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LValueHas +end function LValueHas + +!! Get +function LValueGet(handle) & + bind(C, name='LValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LValueGet +end function LValueGet + +!! Set +subroutine LValueSet(handle, value) & + bind(C, name='LValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: value +end subroutine LValueSet + + +!! ----------------------------------------------------------------------------- +!! Child: Js +!! ----------------------------------------------------------------------------- + +!! Has +function LJsHas(handle) & + bind(C, name='LJsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LJsHas +end function LJsHas + +!! Get, const +function LJsGetConst(handle) & + bind(C, name='LJsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LJsGetConst +end function LJsGetConst + +!! Get, non-const +function LJsGet(handle) & + bind(C, name='LJsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: LJsGet +end function LJsGet + +!! Set +subroutine LJsSet(handle, fieldHandle) & + bind(C, name='LJsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LJsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalL diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Legendre.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Legendre.f03 new file mode 100644 index 000000000..790502070 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Legendre.f03 @@ -0,0 +1,212 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalLegendre +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function LegendreDefaultConst() & + bind(C, name='LegendreDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: LegendreDefaultConst +end function LegendreDefaultConst + +!! Create, default, non-const +function LegendreDefault() & + bind(C, name='LegendreDefault') + use iso_c_binding + implicit none + type(c_ptr) :: LegendreDefault +end function LegendreDefault + +!! Create, general, const +function LegendreCreateConst( & + outerDomainValue, & + values & +) & + bind(C, name='LegendreCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: outerDomainValue + type(c_ptr), intent(in), value :: values + type(c_ptr) :: LegendreCreateConst +end function LegendreCreateConst + +!! Create, general, non-const +function LegendreCreate( & + outerDomainValue, & + values & +) & + bind(C, name='LegendreCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: outerDomainValue + type(c_ptr), intent(in), value :: values + type(c_ptr) :: LegendreCreate +end function LegendreCreate + +!! Assign +subroutine LegendreAssign(handleLHS, handleRHS) & + bind(C, name='LegendreAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine LegendreAssign + +!! Delete +subroutine LegendreDelete(handle) & + bind(C, name='LegendreDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LegendreDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function LegendreRead(handle, filename, filenameSize) & + bind(C, name='LegendreRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LegendreRead +end function LegendreRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function LegendreWrite(handle, filename, filenameSize) & + bind(C, name='LegendreWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LegendreWrite +end function LegendreWrite + +!! Print to standard output, in our prettyprinting format +function LegendrePrint(handle) & + bind(C, name='LegendrePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LegendrePrint +end function LegendrePrint + +!! Print to standard output, as XML +function LegendrePrintXML(handle) & + bind(C, name='LegendrePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LegendrePrintXML +end function LegendrePrintXML + +!! Print to standard output, as JSON +function LegendrePrintJSON(handle) & + bind(C, name='LegendrePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LegendrePrintJSON +end function LegendrePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: outerDomainValue +!! ----------------------------------------------------------------------------- + +!! Has +function LegendreOuterDomainValueHas(handle) & + bind(C, name='LegendreOuterDomainValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LegendreOuterDomainValueHas +end function LegendreOuterDomainValueHas + +!! Get +function LegendreOuterDomainValueGet(handle) & + bind(C, name='LegendreOuterDomainValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: LegendreOuterDomainValueGet +end function LegendreOuterDomainValueGet + +!! Set +subroutine LegendreOuterDomainValueSet(handle, outerDomainValue) & + bind(C, name='LegendreOuterDomainValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: outerDomainValue +end subroutine LegendreOuterDomainValueSet + + +!! ----------------------------------------------------------------------------- +!! Child: values +!! ----------------------------------------------------------------------------- + +!! Has +function LegendreValuesHas(handle) & + bind(C, name='LegendreValuesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LegendreValuesHas +end function LegendreValuesHas + +!! Get, const +function LegendreValuesGetConst(handle) & + bind(C, name='LegendreValuesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LegendreValuesGetConst +end function LegendreValuesGetConst + +!! Get, non-const +function LegendreValuesGet(handle) & + bind(C, name='LegendreValuesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: LegendreValuesGet +end function LegendreValuesGet + +!! Set +subroutine LegendreValuesSet(handle, fieldHandle) & + bind(C, name='LegendreValuesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LegendreValuesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalLegendre diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Lepton.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Lepton.f03 new file mode 100644 index 000000000..d3dc411d9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Lepton.f03 @@ -0,0 +1,438 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalLepton +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function LeptonDefaultConst() & + bind(C, name='LeptonDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: LeptonDefaultConst +end function LeptonDefaultConst + +!! Create, default, non-const +function LeptonDefault() & + bind(C, name='LeptonDefault') + use iso_c_binding + implicit none + type(c_ptr) :: LeptonDefault +end function LeptonDefault + +!! Create, general, const +function LeptonCreateConst( & + id, & + generation, & + mass, & + spin, & + parity, & + charge, & + halflife, & + idSize, & + generationSize & +) & + bind(C, name='LeptonCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + integer(c_size_t), intent(in), value :: generationSize + character(c_char), intent(in) :: generation(generationSize) + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: spin + type(c_ptr), intent(in), value :: parity + type(c_ptr), intent(in), value :: charge + type(c_ptr), intent(in), value :: halflife + type(c_ptr) :: LeptonCreateConst +end function LeptonCreateConst + +!! Create, general, non-const +function LeptonCreate( & + id, & + generation, & + mass, & + spin, & + parity, & + charge, & + halflife, & + idSize, & + generationSize & +) & + bind(C, name='LeptonCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + integer(c_size_t), intent(in), value :: generationSize + character(c_char), intent(in) :: generation(generationSize) + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: spin + type(c_ptr), intent(in), value :: parity + type(c_ptr), intent(in), value :: charge + type(c_ptr), intent(in), value :: halflife + type(c_ptr) :: LeptonCreate +end function LeptonCreate + +!! Assign +subroutine LeptonAssign(handleLHS, handleRHS) & + bind(C, name='LeptonAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine LeptonAssign + +!! Delete +subroutine LeptonDelete(handle) & + bind(C, name='LeptonDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LeptonDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function LeptonRead(handle, filename, filenameSize) & + bind(C, name='LeptonRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LeptonRead +end function LeptonRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function LeptonWrite(handle, filename, filenameSize) & + bind(C, name='LeptonWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LeptonWrite +end function LeptonWrite + +!! Print to standard output, in our prettyprinting format +function LeptonPrint(handle) & + bind(C, name='LeptonPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonPrint +end function LeptonPrint + +!! Print to standard output, as XML +function LeptonPrintXML(handle) & + bind(C, name='LeptonPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonPrintXML +end function LeptonPrintXML + +!! Print to standard output, as JSON +function LeptonPrintJSON(handle) & + bind(C, name='LeptonPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonPrintJSON +end function LeptonPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: id +!! ----------------------------------------------------------------------------- + +!! Has +function LeptonIdHas(handle) & + bind(C, name='LeptonIdHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonIdHas +end function LeptonIdHas + +!! Get +function LeptonIdGet(handle) & + bind(C, name='LeptonIdGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LeptonIdGet +end function LeptonIdGet + +!! Set +subroutine LeptonIdSet(handle, id, idSize) & + bind(C, name='LeptonIdSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) +end subroutine LeptonIdSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: generation +!! ----------------------------------------------------------------------------- + +!! Has +function LeptonGenerationHas(handle) & + bind(C, name='LeptonGenerationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonGenerationHas +end function LeptonGenerationHas + +!! Get +function LeptonGenerationGet(handle) & + bind(C, name='LeptonGenerationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LeptonGenerationGet +end function LeptonGenerationGet + +!! Set +subroutine LeptonGenerationSet(handle, generation, generationSize) & + bind(C, name='LeptonGenerationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: generationSize + character(c_char), intent(in) :: generation(generationSize) +end subroutine LeptonGenerationSet + + +!! ----------------------------------------------------------------------------- +!! Child: mass +!! ----------------------------------------------------------------------------- + +!! Has +function LeptonMassHas(handle) & + bind(C, name='LeptonMassHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonMassHas +end function LeptonMassHas + +!! Get, const +function LeptonMassGetConst(handle) & + bind(C, name='LeptonMassGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LeptonMassGetConst +end function LeptonMassGetConst + +!! Get, non-const +function LeptonMassGet(handle) & + bind(C, name='LeptonMassGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: LeptonMassGet +end function LeptonMassGet + +!! Set +subroutine LeptonMassSet(handle, fieldHandle) & + bind(C, name='LeptonMassSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LeptonMassSet + + +!! ----------------------------------------------------------------------------- +!! Child: spin +!! ----------------------------------------------------------------------------- + +!! Has +function LeptonSpinHas(handle) & + bind(C, name='LeptonSpinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonSpinHas +end function LeptonSpinHas + +!! Get, const +function LeptonSpinGetConst(handle) & + bind(C, name='LeptonSpinGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LeptonSpinGetConst +end function LeptonSpinGetConst + +!! Get, non-const +function LeptonSpinGet(handle) & + bind(C, name='LeptonSpinGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: LeptonSpinGet +end function LeptonSpinGet + +!! Set +subroutine LeptonSpinSet(handle, fieldHandle) & + bind(C, name='LeptonSpinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LeptonSpinSet + + +!! ----------------------------------------------------------------------------- +!! Child: parity +!! ----------------------------------------------------------------------------- + +!! Has +function LeptonParityHas(handle) & + bind(C, name='LeptonParityHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonParityHas +end function LeptonParityHas + +!! Get, const +function LeptonParityGetConst(handle) & + bind(C, name='LeptonParityGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LeptonParityGetConst +end function LeptonParityGetConst + +!! Get, non-const +function LeptonParityGet(handle) & + bind(C, name='LeptonParityGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: LeptonParityGet +end function LeptonParityGet + +!! Set +subroutine LeptonParitySet(handle, fieldHandle) & + bind(C, name='LeptonParitySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LeptonParitySet + + +!! ----------------------------------------------------------------------------- +!! Child: charge +!! ----------------------------------------------------------------------------- + +!! Has +function LeptonChargeHas(handle) & + bind(C, name='LeptonChargeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonChargeHas +end function LeptonChargeHas + +!! Get, const +function LeptonChargeGetConst(handle) & + bind(C, name='LeptonChargeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LeptonChargeGetConst +end function LeptonChargeGetConst + +!! Get, non-const +function LeptonChargeGet(handle) & + bind(C, name='LeptonChargeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: LeptonChargeGet +end function LeptonChargeGet + +!! Set +subroutine LeptonChargeSet(handle, fieldHandle) & + bind(C, name='LeptonChargeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LeptonChargeSet + + +!! ----------------------------------------------------------------------------- +!! Child: halflife +!! ----------------------------------------------------------------------------- + +!! Has +function LeptonHalflifeHas(handle) & + bind(C, name='LeptonHalflifeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonHalflifeHas +end function LeptonHalflifeHas + +!! Get, const +function LeptonHalflifeGetConst(handle) & + bind(C, name='LeptonHalflifeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LeptonHalflifeGetConst +end function LeptonHalflifeGetConst + +!! Get, non-const +function LeptonHalflifeGet(handle) & + bind(C, name='LeptonHalflifeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: LeptonHalflifeGet +end function LeptonHalflifeGet + +!! Set +subroutine LeptonHalflifeSet(handle, fieldHandle) & + bind(C, name='LeptonHalflifeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LeptonHalflifeSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalLepton diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Leptons.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Leptons.f03 new file mode 100644 index 000000000..ce2327e22 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Leptons.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalLeptons +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function LeptonsDefaultConst() & + bind(C, name='LeptonsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: LeptonsDefaultConst +end function LeptonsDefaultConst + +!! Create, default, non-const +function LeptonsDefault() & + bind(C, name='LeptonsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: LeptonsDefault +end function LeptonsDefault + +!! Create, general, const +function LeptonsCreateConst( & + lepton, leptonSize & +) & + bind(C, name='LeptonsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: leptonSize + type(c_ptr), intent(in) :: lepton(leptonSize) + type(c_ptr) :: LeptonsCreateConst +end function LeptonsCreateConst + +!! Create, general, non-const +function LeptonsCreate( & + lepton, leptonSize & +) & + bind(C, name='LeptonsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: leptonSize + type(c_ptr), intent(in) :: lepton(leptonSize) + type(c_ptr) :: LeptonsCreate +end function LeptonsCreate + +!! Assign +subroutine LeptonsAssign(handleLHS, handleRHS) & + bind(C, name='LeptonsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine LeptonsAssign + +!! Delete +subroutine LeptonsDelete(handle) & + bind(C, name='LeptonsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LeptonsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function LeptonsRead(handle, filename, filenameSize) & + bind(C, name='LeptonsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LeptonsRead +end function LeptonsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function LeptonsWrite(handle, filename, filenameSize) & + bind(C, name='LeptonsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LeptonsWrite +end function LeptonsWrite + +!! Print to standard output, in our prettyprinting format +function LeptonsPrint(handle) & + bind(C, name='LeptonsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonsPrint +end function LeptonsPrint + +!! Print to standard output, as XML +function LeptonsPrintXML(handle) & + bind(C, name='LeptonsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonsPrintXML +end function LeptonsPrintXML + +!! Print to standard output, as JSON +function LeptonsPrintJSON(handle) & + bind(C, name='LeptonsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonsPrintJSON +end function LeptonsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: lepton +!! ----------------------------------------------------------------------------- + +!! Has +function LeptonsLeptonHas(handle) & + bind(C, name='LeptonsLeptonHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LeptonsLeptonHas +end function LeptonsLeptonHas + +!! Clear +subroutine LeptonsLeptonClear(handle) & + bind(C, name='LeptonsLeptonClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LeptonsLeptonClear + +!! Size +function LeptonsLeptonSize(handle) & + bind(C, name='LeptonsLeptonSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: LeptonsLeptonSize +end function LeptonsLeptonSize + +!! Add +subroutine LeptonsLeptonAdd(handle, fieldHandle) & + bind(C, name='LeptonsLeptonAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LeptonsLeptonAdd + +!! Get, by index \in [0,size), const +function LeptonsLeptonGetConst(handle, index) & + bind(C, name='LeptonsLeptonGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: LeptonsLeptonGetConst +end function LeptonsLeptonGetConst + +!! Get, by index \in [0,size), non-const +function LeptonsLeptonGet(handle, index) & + bind(C, name='LeptonsLeptonGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: LeptonsLeptonGet +end function LeptonsLeptonGet + +!! Set, by index \in [0,size) +subroutine LeptonsLeptonSet(handle, index, fieldHandle) & + bind(C, name='LeptonsLeptonSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LeptonsLeptonSet + +!! ------------------------ +!! Re: metadatum id +!! ------------------------ + +!! Has, by id +function LeptonsLeptonHasById(handle, meta, metaSize) & + bind(C, name='LeptonsLeptonHasById') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: LeptonsLeptonHasById +end function LeptonsLeptonHasById + +!! Get, by id, const +function LeptonsLeptonGetByIdConst(handle, meta, metaSize) & + bind(C, name='LeptonsLeptonGetByIdConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: LeptonsLeptonGetByIdConst +end function LeptonsLeptonGetByIdConst + +!! Get, by id, non-const +function LeptonsLeptonGetById(handle, meta, metaSize) & + bind(C, name='LeptonsLeptonGetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: LeptonsLeptonGetById +end function LeptonsLeptonGetById + +!! Set, by id +subroutine LeptonsLeptonSetById(handle, meta, metaSize, fieldHandle) & + bind(C, name='LeptonsLeptonSetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LeptonsLeptonSetById + +!! ------------------------ +!! Re: metadatum generation +!! ------------------------ + +!! Has, by generation +function LeptonsLeptonHasByGeneration(handle, meta, metaSize) & + bind(C, name='LeptonsLeptonHasByGeneration') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: LeptonsLeptonHasByGeneration +end function LeptonsLeptonHasByGeneration + +!! Get, by generation, const +function LeptonsLeptonGetByGenerationConst(handle, meta, metaSize) & + bind(C, name='LeptonsLeptonGetByGenerationConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: LeptonsLeptonGetByGenerationConst +end function LeptonsLeptonGetByGenerationConst + +!! Get, by generation, non-const +function LeptonsLeptonGetByGeneration(handle, meta, metaSize) & + bind(C, name='LeptonsLeptonGetByGeneration') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: LeptonsLeptonGetByGeneration +end function LeptonsLeptonGetByGeneration + +!! Set, by generation +subroutine LeptonsLeptonSetByGeneration(handle, meta, metaSize, fieldHandle) & + bind(C, name='LeptonsLeptonSetByGeneration') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LeptonsLeptonSetByGeneration + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalLeptons diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/LevelSpacing.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/LevelSpacing.f03 new file mode 100644 index 000000000..c01c56af2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/LevelSpacing.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalLevelSpacing +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function LevelSpacingDefaultConst() & + bind(C, name='LevelSpacingDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: LevelSpacingDefaultConst +end function LevelSpacingDefaultConst + +!! Create, default, non-const +function LevelSpacingDefault() & + bind(C, name='LevelSpacingDefault') + use iso_c_binding + implicit none + type(c_ptr) :: LevelSpacingDefault +end function LevelSpacingDefault + +!! Create, general, const +function LevelSpacingCreateConst( & + XYs1d, & + constant1d & +) & + bind(C, name='LevelSpacingCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: constant1d + type(c_ptr) :: LevelSpacingCreateConst +end function LevelSpacingCreateConst + +!! Create, general, non-const +function LevelSpacingCreate( & + XYs1d, & + constant1d & +) & + bind(C, name='LevelSpacingCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: constant1d + type(c_ptr) :: LevelSpacingCreate +end function LevelSpacingCreate + +!! Assign +subroutine LevelSpacingAssign(handleLHS, handleRHS) & + bind(C, name='LevelSpacingAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine LevelSpacingAssign + +!! Delete +subroutine LevelSpacingDelete(handle) & + bind(C, name='LevelSpacingDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LevelSpacingDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function LevelSpacingRead(handle, filename, filenameSize) & + bind(C, name='LevelSpacingRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LevelSpacingRead +end function LevelSpacingRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function LevelSpacingWrite(handle, filename, filenameSize) & + bind(C, name='LevelSpacingWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LevelSpacingWrite +end function LevelSpacingWrite + +!! Print to standard output, in our prettyprinting format +function LevelSpacingPrint(handle) & + bind(C, name='LevelSpacingPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LevelSpacingPrint +end function LevelSpacingPrint + +!! Print to standard output, as XML +function LevelSpacingPrintXML(handle) & + bind(C, name='LevelSpacingPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LevelSpacingPrintXML +end function LevelSpacingPrintXML + +!! Print to standard output, as JSON +function LevelSpacingPrintJSON(handle) & + bind(C, name='LevelSpacingPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LevelSpacingPrintJSON +end function LevelSpacingPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function LevelSpacingXYs1dHas(handle) & + bind(C, name='LevelSpacingXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LevelSpacingXYs1dHas +end function LevelSpacingXYs1dHas + +!! Get, const +function LevelSpacingXYs1dGetConst(handle) & + bind(C, name='LevelSpacingXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LevelSpacingXYs1dGetConst +end function LevelSpacingXYs1dGetConst + +!! Get, non-const +function LevelSpacingXYs1dGet(handle) & + bind(C, name='LevelSpacingXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: LevelSpacingXYs1dGet +end function LevelSpacingXYs1dGet + +!! Set +subroutine LevelSpacingXYs1dSet(handle, fieldHandle) & + bind(C, name='LevelSpacingXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LevelSpacingXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: constant1d +!! ----------------------------------------------------------------------------- + +!! Has +function LevelSpacingConstant1dHas(handle) & + bind(C, name='LevelSpacingConstant1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LevelSpacingConstant1dHas +end function LevelSpacingConstant1dHas + +!! Get, const +function LevelSpacingConstant1dGetConst(handle) & + bind(C, name='LevelSpacingConstant1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LevelSpacingConstant1dGetConst +end function LevelSpacingConstant1dGetConst + +!! Get, non-const +function LevelSpacingConstant1dGet(handle) & + bind(C, name='LevelSpacingConstant1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: LevelSpacingConstant1dGet +end function LevelSpacingConstant1dGet + +!! Set +subroutine LevelSpacingConstant1dSet(handle, fieldHandle) & + bind(C, name='LevelSpacingConstant1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LevelSpacingConstant1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalLevelSpacing diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Link.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Link.f03 new file mode 100644 index 000000000..fbd109a57 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Link.f03 @@ -0,0 +1,172 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalLink +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function LinkDefaultConst() & + bind(C, name='LinkDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: LinkDefaultConst +end function LinkDefaultConst + +!! Create, default, non-const +function LinkDefault() & + bind(C, name='LinkDefault') + use iso_c_binding + implicit none + type(c_ptr) :: LinkDefault +end function LinkDefault + +!! Create, general, const +function LinkCreateConst( & + href, & + hrefSize & +) & + bind(C, name='LinkCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: LinkCreateConst +end function LinkCreateConst + +!! Create, general, non-const +function LinkCreate( & + href, & + hrefSize & +) & + bind(C, name='LinkCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: LinkCreate +end function LinkCreate + +!! Assign +subroutine LinkAssign(handleLHS, handleRHS) & + bind(C, name='LinkAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine LinkAssign + +!! Delete +subroutine LinkDelete(handle) & + bind(C, name='LinkDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LinkDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function LinkRead(handle, filename, filenameSize) & + bind(C, name='LinkRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LinkRead +end function LinkRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function LinkWrite(handle, filename, filenameSize) & + bind(C, name='LinkWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LinkWrite +end function LinkWrite + +!! Print to standard output, in our prettyprinting format +function LinkPrint(handle) & + bind(C, name='LinkPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LinkPrint +end function LinkPrint + +!! Print to standard output, as XML +function LinkPrintXML(handle) & + bind(C, name='LinkPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LinkPrintXML +end function LinkPrintXML + +!! Print to standard output, as JSON +function LinkPrintJSON(handle) & + bind(C, name='LinkPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LinkPrintJSON +end function LinkPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function LinkHrefHas(handle) & + bind(C, name='LinkHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LinkHrefHas +end function LinkHrefHas + +!! Get +function LinkHrefGet(handle) & + bind(C, name='LinkHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: LinkHrefGet +end function LinkHrefGet + +!! Set +subroutine LinkHrefSet(handle, href, hrefSize) & + bind(C, name='LinkHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine LinkHrefSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalLink diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ListOfCovariances.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ListOfCovariances.f03 new file mode 100644 index 000000000..ec8c2c863 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ListOfCovariances.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalListOfCovariances +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ListOfCovariancesDefaultConst() & + bind(C, name='ListOfCovariancesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ListOfCovariancesDefaultConst +end function ListOfCovariancesDefaultConst + +!! Create, default, non-const +function ListOfCovariancesDefault() & + bind(C, name='ListOfCovariancesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ListOfCovariancesDefault +end function ListOfCovariancesDefault + +!! Create, general, const +function ListOfCovariancesCreateConst( & + covariance, covarianceSize & +) & + bind(C, name='ListOfCovariancesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: covarianceSize + type(c_ptr), intent(in) :: covariance(covarianceSize) + type(c_ptr) :: ListOfCovariancesCreateConst +end function ListOfCovariancesCreateConst + +!! Create, general, non-const +function ListOfCovariancesCreate( & + covariance, covarianceSize & +) & + bind(C, name='ListOfCovariancesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: covarianceSize + type(c_ptr), intent(in) :: covariance(covarianceSize) + type(c_ptr) :: ListOfCovariancesCreate +end function ListOfCovariancesCreate + +!! Assign +subroutine ListOfCovariancesAssign(handleLHS, handleRHS) & + bind(C, name='ListOfCovariancesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ListOfCovariancesAssign + +!! Delete +subroutine ListOfCovariancesDelete(handle) & + bind(C, name='ListOfCovariancesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ListOfCovariancesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ListOfCovariancesRead(handle, filename, filenameSize) & + bind(C, name='ListOfCovariancesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ListOfCovariancesRead +end function ListOfCovariancesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ListOfCovariancesWrite(handle, filename, filenameSize) & + bind(C, name='ListOfCovariancesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ListOfCovariancesWrite +end function ListOfCovariancesWrite + +!! Print to standard output, in our prettyprinting format +function ListOfCovariancesPrint(handle) & + bind(C, name='ListOfCovariancesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ListOfCovariancesPrint +end function ListOfCovariancesPrint + +!! Print to standard output, as XML +function ListOfCovariancesPrintXML(handle) & + bind(C, name='ListOfCovariancesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ListOfCovariancesPrintXML +end function ListOfCovariancesPrintXML + +!! Print to standard output, as JSON +function ListOfCovariancesPrintJSON(handle) & + bind(C, name='ListOfCovariancesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ListOfCovariancesPrintJSON +end function ListOfCovariancesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: covariance +!! ----------------------------------------------------------------------------- + +!! Has +function ListOfCovariancesCovarianceHas(handle) & + bind(C, name='ListOfCovariancesCovarianceHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ListOfCovariancesCovarianceHas +end function ListOfCovariancesCovarianceHas + +!! Clear +subroutine ListOfCovariancesCovarianceClear(handle) & + bind(C, name='ListOfCovariancesCovarianceClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ListOfCovariancesCovarianceClear + +!! Size +function ListOfCovariancesCovarianceSize(handle) & + bind(C, name='ListOfCovariancesCovarianceSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ListOfCovariancesCovarianceSize +end function ListOfCovariancesCovarianceSize + +!! Add +subroutine ListOfCovariancesCovarianceAdd(handle, fieldHandle) & + bind(C, name='ListOfCovariancesCovarianceAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ListOfCovariancesCovarianceAdd + +!! Get, by index \in [0,size), const +function ListOfCovariancesCovarianceGetConst(handle, index) & + bind(C, name='ListOfCovariancesCovarianceGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ListOfCovariancesCovarianceGetConst +end function ListOfCovariancesCovarianceGetConst + +!! Get, by index \in [0,size), non-const +function ListOfCovariancesCovarianceGet(handle, index) & + bind(C, name='ListOfCovariancesCovarianceGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ListOfCovariancesCovarianceGet +end function ListOfCovariancesCovarianceGet + +!! Set, by index \in [0,size) +subroutine ListOfCovariancesCovarianceSet(handle, index, fieldHandle) & + bind(C, name='ListOfCovariancesCovarianceSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ListOfCovariancesCovarianceSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ListOfCovariancesCovarianceHasByLabel(handle, meta, metaSize) & + bind(C, name='ListOfCovariancesCovarianceHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ListOfCovariancesCovarianceHasByLabel +end function ListOfCovariancesCovarianceHasByLabel + +!! Get, by label, const +function ListOfCovariancesCovarianceGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ListOfCovariancesCovarianceGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ListOfCovariancesCovarianceGetByLabelConst +end function ListOfCovariancesCovarianceGetByLabelConst + +!! Get, by label, non-const +function ListOfCovariancesCovarianceGetByLabel(handle, meta, metaSize) & + bind(C, name='ListOfCovariancesCovarianceGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ListOfCovariancesCovarianceGetByLabel +end function ListOfCovariancesCovarianceGetByLabel + +!! Set, by label +subroutine ListOfCovariancesCovarianceSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ListOfCovariancesCovarianceSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ListOfCovariancesCovarianceSetByLabel + +!! ------------------------ +!! Re: metadatum href +!! ------------------------ + +!! Has, by href +function ListOfCovariancesCovarianceHasByHref(handle, meta, metaSize) & + bind(C, name='ListOfCovariancesCovarianceHasByHref') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ListOfCovariancesCovarianceHasByHref +end function ListOfCovariancesCovarianceHasByHref + +!! Get, by href, const +function ListOfCovariancesCovarianceGetByHrefConst(handle, meta, metaSize) & + bind(C, name='ListOfCovariancesCovarianceGetByHrefConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ListOfCovariancesCovarianceGetByHrefConst +end function ListOfCovariancesCovarianceGetByHrefConst + +!! Get, by href, non-const +function ListOfCovariancesCovarianceGetByHref(handle, meta, metaSize) & + bind(C, name='ListOfCovariancesCovarianceGetByHref') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ListOfCovariancesCovarianceGetByHref +end function ListOfCovariancesCovarianceGetByHref + +!! Set, by href +subroutine ListOfCovariancesCovarianceSetByHref(handle, meta, metaSize, fieldHandle) & + bind(C, name='ListOfCovariancesCovarianceSetByHref') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ListOfCovariancesCovarianceSetByHref + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalListOfCovariances diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Ls.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Ls.f03 new file mode 100644 index 000000000..44317a903 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Ls.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalLs +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function LsDefaultConst() & + bind(C, name='LsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: LsDefaultConst +end function LsDefaultConst + +!! Create, default, non-const +function LsDefault() & + bind(C, name='LsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: LsDefault +end function LsDefault + +!! Create, general, const +function LsCreateConst( & + L, LSize & +) & + bind(C, name='LsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: LSize + type(c_ptr), intent(in) :: L(LSize) + type(c_ptr) :: LsCreateConst +end function LsCreateConst + +!! Create, general, non-const +function LsCreate( & + L, LSize & +) & + bind(C, name='LsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: LSize + type(c_ptr), intent(in) :: L(LSize) + type(c_ptr) :: LsCreate +end function LsCreate + +!! Assign +subroutine LsAssign(handleLHS, handleRHS) & + bind(C, name='LsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine LsAssign + +!! Delete +subroutine LsDelete(handle) & + bind(C, name='LsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function LsRead(handle, filename, filenameSize) & + bind(C, name='LsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LsRead +end function LsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function LsWrite(handle, filename, filenameSize) & + bind(C, name='LsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: LsWrite +end function LsWrite + +!! Print to standard output, in our prettyprinting format +function LsPrint(handle) & + bind(C, name='LsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LsPrint +end function LsPrint + +!! Print to standard output, as XML +function LsPrintXML(handle) & + bind(C, name='LsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LsPrintXML +end function LsPrintXML + +!! Print to standard output, as JSON +function LsPrintJSON(handle) & + bind(C, name='LsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LsPrintJSON +end function LsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: L +!! ----------------------------------------------------------------------------- + +!! Has +function LsLHas(handle) & + bind(C, name='LsLHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: LsLHas +end function LsLHas + +!! Clear +subroutine LsLClear(handle) & + bind(C, name='LsLClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine LsLClear + +!! Size +function LsLSize(handle) & + bind(C, name='LsLSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: LsLSize +end function LsLSize + +!! Add +subroutine LsLAdd(handle, fieldHandle) & + bind(C, name='LsLAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LsLAdd + +!! Get, by index \in [0,size), const +function LsLGetConst(handle, index) & + bind(C, name='LsLGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: LsLGetConst +end function LsLGetConst + +!! Get, by index \in [0,size), non-const +function LsLGet(handle, index) & + bind(C, name='LsLGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: LsLGet +end function LsLGet + +!! Set, by index \in [0,size) +subroutine LsLSet(handle, index, fieldHandle) & + bind(C, name='LsLSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LsLSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function LsLHasByLabel(handle, meta, metaSize) & + bind(C, name='LsLHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: LsLHasByLabel +end function LsLHasByLabel + +!! Get, by label, const +function LsLGetByLabelConst(handle, meta, metaSize) & + bind(C, name='LsLGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: LsLGetByLabelConst +end function LsLGetByLabelConst + +!! Get, by label, non-const +function LsLGetByLabel(handle, meta, metaSize) & + bind(C, name='LsLGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: LsLGetByLabel +end function LsLGetByLabel + +!! Set, by label +subroutine LsLSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='LsLSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LsLSetByLabel + +!! ------------------------ +!! Re: metadatum value +!! ------------------------ + +!! Has, by value +function LsLHasByValue(handle, meta) & + bind(C, name='LsLHasByValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: LsLHasByValue +end function LsLHasByValue + +!! Get, by value, const +function LsLGetByValueConst(handle, meta) & + bind(C, name='LsLGetByValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: LsLGetByValueConst +end function LsLGetByValueConst + +!! Get, by value, non-const +function LsLGetByValue(handle, meta) & + bind(C, name='LsLGetByValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: LsLGetByValue +end function LsLGetByValue + +!! Set, by value +subroutine LsLSetByValue(handle, meta, fieldHandle) & + bind(C, name='LsLSetByValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine LsLSetByValue + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalLs diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MadlandNix.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MadlandNix.f03 new file mode 100644 index 000000000..ff0409158 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MadlandNix.f03 @@ -0,0 +1,266 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalMadlandNix +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function MadlandNixDefaultConst() & + bind(C, name='MadlandNixDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: MadlandNixDefaultConst +end function MadlandNixDefaultConst + +!! Create, default, non-const +function MadlandNixDefault() & + bind(C, name='MadlandNixDefault') + use iso_c_binding + implicit none + type(c_ptr) :: MadlandNixDefault +end function MadlandNixDefault + +!! Create, general, const +function MadlandNixCreateConst( & + EFL, & + EFH, & + T_M & +) & + bind(C, name='MadlandNixCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: EFL + type(c_ptr), intent(in), value :: EFH + type(c_ptr), intent(in), value :: T_M + type(c_ptr) :: MadlandNixCreateConst +end function MadlandNixCreateConst + +!! Create, general, non-const +function MadlandNixCreate( & + EFL, & + EFH, & + T_M & +) & + bind(C, name='MadlandNixCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: EFL + type(c_ptr), intent(in), value :: EFH + type(c_ptr), intent(in), value :: T_M + type(c_ptr) :: MadlandNixCreate +end function MadlandNixCreate + +!! Assign +subroutine MadlandNixAssign(handleLHS, handleRHS) & + bind(C, name='MadlandNixAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine MadlandNixAssign + +!! Delete +subroutine MadlandNixDelete(handle) & + bind(C, name='MadlandNixDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine MadlandNixDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function MadlandNixRead(handle, filename, filenameSize) & + bind(C, name='MadlandNixRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MadlandNixRead +end function MadlandNixRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function MadlandNixWrite(handle, filename, filenameSize) & + bind(C, name='MadlandNixWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MadlandNixWrite +end function MadlandNixWrite + +!! Print to standard output, in our prettyprinting format +function MadlandNixPrint(handle) & + bind(C, name='MadlandNixPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MadlandNixPrint +end function MadlandNixPrint + +!! Print to standard output, as XML +function MadlandNixPrintXML(handle) & + bind(C, name='MadlandNixPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MadlandNixPrintXML +end function MadlandNixPrintXML + +!! Print to standard output, as JSON +function MadlandNixPrintJSON(handle) & + bind(C, name='MadlandNixPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MadlandNixPrintJSON +end function MadlandNixPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: EFL +!! ----------------------------------------------------------------------------- + +!! Has +function MadlandNixEFLHas(handle) & + bind(C, name='MadlandNixEFLHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MadlandNixEFLHas +end function MadlandNixEFLHas + +!! Get, const +function MadlandNixEFLGetConst(handle) & + bind(C, name='MadlandNixEFLGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MadlandNixEFLGetConst +end function MadlandNixEFLGetConst + +!! Get, non-const +function MadlandNixEFLGet(handle) & + bind(C, name='MadlandNixEFLGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MadlandNixEFLGet +end function MadlandNixEFLGet + +!! Set +subroutine MadlandNixEFLSet(handle, fieldHandle) & + bind(C, name='MadlandNixEFLSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MadlandNixEFLSet + + +!! ----------------------------------------------------------------------------- +!! Child: EFH +!! ----------------------------------------------------------------------------- + +!! Has +function MadlandNixEFHHas(handle) & + bind(C, name='MadlandNixEFHHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MadlandNixEFHHas +end function MadlandNixEFHHas + +!! Get, const +function MadlandNixEFHGetConst(handle) & + bind(C, name='MadlandNixEFHGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MadlandNixEFHGetConst +end function MadlandNixEFHGetConst + +!! Get, non-const +function MadlandNixEFHGet(handle) & + bind(C, name='MadlandNixEFHGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MadlandNixEFHGet +end function MadlandNixEFHGet + +!! Set +subroutine MadlandNixEFHSet(handle, fieldHandle) & + bind(C, name='MadlandNixEFHSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MadlandNixEFHSet + + +!! ----------------------------------------------------------------------------- +!! Child: T_M +!! ----------------------------------------------------------------------------- + +!! Has +function MadlandNixT_MHas(handle) & + bind(C, name='MadlandNixT_MHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MadlandNixT_MHas +end function MadlandNixT_MHas + +!! Get, const +function MadlandNixT_MGetConst(handle) & + bind(C, name='MadlandNixT_MGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MadlandNixT_MGetConst +end function MadlandNixT_MGetConst + +!! Get, non-const +function MadlandNixT_MGet(handle) & + bind(C, name='MadlandNixT_MGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MadlandNixT_MGet +end function MadlandNixT_MGet + +!! Set +subroutine MadlandNixT_MSet(handle, fieldHandle) & + bind(C, name='MadlandNixT_MSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MadlandNixT_MSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalMadlandNix diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Mass.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Mass.f03 new file mode 100644 index 000000000..80f607a35 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Mass.f03 @@ -0,0 +1,253 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalMass +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function MassDefaultConst() & + bind(C, name='MassDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: MassDefaultConst +end function MassDefaultConst + +!! Create, default, non-const +function MassDefault() & + bind(C, name='MassDefault') + use iso_c_binding + implicit none + type(c_ptr) :: MassDefault +end function MassDefault + +!! Create, general, const +function MassCreateConst( & + value, & + unit, & + Double, & + unitSize & +) & + bind(C, name='MassCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: MassCreateConst +end function MassCreateConst + +!! Create, general, non-const +function MassCreate( & + value, & + unit, & + Double, & + unitSize & +) & + bind(C, name='MassCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: MassCreate +end function MassCreate + +!! Assign +subroutine MassAssign(handleLHS, handleRHS) & + bind(C, name='MassAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine MassAssign + +!! Delete +subroutine MassDelete(handle) & + bind(C, name='MassDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine MassDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function MassRead(handle, filename, filenameSize) & + bind(C, name='MassRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MassRead +end function MassRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function MassWrite(handle, filename, filenameSize) & + bind(C, name='MassWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MassWrite +end function MassWrite + +!! Print to standard output, in our prettyprinting format +function MassPrint(handle) & + bind(C, name='MassPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MassPrint +end function MassPrint + +!! Print to standard output, as XML +function MassPrintXML(handle) & + bind(C, name='MassPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MassPrintXML +end function MassPrintXML + +!! Print to standard output, as JSON +function MassPrintJSON(handle) & + bind(C, name='MassPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MassPrintJSON +end function MassPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function MassValueHas(handle) & + bind(C, name='MassValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MassValueHas +end function MassValueHas + +!! Get +function MassValueGet(handle) & + bind(C, name='MassValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: MassValueGet +end function MassValueGet + +!! Set +subroutine MassValueSet(handle, value) & + bind(C, name='MassValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine MassValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function MassUnitHas(handle) & + bind(C, name='MassUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MassUnitHas +end function MassUnitHas + +!! Get +function MassUnitGet(handle) & + bind(C, name='MassUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MassUnitGet +end function MassUnitGet + +!! Set +subroutine MassUnitSet(handle, unit, unitSize) & + bind(C, name='MassUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine MassUnitSet + + +!! ----------------------------------------------------------------------------- +!! Child: Double +!! ----------------------------------------------------------------------------- + +!! Has +function MassDoubleHas(handle) & + bind(C, name='MassDoubleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MassDoubleHas +end function MassDoubleHas + +!! Get, const +function MassDoubleGetConst(handle) & + bind(C, name='MassDoubleGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MassDoubleGetConst +end function MassDoubleGetConst + +!! Get, non-const +function MassDoubleGet(handle) & + bind(C, name='MassDoubleGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MassDoubleGet +end function MassDoubleGet + +!! Set +subroutine MassDoubleSet(handle, fieldHandle) & + bind(C, name='MassDoubleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MassDoubleSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalMass diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MetaStable.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MetaStable.f03 new file mode 100644 index 000000000..b79ee940f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MetaStable.f03 @@ -0,0 +1,249 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalMetaStable +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function MetaStableDefaultConst() & + bind(C, name='MetaStableDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: MetaStableDefaultConst +end function MetaStableDefaultConst + +!! Create, default, non-const +function MetaStableDefault() & + bind(C, name='MetaStableDefault') + use iso_c_binding + implicit none + type(c_ptr) :: MetaStableDefault +end function MetaStableDefault + +!! Create, general, const +function MetaStableCreateConst( & + id, & + pid, & + metaStableIndex, & + idSize, & + pidSize & +) & + bind(C, name='MetaStableCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_int), intent(in), value :: metaStableIndex + type(c_ptr) :: MetaStableCreateConst +end function MetaStableCreateConst + +!! Create, general, non-const +function MetaStableCreate( & + id, & + pid, & + metaStableIndex, & + idSize, & + pidSize & +) & + bind(C, name='MetaStableCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_int), intent(in), value :: metaStableIndex + type(c_ptr) :: MetaStableCreate +end function MetaStableCreate + +!! Assign +subroutine MetaStableAssign(handleLHS, handleRHS) & + bind(C, name='MetaStableAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine MetaStableAssign + +!! Delete +subroutine MetaStableDelete(handle) & + bind(C, name='MetaStableDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine MetaStableDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function MetaStableRead(handle, filename, filenameSize) & + bind(C, name='MetaStableRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MetaStableRead +end function MetaStableRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function MetaStableWrite(handle, filename, filenameSize) & + bind(C, name='MetaStableWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MetaStableWrite +end function MetaStableWrite + +!! Print to standard output, in our prettyprinting format +function MetaStablePrint(handle) & + bind(C, name='MetaStablePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MetaStablePrint +end function MetaStablePrint + +!! Print to standard output, as XML +function MetaStablePrintXML(handle) & + bind(C, name='MetaStablePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MetaStablePrintXML +end function MetaStablePrintXML + +!! Print to standard output, as JSON +function MetaStablePrintJSON(handle) & + bind(C, name='MetaStablePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MetaStablePrintJSON +end function MetaStablePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: id +!! ----------------------------------------------------------------------------- + +!! Has +function MetaStableIdHas(handle) & + bind(C, name='MetaStableIdHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MetaStableIdHas +end function MetaStableIdHas + +!! Get +function MetaStableIdGet(handle) & + bind(C, name='MetaStableIdGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MetaStableIdGet +end function MetaStableIdGet + +!! Set +subroutine MetaStableIdSet(handle, id, idSize) & + bind(C, name='MetaStableIdSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) +end subroutine MetaStableIdSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function MetaStablePidHas(handle) & + bind(C, name='MetaStablePidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MetaStablePidHas +end function MetaStablePidHas + +!! Get +function MetaStablePidGet(handle) & + bind(C, name='MetaStablePidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MetaStablePidGet +end function MetaStablePidGet + +!! Set +subroutine MetaStablePidSet(handle, pid, pidSize) & + bind(C, name='MetaStablePidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine MetaStablePidSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: metaStableIndex +!! ----------------------------------------------------------------------------- + +!! Has +function MetaStableMetaStableIndexHas(handle) & + bind(C, name='MetaStableMetaStableIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MetaStableMetaStableIndexHas +end function MetaStableMetaStableIndexHas + +!! Get +function MetaStableMetaStableIndexGet(handle) & + bind(C, name='MetaStableMetaStableIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MetaStableMetaStableIndexGet +end function MetaStableMetaStableIndexGet + +!! Set +subroutine MetaStableMetaStableIndexSet(handle, metaStableIndex) & + bind(C, name='MetaStableMetaStableIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: metaStableIndex +end subroutine MetaStableMetaStableIndexSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalMetaStable diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Mixed.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Mixed.f03 new file mode 100644 index 000000000..169afe9c7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Mixed.f03 @@ -0,0 +1,697 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalMixed +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function MixedDefaultConst() & + bind(C, name='MixedDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: MixedDefaultConst +end function MixedDefaultConst + +!! Create, default, non-const +function MixedDefault() & + bind(C, name='MixedDefault') + use iso_c_binding + implicit none + type(c_ptr) :: MixedDefault +end function MixedDefault + +!! Create, general, const +function MixedCreateConst( & + label, & + covarianceMatrix, covarianceMatrixSize, & + sum, sumSize, & + shortRangeSelfScalingVariance, & + labelSize & +) & + bind(C, name='MixedCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: covarianceMatrixSize + type(c_ptr), intent(in) :: covarianceMatrix(covarianceMatrixSize) + integer(c_size_t), intent(in), value :: sumSize + type(c_ptr), intent(in) :: sum(sumSize) + type(c_ptr), intent(in), value :: shortRangeSelfScalingVariance + type(c_ptr) :: MixedCreateConst +end function MixedCreateConst + +!! Create, general, non-const +function MixedCreate( & + label, & + covarianceMatrix, covarianceMatrixSize, & + sum, sumSize, & + shortRangeSelfScalingVariance, & + labelSize & +) & + bind(C, name='MixedCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: covarianceMatrixSize + type(c_ptr), intent(in) :: covarianceMatrix(covarianceMatrixSize) + integer(c_size_t), intent(in), value :: sumSize + type(c_ptr), intent(in) :: sum(sumSize) + type(c_ptr), intent(in), value :: shortRangeSelfScalingVariance + type(c_ptr) :: MixedCreate +end function MixedCreate + +!! Assign +subroutine MixedAssign(handleLHS, handleRHS) & + bind(C, name='MixedAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine MixedAssign + +!! Delete +subroutine MixedDelete(handle) & + bind(C, name='MixedDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine MixedDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function MixedRead(handle, filename, filenameSize) & + bind(C, name='MixedRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MixedRead +end function MixedRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function MixedWrite(handle, filename, filenameSize) & + bind(C, name='MixedWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MixedWrite +end function MixedWrite + +!! Print to standard output, in our prettyprinting format +function MixedPrint(handle) & + bind(C, name='MixedPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MixedPrint +end function MixedPrint + +!! Print to standard output, as XML +function MixedPrintXML(handle) & + bind(C, name='MixedPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MixedPrintXML +end function MixedPrintXML + +!! Print to standard output, as JSON +function MixedPrintJSON(handle) & + bind(C, name='MixedPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MixedPrintJSON +end function MixedPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function MixedLabelHas(handle) & + bind(C, name='MixedLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MixedLabelHas +end function MixedLabelHas + +!! Get +function MixedLabelGet(handle) & + bind(C, name='MixedLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MixedLabelGet +end function MixedLabelGet + +!! Set +subroutine MixedLabelSet(handle, label, labelSize) & + bind(C, name='MixedLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine MixedLabelSet + + +!! ----------------------------------------------------------------------------- +!! Child: covarianceMatrix +!! ----------------------------------------------------------------------------- + +!! Has +function MixedCovarianceMatrixHas(handle) & + bind(C, name='MixedCovarianceMatrixHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MixedCovarianceMatrixHas +end function MixedCovarianceMatrixHas + +!! Clear +subroutine MixedCovarianceMatrixClear(handle) & + bind(C, name='MixedCovarianceMatrixClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine MixedCovarianceMatrixClear + +!! Size +function MixedCovarianceMatrixSize(handle) & + bind(C, name='MixedCovarianceMatrixSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: MixedCovarianceMatrixSize +end function MixedCovarianceMatrixSize + +!! Add +subroutine MixedCovarianceMatrixAdd(handle, fieldHandle) & + bind(C, name='MixedCovarianceMatrixAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedCovarianceMatrixAdd + +!! Get, by index \in [0,size), const +function MixedCovarianceMatrixGetConst(handle, index) & + bind(C, name='MixedCovarianceMatrixGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: MixedCovarianceMatrixGetConst +end function MixedCovarianceMatrixGetConst + +!! Get, by index \in [0,size), non-const +function MixedCovarianceMatrixGet(handle, index) & + bind(C, name='MixedCovarianceMatrixGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: MixedCovarianceMatrixGet +end function MixedCovarianceMatrixGet + +!! Set, by index \in [0,size) +subroutine MixedCovarianceMatrixSet(handle, index, fieldHandle) & + bind(C, name='MixedCovarianceMatrixSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedCovarianceMatrixSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function MixedCovarianceMatrixHasByLabel(handle, meta, metaSize) & + bind(C, name='MixedCovarianceMatrixHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: MixedCovarianceMatrixHasByLabel +end function MixedCovarianceMatrixHasByLabel + +!! Get, by label, const +function MixedCovarianceMatrixGetByLabelConst(handle, meta, metaSize) & + bind(C, name='MixedCovarianceMatrixGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MixedCovarianceMatrixGetByLabelConst +end function MixedCovarianceMatrixGetByLabelConst + +!! Get, by label, non-const +function MixedCovarianceMatrixGetByLabel(handle, meta, metaSize) & + bind(C, name='MixedCovarianceMatrixGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MixedCovarianceMatrixGetByLabel +end function MixedCovarianceMatrixGetByLabel + +!! Set, by label +subroutine MixedCovarianceMatrixSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='MixedCovarianceMatrixSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedCovarianceMatrixSetByLabel + +!! ------------------------ +!! Re: metadatum type +!! ------------------------ + +!! Has, by type +function MixedCovarianceMatrixHasByType(handle, meta, metaSize) & + bind(C, name='MixedCovarianceMatrixHasByType') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: MixedCovarianceMatrixHasByType +end function MixedCovarianceMatrixHasByType + +!! Get, by type, const +function MixedCovarianceMatrixGetByTypeConst(handle, meta, metaSize) & + bind(C, name='MixedCovarianceMatrixGetByTypeConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MixedCovarianceMatrixGetByTypeConst +end function MixedCovarianceMatrixGetByTypeConst + +!! Get, by type, non-const +function MixedCovarianceMatrixGetByType(handle, meta, metaSize) & + bind(C, name='MixedCovarianceMatrixGetByType') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MixedCovarianceMatrixGetByType +end function MixedCovarianceMatrixGetByType + +!! Set, by type +subroutine MixedCovarianceMatrixSetByType(handle, meta, metaSize, fieldHandle) & + bind(C, name='MixedCovarianceMatrixSetByType') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedCovarianceMatrixSetByType + +!! ------------------------ +!! Re: metadatum productFrame +!! ------------------------ + +!! Has, by productFrame +function MixedCovarianceMatrixHasByProductFrame(handle, meta, metaSize) & + bind(C, name='MixedCovarianceMatrixHasByProductFrame') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: MixedCovarianceMatrixHasByProductFrame +end function MixedCovarianceMatrixHasByProductFrame + +!! Get, by productFrame, const +function MixedCovarianceMatrixGetByProductFrameConst(handle, meta, metaSize) & + bind(C, name='MixedCovarianceMatrixGetByProductFrameConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MixedCovarianceMatrixGetByProductFrameConst +end function MixedCovarianceMatrixGetByProductFrameConst + +!! Get, by productFrame, non-const +function MixedCovarianceMatrixGetByProductFrame(handle, meta, metaSize) & + bind(C, name='MixedCovarianceMatrixGetByProductFrame') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MixedCovarianceMatrixGetByProductFrame +end function MixedCovarianceMatrixGetByProductFrame + +!! Set, by productFrame +subroutine MixedCovarianceMatrixSetByProductFrame(handle, meta, metaSize, fieldHandle) & + bind(C, name='MixedCovarianceMatrixSetByProductFrame') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedCovarianceMatrixSetByProductFrame + + +!! ----------------------------------------------------------------------------- +!! Child: sum +!! ----------------------------------------------------------------------------- + +!! Has +function MixedSumHas(handle) & + bind(C, name='MixedSumHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MixedSumHas +end function MixedSumHas + +!! Clear +subroutine MixedSumClear(handle) & + bind(C, name='MixedSumClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine MixedSumClear + +!! Size +function MixedSumSize(handle) & + bind(C, name='MixedSumSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: MixedSumSize +end function MixedSumSize + +!! Add +subroutine MixedSumAdd(handle, fieldHandle) & + bind(C, name='MixedSumAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedSumAdd + +!! Get, by index \in [0,size), const +function MixedSumGetConst(handle, index) & + bind(C, name='MixedSumGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: MixedSumGetConst +end function MixedSumGetConst + +!! Get, by index \in [0,size), non-const +function MixedSumGet(handle, index) & + bind(C, name='MixedSumGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: MixedSumGet +end function MixedSumGet + +!! Set, by index \in [0,size) +subroutine MixedSumSet(handle, index, fieldHandle) & + bind(C, name='MixedSumSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedSumSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function MixedSumHasByLabel(handle, meta, metaSize) & + bind(C, name='MixedSumHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: MixedSumHasByLabel +end function MixedSumHasByLabel + +!! Get, by label, const +function MixedSumGetByLabelConst(handle, meta, metaSize) & + bind(C, name='MixedSumGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MixedSumGetByLabelConst +end function MixedSumGetByLabelConst + +!! Get, by label, non-const +function MixedSumGetByLabel(handle, meta, metaSize) & + bind(C, name='MixedSumGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MixedSumGetByLabel +end function MixedSumGetByLabel + +!! Set, by label +subroutine MixedSumSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='MixedSumSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedSumSetByLabel + +!! ------------------------ +!! Re: metadatum domainMin +!! ------------------------ + +!! Has, by domainMin +function MixedSumHasByDomainMin(handle, meta) & + bind(C, name='MixedSumHasByDomainMin') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: MixedSumHasByDomainMin +end function MixedSumHasByDomainMin + +!! Get, by domainMin, const +function MixedSumGetByDomainMinConst(handle, meta) & + bind(C, name='MixedSumGetByDomainMinConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: MixedSumGetByDomainMinConst +end function MixedSumGetByDomainMinConst + +!! Get, by domainMin, non-const +function MixedSumGetByDomainMin(handle, meta) & + bind(C, name='MixedSumGetByDomainMin') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: MixedSumGetByDomainMin +end function MixedSumGetByDomainMin + +!! Set, by domainMin +subroutine MixedSumSetByDomainMin(handle, meta, fieldHandle) & + bind(C, name='MixedSumSetByDomainMin') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedSumSetByDomainMin + +!! ------------------------ +!! Re: metadatum domainMax +!! ------------------------ + +!! Has, by domainMax +function MixedSumHasByDomainMax(handle, meta) & + bind(C, name='MixedSumHasByDomainMax') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: MixedSumHasByDomainMax +end function MixedSumHasByDomainMax + +!! Get, by domainMax, const +function MixedSumGetByDomainMaxConst(handle, meta) & + bind(C, name='MixedSumGetByDomainMaxConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: MixedSumGetByDomainMaxConst +end function MixedSumGetByDomainMaxConst + +!! Get, by domainMax, non-const +function MixedSumGetByDomainMax(handle, meta) & + bind(C, name='MixedSumGetByDomainMax') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: MixedSumGetByDomainMax +end function MixedSumGetByDomainMax + +!! Set, by domainMax +subroutine MixedSumSetByDomainMax(handle, meta, fieldHandle) & + bind(C, name='MixedSumSetByDomainMax') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedSumSetByDomainMax + +!! ------------------------ +!! Re: metadatum domainUnit +!! ------------------------ + +!! Has, by domainUnit +function MixedSumHasByDomainUnit(handle, meta, metaSize) & + bind(C, name='MixedSumHasByDomainUnit') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: MixedSumHasByDomainUnit +end function MixedSumHasByDomainUnit + +!! Get, by domainUnit, const +function MixedSumGetByDomainUnitConst(handle, meta, metaSize) & + bind(C, name='MixedSumGetByDomainUnitConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MixedSumGetByDomainUnitConst +end function MixedSumGetByDomainUnitConst + +!! Get, by domainUnit, non-const +function MixedSumGetByDomainUnit(handle, meta, metaSize) & + bind(C, name='MixedSumGetByDomainUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MixedSumGetByDomainUnit +end function MixedSumGetByDomainUnit + +!! Set, by domainUnit +subroutine MixedSumSetByDomainUnit(handle, meta, metaSize, fieldHandle) & + bind(C, name='MixedSumSetByDomainUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedSumSetByDomainUnit + + +!! ----------------------------------------------------------------------------- +!! Child: shortRangeSelfScalingVariance +!! ----------------------------------------------------------------------------- + +!! Has +function MixedShortRangeSelfScalingVarianceHas(handle) & + bind(C, name='MixedShortRangeSelfScalingVarianceHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MixedShortRangeSelfScalingVarianceHas +end function MixedShortRangeSelfScalingVarianceHas + +!! Get, const +function MixedShortRangeSelfScalingVarianceGetConst(handle) & + bind(C, name='MixedShortRangeSelfScalingVarianceGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MixedShortRangeSelfScalingVarianceGetConst +end function MixedShortRangeSelfScalingVarianceGetConst + +!! Get, non-const +function MixedShortRangeSelfScalingVarianceGet(handle) & + bind(C, name='MixedShortRangeSelfScalingVarianceGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MixedShortRangeSelfScalingVarianceGet +end function MixedShortRangeSelfScalingVarianceGet + +!! Set +subroutine MixedShortRangeSelfScalingVarianceSet(handle, fieldHandle) & + bind(C, name='MixedShortRangeSelfScalingVarianceSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MixedShortRangeSelfScalingVarianceSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalMixed diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Multiplicity.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Multiplicity.f03 new file mode 100644 index 000000000..ef96d74a3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Multiplicity.f03 @@ -0,0 +1,491 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalMultiplicity +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function MultiplicityDefaultConst() & + bind(C, name='MultiplicityDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: MultiplicityDefaultConst +end function MultiplicityDefaultConst + +!! Create, default, non-const +function MultiplicityDefault() & + bind(C, name='MultiplicityDefault') + use iso_c_binding + implicit none + type(c_ptr) :: MultiplicityDefault +end function MultiplicityDefault + +!! Create, general, const +function MultiplicityCreateConst( & + constant1d, & + XYs1d, & + regions1d, & + polynomial1d, & + reference, & + branching1d, & + branching3d, & + unspecified & +) & + bind(C, name='MultiplicityCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: constant1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr), intent(in), value :: reference + type(c_ptr), intent(in), value :: branching1d + type(c_ptr), intent(in), value :: branching3d + type(c_ptr), intent(in), value :: unspecified + type(c_ptr) :: MultiplicityCreateConst +end function MultiplicityCreateConst + +!! Create, general, non-const +function MultiplicityCreate( & + constant1d, & + XYs1d, & + regions1d, & + polynomial1d, & + reference, & + branching1d, & + branching3d, & + unspecified & +) & + bind(C, name='MultiplicityCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: constant1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr), intent(in), value :: reference + type(c_ptr), intent(in), value :: branching1d + type(c_ptr), intent(in), value :: branching3d + type(c_ptr), intent(in), value :: unspecified + type(c_ptr) :: MultiplicityCreate +end function MultiplicityCreate + +!! Assign +subroutine MultiplicityAssign(handleLHS, handleRHS) & + bind(C, name='MultiplicityAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine MultiplicityAssign + +!! Delete +subroutine MultiplicityDelete(handle) & + bind(C, name='MultiplicityDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine MultiplicityDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function MultiplicityRead(handle, filename, filenameSize) & + bind(C, name='MultiplicityRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MultiplicityRead +end function MultiplicityRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function MultiplicityWrite(handle, filename, filenameSize) & + bind(C, name='MultiplicityWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MultiplicityWrite +end function MultiplicityWrite + +!! Print to standard output, in our prettyprinting format +function MultiplicityPrint(handle) & + bind(C, name='MultiplicityPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicityPrint +end function MultiplicityPrint + +!! Print to standard output, as XML +function MultiplicityPrintXML(handle) & + bind(C, name='MultiplicityPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicityPrintXML +end function MultiplicityPrintXML + +!! Print to standard output, as JSON +function MultiplicityPrintJSON(handle) & + bind(C, name='MultiplicityPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicityPrintJSON +end function MultiplicityPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: constant1d +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicityConstant1dHas(handle) & + bind(C, name='MultiplicityConstant1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicityConstant1dHas +end function MultiplicityConstant1dHas + +!! Get, const +function MultiplicityConstant1dGetConst(handle) & + bind(C, name='MultiplicityConstant1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MultiplicityConstant1dGetConst +end function MultiplicityConstant1dGetConst + +!! Get, non-const +function MultiplicityConstant1dGet(handle) & + bind(C, name='MultiplicityConstant1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MultiplicityConstant1dGet +end function MultiplicityConstant1dGet + +!! Set +subroutine MultiplicityConstant1dSet(handle, fieldHandle) & + bind(C, name='MultiplicityConstant1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicityConstant1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicityXYs1dHas(handle) & + bind(C, name='MultiplicityXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicityXYs1dHas +end function MultiplicityXYs1dHas + +!! Get, const +function MultiplicityXYs1dGetConst(handle) & + bind(C, name='MultiplicityXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MultiplicityXYs1dGetConst +end function MultiplicityXYs1dGetConst + +!! Get, non-const +function MultiplicityXYs1dGet(handle) & + bind(C, name='MultiplicityXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MultiplicityXYs1dGet +end function MultiplicityXYs1dGet + +!! Set +subroutine MultiplicityXYs1dSet(handle, fieldHandle) & + bind(C, name='MultiplicityXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicityXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: regions1d +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicityRegions1dHas(handle) & + bind(C, name='MultiplicityRegions1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicityRegions1dHas +end function MultiplicityRegions1dHas + +!! Get, const +function MultiplicityRegions1dGetConst(handle) & + bind(C, name='MultiplicityRegions1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MultiplicityRegions1dGetConst +end function MultiplicityRegions1dGetConst + +!! Get, non-const +function MultiplicityRegions1dGet(handle) & + bind(C, name='MultiplicityRegions1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MultiplicityRegions1dGet +end function MultiplicityRegions1dGet + +!! Set +subroutine MultiplicityRegions1dSet(handle, fieldHandle) & + bind(C, name='MultiplicityRegions1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicityRegions1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: polynomial1d +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicityPolynomial1dHas(handle) & + bind(C, name='MultiplicityPolynomial1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicityPolynomial1dHas +end function MultiplicityPolynomial1dHas + +!! Get, const +function MultiplicityPolynomial1dGetConst(handle) & + bind(C, name='MultiplicityPolynomial1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MultiplicityPolynomial1dGetConst +end function MultiplicityPolynomial1dGetConst + +!! Get, non-const +function MultiplicityPolynomial1dGet(handle) & + bind(C, name='MultiplicityPolynomial1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MultiplicityPolynomial1dGet +end function MultiplicityPolynomial1dGet + +!! Set +subroutine MultiplicityPolynomial1dSet(handle, fieldHandle) & + bind(C, name='MultiplicityPolynomial1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicityPolynomial1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: reference +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicityReferenceHas(handle) & + bind(C, name='MultiplicityReferenceHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicityReferenceHas +end function MultiplicityReferenceHas + +!! Get, const +function MultiplicityReferenceGetConst(handle) & + bind(C, name='MultiplicityReferenceGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MultiplicityReferenceGetConst +end function MultiplicityReferenceGetConst + +!! Get, non-const +function MultiplicityReferenceGet(handle) & + bind(C, name='MultiplicityReferenceGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MultiplicityReferenceGet +end function MultiplicityReferenceGet + +!! Set +subroutine MultiplicityReferenceSet(handle, fieldHandle) & + bind(C, name='MultiplicityReferenceSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicityReferenceSet + + +!! ----------------------------------------------------------------------------- +!! Child: branching1d +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicityBranching1dHas(handle) & + bind(C, name='MultiplicityBranching1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicityBranching1dHas +end function MultiplicityBranching1dHas + +!! Get, const +function MultiplicityBranching1dGetConst(handle) & + bind(C, name='MultiplicityBranching1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MultiplicityBranching1dGetConst +end function MultiplicityBranching1dGetConst + +!! Get, non-const +function MultiplicityBranching1dGet(handle) & + bind(C, name='MultiplicityBranching1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MultiplicityBranching1dGet +end function MultiplicityBranching1dGet + +!! Set +subroutine MultiplicityBranching1dSet(handle, fieldHandle) & + bind(C, name='MultiplicityBranching1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicityBranching1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: branching3d +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicityBranching3dHas(handle) & + bind(C, name='MultiplicityBranching3dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicityBranching3dHas +end function MultiplicityBranching3dHas + +!! Get, const +function MultiplicityBranching3dGetConst(handle) & + bind(C, name='MultiplicityBranching3dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MultiplicityBranching3dGetConst +end function MultiplicityBranching3dGetConst + +!! Get, non-const +function MultiplicityBranching3dGet(handle) & + bind(C, name='MultiplicityBranching3dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MultiplicityBranching3dGet +end function MultiplicityBranching3dGet + +!! Set +subroutine MultiplicityBranching3dSet(handle, fieldHandle) & + bind(C, name='MultiplicityBranching3dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicityBranching3dSet + + +!! ----------------------------------------------------------------------------- +!! Child: unspecified +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicityUnspecifiedHas(handle) & + bind(C, name='MultiplicityUnspecifiedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicityUnspecifiedHas +end function MultiplicityUnspecifiedHas + +!! Get, const +function MultiplicityUnspecifiedGetConst(handle) & + bind(C, name='MultiplicityUnspecifiedGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MultiplicityUnspecifiedGetConst +end function MultiplicityUnspecifiedGetConst + +!! Get, non-const +function MultiplicityUnspecifiedGet(handle) & + bind(C, name='MultiplicityUnspecifiedGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MultiplicityUnspecifiedGet +end function MultiplicityUnspecifiedGet + +!! Set +subroutine MultiplicityUnspecifiedSet(handle, fieldHandle) & + bind(C, name='MultiplicityUnspecifiedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicityUnspecifiedSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalMultiplicity diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MultiplicitySum.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MultiplicitySum.f03 new file mode 100644 index 000000000..55d57b7b2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MultiplicitySum.f03 @@ -0,0 +1,298 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalMultiplicitySum +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function MultiplicitySumDefaultConst() & + bind(C, name='MultiplicitySumDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: MultiplicitySumDefaultConst +end function MultiplicitySumDefaultConst + +!! Create, default, non-const +function MultiplicitySumDefault() & + bind(C, name='MultiplicitySumDefault') + use iso_c_binding + implicit none + type(c_ptr) :: MultiplicitySumDefault +end function MultiplicitySumDefault + +!! Create, general, const +function MultiplicitySumCreateConst( & + label, & + ENDF_MT, & + multiplicity, & + summands, & + labelSize & +) & + bind(C, name='MultiplicitySumCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + type(c_ptr), intent(in), value :: multiplicity + type(c_ptr), intent(in), value :: summands + type(c_ptr) :: MultiplicitySumCreateConst +end function MultiplicitySumCreateConst + +!! Create, general, non-const +function MultiplicitySumCreate( & + label, & + ENDF_MT, & + multiplicity, & + summands, & + labelSize & +) & + bind(C, name='MultiplicitySumCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + type(c_ptr), intent(in), value :: multiplicity + type(c_ptr), intent(in), value :: summands + type(c_ptr) :: MultiplicitySumCreate +end function MultiplicitySumCreate + +!! Assign +subroutine MultiplicitySumAssign(handleLHS, handleRHS) & + bind(C, name='MultiplicitySumAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine MultiplicitySumAssign + +!! Delete +subroutine MultiplicitySumDelete(handle) & + bind(C, name='MultiplicitySumDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine MultiplicitySumDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function MultiplicitySumRead(handle, filename, filenameSize) & + bind(C, name='MultiplicitySumRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MultiplicitySumRead +end function MultiplicitySumRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function MultiplicitySumWrite(handle, filename, filenameSize) & + bind(C, name='MultiplicitySumWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MultiplicitySumWrite +end function MultiplicitySumWrite + +!! Print to standard output, in our prettyprinting format +function MultiplicitySumPrint(handle) & + bind(C, name='MultiplicitySumPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumPrint +end function MultiplicitySumPrint + +!! Print to standard output, as XML +function MultiplicitySumPrintXML(handle) & + bind(C, name='MultiplicitySumPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumPrintXML +end function MultiplicitySumPrintXML + +!! Print to standard output, as JSON +function MultiplicitySumPrintJSON(handle) & + bind(C, name='MultiplicitySumPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumPrintJSON +end function MultiplicitySumPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicitySumLabelHas(handle) & + bind(C, name='MultiplicitySumLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumLabelHas +end function MultiplicitySumLabelHas + +!! Get +function MultiplicitySumLabelGet(handle) & + bind(C, name='MultiplicitySumLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MultiplicitySumLabelGet +end function MultiplicitySumLabelGet + +!! Set +subroutine MultiplicitySumLabelSet(handle, label, labelSize) & + bind(C, name='MultiplicitySumLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine MultiplicitySumLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: ENDF_MT +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicitySumENDFMTHas(handle) & + bind(C, name='MultiplicitySumENDFMTHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumENDFMTHas +end function MultiplicitySumENDFMTHas + +!! Get +function MultiplicitySumENDFMTGet(handle) & + bind(C, name='MultiplicitySumENDFMTGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumENDFMTGet +end function MultiplicitySumENDFMTGet + +!! Set +subroutine MultiplicitySumENDFMTSet(handle, ENDF_MT) & + bind(C, name='MultiplicitySumENDFMTSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: ENDF_MT +end subroutine MultiplicitySumENDFMTSet + + +!! ----------------------------------------------------------------------------- +!! Child: multiplicity +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicitySumMultiplicityHas(handle) & + bind(C, name='MultiplicitySumMultiplicityHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumMultiplicityHas +end function MultiplicitySumMultiplicityHas + +!! Get, const +function MultiplicitySumMultiplicityGetConst(handle) & + bind(C, name='MultiplicitySumMultiplicityGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MultiplicitySumMultiplicityGetConst +end function MultiplicitySumMultiplicityGetConst + +!! Get, non-const +function MultiplicitySumMultiplicityGet(handle) & + bind(C, name='MultiplicitySumMultiplicityGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MultiplicitySumMultiplicityGet +end function MultiplicitySumMultiplicityGet + +!! Set +subroutine MultiplicitySumMultiplicitySet(handle, fieldHandle) & + bind(C, name='MultiplicitySumMultiplicitySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicitySumMultiplicitySet + + +!! ----------------------------------------------------------------------------- +!! Child: summands +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicitySumSummandsHas(handle) & + bind(C, name='MultiplicitySumSummandsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumSummandsHas +end function MultiplicitySumSummandsHas + +!! Get, const +function MultiplicitySumSummandsGetConst(handle) & + bind(C, name='MultiplicitySumSummandsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: MultiplicitySumSummandsGetConst +end function MultiplicitySumSummandsGetConst + +!! Get, non-const +function MultiplicitySumSummandsGet(handle) & + bind(C, name='MultiplicitySumSummandsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: MultiplicitySumSummandsGet +end function MultiplicitySumSummandsGet + +!! Set +subroutine MultiplicitySumSummandsSet(handle, fieldHandle) & + bind(C, name='MultiplicitySumSummandsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicitySumSummandsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalMultiplicitySum diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MultiplicitySums.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MultiplicitySums.f03 new file mode 100644 index 000000000..2f1da558b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/MultiplicitySums.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalMultiplicitySums +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function MultiplicitySumsDefaultConst() & + bind(C, name='MultiplicitySumsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: MultiplicitySumsDefaultConst +end function MultiplicitySumsDefaultConst + +!! Create, default, non-const +function MultiplicitySumsDefault() & + bind(C, name='MultiplicitySumsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: MultiplicitySumsDefault +end function MultiplicitySumsDefault + +!! Create, general, const +function MultiplicitySumsCreateConst( & + multiplicitySum, multiplicitySumSize & +) & + bind(C, name='MultiplicitySumsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: multiplicitySumSize + type(c_ptr), intent(in) :: multiplicitySum(multiplicitySumSize) + type(c_ptr) :: MultiplicitySumsCreateConst +end function MultiplicitySumsCreateConst + +!! Create, general, non-const +function MultiplicitySumsCreate( & + multiplicitySum, multiplicitySumSize & +) & + bind(C, name='MultiplicitySumsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: multiplicitySumSize + type(c_ptr), intent(in) :: multiplicitySum(multiplicitySumSize) + type(c_ptr) :: MultiplicitySumsCreate +end function MultiplicitySumsCreate + +!! Assign +subroutine MultiplicitySumsAssign(handleLHS, handleRHS) & + bind(C, name='MultiplicitySumsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine MultiplicitySumsAssign + +!! Delete +subroutine MultiplicitySumsDelete(handle) & + bind(C, name='MultiplicitySumsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine MultiplicitySumsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function MultiplicitySumsRead(handle, filename, filenameSize) & + bind(C, name='MultiplicitySumsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MultiplicitySumsRead +end function MultiplicitySumsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function MultiplicitySumsWrite(handle, filename, filenameSize) & + bind(C, name='MultiplicitySumsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: MultiplicitySumsWrite +end function MultiplicitySumsWrite + +!! Print to standard output, in our prettyprinting format +function MultiplicitySumsPrint(handle) & + bind(C, name='MultiplicitySumsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumsPrint +end function MultiplicitySumsPrint + +!! Print to standard output, as XML +function MultiplicitySumsPrintXML(handle) & + bind(C, name='MultiplicitySumsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumsPrintXML +end function MultiplicitySumsPrintXML + +!! Print to standard output, as JSON +function MultiplicitySumsPrintJSON(handle) & + bind(C, name='MultiplicitySumsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumsPrintJSON +end function MultiplicitySumsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: multiplicitySum +!! ----------------------------------------------------------------------------- + +!! Has +function MultiplicitySumsMultiplicitySumHas(handle) & + bind(C, name='MultiplicitySumsMultiplicitySumHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: MultiplicitySumsMultiplicitySumHas +end function MultiplicitySumsMultiplicitySumHas + +!! Clear +subroutine MultiplicitySumsMultiplicitySumClear(handle) & + bind(C, name='MultiplicitySumsMultiplicitySumClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine MultiplicitySumsMultiplicitySumClear + +!! Size +function MultiplicitySumsMultiplicitySumSize(handle) & + bind(C, name='MultiplicitySumsMultiplicitySumSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: MultiplicitySumsMultiplicitySumSize +end function MultiplicitySumsMultiplicitySumSize + +!! Add +subroutine MultiplicitySumsMultiplicitySumAdd(handle, fieldHandle) & + bind(C, name='MultiplicitySumsMultiplicitySumAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicitySumsMultiplicitySumAdd + +!! Get, by index \in [0,size), const +function MultiplicitySumsMultiplicitySumGetConst(handle, index) & + bind(C, name='MultiplicitySumsMultiplicitySumGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: MultiplicitySumsMultiplicitySumGetConst +end function MultiplicitySumsMultiplicitySumGetConst + +!! Get, by index \in [0,size), non-const +function MultiplicitySumsMultiplicitySumGet(handle, index) & + bind(C, name='MultiplicitySumsMultiplicitySumGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: MultiplicitySumsMultiplicitySumGet +end function MultiplicitySumsMultiplicitySumGet + +!! Set, by index \in [0,size) +subroutine MultiplicitySumsMultiplicitySumSet(handle, index, fieldHandle) & + bind(C, name='MultiplicitySumsMultiplicitySumSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicitySumsMultiplicitySumSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function MultiplicitySumsMultiplicitySumHasByLabel(handle, meta, metaSize) & + bind(C, name='MultiplicitySumsMultiplicitySumHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: MultiplicitySumsMultiplicitySumHasByLabel +end function MultiplicitySumsMultiplicitySumHasByLabel + +!! Get, by label, const +function MultiplicitySumsMultiplicitySumGetByLabelConst(handle, meta, metaSize) & + bind(C, name='MultiplicitySumsMultiplicitySumGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MultiplicitySumsMultiplicitySumGetByLabelConst +end function MultiplicitySumsMultiplicitySumGetByLabelConst + +!! Get, by label, non-const +function MultiplicitySumsMultiplicitySumGetByLabel(handle, meta, metaSize) & + bind(C, name='MultiplicitySumsMultiplicitySumGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: MultiplicitySumsMultiplicitySumGetByLabel +end function MultiplicitySumsMultiplicitySumGetByLabel + +!! Set, by label +subroutine MultiplicitySumsMultiplicitySumSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='MultiplicitySumsMultiplicitySumSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicitySumsMultiplicitySumSetByLabel + +!! ------------------------ +!! Re: metadatum ENDF_MT +!! ------------------------ + +!! Has, by ENDF_MT +function MultiplicitySumsMultiplicitySumHasByENDFMT(handle, meta) & + bind(C, name='MultiplicitySumsMultiplicitySumHasByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: MultiplicitySumsMultiplicitySumHasByENDFMT +end function MultiplicitySumsMultiplicitySumHasByENDFMT + +!! Get, by ENDF_MT, const +function MultiplicitySumsMultiplicitySumGetByENDFMTConst(handle, meta) & + bind(C, name='MultiplicitySumsMultiplicitySumGetByENDFMTConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: MultiplicitySumsMultiplicitySumGetByENDFMTConst +end function MultiplicitySumsMultiplicitySumGetByENDFMTConst + +!! Get, by ENDF_MT, non-const +function MultiplicitySumsMultiplicitySumGetByENDFMT(handle, meta) & + bind(C, name='MultiplicitySumsMultiplicitySumGetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: MultiplicitySumsMultiplicitySumGetByENDFMT +end function MultiplicitySumsMultiplicitySumGetByENDFMT + +!! Set, by ENDF_MT +subroutine MultiplicitySumsMultiplicitySumSetByENDFMT(handle, meta, fieldHandle) & + bind(C, name='MultiplicitySumsMultiplicitySumSetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine MultiplicitySumsMultiplicitySumSetByENDFMT + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalMultiplicitySums diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NBodyPhaseSpace.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NBodyPhaseSpace.f03 new file mode 100644 index 000000000..2ca7ca352 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NBodyPhaseSpace.f03 @@ -0,0 +1,212 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalNBodyPhaseSpace +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function NBodyPhaseSpaceDefaultConst() & + bind(C, name='NBodyPhaseSpaceDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: NBodyPhaseSpaceDefaultConst +end function NBodyPhaseSpaceDefaultConst + +!! Create, default, non-const +function NBodyPhaseSpaceDefault() & + bind(C, name='NBodyPhaseSpaceDefault') + use iso_c_binding + implicit none + type(c_ptr) :: NBodyPhaseSpaceDefault +end function NBodyPhaseSpaceDefault + +!! Create, general, const +function NBodyPhaseSpaceCreateConst( & + numberOfProducts, & + mass & +) & + bind(C, name='NBodyPhaseSpaceCreateConst') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: numberOfProducts + type(c_ptr), intent(in), value :: mass + type(c_ptr) :: NBodyPhaseSpaceCreateConst +end function NBodyPhaseSpaceCreateConst + +!! Create, general, non-const +function NBodyPhaseSpaceCreate( & + numberOfProducts, & + mass & +) & + bind(C, name='NBodyPhaseSpaceCreate') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: numberOfProducts + type(c_ptr), intent(in), value :: mass + type(c_ptr) :: NBodyPhaseSpaceCreate +end function NBodyPhaseSpaceCreate + +!! Assign +subroutine NBodyPhaseSpaceAssign(handleLHS, handleRHS) & + bind(C, name='NBodyPhaseSpaceAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine NBodyPhaseSpaceAssign + +!! Delete +subroutine NBodyPhaseSpaceDelete(handle) & + bind(C, name='NBodyPhaseSpaceDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NBodyPhaseSpaceDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function NBodyPhaseSpaceRead(handle, filename, filenameSize) & + bind(C, name='NBodyPhaseSpaceRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NBodyPhaseSpaceRead +end function NBodyPhaseSpaceRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function NBodyPhaseSpaceWrite(handle, filename, filenameSize) & + bind(C, name='NBodyPhaseSpaceWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NBodyPhaseSpaceWrite +end function NBodyPhaseSpaceWrite + +!! Print to standard output, in our prettyprinting format +function NBodyPhaseSpacePrint(handle) & + bind(C, name='NBodyPhaseSpacePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NBodyPhaseSpacePrint +end function NBodyPhaseSpacePrint + +!! Print to standard output, as XML +function NBodyPhaseSpacePrintXML(handle) & + bind(C, name='NBodyPhaseSpacePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NBodyPhaseSpacePrintXML +end function NBodyPhaseSpacePrintXML + +!! Print to standard output, as JSON +function NBodyPhaseSpacePrintJSON(handle) & + bind(C, name='NBodyPhaseSpacePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NBodyPhaseSpacePrintJSON +end function NBodyPhaseSpacePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: numberOfProducts +!! ----------------------------------------------------------------------------- + +!! Has +function NBodyPhaseSpaceNumberOfProductsHas(handle) & + bind(C, name='NBodyPhaseSpaceNumberOfProductsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NBodyPhaseSpaceNumberOfProductsHas +end function NBodyPhaseSpaceNumberOfProductsHas + +!! Get +function NBodyPhaseSpaceNumberOfProductsGet(handle) & + bind(C, name='NBodyPhaseSpaceNumberOfProductsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NBodyPhaseSpaceNumberOfProductsGet +end function NBodyPhaseSpaceNumberOfProductsGet + +!! Set +subroutine NBodyPhaseSpaceNumberOfProductsSet(handle, numberOfProducts) & + bind(C, name='NBodyPhaseSpaceNumberOfProductsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: numberOfProducts +end subroutine NBodyPhaseSpaceNumberOfProductsSet + + +!! ----------------------------------------------------------------------------- +!! Child: mass +!! ----------------------------------------------------------------------------- + +!! Has +function NBodyPhaseSpaceMassHas(handle) & + bind(C, name='NBodyPhaseSpaceMassHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NBodyPhaseSpaceMassHas +end function NBodyPhaseSpaceMassHas + +!! Get, const +function NBodyPhaseSpaceMassGetConst(handle) & + bind(C, name='NBodyPhaseSpaceMassGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NBodyPhaseSpaceMassGetConst +end function NBodyPhaseSpaceMassGetConst + +!! Get, non-const +function NBodyPhaseSpaceMassGet(handle) & + bind(C, name='NBodyPhaseSpaceMassGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NBodyPhaseSpaceMassGet +end function NBodyPhaseSpaceMassGet + +!! Set +subroutine NBodyPhaseSpaceMassSet(handle, fieldHandle) & + bind(C, name='NBodyPhaseSpaceMassSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NBodyPhaseSpaceMassSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalNBodyPhaseSpace diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NeutrinoEnergy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NeutrinoEnergy.f03 new file mode 100644 index 000000000..4cae7ba49 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NeutrinoEnergy.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalNeutrinoEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function NeutrinoEnergyDefaultConst() & + bind(C, name='NeutrinoEnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: NeutrinoEnergyDefaultConst +end function NeutrinoEnergyDefaultConst + +!! Create, default, non-const +function NeutrinoEnergyDefault() & + bind(C, name='NeutrinoEnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: NeutrinoEnergyDefault +end function NeutrinoEnergyDefault + +!! Create, general, const +function NeutrinoEnergyCreateConst( & + polynomial1d & +) & + bind(C, name='NeutrinoEnergyCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: NeutrinoEnergyCreateConst +end function NeutrinoEnergyCreateConst + +!! Create, general, non-const +function NeutrinoEnergyCreate( & + polynomial1d & +) & + bind(C, name='NeutrinoEnergyCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: NeutrinoEnergyCreate +end function NeutrinoEnergyCreate + +!! Assign +subroutine NeutrinoEnergyAssign(handleLHS, handleRHS) & + bind(C, name='NeutrinoEnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine NeutrinoEnergyAssign + +!! Delete +subroutine NeutrinoEnergyDelete(handle) & + bind(C, name='NeutrinoEnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NeutrinoEnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function NeutrinoEnergyRead(handle, filename, filenameSize) & + bind(C, name='NeutrinoEnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NeutrinoEnergyRead +end function NeutrinoEnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function NeutrinoEnergyWrite(handle, filename, filenameSize) & + bind(C, name='NeutrinoEnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NeutrinoEnergyWrite +end function NeutrinoEnergyWrite + +!! Print to standard output, in our prettyprinting format +function NeutrinoEnergyPrint(handle) & + bind(C, name='NeutrinoEnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NeutrinoEnergyPrint +end function NeutrinoEnergyPrint + +!! Print to standard output, as XML +function NeutrinoEnergyPrintXML(handle) & + bind(C, name='NeutrinoEnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NeutrinoEnergyPrintXML +end function NeutrinoEnergyPrintXML + +!! Print to standard output, as JSON +function NeutrinoEnergyPrintJSON(handle) & + bind(C, name='NeutrinoEnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NeutrinoEnergyPrintJSON +end function NeutrinoEnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: polynomial1d +!! ----------------------------------------------------------------------------- + +!! Has +function NeutrinoEnergyPolynomial1dHas(handle) & + bind(C, name='NeutrinoEnergyPolynomial1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NeutrinoEnergyPolynomial1dHas +end function NeutrinoEnergyPolynomial1dHas + +!! Get, const +function NeutrinoEnergyPolynomial1dGetConst(handle) & + bind(C, name='NeutrinoEnergyPolynomial1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NeutrinoEnergyPolynomial1dGetConst +end function NeutrinoEnergyPolynomial1dGetConst + +!! Get, non-const +function NeutrinoEnergyPolynomial1dGet(handle) & + bind(C, name='NeutrinoEnergyPolynomial1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NeutrinoEnergyPolynomial1dGet +end function NeutrinoEnergyPolynomial1dGet + +!! Set +subroutine NeutrinoEnergyPolynomial1dSet(handle, fieldHandle) & + bind(C, name='NeutrinoEnergyPolynomial1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NeutrinoEnergyPolynomial1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalNeutrinoEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NonNeutrinoEnergy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NonNeutrinoEnergy.f03 new file mode 100644 index 000000000..7949786d5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NonNeutrinoEnergy.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalNonNeutrinoEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function NonNeutrinoEnergyDefaultConst() & + bind(C, name='NonNeutrinoEnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: NonNeutrinoEnergyDefaultConst +end function NonNeutrinoEnergyDefaultConst + +!! Create, default, non-const +function NonNeutrinoEnergyDefault() & + bind(C, name='NonNeutrinoEnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: NonNeutrinoEnergyDefault +end function NonNeutrinoEnergyDefault + +!! Create, general, const +function NonNeutrinoEnergyCreateConst( & + polynomial1d & +) & + bind(C, name='NonNeutrinoEnergyCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: NonNeutrinoEnergyCreateConst +end function NonNeutrinoEnergyCreateConst + +!! Create, general, non-const +function NonNeutrinoEnergyCreate( & + polynomial1d & +) & + bind(C, name='NonNeutrinoEnergyCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: NonNeutrinoEnergyCreate +end function NonNeutrinoEnergyCreate + +!! Assign +subroutine NonNeutrinoEnergyAssign(handleLHS, handleRHS) & + bind(C, name='NonNeutrinoEnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine NonNeutrinoEnergyAssign + +!! Delete +subroutine NonNeutrinoEnergyDelete(handle) & + bind(C, name='NonNeutrinoEnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NonNeutrinoEnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function NonNeutrinoEnergyRead(handle, filename, filenameSize) & + bind(C, name='NonNeutrinoEnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NonNeutrinoEnergyRead +end function NonNeutrinoEnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function NonNeutrinoEnergyWrite(handle, filename, filenameSize) & + bind(C, name='NonNeutrinoEnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NonNeutrinoEnergyWrite +end function NonNeutrinoEnergyWrite + +!! Print to standard output, in our prettyprinting format +function NonNeutrinoEnergyPrint(handle) & + bind(C, name='NonNeutrinoEnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NonNeutrinoEnergyPrint +end function NonNeutrinoEnergyPrint + +!! Print to standard output, as XML +function NonNeutrinoEnergyPrintXML(handle) & + bind(C, name='NonNeutrinoEnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NonNeutrinoEnergyPrintXML +end function NonNeutrinoEnergyPrintXML + +!! Print to standard output, as JSON +function NonNeutrinoEnergyPrintJSON(handle) & + bind(C, name='NonNeutrinoEnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NonNeutrinoEnergyPrintJSON +end function NonNeutrinoEnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: polynomial1d +!! ----------------------------------------------------------------------------- + +!! Has +function NonNeutrinoEnergyPolynomial1dHas(handle) & + bind(C, name='NonNeutrinoEnergyPolynomial1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NonNeutrinoEnergyPolynomial1dHas +end function NonNeutrinoEnergyPolynomial1dHas + +!! Get, const +function NonNeutrinoEnergyPolynomial1dGetConst(handle) & + bind(C, name='NonNeutrinoEnergyPolynomial1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NonNeutrinoEnergyPolynomial1dGetConst +end function NonNeutrinoEnergyPolynomial1dGetConst + +!! Get, non-const +function NonNeutrinoEnergyPolynomial1dGet(handle) & + bind(C, name='NonNeutrinoEnergyPolynomial1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NonNeutrinoEnergyPolynomial1dGet +end function NonNeutrinoEnergyPolynomial1dGet + +!! Set +subroutine NonNeutrinoEnergyPolynomial1dSet(handle, fieldHandle) & + bind(C, name='NonNeutrinoEnergyPolynomial1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NonNeutrinoEnergyPolynomial1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalNonNeutrinoEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NuclearAmplitudeExpansion.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NuclearAmplitudeExpansion.f03 new file mode 100644 index 000000000..3156bfeec --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NuclearAmplitudeExpansion.f03 @@ -0,0 +1,266 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalNuclearAmplitudeExpansion +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function NuclearAmplitudeExpansionDefaultConst() & + bind(C, name='NuclearAmplitudeExpansionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: NuclearAmplitudeExpansionDefaultConst +end function NuclearAmplitudeExpansionDefaultConst + +!! Create, default, non-const +function NuclearAmplitudeExpansionDefault() & + bind(C, name='NuclearAmplitudeExpansionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: NuclearAmplitudeExpansionDefault +end function NuclearAmplitudeExpansionDefault + +!! Create, general, const +function NuclearAmplitudeExpansionCreateConst( & + nuclearTerm, & + realInterferenceTerm, & + imaginaryInterferenceTerm & +) & + bind(C, name='NuclearAmplitudeExpansionCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: nuclearTerm + type(c_ptr), intent(in), value :: realInterferenceTerm + type(c_ptr), intent(in), value :: imaginaryInterferenceTerm + type(c_ptr) :: NuclearAmplitudeExpansionCreateConst +end function NuclearAmplitudeExpansionCreateConst + +!! Create, general, non-const +function NuclearAmplitudeExpansionCreate( & + nuclearTerm, & + realInterferenceTerm, & + imaginaryInterferenceTerm & +) & + bind(C, name='NuclearAmplitudeExpansionCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: nuclearTerm + type(c_ptr), intent(in), value :: realInterferenceTerm + type(c_ptr), intent(in), value :: imaginaryInterferenceTerm + type(c_ptr) :: NuclearAmplitudeExpansionCreate +end function NuclearAmplitudeExpansionCreate + +!! Assign +subroutine NuclearAmplitudeExpansionAssign(handleLHS, handleRHS) & + bind(C, name='NuclearAmplitudeExpansionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine NuclearAmplitudeExpansionAssign + +!! Delete +subroutine NuclearAmplitudeExpansionDelete(handle) & + bind(C, name='NuclearAmplitudeExpansionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NuclearAmplitudeExpansionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function NuclearAmplitudeExpansionRead(handle, filename, filenameSize) & + bind(C, name='NuclearAmplitudeExpansionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclearAmplitudeExpansionRead +end function NuclearAmplitudeExpansionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function NuclearAmplitudeExpansionWrite(handle, filename, filenameSize) & + bind(C, name='NuclearAmplitudeExpansionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclearAmplitudeExpansionWrite +end function NuclearAmplitudeExpansionWrite + +!! Print to standard output, in our prettyprinting format +function NuclearAmplitudeExpansionPrint(handle) & + bind(C, name='NuclearAmplitudeExpansionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearAmplitudeExpansionPrint +end function NuclearAmplitudeExpansionPrint + +!! Print to standard output, as XML +function NuclearAmplitudeExpansionPrintXML(handle) & + bind(C, name='NuclearAmplitudeExpansionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearAmplitudeExpansionPrintXML +end function NuclearAmplitudeExpansionPrintXML + +!! Print to standard output, as JSON +function NuclearAmplitudeExpansionPrintJSON(handle) & + bind(C, name='NuclearAmplitudeExpansionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearAmplitudeExpansionPrintJSON +end function NuclearAmplitudeExpansionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: nuclearTerm +!! ----------------------------------------------------------------------------- + +!! Has +function NuclearAmplitudeExpansionNuclearTermHas(handle) & + bind(C, name='NuclearAmplitudeExpansionNuclearTermHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearAmplitudeExpansionNuclearTermHas +end function NuclearAmplitudeExpansionNuclearTermHas + +!! Get, const +function NuclearAmplitudeExpansionNuclearTermGetConst(handle) & + bind(C, name='NuclearAmplitudeExpansionNuclearTermGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclearAmplitudeExpansionNuclearTermGetConst +end function NuclearAmplitudeExpansionNuclearTermGetConst + +!! Get, non-const +function NuclearAmplitudeExpansionNuclearTermGet(handle) & + bind(C, name='NuclearAmplitudeExpansionNuclearTermGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclearAmplitudeExpansionNuclearTermGet +end function NuclearAmplitudeExpansionNuclearTermGet + +!! Set +subroutine NuclearAmplitudeExpansionNuclearTermSet(handle, fieldHandle) & + bind(C, name='NuclearAmplitudeExpansionNuclearTermSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclearAmplitudeExpansionNuclearTermSet + + +!! ----------------------------------------------------------------------------- +!! Child: realInterferenceTerm +!! ----------------------------------------------------------------------------- + +!! Has +function NuclearAmplitudeExpansionRealInterferenceTermHas(handle) & + bind(C, name='NuclearAmplitudeExpansionRealInterferenceTermHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearAmplitudeExpansionRealInterferenceTermHas +end function NuclearAmplitudeExpansionRealInterferenceTermHas + +!! Get, const +function NuclearAmplitudeExpansionRealInterferenceTermGetConst(handle) & + bind(C, name='NuclearAmplitudeExpansionRealInterferenceTermGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclearAmplitudeExpansionRealInterferenceTermGetConst +end function NuclearAmplitudeExpansionRealInterferenceTermGetConst + +!! Get, non-const +function NuclearAmplitudeExpansionRealInterferenceTermGet(handle) & + bind(C, name='NuclearAmplitudeExpansionRealInterferenceTermGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclearAmplitudeExpansionRealInterferenceTermGet +end function NuclearAmplitudeExpansionRealInterferenceTermGet + +!! Set +subroutine NuclearAmplitudeExpansionRealInterferenceTermSet(handle, fieldHandle) & + bind(C, name='NuclearAmplitudeExpansionRealInterferenceTermSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclearAmplitudeExpansionRealInterferenceTermSet + + +!! ----------------------------------------------------------------------------- +!! Child: imaginaryInterferenceTerm +!! ----------------------------------------------------------------------------- + +!! Has +function NuclearAmplitudeExpansionImaginaryInterferenceTermHas(handle) & + bind(C, name='NuclearAmplitudeExpansionImaginaryInterferenceTermHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearAmplitudeExpansionImaginaryInterferenceTermHas +end function NuclearAmplitudeExpansionImaginaryInterferenceTermHas + +!! Get, const +function NuclearAmplitudeExpansionImaginaryInterferenceTermGetConst(handle) & + bind(C, name='NuclearAmplitudeExpansionImaginaryInterferenceTermGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclearAmplitudeExpansionImaginaryInterferenceTermGetConst +end function NuclearAmplitudeExpansionImaginaryInterferenceTermGetConst + +!! Get, non-const +function NuclearAmplitudeExpansionImaginaryInterferenceTermGet(handle) & + bind(C, name='NuclearAmplitudeExpansionImaginaryInterferenceTermGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclearAmplitudeExpansionImaginaryInterferenceTermGet +end function NuclearAmplitudeExpansionImaginaryInterferenceTermGet + +!! Set +subroutine NuclearAmplitudeExpansionImaginaryInterferenceTermSet(handle, fieldHandle) & + bind(C, name='NuclearAmplitudeExpansionImaginaryInterferenceTermSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclearAmplitudeExpansionImaginaryInterferenceTermSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalNuclearAmplitudeExpansion diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NuclearPlusInterference.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NuclearPlusInterference.f03 new file mode 100644 index 000000000..413a5a648 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NuclearPlusInterference.f03 @@ -0,0 +1,257 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalNuclearPlusInterference +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function NuclearPlusInterferenceDefaultConst() & + bind(C, name='NuclearPlusInterferenceDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: NuclearPlusInterferenceDefaultConst +end function NuclearPlusInterferenceDefaultConst + +!! Create, default, non-const +function NuclearPlusInterferenceDefault() & + bind(C, name='NuclearPlusInterferenceDefault') + use iso_c_binding + implicit none + type(c_ptr) :: NuclearPlusInterferenceDefault +end function NuclearPlusInterferenceDefault + +!! Create, general, const +function NuclearPlusInterferenceCreateConst( & + muCutoff, & + crossSection, & + distribution & +) & + bind(C, name='NuclearPlusInterferenceCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: muCutoff + type(c_ptr), intent(in), value :: crossSection + type(c_ptr), intent(in), value :: distribution + type(c_ptr) :: NuclearPlusInterferenceCreateConst +end function NuclearPlusInterferenceCreateConst + +!! Create, general, non-const +function NuclearPlusInterferenceCreate( & + muCutoff, & + crossSection, & + distribution & +) & + bind(C, name='NuclearPlusInterferenceCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: muCutoff + type(c_ptr), intent(in), value :: crossSection + type(c_ptr), intent(in), value :: distribution + type(c_ptr) :: NuclearPlusInterferenceCreate +end function NuclearPlusInterferenceCreate + +!! Assign +subroutine NuclearPlusInterferenceAssign(handleLHS, handleRHS) & + bind(C, name='NuclearPlusInterferenceAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine NuclearPlusInterferenceAssign + +!! Delete +subroutine NuclearPlusInterferenceDelete(handle) & + bind(C, name='NuclearPlusInterferenceDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NuclearPlusInterferenceDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function NuclearPlusInterferenceRead(handle, filename, filenameSize) & + bind(C, name='NuclearPlusInterferenceRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclearPlusInterferenceRead +end function NuclearPlusInterferenceRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function NuclearPlusInterferenceWrite(handle, filename, filenameSize) & + bind(C, name='NuclearPlusInterferenceWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclearPlusInterferenceWrite +end function NuclearPlusInterferenceWrite + +!! Print to standard output, in our prettyprinting format +function NuclearPlusInterferencePrint(handle) & + bind(C, name='NuclearPlusInterferencePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearPlusInterferencePrint +end function NuclearPlusInterferencePrint + +!! Print to standard output, as XML +function NuclearPlusInterferencePrintXML(handle) & + bind(C, name='NuclearPlusInterferencePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearPlusInterferencePrintXML +end function NuclearPlusInterferencePrintXML + +!! Print to standard output, as JSON +function NuclearPlusInterferencePrintJSON(handle) & + bind(C, name='NuclearPlusInterferencePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearPlusInterferencePrintJSON +end function NuclearPlusInterferencePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: muCutoff +!! ----------------------------------------------------------------------------- + +!! Has +function NuclearPlusInterferenceMuCutoffHas(handle) & + bind(C, name='NuclearPlusInterferenceMuCutoffHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearPlusInterferenceMuCutoffHas +end function NuclearPlusInterferenceMuCutoffHas + +!! Get +function NuclearPlusInterferenceMuCutoffGet(handle) & + bind(C, name='NuclearPlusInterferenceMuCutoffGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: NuclearPlusInterferenceMuCutoffGet +end function NuclearPlusInterferenceMuCutoffGet + +!! Set +subroutine NuclearPlusInterferenceMuCutoffSet(handle, muCutoff) & + bind(C, name='NuclearPlusInterferenceMuCutoffSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: muCutoff +end subroutine NuclearPlusInterferenceMuCutoffSet + + +!! ----------------------------------------------------------------------------- +!! Child: crossSection +!! ----------------------------------------------------------------------------- + +!! Has +function NuclearPlusInterferenceCrossSectionHas(handle) & + bind(C, name='NuclearPlusInterferenceCrossSectionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearPlusInterferenceCrossSectionHas +end function NuclearPlusInterferenceCrossSectionHas + +!! Get, const +function NuclearPlusInterferenceCrossSectionGetConst(handle) & + bind(C, name='NuclearPlusInterferenceCrossSectionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclearPlusInterferenceCrossSectionGetConst +end function NuclearPlusInterferenceCrossSectionGetConst + +!! Get, non-const +function NuclearPlusInterferenceCrossSectionGet(handle) & + bind(C, name='NuclearPlusInterferenceCrossSectionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclearPlusInterferenceCrossSectionGet +end function NuclearPlusInterferenceCrossSectionGet + +!! Set +subroutine NuclearPlusInterferenceCrossSectionSet(handle, fieldHandle) & + bind(C, name='NuclearPlusInterferenceCrossSectionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclearPlusInterferenceCrossSectionSet + + +!! ----------------------------------------------------------------------------- +!! Child: distribution +!! ----------------------------------------------------------------------------- + +!! Has +function NuclearPlusInterferenceDistributionHas(handle) & + bind(C, name='NuclearPlusInterferenceDistributionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearPlusInterferenceDistributionHas +end function NuclearPlusInterferenceDistributionHas + +!! Get, const +function NuclearPlusInterferenceDistributionGetConst(handle) & + bind(C, name='NuclearPlusInterferenceDistributionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclearPlusInterferenceDistributionGetConst +end function NuclearPlusInterferenceDistributionGetConst + +!! Get, non-const +function NuclearPlusInterferenceDistributionGet(handle) & + bind(C, name='NuclearPlusInterferenceDistributionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclearPlusInterferenceDistributionGet +end function NuclearPlusInterferenceDistributionGet + +!! Set +subroutine NuclearPlusInterferenceDistributionSet(handle, fieldHandle) & + bind(C, name='NuclearPlusInterferenceDistributionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclearPlusInterferenceDistributionSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalNuclearPlusInterference diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NuclearTerm.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NuclearTerm.f03 new file mode 100644 index 000000000..7e4fef41d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/NuclearTerm.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalNuclearTerm +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function NuclearTermDefaultConst() & + bind(C, name='NuclearTermDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: NuclearTermDefaultConst +end function NuclearTermDefaultConst + +!! Create, default, non-const +function NuclearTermDefault() & + bind(C, name='NuclearTermDefault') + use iso_c_binding + implicit none + type(c_ptr) :: NuclearTermDefault +end function NuclearTermDefault + +!! Create, general, const +function NuclearTermCreateConst( & + regions2d, & + XYs2d & +) & + bind(C, name='NuclearTermCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: regions2d + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: NuclearTermCreateConst +end function NuclearTermCreateConst + +!! Create, general, non-const +function NuclearTermCreate( & + regions2d, & + XYs2d & +) & + bind(C, name='NuclearTermCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: regions2d + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: NuclearTermCreate +end function NuclearTermCreate + +!! Assign +subroutine NuclearTermAssign(handleLHS, handleRHS) & + bind(C, name='NuclearTermAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine NuclearTermAssign + +!! Delete +subroutine NuclearTermDelete(handle) & + bind(C, name='NuclearTermDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NuclearTermDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function NuclearTermRead(handle, filename, filenameSize) & + bind(C, name='NuclearTermRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclearTermRead +end function NuclearTermRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function NuclearTermWrite(handle, filename, filenameSize) & + bind(C, name='NuclearTermWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclearTermWrite +end function NuclearTermWrite + +!! Print to standard output, in our prettyprinting format +function NuclearTermPrint(handle) & + bind(C, name='NuclearTermPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearTermPrint +end function NuclearTermPrint + +!! Print to standard output, as XML +function NuclearTermPrintXML(handle) & + bind(C, name='NuclearTermPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearTermPrintXML +end function NuclearTermPrintXML + +!! Print to standard output, as JSON +function NuclearTermPrintJSON(handle) & + bind(C, name='NuclearTermPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearTermPrintJSON +end function NuclearTermPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: regions2d +!! ----------------------------------------------------------------------------- + +!! Has +function NuclearTermRegions2dHas(handle) & + bind(C, name='NuclearTermRegions2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearTermRegions2dHas +end function NuclearTermRegions2dHas + +!! Get, const +function NuclearTermRegions2dGetConst(handle) & + bind(C, name='NuclearTermRegions2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclearTermRegions2dGetConst +end function NuclearTermRegions2dGetConst + +!! Get, non-const +function NuclearTermRegions2dGet(handle) & + bind(C, name='NuclearTermRegions2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclearTermRegions2dGet +end function NuclearTermRegions2dGet + +!! Set +subroutine NuclearTermRegions2dSet(handle, fieldHandle) & + bind(C, name='NuclearTermRegions2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclearTermRegions2dSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs2d +!! ----------------------------------------------------------------------------- + +!! Has +function NuclearTermXYs2dHas(handle) & + bind(C, name='NuclearTermXYs2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclearTermXYs2dHas +end function NuclearTermXYs2dHas + +!! Get, const +function NuclearTermXYs2dGetConst(handle) & + bind(C, name='NuclearTermXYs2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclearTermXYs2dGetConst +end function NuclearTermXYs2dGetConst + +!! Get, non-const +function NuclearTermXYs2dGet(handle) & + bind(C, name='NuclearTermXYs2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclearTermXYs2dGet +end function NuclearTermXYs2dGet + +!! Set +subroutine NuclearTermXYs2dSet(handle, fieldHandle) & + bind(C, name='NuclearTermXYs2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclearTermXYs2dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalNuclearTerm diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Nucleus.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Nucleus.f03 new file mode 100644 index 000000000..fe5c90d22 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Nucleus.f03 @@ -0,0 +1,523 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalNucleus +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function NucleusDefaultConst() & + bind(C, name='NucleusDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: NucleusDefaultConst +end function NucleusDefaultConst + +!! Create, default, non-const +function NucleusDefault() & + bind(C, name='NucleusDefault') + use iso_c_binding + implicit none + type(c_ptr) :: NucleusDefault +end function NucleusDefault + +!! Create, general, const +function NucleusCreateConst( & + id, & + index, & + mass, & + spin, & + parity, & + charge, & + halflife, & + energy, & + decayData, & + idSize & +) & + bind(C, name='NucleusCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + integer(c_int), intent(in), value :: index + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: spin + type(c_ptr), intent(in), value :: parity + type(c_ptr), intent(in), value :: charge + type(c_ptr), intent(in), value :: halflife + type(c_ptr), intent(in), value :: energy + type(c_ptr), intent(in), value :: decayData + type(c_ptr) :: NucleusCreateConst +end function NucleusCreateConst + +!! Create, general, non-const +function NucleusCreate( & + id, & + index, & + mass, & + spin, & + parity, & + charge, & + halflife, & + energy, & + decayData, & + idSize & +) & + bind(C, name='NucleusCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + integer(c_int), intent(in), value :: index + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: spin + type(c_ptr), intent(in), value :: parity + type(c_ptr), intent(in), value :: charge + type(c_ptr), intent(in), value :: halflife + type(c_ptr), intent(in), value :: energy + type(c_ptr), intent(in), value :: decayData + type(c_ptr) :: NucleusCreate +end function NucleusCreate + +!! Assign +subroutine NucleusAssign(handleLHS, handleRHS) & + bind(C, name='NucleusAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine NucleusAssign + +!! Delete +subroutine NucleusDelete(handle) & + bind(C, name='NucleusDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NucleusDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function NucleusRead(handle, filename, filenameSize) & + bind(C, name='NucleusRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NucleusRead +end function NucleusRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function NucleusWrite(handle, filename, filenameSize) & + bind(C, name='NucleusWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NucleusWrite +end function NucleusWrite + +!! Print to standard output, in our prettyprinting format +function NucleusPrint(handle) & + bind(C, name='NucleusPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusPrint +end function NucleusPrint + +!! Print to standard output, as XML +function NucleusPrintXML(handle) & + bind(C, name='NucleusPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusPrintXML +end function NucleusPrintXML + +!! Print to standard output, as JSON +function NucleusPrintJSON(handle) & + bind(C, name='NucleusPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusPrintJSON +end function NucleusPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: id +!! ----------------------------------------------------------------------------- + +!! Has +function NucleusIdHas(handle) & + bind(C, name='NucleusIdHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusIdHas +end function NucleusIdHas + +!! Get +function NucleusIdGet(handle) & + bind(C, name='NucleusIdGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NucleusIdGet +end function NucleusIdGet + +!! Set +subroutine NucleusIdSet(handle, id, idSize) & + bind(C, name='NucleusIdSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) +end subroutine NucleusIdSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: index +!! ----------------------------------------------------------------------------- + +!! Has +function NucleusIndexHas(handle) & + bind(C, name='NucleusIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusIndexHas +end function NucleusIndexHas + +!! Get +function NucleusIndexGet(handle) & + bind(C, name='NucleusIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusIndexGet +end function NucleusIndexGet + +!! Set +subroutine NucleusIndexSet(handle, index) & + bind(C, name='NucleusIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: index +end subroutine NucleusIndexSet + + +!! ----------------------------------------------------------------------------- +!! Child: mass +!! ----------------------------------------------------------------------------- + +!! Has +function NucleusMassHas(handle) & + bind(C, name='NucleusMassHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusMassHas +end function NucleusMassHas + +!! Get, const +function NucleusMassGetConst(handle) & + bind(C, name='NucleusMassGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NucleusMassGetConst +end function NucleusMassGetConst + +!! Get, non-const +function NucleusMassGet(handle) & + bind(C, name='NucleusMassGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NucleusMassGet +end function NucleusMassGet + +!! Set +subroutine NucleusMassSet(handle, fieldHandle) & + bind(C, name='NucleusMassSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NucleusMassSet + + +!! ----------------------------------------------------------------------------- +!! Child: spin +!! ----------------------------------------------------------------------------- + +!! Has +function NucleusSpinHas(handle) & + bind(C, name='NucleusSpinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusSpinHas +end function NucleusSpinHas + +!! Get, const +function NucleusSpinGetConst(handle) & + bind(C, name='NucleusSpinGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NucleusSpinGetConst +end function NucleusSpinGetConst + +!! Get, non-const +function NucleusSpinGet(handle) & + bind(C, name='NucleusSpinGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NucleusSpinGet +end function NucleusSpinGet + +!! Set +subroutine NucleusSpinSet(handle, fieldHandle) & + bind(C, name='NucleusSpinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NucleusSpinSet + + +!! ----------------------------------------------------------------------------- +!! Child: parity +!! ----------------------------------------------------------------------------- + +!! Has +function NucleusParityHas(handle) & + bind(C, name='NucleusParityHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusParityHas +end function NucleusParityHas + +!! Get, const +function NucleusParityGetConst(handle) & + bind(C, name='NucleusParityGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NucleusParityGetConst +end function NucleusParityGetConst + +!! Get, non-const +function NucleusParityGet(handle) & + bind(C, name='NucleusParityGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NucleusParityGet +end function NucleusParityGet + +!! Set +subroutine NucleusParitySet(handle, fieldHandle) & + bind(C, name='NucleusParitySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NucleusParitySet + + +!! ----------------------------------------------------------------------------- +!! Child: charge +!! ----------------------------------------------------------------------------- + +!! Has +function NucleusChargeHas(handle) & + bind(C, name='NucleusChargeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusChargeHas +end function NucleusChargeHas + +!! Get, const +function NucleusChargeGetConst(handle) & + bind(C, name='NucleusChargeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NucleusChargeGetConst +end function NucleusChargeGetConst + +!! Get, non-const +function NucleusChargeGet(handle) & + bind(C, name='NucleusChargeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NucleusChargeGet +end function NucleusChargeGet + +!! Set +subroutine NucleusChargeSet(handle, fieldHandle) & + bind(C, name='NucleusChargeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NucleusChargeSet + + +!! ----------------------------------------------------------------------------- +!! Child: halflife +!! ----------------------------------------------------------------------------- + +!! Has +function NucleusHalflifeHas(handle) & + bind(C, name='NucleusHalflifeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusHalflifeHas +end function NucleusHalflifeHas + +!! Get, const +function NucleusHalflifeGetConst(handle) & + bind(C, name='NucleusHalflifeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NucleusHalflifeGetConst +end function NucleusHalflifeGetConst + +!! Get, non-const +function NucleusHalflifeGet(handle) & + bind(C, name='NucleusHalflifeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NucleusHalflifeGet +end function NucleusHalflifeGet + +!! Set +subroutine NucleusHalflifeSet(handle, fieldHandle) & + bind(C, name='NucleusHalflifeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NucleusHalflifeSet + + +!! ----------------------------------------------------------------------------- +!! Child: energy +!! ----------------------------------------------------------------------------- + +!! Has +function NucleusEnergyHas(handle) & + bind(C, name='NucleusEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusEnergyHas +end function NucleusEnergyHas + +!! Get, const +function NucleusEnergyGetConst(handle) & + bind(C, name='NucleusEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NucleusEnergyGetConst +end function NucleusEnergyGetConst + +!! Get, non-const +function NucleusEnergyGet(handle) & + bind(C, name='NucleusEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NucleusEnergyGet +end function NucleusEnergyGet + +!! Set +subroutine NucleusEnergySet(handle, fieldHandle) & + bind(C, name='NucleusEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NucleusEnergySet + + +!! ----------------------------------------------------------------------------- +!! Child: decayData +!! ----------------------------------------------------------------------------- + +!! Has +function NucleusDecayDataHas(handle) & + bind(C, name='NucleusDecayDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NucleusDecayDataHas +end function NucleusDecayDataHas + +!! Get, const +function NucleusDecayDataGetConst(handle) & + bind(C, name='NucleusDecayDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NucleusDecayDataGetConst +end function NucleusDecayDataGetConst + +!! Get, non-const +function NucleusDecayDataGet(handle) & + bind(C, name='NucleusDecayDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NucleusDecayDataGet +end function NucleusDecayDataGet + +!! Set +subroutine NucleusDecayDataSet(handle, fieldHandle) & + bind(C, name='NucleusDecayDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NucleusDecayDataSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalNucleus diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Nuclide.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Nuclide.f03 new file mode 100644 index 000000000..90d15108f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Nuclide.f03 @@ -0,0 +1,397 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalNuclide +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function NuclideDefaultConst() & + bind(C, name='NuclideDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: NuclideDefaultConst +end function NuclideDefaultConst + +!! Create, default, non-const +function NuclideDefault() & + bind(C, name='NuclideDefault') + use iso_c_binding + implicit none + type(c_ptr) :: NuclideDefault +end function NuclideDefault + +!! Create, general, const +function NuclideCreateConst( & + id, & + mass, & + charge, & + nucleus, & + decayData, & + fissionFragmentData, & + idSize & +) & + bind(C, name='NuclideCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: charge + type(c_ptr), intent(in), value :: nucleus + type(c_ptr), intent(in), value :: decayData + type(c_ptr), intent(in), value :: fissionFragmentData + type(c_ptr) :: NuclideCreateConst +end function NuclideCreateConst + +!! Create, general, non-const +function NuclideCreate( & + id, & + mass, & + charge, & + nucleus, & + decayData, & + fissionFragmentData, & + idSize & +) & + bind(C, name='NuclideCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: charge + type(c_ptr), intent(in), value :: nucleus + type(c_ptr), intent(in), value :: decayData + type(c_ptr), intent(in), value :: fissionFragmentData + type(c_ptr) :: NuclideCreate +end function NuclideCreate + +!! Assign +subroutine NuclideAssign(handleLHS, handleRHS) & + bind(C, name='NuclideAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine NuclideAssign + +!! Delete +subroutine NuclideDelete(handle) & + bind(C, name='NuclideDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NuclideDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function NuclideRead(handle, filename, filenameSize) & + bind(C, name='NuclideRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclideRead +end function NuclideRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function NuclideWrite(handle, filename, filenameSize) & + bind(C, name='NuclideWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclideWrite +end function NuclideWrite + +!! Print to standard output, in our prettyprinting format +function NuclidePrint(handle) & + bind(C, name='NuclidePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclidePrint +end function NuclidePrint + +!! Print to standard output, as XML +function NuclidePrintXML(handle) & + bind(C, name='NuclidePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclidePrintXML +end function NuclidePrintXML + +!! Print to standard output, as JSON +function NuclidePrintJSON(handle) & + bind(C, name='NuclidePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclidePrintJSON +end function NuclidePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: id +!! ----------------------------------------------------------------------------- + +!! Has +function NuclideIdHas(handle) & + bind(C, name='NuclideIdHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclideIdHas +end function NuclideIdHas + +!! Get +function NuclideIdGet(handle) & + bind(C, name='NuclideIdGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclideIdGet +end function NuclideIdGet + +!! Set +subroutine NuclideIdSet(handle, id, idSize) & + bind(C, name='NuclideIdSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) +end subroutine NuclideIdSet + + +!! ----------------------------------------------------------------------------- +!! Child: mass +!! ----------------------------------------------------------------------------- + +!! Has +function NuclideMassHas(handle) & + bind(C, name='NuclideMassHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclideMassHas +end function NuclideMassHas + +!! Get, const +function NuclideMassGetConst(handle) & + bind(C, name='NuclideMassGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclideMassGetConst +end function NuclideMassGetConst + +!! Get, non-const +function NuclideMassGet(handle) & + bind(C, name='NuclideMassGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclideMassGet +end function NuclideMassGet + +!! Set +subroutine NuclideMassSet(handle, fieldHandle) & + bind(C, name='NuclideMassSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclideMassSet + + +!! ----------------------------------------------------------------------------- +!! Child: charge +!! ----------------------------------------------------------------------------- + +!! Has +function NuclideChargeHas(handle) & + bind(C, name='NuclideChargeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclideChargeHas +end function NuclideChargeHas + +!! Get, const +function NuclideChargeGetConst(handle) & + bind(C, name='NuclideChargeGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclideChargeGetConst +end function NuclideChargeGetConst + +!! Get, non-const +function NuclideChargeGet(handle) & + bind(C, name='NuclideChargeGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclideChargeGet +end function NuclideChargeGet + +!! Set +subroutine NuclideChargeSet(handle, fieldHandle) & + bind(C, name='NuclideChargeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclideChargeSet + + +!! ----------------------------------------------------------------------------- +!! Child: nucleus +!! ----------------------------------------------------------------------------- + +!! Has +function NuclideNucleusHas(handle) & + bind(C, name='NuclideNucleusHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclideNucleusHas +end function NuclideNucleusHas + +!! Get, const +function NuclideNucleusGetConst(handle) & + bind(C, name='NuclideNucleusGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclideNucleusGetConst +end function NuclideNucleusGetConst + +!! Get, non-const +function NuclideNucleusGet(handle) & + bind(C, name='NuclideNucleusGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclideNucleusGet +end function NuclideNucleusGet + +!! Set +subroutine NuclideNucleusSet(handle, fieldHandle) & + bind(C, name='NuclideNucleusSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclideNucleusSet + + +!! ----------------------------------------------------------------------------- +!! Child: decayData +!! ----------------------------------------------------------------------------- + +!! Has +function NuclideDecayDataHas(handle) & + bind(C, name='NuclideDecayDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclideDecayDataHas +end function NuclideDecayDataHas + +!! Get, const +function NuclideDecayDataGetConst(handle) & + bind(C, name='NuclideDecayDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclideDecayDataGetConst +end function NuclideDecayDataGetConst + +!! Get, non-const +function NuclideDecayDataGet(handle) & + bind(C, name='NuclideDecayDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclideDecayDataGet +end function NuclideDecayDataGet + +!! Set +subroutine NuclideDecayDataSet(handle, fieldHandle) & + bind(C, name='NuclideDecayDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclideDecayDataSet + + +!! ----------------------------------------------------------------------------- +!! Child: fissionFragmentData +!! ----------------------------------------------------------------------------- + +!! Has +function NuclideFissionFragmentDataHas(handle) & + bind(C, name='NuclideFissionFragmentDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclideFissionFragmentDataHas +end function NuclideFissionFragmentDataHas + +!! Get, const +function NuclideFissionFragmentDataGetConst(handle) & + bind(C, name='NuclideFissionFragmentDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclideFissionFragmentDataGetConst +end function NuclideFissionFragmentDataGetConst + +!! Get, non-const +function NuclideFissionFragmentDataGet(handle) & + bind(C, name='NuclideFissionFragmentDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: NuclideFissionFragmentDataGet +end function NuclideFissionFragmentDataGet + +!! Set +subroutine NuclideFissionFragmentDataSet(handle, fieldHandle) & + bind(C, name='NuclideFissionFragmentDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclideFissionFragmentDataSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalNuclide diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Nuclides.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Nuclides.f03 new file mode 100644 index 000000000..dafc33446 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Nuclides.f03 @@ -0,0 +1,255 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalNuclides +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function NuclidesDefaultConst() & + bind(C, name='NuclidesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: NuclidesDefaultConst +end function NuclidesDefaultConst + +!! Create, default, non-const +function NuclidesDefault() & + bind(C, name='NuclidesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: NuclidesDefault +end function NuclidesDefault + +!! Create, general, const +function NuclidesCreateConst( & + nuclide, nuclideSize & +) & + bind(C, name='NuclidesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: nuclideSize + type(c_ptr), intent(in) :: nuclide(nuclideSize) + type(c_ptr) :: NuclidesCreateConst +end function NuclidesCreateConst + +!! Create, general, non-const +function NuclidesCreate( & + nuclide, nuclideSize & +) & + bind(C, name='NuclidesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: nuclideSize + type(c_ptr), intent(in) :: nuclide(nuclideSize) + type(c_ptr) :: NuclidesCreate +end function NuclidesCreate + +!! Assign +subroutine NuclidesAssign(handleLHS, handleRHS) & + bind(C, name='NuclidesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine NuclidesAssign + +!! Delete +subroutine NuclidesDelete(handle) & + bind(C, name='NuclidesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NuclidesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function NuclidesRead(handle, filename, filenameSize) & + bind(C, name='NuclidesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclidesRead +end function NuclidesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function NuclidesWrite(handle, filename, filenameSize) & + bind(C, name='NuclidesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclidesWrite +end function NuclidesWrite + +!! Print to standard output, in our prettyprinting format +function NuclidesPrint(handle) & + bind(C, name='NuclidesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclidesPrint +end function NuclidesPrint + +!! Print to standard output, as XML +function NuclidesPrintXML(handle) & + bind(C, name='NuclidesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclidesPrintXML +end function NuclidesPrintXML + +!! Print to standard output, as JSON +function NuclidesPrintJSON(handle) & + bind(C, name='NuclidesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclidesPrintJSON +end function NuclidesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: nuclide +!! ----------------------------------------------------------------------------- + +!! Has +function NuclidesNuclideHas(handle) & + bind(C, name='NuclidesNuclideHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclidesNuclideHas +end function NuclidesNuclideHas + +!! Clear +subroutine NuclidesNuclideClear(handle) & + bind(C, name='NuclidesNuclideClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NuclidesNuclideClear + +!! Size +function NuclidesNuclideSize(handle) & + bind(C, name='NuclidesNuclideSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: NuclidesNuclideSize +end function NuclidesNuclideSize + +!! Add +subroutine NuclidesNuclideAdd(handle, fieldHandle) & + bind(C, name='NuclidesNuclideAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclidesNuclideAdd + +!! Get, by index \in [0,size), const +function NuclidesNuclideGetConst(handle, index) & + bind(C, name='NuclidesNuclideGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: NuclidesNuclideGetConst +end function NuclidesNuclideGetConst + +!! Get, by index \in [0,size), non-const +function NuclidesNuclideGet(handle, index) & + bind(C, name='NuclidesNuclideGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: NuclidesNuclideGet +end function NuclidesNuclideGet + +!! Set, by index \in [0,size) +subroutine NuclidesNuclideSet(handle, index, fieldHandle) & + bind(C, name='NuclidesNuclideSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclidesNuclideSet + +!! ------------------------ +!! Re: metadatum id +!! ------------------------ + +!! Has, by id +function NuclidesNuclideHasById(handle, meta, metaSize) & + bind(C, name='NuclidesNuclideHasById') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: NuclidesNuclideHasById +end function NuclidesNuclideHasById + +!! Get, by id, const +function NuclidesNuclideGetByIdConst(handle, meta, metaSize) & + bind(C, name='NuclidesNuclideGetByIdConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: NuclidesNuclideGetByIdConst +end function NuclidesNuclideGetByIdConst + +!! Get, by id, non-const +function NuclidesNuclideGetById(handle, meta, metaSize) & + bind(C, name='NuclidesNuclideGetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: NuclidesNuclideGetById +end function NuclidesNuclideGetById + +!! Set, by id +subroutine NuclidesNuclideSetById(handle, meta, metaSize, fieldHandle) & + bind(C, name='NuclidesNuclideSetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine NuclidesNuclideSetById + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalNuclides diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/OrphanProduct.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/OrphanProduct.f03 new file mode 100644 index 000000000..8308d412b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/OrphanProduct.f03 @@ -0,0 +1,298 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalOrphanProduct +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function OrphanProductDefaultConst() & + bind(C, name='OrphanProductDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: OrphanProductDefaultConst +end function OrphanProductDefaultConst + +!! Create, default, non-const +function OrphanProductDefault() & + bind(C, name='OrphanProductDefault') + use iso_c_binding + implicit none + type(c_ptr) :: OrphanProductDefault +end function OrphanProductDefault + +!! Create, general, const +function OrphanProductCreateConst( & + label, & + ENDF_MT, & + crossSection, & + outputChannel, & + labelSize & +) & + bind(C, name='OrphanProductCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + type(c_ptr), intent(in), value :: crossSection + type(c_ptr), intent(in), value :: outputChannel + type(c_ptr) :: OrphanProductCreateConst +end function OrphanProductCreateConst + +!! Create, general, non-const +function OrphanProductCreate( & + label, & + ENDF_MT, & + crossSection, & + outputChannel, & + labelSize & +) & + bind(C, name='OrphanProductCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + type(c_ptr), intent(in), value :: crossSection + type(c_ptr), intent(in), value :: outputChannel + type(c_ptr) :: OrphanProductCreate +end function OrphanProductCreate + +!! Assign +subroutine OrphanProductAssign(handleLHS, handleRHS) & + bind(C, name='OrphanProductAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine OrphanProductAssign + +!! Delete +subroutine OrphanProductDelete(handle) & + bind(C, name='OrphanProductDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine OrphanProductDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function OrphanProductRead(handle, filename, filenameSize) & + bind(C, name='OrphanProductRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: OrphanProductRead +end function OrphanProductRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function OrphanProductWrite(handle, filename, filenameSize) & + bind(C, name='OrphanProductWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: OrphanProductWrite +end function OrphanProductWrite + +!! Print to standard output, in our prettyprinting format +function OrphanProductPrint(handle) & + bind(C, name='OrphanProductPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductPrint +end function OrphanProductPrint + +!! Print to standard output, as XML +function OrphanProductPrintXML(handle) & + bind(C, name='OrphanProductPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductPrintXML +end function OrphanProductPrintXML + +!! Print to standard output, as JSON +function OrphanProductPrintJSON(handle) & + bind(C, name='OrphanProductPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductPrintJSON +end function OrphanProductPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function OrphanProductLabelHas(handle) & + bind(C, name='OrphanProductLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductLabelHas +end function OrphanProductLabelHas + +!! Get +function OrphanProductLabelGet(handle) & + bind(C, name='OrphanProductLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OrphanProductLabelGet +end function OrphanProductLabelGet + +!! Set +subroutine OrphanProductLabelSet(handle, label, labelSize) & + bind(C, name='OrphanProductLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine OrphanProductLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: ENDF_MT +!! ----------------------------------------------------------------------------- + +!! Has +function OrphanProductENDFMTHas(handle) & + bind(C, name='OrphanProductENDFMTHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductENDFMTHas +end function OrphanProductENDFMTHas + +!! Get +function OrphanProductENDFMTGet(handle) & + bind(C, name='OrphanProductENDFMTGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductENDFMTGet +end function OrphanProductENDFMTGet + +!! Set +subroutine OrphanProductENDFMTSet(handle, ENDF_MT) & + bind(C, name='OrphanProductENDFMTSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: ENDF_MT +end subroutine OrphanProductENDFMTSet + + +!! ----------------------------------------------------------------------------- +!! Child: crossSection +!! ----------------------------------------------------------------------------- + +!! Has +function OrphanProductCrossSectionHas(handle) & + bind(C, name='OrphanProductCrossSectionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductCrossSectionHas +end function OrphanProductCrossSectionHas + +!! Get, const +function OrphanProductCrossSectionGetConst(handle) & + bind(C, name='OrphanProductCrossSectionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OrphanProductCrossSectionGetConst +end function OrphanProductCrossSectionGetConst + +!! Get, non-const +function OrphanProductCrossSectionGet(handle) & + bind(C, name='OrphanProductCrossSectionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: OrphanProductCrossSectionGet +end function OrphanProductCrossSectionGet + +!! Set +subroutine OrphanProductCrossSectionSet(handle, fieldHandle) & + bind(C, name='OrphanProductCrossSectionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine OrphanProductCrossSectionSet + + +!! ----------------------------------------------------------------------------- +!! Child: outputChannel +!! ----------------------------------------------------------------------------- + +!! Has +function OrphanProductOutputChannelHas(handle) & + bind(C, name='OrphanProductOutputChannelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductOutputChannelHas +end function OrphanProductOutputChannelHas + +!! Get, const +function OrphanProductOutputChannelGetConst(handle) & + bind(C, name='OrphanProductOutputChannelGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OrphanProductOutputChannelGetConst +end function OrphanProductOutputChannelGetConst + +!! Get, non-const +function OrphanProductOutputChannelGet(handle) & + bind(C, name='OrphanProductOutputChannelGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: OrphanProductOutputChannelGet +end function OrphanProductOutputChannelGet + +!! Set +subroutine OrphanProductOutputChannelSet(handle, fieldHandle) & + bind(C, name='OrphanProductOutputChannelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine OrphanProductOutputChannelSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalOrphanProduct diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/OrphanProducts.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/OrphanProducts.f03 new file mode 100644 index 000000000..0b44935f5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/OrphanProducts.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalOrphanProducts +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function OrphanProductsDefaultConst() & + bind(C, name='OrphanProductsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: OrphanProductsDefaultConst +end function OrphanProductsDefaultConst + +!! Create, default, non-const +function OrphanProductsDefault() & + bind(C, name='OrphanProductsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: OrphanProductsDefault +end function OrphanProductsDefault + +!! Create, general, const +function OrphanProductsCreateConst( & + orphanProduct, orphanProductSize & +) & + bind(C, name='OrphanProductsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: orphanProductSize + type(c_ptr), intent(in) :: orphanProduct(orphanProductSize) + type(c_ptr) :: OrphanProductsCreateConst +end function OrphanProductsCreateConst + +!! Create, general, non-const +function OrphanProductsCreate( & + orphanProduct, orphanProductSize & +) & + bind(C, name='OrphanProductsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: orphanProductSize + type(c_ptr), intent(in) :: orphanProduct(orphanProductSize) + type(c_ptr) :: OrphanProductsCreate +end function OrphanProductsCreate + +!! Assign +subroutine OrphanProductsAssign(handleLHS, handleRHS) & + bind(C, name='OrphanProductsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine OrphanProductsAssign + +!! Delete +subroutine OrphanProductsDelete(handle) & + bind(C, name='OrphanProductsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine OrphanProductsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function OrphanProductsRead(handle, filename, filenameSize) & + bind(C, name='OrphanProductsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: OrphanProductsRead +end function OrphanProductsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function OrphanProductsWrite(handle, filename, filenameSize) & + bind(C, name='OrphanProductsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: OrphanProductsWrite +end function OrphanProductsWrite + +!! Print to standard output, in our prettyprinting format +function OrphanProductsPrint(handle) & + bind(C, name='OrphanProductsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductsPrint +end function OrphanProductsPrint + +!! Print to standard output, as XML +function OrphanProductsPrintXML(handle) & + bind(C, name='OrphanProductsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductsPrintXML +end function OrphanProductsPrintXML + +!! Print to standard output, as JSON +function OrphanProductsPrintJSON(handle) & + bind(C, name='OrphanProductsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductsPrintJSON +end function OrphanProductsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: orphanProduct +!! ----------------------------------------------------------------------------- + +!! Has +function OrphanProductsOrphanProductHas(handle) & + bind(C, name='OrphanProductsOrphanProductHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OrphanProductsOrphanProductHas +end function OrphanProductsOrphanProductHas + +!! Clear +subroutine OrphanProductsOrphanProductClear(handle) & + bind(C, name='OrphanProductsOrphanProductClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine OrphanProductsOrphanProductClear + +!! Size +function OrphanProductsOrphanProductSize(handle) & + bind(C, name='OrphanProductsOrphanProductSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: OrphanProductsOrphanProductSize +end function OrphanProductsOrphanProductSize + +!! Add +subroutine OrphanProductsOrphanProductAdd(handle, fieldHandle) & + bind(C, name='OrphanProductsOrphanProductAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine OrphanProductsOrphanProductAdd + +!! Get, by index \in [0,size), const +function OrphanProductsOrphanProductGetConst(handle, index) & + bind(C, name='OrphanProductsOrphanProductGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: OrphanProductsOrphanProductGetConst +end function OrphanProductsOrphanProductGetConst + +!! Get, by index \in [0,size), non-const +function OrphanProductsOrphanProductGet(handle, index) & + bind(C, name='OrphanProductsOrphanProductGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: OrphanProductsOrphanProductGet +end function OrphanProductsOrphanProductGet + +!! Set, by index \in [0,size) +subroutine OrphanProductsOrphanProductSet(handle, index, fieldHandle) & + bind(C, name='OrphanProductsOrphanProductSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine OrphanProductsOrphanProductSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function OrphanProductsOrphanProductHasByLabel(handle, meta, metaSize) & + bind(C, name='OrphanProductsOrphanProductHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: OrphanProductsOrphanProductHasByLabel +end function OrphanProductsOrphanProductHasByLabel + +!! Get, by label, const +function OrphanProductsOrphanProductGetByLabelConst(handle, meta, metaSize) & + bind(C, name='OrphanProductsOrphanProductGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: OrphanProductsOrphanProductGetByLabelConst +end function OrphanProductsOrphanProductGetByLabelConst + +!! Get, by label, non-const +function OrphanProductsOrphanProductGetByLabel(handle, meta, metaSize) & + bind(C, name='OrphanProductsOrphanProductGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: OrphanProductsOrphanProductGetByLabel +end function OrphanProductsOrphanProductGetByLabel + +!! Set, by label +subroutine OrphanProductsOrphanProductSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='OrphanProductsOrphanProductSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine OrphanProductsOrphanProductSetByLabel + +!! ------------------------ +!! Re: metadatum ENDF_MT +!! ------------------------ + +!! Has, by ENDF_MT +function OrphanProductsOrphanProductHasByENDFMT(handle, meta) & + bind(C, name='OrphanProductsOrphanProductHasByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: OrphanProductsOrphanProductHasByENDFMT +end function OrphanProductsOrphanProductHasByENDFMT + +!! Get, by ENDF_MT, const +function OrphanProductsOrphanProductGetByENDFMTConst(handle, meta) & + bind(C, name='OrphanProductsOrphanProductGetByENDFMTConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: OrphanProductsOrphanProductGetByENDFMTConst +end function OrphanProductsOrphanProductGetByENDFMTConst + +!! Get, by ENDF_MT, non-const +function OrphanProductsOrphanProductGetByENDFMT(handle, meta) & + bind(C, name='OrphanProductsOrphanProductGetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: OrphanProductsOrphanProductGetByENDFMT +end function OrphanProductsOrphanProductGetByENDFMT + +!! Set, by ENDF_MT +subroutine OrphanProductsOrphanProductSetByENDFMT(handle, meta, fieldHandle) & + bind(C, name='OrphanProductsOrphanProductSetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine OrphanProductsOrphanProductSetByENDFMT + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalOrphanProducts diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/OutputChannel.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/OutputChannel.f03 new file mode 100644 index 000000000..84d3772d0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/OutputChannel.f03 @@ -0,0 +1,348 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalOutputChannel +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function OutputChannelDefaultConst() & + bind(C, name='OutputChannelDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: OutputChannelDefaultConst +end function OutputChannelDefaultConst + +!! Create, default, non-const +function OutputChannelDefault() & + bind(C, name='OutputChannelDefault') + use iso_c_binding + implicit none + type(c_ptr) :: OutputChannelDefault +end function OutputChannelDefault + +!! Create, general, const +function OutputChannelCreateConst( & + genre, & + process, & + Q, & + products, & + fissionFragmentData, & + genreSize, & + processSize & +) & + bind(C, name='OutputChannelCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: genreSize + character(c_char), intent(in) :: genre(genreSize) + integer(c_size_t), intent(in), value :: processSize + character(c_char), intent(in) :: process(processSize) + type(c_ptr), intent(in), value :: Q + type(c_ptr), intent(in), value :: products + type(c_ptr), intent(in), value :: fissionFragmentData + type(c_ptr) :: OutputChannelCreateConst +end function OutputChannelCreateConst + +!! Create, general, non-const +function OutputChannelCreate( & + genre, & + process, & + Q, & + products, & + fissionFragmentData, & + genreSize, & + processSize & +) & + bind(C, name='OutputChannelCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: genreSize + character(c_char), intent(in) :: genre(genreSize) + integer(c_size_t), intent(in), value :: processSize + character(c_char), intent(in) :: process(processSize) + type(c_ptr), intent(in), value :: Q + type(c_ptr), intent(in), value :: products + type(c_ptr), intent(in), value :: fissionFragmentData + type(c_ptr) :: OutputChannelCreate +end function OutputChannelCreate + +!! Assign +subroutine OutputChannelAssign(handleLHS, handleRHS) & + bind(C, name='OutputChannelAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine OutputChannelAssign + +!! Delete +subroutine OutputChannelDelete(handle) & + bind(C, name='OutputChannelDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine OutputChannelDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function OutputChannelRead(handle, filename, filenameSize) & + bind(C, name='OutputChannelRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: OutputChannelRead +end function OutputChannelRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function OutputChannelWrite(handle, filename, filenameSize) & + bind(C, name='OutputChannelWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: OutputChannelWrite +end function OutputChannelWrite + +!! Print to standard output, in our prettyprinting format +function OutputChannelPrint(handle) & + bind(C, name='OutputChannelPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelPrint +end function OutputChannelPrint + +!! Print to standard output, as XML +function OutputChannelPrintXML(handle) & + bind(C, name='OutputChannelPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelPrintXML +end function OutputChannelPrintXML + +!! Print to standard output, as JSON +function OutputChannelPrintJSON(handle) & + bind(C, name='OutputChannelPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelPrintJSON +end function OutputChannelPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: genre +!! ----------------------------------------------------------------------------- + +!! Has +function OutputChannelGenreHas(handle) & + bind(C, name='OutputChannelGenreHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelGenreHas +end function OutputChannelGenreHas + +!! Get +function OutputChannelGenreGet(handle) & + bind(C, name='OutputChannelGenreGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OutputChannelGenreGet +end function OutputChannelGenreGet + +!! Set +subroutine OutputChannelGenreSet(handle, genre, genreSize) & + bind(C, name='OutputChannelGenreSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: genreSize + character(c_char), intent(in) :: genre(genreSize) +end subroutine OutputChannelGenreSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: process +!! ----------------------------------------------------------------------------- + +!! Has +function OutputChannelProcessHas(handle) & + bind(C, name='OutputChannelProcessHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelProcessHas +end function OutputChannelProcessHas + +!! Get +function OutputChannelProcessGet(handle) & + bind(C, name='OutputChannelProcessGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OutputChannelProcessGet +end function OutputChannelProcessGet + +!! Set +subroutine OutputChannelProcessSet(handle, process, processSize) & + bind(C, name='OutputChannelProcessSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: processSize + character(c_char), intent(in) :: process(processSize) +end subroutine OutputChannelProcessSet + + +!! ----------------------------------------------------------------------------- +!! Child: Q +!! ----------------------------------------------------------------------------- + +!! Has +function OutputChannelQHas(handle) & + bind(C, name='OutputChannelQHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelQHas +end function OutputChannelQHas + +!! Get, const +function OutputChannelQGetConst(handle) & + bind(C, name='OutputChannelQGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OutputChannelQGetConst +end function OutputChannelQGetConst + +!! Get, non-const +function OutputChannelQGet(handle) & + bind(C, name='OutputChannelQGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: OutputChannelQGet +end function OutputChannelQGet + +!! Set +subroutine OutputChannelQSet(handle, fieldHandle) & + bind(C, name='OutputChannelQSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine OutputChannelQSet + + +!! ----------------------------------------------------------------------------- +!! Child: products +!! ----------------------------------------------------------------------------- + +!! Has +function OutputChannelProductsHas(handle) & + bind(C, name='OutputChannelProductsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelProductsHas +end function OutputChannelProductsHas + +!! Get, const +function OutputChannelProductsGetConst(handle) & + bind(C, name='OutputChannelProductsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OutputChannelProductsGetConst +end function OutputChannelProductsGetConst + +!! Get, non-const +function OutputChannelProductsGet(handle) & + bind(C, name='OutputChannelProductsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: OutputChannelProductsGet +end function OutputChannelProductsGet + +!! Set +subroutine OutputChannelProductsSet(handle, fieldHandle) & + bind(C, name='OutputChannelProductsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine OutputChannelProductsSet + + +!! ----------------------------------------------------------------------------- +!! Child: fissionFragmentData +!! ----------------------------------------------------------------------------- + +!! Has +function OutputChannelFissionFragmentDataHas(handle) & + bind(C, name='OutputChannelFissionFragmentDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelFissionFragmentDataHas +end function OutputChannelFissionFragmentDataHas + +!! Get, const +function OutputChannelFissionFragmentDataGetConst(handle) & + bind(C, name='OutputChannelFissionFragmentDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OutputChannelFissionFragmentDataGetConst +end function OutputChannelFissionFragmentDataGetConst + +!! Get, non-const +function OutputChannelFissionFragmentDataGet(handle) & + bind(C, name='OutputChannelFissionFragmentDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: OutputChannelFissionFragmentDataGet +end function OutputChannelFissionFragmentDataGet + +!! Set +subroutine OutputChannelFissionFragmentDataSet(handle, fieldHandle) & + bind(C, name='OutputChannelFissionFragmentDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine OutputChannelFissionFragmentDataSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalOutputChannel diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterCovariance.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterCovariance.f03 new file mode 100644 index 000000000..52994c048 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterCovariance.f03 @@ -0,0 +1,262 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalParameterCovariance +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ParameterCovarianceDefaultConst() & + bind(C, name='ParameterCovarianceDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ParameterCovarianceDefaultConst +end function ParameterCovarianceDefaultConst + +!! Create, default, non-const +function ParameterCovarianceDefault() & + bind(C, name='ParameterCovarianceDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ParameterCovarianceDefault +end function ParameterCovarianceDefault + +!! Create, general, const +function ParameterCovarianceCreateConst( & + label, & + rowData, & + parameterCovarianceMatrix, & + labelSize & +) & + bind(C, name='ParameterCovarianceCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: rowData + type(c_ptr), intent(in), value :: parameterCovarianceMatrix + type(c_ptr) :: ParameterCovarianceCreateConst +end function ParameterCovarianceCreateConst + +!! Create, general, non-const +function ParameterCovarianceCreate( & + label, & + rowData, & + parameterCovarianceMatrix, & + labelSize & +) & + bind(C, name='ParameterCovarianceCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: rowData + type(c_ptr), intent(in), value :: parameterCovarianceMatrix + type(c_ptr) :: ParameterCovarianceCreate +end function ParameterCovarianceCreate + +!! Assign +subroutine ParameterCovarianceAssign(handleLHS, handleRHS) & + bind(C, name='ParameterCovarianceAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ParameterCovarianceAssign + +!! Delete +subroutine ParameterCovarianceDelete(handle) & + bind(C, name='ParameterCovarianceDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ParameterCovarianceDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ParameterCovarianceRead(handle, filename, filenameSize) & + bind(C, name='ParameterCovarianceRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParameterCovarianceRead +end function ParameterCovarianceRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ParameterCovarianceWrite(handle, filename, filenameSize) & + bind(C, name='ParameterCovarianceWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParameterCovarianceWrite +end function ParameterCovarianceWrite + +!! Print to standard output, in our prettyprinting format +function ParameterCovariancePrint(handle) & + bind(C, name='ParameterCovariancePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovariancePrint +end function ParameterCovariancePrint + +!! Print to standard output, as XML +function ParameterCovariancePrintXML(handle) & + bind(C, name='ParameterCovariancePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovariancePrintXML +end function ParameterCovariancePrintXML + +!! Print to standard output, as JSON +function ParameterCovariancePrintJSON(handle) & + bind(C, name='ParameterCovariancePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovariancePrintJSON +end function ParameterCovariancePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterCovarianceLabelHas(handle) & + bind(C, name='ParameterCovarianceLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovarianceLabelHas +end function ParameterCovarianceLabelHas + +!! Get +function ParameterCovarianceLabelGet(handle) & + bind(C, name='ParameterCovarianceLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ParameterCovarianceLabelGet +end function ParameterCovarianceLabelGet + +!! Set +subroutine ParameterCovarianceLabelSet(handle, label, labelSize) & + bind(C, name='ParameterCovarianceLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ParameterCovarianceLabelSet + + +!! ----------------------------------------------------------------------------- +!! Child: rowData +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterCovarianceRowDataHas(handle) & + bind(C, name='ParameterCovarianceRowDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovarianceRowDataHas +end function ParameterCovarianceRowDataHas + +!! Get, const +function ParameterCovarianceRowDataGetConst(handle) & + bind(C, name='ParameterCovarianceRowDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ParameterCovarianceRowDataGetConst +end function ParameterCovarianceRowDataGetConst + +!! Get, non-const +function ParameterCovarianceRowDataGet(handle) & + bind(C, name='ParameterCovarianceRowDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ParameterCovarianceRowDataGet +end function ParameterCovarianceRowDataGet + +!! Set +subroutine ParameterCovarianceRowDataSet(handle, fieldHandle) & + bind(C, name='ParameterCovarianceRowDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParameterCovarianceRowDataSet + + +!! ----------------------------------------------------------------------------- +!! Child: parameterCovarianceMatrix +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterCovarianceParameterCovarianceMatrixHas(handle) & + bind(C, name='ParameterCovarianceParameterCovarianceMatrixHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovarianceParameterCovarianceMatrixHas +end function ParameterCovarianceParameterCovarianceMatrixHas + +!! Get, const +function ParameterCovarianceParameterCovarianceMatrixGetConst(handle) & + bind(C, name='ParameterCovarianceParameterCovarianceMatrixGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ParameterCovarianceParameterCovarianceMatrixGetConst +end function ParameterCovarianceParameterCovarianceMatrixGetConst + +!! Get, non-const +function ParameterCovarianceParameterCovarianceMatrixGet(handle) & + bind(C, name='ParameterCovarianceParameterCovarianceMatrixGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ParameterCovarianceParameterCovarianceMatrixGet +end function ParameterCovarianceParameterCovarianceMatrixGet + +!! Set +subroutine ParameterCovarianceParameterCovarianceMatrixSet(handle, fieldHandle) & + bind(C, name='ParameterCovarianceParameterCovarianceMatrixSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParameterCovarianceParameterCovarianceMatrixSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalParameterCovariance diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterCovarianceMatrix.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterCovarianceMatrix.f03 new file mode 100644 index 000000000..0d4eec600 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterCovarianceMatrix.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalParameterCovarianceMatrix +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ParameterCovarianceMatrixDefaultConst() & + bind(C, name='ParameterCovarianceMatrixDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ParameterCovarianceMatrixDefaultConst +end function ParameterCovarianceMatrixDefaultConst + +!! Create, default, non-const +function ParameterCovarianceMatrixDefault() & + bind(C, name='ParameterCovarianceMatrixDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ParameterCovarianceMatrixDefault +end function ParameterCovarianceMatrixDefault + +!! Create, general, const +function ParameterCovarianceMatrixCreateConst( & + label, & + type1, & + array, & + parameters, & + labelSize, & + type1Size & +) & + bind(C, name='ParameterCovarianceMatrixCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) + type(c_ptr), intent(in), value :: array + type(c_ptr), intent(in), value :: parameters + type(c_ptr) :: ParameterCovarianceMatrixCreateConst +end function ParameterCovarianceMatrixCreateConst + +!! Create, general, non-const +function ParameterCovarianceMatrixCreate( & + label, & + type1, & + array, & + parameters, & + labelSize, & + type1Size & +) & + bind(C, name='ParameterCovarianceMatrixCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) + type(c_ptr), intent(in), value :: array + type(c_ptr), intent(in), value :: parameters + type(c_ptr) :: ParameterCovarianceMatrixCreate +end function ParameterCovarianceMatrixCreate + +!! Assign +subroutine ParameterCovarianceMatrixAssign(handleLHS, handleRHS) & + bind(C, name='ParameterCovarianceMatrixAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ParameterCovarianceMatrixAssign + +!! Delete +subroutine ParameterCovarianceMatrixDelete(handle) & + bind(C, name='ParameterCovarianceMatrixDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ParameterCovarianceMatrixDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ParameterCovarianceMatrixRead(handle, filename, filenameSize) & + bind(C, name='ParameterCovarianceMatrixRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParameterCovarianceMatrixRead +end function ParameterCovarianceMatrixRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ParameterCovarianceMatrixWrite(handle, filename, filenameSize) & + bind(C, name='ParameterCovarianceMatrixWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParameterCovarianceMatrixWrite +end function ParameterCovarianceMatrixWrite + +!! Print to standard output, in our prettyprinting format +function ParameterCovarianceMatrixPrint(handle) & + bind(C, name='ParameterCovarianceMatrixPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovarianceMatrixPrint +end function ParameterCovarianceMatrixPrint + +!! Print to standard output, as XML +function ParameterCovarianceMatrixPrintXML(handle) & + bind(C, name='ParameterCovarianceMatrixPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovarianceMatrixPrintXML +end function ParameterCovarianceMatrixPrintXML + +!! Print to standard output, as JSON +function ParameterCovarianceMatrixPrintJSON(handle) & + bind(C, name='ParameterCovarianceMatrixPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovarianceMatrixPrintJSON +end function ParameterCovarianceMatrixPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterCovarianceMatrixLabelHas(handle) & + bind(C, name='ParameterCovarianceMatrixLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovarianceMatrixLabelHas +end function ParameterCovarianceMatrixLabelHas + +!! Get +function ParameterCovarianceMatrixLabelGet(handle) & + bind(C, name='ParameterCovarianceMatrixLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ParameterCovarianceMatrixLabelGet +end function ParameterCovarianceMatrixLabelGet + +!! Set +subroutine ParameterCovarianceMatrixLabelSet(handle, label, labelSize) & + bind(C, name='ParameterCovarianceMatrixLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ParameterCovarianceMatrixLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: type +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterCovarianceMatrixTypeHas(handle) & + bind(C, name='ParameterCovarianceMatrixTypeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovarianceMatrixTypeHas +end function ParameterCovarianceMatrixTypeHas + +!! Get +function ParameterCovarianceMatrixTypeGet(handle) & + bind(C, name='ParameterCovarianceMatrixTypeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ParameterCovarianceMatrixTypeGet +end function ParameterCovarianceMatrixTypeGet + +!! Set +subroutine ParameterCovarianceMatrixTypeSet(handle, type1, type1Size) & + bind(C, name='ParameterCovarianceMatrixTypeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) +end subroutine ParameterCovarianceMatrixTypeSet + + +!! ----------------------------------------------------------------------------- +!! Child: array +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterCovarianceMatrixArrayHas(handle) & + bind(C, name='ParameterCovarianceMatrixArrayHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovarianceMatrixArrayHas +end function ParameterCovarianceMatrixArrayHas + +!! Get, const +function ParameterCovarianceMatrixArrayGetConst(handle) & + bind(C, name='ParameterCovarianceMatrixArrayGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ParameterCovarianceMatrixArrayGetConst +end function ParameterCovarianceMatrixArrayGetConst + +!! Get, non-const +function ParameterCovarianceMatrixArrayGet(handle) & + bind(C, name='ParameterCovarianceMatrixArrayGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ParameterCovarianceMatrixArrayGet +end function ParameterCovarianceMatrixArrayGet + +!! Set +subroutine ParameterCovarianceMatrixArraySet(handle, fieldHandle) & + bind(C, name='ParameterCovarianceMatrixArraySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParameterCovarianceMatrixArraySet + + +!! ----------------------------------------------------------------------------- +!! Child: parameters +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterCovarianceMatrixParametersHas(handle) & + bind(C, name='ParameterCovarianceMatrixParametersHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovarianceMatrixParametersHas +end function ParameterCovarianceMatrixParametersHas + +!! Get, const +function ParameterCovarianceMatrixParametersGetConst(handle) & + bind(C, name='ParameterCovarianceMatrixParametersGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ParameterCovarianceMatrixParametersGetConst +end function ParameterCovarianceMatrixParametersGetConst + +!! Get, non-const +function ParameterCovarianceMatrixParametersGet(handle) & + bind(C, name='ParameterCovarianceMatrixParametersGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ParameterCovarianceMatrixParametersGet +end function ParameterCovarianceMatrixParametersGet + +!! Set +subroutine ParameterCovarianceMatrixParametersSet(handle, fieldHandle) & + bind(C, name='ParameterCovarianceMatrixParametersSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParameterCovarianceMatrixParametersSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalParameterCovarianceMatrix diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterCovariances.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterCovariances.f03 new file mode 100644 index 000000000..c108e9576 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterCovariances.f03 @@ -0,0 +1,423 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalParameterCovariances +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ParameterCovariancesDefaultConst() & + bind(C, name='ParameterCovariancesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ParameterCovariancesDefaultConst +end function ParameterCovariancesDefaultConst + +!! Create, default, non-const +function ParameterCovariancesDefault() & + bind(C, name='ParameterCovariancesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ParameterCovariancesDefault +end function ParameterCovariancesDefault + +!! Create, general, const +function ParameterCovariancesCreateConst( & + parameterCovariance, parameterCovarianceSize, & + averageParameterCovariance, averageParameterCovarianceSize & +) & + bind(C, name='ParameterCovariancesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: parameterCovarianceSize + type(c_ptr), intent(in) :: parameterCovariance(parameterCovarianceSize) + integer(c_size_t), intent(in), value :: averageParameterCovarianceSize + type(c_ptr), intent(in) :: averageParameterCovariance(averageParameterCovarianceSize) + type(c_ptr) :: ParameterCovariancesCreateConst +end function ParameterCovariancesCreateConst + +!! Create, general, non-const +function ParameterCovariancesCreate( & + parameterCovariance, parameterCovarianceSize, & + averageParameterCovariance, averageParameterCovarianceSize & +) & + bind(C, name='ParameterCovariancesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: parameterCovarianceSize + type(c_ptr), intent(in) :: parameterCovariance(parameterCovarianceSize) + integer(c_size_t), intent(in), value :: averageParameterCovarianceSize + type(c_ptr), intent(in) :: averageParameterCovariance(averageParameterCovarianceSize) + type(c_ptr) :: ParameterCovariancesCreate +end function ParameterCovariancesCreate + +!! Assign +subroutine ParameterCovariancesAssign(handleLHS, handleRHS) & + bind(C, name='ParameterCovariancesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ParameterCovariancesAssign + +!! Delete +subroutine ParameterCovariancesDelete(handle) & + bind(C, name='ParameterCovariancesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ParameterCovariancesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ParameterCovariancesRead(handle, filename, filenameSize) & + bind(C, name='ParameterCovariancesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParameterCovariancesRead +end function ParameterCovariancesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ParameterCovariancesWrite(handle, filename, filenameSize) & + bind(C, name='ParameterCovariancesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParameterCovariancesWrite +end function ParameterCovariancesWrite + +!! Print to standard output, in our prettyprinting format +function ParameterCovariancesPrint(handle) & + bind(C, name='ParameterCovariancesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovariancesPrint +end function ParameterCovariancesPrint + +!! Print to standard output, as XML +function ParameterCovariancesPrintXML(handle) & + bind(C, name='ParameterCovariancesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovariancesPrintXML +end function ParameterCovariancesPrintXML + +!! Print to standard output, as JSON +function ParameterCovariancesPrintJSON(handle) & + bind(C, name='ParameterCovariancesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovariancesPrintJSON +end function ParameterCovariancesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: parameterCovariance +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterCovariancesParameterCovarianceHas(handle) & + bind(C, name='ParameterCovariancesParameterCovarianceHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovariancesParameterCovarianceHas +end function ParameterCovariancesParameterCovarianceHas + +!! Clear +subroutine ParameterCovariancesParameterCovarianceClear(handle) & + bind(C, name='ParameterCovariancesParameterCovarianceClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ParameterCovariancesParameterCovarianceClear + +!! Size +function ParameterCovariancesParameterCovarianceSize(handle) & + bind(C, name='ParameterCovariancesParameterCovarianceSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ParameterCovariancesParameterCovarianceSize +end function ParameterCovariancesParameterCovarianceSize + +!! Add +subroutine ParameterCovariancesParameterCovarianceAdd(handle, fieldHandle) & + bind(C, name='ParameterCovariancesParameterCovarianceAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParameterCovariancesParameterCovarianceAdd + +!! Get, by index \in [0,size), const +function ParameterCovariancesParameterCovarianceGetConst(handle, index) & + bind(C, name='ParameterCovariancesParameterCovarianceGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ParameterCovariancesParameterCovarianceGetConst +end function ParameterCovariancesParameterCovarianceGetConst + +!! Get, by index \in [0,size), non-const +function ParameterCovariancesParameterCovarianceGet(handle, index) & + bind(C, name='ParameterCovariancesParameterCovarianceGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ParameterCovariancesParameterCovarianceGet +end function ParameterCovariancesParameterCovarianceGet + +!! Set, by index \in [0,size) +subroutine ParameterCovariancesParameterCovarianceSet(handle, index, fieldHandle) & + bind(C, name='ParameterCovariancesParameterCovarianceSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParameterCovariancesParameterCovarianceSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ParameterCovariancesParameterCovarianceHasByLabel(handle, meta, metaSize) & + bind(C, name='ParameterCovariancesParameterCovarianceHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ParameterCovariancesParameterCovarianceHasByLabel +end function ParameterCovariancesParameterCovarianceHasByLabel + +!! Get, by label, const +function ParameterCovariancesParameterCovarianceGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ParameterCovariancesParameterCovarianceGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ParameterCovariancesParameterCovarianceGetByLabelConst +end function ParameterCovariancesParameterCovarianceGetByLabelConst + +!! Get, by label, non-const +function ParameterCovariancesParameterCovarianceGetByLabel(handle, meta, metaSize) & + bind(C, name='ParameterCovariancesParameterCovarianceGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ParameterCovariancesParameterCovarianceGetByLabel +end function ParameterCovariancesParameterCovarianceGetByLabel + +!! Set, by label +subroutine ParameterCovariancesParameterCovarianceSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ParameterCovariancesParameterCovarianceSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParameterCovariancesParameterCovarianceSetByLabel + + +!! ----------------------------------------------------------------------------- +!! Child: averageParameterCovariance +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterCovariancesAverageParameterCovarianceHas(handle) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterCovariancesAverageParameterCovarianceHas +end function ParameterCovariancesAverageParameterCovarianceHas + +!! Clear +subroutine ParameterCovariancesAverageParameterCovarianceClear(handle) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ParameterCovariancesAverageParameterCovarianceClear + +!! Size +function ParameterCovariancesAverageParameterCovarianceSize(handle) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ParameterCovariancesAverageParameterCovarianceSize +end function ParameterCovariancesAverageParameterCovarianceSize + +!! Add +subroutine ParameterCovariancesAverageParameterCovarianceAdd(handle, fieldHandle) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParameterCovariancesAverageParameterCovarianceAdd + +!! Get, by index \in [0,size), const +function ParameterCovariancesAverageParameterCovarianceGetConst(handle, index) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ParameterCovariancesAverageParameterCovarianceGetConst +end function ParameterCovariancesAverageParameterCovarianceGetConst + +!! Get, by index \in [0,size), non-const +function ParameterCovariancesAverageParameterCovarianceGet(handle, index) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ParameterCovariancesAverageParameterCovarianceGet +end function ParameterCovariancesAverageParameterCovarianceGet + +!! Set, by index \in [0,size) +subroutine ParameterCovariancesAverageParameterCovarianceSet(handle, index, fieldHandle) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParameterCovariancesAverageParameterCovarianceSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ParameterCovariancesAverageParameterCovarianceHasByLabel(handle, meta, metaSize) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ParameterCovariancesAverageParameterCovarianceHasByLabel +end function ParameterCovariancesAverageParameterCovarianceHasByLabel + +!! Get, by label, const +function ParameterCovariancesAverageParameterCovarianceGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ParameterCovariancesAverageParameterCovarianceGetByLabelConst +end function ParameterCovariancesAverageParameterCovarianceGetByLabelConst + +!! Get, by label, non-const +function ParameterCovariancesAverageParameterCovarianceGetByLabel(handle, meta, metaSize) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ParameterCovariancesAverageParameterCovarianceGetByLabel +end function ParameterCovariancesAverageParameterCovarianceGetByLabel + +!! Set, by label +subroutine ParameterCovariancesAverageParameterCovarianceSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParameterCovariancesAverageParameterCovarianceSetByLabel + +!! ------------------------ +!! Re: metadatum crossTerm +!! ------------------------ + +!! Has, by crossTerm +function ParameterCovariancesAverageParameterCovarianceHasByCrossTerm(handle, meta) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceHasByCrossTerm') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool), intent(in), value :: meta + integer(c_int) :: ParameterCovariancesAverageParameterCovarianceHasByCrossTerm +end function ParameterCovariancesAverageParameterCovarianceHasByCrossTerm + +!! Get, by crossTerm, const +function ParameterCovariancesAverageParameterCovarianceGetByCrossTermConst(handle, meta) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceGetByCrossTermConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr) :: ParameterCovariancesAverageParameterCovarianceGetByCrossTermConst +end function ParameterCovariancesAverageParameterCovarianceGetByCrossTermConst + +!! Get, by crossTerm, non-const +function ParameterCovariancesAverageParameterCovarianceGetByCrossTerm(handle, meta) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceGetByCrossTerm') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr) :: ParameterCovariancesAverageParameterCovarianceGetByCrossTerm +end function ParameterCovariancesAverageParameterCovarianceGetByCrossTerm + +!! Set, by crossTerm +subroutine ParameterCovariancesAverageParameterCovarianceSetByCrossTerm(handle, meta, fieldHandle) & + bind(C, name='ParameterCovariancesAverageParameterCovarianceSetByCrossTerm') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParameterCovariancesAverageParameterCovarianceSetByCrossTerm + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalParameterCovariances diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterLink.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterLink.f03 new file mode 100644 index 000000000..f0e5f7127 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ParameterLink.f03 @@ -0,0 +1,285 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalParameterLink +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ParameterLinkDefaultConst() & + bind(C, name='ParameterLinkDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ParameterLinkDefaultConst +end function ParameterLinkDefaultConst + +!! Create, default, non-const +function ParameterLinkDefault() & + bind(C, name='ParameterLinkDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ParameterLinkDefault +end function ParameterLinkDefault + +!! Create, general, const +function ParameterLinkCreateConst( & + label, & + href, & + nParameters, & + matrixStartIndex, & + labelSize, & + hrefSize & +) & + bind(C, name='ParameterLinkCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + integer(c_int), intent(in), value :: nParameters + integer(c_int), intent(in), value :: matrixStartIndex + type(c_ptr) :: ParameterLinkCreateConst +end function ParameterLinkCreateConst + +!! Create, general, non-const +function ParameterLinkCreate( & + label, & + href, & + nParameters, & + matrixStartIndex, & + labelSize, & + hrefSize & +) & + bind(C, name='ParameterLinkCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + integer(c_int), intent(in), value :: nParameters + integer(c_int), intent(in), value :: matrixStartIndex + type(c_ptr) :: ParameterLinkCreate +end function ParameterLinkCreate + +!! Assign +subroutine ParameterLinkAssign(handleLHS, handleRHS) & + bind(C, name='ParameterLinkAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ParameterLinkAssign + +!! Delete +subroutine ParameterLinkDelete(handle) & + bind(C, name='ParameterLinkDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ParameterLinkDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ParameterLinkRead(handle, filename, filenameSize) & + bind(C, name='ParameterLinkRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParameterLinkRead +end function ParameterLinkRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ParameterLinkWrite(handle, filename, filenameSize) & + bind(C, name='ParameterLinkWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParameterLinkWrite +end function ParameterLinkWrite + +!! Print to standard output, in our prettyprinting format +function ParameterLinkPrint(handle) & + bind(C, name='ParameterLinkPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterLinkPrint +end function ParameterLinkPrint + +!! Print to standard output, as XML +function ParameterLinkPrintXML(handle) & + bind(C, name='ParameterLinkPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterLinkPrintXML +end function ParameterLinkPrintXML + +!! Print to standard output, as JSON +function ParameterLinkPrintJSON(handle) & + bind(C, name='ParameterLinkPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterLinkPrintJSON +end function ParameterLinkPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterLinkLabelHas(handle) & + bind(C, name='ParameterLinkLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterLinkLabelHas +end function ParameterLinkLabelHas + +!! Get +function ParameterLinkLabelGet(handle) & + bind(C, name='ParameterLinkLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ParameterLinkLabelGet +end function ParameterLinkLabelGet + +!! Set +subroutine ParameterLinkLabelSet(handle, label, labelSize) & + bind(C, name='ParameterLinkLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ParameterLinkLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterLinkHrefHas(handle) & + bind(C, name='ParameterLinkHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterLinkHrefHas +end function ParameterLinkHrefHas + +!! Get +function ParameterLinkHrefGet(handle) & + bind(C, name='ParameterLinkHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ParameterLinkHrefGet +end function ParameterLinkHrefGet + +!! Set +subroutine ParameterLinkHrefSet(handle, href, hrefSize) & + bind(C, name='ParameterLinkHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine ParameterLinkHrefSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: nParameters +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterLinkNParametersHas(handle) & + bind(C, name='ParameterLinkNParametersHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterLinkNParametersHas +end function ParameterLinkNParametersHas + +!! Get +function ParameterLinkNParametersGet(handle) & + bind(C, name='ParameterLinkNParametersGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterLinkNParametersGet +end function ParameterLinkNParametersGet + +!! Set +subroutine ParameterLinkNParametersSet(handle, nParameters) & + bind(C, name='ParameterLinkNParametersSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: nParameters +end subroutine ParameterLinkNParametersSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: matrixStartIndex +!! ----------------------------------------------------------------------------- + +!! Has +function ParameterLinkMatrixStartIndexHas(handle) & + bind(C, name='ParameterLinkMatrixStartIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterLinkMatrixStartIndexHas +end function ParameterLinkMatrixStartIndexHas + +!! Get +function ParameterLinkMatrixStartIndexGet(handle) & + bind(C, name='ParameterLinkMatrixStartIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParameterLinkMatrixStartIndexGet +end function ParameterLinkMatrixStartIndexGet + +!! Set +subroutine ParameterLinkMatrixStartIndexSet(handle, matrixStartIndex) & + bind(C, name='ParameterLinkMatrixStartIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: matrixStartIndex +end subroutine ParameterLinkMatrixStartIndexSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalParameterLink diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Parameters.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Parameters.f03 new file mode 100644 index 000000000..22caeb333 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Parameters.f03 @@ -0,0 +1,391 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalParameters +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ParametersDefaultConst() & + bind(C, name='ParametersDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ParametersDefaultConst +end function ParametersDefaultConst + +!! Create, default, non-const +function ParametersDefault() & + bind(C, name='ParametersDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ParametersDefault +end function ParametersDefault + +!! Create, general, const +function ParametersCreateConst( & + parameterLink, parameterLinkSize & +) & + bind(C, name='ParametersCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: parameterLinkSize + type(c_ptr), intent(in) :: parameterLink(parameterLinkSize) + type(c_ptr) :: ParametersCreateConst +end function ParametersCreateConst + +!! Create, general, non-const +function ParametersCreate( & + parameterLink, parameterLinkSize & +) & + bind(C, name='ParametersCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: parameterLinkSize + type(c_ptr), intent(in) :: parameterLink(parameterLinkSize) + type(c_ptr) :: ParametersCreate +end function ParametersCreate + +!! Assign +subroutine ParametersAssign(handleLHS, handleRHS) & + bind(C, name='ParametersAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ParametersAssign + +!! Delete +subroutine ParametersDelete(handle) & + bind(C, name='ParametersDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ParametersDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ParametersRead(handle, filename, filenameSize) & + bind(C, name='ParametersRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParametersRead +end function ParametersRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ParametersWrite(handle, filename, filenameSize) & + bind(C, name='ParametersWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParametersWrite +end function ParametersWrite + +!! Print to standard output, in our prettyprinting format +function ParametersPrint(handle) & + bind(C, name='ParametersPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParametersPrint +end function ParametersPrint + +!! Print to standard output, as XML +function ParametersPrintXML(handle) & + bind(C, name='ParametersPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParametersPrintXML +end function ParametersPrintXML + +!! Print to standard output, as JSON +function ParametersPrintJSON(handle) & + bind(C, name='ParametersPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParametersPrintJSON +end function ParametersPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: parameterLink +!! ----------------------------------------------------------------------------- + +!! Has +function ParametersParameterLinkHas(handle) & + bind(C, name='ParametersParameterLinkHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParametersParameterLinkHas +end function ParametersParameterLinkHas + +!! Clear +subroutine ParametersParameterLinkClear(handle) & + bind(C, name='ParametersParameterLinkClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ParametersParameterLinkClear + +!! Size +function ParametersParameterLinkSize(handle) & + bind(C, name='ParametersParameterLinkSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ParametersParameterLinkSize +end function ParametersParameterLinkSize + +!! Add +subroutine ParametersParameterLinkAdd(handle, fieldHandle) & + bind(C, name='ParametersParameterLinkAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParametersParameterLinkAdd + +!! Get, by index \in [0,size), const +function ParametersParameterLinkGetConst(handle, index) & + bind(C, name='ParametersParameterLinkGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ParametersParameterLinkGetConst +end function ParametersParameterLinkGetConst + +!! Get, by index \in [0,size), non-const +function ParametersParameterLinkGet(handle, index) & + bind(C, name='ParametersParameterLinkGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ParametersParameterLinkGet +end function ParametersParameterLinkGet + +!! Set, by index \in [0,size) +subroutine ParametersParameterLinkSet(handle, index, fieldHandle) & + bind(C, name='ParametersParameterLinkSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParametersParameterLinkSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ParametersParameterLinkHasByLabel(handle, meta, metaSize) & + bind(C, name='ParametersParameterLinkHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ParametersParameterLinkHasByLabel +end function ParametersParameterLinkHasByLabel + +!! Get, by label, const +function ParametersParameterLinkGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ParametersParameterLinkGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ParametersParameterLinkGetByLabelConst +end function ParametersParameterLinkGetByLabelConst + +!! Get, by label, non-const +function ParametersParameterLinkGetByLabel(handle, meta, metaSize) & + bind(C, name='ParametersParameterLinkGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ParametersParameterLinkGetByLabel +end function ParametersParameterLinkGetByLabel + +!! Set, by label +subroutine ParametersParameterLinkSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ParametersParameterLinkSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParametersParameterLinkSetByLabel + +!! ------------------------ +!! Re: metadatum href +!! ------------------------ + +!! Has, by href +function ParametersParameterLinkHasByHref(handle, meta, metaSize) & + bind(C, name='ParametersParameterLinkHasByHref') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ParametersParameterLinkHasByHref +end function ParametersParameterLinkHasByHref + +!! Get, by href, const +function ParametersParameterLinkGetByHrefConst(handle, meta, metaSize) & + bind(C, name='ParametersParameterLinkGetByHrefConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ParametersParameterLinkGetByHrefConst +end function ParametersParameterLinkGetByHrefConst + +!! Get, by href, non-const +function ParametersParameterLinkGetByHref(handle, meta, metaSize) & + bind(C, name='ParametersParameterLinkGetByHref') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ParametersParameterLinkGetByHref +end function ParametersParameterLinkGetByHref + +!! Set, by href +subroutine ParametersParameterLinkSetByHref(handle, meta, metaSize, fieldHandle) & + bind(C, name='ParametersParameterLinkSetByHref') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParametersParameterLinkSetByHref + +!! ------------------------ +!! Re: metadatum nParameters +!! ------------------------ + +!! Has, by nParameters +function ParametersParameterLinkHasByNParameters(handle, meta) & + bind(C, name='ParametersParameterLinkHasByNParameters') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: ParametersParameterLinkHasByNParameters +end function ParametersParameterLinkHasByNParameters + +!! Get, by nParameters, const +function ParametersParameterLinkGetByNParametersConst(handle, meta) & + bind(C, name='ParametersParameterLinkGetByNParametersConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ParametersParameterLinkGetByNParametersConst +end function ParametersParameterLinkGetByNParametersConst + +!! Get, by nParameters, non-const +function ParametersParameterLinkGetByNParameters(handle, meta) & + bind(C, name='ParametersParameterLinkGetByNParameters') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ParametersParameterLinkGetByNParameters +end function ParametersParameterLinkGetByNParameters + +!! Set, by nParameters +subroutine ParametersParameterLinkSetByNParameters(handle, meta, fieldHandle) & + bind(C, name='ParametersParameterLinkSetByNParameters') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParametersParameterLinkSetByNParameters + +!! ------------------------ +!! Re: metadatum matrixStartIndex +!! ------------------------ + +!! Has, by matrixStartIndex +function ParametersParameterLinkHasByMatrixStartIndex(handle, meta) & + bind(C, name='ParametersParameterLinkHasByMatrixStartIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: ParametersParameterLinkHasByMatrixStartIndex +end function ParametersParameterLinkHasByMatrixStartIndex + +!! Get, by matrixStartIndex, const +function ParametersParameterLinkGetByMatrixStartIndexConst(handle, meta) & + bind(C, name='ParametersParameterLinkGetByMatrixStartIndexConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ParametersParameterLinkGetByMatrixStartIndexConst +end function ParametersParameterLinkGetByMatrixStartIndexConst + +!! Get, by matrixStartIndex, non-const +function ParametersParameterLinkGetByMatrixStartIndex(handle, meta) & + bind(C, name='ParametersParameterLinkGetByMatrixStartIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ParametersParameterLinkGetByMatrixStartIndex +end function ParametersParameterLinkGetByMatrixStartIndex + +!! Set, by matrixStartIndex +subroutine ParametersParameterLinkSetByMatrixStartIndex(handle, meta, fieldHandle) & + bind(C, name='ParametersParameterLinkSetByMatrixStartIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParametersParameterLinkSetByMatrixStartIndex + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalParameters diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Parity.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Parity.f03 new file mode 100644 index 000000000..21c9e90de --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Parity.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalParity +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ParityDefaultConst() & + bind(C, name='ParityDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ParityDefaultConst +end function ParityDefaultConst + +!! Create, default, non-const +function ParityDefault() & + bind(C, name='ParityDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ParityDefault +end function ParityDefault + +!! Create, general, const +function ParityCreateConst( & + integer & +) & + bind(C, name='ParityCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: integer + type(c_ptr) :: ParityCreateConst +end function ParityCreateConst + +!! Create, general, non-const +function ParityCreate( & + integer & +) & + bind(C, name='ParityCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: integer + type(c_ptr) :: ParityCreate +end function ParityCreate + +!! Assign +subroutine ParityAssign(handleLHS, handleRHS) & + bind(C, name='ParityAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ParityAssign + +!! Delete +subroutine ParityDelete(handle) & + bind(C, name='ParityDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ParityDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ParityRead(handle, filename, filenameSize) & + bind(C, name='ParityRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParityRead +end function ParityRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ParityWrite(handle, filename, filenameSize) & + bind(C, name='ParityWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ParityWrite +end function ParityWrite + +!! Print to standard output, in our prettyprinting format +function ParityPrint(handle) & + bind(C, name='ParityPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParityPrint +end function ParityPrint + +!! Print to standard output, as XML +function ParityPrintXML(handle) & + bind(C, name='ParityPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParityPrintXML +end function ParityPrintXML + +!! Print to standard output, as JSON +function ParityPrintJSON(handle) & + bind(C, name='ParityPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParityPrintJSON +end function ParityPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: integer +!! ----------------------------------------------------------------------------- + +!! Has +function ParityIntegerHas(handle) & + bind(C, name='ParityIntegerHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ParityIntegerHas +end function ParityIntegerHas + +!! Get, const +function ParityIntegerGetConst(handle) & + bind(C, name='ParityIntegerGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ParityIntegerGetConst +end function ParityIntegerGetConst + +!! Get, non-const +function ParityIntegerGet(handle) & + bind(C, name='ParityIntegerGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ParityIntegerGet +end function ParityIntegerGet + +!! Set +subroutine ParityIntegerSet(handle, fieldHandle) & + bind(C, name='ParityIntegerSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ParityIntegerSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalParity diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PhotonEmissionProbabilities.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PhotonEmissionProbabilities.f03 new file mode 100644 index 000000000..8a2e598f3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PhotonEmissionProbabilities.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalPhotonEmissionProbabilities +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function PhotonEmissionProbabilitiesDefaultConst() & + bind(C, name='PhotonEmissionProbabilitiesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: PhotonEmissionProbabilitiesDefaultConst +end function PhotonEmissionProbabilitiesDefaultConst + +!! Create, default, non-const +function PhotonEmissionProbabilitiesDefault() & + bind(C, name='PhotonEmissionProbabilitiesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: PhotonEmissionProbabilitiesDefault +end function PhotonEmissionProbabilitiesDefault + +!! Create, general, const +function PhotonEmissionProbabilitiesCreateConst( & + shell & +) & + bind(C, name='PhotonEmissionProbabilitiesCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: shell + type(c_ptr) :: PhotonEmissionProbabilitiesCreateConst +end function PhotonEmissionProbabilitiesCreateConst + +!! Create, general, non-const +function PhotonEmissionProbabilitiesCreate( & + shell & +) & + bind(C, name='PhotonEmissionProbabilitiesCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: shell + type(c_ptr) :: PhotonEmissionProbabilitiesCreate +end function PhotonEmissionProbabilitiesCreate + +!! Assign +subroutine PhotonEmissionProbabilitiesAssign(handleLHS, handleRHS) & + bind(C, name='PhotonEmissionProbabilitiesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine PhotonEmissionProbabilitiesAssign + +!! Delete +subroutine PhotonEmissionProbabilitiesDelete(handle) & + bind(C, name='PhotonEmissionProbabilitiesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine PhotonEmissionProbabilitiesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function PhotonEmissionProbabilitiesRead(handle, filename, filenameSize) & + bind(C, name='PhotonEmissionProbabilitiesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PhotonEmissionProbabilitiesRead +end function PhotonEmissionProbabilitiesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function PhotonEmissionProbabilitiesWrite(handle, filename, filenameSize) & + bind(C, name='PhotonEmissionProbabilitiesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PhotonEmissionProbabilitiesWrite +end function PhotonEmissionProbabilitiesWrite + +!! Print to standard output, in our prettyprinting format +function PhotonEmissionProbabilitiesPrint(handle) & + bind(C, name='PhotonEmissionProbabilitiesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PhotonEmissionProbabilitiesPrint +end function PhotonEmissionProbabilitiesPrint + +!! Print to standard output, as XML +function PhotonEmissionProbabilitiesPrintXML(handle) & + bind(C, name='PhotonEmissionProbabilitiesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PhotonEmissionProbabilitiesPrintXML +end function PhotonEmissionProbabilitiesPrintXML + +!! Print to standard output, as JSON +function PhotonEmissionProbabilitiesPrintJSON(handle) & + bind(C, name='PhotonEmissionProbabilitiesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PhotonEmissionProbabilitiesPrintJSON +end function PhotonEmissionProbabilitiesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: shell +!! ----------------------------------------------------------------------------- + +!! Has +function PhotonEmissionProbabilitiesShellHas(handle) & + bind(C, name='PhotonEmissionProbabilitiesShellHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PhotonEmissionProbabilitiesShellHas +end function PhotonEmissionProbabilitiesShellHas + +!! Get, const +function PhotonEmissionProbabilitiesShellGetConst(handle) & + bind(C, name='PhotonEmissionProbabilitiesShellGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PhotonEmissionProbabilitiesShellGetConst +end function PhotonEmissionProbabilitiesShellGetConst + +!! Get, non-const +function PhotonEmissionProbabilitiesShellGet(handle) & + bind(C, name='PhotonEmissionProbabilitiesShellGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PhotonEmissionProbabilitiesShellGet +end function PhotonEmissionProbabilitiesShellGet + +!! Set +subroutine PhotonEmissionProbabilitiesShellSet(handle, fieldHandle) & + bind(C, name='PhotonEmissionProbabilitiesShellSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PhotonEmissionProbabilitiesShellSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalPhotonEmissionProbabilities diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Polynomial1d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Polynomial1d.f03 new file mode 100644 index 000000000..5ff34ac1f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Polynomial1d.f03 @@ -0,0 +1,379 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalPolynomial1d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Polynomial1dDefaultConst() & + bind(C, name='Polynomial1dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Polynomial1dDefaultConst +end function Polynomial1dDefaultConst + +!! Create, default, non-const +function Polynomial1dDefault() & + bind(C, name='Polynomial1dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Polynomial1dDefault +end function Polynomial1dDefault + +!! Create, general, const +function Polynomial1dCreateConst( & + label, & + domainMin, & + domainMax, & + axes, & + values, & + uncertainty, & + labelSize & +) & + bind(C, name='Polynomial1dCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: values + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: Polynomial1dCreateConst +end function Polynomial1dCreateConst + +!! Create, general, non-const +function Polynomial1dCreate( & + label, & + domainMin, & + domainMax, & + axes, & + values, & + uncertainty, & + labelSize & +) & + bind(C, name='Polynomial1dCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: values + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: Polynomial1dCreate +end function Polynomial1dCreate + +!! Assign +subroutine Polynomial1dAssign(handleLHS, handleRHS) & + bind(C, name='Polynomial1dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Polynomial1dAssign + +!! Delete +subroutine Polynomial1dDelete(handle) & + bind(C, name='Polynomial1dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Polynomial1dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Polynomial1dRead(handle, filename, filenameSize) & + bind(C, name='Polynomial1dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Polynomial1dRead +end function Polynomial1dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Polynomial1dWrite(handle, filename, filenameSize) & + bind(C, name='Polynomial1dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Polynomial1dWrite +end function Polynomial1dWrite + +!! Print to standard output, in our prettyprinting format +function Polynomial1dPrint(handle) & + bind(C, name='Polynomial1dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dPrint +end function Polynomial1dPrint + +!! Print to standard output, as XML +function Polynomial1dPrintXML(handle) & + bind(C, name='Polynomial1dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dPrintXML +end function Polynomial1dPrintXML + +!! Print to standard output, as JSON +function Polynomial1dPrintJSON(handle) & + bind(C, name='Polynomial1dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dPrintJSON +end function Polynomial1dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function Polynomial1dLabelHas(handle) & + bind(C, name='Polynomial1dLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dLabelHas +end function Polynomial1dLabelHas + +!! Get +function Polynomial1dLabelGet(handle) & + bind(C, name='Polynomial1dLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Polynomial1dLabelGet +end function Polynomial1dLabelGet + +!! Set +subroutine Polynomial1dLabelSet(handle, label, labelSize) & + bind(C, name='Polynomial1dLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine Polynomial1dLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMin +!! ----------------------------------------------------------------------------- + +!! Has +function Polynomial1dDomainMinHas(handle) & + bind(C, name='Polynomial1dDomainMinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dDomainMinHas +end function Polynomial1dDomainMinHas + +!! Get +function Polynomial1dDomainMinGet(handle) & + bind(C, name='Polynomial1dDomainMinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: Polynomial1dDomainMinGet +end function Polynomial1dDomainMinGet + +!! Set +subroutine Polynomial1dDomainMinSet(handle, domainMin) & + bind(C, name='Polynomial1dDomainMinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMin +end subroutine Polynomial1dDomainMinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMax +!! ----------------------------------------------------------------------------- + +!! Has +function Polynomial1dDomainMaxHas(handle) & + bind(C, name='Polynomial1dDomainMaxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dDomainMaxHas +end function Polynomial1dDomainMaxHas + +!! Get +function Polynomial1dDomainMaxGet(handle) & + bind(C, name='Polynomial1dDomainMaxGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: Polynomial1dDomainMaxGet +end function Polynomial1dDomainMaxGet + +!! Set +subroutine Polynomial1dDomainMaxSet(handle, domainMax) & + bind(C, name='Polynomial1dDomainMaxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMax +end subroutine Polynomial1dDomainMaxSet + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function Polynomial1dAxesHas(handle) & + bind(C, name='Polynomial1dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dAxesHas +end function Polynomial1dAxesHas + +!! Get, const +function Polynomial1dAxesGetConst(handle) & + bind(C, name='Polynomial1dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Polynomial1dAxesGetConst +end function Polynomial1dAxesGetConst + +!! Get, non-const +function Polynomial1dAxesGet(handle) & + bind(C, name='Polynomial1dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Polynomial1dAxesGet +end function Polynomial1dAxesGet + +!! Set +subroutine Polynomial1dAxesSet(handle, fieldHandle) & + bind(C, name='Polynomial1dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Polynomial1dAxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: values +!! ----------------------------------------------------------------------------- + +!! Has +function Polynomial1dValuesHas(handle) & + bind(C, name='Polynomial1dValuesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dValuesHas +end function Polynomial1dValuesHas + +!! Get, const +function Polynomial1dValuesGetConst(handle) & + bind(C, name='Polynomial1dValuesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Polynomial1dValuesGetConst +end function Polynomial1dValuesGetConst + +!! Get, non-const +function Polynomial1dValuesGet(handle) & + bind(C, name='Polynomial1dValuesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Polynomial1dValuesGet +end function Polynomial1dValuesGet + +!! Set +subroutine Polynomial1dValuesSet(handle, fieldHandle) & + bind(C, name='Polynomial1dValuesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Polynomial1dValuesSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function Polynomial1dUncertaintyHas(handle) & + bind(C, name='Polynomial1dUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dUncertaintyHas +end function Polynomial1dUncertaintyHas + +!! Get, const +function Polynomial1dUncertaintyGetConst(handle) & + bind(C, name='Polynomial1dUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Polynomial1dUncertaintyGetConst +end function Polynomial1dUncertaintyGetConst + +!! Get, non-const +function Polynomial1dUncertaintyGet(handle) & + bind(C, name='Polynomial1dUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Polynomial1dUncertaintyGet +end function Polynomial1dUncertaintyGet + +!! Set +subroutine Polynomial1dUncertaintySet(handle, fieldHandle) & + bind(C, name='Polynomial1dUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Polynomial1dUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalPolynomial1d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PositronEmissionIntensity.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PositronEmissionIntensity.f03 new file mode 100644 index 000000000..2e1ff5325 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PositronEmissionIntensity.f03 @@ -0,0 +1,212 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalPositronEmissionIntensity +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function PositronEmissionIntensityDefaultConst() & + bind(C, name='PositronEmissionIntensityDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: PositronEmissionIntensityDefaultConst +end function PositronEmissionIntensityDefaultConst + +!! Create, default, non-const +function PositronEmissionIntensityDefault() & + bind(C, name='PositronEmissionIntensityDefault') + use iso_c_binding + implicit none + type(c_ptr) :: PositronEmissionIntensityDefault +end function PositronEmissionIntensityDefault + +!! Create, general, const +function PositronEmissionIntensityCreateConst( & + value, & + uncertainty & +) & + bind(C, name='PositronEmissionIntensityCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: PositronEmissionIntensityCreateConst +end function PositronEmissionIntensityCreateConst + +!! Create, general, non-const +function PositronEmissionIntensityCreate( & + value, & + uncertainty & +) & + bind(C, name='PositronEmissionIntensityCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: PositronEmissionIntensityCreate +end function PositronEmissionIntensityCreate + +!! Assign +subroutine PositronEmissionIntensityAssign(handleLHS, handleRHS) & + bind(C, name='PositronEmissionIntensityAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine PositronEmissionIntensityAssign + +!! Delete +subroutine PositronEmissionIntensityDelete(handle) & + bind(C, name='PositronEmissionIntensityDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine PositronEmissionIntensityDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function PositronEmissionIntensityRead(handle, filename, filenameSize) & + bind(C, name='PositronEmissionIntensityRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PositronEmissionIntensityRead +end function PositronEmissionIntensityRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function PositronEmissionIntensityWrite(handle, filename, filenameSize) & + bind(C, name='PositronEmissionIntensityWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PositronEmissionIntensityWrite +end function PositronEmissionIntensityWrite + +!! Print to standard output, in our prettyprinting format +function PositronEmissionIntensityPrint(handle) & + bind(C, name='PositronEmissionIntensityPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PositronEmissionIntensityPrint +end function PositronEmissionIntensityPrint + +!! Print to standard output, as XML +function PositronEmissionIntensityPrintXML(handle) & + bind(C, name='PositronEmissionIntensityPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PositronEmissionIntensityPrintXML +end function PositronEmissionIntensityPrintXML + +!! Print to standard output, as JSON +function PositronEmissionIntensityPrintJSON(handle) & + bind(C, name='PositronEmissionIntensityPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PositronEmissionIntensityPrintJSON +end function PositronEmissionIntensityPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function PositronEmissionIntensityValueHas(handle) & + bind(C, name='PositronEmissionIntensityValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PositronEmissionIntensityValueHas +end function PositronEmissionIntensityValueHas + +!! Get +function PositronEmissionIntensityValueGet(handle) & + bind(C, name='PositronEmissionIntensityValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: PositronEmissionIntensityValueGet +end function PositronEmissionIntensityValueGet + +!! Set +subroutine PositronEmissionIntensityValueSet(handle, value) & + bind(C, name='PositronEmissionIntensityValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine PositronEmissionIntensityValueSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function PositronEmissionIntensityUncertaintyHas(handle) & + bind(C, name='PositronEmissionIntensityUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PositronEmissionIntensityUncertaintyHas +end function PositronEmissionIntensityUncertaintyHas + +!! Get, const +function PositronEmissionIntensityUncertaintyGetConst(handle) & + bind(C, name='PositronEmissionIntensityUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PositronEmissionIntensityUncertaintyGetConst +end function PositronEmissionIntensityUncertaintyGetConst + +!! Get, non-const +function PositronEmissionIntensityUncertaintyGet(handle) & + bind(C, name='PositronEmissionIntensityUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PositronEmissionIntensityUncertaintyGet +end function PositronEmissionIntensityUncertaintyGet + +!! Set +subroutine PositronEmissionIntensityUncertaintySet(handle, fieldHandle) & + bind(C, name='PositronEmissionIntensityUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PositronEmissionIntensityUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalPositronEmissionIntensity diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PrimaryGamma.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PrimaryGamma.f03 new file mode 100644 index 000000000..3eb1bc398 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PrimaryGamma.f03 @@ -0,0 +1,284 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalPrimaryGamma +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function PrimaryGammaDefaultConst() & + bind(C, name='PrimaryGammaDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: PrimaryGammaDefaultConst +end function PrimaryGammaDefaultConst + +!! Create, default, non-const +function PrimaryGammaDefault() & + bind(C, name='PrimaryGammaDefault') + use iso_c_binding + implicit none + type(c_ptr) :: PrimaryGammaDefault +end function PrimaryGammaDefault + +!! Create, general, const +function PrimaryGammaCreateConst( & + value, & + domainMin, & + domainMax, & + axes & +) & + bind(C, name='PrimaryGammaCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + type(c_ptr), intent(in), value :: axes + type(c_ptr) :: PrimaryGammaCreateConst +end function PrimaryGammaCreateConst + +!! Create, general, non-const +function PrimaryGammaCreate( & + value, & + domainMin, & + domainMax, & + axes & +) & + bind(C, name='PrimaryGammaCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + type(c_ptr), intent(in), value :: axes + type(c_ptr) :: PrimaryGammaCreate +end function PrimaryGammaCreate + +!! Assign +subroutine PrimaryGammaAssign(handleLHS, handleRHS) & + bind(C, name='PrimaryGammaAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine PrimaryGammaAssign + +!! Delete +subroutine PrimaryGammaDelete(handle) & + bind(C, name='PrimaryGammaDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine PrimaryGammaDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function PrimaryGammaRead(handle, filename, filenameSize) & + bind(C, name='PrimaryGammaRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PrimaryGammaRead +end function PrimaryGammaRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function PrimaryGammaWrite(handle, filename, filenameSize) & + bind(C, name='PrimaryGammaWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PrimaryGammaWrite +end function PrimaryGammaWrite + +!! Print to standard output, in our prettyprinting format +function PrimaryGammaPrint(handle) & + bind(C, name='PrimaryGammaPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PrimaryGammaPrint +end function PrimaryGammaPrint + +!! Print to standard output, as XML +function PrimaryGammaPrintXML(handle) & + bind(C, name='PrimaryGammaPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PrimaryGammaPrintXML +end function PrimaryGammaPrintXML + +!! Print to standard output, as JSON +function PrimaryGammaPrintJSON(handle) & + bind(C, name='PrimaryGammaPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PrimaryGammaPrintJSON +end function PrimaryGammaPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function PrimaryGammaValueHas(handle) & + bind(C, name='PrimaryGammaValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PrimaryGammaValueHas +end function PrimaryGammaValueHas + +!! Get +function PrimaryGammaValueGet(handle) & + bind(C, name='PrimaryGammaValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: PrimaryGammaValueGet +end function PrimaryGammaValueGet + +!! Set +subroutine PrimaryGammaValueSet(handle, value) & + bind(C, name='PrimaryGammaValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine PrimaryGammaValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMin +!! ----------------------------------------------------------------------------- + +!! Has +function PrimaryGammaDomainMinHas(handle) & + bind(C, name='PrimaryGammaDomainMinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PrimaryGammaDomainMinHas +end function PrimaryGammaDomainMinHas + +!! Get +function PrimaryGammaDomainMinGet(handle) & + bind(C, name='PrimaryGammaDomainMinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: PrimaryGammaDomainMinGet +end function PrimaryGammaDomainMinGet + +!! Set +subroutine PrimaryGammaDomainMinSet(handle, domainMin) & + bind(C, name='PrimaryGammaDomainMinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMin +end subroutine PrimaryGammaDomainMinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMax +!! ----------------------------------------------------------------------------- + +!! Has +function PrimaryGammaDomainMaxHas(handle) & + bind(C, name='PrimaryGammaDomainMaxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PrimaryGammaDomainMaxHas +end function PrimaryGammaDomainMaxHas + +!! Get +function PrimaryGammaDomainMaxGet(handle) & + bind(C, name='PrimaryGammaDomainMaxGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: PrimaryGammaDomainMaxGet +end function PrimaryGammaDomainMaxGet + +!! Set +subroutine PrimaryGammaDomainMaxSet(handle, domainMax) & + bind(C, name='PrimaryGammaDomainMaxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMax +end subroutine PrimaryGammaDomainMaxSet + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function PrimaryGammaAxesHas(handle) & + bind(C, name='PrimaryGammaAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PrimaryGammaAxesHas +end function PrimaryGammaAxesHas + +!! Get, const +function PrimaryGammaAxesGetConst(handle) & + bind(C, name='PrimaryGammaAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PrimaryGammaAxesGetConst +end function PrimaryGammaAxesGetConst + +!! Get, non-const +function PrimaryGammaAxesGet(handle) & + bind(C, name='PrimaryGammaAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PrimaryGammaAxesGet +end function PrimaryGammaAxesGet + +!! Set +subroutine PrimaryGammaAxesSet(handle, fieldHandle) & + bind(C, name='PrimaryGammaAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PrimaryGammaAxesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalPrimaryGamma diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Probability.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Probability.f03 new file mode 100644 index 000000000..a80899c4d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Probability.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalProbability +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ProbabilityDefaultConst() & + bind(C, name='ProbabilityDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ProbabilityDefaultConst +end function ProbabilityDefaultConst + +!! Create, default, non-const +function ProbabilityDefault() & + bind(C, name='ProbabilityDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ProbabilityDefault +end function ProbabilityDefault + +!! Create, general, const +function ProbabilityCreateConst( & + Double & +) & + bind(C, name='ProbabilityCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: ProbabilityCreateConst +end function ProbabilityCreateConst + +!! Create, general, non-const +function ProbabilityCreate( & + Double & +) & + bind(C, name='ProbabilityCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: ProbabilityCreate +end function ProbabilityCreate + +!! Assign +subroutine ProbabilityAssign(handleLHS, handleRHS) & + bind(C, name='ProbabilityAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ProbabilityAssign + +!! Delete +subroutine ProbabilityDelete(handle) & + bind(C, name='ProbabilityDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProbabilityDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ProbabilityRead(handle, filename, filenameSize) & + bind(C, name='ProbabilityRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProbabilityRead +end function ProbabilityRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ProbabilityWrite(handle, filename, filenameSize) & + bind(C, name='ProbabilityWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProbabilityWrite +end function ProbabilityWrite + +!! Print to standard output, in our prettyprinting format +function ProbabilityPrint(handle) & + bind(C, name='ProbabilityPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProbabilityPrint +end function ProbabilityPrint + +!! Print to standard output, as XML +function ProbabilityPrintXML(handle) & + bind(C, name='ProbabilityPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProbabilityPrintXML +end function ProbabilityPrintXML + +!! Print to standard output, as JSON +function ProbabilityPrintJSON(handle) & + bind(C, name='ProbabilityPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProbabilityPrintJSON +end function ProbabilityPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: Double +!! ----------------------------------------------------------------------------- + +!! Has +function ProbabilityDoubleHas(handle) & + bind(C, name='ProbabilityDoubleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProbabilityDoubleHas +end function ProbabilityDoubleHas + +!! Get, const +function ProbabilityDoubleGetConst(handle) & + bind(C, name='ProbabilityDoubleGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProbabilityDoubleGetConst +end function ProbabilityDoubleGetConst + +!! Get, non-const +function ProbabilityDoubleGet(handle) & + bind(C, name='ProbabilityDoubleGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ProbabilityDoubleGet +end function ProbabilityDoubleGet + +!! Set +subroutine ProbabilityDoubleSet(handle, fieldHandle) & + bind(C, name='ProbabilityDoubleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProbabilityDoubleSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalProbability diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Product.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Product.f03 new file mode 100644 index 000000000..8c3ccb4a5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Product.f03 @@ -0,0 +1,393 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalProduct +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ProductDefaultConst() & + bind(C, name='ProductDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ProductDefaultConst +end function ProductDefaultConst + +!! Create, default, non-const +function ProductDefault() & + bind(C, name='ProductDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ProductDefault +end function ProductDefault + +!! Create, general, const +function ProductCreateConst( & + label, & + pid, & + multiplicity, & + distribution, & + outputChannel, & + averageProductEnergy, & + labelSize, & + pidSize & +) & + bind(C, name='ProductCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + type(c_ptr), intent(in), value :: multiplicity + type(c_ptr), intent(in), value :: distribution + type(c_ptr), intent(in), value :: outputChannel + type(c_ptr), intent(in), value :: averageProductEnergy + type(c_ptr) :: ProductCreateConst +end function ProductCreateConst + +!! Create, general, non-const +function ProductCreate( & + label, & + pid, & + multiplicity, & + distribution, & + outputChannel, & + averageProductEnergy, & + labelSize, & + pidSize & +) & + bind(C, name='ProductCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + type(c_ptr), intent(in), value :: multiplicity + type(c_ptr), intent(in), value :: distribution + type(c_ptr), intent(in), value :: outputChannel + type(c_ptr), intent(in), value :: averageProductEnergy + type(c_ptr) :: ProductCreate +end function ProductCreate + +!! Assign +subroutine ProductAssign(handleLHS, handleRHS) & + bind(C, name='ProductAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ProductAssign + +!! Delete +subroutine ProductDelete(handle) & + bind(C, name='ProductDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ProductRead(handle, filename, filenameSize) & + bind(C, name='ProductRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductRead +end function ProductRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ProductWrite(handle, filename, filenameSize) & + bind(C, name='ProductWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductWrite +end function ProductWrite + +!! Print to standard output, in our prettyprinting format +function ProductPrint(handle) & + bind(C, name='ProductPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductPrint +end function ProductPrint + +!! Print to standard output, as XML +function ProductPrintXML(handle) & + bind(C, name='ProductPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductPrintXML +end function ProductPrintXML + +!! Print to standard output, as JSON +function ProductPrintJSON(handle) & + bind(C, name='ProductPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductPrintJSON +end function ProductPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ProductLabelHas(handle) & + bind(C, name='ProductLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductLabelHas +end function ProductLabelHas + +!! Get +function ProductLabelGet(handle) & + bind(C, name='ProductLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductLabelGet +end function ProductLabelGet + +!! Set +subroutine ProductLabelSet(handle, label, labelSize) & + bind(C, name='ProductLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ProductLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function ProductPidHas(handle) & + bind(C, name='ProductPidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductPidHas +end function ProductPidHas + +!! Get +function ProductPidGet(handle) & + bind(C, name='ProductPidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductPidGet +end function ProductPidGet + +!! Set +subroutine ProductPidSet(handle, pid, pidSize) & + bind(C, name='ProductPidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine ProductPidSet + + +!! ----------------------------------------------------------------------------- +!! Child: multiplicity +!! ----------------------------------------------------------------------------- + +!! Has +function ProductMultiplicityHas(handle) & + bind(C, name='ProductMultiplicityHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductMultiplicityHas +end function ProductMultiplicityHas + +!! Get, const +function ProductMultiplicityGetConst(handle) & + bind(C, name='ProductMultiplicityGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductMultiplicityGetConst +end function ProductMultiplicityGetConst + +!! Get, non-const +function ProductMultiplicityGet(handle) & + bind(C, name='ProductMultiplicityGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ProductMultiplicityGet +end function ProductMultiplicityGet + +!! Set +subroutine ProductMultiplicitySet(handle, fieldHandle) & + bind(C, name='ProductMultiplicitySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductMultiplicitySet + + +!! ----------------------------------------------------------------------------- +!! Child: distribution +!! ----------------------------------------------------------------------------- + +!! Has +function ProductDistributionHas(handle) & + bind(C, name='ProductDistributionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductDistributionHas +end function ProductDistributionHas + +!! Get, const +function ProductDistributionGetConst(handle) & + bind(C, name='ProductDistributionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductDistributionGetConst +end function ProductDistributionGetConst + +!! Get, non-const +function ProductDistributionGet(handle) & + bind(C, name='ProductDistributionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ProductDistributionGet +end function ProductDistributionGet + +!! Set +subroutine ProductDistributionSet(handle, fieldHandle) & + bind(C, name='ProductDistributionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductDistributionSet + + +!! ----------------------------------------------------------------------------- +!! Child: outputChannel +!! ----------------------------------------------------------------------------- + +!! Has +function ProductOutputChannelHas(handle) & + bind(C, name='ProductOutputChannelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductOutputChannelHas +end function ProductOutputChannelHas + +!! Get, const +function ProductOutputChannelGetConst(handle) & + bind(C, name='ProductOutputChannelGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductOutputChannelGetConst +end function ProductOutputChannelGetConst + +!! Get, non-const +function ProductOutputChannelGet(handle) & + bind(C, name='ProductOutputChannelGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ProductOutputChannelGet +end function ProductOutputChannelGet + +!! Set +subroutine ProductOutputChannelSet(handle, fieldHandle) & + bind(C, name='ProductOutputChannelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductOutputChannelSet + + +!! ----------------------------------------------------------------------------- +!! Child: averageProductEnergy +!! ----------------------------------------------------------------------------- + +!! Has +function ProductAverageProductEnergyHas(handle) & + bind(C, name='ProductAverageProductEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductAverageProductEnergyHas +end function ProductAverageProductEnergyHas + +!! Get, const +function ProductAverageProductEnergyGetConst(handle) & + bind(C, name='ProductAverageProductEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductAverageProductEnergyGetConst +end function ProductAverageProductEnergyGetConst + +!! Get, non-const +function ProductAverageProductEnergyGet(handle) & + bind(C, name='ProductAverageProductEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ProductAverageProductEnergyGet +end function ProductAverageProductEnergyGet + +!! Set +subroutine ProductAverageProductEnergySet(handle, fieldHandle) & + bind(C, name='ProductAverageProductEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductAverageProductEnergySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalProduct diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ProductYield.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ProductYield.f03 new file mode 100644 index 000000000..49e2ea06b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ProductYield.f03 @@ -0,0 +1,262 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalProductYield +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ProductYieldDefaultConst() & + bind(C, name='ProductYieldDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ProductYieldDefaultConst +end function ProductYieldDefaultConst + +!! Create, default, non-const +function ProductYieldDefault() & + bind(C, name='ProductYieldDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ProductYieldDefault +end function ProductYieldDefault + +!! Create, general, const +function ProductYieldCreateConst( & + label, & + nuclides, & + elapsedTimes, & + labelSize & +) & + bind(C, name='ProductYieldCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: nuclides + type(c_ptr), intent(in), value :: elapsedTimes + type(c_ptr) :: ProductYieldCreateConst +end function ProductYieldCreateConst + +!! Create, general, non-const +function ProductYieldCreate( & + label, & + nuclides, & + elapsedTimes, & + labelSize & +) & + bind(C, name='ProductYieldCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: nuclides + type(c_ptr), intent(in), value :: elapsedTimes + type(c_ptr) :: ProductYieldCreate +end function ProductYieldCreate + +!! Assign +subroutine ProductYieldAssign(handleLHS, handleRHS) & + bind(C, name='ProductYieldAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ProductYieldAssign + +!! Delete +subroutine ProductYieldDelete(handle) & + bind(C, name='ProductYieldDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductYieldDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ProductYieldRead(handle, filename, filenameSize) & + bind(C, name='ProductYieldRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductYieldRead +end function ProductYieldRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ProductYieldWrite(handle, filename, filenameSize) & + bind(C, name='ProductYieldWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductYieldWrite +end function ProductYieldWrite + +!! Print to standard output, in our prettyprinting format +function ProductYieldPrint(handle) & + bind(C, name='ProductYieldPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductYieldPrint +end function ProductYieldPrint + +!! Print to standard output, as XML +function ProductYieldPrintXML(handle) & + bind(C, name='ProductYieldPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductYieldPrintXML +end function ProductYieldPrintXML + +!! Print to standard output, as JSON +function ProductYieldPrintJSON(handle) & + bind(C, name='ProductYieldPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductYieldPrintJSON +end function ProductYieldPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ProductYieldLabelHas(handle) & + bind(C, name='ProductYieldLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductYieldLabelHas +end function ProductYieldLabelHas + +!! Get +function ProductYieldLabelGet(handle) & + bind(C, name='ProductYieldLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductYieldLabelGet +end function ProductYieldLabelGet + +!! Set +subroutine ProductYieldLabelSet(handle, label, labelSize) & + bind(C, name='ProductYieldLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ProductYieldLabelSet + + +!! ----------------------------------------------------------------------------- +!! Child: nuclides +!! ----------------------------------------------------------------------------- + +!! Has +function ProductYieldNuclidesHas(handle) & + bind(C, name='ProductYieldNuclidesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductYieldNuclidesHas +end function ProductYieldNuclidesHas + +!! Get, const +function ProductYieldNuclidesGetConst(handle) & + bind(C, name='ProductYieldNuclidesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductYieldNuclidesGetConst +end function ProductYieldNuclidesGetConst + +!! Get, non-const +function ProductYieldNuclidesGet(handle) & + bind(C, name='ProductYieldNuclidesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ProductYieldNuclidesGet +end function ProductYieldNuclidesGet + +!! Set +subroutine ProductYieldNuclidesSet(handle, fieldHandle) & + bind(C, name='ProductYieldNuclidesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductYieldNuclidesSet + + +!! ----------------------------------------------------------------------------- +!! Child: elapsedTimes +!! ----------------------------------------------------------------------------- + +!! Has +function ProductYieldElapsedTimesHas(handle) & + bind(C, name='ProductYieldElapsedTimesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductYieldElapsedTimesHas +end function ProductYieldElapsedTimesHas + +!! Get, const +function ProductYieldElapsedTimesGetConst(handle) & + bind(C, name='ProductYieldElapsedTimesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductYieldElapsedTimesGetConst +end function ProductYieldElapsedTimesGetConst + +!! Get, non-const +function ProductYieldElapsedTimesGet(handle) & + bind(C, name='ProductYieldElapsedTimesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ProductYieldElapsedTimesGet +end function ProductYieldElapsedTimesGet + +!! Set +subroutine ProductYieldElapsedTimesSet(handle, fieldHandle) & + bind(C, name='ProductYieldElapsedTimesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductYieldElapsedTimesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalProductYield diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ProductYields.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ProductYields.f03 new file mode 100644 index 000000000..95bda4503 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ProductYields.f03 @@ -0,0 +1,255 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalProductYields +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ProductYieldsDefaultConst() & + bind(C, name='ProductYieldsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ProductYieldsDefaultConst +end function ProductYieldsDefaultConst + +!! Create, default, non-const +function ProductYieldsDefault() & + bind(C, name='ProductYieldsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ProductYieldsDefault +end function ProductYieldsDefault + +!! Create, general, const +function ProductYieldsCreateConst( & + productYield, productYieldSize & +) & + bind(C, name='ProductYieldsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: productYieldSize + type(c_ptr), intent(in) :: productYield(productYieldSize) + type(c_ptr) :: ProductYieldsCreateConst +end function ProductYieldsCreateConst + +!! Create, general, non-const +function ProductYieldsCreate( & + productYield, productYieldSize & +) & + bind(C, name='ProductYieldsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: productYieldSize + type(c_ptr), intent(in) :: productYield(productYieldSize) + type(c_ptr) :: ProductYieldsCreate +end function ProductYieldsCreate + +!! Assign +subroutine ProductYieldsAssign(handleLHS, handleRHS) & + bind(C, name='ProductYieldsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ProductYieldsAssign + +!! Delete +subroutine ProductYieldsDelete(handle) & + bind(C, name='ProductYieldsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductYieldsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ProductYieldsRead(handle, filename, filenameSize) & + bind(C, name='ProductYieldsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductYieldsRead +end function ProductYieldsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ProductYieldsWrite(handle, filename, filenameSize) & + bind(C, name='ProductYieldsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductYieldsWrite +end function ProductYieldsWrite + +!! Print to standard output, in our prettyprinting format +function ProductYieldsPrint(handle) & + bind(C, name='ProductYieldsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductYieldsPrint +end function ProductYieldsPrint + +!! Print to standard output, as XML +function ProductYieldsPrintXML(handle) & + bind(C, name='ProductYieldsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductYieldsPrintXML +end function ProductYieldsPrintXML + +!! Print to standard output, as JSON +function ProductYieldsPrintJSON(handle) & + bind(C, name='ProductYieldsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductYieldsPrintJSON +end function ProductYieldsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: productYield +!! ----------------------------------------------------------------------------- + +!! Has +function ProductYieldsProductYieldHas(handle) & + bind(C, name='ProductYieldsProductYieldHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductYieldsProductYieldHas +end function ProductYieldsProductYieldHas + +!! Clear +subroutine ProductYieldsProductYieldClear(handle) & + bind(C, name='ProductYieldsProductYieldClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductYieldsProductYieldClear + +!! Size +function ProductYieldsProductYieldSize(handle) & + bind(C, name='ProductYieldsProductYieldSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ProductYieldsProductYieldSize +end function ProductYieldsProductYieldSize + +!! Add +subroutine ProductYieldsProductYieldAdd(handle, fieldHandle) & + bind(C, name='ProductYieldsProductYieldAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductYieldsProductYieldAdd + +!! Get, by index \in [0,size), const +function ProductYieldsProductYieldGetConst(handle, index) & + bind(C, name='ProductYieldsProductYieldGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ProductYieldsProductYieldGetConst +end function ProductYieldsProductYieldGetConst + +!! Get, by index \in [0,size), non-const +function ProductYieldsProductYieldGet(handle, index) & + bind(C, name='ProductYieldsProductYieldGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ProductYieldsProductYieldGet +end function ProductYieldsProductYieldGet + +!! Set, by index \in [0,size) +subroutine ProductYieldsProductYieldSet(handle, index, fieldHandle) & + bind(C, name='ProductYieldsProductYieldSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductYieldsProductYieldSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ProductYieldsProductYieldHasByLabel(handle, meta, metaSize) & + bind(C, name='ProductYieldsProductYieldHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ProductYieldsProductYieldHasByLabel +end function ProductYieldsProductYieldHasByLabel + +!! Get, by label, const +function ProductYieldsProductYieldGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ProductYieldsProductYieldGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductYieldsProductYieldGetByLabelConst +end function ProductYieldsProductYieldGetByLabelConst + +!! Get, by label, non-const +function ProductYieldsProductYieldGetByLabel(handle, meta, metaSize) & + bind(C, name='ProductYieldsProductYieldGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductYieldsProductYieldGetByLabel +end function ProductYieldsProductYieldGetByLabel + +!! Set, by label +subroutine ProductYieldsProductYieldSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ProductYieldsProductYieldSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductYieldsProductYieldSetByLabel + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalProductYields diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Production.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Production.f03 new file mode 100644 index 000000000..4a9e23617 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Production.f03 @@ -0,0 +1,298 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalProduction +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ProductionDefaultConst() & + bind(C, name='ProductionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ProductionDefaultConst +end function ProductionDefaultConst + +!! Create, default, non-const +function ProductionDefault() & + bind(C, name='ProductionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ProductionDefault +end function ProductionDefault + +!! Create, general, const +function ProductionCreateConst( & + label, & + ENDF_MT, & + crossSection, & + outputChannel, & + labelSize & +) & + bind(C, name='ProductionCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + type(c_ptr), intent(in), value :: crossSection + type(c_ptr), intent(in), value :: outputChannel + type(c_ptr) :: ProductionCreateConst +end function ProductionCreateConst + +!! Create, general, non-const +function ProductionCreate( & + label, & + ENDF_MT, & + crossSection, & + outputChannel, & + labelSize & +) & + bind(C, name='ProductionCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + type(c_ptr), intent(in), value :: crossSection + type(c_ptr), intent(in), value :: outputChannel + type(c_ptr) :: ProductionCreate +end function ProductionCreate + +!! Assign +subroutine ProductionAssign(handleLHS, handleRHS) & + bind(C, name='ProductionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ProductionAssign + +!! Delete +subroutine ProductionDelete(handle) & + bind(C, name='ProductionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ProductionRead(handle, filename, filenameSize) & + bind(C, name='ProductionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductionRead +end function ProductionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ProductionWrite(handle, filename, filenameSize) & + bind(C, name='ProductionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductionWrite +end function ProductionWrite + +!! Print to standard output, in our prettyprinting format +function ProductionPrint(handle) & + bind(C, name='ProductionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionPrint +end function ProductionPrint + +!! Print to standard output, as XML +function ProductionPrintXML(handle) & + bind(C, name='ProductionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionPrintXML +end function ProductionPrintXML + +!! Print to standard output, as JSON +function ProductionPrintJSON(handle) & + bind(C, name='ProductionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionPrintJSON +end function ProductionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ProductionLabelHas(handle) & + bind(C, name='ProductionLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionLabelHas +end function ProductionLabelHas + +!! Get +function ProductionLabelGet(handle) & + bind(C, name='ProductionLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductionLabelGet +end function ProductionLabelGet + +!! Set +subroutine ProductionLabelSet(handle, label, labelSize) & + bind(C, name='ProductionLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ProductionLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: ENDF_MT +!! ----------------------------------------------------------------------------- + +!! Has +function ProductionENDFMTHas(handle) & + bind(C, name='ProductionENDFMTHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionENDFMTHas +end function ProductionENDFMTHas + +!! Get +function ProductionENDFMTGet(handle) & + bind(C, name='ProductionENDFMTGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionENDFMTGet +end function ProductionENDFMTGet + +!! Set +subroutine ProductionENDFMTSet(handle, ENDF_MT) & + bind(C, name='ProductionENDFMTSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: ENDF_MT +end subroutine ProductionENDFMTSet + + +!! ----------------------------------------------------------------------------- +!! Child: crossSection +!! ----------------------------------------------------------------------------- + +!! Has +function ProductionCrossSectionHas(handle) & + bind(C, name='ProductionCrossSectionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionCrossSectionHas +end function ProductionCrossSectionHas + +!! Get, const +function ProductionCrossSectionGetConst(handle) & + bind(C, name='ProductionCrossSectionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductionCrossSectionGetConst +end function ProductionCrossSectionGetConst + +!! Get, non-const +function ProductionCrossSectionGet(handle) & + bind(C, name='ProductionCrossSectionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ProductionCrossSectionGet +end function ProductionCrossSectionGet + +!! Set +subroutine ProductionCrossSectionSet(handle, fieldHandle) & + bind(C, name='ProductionCrossSectionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductionCrossSectionSet + + +!! ----------------------------------------------------------------------------- +!! Child: outputChannel +!! ----------------------------------------------------------------------------- + +!! Has +function ProductionOutputChannelHas(handle) & + bind(C, name='ProductionOutputChannelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionOutputChannelHas +end function ProductionOutputChannelHas + +!! Get, const +function ProductionOutputChannelGetConst(handle) & + bind(C, name='ProductionOutputChannelGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductionOutputChannelGetConst +end function ProductionOutputChannelGetConst + +!! Get, non-const +function ProductionOutputChannelGet(handle) & + bind(C, name='ProductionOutputChannelGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ProductionOutputChannelGet +end function ProductionOutputChannelGet + +!! Set +subroutine ProductionOutputChannelSet(handle, fieldHandle) & + bind(C, name='ProductionOutputChannelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductionOutputChannelSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalProduction diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Productions.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Productions.f03 new file mode 100644 index 000000000..0d6d81709 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Productions.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalProductions +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ProductionsDefaultConst() & + bind(C, name='ProductionsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ProductionsDefaultConst +end function ProductionsDefaultConst + +!! Create, default, non-const +function ProductionsDefault() & + bind(C, name='ProductionsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ProductionsDefault +end function ProductionsDefault + +!! Create, general, const +function ProductionsCreateConst( & + production, productionSize & +) & + bind(C, name='ProductionsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: productionSize + type(c_ptr), intent(in) :: production(productionSize) + type(c_ptr) :: ProductionsCreateConst +end function ProductionsCreateConst + +!! Create, general, non-const +function ProductionsCreate( & + production, productionSize & +) & + bind(C, name='ProductionsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: productionSize + type(c_ptr), intent(in) :: production(productionSize) + type(c_ptr) :: ProductionsCreate +end function ProductionsCreate + +!! Assign +subroutine ProductionsAssign(handleLHS, handleRHS) & + bind(C, name='ProductionsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ProductionsAssign + +!! Delete +subroutine ProductionsDelete(handle) & + bind(C, name='ProductionsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductionsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ProductionsRead(handle, filename, filenameSize) & + bind(C, name='ProductionsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductionsRead +end function ProductionsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ProductionsWrite(handle, filename, filenameSize) & + bind(C, name='ProductionsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductionsWrite +end function ProductionsWrite + +!! Print to standard output, in our prettyprinting format +function ProductionsPrint(handle) & + bind(C, name='ProductionsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionsPrint +end function ProductionsPrint + +!! Print to standard output, as XML +function ProductionsPrintXML(handle) & + bind(C, name='ProductionsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionsPrintXML +end function ProductionsPrintXML + +!! Print to standard output, as JSON +function ProductionsPrintJSON(handle) & + bind(C, name='ProductionsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionsPrintJSON +end function ProductionsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: production +!! ----------------------------------------------------------------------------- + +!! Has +function ProductionsProductionHas(handle) & + bind(C, name='ProductionsProductionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductionsProductionHas +end function ProductionsProductionHas + +!! Clear +subroutine ProductionsProductionClear(handle) & + bind(C, name='ProductionsProductionClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductionsProductionClear + +!! Size +function ProductionsProductionSize(handle) & + bind(C, name='ProductionsProductionSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ProductionsProductionSize +end function ProductionsProductionSize + +!! Add +subroutine ProductionsProductionAdd(handle, fieldHandle) & + bind(C, name='ProductionsProductionAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductionsProductionAdd + +!! Get, by index \in [0,size), const +function ProductionsProductionGetConst(handle, index) & + bind(C, name='ProductionsProductionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ProductionsProductionGetConst +end function ProductionsProductionGetConst + +!! Get, by index \in [0,size), non-const +function ProductionsProductionGet(handle, index) & + bind(C, name='ProductionsProductionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ProductionsProductionGet +end function ProductionsProductionGet + +!! Set, by index \in [0,size) +subroutine ProductionsProductionSet(handle, index, fieldHandle) & + bind(C, name='ProductionsProductionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductionsProductionSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ProductionsProductionHasByLabel(handle, meta, metaSize) & + bind(C, name='ProductionsProductionHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ProductionsProductionHasByLabel +end function ProductionsProductionHasByLabel + +!! Get, by label, const +function ProductionsProductionGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ProductionsProductionGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductionsProductionGetByLabelConst +end function ProductionsProductionGetByLabelConst + +!! Get, by label, non-const +function ProductionsProductionGetByLabel(handle, meta, metaSize) & + bind(C, name='ProductionsProductionGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductionsProductionGetByLabel +end function ProductionsProductionGetByLabel + +!! Set, by label +subroutine ProductionsProductionSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ProductionsProductionSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductionsProductionSetByLabel + +!! ------------------------ +!! Re: metadatum ENDF_MT +!! ------------------------ + +!! Has, by ENDF_MT +function ProductionsProductionHasByENDFMT(handle, meta) & + bind(C, name='ProductionsProductionHasByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: ProductionsProductionHasByENDFMT +end function ProductionsProductionHasByENDFMT + +!! Get, by ENDF_MT, const +function ProductionsProductionGetByENDFMTConst(handle, meta) & + bind(C, name='ProductionsProductionGetByENDFMTConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ProductionsProductionGetByENDFMTConst +end function ProductionsProductionGetByENDFMTConst + +!! Get, by ENDF_MT, non-const +function ProductionsProductionGetByENDFMT(handle, meta) & + bind(C, name='ProductionsProductionGetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ProductionsProductionGetByENDFMT +end function ProductionsProductionGetByENDFMT + +!! Set, by ENDF_MT +subroutine ProductionsProductionSetByENDFMT(handle, meta, fieldHandle) & + bind(C, name='ProductionsProductionSetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductionsProductionSetByENDFMT + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalProductions diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Products.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Products.f03 new file mode 100644 index 000000000..2d3d3f43c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Products.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalProducts +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ProductsDefaultConst() & + bind(C, name='ProductsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ProductsDefaultConst +end function ProductsDefaultConst + +!! Create, default, non-const +function ProductsDefault() & + bind(C, name='ProductsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ProductsDefault +end function ProductsDefault + +!! Create, general, const +function ProductsCreateConst( & + product, productSize & +) & + bind(C, name='ProductsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: productSize + type(c_ptr), intent(in) :: product(productSize) + type(c_ptr) :: ProductsCreateConst +end function ProductsCreateConst + +!! Create, general, non-const +function ProductsCreate( & + product, productSize & +) & + bind(C, name='ProductsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: productSize + type(c_ptr), intent(in) :: product(productSize) + type(c_ptr) :: ProductsCreate +end function ProductsCreate + +!! Assign +subroutine ProductsAssign(handleLHS, handleRHS) & + bind(C, name='ProductsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ProductsAssign + +!! Delete +subroutine ProductsDelete(handle) & + bind(C, name='ProductsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ProductsRead(handle, filename, filenameSize) & + bind(C, name='ProductsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductsRead +end function ProductsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ProductsWrite(handle, filename, filenameSize) & + bind(C, name='ProductsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductsWrite +end function ProductsWrite + +!! Print to standard output, in our prettyprinting format +function ProductsPrint(handle) & + bind(C, name='ProductsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductsPrint +end function ProductsPrint + +!! Print to standard output, as XML +function ProductsPrintXML(handle) & + bind(C, name='ProductsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductsPrintXML +end function ProductsPrintXML + +!! Print to standard output, as JSON +function ProductsPrintJSON(handle) & + bind(C, name='ProductsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductsPrintJSON +end function ProductsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: product +!! ----------------------------------------------------------------------------- + +!! Has +function ProductsProductHas(handle) & + bind(C, name='ProductsProductHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductsProductHas +end function ProductsProductHas + +!! Clear +subroutine ProductsProductClear(handle) & + bind(C, name='ProductsProductClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductsProductClear + +!! Size +function ProductsProductSize(handle) & + bind(C, name='ProductsProductSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ProductsProductSize +end function ProductsProductSize + +!! Add +subroutine ProductsProductAdd(handle, fieldHandle) & + bind(C, name='ProductsProductAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductsProductAdd + +!! Get, by index \in [0,size), const +function ProductsProductGetConst(handle, index) & + bind(C, name='ProductsProductGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ProductsProductGetConst +end function ProductsProductGetConst + +!! Get, by index \in [0,size), non-const +function ProductsProductGet(handle, index) & + bind(C, name='ProductsProductGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ProductsProductGet +end function ProductsProductGet + +!! Set, by index \in [0,size) +subroutine ProductsProductSet(handle, index, fieldHandle) & + bind(C, name='ProductsProductSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductsProductSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ProductsProductHasByLabel(handle, meta, metaSize) & + bind(C, name='ProductsProductHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ProductsProductHasByLabel +end function ProductsProductHasByLabel + +!! Get, by label, const +function ProductsProductGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ProductsProductGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductsProductGetByLabelConst +end function ProductsProductGetByLabelConst + +!! Get, by label, non-const +function ProductsProductGetByLabel(handle, meta, metaSize) & + bind(C, name='ProductsProductGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductsProductGetByLabel +end function ProductsProductGetByLabel + +!! Set, by label +subroutine ProductsProductSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ProductsProductSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductsProductSetByLabel + +!! ------------------------ +!! Re: metadatum pid +!! ------------------------ + +!! Has, by pid +function ProductsProductHasByPid(handle, meta, metaSize) & + bind(C, name='ProductsProductHasByPid') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ProductsProductHasByPid +end function ProductsProductHasByPid + +!! Get, by pid, const +function ProductsProductGetByPidConst(handle, meta, metaSize) & + bind(C, name='ProductsProductGetByPidConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductsProductGetByPidConst +end function ProductsProductGetByPidConst + +!! Get, by pid, non-const +function ProductsProductGetByPid(handle, meta, metaSize) & + bind(C, name='ProductsProductGetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductsProductGetByPid +end function ProductsProductGetByPid + +!! Set, by pid +subroutine ProductsProductSetByPid(handle, meta, metaSize, fieldHandle) & + bind(C, name='ProductsProductSetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductsProductSetByPid + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalProducts diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ProjectileEnergyDomain.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ProjectileEnergyDomain.f03 new file mode 100644 index 000000000..dbd394d25 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ProjectileEnergyDomain.f03 @@ -0,0 +1,244 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalProjectileEnergyDomain +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ProjectileEnergyDomainDefaultConst() & + bind(C, name='ProjectileEnergyDomainDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ProjectileEnergyDomainDefaultConst +end function ProjectileEnergyDomainDefaultConst + +!! Create, default, non-const +function ProjectileEnergyDomainDefault() & + bind(C, name='ProjectileEnergyDomainDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ProjectileEnergyDomainDefault +end function ProjectileEnergyDomainDefault + +!! Create, general, const +function ProjectileEnergyDomainCreateConst( & + min, & + max, & + unit, & + unitSize & +) & + bind(C, name='ProjectileEnergyDomainCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: min + real(c_double), intent(in), value :: max + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: ProjectileEnergyDomainCreateConst +end function ProjectileEnergyDomainCreateConst + +!! Create, general, non-const +function ProjectileEnergyDomainCreate( & + min, & + max, & + unit, & + unitSize & +) & + bind(C, name='ProjectileEnergyDomainCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: min + real(c_double), intent(in), value :: max + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: ProjectileEnergyDomainCreate +end function ProjectileEnergyDomainCreate + +!! Assign +subroutine ProjectileEnergyDomainAssign(handleLHS, handleRHS) & + bind(C, name='ProjectileEnergyDomainAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ProjectileEnergyDomainAssign + +!! Delete +subroutine ProjectileEnergyDomainDelete(handle) & + bind(C, name='ProjectileEnergyDomainDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProjectileEnergyDomainDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ProjectileEnergyDomainRead(handle, filename, filenameSize) & + bind(C, name='ProjectileEnergyDomainRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProjectileEnergyDomainRead +end function ProjectileEnergyDomainRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ProjectileEnergyDomainWrite(handle, filename, filenameSize) & + bind(C, name='ProjectileEnergyDomainWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProjectileEnergyDomainWrite +end function ProjectileEnergyDomainWrite + +!! Print to standard output, in our prettyprinting format +function ProjectileEnergyDomainPrint(handle) & + bind(C, name='ProjectileEnergyDomainPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProjectileEnergyDomainPrint +end function ProjectileEnergyDomainPrint + +!! Print to standard output, as XML +function ProjectileEnergyDomainPrintXML(handle) & + bind(C, name='ProjectileEnergyDomainPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProjectileEnergyDomainPrintXML +end function ProjectileEnergyDomainPrintXML + +!! Print to standard output, as JSON +function ProjectileEnergyDomainPrintJSON(handle) & + bind(C, name='ProjectileEnergyDomainPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProjectileEnergyDomainPrintJSON +end function ProjectileEnergyDomainPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: min +!! ----------------------------------------------------------------------------- + +!! Has +function ProjectileEnergyDomainMinHas(handle) & + bind(C, name='ProjectileEnergyDomainMinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProjectileEnergyDomainMinHas +end function ProjectileEnergyDomainMinHas + +!! Get +function ProjectileEnergyDomainMinGet(handle) & + bind(C, name='ProjectileEnergyDomainMinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: ProjectileEnergyDomainMinGet +end function ProjectileEnergyDomainMinGet + +!! Set +subroutine ProjectileEnergyDomainMinSet(handle, min) & + bind(C, name='ProjectileEnergyDomainMinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: min +end subroutine ProjectileEnergyDomainMinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: max +!! ----------------------------------------------------------------------------- + +!! Has +function ProjectileEnergyDomainMaxHas(handle) & + bind(C, name='ProjectileEnergyDomainMaxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProjectileEnergyDomainMaxHas +end function ProjectileEnergyDomainMaxHas + +!! Get +function ProjectileEnergyDomainMaxGet(handle) & + bind(C, name='ProjectileEnergyDomainMaxGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: ProjectileEnergyDomainMaxGet +end function ProjectileEnergyDomainMaxGet + +!! Set +subroutine ProjectileEnergyDomainMaxSet(handle, max) & + bind(C, name='ProjectileEnergyDomainMaxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: max +end subroutine ProjectileEnergyDomainMaxSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function ProjectileEnergyDomainUnitHas(handle) & + bind(C, name='ProjectileEnergyDomainUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProjectileEnergyDomainUnitHas +end function ProjectileEnergyDomainUnitHas + +!! Get +function ProjectileEnergyDomainUnitGet(handle) & + bind(C, name='ProjectileEnergyDomainUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProjectileEnergyDomainUnitGet +end function ProjectileEnergyDomainUnitGet + +!! Set +subroutine ProjectileEnergyDomainUnitSet(handle, unit, unitSize) & + bind(C, name='ProjectileEnergyDomainUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine ProjectileEnergyDomainUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalProjectileEnergyDomain diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PromptGammaEnergy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PromptGammaEnergy.f03 new file mode 100644 index 000000000..7766da1e7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PromptGammaEnergy.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalPromptGammaEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function PromptGammaEnergyDefaultConst() & + bind(C, name='PromptGammaEnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: PromptGammaEnergyDefaultConst +end function PromptGammaEnergyDefaultConst + +!! Create, default, non-const +function PromptGammaEnergyDefault() & + bind(C, name='PromptGammaEnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: PromptGammaEnergyDefault +end function PromptGammaEnergyDefault + +!! Create, general, const +function PromptGammaEnergyCreateConst( & + polynomial1d, & + XYs1d & +) & + bind(C, name='PromptGammaEnergyCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: PromptGammaEnergyCreateConst +end function PromptGammaEnergyCreateConst + +!! Create, general, non-const +function PromptGammaEnergyCreate( & + polynomial1d, & + XYs1d & +) & + bind(C, name='PromptGammaEnergyCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: PromptGammaEnergyCreate +end function PromptGammaEnergyCreate + +!! Assign +subroutine PromptGammaEnergyAssign(handleLHS, handleRHS) & + bind(C, name='PromptGammaEnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine PromptGammaEnergyAssign + +!! Delete +subroutine PromptGammaEnergyDelete(handle) & + bind(C, name='PromptGammaEnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine PromptGammaEnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function PromptGammaEnergyRead(handle, filename, filenameSize) & + bind(C, name='PromptGammaEnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PromptGammaEnergyRead +end function PromptGammaEnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function PromptGammaEnergyWrite(handle, filename, filenameSize) & + bind(C, name='PromptGammaEnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PromptGammaEnergyWrite +end function PromptGammaEnergyWrite + +!! Print to standard output, in our prettyprinting format +function PromptGammaEnergyPrint(handle) & + bind(C, name='PromptGammaEnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptGammaEnergyPrint +end function PromptGammaEnergyPrint + +!! Print to standard output, as XML +function PromptGammaEnergyPrintXML(handle) & + bind(C, name='PromptGammaEnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptGammaEnergyPrintXML +end function PromptGammaEnergyPrintXML + +!! Print to standard output, as JSON +function PromptGammaEnergyPrintJSON(handle) & + bind(C, name='PromptGammaEnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptGammaEnergyPrintJSON +end function PromptGammaEnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: polynomial1d +!! ----------------------------------------------------------------------------- + +!! Has +function PromptGammaEnergyPolynomial1dHas(handle) & + bind(C, name='PromptGammaEnergyPolynomial1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptGammaEnergyPolynomial1dHas +end function PromptGammaEnergyPolynomial1dHas + +!! Get, const +function PromptGammaEnergyPolynomial1dGetConst(handle) & + bind(C, name='PromptGammaEnergyPolynomial1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PromptGammaEnergyPolynomial1dGetConst +end function PromptGammaEnergyPolynomial1dGetConst + +!! Get, non-const +function PromptGammaEnergyPolynomial1dGet(handle) & + bind(C, name='PromptGammaEnergyPolynomial1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PromptGammaEnergyPolynomial1dGet +end function PromptGammaEnergyPolynomial1dGet + +!! Set +subroutine PromptGammaEnergyPolynomial1dSet(handle, fieldHandle) & + bind(C, name='PromptGammaEnergyPolynomial1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PromptGammaEnergyPolynomial1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function PromptGammaEnergyXYs1dHas(handle) & + bind(C, name='PromptGammaEnergyXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptGammaEnergyXYs1dHas +end function PromptGammaEnergyXYs1dHas + +!! Get, const +function PromptGammaEnergyXYs1dGetConst(handle) & + bind(C, name='PromptGammaEnergyXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PromptGammaEnergyXYs1dGetConst +end function PromptGammaEnergyXYs1dGetConst + +!! Get, non-const +function PromptGammaEnergyXYs1dGet(handle) & + bind(C, name='PromptGammaEnergyXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PromptGammaEnergyXYs1dGet +end function PromptGammaEnergyXYs1dGet + +!! Set +subroutine PromptGammaEnergyXYs1dSet(handle, fieldHandle) & + bind(C, name='PromptGammaEnergyXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PromptGammaEnergyXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalPromptGammaEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PromptNeutronKE.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PromptNeutronKE.f03 new file mode 100644 index 000000000..6ffe520d0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PromptNeutronKE.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalPromptNeutronKE +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function PromptNeutronKEDefaultConst() & + bind(C, name='PromptNeutronKEDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: PromptNeutronKEDefaultConst +end function PromptNeutronKEDefaultConst + +!! Create, default, non-const +function PromptNeutronKEDefault() & + bind(C, name='PromptNeutronKEDefault') + use iso_c_binding + implicit none + type(c_ptr) :: PromptNeutronKEDefault +end function PromptNeutronKEDefault + +!! Create, general, const +function PromptNeutronKECreateConst( & + polynomial1d, & + XYs1d & +) & + bind(C, name='PromptNeutronKECreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: PromptNeutronKECreateConst +end function PromptNeutronKECreateConst + +!! Create, general, non-const +function PromptNeutronKECreate( & + polynomial1d, & + XYs1d & +) & + bind(C, name='PromptNeutronKECreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: PromptNeutronKECreate +end function PromptNeutronKECreate + +!! Assign +subroutine PromptNeutronKEAssign(handleLHS, handleRHS) & + bind(C, name='PromptNeutronKEAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine PromptNeutronKEAssign + +!! Delete +subroutine PromptNeutronKEDelete(handle) & + bind(C, name='PromptNeutronKEDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine PromptNeutronKEDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function PromptNeutronKERead(handle, filename, filenameSize) & + bind(C, name='PromptNeutronKERead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PromptNeutronKERead +end function PromptNeutronKERead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function PromptNeutronKEWrite(handle, filename, filenameSize) & + bind(C, name='PromptNeutronKEWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PromptNeutronKEWrite +end function PromptNeutronKEWrite + +!! Print to standard output, in our prettyprinting format +function PromptNeutronKEPrint(handle) & + bind(C, name='PromptNeutronKEPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptNeutronKEPrint +end function PromptNeutronKEPrint + +!! Print to standard output, as XML +function PromptNeutronKEPrintXML(handle) & + bind(C, name='PromptNeutronKEPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptNeutronKEPrintXML +end function PromptNeutronKEPrintXML + +!! Print to standard output, as JSON +function PromptNeutronKEPrintJSON(handle) & + bind(C, name='PromptNeutronKEPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptNeutronKEPrintJSON +end function PromptNeutronKEPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: polynomial1d +!! ----------------------------------------------------------------------------- + +!! Has +function PromptNeutronKEPolynomial1dHas(handle) & + bind(C, name='PromptNeutronKEPolynomial1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptNeutronKEPolynomial1dHas +end function PromptNeutronKEPolynomial1dHas + +!! Get, const +function PromptNeutronKEPolynomial1dGetConst(handle) & + bind(C, name='PromptNeutronKEPolynomial1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PromptNeutronKEPolynomial1dGetConst +end function PromptNeutronKEPolynomial1dGetConst + +!! Get, non-const +function PromptNeutronKEPolynomial1dGet(handle) & + bind(C, name='PromptNeutronKEPolynomial1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PromptNeutronKEPolynomial1dGet +end function PromptNeutronKEPolynomial1dGet + +!! Set +subroutine PromptNeutronKEPolynomial1dSet(handle, fieldHandle) & + bind(C, name='PromptNeutronKEPolynomial1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PromptNeutronKEPolynomial1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function PromptNeutronKEXYs1dHas(handle) & + bind(C, name='PromptNeutronKEXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptNeutronKEXYs1dHas +end function PromptNeutronKEXYs1dHas + +!! Get, const +function PromptNeutronKEXYs1dGetConst(handle) & + bind(C, name='PromptNeutronKEXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PromptNeutronKEXYs1dGetConst +end function PromptNeutronKEXYs1dGetConst + +!! Get, non-const +function PromptNeutronKEXYs1dGet(handle) & + bind(C, name='PromptNeutronKEXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PromptNeutronKEXYs1dGet +end function PromptNeutronKEXYs1dGet + +!! Set +subroutine PromptNeutronKEXYs1dSet(handle, fieldHandle) & + bind(C, name='PromptNeutronKEXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PromptNeutronKEXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalPromptNeutronKE diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PromptProductKE.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PromptProductKE.f03 new file mode 100644 index 000000000..c427ac438 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/PromptProductKE.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalPromptProductKE +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function PromptProductKEDefaultConst() & + bind(C, name='PromptProductKEDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: PromptProductKEDefaultConst +end function PromptProductKEDefaultConst + +!! Create, default, non-const +function PromptProductKEDefault() & + bind(C, name='PromptProductKEDefault') + use iso_c_binding + implicit none + type(c_ptr) :: PromptProductKEDefault +end function PromptProductKEDefault + +!! Create, general, const +function PromptProductKECreateConst( & + polynomial1d, & + XYs1d & +) & + bind(C, name='PromptProductKECreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: PromptProductKECreateConst +end function PromptProductKECreateConst + +!! Create, general, non-const +function PromptProductKECreate( & + polynomial1d, & + XYs1d & +) & + bind(C, name='PromptProductKECreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: PromptProductKECreate +end function PromptProductKECreate + +!! Assign +subroutine PromptProductKEAssign(handleLHS, handleRHS) & + bind(C, name='PromptProductKEAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine PromptProductKEAssign + +!! Delete +subroutine PromptProductKEDelete(handle) & + bind(C, name='PromptProductKEDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine PromptProductKEDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function PromptProductKERead(handle, filename, filenameSize) & + bind(C, name='PromptProductKERead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PromptProductKERead +end function PromptProductKERead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function PromptProductKEWrite(handle, filename, filenameSize) & + bind(C, name='PromptProductKEWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PromptProductKEWrite +end function PromptProductKEWrite + +!! Print to standard output, in our prettyprinting format +function PromptProductKEPrint(handle) & + bind(C, name='PromptProductKEPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptProductKEPrint +end function PromptProductKEPrint + +!! Print to standard output, as XML +function PromptProductKEPrintXML(handle) & + bind(C, name='PromptProductKEPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptProductKEPrintXML +end function PromptProductKEPrintXML + +!! Print to standard output, as JSON +function PromptProductKEPrintJSON(handle) & + bind(C, name='PromptProductKEPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptProductKEPrintJSON +end function PromptProductKEPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: polynomial1d +!! ----------------------------------------------------------------------------- + +!! Has +function PromptProductKEPolynomial1dHas(handle) & + bind(C, name='PromptProductKEPolynomial1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptProductKEPolynomial1dHas +end function PromptProductKEPolynomial1dHas + +!! Get, const +function PromptProductKEPolynomial1dGetConst(handle) & + bind(C, name='PromptProductKEPolynomial1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PromptProductKEPolynomial1dGetConst +end function PromptProductKEPolynomial1dGetConst + +!! Get, non-const +function PromptProductKEPolynomial1dGet(handle) & + bind(C, name='PromptProductKEPolynomial1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PromptProductKEPolynomial1dGet +end function PromptProductKEPolynomial1dGet + +!! Set +subroutine PromptProductKEPolynomial1dSet(handle, fieldHandle) & + bind(C, name='PromptProductKEPolynomial1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PromptProductKEPolynomial1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function PromptProductKEXYs1dHas(handle) & + bind(C, name='PromptProductKEXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PromptProductKEXYs1dHas +end function PromptProductKEXYs1dHas + +!! Get, const +function PromptProductKEXYs1dGetConst(handle) & + bind(C, name='PromptProductKEXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PromptProductKEXYs1dGetConst +end function PromptProductKEXYs1dGetConst + +!! Get, non-const +function PromptProductKEXYs1dGet(handle) & + bind(C, name='PromptProductKEXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PromptProductKEXYs1dGet +end function PromptProductKEXYs1dGet + +!! Set +subroutine PromptProductKEXYs1dSet(handle, fieldHandle) & + bind(C, name='PromptProductKEXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PromptProductKEXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalPromptProductKE diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Q.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Q.f03 new file mode 100644 index 000000000..89eaa4df2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Q.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalQ +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function QDefaultConst() & + bind(C, name='QDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: QDefaultConst +end function QDefaultConst + +!! Create, default, non-const +function QDefault() & + bind(C, name='QDefault') + use iso_c_binding + implicit none + type(c_ptr) :: QDefault +end function QDefault + +!! Create, general, const +function QCreateConst( & + Double, & + constant1d & +) & + bind(C, name='QCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr), intent(in), value :: constant1d + type(c_ptr) :: QCreateConst +end function QCreateConst + +!! Create, general, non-const +function QCreate( & + Double, & + constant1d & +) & + bind(C, name='QCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr), intent(in), value :: constant1d + type(c_ptr) :: QCreate +end function QCreate + +!! Assign +subroutine QAssign(handleLHS, handleRHS) & + bind(C, name='QAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine QAssign + +!! Delete +subroutine QDelete(handle) & + bind(C, name='QDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine QDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function QRead(handle, filename, filenameSize) & + bind(C, name='QRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: QRead +end function QRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function QWrite(handle, filename, filenameSize) & + bind(C, name='QWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: QWrite +end function QWrite + +!! Print to standard output, in our prettyprinting format +function QPrint(handle) & + bind(C, name='QPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: QPrint +end function QPrint + +!! Print to standard output, as XML +function QPrintXML(handle) & + bind(C, name='QPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: QPrintXML +end function QPrintXML + +!! Print to standard output, as JSON +function QPrintJSON(handle) & + bind(C, name='QPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: QPrintJSON +end function QPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: Double +!! ----------------------------------------------------------------------------- + +!! Has +function QDoubleHas(handle) & + bind(C, name='QDoubleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: QDoubleHas +end function QDoubleHas + +!! Get, const +function QDoubleGetConst(handle) & + bind(C, name='QDoubleGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: QDoubleGetConst +end function QDoubleGetConst + +!! Get, non-const +function QDoubleGet(handle) & + bind(C, name='QDoubleGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: QDoubleGet +end function QDoubleGet + +!! Set +subroutine QDoubleSet(handle, fieldHandle) & + bind(C, name='QDoubleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine QDoubleSet + + +!! ----------------------------------------------------------------------------- +!! Child: constant1d +!! ----------------------------------------------------------------------------- + +!! Has +function QConstant1dHas(handle) & + bind(C, name='QConstant1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: QConstant1dHas +end function QConstant1dHas + +!! Get, const +function QConstant1dGetConst(handle) & + bind(C, name='QConstant1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: QConstant1dGetConst +end function QConstant1dGetConst + +!! Get, non-const +function QConstant1dGet(handle) & + bind(C, name='QConstant1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: QConstant1dGet +end function QConstant1dGet + +!! Set +subroutine QConstant1dSet(handle, fieldHandle) & + bind(C, name='QConstant1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine QConstant1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalQ diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/R.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/R.f03 new file mode 100644 index 000000000..9fcd02351 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/R.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalR +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function RDefaultConst() & + bind(C, name='RDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: RDefaultConst +end function RDefaultConst + +!! Create, default, non-const +function RDefault() & + bind(C, name='RDefault') + use iso_c_binding + implicit none + type(c_ptr) :: RDefault +end function RDefault + +!! Create, general, const +function RCreateConst( & + XYs2d & +) & + bind(C, name='RCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: RCreateConst +end function RCreateConst + +!! Create, general, non-const +function RCreate( & + XYs2d & +) & + bind(C, name='RCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: RCreate +end function RCreate + +!! Assign +subroutine RAssign(handleLHS, handleRHS) & + bind(C, name='RAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine RAssign + +!! Delete +subroutine RDelete(handle) & + bind(C, name='RDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine RDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function RRead(handle, filename, filenameSize) & + bind(C, name='RRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RRead +end function RRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function RWrite(handle, filename, filenameSize) & + bind(C, name='RWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RWrite +end function RWrite + +!! Print to standard output, in our prettyprinting format +function RPrint(handle) & + bind(C, name='RPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RPrint +end function RPrint + +!! Print to standard output, as XML +function RPrintXML(handle) & + bind(C, name='RPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RPrintXML +end function RPrintXML + +!! Print to standard output, as JSON +function RPrintJSON(handle) & + bind(C, name='RPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RPrintJSON +end function RPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs2d +!! ----------------------------------------------------------------------------- + +!! Has +function RXYs2dHas(handle) & + bind(C, name='RXYs2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RXYs2dHas +end function RXYs2dHas + +!! Get, const +function RXYs2dGetConst(handle) & + bind(C, name='RXYs2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RXYs2dGetConst +end function RXYs2dGetConst + +!! Get, non-const +function RXYs2dGet(handle) & + bind(C, name='RXYs2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: RXYs2dGet +end function RXYs2dGet + +!! Set +subroutine RXYs2dSet(handle, fieldHandle) & + bind(C, name='RXYs2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine RXYs2dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalR diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RMatrix.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RMatrix.f03 new file mode 100644 index 000000000..9be0e77d7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RMatrix.f03 @@ -0,0 +1,461 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalRMatrix +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function RMatrixDefaultConst() & + bind(C, name='RMatrixDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: RMatrixDefaultConst +end function RMatrixDefaultConst + +!! Create, default, non-const +function RMatrixDefault() & + bind(C, name='RMatrixDefault') + use iso_c_binding + implicit none + type(c_ptr) :: RMatrixDefault +end function RMatrixDefault + +!! Create, general, const +function RMatrixCreateConst( & + label, & + approximation, & + boundaryCondition, & + calculateChannelRadius, & + supportsAngularReconstruction, & + PoPs, & + resonanceReactions, & + spinGroups, & + labelSize, & + approximationSize, & + boundaryConditionSize & +) & + bind(C, name='RMatrixCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: approximationSize + character(c_char), intent(in) :: approximation(approximationSize) + integer(c_size_t), intent(in), value :: boundaryConditionSize + character(c_char), intent(in) :: boundaryCondition(boundaryConditionSize) + logical(c_bool), intent(in), value :: calculateChannelRadius + logical(c_bool), intent(in), value :: supportsAngularReconstruction + type(c_ptr), intent(in), value :: PoPs + type(c_ptr), intent(in), value :: resonanceReactions + type(c_ptr), intent(in), value :: spinGroups + type(c_ptr) :: RMatrixCreateConst +end function RMatrixCreateConst + +!! Create, general, non-const +function RMatrixCreate( & + label, & + approximation, & + boundaryCondition, & + calculateChannelRadius, & + supportsAngularReconstruction, & + PoPs, & + resonanceReactions, & + spinGroups, & + labelSize, & + approximationSize, & + boundaryConditionSize & +) & + bind(C, name='RMatrixCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: approximationSize + character(c_char), intent(in) :: approximation(approximationSize) + integer(c_size_t), intent(in), value :: boundaryConditionSize + character(c_char), intent(in) :: boundaryCondition(boundaryConditionSize) + logical(c_bool), intent(in), value :: calculateChannelRadius + logical(c_bool), intent(in), value :: supportsAngularReconstruction + type(c_ptr), intent(in), value :: PoPs + type(c_ptr), intent(in), value :: resonanceReactions + type(c_ptr), intent(in), value :: spinGroups + type(c_ptr) :: RMatrixCreate +end function RMatrixCreate + +!! Assign +subroutine RMatrixAssign(handleLHS, handleRHS) & + bind(C, name='RMatrixAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine RMatrixAssign + +!! Delete +subroutine RMatrixDelete(handle) & + bind(C, name='RMatrixDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine RMatrixDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function RMatrixRead(handle, filename, filenameSize) & + bind(C, name='RMatrixRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RMatrixRead +end function RMatrixRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function RMatrixWrite(handle, filename, filenameSize) & + bind(C, name='RMatrixWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RMatrixWrite +end function RMatrixWrite + +!! Print to standard output, in our prettyprinting format +function RMatrixPrint(handle) & + bind(C, name='RMatrixPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RMatrixPrint +end function RMatrixPrint + +!! Print to standard output, as XML +function RMatrixPrintXML(handle) & + bind(C, name='RMatrixPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RMatrixPrintXML +end function RMatrixPrintXML + +!! Print to standard output, as JSON +function RMatrixPrintJSON(handle) & + bind(C, name='RMatrixPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RMatrixPrintJSON +end function RMatrixPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function RMatrixLabelHas(handle) & + bind(C, name='RMatrixLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RMatrixLabelHas +end function RMatrixLabelHas + +!! Get +function RMatrixLabelGet(handle) & + bind(C, name='RMatrixLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RMatrixLabelGet +end function RMatrixLabelGet + +!! Set +subroutine RMatrixLabelSet(handle, label, labelSize) & + bind(C, name='RMatrixLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine RMatrixLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: approximation +!! ----------------------------------------------------------------------------- + +!! Has +function RMatrixApproximationHas(handle) & + bind(C, name='RMatrixApproximationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RMatrixApproximationHas +end function RMatrixApproximationHas + +!! Get +function RMatrixApproximationGet(handle) & + bind(C, name='RMatrixApproximationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RMatrixApproximationGet +end function RMatrixApproximationGet + +!! Set +subroutine RMatrixApproximationSet(handle, approximation, approximationSize) & + bind(C, name='RMatrixApproximationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: approximationSize + character(c_char), intent(in) :: approximation(approximationSize) +end subroutine RMatrixApproximationSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: boundaryCondition +!! ----------------------------------------------------------------------------- + +!! Has +function RMatrixBoundaryConditionHas(handle) & + bind(C, name='RMatrixBoundaryConditionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RMatrixBoundaryConditionHas +end function RMatrixBoundaryConditionHas + +!! Get +function RMatrixBoundaryConditionGet(handle) & + bind(C, name='RMatrixBoundaryConditionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RMatrixBoundaryConditionGet +end function RMatrixBoundaryConditionGet + +!! Set +subroutine RMatrixBoundaryConditionSet(handle, boundaryCondition, boundaryConditionSize) & + bind(C, name='RMatrixBoundaryConditionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: boundaryConditionSize + character(c_char), intent(in) :: boundaryCondition(boundaryConditionSize) +end subroutine RMatrixBoundaryConditionSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: calculateChannelRadius +!! ----------------------------------------------------------------------------- + +!! Has +function RMatrixCalculateChannelRadiusHas(handle) & + bind(C, name='RMatrixCalculateChannelRadiusHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RMatrixCalculateChannelRadiusHas +end function RMatrixCalculateChannelRadiusHas + +!! Get +function RMatrixCalculateChannelRadiusGet(handle) & + bind(C, name='RMatrixCalculateChannelRadiusGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: RMatrixCalculateChannelRadiusGet +end function RMatrixCalculateChannelRadiusGet + +!! Set +subroutine RMatrixCalculateChannelRadiusSet(handle, calculateChannelRadius) & + bind(C, name='RMatrixCalculateChannelRadiusSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: calculateChannelRadius +end subroutine RMatrixCalculateChannelRadiusSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: supportsAngularReconstruction +!! ----------------------------------------------------------------------------- + +!! Has +function RMatrixSupportsAngularReconstructionHas(handle) & + bind(C, name='RMatrixSupportsAngularReconstructionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RMatrixSupportsAngularReconstructionHas +end function RMatrixSupportsAngularReconstructionHas + +!! Get +function RMatrixSupportsAngularReconstructionGet(handle) & + bind(C, name='RMatrixSupportsAngularReconstructionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: RMatrixSupportsAngularReconstructionGet +end function RMatrixSupportsAngularReconstructionGet + +!! Set +subroutine RMatrixSupportsAngularReconstructionSet(handle, supportsAngularReconstruction) & + bind(C, name='RMatrixSupportsAngularReconstructionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: supportsAngularReconstruction +end subroutine RMatrixSupportsAngularReconstructionSet + + +!! ----------------------------------------------------------------------------- +!! Child: PoPs +!! ----------------------------------------------------------------------------- + +!! Has +function RMatrixPoPsHas(handle) & + bind(C, name='RMatrixPoPsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RMatrixPoPsHas +end function RMatrixPoPsHas + +!! Get, const +function RMatrixPoPsGetConst(handle) & + bind(C, name='RMatrixPoPsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RMatrixPoPsGetConst +end function RMatrixPoPsGetConst + +!! Get, non-const +function RMatrixPoPsGet(handle) & + bind(C, name='RMatrixPoPsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: RMatrixPoPsGet +end function RMatrixPoPsGet + +!! Set +subroutine RMatrixPoPsSet(handle, fieldHandle) & + bind(C, name='RMatrixPoPsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine RMatrixPoPsSet + + +!! ----------------------------------------------------------------------------- +!! Child: resonanceReactions +!! ----------------------------------------------------------------------------- + +!! Has +function RMatrixResonanceReactionsHas(handle) & + bind(C, name='RMatrixResonanceReactionsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RMatrixResonanceReactionsHas +end function RMatrixResonanceReactionsHas + +!! Get, const +function RMatrixResonanceReactionsGetConst(handle) & + bind(C, name='RMatrixResonanceReactionsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RMatrixResonanceReactionsGetConst +end function RMatrixResonanceReactionsGetConst + +!! Get, non-const +function RMatrixResonanceReactionsGet(handle) & + bind(C, name='RMatrixResonanceReactionsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: RMatrixResonanceReactionsGet +end function RMatrixResonanceReactionsGet + +!! Set +subroutine RMatrixResonanceReactionsSet(handle, fieldHandle) & + bind(C, name='RMatrixResonanceReactionsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine RMatrixResonanceReactionsSet + + +!! ----------------------------------------------------------------------------- +!! Child: spinGroups +!! ----------------------------------------------------------------------------- + +!! Has +function RMatrixSpinGroupsHas(handle) & + bind(C, name='RMatrixSpinGroupsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RMatrixSpinGroupsHas +end function RMatrixSpinGroupsHas + +!! Get, const +function RMatrixSpinGroupsGetConst(handle) & + bind(C, name='RMatrixSpinGroupsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RMatrixSpinGroupsGetConst +end function RMatrixSpinGroupsGetConst + +!! Get, non-const +function RMatrixSpinGroupsGet(handle) & + bind(C, name='RMatrixSpinGroupsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: RMatrixSpinGroupsGet +end function RMatrixSpinGroupsGet + +!! Set +subroutine RMatrixSpinGroupsSet(handle, fieldHandle) & + bind(C, name='RMatrixSpinGroupsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine RMatrixSpinGroupsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalRMatrix diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Rate.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Rate.f03 new file mode 100644 index 000000000..a8f4c6984 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Rate.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalRate +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function RateDefaultConst() & + bind(C, name='RateDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: RateDefaultConst +end function RateDefaultConst + +!! Create, default, non-const +function RateDefault() & + bind(C, name='RateDefault') + use iso_c_binding + implicit none + type(c_ptr) :: RateDefault +end function RateDefault + +!! Create, general, const +function RateCreateConst( & + Double & +) & + bind(C, name='RateCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: RateCreateConst +end function RateCreateConst + +!! Create, general, non-const +function RateCreate( & + Double & +) & + bind(C, name='RateCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: RateCreate +end function RateCreate + +!! Assign +subroutine RateAssign(handleLHS, handleRHS) & + bind(C, name='RateAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine RateAssign + +!! Delete +subroutine RateDelete(handle) & + bind(C, name='RateDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine RateDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function RateRead(handle, filename, filenameSize) & + bind(C, name='RateRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RateRead +end function RateRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function RateWrite(handle, filename, filenameSize) & + bind(C, name='RateWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RateWrite +end function RateWrite + +!! Print to standard output, in our prettyprinting format +function RatePrint(handle) & + bind(C, name='RatePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RatePrint +end function RatePrint + +!! Print to standard output, as XML +function RatePrintXML(handle) & + bind(C, name='RatePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RatePrintXML +end function RatePrintXML + +!! Print to standard output, as JSON +function RatePrintJSON(handle) & + bind(C, name='RatePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RatePrintJSON +end function RatePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: Double +!! ----------------------------------------------------------------------------- + +!! Has +function RateDoubleHas(handle) & + bind(C, name='RateDoubleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RateDoubleHas +end function RateDoubleHas + +!! Get, const +function RateDoubleGetConst(handle) & + bind(C, name='RateDoubleGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RateDoubleGetConst +end function RateDoubleGetConst + +!! Get, non-const +function RateDoubleGet(handle) & + bind(C, name='RateDoubleGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: RateDoubleGet +end function RateDoubleGet + +!! Set +subroutine RateDoubleSet(handle, fieldHandle) & + bind(C, name='RateDoubleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine RateDoubleSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalRate diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Reaction.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Reaction.f03 new file mode 100644 index 000000000..be560a595 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Reaction.f03 @@ -0,0 +1,384 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalReaction +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ReactionDefaultConst() & + bind(C, name='ReactionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionDefaultConst +end function ReactionDefaultConst + +!! Create, default, non-const +function ReactionDefault() & + bind(C, name='ReactionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionDefault +end function ReactionDefault + +!! Create, general, const +function ReactionCreateConst( & + label, & + ENDF_MT, & + fissionGenre, & + crossSection, & + outputChannel, & + doubleDifferentialCrossSection, & + labelSize, & + fissionGenreSize & +) & + bind(C, name='ReactionCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + integer(c_size_t), intent(in), value :: fissionGenreSize + character(c_char), intent(in) :: fissionGenre(fissionGenreSize) + type(c_ptr), intent(in), value :: crossSection + type(c_ptr), intent(in), value :: outputChannel + type(c_ptr), intent(in), value :: doubleDifferentialCrossSection + type(c_ptr) :: ReactionCreateConst +end function ReactionCreateConst + +!! Create, general, non-const +function ReactionCreate( & + label, & + ENDF_MT, & + fissionGenre, & + crossSection, & + outputChannel, & + doubleDifferentialCrossSection, & + labelSize, & + fissionGenreSize & +) & + bind(C, name='ReactionCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: ENDF_MT + integer(c_size_t), intent(in), value :: fissionGenreSize + character(c_char), intent(in) :: fissionGenre(fissionGenreSize) + type(c_ptr), intent(in), value :: crossSection + type(c_ptr), intent(in), value :: outputChannel + type(c_ptr), intent(in), value :: doubleDifferentialCrossSection + type(c_ptr) :: ReactionCreate +end function ReactionCreate + +!! Assign +subroutine ReactionAssign(handleLHS, handleRHS) & + bind(C, name='ReactionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ReactionAssign + +!! Delete +subroutine ReactionDelete(handle) & + bind(C, name='ReactionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ReactionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ReactionRead(handle, filename, filenameSize) & + bind(C, name='ReactionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionRead +end function ReactionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ReactionWrite(handle, filename, filenameSize) & + bind(C, name='ReactionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionWrite +end function ReactionWrite + +!! Print to standard output, in our prettyprinting format +function ReactionPrint(handle) & + bind(C, name='ReactionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionPrint +end function ReactionPrint + +!! Print to standard output, as XML +function ReactionPrintXML(handle) & + bind(C, name='ReactionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionPrintXML +end function ReactionPrintXML + +!! Print to standard output, as JSON +function ReactionPrintJSON(handle) & + bind(C, name='ReactionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionPrintJSON +end function ReactionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionLabelHas(handle) & + bind(C, name='ReactionLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionLabelHas +end function ReactionLabelHas + +!! Get +function ReactionLabelGet(handle) & + bind(C, name='ReactionLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionLabelGet +end function ReactionLabelGet + +!! Set +subroutine ReactionLabelSet(handle, label, labelSize) & + bind(C, name='ReactionLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ReactionLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: ENDF_MT +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionENDFMTHas(handle) & + bind(C, name='ReactionENDFMTHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionENDFMTHas +end function ReactionENDFMTHas + +!! Get +function ReactionENDFMTGet(handle) & + bind(C, name='ReactionENDFMTGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionENDFMTGet +end function ReactionENDFMTGet + +!! Set +subroutine ReactionENDFMTSet(handle, ENDF_MT) & + bind(C, name='ReactionENDFMTSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: ENDF_MT +end subroutine ReactionENDFMTSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: fissionGenre +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionFissionGenreHas(handle) & + bind(C, name='ReactionFissionGenreHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionFissionGenreHas +end function ReactionFissionGenreHas + +!! Get +function ReactionFissionGenreGet(handle) & + bind(C, name='ReactionFissionGenreGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionFissionGenreGet +end function ReactionFissionGenreGet + +!! Set +subroutine ReactionFissionGenreSet(handle, fissionGenre, fissionGenreSize) & + bind(C, name='ReactionFissionGenreSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: fissionGenreSize + character(c_char), intent(in) :: fissionGenre(fissionGenreSize) +end subroutine ReactionFissionGenreSet + + +!! ----------------------------------------------------------------------------- +!! Child: crossSection +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionCrossSectionHas(handle) & + bind(C, name='ReactionCrossSectionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionCrossSectionHas +end function ReactionCrossSectionHas + +!! Get, const +function ReactionCrossSectionGetConst(handle) & + bind(C, name='ReactionCrossSectionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionCrossSectionGetConst +end function ReactionCrossSectionGetConst + +!! Get, non-const +function ReactionCrossSectionGet(handle) & + bind(C, name='ReactionCrossSectionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionCrossSectionGet +end function ReactionCrossSectionGet + +!! Set +subroutine ReactionCrossSectionSet(handle, fieldHandle) & + bind(C, name='ReactionCrossSectionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionCrossSectionSet + + +!! ----------------------------------------------------------------------------- +!! Child: outputChannel +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionOutputChannelHas(handle) & + bind(C, name='ReactionOutputChannelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionOutputChannelHas +end function ReactionOutputChannelHas + +!! Get, const +function ReactionOutputChannelGetConst(handle) & + bind(C, name='ReactionOutputChannelGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionOutputChannelGetConst +end function ReactionOutputChannelGetConst + +!! Get, non-const +function ReactionOutputChannelGet(handle) & + bind(C, name='ReactionOutputChannelGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionOutputChannelGet +end function ReactionOutputChannelGet + +!! Set +subroutine ReactionOutputChannelSet(handle, fieldHandle) & + bind(C, name='ReactionOutputChannelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionOutputChannelSet + + +!! ----------------------------------------------------------------------------- +!! Child: doubleDifferentialCrossSection +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionDoubleDifferentialCrossSectionHas(handle) & + bind(C, name='ReactionDoubleDifferentialCrossSectionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionDoubleDifferentialCrossSectionHas +end function ReactionDoubleDifferentialCrossSectionHas + +!! Get, const +function ReactionDoubleDifferentialCrossSectionGetConst(handle) & + bind(C, name='ReactionDoubleDifferentialCrossSectionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionDoubleDifferentialCrossSectionGetConst +end function ReactionDoubleDifferentialCrossSectionGetConst + +!! Get, non-const +function ReactionDoubleDifferentialCrossSectionGet(handle) & + bind(C, name='ReactionDoubleDifferentialCrossSectionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionDoubleDifferentialCrossSectionGet +end function ReactionDoubleDifferentialCrossSectionGet + +!! Set +subroutine ReactionDoubleDifferentialCrossSectionSet(handle, fieldHandle) & + bind(C, name='ReactionDoubleDifferentialCrossSectionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionDoubleDifferentialCrossSectionSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalReaction diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Reactions.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Reactions.f03 new file mode 100644 index 000000000..125d28bb1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Reactions.f03 @@ -0,0 +1,347 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalReactions +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ReactionsDefaultConst() & + bind(C, name='ReactionsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionsDefaultConst +end function ReactionsDefaultConst + +!! Create, default, non-const +function ReactionsDefault() & + bind(C, name='ReactionsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionsDefault +end function ReactionsDefault + +!! Create, general, const +function ReactionsCreateConst( & + reaction, reactionSize & +) & + bind(C, name='ReactionsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: reactionSize + type(c_ptr), intent(in) :: reaction(reactionSize) + type(c_ptr) :: ReactionsCreateConst +end function ReactionsCreateConst + +!! Create, general, non-const +function ReactionsCreate( & + reaction, reactionSize & +) & + bind(C, name='ReactionsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: reactionSize + type(c_ptr), intent(in) :: reaction(reactionSize) + type(c_ptr) :: ReactionsCreate +end function ReactionsCreate + +!! Assign +subroutine ReactionsAssign(handleLHS, handleRHS) & + bind(C, name='ReactionsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ReactionsAssign + +!! Delete +subroutine ReactionsDelete(handle) & + bind(C, name='ReactionsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ReactionsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ReactionsRead(handle, filename, filenameSize) & + bind(C, name='ReactionsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionsRead +end function ReactionsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ReactionsWrite(handle, filename, filenameSize) & + bind(C, name='ReactionsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionsWrite +end function ReactionsWrite + +!! Print to standard output, in our prettyprinting format +function ReactionsPrint(handle) & + bind(C, name='ReactionsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionsPrint +end function ReactionsPrint + +!! Print to standard output, as XML +function ReactionsPrintXML(handle) & + bind(C, name='ReactionsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionsPrintXML +end function ReactionsPrintXML + +!! Print to standard output, as JSON +function ReactionsPrintJSON(handle) & + bind(C, name='ReactionsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionsPrintJSON +end function ReactionsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: reaction +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionsReactionHas(handle) & + bind(C, name='ReactionsReactionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionsReactionHas +end function ReactionsReactionHas + +!! Clear +subroutine ReactionsReactionClear(handle) & + bind(C, name='ReactionsReactionClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ReactionsReactionClear + +!! Size +function ReactionsReactionSize(handle) & + bind(C, name='ReactionsReactionSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ReactionsReactionSize +end function ReactionsReactionSize + +!! Add +subroutine ReactionsReactionAdd(handle, fieldHandle) & + bind(C, name='ReactionsReactionAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionsReactionAdd + +!! Get, by index \in [0,size), const +function ReactionsReactionGetConst(handle, index) & + bind(C, name='ReactionsReactionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ReactionsReactionGetConst +end function ReactionsReactionGetConst + +!! Get, by index \in [0,size), non-const +function ReactionsReactionGet(handle, index) & + bind(C, name='ReactionsReactionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ReactionsReactionGet +end function ReactionsReactionGet + +!! Set, by index \in [0,size) +subroutine ReactionsReactionSet(handle, index, fieldHandle) & + bind(C, name='ReactionsReactionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionsReactionSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ReactionsReactionHasByLabel(handle, meta, metaSize) & + bind(C, name='ReactionsReactionHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ReactionsReactionHasByLabel +end function ReactionsReactionHasByLabel + +!! Get, by label, const +function ReactionsReactionGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ReactionsReactionGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ReactionsReactionGetByLabelConst +end function ReactionsReactionGetByLabelConst + +!! Get, by label, non-const +function ReactionsReactionGetByLabel(handle, meta, metaSize) & + bind(C, name='ReactionsReactionGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ReactionsReactionGetByLabel +end function ReactionsReactionGetByLabel + +!! Set, by label +subroutine ReactionsReactionSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ReactionsReactionSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionsReactionSetByLabel + +!! ------------------------ +!! Re: metadatum ENDF_MT +!! ------------------------ + +!! Has, by ENDF_MT +function ReactionsReactionHasByENDFMT(handle, meta) & + bind(C, name='ReactionsReactionHasByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: ReactionsReactionHasByENDFMT +end function ReactionsReactionHasByENDFMT + +!! Get, by ENDF_MT, const +function ReactionsReactionGetByENDFMTConst(handle, meta) & + bind(C, name='ReactionsReactionGetByENDFMTConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ReactionsReactionGetByENDFMTConst +end function ReactionsReactionGetByENDFMTConst + +!! Get, by ENDF_MT, non-const +function ReactionsReactionGetByENDFMT(handle, meta) & + bind(C, name='ReactionsReactionGetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ReactionsReactionGetByENDFMT +end function ReactionsReactionGetByENDFMT + +!! Set, by ENDF_MT +subroutine ReactionsReactionSetByENDFMT(handle, meta, fieldHandle) & + bind(C, name='ReactionsReactionSetByENDFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionsReactionSetByENDFMT + +!! ------------------------ +!! Re: metadatum fissionGenre +!! ------------------------ + +!! Has, by fissionGenre +function ReactionsReactionHasByFissionGenre(handle, meta, metaSize) & + bind(C, name='ReactionsReactionHasByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ReactionsReactionHasByFissionGenre +end function ReactionsReactionHasByFissionGenre + +!! Get, by fissionGenre, const +function ReactionsReactionGetByFissionGenreConst(handle, meta, metaSize) & + bind(C, name='ReactionsReactionGetByFissionGenreConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ReactionsReactionGetByFissionGenreConst +end function ReactionsReactionGetByFissionGenreConst + +!! Get, by fissionGenre, non-const +function ReactionsReactionGetByFissionGenre(handle, meta, metaSize) & + bind(C, name='ReactionsReactionGetByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ReactionsReactionGetByFissionGenre +end function ReactionsReactionGetByFissionGenre + +!! Set, by fissionGenre +subroutine ReactionsReactionSetByFissionGenre(handle, meta, metaSize, fieldHandle) & + bind(C, name='ReactionsReactionSetByFissionGenre') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionsReactionSetByFissionGenre + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalReactions diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RealAnomalousFactor.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RealAnomalousFactor.f03 new file mode 100644 index 000000000..74eff6950 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RealAnomalousFactor.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalRealAnomalousFactor +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function RealAnomalousFactorDefaultConst() & + bind(C, name='RealAnomalousFactorDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: RealAnomalousFactorDefaultConst +end function RealAnomalousFactorDefaultConst + +!! Create, default, non-const +function RealAnomalousFactorDefault() & + bind(C, name='RealAnomalousFactorDefault') + use iso_c_binding + implicit none + type(c_ptr) :: RealAnomalousFactorDefault +end function RealAnomalousFactorDefault + +!! Create, general, const +function RealAnomalousFactorCreateConst( & + XYs1d & +) & + bind(C, name='RealAnomalousFactorCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: RealAnomalousFactorCreateConst +end function RealAnomalousFactorCreateConst + +!! Create, general, non-const +function RealAnomalousFactorCreate( & + XYs1d & +) & + bind(C, name='RealAnomalousFactorCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: RealAnomalousFactorCreate +end function RealAnomalousFactorCreate + +!! Assign +subroutine RealAnomalousFactorAssign(handleLHS, handleRHS) & + bind(C, name='RealAnomalousFactorAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine RealAnomalousFactorAssign + +!! Delete +subroutine RealAnomalousFactorDelete(handle) & + bind(C, name='RealAnomalousFactorDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine RealAnomalousFactorDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function RealAnomalousFactorRead(handle, filename, filenameSize) & + bind(C, name='RealAnomalousFactorRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RealAnomalousFactorRead +end function RealAnomalousFactorRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function RealAnomalousFactorWrite(handle, filename, filenameSize) & + bind(C, name='RealAnomalousFactorWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RealAnomalousFactorWrite +end function RealAnomalousFactorWrite + +!! Print to standard output, in our prettyprinting format +function RealAnomalousFactorPrint(handle) & + bind(C, name='RealAnomalousFactorPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RealAnomalousFactorPrint +end function RealAnomalousFactorPrint + +!! Print to standard output, as XML +function RealAnomalousFactorPrintXML(handle) & + bind(C, name='RealAnomalousFactorPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RealAnomalousFactorPrintXML +end function RealAnomalousFactorPrintXML + +!! Print to standard output, as JSON +function RealAnomalousFactorPrintJSON(handle) & + bind(C, name='RealAnomalousFactorPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RealAnomalousFactorPrintJSON +end function RealAnomalousFactorPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function RealAnomalousFactorXYs1dHas(handle) & + bind(C, name='RealAnomalousFactorXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RealAnomalousFactorXYs1dHas +end function RealAnomalousFactorXYs1dHas + +!! Get, const +function RealAnomalousFactorXYs1dGetConst(handle) & + bind(C, name='RealAnomalousFactorXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RealAnomalousFactorXYs1dGetConst +end function RealAnomalousFactorXYs1dGetConst + +!! Get, non-const +function RealAnomalousFactorXYs1dGet(handle) & + bind(C, name='RealAnomalousFactorXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: RealAnomalousFactorXYs1dGet +end function RealAnomalousFactorXYs1dGet + +!! Set +subroutine RealAnomalousFactorXYs1dSet(handle, fieldHandle) & + bind(C, name='RealAnomalousFactorXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine RealAnomalousFactorXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalRealAnomalousFactor diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RealInterferenceTerm.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RealInterferenceTerm.f03 new file mode 100644 index 000000000..17f05d3af --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RealInterferenceTerm.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalRealInterferenceTerm +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function RealInterferenceTermDefaultConst() & + bind(C, name='RealInterferenceTermDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: RealInterferenceTermDefaultConst +end function RealInterferenceTermDefaultConst + +!! Create, default, non-const +function RealInterferenceTermDefault() & + bind(C, name='RealInterferenceTermDefault') + use iso_c_binding + implicit none + type(c_ptr) :: RealInterferenceTermDefault +end function RealInterferenceTermDefault + +!! Create, general, const +function RealInterferenceTermCreateConst( & + regions2d, & + XYs2d & +) & + bind(C, name='RealInterferenceTermCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: regions2d + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: RealInterferenceTermCreateConst +end function RealInterferenceTermCreateConst + +!! Create, general, non-const +function RealInterferenceTermCreate( & + regions2d, & + XYs2d & +) & + bind(C, name='RealInterferenceTermCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: regions2d + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr) :: RealInterferenceTermCreate +end function RealInterferenceTermCreate + +!! Assign +subroutine RealInterferenceTermAssign(handleLHS, handleRHS) & + bind(C, name='RealInterferenceTermAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine RealInterferenceTermAssign + +!! Delete +subroutine RealInterferenceTermDelete(handle) & + bind(C, name='RealInterferenceTermDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine RealInterferenceTermDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function RealInterferenceTermRead(handle, filename, filenameSize) & + bind(C, name='RealInterferenceTermRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RealInterferenceTermRead +end function RealInterferenceTermRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function RealInterferenceTermWrite(handle, filename, filenameSize) & + bind(C, name='RealInterferenceTermWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RealInterferenceTermWrite +end function RealInterferenceTermWrite + +!! Print to standard output, in our prettyprinting format +function RealInterferenceTermPrint(handle) & + bind(C, name='RealInterferenceTermPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RealInterferenceTermPrint +end function RealInterferenceTermPrint + +!! Print to standard output, as XML +function RealInterferenceTermPrintXML(handle) & + bind(C, name='RealInterferenceTermPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RealInterferenceTermPrintXML +end function RealInterferenceTermPrintXML + +!! Print to standard output, as JSON +function RealInterferenceTermPrintJSON(handle) & + bind(C, name='RealInterferenceTermPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RealInterferenceTermPrintJSON +end function RealInterferenceTermPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: regions2d +!! ----------------------------------------------------------------------------- + +!! Has +function RealInterferenceTermRegions2dHas(handle) & + bind(C, name='RealInterferenceTermRegions2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RealInterferenceTermRegions2dHas +end function RealInterferenceTermRegions2dHas + +!! Get, const +function RealInterferenceTermRegions2dGetConst(handle) & + bind(C, name='RealInterferenceTermRegions2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RealInterferenceTermRegions2dGetConst +end function RealInterferenceTermRegions2dGetConst + +!! Get, non-const +function RealInterferenceTermRegions2dGet(handle) & + bind(C, name='RealInterferenceTermRegions2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: RealInterferenceTermRegions2dGet +end function RealInterferenceTermRegions2dGet + +!! Set +subroutine RealInterferenceTermRegions2dSet(handle, fieldHandle) & + bind(C, name='RealInterferenceTermRegions2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine RealInterferenceTermRegions2dSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs2d +!! ----------------------------------------------------------------------------- + +!! Has +function RealInterferenceTermXYs2dHas(handle) & + bind(C, name='RealInterferenceTermXYs2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RealInterferenceTermXYs2dHas +end function RealInterferenceTermXYs2dHas + +!! Get, const +function RealInterferenceTermXYs2dGetConst(handle) & + bind(C, name='RealInterferenceTermXYs2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RealInterferenceTermXYs2dGetConst +end function RealInterferenceTermXYs2dGetConst + +!! Get, non-const +function RealInterferenceTermXYs2dGet(handle) & + bind(C, name='RealInterferenceTermXYs2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: RealInterferenceTermXYs2dGet +end function RealInterferenceTermXYs2dGet + +!! Set +subroutine RealInterferenceTermXYs2dSet(handle, fieldHandle) & + bind(C, name='RealInterferenceTermXYs2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine RealInterferenceTermXYs2dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalRealInterferenceTerm diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Recoil.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Recoil.f03 new file mode 100644 index 000000000..1be683852 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Recoil.f03 @@ -0,0 +1,172 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalRecoil +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function RecoilDefaultConst() & + bind(C, name='RecoilDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: RecoilDefaultConst +end function RecoilDefaultConst + +!! Create, default, non-const +function RecoilDefault() & + bind(C, name='RecoilDefault') + use iso_c_binding + implicit none + type(c_ptr) :: RecoilDefault +end function RecoilDefault + +!! Create, general, const +function RecoilCreateConst( & + href, & + hrefSize & +) & + bind(C, name='RecoilCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: RecoilCreateConst +end function RecoilCreateConst + +!! Create, general, non-const +function RecoilCreate( & + href, & + hrefSize & +) & + bind(C, name='RecoilCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: RecoilCreate +end function RecoilCreate + +!! Assign +subroutine RecoilAssign(handleLHS, handleRHS) & + bind(C, name='RecoilAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine RecoilAssign + +!! Delete +subroutine RecoilDelete(handle) & + bind(C, name='RecoilDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine RecoilDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function RecoilRead(handle, filename, filenameSize) & + bind(C, name='RecoilRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RecoilRead +end function RecoilRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function RecoilWrite(handle, filename, filenameSize) & + bind(C, name='RecoilWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RecoilWrite +end function RecoilWrite + +!! Print to standard output, in our prettyprinting format +function RecoilPrint(handle) & + bind(C, name='RecoilPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RecoilPrint +end function RecoilPrint + +!! Print to standard output, as XML +function RecoilPrintXML(handle) & + bind(C, name='RecoilPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RecoilPrintXML +end function RecoilPrintXML + +!! Print to standard output, as JSON +function RecoilPrintJSON(handle) & + bind(C, name='RecoilPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RecoilPrintJSON +end function RecoilPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function RecoilHrefHas(handle) & + bind(C, name='RecoilHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RecoilHrefHas +end function RecoilHrefHas + +!! Get +function RecoilHrefGet(handle) & + bind(C, name='RecoilHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RecoilHrefGet +end function RecoilHrefGet + +!! Set +subroutine RecoilHrefSet(handle, href, hrefSize) & + bind(C, name='RecoilHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine RecoilHrefSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalRecoil diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Reference.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Reference.f03 new file mode 100644 index 000000000..b474be751 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Reference.f03 @@ -0,0 +1,213 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalReference +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ReferenceDefaultConst() & + bind(C, name='ReferenceDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ReferenceDefaultConst +end function ReferenceDefaultConst + +!! Create, default, non-const +function ReferenceDefault() & + bind(C, name='ReferenceDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ReferenceDefault +end function ReferenceDefault + +!! Create, general, const +function ReferenceCreateConst( & + label, & + href, & + labelSize, & + hrefSize & +) & + bind(C, name='ReferenceCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: ReferenceCreateConst +end function ReferenceCreateConst + +!! Create, general, non-const +function ReferenceCreate( & + label, & + href, & + labelSize, & + hrefSize & +) & + bind(C, name='ReferenceCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: ReferenceCreate +end function ReferenceCreate + +!! Assign +subroutine ReferenceAssign(handleLHS, handleRHS) & + bind(C, name='ReferenceAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ReferenceAssign + +!! Delete +subroutine ReferenceDelete(handle) & + bind(C, name='ReferenceDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ReferenceDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ReferenceRead(handle, filename, filenameSize) & + bind(C, name='ReferenceRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReferenceRead +end function ReferenceRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ReferenceWrite(handle, filename, filenameSize) & + bind(C, name='ReferenceWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReferenceWrite +end function ReferenceWrite + +!! Print to standard output, in our prettyprinting format +function ReferencePrint(handle) & + bind(C, name='ReferencePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReferencePrint +end function ReferencePrint + +!! Print to standard output, as XML +function ReferencePrintXML(handle) & + bind(C, name='ReferencePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReferencePrintXML +end function ReferencePrintXML + +!! Print to standard output, as JSON +function ReferencePrintJSON(handle) & + bind(C, name='ReferencePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReferencePrintJSON +end function ReferencePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ReferenceLabelHas(handle) & + bind(C, name='ReferenceLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReferenceLabelHas +end function ReferenceLabelHas + +!! Get +function ReferenceLabelGet(handle) & + bind(C, name='ReferenceLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReferenceLabelGet +end function ReferenceLabelGet + +!! Set +subroutine ReferenceLabelSet(handle, label, labelSize) & + bind(C, name='ReferenceLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ReferenceLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function ReferenceHrefHas(handle) & + bind(C, name='ReferenceHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReferenceHrefHas +end function ReferenceHrefHas + +!! Get +function ReferenceHrefGet(handle) & + bind(C, name='ReferenceHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReferenceHrefGet +end function ReferenceHrefGet + +!! Set +subroutine ReferenceHrefSet(handle, href, hrefSize) & + bind(C, name='ReferenceHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine ReferenceHrefSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalReference diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Regions1d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Regions1d.f03 new file mode 100644 index 000000000..4decdca42 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Regions1d.f03 @@ -0,0 +1,343 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalRegions1d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Regions1dDefaultConst() & + bind(C, name='Regions1dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Regions1dDefaultConst +end function Regions1dDefaultConst + +!! Create, default, non-const +function Regions1dDefault() & + bind(C, name='Regions1dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Regions1dDefault +end function Regions1dDefault + +!! Create, general, const +function Regions1dCreateConst( & + label, & + outerDomainValue, & + axes, & + uncertainty, & + function1ds, & + labelSize & +) & + bind(C, name='Regions1dCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: outerDomainValue + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr), intent(in), value :: function1ds + type(c_ptr) :: Regions1dCreateConst +end function Regions1dCreateConst + +!! Create, general, non-const +function Regions1dCreate( & + label, & + outerDomainValue, & + axes, & + uncertainty, & + function1ds, & + labelSize & +) & + bind(C, name='Regions1dCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: outerDomainValue + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr), intent(in), value :: function1ds + type(c_ptr) :: Regions1dCreate +end function Regions1dCreate + +!! Assign +subroutine Regions1dAssign(handleLHS, handleRHS) & + bind(C, name='Regions1dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Regions1dAssign + +!! Delete +subroutine Regions1dDelete(handle) & + bind(C, name='Regions1dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Regions1dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Regions1dRead(handle, filename, filenameSize) & + bind(C, name='Regions1dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Regions1dRead +end function Regions1dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Regions1dWrite(handle, filename, filenameSize) & + bind(C, name='Regions1dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Regions1dWrite +end function Regions1dWrite + +!! Print to standard output, in our prettyprinting format +function Regions1dPrint(handle) & + bind(C, name='Regions1dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dPrint +end function Regions1dPrint + +!! Print to standard output, as XML +function Regions1dPrintXML(handle) & + bind(C, name='Regions1dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dPrintXML +end function Regions1dPrintXML + +!! Print to standard output, as JSON +function Regions1dPrintJSON(handle) & + bind(C, name='Regions1dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dPrintJSON +end function Regions1dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function Regions1dLabelHas(handle) & + bind(C, name='Regions1dLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dLabelHas +end function Regions1dLabelHas + +!! Get +function Regions1dLabelGet(handle) & + bind(C, name='Regions1dLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Regions1dLabelGet +end function Regions1dLabelGet + +!! Set +subroutine Regions1dLabelSet(handle, label, labelSize) & + bind(C, name='Regions1dLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine Regions1dLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: outerDomainValue +!! ----------------------------------------------------------------------------- + +!! Has +function Regions1dOuterDomainValueHas(handle) & + bind(C, name='Regions1dOuterDomainValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dOuterDomainValueHas +end function Regions1dOuterDomainValueHas + +!! Get +function Regions1dOuterDomainValueGet(handle) & + bind(C, name='Regions1dOuterDomainValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: Regions1dOuterDomainValueGet +end function Regions1dOuterDomainValueGet + +!! Set +subroutine Regions1dOuterDomainValueSet(handle, outerDomainValue) & + bind(C, name='Regions1dOuterDomainValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: outerDomainValue +end subroutine Regions1dOuterDomainValueSet + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function Regions1dAxesHas(handle) & + bind(C, name='Regions1dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dAxesHas +end function Regions1dAxesHas + +!! Get, const +function Regions1dAxesGetConst(handle) & + bind(C, name='Regions1dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Regions1dAxesGetConst +end function Regions1dAxesGetConst + +!! Get, non-const +function Regions1dAxesGet(handle) & + bind(C, name='Regions1dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Regions1dAxesGet +end function Regions1dAxesGet + +!! Set +subroutine Regions1dAxesSet(handle, fieldHandle) & + bind(C, name='Regions1dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions1dAxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function Regions1dUncertaintyHas(handle) & + bind(C, name='Regions1dUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dUncertaintyHas +end function Regions1dUncertaintyHas + +!! Get, const +function Regions1dUncertaintyGetConst(handle) & + bind(C, name='Regions1dUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Regions1dUncertaintyGetConst +end function Regions1dUncertaintyGetConst + +!! Get, non-const +function Regions1dUncertaintyGet(handle) & + bind(C, name='Regions1dUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Regions1dUncertaintyGet +end function Regions1dUncertaintyGet + +!! Set +subroutine Regions1dUncertaintySet(handle, fieldHandle) & + bind(C, name='Regions1dUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions1dUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! Child: function1ds +!! ----------------------------------------------------------------------------- + +!! Has +function Regions1dFunction1dsHas(handle) & + bind(C, name='Regions1dFunction1dsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions1dFunction1dsHas +end function Regions1dFunction1dsHas + +!! Get, const +function Regions1dFunction1dsGetConst(handle) & + bind(C, name='Regions1dFunction1dsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Regions1dFunction1dsGetConst +end function Regions1dFunction1dsGetConst + +!! Get, non-const +function Regions1dFunction1dsGet(handle) & + bind(C, name='Regions1dFunction1dsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Regions1dFunction1dsGet +end function Regions1dFunction1dsGet + +!! Set +subroutine Regions1dFunction1dsSet(handle, fieldHandle) & + bind(C, name='Regions1dFunction1dsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions1dFunction1dsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalRegions1d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Regions2d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Regions2d.f03 new file mode 100644 index 000000000..1290880b2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Regions2d.f03 @@ -0,0 +1,266 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalRegions2d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Regions2dDefaultConst() & + bind(C, name='Regions2dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Regions2dDefaultConst +end function Regions2dDefaultConst + +!! Create, default, non-const +function Regions2dDefault() & + bind(C, name='Regions2dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Regions2dDefault +end function Regions2dDefault + +!! Create, general, const +function Regions2dCreateConst( & + axes, & + function2ds, & + uncertainty & +) & + bind(C, name='Regions2dCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: function2ds + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: Regions2dCreateConst +end function Regions2dCreateConst + +!! Create, general, non-const +function Regions2dCreate( & + axes, & + function2ds, & + uncertainty & +) & + bind(C, name='Regions2dCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: function2ds + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: Regions2dCreate +end function Regions2dCreate + +!! Assign +subroutine Regions2dAssign(handleLHS, handleRHS) & + bind(C, name='Regions2dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Regions2dAssign + +!! Delete +subroutine Regions2dDelete(handle) & + bind(C, name='Regions2dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Regions2dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Regions2dRead(handle, filename, filenameSize) & + bind(C, name='Regions2dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Regions2dRead +end function Regions2dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Regions2dWrite(handle, filename, filenameSize) & + bind(C, name='Regions2dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Regions2dWrite +end function Regions2dWrite + +!! Print to standard output, in our prettyprinting format +function Regions2dPrint(handle) & + bind(C, name='Regions2dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions2dPrint +end function Regions2dPrint + +!! Print to standard output, as XML +function Regions2dPrintXML(handle) & + bind(C, name='Regions2dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions2dPrintXML +end function Regions2dPrintXML + +!! Print to standard output, as JSON +function Regions2dPrintJSON(handle) & + bind(C, name='Regions2dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions2dPrintJSON +end function Regions2dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function Regions2dAxesHas(handle) & + bind(C, name='Regions2dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions2dAxesHas +end function Regions2dAxesHas + +!! Get, const +function Regions2dAxesGetConst(handle) & + bind(C, name='Regions2dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Regions2dAxesGetConst +end function Regions2dAxesGetConst + +!! Get, non-const +function Regions2dAxesGet(handle) & + bind(C, name='Regions2dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Regions2dAxesGet +end function Regions2dAxesGet + +!! Set +subroutine Regions2dAxesSet(handle, fieldHandle) & + bind(C, name='Regions2dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions2dAxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: function2ds +!! ----------------------------------------------------------------------------- + +!! Has +function Regions2dFunction2dsHas(handle) & + bind(C, name='Regions2dFunction2dsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions2dFunction2dsHas +end function Regions2dFunction2dsHas + +!! Get, const +function Regions2dFunction2dsGetConst(handle) & + bind(C, name='Regions2dFunction2dsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Regions2dFunction2dsGetConst +end function Regions2dFunction2dsGetConst + +!! Get, non-const +function Regions2dFunction2dsGet(handle) & + bind(C, name='Regions2dFunction2dsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Regions2dFunction2dsGet +end function Regions2dFunction2dsGet + +!! Set +subroutine Regions2dFunction2dsSet(handle, fieldHandle) & + bind(C, name='Regions2dFunction2dsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions2dFunction2dsSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function Regions2dUncertaintyHas(handle) & + bind(C, name='Regions2dUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Regions2dUncertaintyHas +end function Regions2dUncertaintyHas + +!! Get, const +function Regions2dUncertaintyGetConst(handle) & + bind(C, name='Regions2dUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Regions2dUncertaintyGetConst +end function Regions2dUncertaintyGetConst + +!! Get, non-const +function Regions2dUncertaintyGet(handle) & + bind(C, name='Regions2dUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Regions2dUncertaintyGet +end function Regions2dUncertaintyGet + +!! Set +subroutine Regions2dUncertaintySet(handle, fieldHandle) & + bind(C, name='Regions2dUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Regions2dUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalRegions2d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Resolved.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Resolved.f03 new file mode 100644 index 000000000..45ab4b708 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Resolved.f03 @@ -0,0 +1,334 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalResolved +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ResolvedDefaultConst() & + bind(C, name='ResolvedDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ResolvedDefaultConst +end function ResolvedDefaultConst + +!! Create, default, non-const +function ResolvedDefault() & + bind(C, name='ResolvedDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ResolvedDefault +end function ResolvedDefault + +!! Create, general, const +function ResolvedCreateConst( & + domainMin, & + domainMax, & + domainUnit, & + BreitWigner, & + RMatrix, & + domainUnitSize & +) & + bind(C, name='ResolvedCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) + type(c_ptr), intent(in), value :: BreitWigner + type(c_ptr), intent(in), value :: RMatrix + type(c_ptr) :: ResolvedCreateConst +end function ResolvedCreateConst + +!! Create, general, non-const +function ResolvedCreate( & + domainMin, & + domainMax, & + domainUnit, & + BreitWigner, & + RMatrix, & + domainUnitSize & +) & + bind(C, name='ResolvedCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) + type(c_ptr), intent(in), value :: BreitWigner + type(c_ptr), intent(in), value :: RMatrix + type(c_ptr) :: ResolvedCreate +end function ResolvedCreate + +!! Assign +subroutine ResolvedAssign(handleLHS, handleRHS) & + bind(C, name='ResolvedAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ResolvedAssign + +!! Delete +subroutine ResolvedDelete(handle) & + bind(C, name='ResolvedDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ResolvedDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ResolvedRead(handle, filename, filenameSize) & + bind(C, name='ResolvedRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResolvedRead +end function ResolvedRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ResolvedWrite(handle, filename, filenameSize) & + bind(C, name='ResolvedWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResolvedWrite +end function ResolvedWrite + +!! Print to standard output, in our prettyprinting format +function ResolvedPrint(handle) & + bind(C, name='ResolvedPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedPrint +end function ResolvedPrint + +!! Print to standard output, as XML +function ResolvedPrintXML(handle) & + bind(C, name='ResolvedPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedPrintXML +end function ResolvedPrintXML + +!! Print to standard output, as JSON +function ResolvedPrintJSON(handle) & + bind(C, name='ResolvedPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedPrintJSON +end function ResolvedPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMin +!! ----------------------------------------------------------------------------- + +!! Has +function ResolvedDomainMinHas(handle) & + bind(C, name='ResolvedDomainMinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedDomainMinHas +end function ResolvedDomainMinHas + +!! Get +function ResolvedDomainMinGet(handle) & + bind(C, name='ResolvedDomainMinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: ResolvedDomainMinGet +end function ResolvedDomainMinGet + +!! Set +subroutine ResolvedDomainMinSet(handle, domainMin) & + bind(C, name='ResolvedDomainMinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMin +end subroutine ResolvedDomainMinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMax +!! ----------------------------------------------------------------------------- + +!! Has +function ResolvedDomainMaxHas(handle) & + bind(C, name='ResolvedDomainMaxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedDomainMaxHas +end function ResolvedDomainMaxHas + +!! Get +function ResolvedDomainMaxGet(handle) & + bind(C, name='ResolvedDomainMaxGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: ResolvedDomainMaxGet +end function ResolvedDomainMaxGet + +!! Set +subroutine ResolvedDomainMaxSet(handle, domainMax) & + bind(C, name='ResolvedDomainMaxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMax +end subroutine ResolvedDomainMaxSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainUnit +!! ----------------------------------------------------------------------------- + +!! Has +function ResolvedDomainUnitHas(handle) & + bind(C, name='ResolvedDomainUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedDomainUnitHas +end function ResolvedDomainUnitHas + +!! Get +function ResolvedDomainUnitGet(handle) & + bind(C, name='ResolvedDomainUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResolvedDomainUnitGet +end function ResolvedDomainUnitGet + +!! Set +subroutine ResolvedDomainUnitSet(handle, domainUnit, domainUnitSize) & + bind(C, name='ResolvedDomainUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) +end subroutine ResolvedDomainUnitSet + + +!! ----------------------------------------------------------------------------- +!! Child: BreitWigner +!! ----------------------------------------------------------------------------- + +!! Has +function ResolvedBreitWignerHas(handle) & + bind(C, name='ResolvedBreitWignerHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedBreitWignerHas +end function ResolvedBreitWignerHas + +!! Get, const +function ResolvedBreitWignerGetConst(handle) & + bind(C, name='ResolvedBreitWignerGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResolvedBreitWignerGetConst +end function ResolvedBreitWignerGetConst + +!! Get, non-const +function ResolvedBreitWignerGet(handle) & + bind(C, name='ResolvedBreitWignerGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResolvedBreitWignerGet +end function ResolvedBreitWignerGet + +!! Set +subroutine ResolvedBreitWignerSet(handle, fieldHandle) & + bind(C, name='ResolvedBreitWignerSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResolvedBreitWignerSet + + +!! ----------------------------------------------------------------------------- +!! Child: RMatrix +!! ----------------------------------------------------------------------------- + +!! Has +function ResolvedRMatrixHas(handle) & + bind(C, name='ResolvedRMatrixHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedRMatrixHas +end function ResolvedRMatrixHas + +!! Get, const +function ResolvedRMatrixGetConst(handle) & + bind(C, name='ResolvedRMatrixGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResolvedRMatrixGetConst +end function ResolvedRMatrixGetConst + +!! Get, non-const +function ResolvedRMatrixGet(handle) & + bind(C, name='ResolvedRMatrixGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResolvedRMatrixGet +end function ResolvedRMatrixGet + +!! Set +subroutine ResolvedRMatrixSet(handle, fieldHandle) & + bind(C, name='ResolvedRMatrixSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResolvedRMatrixSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalResolved diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResolvedRegion.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResolvedRegion.f03 new file mode 100644 index 000000000..5c3578b09 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResolvedRegion.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalResolvedRegion +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ResolvedRegionDefaultConst() & + bind(C, name='ResolvedRegionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ResolvedRegionDefaultConst +end function ResolvedRegionDefaultConst + +!! Create, default, non-const +function ResolvedRegionDefault() & + bind(C, name='ResolvedRegionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ResolvedRegionDefault +end function ResolvedRegionDefault + +!! Create, general, const +function ResolvedRegionCreateConst( & + XYs1d, & + regions1d & +) & + bind(C, name='ResolvedRegionCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr) :: ResolvedRegionCreateConst +end function ResolvedRegionCreateConst + +!! Create, general, non-const +function ResolvedRegionCreate( & + XYs1d, & + regions1d & +) & + bind(C, name='ResolvedRegionCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr) :: ResolvedRegionCreate +end function ResolvedRegionCreate + +!! Assign +subroutine ResolvedRegionAssign(handleLHS, handleRHS) & + bind(C, name='ResolvedRegionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ResolvedRegionAssign + +!! Delete +subroutine ResolvedRegionDelete(handle) & + bind(C, name='ResolvedRegionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ResolvedRegionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ResolvedRegionRead(handle, filename, filenameSize) & + bind(C, name='ResolvedRegionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResolvedRegionRead +end function ResolvedRegionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ResolvedRegionWrite(handle, filename, filenameSize) & + bind(C, name='ResolvedRegionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResolvedRegionWrite +end function ResolvedRegionWrite + +!! Print to standard output, in our prettyprinting format +function ResolvedRegionPrint(handle) & + bind(C, name='ResolvedRegionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedRegionPrint +end function ResolvedRegionPrint + +!! Print to standard output, as XML +function ResolvedRegionPrintXML(handle) & + bind(C, name='ResolvedRegionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedRegionPrintXML +end function ResolvedRegionPrintXML + +!! Print to standard output, as JSON +function ResolvedRegionPrintJSON(handle) & + bind(C, name='ResolvedRegionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedRegionPrintJSON +end function ResolvedRegionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function ResolvedRegionXYs1dHas(handle) & + bind(C, name='ResolvedRegionXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedRegionXYs1dHas +end function ResolvedRegionXYs1dHas + +!! Get, const +function ResolvedRegionXYs1dGetConst(handle) & + bind(C, name='ResolvedRegionXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResolvedRegionXYs1dGetConst +end function ResolvedRegionXYs1dGetConst + +!! Get, non-const +function ResolvedRegionXYs1dGet(handle) & + bind(C, name='ResolvedRegionXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResolvedRegionXYs1dGet +end function ResolvedRegionXYs1dGet + +!! Set +subroutine ResolvedRegionXYs1dSet(handle, fieldHandle) & + bind(C, name='ResolvedRegionXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResolvedRegionXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: regions1d +!! ----------------------------------------------------------------------------- + +!! Has +function ResolvedRegionRegions1dHas(handle) & + bind(C, name='ResolvedRegionRegions1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResolvedRegionRegions1dHas +end function ResolvedRegionRegions1dHas + +!! Get, const +function ResolvedRegionRegions1dGetConst(handle) & + bind(C, name='ResolvedRegionRegions1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResolvedRegionRegions1dGetConst +end function ResolvedRegionRegions1dGetConst + +!! Get, non-const +function ResolvedRegionRegions1dGet(handle) & + bind(C, name='ResolvedRegionRegions1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResolvedRegionRegions1dGet +end function ResolvedRegionRegions1dGet + +!! Set +subroutine ResolvedRegionRegions1dSet(handle, fieldHandle) & + bind(C, name='ResolvedRegionRegions1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResolvedRegionRegions1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalResolvedRegion diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonanceParameters.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonanceParameters.f03 new file mode 100644 index 000000000..10dd8d649 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonanceParameters.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalResonanceParameters +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ResonanceParametersDefaultConst() & + bind(C, name='ResonanceParametersDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ResonanceParametersDefaultConst +end function ResonanceParametersDefaultConst + +!! Create, default, non-const +function ResonanceParametersDefault() & + bind(C, name='ResonanceParametersDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ResonanceParametersDefault +end function ResonanceParametersDefault + +!! Create, general, const +function ResonanceParametersCreateConst( & + table & +) & + bind(C, name='ResonanceParametersCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: table + type(c_ptr) :: ResonanceParametersCreateConst +end function ResonanceParametersCreateConst + +!! Create, general, non-const +function ResonanceParametersCreate( & + table & +) & + bind(C, name='ResonanceParametersCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: table + type(c_ptr) :: ResonanceParametersCreate +end function ResonanceParametersCreate + +!! Assign +subroutine ResonanceParametersAssign(handleLHS, handleRHS) & + bind(C, name='ResonanceParametersAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ResonanceParametersAssign + +!! Delete +subroutine ResonanceParametersDelete(handle) & + bind(C, name='ResonanceParametersDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ResonanceParametersDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ResonanceParametersRead(handle, filename, filenameSize) & + bind(C, name='ResonanceParametersRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResonanceParametersRead +end function ResonanceParametersRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ResonanceParametersWrite(handle, filename, filenameSize) & + bind(C, name='ResonanceParametersWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResonanceParametersWrite +end function ResonanceParametersWrite + +!! Print to standard output, in our prettyprinting format +function ResonanceParametersPrint(handle) & + bind(C, name='ResonanceParametersPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceParametersPrint +end function ResonanceParametersPrint + +!! Print to standard output, as XML +function ResonanceParametersPrintXML(handle) & + bind(C, name='ResonanceParametersPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceParametersPrintXML +end function ResonanceParametersPrintXML + +!! Print to standard output, as JSON +function ResonanceParametersPrintJSON(handle) & + bind(C, name='ResonanceParametersPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceParametersPrintJSON +end function ResonanceParametersPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: table +!! ----------------------------------------------------------------------------- + +!! Has +function ResonanceParametersTableHas(handle) & + bind(C, name='ResonanceParametersTableHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceParametersTableHas +end function ResonanceParametersTableHas + +!! Get, const +function ResonanceParametersTableGetConst(handle) & + bind(C, name='ResonanceParametersTableGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonanceParametersTableGetConst +end function ResonanceParametersTableGetConst + +!! Get, non-const +function ResonanceParametersTableGet(handle) & + bind(C, name='ResonanceParametersTableGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResonanceParametersTableGet +end function ResonanceParametersTableGet + +!! Set +subroutine ResonanceParametersTableSet(handle, fieldHandle) & + bind(C, name='ResonanceParametersTableSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonanceParametersTableSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalResonanceParameters diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonanceReaction.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonanceReaction.f03 new file mode 100644 index 000000000..e221638e1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonanceReaction.f03 @@ -0,0 +1,429 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalResonanceReaction +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ResonanceReactionDefaultConst() & + bind(C, name='ResonanceReactionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ResonanceReactionDefaultConst +end function ResonanceReactionDefaultConst + +!! Create, default, non-const +function ResonanceReactionDefault() & + bind(C, name='ResonanceReactionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ResonanceReactionDefault +end function ResonanceReactionDefault + +!! Create, general, const +function ResonanceReactionCreateConst( & + label, & + ejectile, & + eliminated, & + link, & + hardSphereRadius, & + Q, & + scatteringRadius, & + labelSize, & + ejectileSize & +) & + bind(C, name='ResonanceReactionCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: ejectileSize + character(c_char), intent(in) :: ejectile(ejectileSize) + logical(c_bool), intent(in), value :: eliminated + type(c_ptr), intent(in), value :: link + type(c_ptr), intent(in), value :: hardSphereRadius + type(c_ptr), intent(in), value :: Q + type(c_ptr), intent(in), value :: scatteringRadius + type(c_ptr) :: ResonanceReactionCreateConst +end function ResonanceReactionCreateConst + +!! Create, general, non-const +function ResonanceReactionCreate( & + label, & + ejectile, & + eliminated, & + link, & + hardSphereRadius, & + Q, & + scatteringRadius, & + labelSize, & + ejectileSize & +) & + bind(C, name='ResonanceReactionCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: ejectileSize + character(c_char), intent(in) :: ejectile(ejectileSize) + logical(c_bool), intent(in), value :: eliminated + type(c_ptr), intent(in), value :: link + type(c_ptr), intent(in), value :: hardSphereRadius + type(c_ptr), intent(in), value :: Q + type(c_ptr), intent(in), value :: scatteringRadius + type(c_ptr) :: ResonanceReactionCreate +end function ResonanceReactionCreate + +!! Assign +subroutine ResonanceReactionAssign(handleLHS, handleRHS) & + bind(C, name='ResonanceReactionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ResonanceReactionAssign + +!! Delete +subroutine ResonanceReactionDelete(handle) & + bind(C, name='ResonanceReactionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ResonanceReactionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ResonanceReactionRead(handle, filename, filenameSize) & + bind(C, name='ResonanceReactionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResonanceReactionRead +end function ResonanceReactionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ResonanceReactionWrite(handle, filename, filenameSize) & + bind(C, name='ResonanceReactionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResonanceReactionWrite +end function ResonanceReactionWrite + +!! Print to standard output, in our prettyprinting format +function ResonanceReactionPrint(handle) & + bind(C, name='ResonanceReactionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionPrint +end function ResonanceReactionPrint + +!! Print to standard output, as XML +function ResonanceReactionPrintXML(handle) & + bind(C, name='ResonanceReactionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionPrintXML +end function ResonanceReactionPrintXML + +!! Print to standard output, as JSON +function ResonanceReactionPrintJSON(handle) & + bind(C, name='ResonanceReactionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionPrintJSON +end function ResonanceReactionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ResonanceReactionLabelHas(handle) & + bind(C, name='ResonanceReactionLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionLabelHas +end function ResonanceReactionLabelHas + +!! Get +function ResonanceReactionLabelGet(handle) & + bind(C, name='ResonanceReactionLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonanceReactionLabelGet +end function ResonanceReactionLabelGet + +!! Set +subroutine ResonanceReactionLabelSet(handle, label, labelSize) & + bind(C, name='ResonanceReactionLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ResonanceReactionLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: ejectile +!! ----------------------------------------------------------------------------- + +!! Has +function ResonanceReactionEjectileHas(handle) & + bind(C, name='ResonanceReactionEjectileHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionEjectileHas +end function ResonanceReactionEjectileHas + +!! Get +function ResonanceReactionEjectileGet(handle) & + bind(C, name='ResonanceReactionEjectileGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonanceReactionEjectileGet +end function ResonanceReactionEjectileGet + +!! Set +subroutine ResonanceReactionEjectileSet(handle, ejectile, ejectileSize) & + bind(C, name='ResonanceReactionEjectileSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: ejectileSize + character(c_char), intent(in) :: ejectile(ejectileSize) +end subroutine ResonanceReactionEjectileSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: eliminated +!! ----------------------------------------------------------------------------- + +!! Has +function ResonanceReactionEliminatedHas(handle) & + bind(C, name='ResonanceReactionEliminatedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionEliminatedHas +end function ResonanceReactionEliminatedHas + +!! Get +function ResonanceReactionEliminatedGet(handle) & + bind(C, name='ResonanceReactionEliminatedGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: ResonanceReactionEliminatedGet +end function ResonanceReactionEliminatedGet + +!! Set +subroutine ResonanceReactionEliminatedSet(handle, eliminated) & + bind(C, name='ResonanceReactionEliminatedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: eliminated +end subroutine ResonanceReactionEliminatedSet + + +!! ----------------------------------------------------------------------------- +!! Child: link +!! ----------------------------------------------------------------------------- + +!! Has +function ResonanceReactionLinkHas(handle) & + bind(C, name='ResonanceReactionLinkHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionLinkHas +end function ResonanceReactionLinkHas + +!! Get, const +function ResonanceReactionLinkGetConst(handle) & + bind(C, name='ResonanceReactionLinkGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonanceReactionLinkGetConst +end function ResonanceReactionLinkGetConst + +!! Get, non-const +function ResonanceReactionLinkGet(handle) & + bind(C, name='ResonanceReactionLinkGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResonanceReactionLinkGet +end function ResonanceReactionLinkGet + +!! Set +subroutine ResonanceReactionLinkSet(handle, fieldHandle) & + bind(C, name='ResonanceReactionLinkSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonanceReactionLinkSet + + +!! ----------------------------------------------------------------------------- +!! Child: hardSphereRadius +!! ----------------------------------------------------------------------------- + +!! Has +function ResonanceReactionHardSphereRadiusHas(handle) & + bind(C, name='ResonanceReactionHardSphereRadiusHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionHardSphereRadiusHas +end function ResonanceReactionHardSphereRadiusHas + +!! Get, const +function ResonanceReactionHardSphereRadiusGetConst(handle) & + bind(C, name='ResonanceReactionHardSphereRadiusGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonanceReactionHardSphereRadiusGetConst +end function ResonanceReactionHardSphereRadiusGetConst + +!! Get, non-const +function ResonanceReactionHardSphereRadiusGet(handle) & + bind(C, name='ResonanceReactionHardSphereRadiusGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResonanceReactionHardSphereRadiusGet +end function ResonanceReactionHardSphereRadiusGet + +!! Set +subroutine ResonanceReactionHardSphereRadiusSet(handle, fieldHandle) & + bind(C, name='ResonanceReactionHardSphereRadiusSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonanceReactionHardSphereRadiusSet + + +!! ----------------------------------------------------------------------------- +!! Child: Q +!! ----------------------------------------------------------------------------- + +!! Has +function ResonanceReactionQHas(handle) & + bind(C, name='ResonanceReactionQHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionQHas +end function ResonanceReactionQHas + +!! Get, const +function ResonanceReactionQGetConst(handle) & + bind(C, name='ResonanceReactionQGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonanceReactionQGetConst +end function ResonanceReactionQGetConst + +!! Get, non-const +function ResonanceReactionQGet(handle) & + bind(C, name='ResonanceReactionQGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResonanceReactionQGet +end function ResonanceReactionQGet + +!! Set +subroutine ResonanceReactionQSet(handle, fieldHandle) & + bind(C, name='ResonanceReactionQSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonanceReactionQSet + + +!! ----------------------------------------------------------------------------- +!! Child: scatteringRadius +!! ----------------------------------------------------------------------------- + +!! Has +function ResonanceReactionScatteringRadiusHas(handle) & + bind(C, name='ResonanceReactionScatteringRadiusHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionScatteringRadiusHas +end function ResonanceReactionScatteringRadiusHas + +!! Get, const +function ResonanceReactionScatteringRadiusGetConst(handle) & + bind(C, name='ResonanceReactionScatteringRadiusGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonanceReactionScatteringRadiusGetConst +end function ResonanceReactionScatteringRadiusGetConst + +!! Get, non-const +function ResonanceReactionScatteringRadiusGet(handle) & + bind(C, name='ResonanceReactionScatteringRadiusGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResonanceReactionScatteringRadiusGet +end function ResonanceReactionScatteringRadiusGet + +!! Set +subroutine ResonanceReactionScatteringRadiusSet(handle, fieldHandle) & + bind(C, name='ResonanceReactionScatteringRadiusSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonanceReactionScatteringRadiusSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalResonanceReaction diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonanceReactions.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonanceReactions.f03 new file mode 100644 index 000000000..44412409c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonanceReactions.f03 @@ -0,0 +1,347 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalResonanceReactions +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ResonanceReactionsDefaultConst() & + bind(C, name='ResonanceReactionsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ResonanceReactionsDefaultConst +end function ResonanceReactionsDefaultConst + +!! Create, default, non-const +function ResonanceReactionsDefault() & + bind(C, name='ResonanceReactionsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ResonanceReactionsDefault +end function ResonanceReactionsDefault + +!! Create, general, const +function ResonanceReactionsCreateConst( & + resonanceReaction, resonanceReactionSize & +) & + bind(C, name='ResonanceReactionsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: resonanceReactionSize + type(c_ptr), intent(in) :: resonanceReaction(resonanceReactionSize) + type(c_ptr) :: ResonanceReactionsCreateConst +end function ResonanceReactionsCreateConst + +!! Create, general, non-const +function ResonanceReactionsCreate( & + resonanceReaction, resonanceReactionSize & +) & + bind(C, name='ResonanceReactionsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: resonanceReactionSize + type(c_ptr), intent(in) :: resonanceReaction(resonanceReactionSize) + type(c_ptr) :: ResonanceReactionsCreate +end function ResonanceReactionsCreate + +!! Assign +subroutine ResonanceReactionsAssign(handleLHS, handleRHS) & + bind(C, name='ResonanceReactionsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ResonanceReactionsAssign + +!! Delete +subroutine ResonanceReactionsDelete(handle) & + bind(C, name='ResonanceReactionsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ResonanceReactionsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ResonanceReactionsRead(handle, filename, filenameSize) & + bind(C, name='ResonanceReactionsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResonanceReactionsRead +end function ResonanceReactionsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ResonanceReactionsWrite(handle, filename, filenameSize) & + bind(C, name='ResonanceReactionsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResonanceReactionsWrite +end function ResonanceReactionsWrite + +!! Print to standard output, in our prettyprinting format +function ResonanceReactionsPrint(handle) & + bind(C, name='ResonanceReactionsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionsPrint +end function ResonanceReactionsPrint + +!! Print to standard output, as XML +function ResonanceReactionsPrintXML(handle) & + bind(C, name='ResonanceReactionsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionsPrintXML +end function ResonanceReactionsPrintXML + +!! Print to standard output, as JSON +function ResonanceReactionsPrintJSON(handle) & + bind(C, name='ResonanceReactionsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionsPrintJSON +end function ResonanceReactionsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: resonanceReaction +!! ----------------------------------------------------------------------------- + +!! Has +function ResonanceReactionsResonanceReactionHas(handle) & + bind(C, name='ResonanceReactionsResonanceReactionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonanceReactionsResonanceReactionHas +end function ResonanceReactionsResonanceReactionHas + +!! Clear +subroutine ResonanceReactionsResonanceReactionClear(handle) & + bind(C, name='ResonanceReactionsResonanceReactionClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ResonanceReactionsResonanceReactionClear + +!! Size +function ResonanceReactionsResonanceReactionSize(handle) & + bind(C, name='ResonanceReactionsResonanceReactionSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ResonanceReactionsResonanceReactionSize +end function ResonanceReactionsResonanceReactionSize + +!! Add +subroutine ResonanceReactionsResonanceReactionAdd(handle, fieldHandle) & + bind(C, name='ResonanceReactionsResonanceReactionAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonanceReactionsResonanceReactionAdd + +!! Get, by index \in [0,size), const +function ResonanceReactionsResonanceReactionGetConst(handle, index) & + bind(C, name='ResonanceReactionsResonanceReactionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ResonanceReactionsResonanceReactionGetConst +end function ResonanceReactionsResonanceReactionGetConst + +!! Get, by index \in [0,size), non-const +function ResonanceReactionsResonanceReactionGet(handle, index) & + bind(C, name='ResonanceReactionsResonanceReactionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ResonanceReactionsResonanceReactionGet +end function ResonanceReactionsResonanceReactionGet + +!! Set, by index \in [0,size) +subroutine ResonanceReactionsResonanceReactionSet(handle, index, fieldHandle) & + bind(C, name='ResonanceReactionsResonanceReactionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonanceReactionsResonanceReactionSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ResonanceReactionsResonanceReactionHasByLabel(handle, meta, metaSize) & + bind(C, name='ResonanceReactionsResonanceReactionHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ResonanceReactionsResonanceReactionHasByLabel +end function ResonanceReactionsResonanceReactionHasByLabel + +!! Get, by label, const +function ResonanceReactionsResonanceReactionGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ResonanceReactionsResonanceReactionGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ResonanceReactionsResonanceReactionGetByLabelConst +end function ResonanceReactionsResonanceReactionGetByLabelConst + +!! Get, by label, non-const +function ResonanceReactionsResonanceReactionGetByLabel(handle, meta, metaSize) & + bind(C, name='ResonanceReactionsResonanceReactionGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ResonanceReactionsResonanceReactionGetByLabel +end function ResonanceReactionsResonanceReactionGetByLabel + +!! Set, by label +subroutine ResonanceReactionsResonanceReactionSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ResonanceReactionsResonanceReactionSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonanceReactionsResonanceReactionSetByLabel + +!! ------------------------ +!! Re: metadatum ejectile +!! ------------------------ + +!! Has, by ejectile +function ResonanceReactionsResonanceReactionHasByEjectile(handle, meta, metaSize) & + bind(C, name='ResonanceReactionsResonanceReactionHasByEjectile') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ResonanceReactionsResonanceReactionHasByEjectile +end function ResonanceReactionsResonanceReactionHasByEjectile + +!! Get, by ejectile, const +function ResonanceReactionsResonanceReactionGetByEjectileConst(handle, meta, metaSize) & + bind(C, name='ResonanceReactionsResonanceReactionGetByEjectileConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ResonanceReactionsResonanceReactionGetByEjectileConst +end function ResonanceReactionsResonanceReactionGetByEjectileConst + +!! Get, by ejectile, non-const +function ResonanceReactionsResonanceReactionGetByEjectile(handle, meta, metaSize) & + bind(C, name='ResonanceReactionsResonanceReactionGetByEjectile') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ResonanceReactionsResonanceReactionGetByEjectile +end function ResonanceReactionsResonanceReactionGetByEjectile + +!! Set, by ejectile +subroutine ResonanceReactionsResonanceReactionSetByEjectile(handle, meta, metaSize, fieldHandle) & + bind(C, name='ResonanceReactionsResonanceReactionSetByEjectile') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonanceReactionsResonanceReactionSetByEjectile + +!! ------------------------ +!! Re: metadatum eliminated +!! ------------------------ + +!! Has, by eliminated +function ResonanceReactionsResonanceReactionHasByEliminated(handle, meta) & + bind(C, name='ResonanceReactionsResonanceReactionHasByEliminated') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool), intent(in), value :: meta + integer(c_int) :: ResonanceReactionsResonanceReactionHasByEliminated +end function ResonanceReactionsResonanceReactionHasByEliminated + +!! Get, by eliminated, const +function ResonanceReactionsResonanceReactionGetByEliminatedConst(handle, meta) & + bind(C, name='ResonanceReactionsResonanceReactionGetByEliminatedConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr) :: ResonanceReactionsResonanceReactionGetByEliminatedConst +end function ResonanceReactionsResonanceReactionGetByEliminatedConst + +!! Get, by eliminated, non-const +function ResonanceReactionsResonanceReactionGetByEliminated(handle, meta) & + bind(C, name='ResonanceReactionsResonanceReactionGetByEliminated') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr) :: ResonanceReactionsResonanceReactionGetByEliminated +end function ResonanceReactionsResonanceReactionGetByEliminated + +!! Set, by eliminated +subroutine ResonanceReactionsResonanceReactionSetByEliminated(handle, meta, fieldHandle) & + bind(C, name='ResonanceReactionsResonanceReactionSetByEliminated') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonanceReactionsResonanceReactionSetByEliminated + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalResonanceReactions diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Resonances.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Resonances.f03 new file mode 100644 index 000000000..4b136a50d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Resonances.f03 @@ -0,0 +1,307 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalResonances +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ResonancesDefaultConst() & + bind(C, name='ResonancesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ResonancesDefaultConst +end function ResonancesDefaultConst + +!! Create, default, non-const +function ResonancesDefault() & + bind(C, name='ResonancesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ResonancesDefault +end function ResonancesDefault + +!! Create, general, const +function ResonancesCreateConst( & + href, & + scatteringRadius, & + resolved, & + unresolved, & + hrefSize & +) & + bind(C, name='ResonancesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr), intent(in), value :: scatteringRadius + type(c_ptr), intent(in), value :: resolved + type(c_ptr), intent(in), value :: unresolved + type(c_ptr) :: ResonancesCreateConst +end function ResonancesCreateConst + +!! Create, general, non-const +function ResonancesCreate( & + href, & + scatteringRadius, & + resolved, & + unresolved, & + hrefSize & +) & + bind(C, name='ResonancesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr), intent(in), value :: scatteringRadius + type(c_ptr), intent(in), value :: resolved + type(c_ptr), intent(in), value :: unresolved + type(c_ptr) :: ResonancesCreate +end function ResonancesCreate + +!! Assign +subroutine ResonancesAssign(handleLHS, handleRHS) & + bind(C, name='ResonancesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ResonancesAssign + +!! Delete +subroutine ResonancesDelete(handle) & + bind(C, name='ResonancesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ResonancesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ResonancesRead(handle, filename, filenameSize) & + bind(C, name='ResonancesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResonancesRead +end function ResonancesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ResonancesWrite(handle, filename, filenameSize) & + bind(C, name='ResonancesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResonancesWrite +end function ResonancesWrite + +!! Print to standard output, in our prettyprinting format +function ResonancesPrint(handle) & + bind(C, name='ResonancesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesPrint +end function ResonancesPrint + +!! Print to standard output, as XML +function ResonancesPrintXML(handle) & + bind(C, name='ResonancesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesPrintXML +end function ResonancesPrintXML + +!! Print to standard output, as JSON +function ResonancesPrintJSON(handle) & + bind(C, name='ResonancesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesPrintJSON +end function ResonancesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function ResonancesHrefHas(handle) & + bind(C, name='ResonancesHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesHrefHas +end function ResonancesHrefHas + +!! Get +function ResonancesHrefGet(handle) & + bind(C, name='ResonancesHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonancesHrefGet +end function ResonancesHrefGet + +!! Set +subroutine ResonancesHrefSet(handle, href, hrefSize) & + bind(C, name='ResonancesHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine ResonancesHrefSet + + +!! ----------------------------------------------------------------------------- +!! Child: scatteringRadius +!! ----------------------------------------------------------------------------- + +!! Has +function ResonancesScatteringRadiusHas(handle) & + bind(C, name='ResonancesScatteringRadiusHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesScatteringRadiusHas +end function ResonancesScatteringRadiusHas + +!! Get, const +function ResonancesScatteringRadiusGetConst(handle) & + bind(C, name='ResonancesScatteringRadiusGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonancesScatteringRadiusGetConst +end function ResonancesScatteringRadiusGetConst + +!! Get, non-const +function ResonancesScatteringRadiusGet(handle) & + bind(C, name='ResonancesScatteringRadiusGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResonancesScatteringRadiusGet +end function ResonancesScatteringRadiusGet + +!! Set +subroutine ResonancesScatteringRadiusSet(handle, fieldHandle) & + bind(C, name='ResonancesScatteringRadiusSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonancesScatteringRadiusSet + + +!! ----------------------------------------------------------------------------- +!! Child: resolved +!! ----------------------------------------------------------------------------- + +!! Has +function ResonancesResolvedHas(handle) & + bind(C, name='ResonancesResolvedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesResolvedHas +end function ResonancesResolvedHas + +!! Get, const +function ResonancesResolvedGetConst(handle) & + bind(C, name='ResonancesResolvedGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonancesResolvedGetConst +end function ResonancesResolvedGetConst + +!! Get, non-const +function ResonancesResolvedGet(handle) & + bind(C, name='ResonancesResolvedGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResonancesResolvedGet +end function ResonancesResolvedGet + +!! Set +subroutine ResonancesResolvedSet(handle, fieldHandle) & + bind(C, name='ResonancesResolvedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonancesResolvedSet + + +!! ----------------------------------------------------------------------------- +!! Child: unresolved +!! ----------------------------------------------------------------------------- + +!! Has +function ResonancesUnresolvedHas(handle) & + bind(C, name='ResonancesUnresolvedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesUnresolvedHas +end function ResonancesUnresolvedHas + +!! Get, const +function ResonancesUnresolvedGetConst(handle) & + bind(C, name='ResonancesUnresolvedGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonancesUnresolvedGetConst +end function ResonancesUnresolvedGetConst + +!! Get, non-const +function ResonancesUnresolvedGet(handle) & + bind(C, name='ResonancesUnresolvedGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResonancesUnresolvedGet +end function ResonancesUnresolvedGet + +!! Set +subroutine ResonancesUnresolvedSet(handle, fieldHandle) & + bind(C, name='ResonancesUnresolvedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonancesUnresolvedSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalResonances diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonancesWithBackground.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonancesWithBackground.f03 new file mode 100644 index 000000000..538ede751 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ResonancesWithBackground.f03 @@ -0,0 +1,307 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalResonancesWithBackground +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ResonancesWithBackgroundDefaultConst() & + bind(C, name='ResonancesWithBackgroundDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ResonancesWithBackgroundDefaultConst +end function ResonancesWithBackgroundDefaultConst + +!! Create, default, non-const +function ResonancesWithBackgroundDefault() & + bind(C, name='ResonancesWithBackgroundDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ResonancesWithBackgroundDefault +end function ResonancesWithBackgroundDefault + +!! Create, general, const +function ResonancesWithBackgroundCreateConst( & + label, & + resonances, & + background, & + uncertainty, & + labelSize & +) & + bind(C, name='ResonancesWithBackgroundCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: resonances + type(c_ptr), intent(in), value :: background + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: ResonancesWithBackgroundCreateConst +end function ResonancesWithBackgroundCreateConst + +!! Create, general, non-const +function ResonancesWithBackgroundCreate( & + label, & + resonances, & + background, & + uncertainty, & + labelSize & +) & + bind(C, name='ResonancesWithBackgroundCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + type(c_ptr), intent(in), value :: resonances + type(c_ptr), intent(in), value :: background + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: ResonancesWithBackgroundCreate +end function ResonancesWithBackgroundCreate + +!! Assign +subroutine ResonancesWithBackgroundAssign(handleLHS, handleRHS) & + bind(C, name='ResonancesWithBackgroundAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ResonancesWithBackgroundAssign + +!! Delete +subroutine ResonancesWithBackgroundDelete(handle) & + bind(C, name='ResonancesWithBackgroundDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ResonancesWithBackgroundDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ResonancesWithBackgroundRead(handle, filename, filenameSize) & + bind(C, name='ResonancesWithBackgroundRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResonancesWithBackgroundRead +end function ResonancesWithBackgroundRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ResonancesWithBackgroundWrite(handle, filename, filenameSize) & + bind(C, name='ResonancesWithBackgroundWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ResonancesWithBackgroundWrite +end function ResonancesWithBackgroundWrite + +!! Print to standard output, in our prettyprinting format +function ResonancesWithBackgroundPrint(handle) & + bind(C, name='ResonancesWithBackgroundPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesWithBackgroundPrint +end function ResonancesWithBackgroundPrint + +!! Print to standard output, as XML +function ResonancesWithBackgroundPrintXML(handle) & + bind(C, name='ResonancesWithBackgroundPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesWithBackgroundPrintXML +end function ResonancesWithBackgroundPrintXML + +!! Print to standard output, as JSON +function ResonancesWithBackgroundPrintJSON(handle) & + bind(C, name='ResonancesWithBackgroundPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesWithBackgroundPrintJSON +end function ResonancesWithBackgroundPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ResonancesWithBackgroundLabelHas(handle) & + bind(C, name='ResonancesWithBackgroundLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesWithBackgroundLabelHas +end function ResonancesWithBackgroundLabelHas + +!! Get +function ResonancesWithBackgroundLabelGet(handle) & + bind(C, name='ResonancesWithBackgroundLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonancesWithBackgroundLabelGet +end function ResonancesWithBackgroundLabelGet + +!! Set +subroutine ResonancesWithBackgroundLabelSet(handle, label, labelSize) & + bind(C, name='ResonancesWithBackgroundLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ResonancesWithBackgroundLabelSet + + +!! ----------------------------------------------------------------------------- +!! Child: resonances +!! ----------------------------------------------------------------------------- + +!! Has +function ResonancesWithBackgroundResonancesHas(handle) & + bind(C, name='ResonancesWithBackgroundResonancesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesWithBackgroundResonancesHas +end function ResonancesWithBackgroundResonancesHas + +!! Get, const +function ResonancesWithBackgroundResonancesGetConst(handle) & + bind(C, name='ResonancesWithBackgroundResonancesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonancesWithBackgroundResonancesGetConst +end function ResonancesWithBackgroundResonancesGetConst + +!! Get, non-const +function ResonancesWithBackgroundResonancesGet(handle) & + bind(C, name='ResonancesWithBackgroundResonancesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResonancesWithBackgroundResonancesGet +end function ResonancesWithBackgroundResonancesGet + +!! Set +subroutine ResonancesWithBackgroundResonancesSet(handle, fieldHandle) & + bind(C, name='ResonancesWithBackgroundResonancesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonancesWithBackgroundResonancesSet + + +!! ----------------------------------------------------------------------------- +!! Child: background +!! ----------------------------------------------------------------------------- + +!! Has +function ResonancesWithBackgroundBackgroundHas(handle) & + bind(C, name='ResonancesWithBackgroundBackgroundHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesWithBackgroundBackgroundHas +end function ResonancesWithBackgroundBackgroundHas + +!! Get, const +function ResonancesWithBackgroundBackgroundGetConst(handle) & + bind(C, name='ResonancesWithBackgroundBackgroundGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonancesWithBackgroundBackgroundGetConst +end function ResonancesWithBackgroundBackgroundGetConst + +!! Get, non-const +function ResonancesWithBackgroundBackgroundGet(handle) & + bind(C, name='ResonancesWithBackgroundBackgroundGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResonancesWithBackgroundBackgroundGet +end function ResonancesWithBackgroundBackgroundGet + +!! Set +subroutine ResonancesWithBackgroundBackgroundSet(handle, fieldHandle) & + bind(C, name='ResonancesWithBackgroundBackgroundSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonancesWithBackgroundBackgroundSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function ResonancesWithBackgroundUncertaintyHas(handle) & + bind(C, name='ResonancesWithBackgroundUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ResonancesWithBackgroundUncertaintyHas +end function ResonancesWithBackgroundUncertaintyHas + +!! Get, const +function ResonancesWithBackgroundUncertaintyGetConst(handle) & + bind(C, name='ResonancesWithBackgroundUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ResonancesWithBackgroundUncertaintyGetConst +end function ResonancesWithBackgroundUncertaintyGetConst + +!! Get, non-const +function ResonancesWithBackgroundUncertaintyGet(handle) & + bind(C, name='ResonancesWithBackgroundUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ResonancesWithBackgroundUncertaintyGet +end function ResonancesWithBackgroundUncertaintyGet + +!! Set +subroutine ResonancesWithBackgroundUncertaintySet(handle, fieldHandle) & + bind(C, name='ResonancesWithBackgroundUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ResonancesWithBackgroundUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalResonancesWithBackground diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RowData.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RowData.f03 new file mode 100644 index 000000000..b41a1905d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RowData.f03 @@ -0,0 +1,294 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalRowData +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function RowDataDefaultConst() & + bind(C, name='RowDataDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: RowDataDefaultConst +end function RowDataDefaultConst + +!! Create, default, non-const +function RowDataDefault() & + bind(C, name='RowDataDefault') + use iso_c_binding + implicit none + type(c_ptr) :: RowDataDefault +end function RowDataDefault + +!! Create, general, const +function RowDataCreateConst( & + ENDF_MFMT, & + dimension, & + href, & + slices, & + ENDF_MFMTSize, & + hrefSize & +) & + bind(C, name='RowDataCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: ENDF_MFMTSize + character(c_char), intent(in) :: ENDF_MFMT(ENDF_MFMTSize) + integer(c_int), intent(in), value :: dimension + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr), intent(in), value :: slices + type(c_ptr) :: RowDataCreateConst +end function RowDataCreateConst + +!! Create, general, non-const +function RowDataCreate( & + ENDF_MFMT, & + dimension, & + href, & + slices, & + ENDF_MFMTSize, & + hrefSize & +) & + bind(C, name='RowDataCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: ENDF_MFMTSize + character(c_char), intent(in) :: ENDF_MFMT(ENDF_MFMTSize) + integer(c_int), intent(in), value :: dimension + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr), intent(in), value :: slices + type(c_ptr) :: RowDataCreate +end function RowDataCreate + +!! Assign +subroutine RowDataAssign(handleLHS, handleRHS) & + bind(C, name='RowDataAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine RowDataAssign + +!! Delete +subroutine RowDataDelete(handle) & + bind(C, name='RowDataDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine RowDataDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function RowDataRead(handle, filename, filenameSize) & + bind(C, name='RowDataRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RowDataRead +end function RowDataRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function RowDataWrite(handle, filename, filenameSize) & + bind(C, name='RowDataWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RowDataWrite +end function RowDataWrite + +!! Print to standard output, in our prettyprinting format +function RowDataPrint(handle) & + bind(C, name='RowDataPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RowDataPrint +end function RowDataPrint + +!! Print to standard output, as XML +function RowDataPrintXML(handle) & + bind(C, name='RowDataPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RowDataPrintXML +end function RowDataPrintXML + +!! Print to standard output, as JSON +function RowDataPrintJSON(handle) & + bind(C, name='RowDataPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RowDataPrintJSON +end function RowDataPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: ENDF_MFMT +!! ----------------------------------------------------------------------------- + +!! Has +function RowDataENDFMFMTHas(handle) & + bind(C, name='RowDataENDFMFMTHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RowDataENDFMFMTHas +end function RowDataENDFMFMTHas + +!! Get +function RowDataENDFMFMTGet(handle) & + bind(C, name='RowDataENDFMFMTGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RowDataENDFMFMTGet +end function RowDataENDFMFMTGet + +!! Set +subroutine RowDataENDFMFMTSet(handle, ENDF_MFMT, ENDF_MFMTSize) & + bind(C, name='RowDataENDFMFMTSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: ENDF_MFMTSize + character(c_char), intent(in) :: ENDF_MFMT(ENDF_MFMTSize) +end subroutine RowDataENDFMFMTSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: dimension +!! ----------------------------------------------------------------------------- + +!! Has +function RowDataDimensionHas(handle) & + bind(C, name='RowDataDimensionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RowDataDimensionHas +end function RowDataDimensionHas + +!! Get +function RowDataDimensionGet(handle) & + bind(C, name='RowDataDimensionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RowDataDimensionGet +end function RowDataDimensionGet + +!! Set +subroutine RowDataDimensionSet(handle, dimension) & + bind(C, name='RowDataDimensionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: dimension +end subroutine RowDataDimensionSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function RowDataHrefHas(handle) & + bind(C, name='RowDataHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RowDataHrefHas +end function RowDataHrefHas + +!! Get +function RowDataHrefGet(handle) & + bind(C, name='RowDataHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RowDataHrefGet +end function RowDataHrefGet + +!! Set +subroutine RowDataHrefSet(handle, href, hrefSize) & + bind(C, name='RowDataHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine RowDataHrefSet + + +!! ----------------------------------------------------------------------------- +!! Child: slices +!! ----------------------------------------------------------------------------- + +!! Has +function RowDataSlicesHas(handle) & + bind(C, name='RowDataSlicesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RowDataSlicesHas +end function RowDataSlicesHas + +!! Get, const +function RowDataSlicesGetConst(handle) & + bind(C, name='RowDataSlicesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: RowDataSlicesGetConst +end function RowDataSlicesGetConst + +!! Get, non-const +function RowDataSlicesGet(handle) & + bind(C, name='RowDataSlicesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: RowDataSlicesGet +end function RowDataSlicesGet + +!! Set +subroutine RowDataSlicesSet(handle, fieldHandle) & + bind(C, name='RowDataSlicesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine RowDataSlicesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalRowData diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RutherfordScattering.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RutherfordScattering.f03 new file mode 100644 index 000000000..04b07b8d9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/RutherfordScattering.f03 @@ -0,0 +1,131 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalRutherfordScattering +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function RutherfordScatteringDefaultConst() & + bind(C, name='RutherfordScatteringDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: RutherfordScatteringDefaultConst +end function RutherfordScatteringDefaultConst + +!! Create, default, non-const +function RutherfordScatteringDefault() & + bind(C, name='RutherfordScatteringDefault') + use iso_c_binding + implicit none + type(c_ptr) :: RutherfordScatteringDefault +end function RutherfordScatteringDefault + +!! Create, general, const +function RutherfordScatteringCreateConst( & +) & + bind(C, name='RutherfordScatteringCreateConst') + use iso_c_binding + implicit none + type(c_ptr) :: RutherfordScatteringCreateConst +end function RutherfordScatteringCreateConst + +!! Create, general, non-const +function RutherfordScatteringCreate( & +) & + bind(C, name='RutherfordScatteringCreate') + use iso_c_binding + implicit none + type(c_ptr) :: RutherfordScatteringCreate +end function RutherfordScatteringCreate + +!! Assign +subroutine RutherfordScatteringAssign(handleLHS, handleRHS) & + bind(C, name='RutherfordScatteringAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine RutherfordScatteringAssign + +!! Delete +subroutine RutherfordScatteringDelete(handle) & + bind(C, name='RutherfordScatteringDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine RutherfordScatteringDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function RutherfordScatteringRead(handle, filename, filenameSize) & + bind(C, name='RutherfordScatteringRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RutherfordScatteringRead +end function RutherfordScatteringRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function RutherfordScatteringWrite(handle, filename, filenameSize) & + bind(C, name='RutherfordScatteringWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: RutherfordScatteringWrite +end function RutherfordScatteringWrite + +!! Print to standard output, in our prettyprinting format +function RutherfordScatteringPrint(handle) & + bind(C, name='RutherfordScatteringPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RutherfordScatteringPrint +end function RutherfordScatteringPrint + +!! Print to standard output, as XML +function RutherfordScatteringPrintXML(handle) & + bind(C, name='RutherfordScatteringPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RutherfordScatteringPrintXML +end function RutherfordScatteringPrintXML + +!! Print to standard output, as JSON +function RutherfordScatteringPrintJSON(handle) & + bind(C, name='RutherfordScatteringPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: RutherfordScatteringPrintJSON +end function RutherfordScatteringPrintJSON + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalRutherfordScattering diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SCTApproximation.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SCTApproximation.f03 new file mode 100644 index 000000000..720a854cd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SCTApproximation.f03 @@ -0,0 +1,131 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSCTApproximation +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SCTApproximationDefaultConst() & + bind(C, name='SCTApproximationDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SCTApproximationDefaultConst +end function SCTApproximationDefaultConst + +!! Create, default, non-const +function SCTApproximationDefault() & + bind(C, name='SCTApproximationDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SCTApproximationDefault +end function SCTApproximationDefault + +!! Create, general, const +function SCTApproximationCreateConst( & +) & + bind(C, name='SCTApproximationCreateConst') + use iso_c_binding + implicit none + type(c_ptr) :: SCTApproximationCreateConst +end function SCTApproximationCreateConst + +!! Create, general, non-const +function SCTApproximationCreate( & +) & + bind(C, name='SCTApproximationCreate') + use iso_c_binding + implicit none + type(c_ptr) :: SCTApproximationCreate +end function SCTApproximationCreate + +!! Assign +subroutine SCTApproximationAssign(handleLHS, handleRHS) & + bind(C, name='SCTApproximationAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SCTApproximationAssign + +!! Delete +subroutine SCTApproximationDelete(handle) & + bind(C, name='SCTApproximationDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SCTApproximationDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SCTApproximationRead(handle, filename, filenameSize) & + bind(C, name='SCTApproximationRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SCTApproximationRead +end function SCTApproximationRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SCTApproximationWrite(handle, filename, filenameSize) & + bind(C, name='SCTApproximationWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SCTApproximationWrite +end function SCTApproximationWrite + +!! Print to standard output, in our prettyprinting format +function SCTApproximationPrint(handle) & + bind(C, name='SCTApproximationPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SCTApproximationPrint +end function SCTApproximationPrint + +!! Print to standard output, as XML +function SCTApproximationPrintXML(handle) & + bind(C, name='SCTApproximationPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SCTApproximationPrintXML +end function SCTApproximationPrintXML + +!! Print to standard output, as JSON +function SCTApproximationPrintJSON(handle) & + bind(C, name='SCTApproximationPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SCTApproximationPrintJSON +end function SCTApproximationPrintJSON + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSCTApproximation diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/S_table.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/S_table.f03 new file mode 100644 index 000000000..1ea26f048 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/S_table.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalS_table +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function S_tableDefaultConst() & + bind(C, name='S_tableDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: S_tableDefaultConst +end function S_tableDefaultConst + +!! Create, default, non-const +function S_tableDefault() & + bind(C, name='S_tableDefault') + use iso_c_binding + implicit none + type(c_ptr) :: S_tableDefault +end function S_tableDefault + +!! Create, general, const +function S_tableCreateConst( & + gridded2d & +) & + bind(C, name='S_tableCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: gridded2d + type(c_ptr) :: S_tableCreateConst +end function S_tableCreateConst + +!! Create, general, non-const +function S_tableCreate( & + gridded2d & +) & + bind(C, name='S_tableCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: gridded2d + type(c_ptr) :: S_tableCreate +end function S_tableCreate + +!! Assign +subroutine S_tableAssign(handleLHS, handleRHS) & + bind(C, name='S_tableAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine S_tableAssign + +!! Delete +subroutine S_tableDelete(handle) & + bind(C, name='S_tableDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine S_tableDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function S_tableRead(handle, filename, filenameSize) & + bind(C, name='S_tableRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: S_tableRead +end function S_tableRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function S_tableWrite(handle, filename, filenameSize) & + bind(C, name='S_tableWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: S_tableWrite +end function S_tableWrite + +!! Print to standard output, in our prettyprinting format +function S_tablePrint(handle) & + bind(C, name='S_tablePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: S_tablePrint +end function S_tablePrint + +!! Print to standard output, as XML +function S_tablePrintXML(handle) & + bind(C, name='S_tablePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: S_tablePrintXML +end function S_tablePrintXML + +!! Print to standard output, as JSON +function S_tablePrintJSON(handle) & + bind(C, name='S_tablePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: S_tablePrintJSON +end function S_tablePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: gridded2d +!! ----------------------------------------------------------------------------- + +!! Has +function S_tableGridded2dHas(handle) & + bind(C, name='S_tableGridded2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: S_tableGridded2dHas +end function S_tableGridded2dHas + +!! Get, const +function S_tableGridded2dGetConst(handle) & + bind(C, name='S_tableGridded2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: S_tableGridded2dGetConst +end function S_tableGridded2dGetConst + +!! Get, non-const +function S_tableGridded2dGet(handle) & + bind(C, name='S_tableGridded2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: S_tableGridded2dGet +end function S_tableGridded2dGet + +!! Set +subroutine S_tableGridded2dSet(handle, fieldHandle) & + bind(C, name='S_tableGridded2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine S_tableGridded2dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalS_table diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringAtom.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringAtom.f03 new file mode 100644 index 000000000..baf2ff4e8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringAtom.f03 @@ -0,0 +1,514 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalScatteringAtom +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ScatteringAtomDefaultConst() & + bind(C, name='ScatteringAtomDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ScatteringAtomDefaultConst +end function ScatteringAtomDefaultConst + +!! Create, default, non-const +function ScatteringAtomDefault() & + bind(C, name='ScatteringAtomDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ScatteringAtomDefault +end function ScatteringAtomDefault + +!! Create, general, const +function ScatteringAtomCreateConst( & + pid, & + numberPerMolecule, & + primaryScatterer, & + mass, & + e_critical, & + e_max, & + boundAtomCrossSection, & + selfScatteringKernel, & + T_effective, & + pidSize & +) & + bind(C, name='ScatteringAtomCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_int), intent(in), value :: numberPerMolecule + logical(c_bool), intent(in), value :: primaryScatterer + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: e_critical + type(c_ptr), intent(in), value :: e_max + type(c_ptr), intent(in), value :: boundAtomCrossSection + type(c_ptr), intent(in), value :: selfScatteringKernel + type(c_ptr), intent(in), value :: T_effective + type(c_ptr) :: ScatteringAtomCreateConst +end function ScatteringAtomCreateConst + +!! Create, general, non-const +function ScatteringAtomCreate( & + pid, & + numberPerMolecule, & + primaryScatterer, & + mass, & + e_critical, & + e_max, & + boundAtomCrossSection, & + selfScatteringKernel, & + T_effective, & + pidSize & +) & + bind(C, name='ScatteringAtomCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_int), intent(in), value :: numberPerMolecule + logical(c_bool), intent(in), value :: primaryScatterer + type(c_ptr), intent(in), value :: mass + type(c_ptr), intent(in), value :: e_critical + type(c_ptr), intent(in), value :: e_max + type(c_ptr), intent(in), value :: boundAtomCrossSection + type(c_ptr), intent(in), value :: selfScatteringKernel + type(c_ptr), intent(in), value :: T_effective + type(c_ptr) :: ScatteringAtomCreate +end function ScatteringAtomCreate + +!! Assign +subroutine ScatteringAtomAssign(handleLHS, handleRHS) & + bind(C, name='ScatteringAtomAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ScatteringAtomAssign + +!! Delete +subroutine ScatteringAtomDelete(handle) & + bind(C, name='ScatteringAtomDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ScatteringAtomDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ScatteringAtomRead(handle, filename, filenameSize) & + bind(C, name='ScatteringAtomRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ScatteringAtomRead +end function ScatteringAtomRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ScatteringAtomWrite(handle, filename, filenameSize) & + bind(C, name='ScatteringAtomWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ScatteringAtomWrite +end function ScatteringAtomWrite + +!! Print to standard output, in our prettyprinting format +function ScatteringAtomPrint(handle) & + bind(C, name='ScatteringAtomPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomPrint +end function ScatteringAtomPrint + +!! Print to standard output, as XML +function ScatteringAtomPrintXML(handle) & + bind(C, name='ScatteringAtomPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomPrintXML +end function ScatteringAtomPrintXML + +!! Print to standard output, as JSON +function ScatteringAtomPrintJSON(handle) & + bind(C, name='ScatteringAtomPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomPrintJSON +end function ScatteringAtomPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringAtomPidHas(handle) & + bind(C, name='ScatteringAtomPidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomPidHas +end function ScatteringAtomPidHas + +!! Get +function ScatteringAtomPidGet(handle) & + bind(C, name='ScatteringAtomPidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ScatteringAtomPidGet +end function ScatteringAtomPidGet + +!! Set +subroutine ScatteringAtomPidSet(handle, pid, pidSize) & + bind(C, name='ScatteringAtomPidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine ScatteringAtomPidSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: numberPerMolecule +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringAtomNumberPerMoleculeHas(handle) & + bind(C, name='ScatteringAtomNumberPerMoleculeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomNumberPerMoleculeHas +end function ScatteringAtomNumberPerMoleculeHas + +!! Get +function ScatteringAtomNumberPerMoleculeGet(handle) & + bind(C, name='ScatteringAtomNumberPerMoleculeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomNumberPerMoleculeGet +end function ScatteringAtomNumberPerMoleculeGet + +!! Set +subroutine ScatteringAtomNumberPerMoleculeSet(handle, numberPerMolecule) & + bind(C, name='ScatteringAtomNumberPerMoleculeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: numberPerMolecule +end subroutine ScatteringAtomNumberPerMoleculeSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: primaryScatterer +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringAtomPrimaryScattererHas(handle) & + bind(C, name='ScatteringAtomPrimaryScattererHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomPrimaryScattererHas +end function ScatteringAtomPrimaryScattererHas + +!! Get +function ScatteringAtomPrimaryScattererGet(handle) & + bind(C, name='ScatteringAtomPrimaryScattererGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: ScatteringAtomPrimaryScattererGet +end function ScatteringAtomPrimaryScattererGet + +!! Set +subroutine ScatteringAtomPrimaryScattererSet(handle, primaryScatterer) & + bind(C, name='ScatteringAtomPrimaryScattererSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: primaryScatterer +end subroutine ScatteringAtomPrimaryScattererSet + + +!! ----------------------------------------------------------------------------- +!! Child: mass +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringAtomMassHas(handle) & + bind(C, name='ScatteringAtomMassHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomMassHas +end function ScatteringAtomMassHas + +!! Get, const +function ScatteringAtomMassGetConst(handle) & + bind(C, name='ScatteringAtomMassGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ScatteringAtomMassGetConst +end function ScatteringAtomMassGetConst + +!! Get, non-const +function ScatteringAtomMassGet(handle) & + bind(C, name='ScatteringAtomMassGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ScatteringAtomMassGet +end function ScatteringAtomMassGet + +!! Set +subroutine ScatteringAtomMassSet(handle, fieldHandle) & + bind(C, name='ScatteringAtomMassSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringAtomMassSet + + +!! ----------------------------------------------------------------------------- +!! Child: e_critical +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringAtomE_criticalHas(handle) & + bind(C, name='ScatteringAtomE_criticalHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomE_criticalHas +end function ScatteringAtomE_criticalHas + +!! Get, const +function ScatteringAtomE_criticalGetConst(handle) & + bind(C, name='ScatteringAtomE_criticalGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ScatteringAtomE_criticalGetConst +end function ScatteringAtomE_criticalGetConst + +!! Get, non-const +function ScatteringAtomE_criticalGet(handle) & + bind(C, name='ScatteringAtomE_criticalGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ScatteringAtomE_criticalGet +end function ScatteringAtomE_criticalGet + +!! Set +subroutine ScatteringAtomE_criticalSet(handle, fieldHandle) & + bind(C, name='ScatteringAtomE_criticalSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringAtomE_criticalSet + + +!! ----------------------------------------------------------------------------- +!! Child: e_max +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringAtomE_maxHas(handle) & + bind(C, name='ScatteringAtomE_maxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomE_maxHas +end function ScatteringAtomE_maxHas + +!! Get, const +function ScatteringAtomE_maxGetConst(handle) & + bind(C, name='ScatteringAtomE_maxGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ScatteringAtomE_maxGetConst +end function ScatteringAtomE_maxGetConst + +!! Get, non-const +function ScatteringAtomE_maxGet(handle) & + bind(C, name='ScatteringAtomE_maxGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ScatteringAtomE_maxGet +end function ScatteringAtomE_maxGet + +!! Set +subroutine ScatteringAtomE_maxSet(handle, fieldHandle) & + bind(C, name='ScatteringAtomE_maxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringAtomE_maxSet + + +!! ----------------------------------------------------------------------------- +!! Child: boundAtomCrossSection +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringAtomBoundAtomCrossSectionHas(handle) & + bind(C, name='ScatteringAtomBoundAtomCrossSectionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomBoundAtomCrossSectionHas +end function ScatteringAtomBoundAtomCrossSectionHas + +!! Get, const +function ScatteringAtomBoundAtomCrossSectionGetConst(handle) & + bind(C, name='ScatteringAtomBoundAtomCrossSectionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ScatteringAtomBoundAtomCrossSectionGetConst +end function ScatteringAtomBoundAtomCrossSectionGetConst + +!! Get, non-const +function ScatteringAtomBoundAtomCrossSectionGet(handle) & + bind(C, name='ScatteringAtomBoundAtomCrossSectionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ScatteringAtomBoundAtomCrossSectionGet +end function ScatteringAtomBoundAtomCrossSectionGet + +!! Set +subroutine ScatteringAtomBoundAtomCrossSectionSet(handle, fieldHandle) & + bind(C, name='ScatteringAtomBoundAtomCrossSectionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringAtomBoundAtomCrossSectionSet + + +!! ----------------------------------------------------------------------------- +!! Child: selfScatteringKernel +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringAtomSelfScatteringKernelHas(handle) & + bind(C, name='ScatteringAtomSelfScatteringKernelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomSelfScatteringKernelHas +end function ScatteringAtomSelfScatteringKernelHas + +!! Get, const +function ScatteringAtomSelfScatteringKernelGetConst(handle) & + bind(C, name='ScatteringAtomSelfScatteringKernelGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ScatteringAtomSelfScatteringKernelGetConst +end function ScatteringAtomSelfScatteringKernelGetConst + +!! Get, non-const +function ScatteringAtomSelfScatteringKernelGet(handle) & + bind(C, name='ScatteringAtomSelfScatteringKernelGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ScatteringAtomSelfScatteringKernelGet +end function ScatteringAtomSelfScatteringKernelGet + +!! Set +subroutine ScatteringAtomSelfScatteringKernelSet(handle, fieldHandle) & + bind(C, name='ScatteringAtomSelfScatteringKernelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringAtomSelfScatteringKernelSet + + +!! ----------------------------------------------------------------------------- +!! Child: T_effective +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringAtomT_effectiveHas(handle) & + bind(C, name='ScatteringAtomT_effectiveHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomT_effectiveHas +end function ScatteringAtomT_effectiveHas + +!! Get, const +function ScatteringAtomT_effectiveGetConst(handle) & + bind(C, name='ScatteringAtomT_effectiveGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ScatteringAtomT_effectiveGetConst +end function ScatteringAtomT_effectiveGetConst + +!! Get, non-const +function ScatteringAtomT_effectiveGet(handle) & + bind(C, name='ScatteringAtomT_effectiveGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ScatteringAtomT_effectiveGet +end function ScatteringAtomT_effectiveGet + +!! Set +subroutine ScatteringAtomT_effectiveSet(handle, fieldHandle) & + bind(C, name='ScatteringAtomT_effectiveSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringAtomT_effectiveSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalScatteringAtom diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringAtoms.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringAtoms.f03 new file mode 100644 index 000000000..6fcbe7ad4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringAtoms.f03 @@ -0,0 +1,343 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalScatteringAtoms +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ScatteringAtomsDefaultConst() & + bind(C, name='ScatteringAtomsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ScatteringAtomsDefaultConst +end function ScatteringAtomsDefaultConst + +!! Create, default, non-const +function ScatteringAtomsDefault() & + bind(C, name='ScatteringAtomsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ScatteringAtomsDefault +end function ScatteringAtomsDefault + +!! Create, general, const +function ScatteringAtomsCreateConst( & + scatteringAtom, scatteringAtomSize & +) & + bind(C, name='ScatteringAtomsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: scatteringAtomSize + type(c_ptr), intent(in) :: scatteringAtom(scatteringAtomSize) + type(c_ptr) :: ScatteringAtomsCreateConst +end function ScatteringAtomsCreateConst + +!! Create, general, non-const +function ScatteringAtomsCreate( & + scatteringAtom, scatteringAtomSize & +) & + bind(C, name='ScatteringAtomsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: scatteringAtomSize + type(c_ptr), intent(in) :: scatteringAtom(scatteringAtomSize) + type(c_ptr) :: ScatteringAtomsCreate +end function ScatteringAtomsCreate + +!! Assign +subroutine ScatteringAtomsAssign(handleLHS, handleRHS) & + bind(C, name='ScatteringAtomsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ScatteringAtomsAssign + +!! Delete +subroutine ScatteringAtomsDelete(handle) & + bind(C, name='ScatteringAtomsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ScatteringAtomsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ScatteringAtomsRead(handle, filename, filenameSize) & + bind(C, name='ScatteringAtomsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ScatteringAtomsRead +end function ScatteringAtomsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ScatteringAtomsWrite(handle, filename, filenameSize) & + bind(C, name='ScatteringAtomsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ScatteringAtomsWrite +end function ScatteringAtomsWrite + +!! Print to standard output, in our prettyprinting format +function ScatteringAtomsPrint(handle) & + bind(C, name='ScatteringAtomsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomsPrint +end function ScatteringAtomsPrint + +!! Print to standard output, as XML +function ScatteringAtomsPrintXML(handle) & + bind(C, name='ScatteringAtomsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomsPrintXML +end function ScatteringAtomsPrintXML + +!! Print to standard output, as JSON +function ScatteringAtomsPrintJSON(handle) & + bind(C, name='ScatteringAtomsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomsPrintJSON +end function ScatteringAtomsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: scatteringAtom +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringAtomsScatteringAtomHas(handle) & + bind(C, name='ScatteringAtomsScatteringAtomHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringAtomsScatteringAtomHas +end function ScatteringAtomsScatteringAtomHas + +!! Clear +subroutine ScatteringAtomsScatteringAtomClear(handle) & + bind(C, name='ScatteringAtomsScatteringAtomClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ScatteringAtomsScatteringAtomClear + +!! Size +function ScatteringAtomsScatteringAtomSize(handle) & + bind(C, name='ScatteringAtomsScatteringAtomSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ScatteringAtomsScatteringAtomSize +end function ScatteringAtomsScatteringAtomSize + +!! Add +subroutine ScatteringAtomsScatteringAtomAdd(handle, fieldHandle) & + bind(C, name='ScatteringAtomsScatteringAtomAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringAtomsScatteringAtomAdd + +!! Get, by index \in [0,size), const +function ScatteringAtomsScatteringAtomGetConst(handle, index) & + bind(C, name='ScatteringAtomsScatteringAtomGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ScatteringAtomsScatteringAtomGetConst +end function ScatteringAtomsScatteringAtomGetConst + +!! Get, by index \in [0,size), non-const +function ScatteringAtomsScatteringAtomGet(handle, index) & + bind(C, name='ScatteringAtomsScatteringAtomGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ScatteringAtomsScatteringAtomGet +end function ScatteringAtomsScatteringAtomGet + +!! Set, by index \in [0,size) +subroutine ScatteringAtomsScatteringAtomSet(handle, index, fieldHandle) & + bind(C, name='ScatteringAtomsScatteringAtomSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringAtomsScatteringAtomSet + +!! ------------------------ +!! Re: metadatum pid +!! ------------------------ + +!! Has, by pid +function ScatteringAtomsScatteringAtomHasByPid(handle, meta, metaSize) & + bind(C, name='ScatteringAtomsScatteringAtomHasByPid') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ScatteringAtomsScatteringAtomHasByPid +end function ScatteringAtomsScatteringAtomHasByPid + +!! Get, by pid, const +function ScatteringAtomsScatteringAtomGetByPidConst(handle, meta, metaSize) & + bind(C, name='ScatteringAtomsScatteringAtomGetByPidConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ScatteringAtomsScatteringAtomGetByPidConst +end function ScatteringAtomsScatteringAtomGetByPidConst + +!! Get, by pid, non-const +function ScatteringAtomsScatteringAtomGetByPid(handle, meta, metaSize) & + bind(C, name='ScatteringAtomsScatteringAtomGetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ScatteringAtomsScatteringAtomGetByPid +end function ScatteringAtomsScatteringAtomGetByPid + +!! Set, by pid +subroutine ScatteringAtomsScatteringAtomSetByPid(handle, meta, metaSize, fieldHandle) & + bind(C, name='ScatteringAtomsScatteringAtomSetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringAtomsScatteringAtomSetByPid + +!! ------------------------ +!! Re: metadatum numberPerMolecule +!! ------------------------ + +!! Has, by numberPerMolecule +function ScatteringAtomsScatteringAtomHasByNumberPerMolecule(handle, meta) & + bind(C, name='ScatteringAtomsScatteringAtomHasByNumberPerMolecule') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: ScatteringAtomsScatteringAtomHasByNumberPerMolecule +end function ScatteringAtomsScatteringAtomHasByNumberPerMolecule + +!! Get, by numberPerMolecule, const +function ScatteringAtomsScatteringAtomGetByNumberPerMoleculeConst(handle, meta) & + bind(C, name='ScatteringAtomsScatteringAtomGetByNumberPerMoleculeConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ScatteringAtomsScatteringAtomGetByNumberPerMoleculeConst +end function ScatteringAtomsScatteringAtomGetByNumberPerMoleculeConst + +!! Get, by numberPerMolecule, non-const +function ScatteringAtomsScatteringAtomGetByNumberPerMolecule(handle, meta) & + bind(C, name='ScatteringAtomsScatteringAtomGetByNumberPerMolecule') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: ScatteringAtomsScatteringAtomGetByNumberPerMolecule +end function ScatteringAtomsScatteringAtomGetByNumberPerMolecule + +!! Set, by numberPerMolecule +subroutine ScatteringAtomsScatteringAtomSetByNumberPerMolecule(handle, meta, fieldHandle) & + bind(C, name='ScatteringAtomsScatteringAtomSetByNumberPerMolecule') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringAtomsScatteringAtomSetByNumberPerMolecule + +!! ------------------------ +!! Re: metadatum primaryScatterer +!! ------------------------ + +!! Has, by primaryScatterer +function ScatteringAtomsScatteringAtomHasByPrimaryScatterer(handle, meta) & + bind(C, name='ScatteringAtomsScatteringAtomHasByPrimaryScatterer') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool), intent(in), value :: meta + integer(c_int) :: ScatteringAtomsScatteringAtomHasByPrimaryScatterer +end function ScatteringAtomsScatteringAtomHasByPrimaryScatterer + +!! Get, by primaryScatterer, const +function ScatteringAtomsScatteringAtomGetByPrimaryScattererConst(handle, meta) & + bind(C, name='ScatteringAtomsScatteringAtomGetByPrimaryScattererConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr) :: ScatteringAtomsScatteringAtomGetByPrimaryScattererConst +end function ScatteringAtomsScatteringAtomGetByPrimaryScattererConst + +!! Get, by primaryScatterer, non-const +function ScatteringAtomsScatteringAtomGetByPrimaryScatterer(handle, meta) & + bind(C, name='ScatteringAtomsScatteringAtomGetByPrimaryScatterer') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr) :: ScatteringAtomsScatteringAtomGetByPrimaryScatterer +end function ScatteringAtomsScatteringAtomGetByPrimaryScatterer + +!! Set, by primaryScatterer +subroutine ScatteringAtomsScatteringAtomSetByPrimaryScatterer(handle, meta, fieldHandle) & + bind(C, name='ScatteringAtomsScatteringAtomSetByPrimaryScatterer') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringAtomsScatteringAtomSetByPrimaryScatterer + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalScatteringAtoms diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringFactor.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringFactor.f03 new file mode 100644 index 000000000..6941a8f5f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringFactor.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalScatteringFactor +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ScatteringFactorDefaultConst() & + bind(C, name='ScatteringFactorDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ScatteringFactorDefaultConst +end function ScatteringFactorDefaultConst + +!! Create, default, non-const +function ScatteringFactorDefault() & + bind(C, name='ScatteringFactorDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ScatteringFactorDefault +end function ScatteringFactorDefault + +!! Create, general, const +function ScatteringFactorCreateConst( & + XYs1d & +) & + bind(C, name='ScatteringFactorCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: ScatteringFactorCreateConst +end function ScatteringFactorCreateConst + +!! Create, general, non-const +function ScatteringFactorCreate( & + XYs1d & +) & + bind(C, name='ScatteringFactorCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: ScatteringFactorCreate +end function ScatteringFactorCreate + +!! Assign +subroutine ScatteringFactorAssign(handleLHS, handleRHS) & + bind(C, name='ScatteringFactorAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ScatteringFactorAssign + +!! Delete +subroutine ScatteringFactorDelete(handle) & + bind(C, name='ScatteringFactorDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ScatteringFactorDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ScatteringFactorRead(handle, filename, filenameSize) & + bind(C, name='ScatteringFactorRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ScatteringFactorRead +end function ScatteringFactorRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ScatteringFactorWrite(handle, filename, filenameSize) & + bind(C, name='ScatteringFactorWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ScatteringFactorWrite +end function ScatteringFactorWrite + +!! Print to standard output, in our prettyprinting format +function ScatteringFactorPrint(handle) & + bind(C, name='ScatteringFactorPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringFactorPrint +end function ScatteringFactorPrint + +!! Print to standard output, as XML +function ScatteringFactorPrintXML(handle) & + bind(C, name='ScatteringFactorPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringFactorPrintXML +end function ScatteringFactorPrintXML + +!! Print to standard output, as JSON +function ScatteringFactorPrintJSON(handle) & + bind(C, name='ScatteringFactorPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringFactorPrintJSON +end function ScatteringFactorPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringFactorXYs1dHas(handle) & + bind(C, name='ScatteringFactorXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringFactorXYs1dHas +end function ScatteringFactorXYs1dHas + +!! Get, const +function ScatteringFactorXYs1dGetConst(handle) & + bind(C, name='ScatteringFactorXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ScatteringFactorXYs1dGetConst +end function ScatteringFactorXYs1dGetConst + +!! Get, non-const +function ScatteringFactorXYs1dGet(handle) & + bind(C, name='ScatteringFactorXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ScatteringFactorXYs1dGet +end function ScatteringFactorXYs1dGet + +!! Set +subroutine ScatteringFactorXYs1dSet(handle, fieldHandle) & + bind(C, name='ScatteringFactorXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringFactorXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalScatteringFactor diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringRadius.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringRadius.f03 new file mode 100644 index 000000000..1b828b307 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ScatteringRadius.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalScatteringRadius +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ScatteringRadiusDefaultConst() & + bind(C, name='ScatteringRadiusDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ScatteringRadiusDefaultConst +end function ScatteringRadiusDefaultConst + +!! Create, default, non-const +function ScatteringRadiusDefault() & + bind(C, name='ScatteringRadiusDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ScatteringRadiusDefault +end function ScatteringRadiusDefault + +!! Create, general, const +function ScatteringRadiusCreateConst( & + constant1d, & + XYs1d & +) & + bind(C, name='ScatteringRadiusCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: constant1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: ScatteringRadiusCreateConst +end function ScatteringRadiusCreateConst + +!! Create, general, non-const +function ScatteringRadiusCreate( & + constant1d, & + XYs1d & +) & + bind(C, name='ScatteringRadiusCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: constant1d + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: ScatteringRadiusCreate +end function ScatteringRadiusCreate + +!! Assign +subroutine ScatteringRadiusAssign(handleLHS, handleRHS) & + bind(C, name='ScatteringRadiusAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ScatteringRadiusAssign + +!! Delete +subroutine ScatteringRadiusDelete(handle) & + bind(C, name='ScatteringRadiusDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ScatteringRadiusDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ScatteringRadiusRead(handle, filename, filenameSize) & + bind(C, name='ScatteringRadiusRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ScatteringRadiusRead +end function ScatteringRadiusRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ScatteringRadiusWrite(handle, filename, filenameSize) & + bind(C, name='ScatteringRadiusWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ScatteringRadiusWrite +end function ScatteringRadiusWrite + +!! Print to standard output, in our prettyprinting format +function ScatteringRadiusPrint(handle) & + bind(C, name='ScatteringRadiusPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringRadiusPrint +end function ScatteringRadiusPrint + +!! Print to standard output, as XML +function ScatteringRadiusPrintXML(handle) & + bind(C, name='ScatteringRadiusPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringRadiusPrintXML +end function ScatteringRadiusPrintXML + +!! Print to standard output, as JSON +function ScatteringRadiusPrintJSON(handle) & + bind(C, name='ScatteringRadiusPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringRadiusPrintJSON +end function ScatteringRadiusPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: constant1d +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringRadiusConstant1dHas(handle) & + bind(C, name='ScatteringRadiusConstant1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringRadiusConstant1dHas +end function ScatteringRadiusConstant1dHas + +!! Get, const +function ScatteringRadiusConstant1dGetConst(handle) & + bind(C, name='ScatteringRadiusConstant1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ScatteringRadiusConstant1dGetConst +end function ScatteringRadiusConstant1dGetConst + +!! Get, non-const +function ScatteringRadiusConstant1dGet(handle) & + bind(C, name='ScatteringRadiusConstant1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ScatteringRadiusConstant1dGet +end function ScatteringRadiusConstant1dGet + +!! Set +subroutine ScatteringRadiusConstant1dSet(handle, fieldHandle) & + bind(C, name='ScatteringRadiusConstant1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringRadiusConstant1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function ScatteringRadiusXYs1dHas(handle) & + bind(C, name='ScatteringRadiusXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ScatteringRadiusXYs1dHas +end function ScatteringRadiusXYs1dHas + +!! Get, const +function ScatteringRadiusXYs1dGetConst(handle) & + bind(C, name='ScatteringRadiusXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ScatteringRadiusXYs1dGetConst +end function ScatteringRadiusXYs1dGetConst + +!! Get, non-const +function ScatteringRadiusXYs1dGet(handle) & + bind(C, name='ScatteringRadiusXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ScatteringRadiusXYs1dGet +end function ScatteringRadiusXYs1dGet + +!! Set +subroutine ScatteringRadiusXYs1dSet(handle, fieldHandle) & + bind(C, name='ScatteringRadiusXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ScatteringRadiusXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalScatteringRadius diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SelfScatteringKernel.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SelfScatteringKernel.f03 new file mode 100644 index 000000000..76d0aa0b7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SelfScatteringKernel.f03 @@ -0,0 +1,302 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSelfScatteringKernel +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SelfScatteringKernelDefaultConst() & + bind(C, name='SelfScatteringKernelDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SelfScatteringKernelDefaultConst +end function SelfScatteringKernelDefaultConst + +!! Create, default, non-const +function SelfScatteringKernelDefault() & + bind(C, name='SelfScatteringKernelDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SelfScatteringKernelDefault +end function SelfScatteringKernelDefault + +!! Create, general, const +function SelfScatteringKernelCreateConst( & + symmetric, & + gridded3d, & + SCTApproximation, & + freeGasApproximation & +) & + bind(C, name='SelfScatteringKernelCreateConst') + use iso_c_binding + implicit none + logical(c_bool), intent(in), value :: symmetric + type(c_ptr), intent(in), value :: gridded3d + type(c_ptr), intent(in), value :: SCTApproximation + type(c_ptr), intent(in), value :: freeGasApproximation + type(c_ptr) :: SelfScatteringKernelCreateConst +end function SelfScatteringKernelCreateConst + +!! Create, general, non-const +function SelfScatteringKernelCreate( & + symmetric, & + gridded3d, & + SCTApproximation, & + freeGasApproximation & +) & + bind(C, name='SelfScatteringKernelCreate') + use iso_c_binding + implicit none + logical(c_bool), intent(in), value :: symmetric + type(c_ptr), intent(in), value :: gridded3d + type(c_ptr), intent(in), value :: SCTApproximation + type(c_ptr), intent(in), value :: freeGasApproximation + type(c_ptr) :: SelfScatteringKernelCreate +end function SelfScatteringKernelCreate + +!! Assign +subroutine SelfScatteringKernelAssign(handleLHS, handleRHS) & + bind(C, name='SelfScatteringKernelAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SelfScatteringKernelAssign + +!! Delete +subroutine SelfScatteringKernelDelete(handle) & + bind(C, name='SelfScatteringKernelDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SelfScatteringKernelDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SelfScatteringKernelRead(handle, filename, filenameSize) & + bind(C, name='SelfScatteringKernelRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SelfScatteringKernelRead +end function SelfScatteringKernelRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SelfScatteringKernelWrite(handle, filename, filenameSize) & + bind(C, name='SelfScatteringKernelWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SelfScatteringKernelWrite +end function SelfScatteringKernelWrite + +!! Print to standard output, in our prettyprinting format +function SelfScatteringKernelPrint(handle) & + bind(C, name='SelfScatteringKernelPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SelfScatteringKernelPrint +end function SelfScatteringKernelPrint + +!! Print to standard output, as XML +function SelfScatteringKernelPrintXML(handle) & + bind(C, name='SelfScatteringKernelPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SelfScatteringKernelPrintXML +end function SelfScatteringKernelPrintXML + +!! Print to standard output, as JSON +function SelfScatteringKernelPrintJSON(handle) & + bind(C, name='SelfScatteringKernelPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SelfScatteringKernelPrintJSON +end function SelfScatteringKernelPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: symmetric +!! ----------------------------------------------------------------------------- + +!! Has +function SelfScatteringKernelSymmetricHas(handle) & + bind(C, name='SelfScatteringKernelSymmetricHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SelfScatteringKernelSymmetricHas +end function SelfScatteringKernelSymmetricHas + +!! Get +function SelfScatteringKernelSymmetricGet(handle) & + bind(C, name='SelfScatteringKernelSymmetricGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: SelfScatteringKernelSymmetricGet +end function SelfScatteringKernelSymmetricGet + +!! Set +subroutine SelfScatteringKernelSymmetricSet(handle, symmetric) & + bind(C, name='SelfScatteringKernelSymmetricSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: symmetric +end subroutine SelfScatteringKernelSymmetricSet + + +!! ----------------------------------------------------------------------------- +!! Child: gridded3d +!! ----------------------------------------------------------------------------- + +!! Has +function SelfScatteringKernelGridded3dHas(handle) & + bind(C, name='SelfScatteringKernelGridded3dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SelfScatteringKernelGridded3dHas +end function SelfScatteringKernelGridded3dHas + +!! Get, const +function SelfScatteringKernelGridded3dGetConst(handle) & + bind(C, name='SelfScatteringKernelGridded3dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SelfScatteringKernelGridded3dGetConst +end function SelfScatteringKernelGridded3dGetConst + +!! Get, non-const +function SelfScatteringKernelGridded3dGet(handle) & + bind(C, name='SelfScatteringKernelGridded3dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: SelfScatteringKernelGridded3dGet +end function SelfScatteringKernelGridded3dGet + +!! Set +subroutine SelfScatteringKernelGridded3dSet(handle, fieldHandle) & + bind(C, name='SelfScatteringKernelGridded3dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SelfScatteringKernelGridded3dSet + + +!! ----------------------------------------------------------------------------- +!! Child: SCTApproximation +!! ----------------------------------------------------------------------------- + +!! Has +function SelfScatteringKernelSCTApproximationHas(handle) & + bind(C, name='SelfScatteringKernelSCTApproximationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SelfScatteringKernelSCTApproximationHas +end function SelfScatteringKernelSCTApproximationHas + +!! Get, const +function SelfScatteringKernelSCTApproximationGetConst(handle) & + bind(C, name='SelfScatteringKernelSCTApproximationGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SelfScatteringKernelSCTApproximationGetConst +end function SelfScatteringKernelSCTApproximationGetConst + +!! Get, non-const +function SelfScatteringKernelSCTApproximationGet(handle) & + bind(C, name='SelfScatteringKernelSCTApproximationGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: SelfScatteringKernelSCTApproximationGet +end function SelfScatteringKernelSCTApproximationGet + +!! Set +subroutine SelfScatteringKernelSCTApproximationSet(handle, fieldHandle) & + bind(C, name='SelfScatteringKernelSCTApproximationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SelfScatteringKernelSCTApproximationSet + + +!! ----------------------------------------------------------------------------- +!! Child: freeGasApproximation +!! ----------------------------------------------------------------------------- + +!! Has +function SelfScatteringKernelFreeGasApproximationHas(handle) & + bind(C, name='SelfScatteringKernelFreeGasApproximationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SelfScatteringKernelFreeGasApproximationHas +end function SelfScatteringKernelFreeGasApproximationHas + +!! Get, const +function SelfScatteringKernelFreeGasApproximationGetConst(handle) & + bind(C, name='SelfScatteringKernelFreeGasApproximationGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SelfScatteringKernelFreeGasApproximationGetConst +end function SelfScatteringKernelFreeGasApproximationGetConst + +!! Get, non-const +function SelfScatteringKernelFreeGasApproximationGet(handle) & + bind(C, name='SelfScatteringKernelFreeGasApproximationGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: SelfScatteringKernelFreeGasApproximationGet +end function SelfScatteringKernelFreeGasApproximationGet + +!! Set +subroutine SelfScatteringKernelFreeGasApproximationSet(handle, fieldHandle) & + bind(C, name='SelfScatteringKernelFreeGasApproximationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SelfScatteringKernelFreeGasApproximationSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSelfScatteringKernel diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Shell.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Shell.f03 new file mode 100644 index 000000000..f09fe9613 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Shell.f03 @@ -0,0 +1,253 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalShell +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ShellDefaultConst() & + bind(C, name='ShellDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ShellDefaultConst +end function ShellDefaultConst + +!! Create, default, non-const +function ShellDefault() & + bind(C, name='ShellDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ShellDefault +end function ShellDefault + +!! Create, general, const +function ShellCreateConst( & + label, & + value, & + uncertainty, & + labelSize & +) & + bind(C, name='ShellCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: value + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: ShellCreateConst +end function ShellCreateConst + +!! Create, general, non-const +function ShellCreate( & + label, & + value, & + uncertainty, & + labelSize & +) & + bind(C, name='ShellCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: value + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: ShellCreate +end function ShellCreate + +!! Assign +subroutine ShellAssign(handleLHS, handleRHS) & + bind(C, name='ShellAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ShellAssign + +!! Delete +subroutine ShellDelete(handle) & + bind(C, name='ShellDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ShellDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ShellRead(handle, filename, filenameSize) & + bind(C, name='ShellRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ShellRead +end function ShellRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ShellWrite(handle, filename, filenameSize) & + bind(C, name='ShellWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ShellWrite +end function ShellWrite + +!! Print to standard output, in our prettyprinting format +function ShellPrint(handle) & + bind(C, name='ShellPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShellPrint +end function ShellPrint + +!! Print to standard output, as XML +function ShellPrintXML(handle) & + bind(C, name='ShellPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShellPrintXML +end function ShellPrintXML + +!! Print to standard output, as JSON +function ShellPrintJSON(handle) & + bind(C, name='ShellPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShellPrintJSON +end function ShellPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ShellLabelHas(handle) & + bind(C, name='ShellLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShellLabelHas +end function ShellLabelHas + +!! Get +function ShellLabelGet(handle) & + bind(C, name='ShellLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ShellLabelGet +end function ShellLabelGet + +!! Set +subroutine ShellLabelSet(handle, label, labelSize) & + bind(C, name='ShellLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ShellLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function ShellValueHas(handle) & + bind(C, name='ShellValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShellValueHas +end function ShellValueHas + +!! Get +function ShellValueGet(handle) & + bind(C, name='ShellValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: ShellValueGet +end function ShellValueGet + +!! Set +subroutine ShellValueSet(handle, value) & + bind(C, name='ShellValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine ShellValueSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function ShellUncertaintyHas(handle) & + bind(C, name='ShellUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShellUncertaintyHas +end function ShellUncertaintyHas + +!! Get, const +function ShellUncertaintyGetConst(handle) & + bind(C, name='ShellUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ShellUncertaintyGetConst +end function ShellUncertaintyGetConst + +!! Get, non-const +function ShellUncertaintyGet(handle) & + bind(C, name='ShellUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ShellUncertaintyGet +end function ShellUncertaintyGet + +!! Set +subroutine ShellUncertaintySet(handle, fieldHandle) & + bind(C, name='ShellUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ShellUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalShell diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ShortRangeSelfScalingVariance.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ShortRangeSelfScalingVariance.f03 new file mode 100644 index 000000000..30e7a5e79 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ShortRangeSelfScalingVariance.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalShortRangeSelfScalingVariance +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ShortRangeSelfScalingVarianceDefaultConst() & + bind(C, name='ShortRangeSelfScalingVarianceDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ShortRangeSelfScalingVarianceDefaultConst +end function ShortRangeSelfScalingVarianceDefaultConst + +!! Create, default, non-const +function ShortRangeSelfScalingVarianceDefault() & + bind(C, name='ShortRangeSelfScalingVarianceDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ShortRangeSelfScalingVarianceDefault +end function ShortRangeSelfScalingVarianceDefault + +!! Create, general, const +function ShortRangeSelfScalingVarianceCreateConst( & + label, & + type1, & + dependenceOnProcessedGroupWidth, & + gridded2d, & + labelSize, & + type1Size, & + dependenceOnProcessedGroupWidthSize & +) & + bind(C, name='ShortRangeSelfScalingVarianceCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) + integer(c_size_t), intent(in), value :: dependenceOnProcessedGroupWidthSize + character(c_char), intent(in) :: dependenceOnProcessedGroupWidth(dependenceOnProcessedGroupWidthSize) + type(c_ptr), intent(in), value :: gridded2d + type(c_ptr) :: ShortRangeSelfScalingVarianceCreateConst +end function ShortRangeSelfScalingVarianceCreateConst + +!! Create, general, non-const +function ShortRangeSelfScalingVarianceCreate( & + label, & + type1, & + dependenceOnProcessedGroupWidth, & + gridded2d, & + labelSize, & + type1Size, & + dependenceOnProcessedGroupWidthSize & +) & + bind(C, name='ShortRangeSelfScalingVarianceCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) + integer(c_size_t), intent(in), value :: dependenceOnProcessedGroupWidthSize + character(c_char), intent(in) :: dependenceOnProcessedGroupWidth(dependenceOnProcessedGroupWidthSize) + type(c_ptr), intent(in), value :: gridded2d + type(c_ptr) :: ShortRangeSelfScalingVarianceCreate +end function ShortRangeSelfScalingVarianceCreate + +!! Assign +subroutine ShortRangeSelfScalingVarianceAssign(handleLHS, handleRHS) & + bind(C, name='ShortRangeSelfScalingVarianceAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ShortRangeSelfScalingVarianceAssign + +!! Delete +subroutine ShortRangeSelfScalingVarianceDelete(handle) & + bind(C, name='ShortRangeSelfScalingVarianceDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ShortRangeSelfScalingVarianceDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ShortRangeSelfScalingVarianceRead(handle, filename, filenameSize) & + bind(C, name='ShortRangeSelfScalingVarianceRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ShortRangeSelfScalingVarianceRead +end function ShortRangeSelfScalingVarianceRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ShortRangeSelfScalingVarianceWrite(handle, filename, filenameSize) & + bind(C, name='ShortRangeSelfScalingVarianceWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ShortRangeSelfScalingVarianceWrite +end function ShortRangeSelfScalingVarianceWrite + +!! Print to standard output, in our prettyprinting format +function ShortRangeSelfScalingVariancePrint(handle) & + bind(C, name='ShortRangeSelfScalingVariancePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShortRangeSelfScalingVariancePrint +end function ShortRangeSelfScalingVariancePrint + +!! Print to standard output, as XML +function ShortRangeSelfScalingVariancePrintXML(handle) & + bind(C, name='ShortRangeSelfScalingVariancePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShortRangeSelfScalingVariancePrintXML +end function ShortRangeSelfScalingVariancePrintXML + +!! Print to standard output, as JSON +function ShortRangeSelfScalingVariancePrintJSON(handle) & + bind(C, name='ShortRangeSelfScalingVariancePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShortRangeSelfScalingVariancePrintJSON +end function ShortRangeSelfScalingVariancePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ShortRangeSelfScalingVarianceLabelHas(handle) & + bind(C, name='ShortRangeSelfScalingVarianceLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShortRangeSelfScalingVarianceLabelHas +end function ShortRangeSelfScalingVarianceLabelHas + +!! Get +function ShortRangeSelfScalingVarianceLabelGet(handle) & + bind(C, name='ShortRangeSelfScalingVarianceLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ShortRangeSelfScalingVarianceLabelGet +end function ShortRangeSelfScalingVarianceLabelGet + +!! Set +subroutine ShortRangeSelfScalingVarianceLabelSet(handle, label, labelSize) & + bind(C, name='ShortRangeSelfScalingVarianceLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ShortRangeSelfScalingVarianceLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: type +!! ----------------------------------------------------------------------------- + +!! Has +function ShortRangeSelfScalingVarianceTypeHas(handle) & + bind(C, name='ShortRangeSelfScalingVarianceTypeHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShortRangeSelfScalingVarianceTypeHas +end function ShortRangeSelfScalingVarianceTypeHas + +!! Get +function ShortRangeSelfScalingVarianceTypeGet(handle) & + bind(C, name='ShortRangeSelfScalingVarianceTypeGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ShortRangeSelfScalingVarianceTypeGet +end function ShortRangeSelfScalingVarianceTypeGet + +!! Set +subroutine ShortRangeSelfScalingVarianceTypeSet(handle, type1, type1Size) & + bind(C, name='ShortRangeSelfScalingVarianceTypeSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: type1Size + character(c_char), intent(in) :: type1(type1Size) +end subroutine ShortRangeSelfScalingVarianceTypeSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: dependenceOnProcessedGroupWidth +!! ----------------------------------------------------------------------------- + +!! Has +function ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthHas(handle) & + bind(C, name='ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthHas +end function ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthHas + +!! Get +function ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthGet(handle) & + bind(C, name='ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthGet +end function ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthGet + +!! Set +subroutine ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthSet(handle, dependenceOnProcessedGroupWidth, dependenceOnProcessedGroupWidthSize) & + bind(C, name='ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: dependenceOnProcessedGroupWidthSize + character(c_char), intent(in) :: dependenceOnProcessedGroupWidth(dependenceOnProcessedGroupWidthSize) +end subroutine ShortRangeSelfScalingVarianceDependenceOnProcessedGroupWidthSet + + +!! ----------------------------------------------------------------------------- +!! Child: gridded2d +!! ----------------------------------------------------------------------------- + +!! Has +function ShortRangeSelfScalingVarianceGridded2dHas(handle) & + bind(C, name='ShortRangeSelfScalingVarianceGridded2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ShortRangeSelfScalingVarianceGridded2dHas +end function ShortRangeSelfScalingVarianceGridded2dHas + +!! Get, const +function ShortRangeSelfScalingVarianceGridded2dGetConst(handle) & + bind(C, name='ShortRangeSelfScalingVarianceGridded2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ShortRangeSelfScalingVarianceGridded2dGetConst +end function ShortRangeSelfScalingVarianceGridded2dGetConst + +!! Get, non-const +function ShortRangeSelfScalingVarianceGridded2dGet(handle) & + bind(C, name='ShortRangeSelfScalingVarianceGridded2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ShortRangeSelfScalingVarianceGridded2dGet +end function ShortRangeSelfScalingVarianceGridded2dGet + +!! Set +subroutine ShortRangeSelfScalingVarianceGridded2dSet(handle, fieldHandle) & + bind(C, name='ShortRangeSelfScalingVarianceGridded2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ShortRangeSelfScalingVarianceGridded2dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalShortRangeSelfScalingVariance diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SimpleMaxwellianFission.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SimpleMaxwellianFission.f03 new file mode 100644 index 000000000..f22afa5e8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SimpleMaxwellianFission.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSimpleMaxwellianFission +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SimpleMaxwellianFissionDefaultConst() & + bind(C, name='SimpleMaxwellianFissionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SimpleMaxwellianFissionDefaultConst +end function SimpleMaxwellianFissionDefaultConst + +!! Create, default, non-const +function SimpleMaxwellianFissionDefault() & + bind(C, name='SimpleMaxwellianFissionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SimpleMaxwellianFissionDefault +end function SimpleMaxwellianFissionDefault + +!! Create, general, const +function SimpleMaxwellianFissionCreateConst( & + U, & + theta & +) & + bind(C, name='SimpleMaxwellianFissionCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: U + type(c_ptr), intent(in), value :: theta + type(c_ptr) :: SimpleMaxwellianFissionCreateConst +end function SimpleMaxwellianFissionCreateConst + +!! Create, general, non-const +function SimpleMaxwellianFissionCreate( & + U, & + theta & +) & + bind(C, name='SimpleMaxwellianFissionCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: U + type(c_ptr), intent(in), value :: theta + type(c_ptr) :: SimpleMaxwellianFissionCreate +end function SimpleMaxwellianFissionCreate + +!! Assign +subroutine SimpleMaxwellianFissionAssign(handleLHS, handleRHS) & + bind(C, name='SimpleMaxwellianFissionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SimpleMaxwellianFissionAssign + +!! Delete +subroutine SimpleMaxwellianFissionDelete(handle) & + bind(C, name='SimpleMaxwellianFissionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SimpleMaxwellianFissionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SimpleMaxwellianFissionRead(handle, filename, filenameSize) & + bind(C, name='SimpleMaxwellianFissionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SimpleMaxwellianFissionRead +end function SimpleMaxwellianFissionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SimpleMaxwellianFissionWrite(handle, filename, filenameSize) & + bind(C, name='SimpleMaxwellianFissionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SimpleMaxwellianFissionWrite +end function SimpleMaxwellianFissionWrite + +!! Print to standard output, in our prettyprinting format +function SimpleMaxwellianFissionPrint(handle) & + bind(C, name='SimpleMaxwellianFissionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SimpleMaxwellianFissionPrint +end function SimpleMaxwellianFissionPrint + +!! Print to standard output, as XML +function SimpleMaxwellianFissionPrintXML(handle) & + bind(C, name='SimpleMaxwellianFissionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SimpleMaxwellianFissionPrintXML +end function SimpleMaxwellianFissionPrintXML + +!! Print to standard output, as JSON +function SimpleMaxwellianFissionPrintJSON(handle) & + bind(C, name='SimpleMaxwellianFissionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SimpleMaxwellianFissionPrintJSON +end function SimpleMaxwellianFissionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: U +!! ----------------------------------------------------------------------------- + +!! Has +function SimpleMaxwellianFissionUHas(handle) & + bind(C, name='SimpleMaxwellianFissionUHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SimpleMaxwellianFissionUHas +end function SimpleMaxwellianFissionUHas + +!! Get, const +function SimpleMaxwellianFissionUGetConst(handle) & + bind(C, name='SimpleMaxwellianFissionUGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SimpleMaxwellianFissionUGetConst +end function SimpleMaxwellianFissionUGetConst + +!! Get, non-const +function SimpleMaxwellianFissionUGet(handle) & + bind(C, name='SimpleMaxwellianFissionUGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: SimpleMaxwellianFissionUGet +end function SimpleMaxwellianFissionUGet + +!! Set +subroutine SimpleMaxwellianFissionUSet(handle, fieldHandle) & + bind(C, name='SimpleMaxwellianFissionUSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SimpleMaxwellianFissionUSet + + +!! ----------------------------------------------------------------------------- +!! Child: theta +!! ----------------------------------------------------------------------------- + +!! Has +function SimpleMaxwellianFissionThetaHas(handle) & + bind(C, name='SimpleMaxwellianFissionThetaHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SimpleMaxwellianFissionThetaHas +end function SimpleMaxwellianFissionThetaHas + +!! Get, const +function SimpleMaxwellianFissionThetaGetConst(handle) & + bind(C, name='SimpleMaxwellianFissionThetaGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SimpleMaxwellianFissionThetaGetConst +end function SimpleMaxwellianFissionThetaGetConst + +!! Get, non-const +function SimpleMaxwellianFissionThetaGet(handle) & + bind(C, name='SimpleMaxwellianFissionThetaGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: SimpleMaxwellianFissionThetaGet +end function SimpleMaxwellianFissionThetaGet + +!! Set +subroutine SimpleMaxwellianFissionThetaSet(handle, fieldHandle) & + bind(C, name='SimpleMaxwellianFissionThetaSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SimpleMaxwellianFissionThetaSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSimpleMaxwellianFission diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Slice.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Slice.f03 new file mode 100644 index 000000000..8c6cd29e6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Slice.f03 @@ -0,0 +1,316 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSlice +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SliceDefaultConst() & + bind(C, name='SliceDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SliceDefaultConst +end function SliceDefaultConst + +!! Create, default, non-const +function SliceDefault() & + bind(C, name='SliceDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SliceDefault +end function SliceDefault + +!! Create, general, const +function SliceCreateConst( & + dimension, & + domainValue, & + domainMin, & + domainMax, & + domainUnit, & + domainUnitSize & +) & + bind(C, name='SliceCreateConst') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: dimension + integer(c_int), intent(in), value :: domainValue + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) + type(c_ptr) :: SliceCreateConst +end function SliceCreateConst + +!! Create, general, non-const +function SliceCreate( & + dimension, & + domainValue, & + domainMin, & + domainMax, & + domainUnit, & + domainUnitSize & +) & + bind(C, name='SliceCreate') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: dimension + integer(c_int), intent(in), value :: domainValue + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) + type(c_ptr) :: SliceCreate +end function SliceCreate + +!! Assign +subroutine SliceAssign(handleLHS, handleRHS) & + bind(C, name='SliceAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SliceAssign + +!! Delete +subroutine SliceDelete(handle) & + bind(C, name='SliceDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SliceDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SliceRead(handle, filename, filenameSize) & + bind(C, name='SliceRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SliceRead +end function SliceRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SliceWrite(handle, filename, filenameSize) & + bind(C, name='SliceWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SliceWrite +end function SliceWrite + +!! Print to standard output, in our prettyprinting format +function SlicePrint(handle) & + bind(C, name='SlicePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SlicePrint +end function SlicePrint + +!! Print to standard output, as XML +function SlicePrintXML(handle) & + bind(C, name='SlicePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SlicePrintXML +end function SlicePrintXML + +!! Print to standard output, as JSON +function SlicePrintJSON(handle) & + bind(C, name='SlicePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SlicePrintJSON +end function SlicePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: dimension +!! ----------------------------------------------------------------------------- + +!! Has +function SliceDimensionHas(handle) & + bind(C, name='SliceDimensionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SliceDimensionHas +end function SliceDimensionHas + +!! Get +function SliceDimensionGet(handle) & + bind(C, name='SliceDimensionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SliceDimensionGet +end function SliceDimensionGet + +!! Set +subroutine SliceDimensionSet(handle, dimension) & + bind(C, name='SliceDimensionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: dimension +end subroutine SliceDimensionSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainValue +!! ----------------------------------------------------------------------------- + +!! Has +function SliceDomainValueHas(handle) & + bind(C, name='SliceDomainValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SliceDomainValueHas +end function SliceDomainValueHas + +!! Get +function SliceDomainValueGet(handle) & + bind(C, name='SliceDomainValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SliceDomainValueGet +end function SliceDomainValueGet + +!! Set +subroutine SliceDomainValueSet(handle, domainValue) & + bind(C, name='SliceDomainValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: domainValue +end subroutine SliceDomainValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMin +!! ----------------------------------------------------------------------------- + +!! Has +function SliceDomainMinHas(handle) & + bind(C, name='SliceDomainMinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SliceDomainMinHas +end function SliceDomainMinHas + +!! Get +function SliceDomainMinGet(handle) & + bind(C, name='SliceDomainMinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: SliceDomainMinGet +end function SliceDomainMinGet + +!! Set +subroutine SliceDomainMinSet(handle, domainMin) & + bind(C, name='SliceDomainMinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMin +end subroutine SliceDomainMinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMax +!! ----------------------------------------------------------------------------- + +!! Has +function SliceDomainMaxHas(handle) & + bind(C, name='SliceDomainMaxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SliceDomainMaxHas +end function SliceDomainMaxHas + +!! Get +function SliceDomainMaxGet(handle) & + bind(C, name='SliceDomainMaxGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: SliceDomainMaxGet +end function SliceDomainMaxGet + +!! Set +subroutine SliceDomainMaxSet(handle, domainMax) & + bind(C, name='SliceDomainMaxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMax +end subroutine SliceDomainMaxSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainUnit +!! ----------------------------------------------------------------------------- + +!! Has +function SliceDomainUnitHas(handle) & + bind(C, name='SliceDomainUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SliceDomainUnitHas +end function SliceDomainUnitHas + +!! Get +function SliceDomainUnitGet(handle) & + bind(C, name='SliceDomainUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SliceDomainUnitGet +end function SliceDomainUnitGet + +!! Set +subroutine SliceDomainUnitSet(handle, domainUnit, domainUnitSize) & + bind(C, name='SliceDomainUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) +end subroutine SliceDomainUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSlice diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Slices.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Slices.f03 new file mode 100644 index 000000000..a468cba66 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Slices.f03 @@ -0,0 +1,431 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSlices +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SlicesDefaultConst() & + bind(C, name='SlicesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SlicesDefaultConst +end function SlicesDefaultConst + +!! Create, default, non-const +function SlicesDefault() & + bind(C, name='SlicesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SlicesDefault +end function SlicesDefault + +!! Create, general, const +function SlicesCreateConst( & + slice, sliceSize & +) & + bind(C, name='SlicesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: sliceSize + type(c_ptr), intent(in) :: slice(sliceSize) + type(c_ptr) :: SlicesCreateConst +end function SlicesCreateConst + +!! Create, general, non-const +function SlicesCreate( & + slice, sliceSize & +) & + bind(C, name='SlicesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: sliceSize + type(c_ptr), intent(in) :: slice(sliceSize) + type(c_ptr) :: SlicesCreate +end function SlicesCreate + +!! Assign +subroutine SlicesAssign(handleLHS, handleRHS) & + bind(C, name='SlicesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SlicesAssign + +!! Delete +subroutine SlicesDelete(handle) & + bind(C, name='SlicesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SlicesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SlicesRead(handle, filename, filenameSize) & + bind(C, name='SlicesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SlicesRead +end function SlicesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SlicesWrite(handle, filename, filenameSize) & + bind(C, name='SlicesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SlicesWrite +end function SlicesWrite + +!! Print to standard output, in our prettyprinting format +function SlicesPrint(handle) & + bind(C, name='SlicesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SlicesPrint +end function SlicesPrint + +!! Print to standard output, as XML +function SlicesPrintXML(handle) & + bind(C, name='SlicesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SlicesPrintXML +end function SlicesPrintXML + +!! Print to standard output, as JSON +function SlicesPrintJSON(handle) & + bind(C, name='SlicesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SlicesPrintJSON +end function SlicesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: slice +!! ----------------------------------------------------------------------------- + +!! Has +function SlicesSliceHas(handle) & + bind(C, name='SlicesSliceHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SlicesSliceHas +end function SlicesSliceHas + +!! Clear +subroutine SlicesSliceClear(handle) & + bind(C, name='SlicesSliceClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SlicesSliceClear + +!! Size +function SlicesSliceSize(handle) & + bind(C, name='SlicesSliceSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: SlicesSliceSize +end function SlicesSliceSize + +!! Add +subroutine SlicesSliceAdd(handle, fieldHandle) & + bind(C, name='SlicesSliceAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SlicesSliceAdd + +!! Get, by index \in [0,size), const +function SlicesSliceGetConst(handle, index) & + bind(C, name='SlicesSliceGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SlicesSliceGetConst +end function SlicesSliceGetConst + +!! Get, by index \in [0,size), non-const +function SlicesSliceGet(handle, index) & + bind(C, name='SlicesSliceGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SlicesSliceGet +end function SlicesSliceGet + +!! Set, by index \in [0,size) +subroutine SlicesSliceSet(handle, index, fieldHandle) & + bind(C, name='SlicesSliceSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SlicesSliceSet + +!! ------------------------ +!! Re: metadatum dimension +!! ------------------------ + +!! Has, by dimension +function SlicesSliceHasByDimension(handle, meta) & + bind(C, name='SlicesSliceHasByDimension') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: SlicesSliceHasByDimension +end function SlicesSliceHasByDimension + +!! Get, by dimension, const +function SlicesSliceGetByDimensionConst(handle, meta) & + bind(C, name='SlicesSliceGetByDimensionConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: SlicesSliceGetByDimensionConst +end function SlicesSliceGetByDimensionConst + +!! Get, by dimension, non-const +function SlicesSliceGetByDimension(handle, meta) & + bind(C, name='SlicesSliceGetByDimension') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: SlicesSliceGetByDimension +end function SlicesSliceGetByDimension + +!! Set, by dimension +subroutine SlicesSliceSetByDimension(handle, meta, fieldHandle) & + bind(C, name='SlicesSliceSetByDimension') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SlicesSliceSetByDimension + +!! ------------------------ +!! Re: metadatum domainValue +!! ------------------------ + +!! Has, by domainValue +function SlicesSliceHasByDomainValue(handle, meta) & + bind(C, name='SlicesSliceHasByDomainValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: SlicesSliceHasByDomainValue +end function SlicesSliceHasByDomainValue + +!! Get, by domainValue, const +function SlicesSliceGetByDomainValueConst(handle, meta) & + bind(C, name='SlicesSliceGetByDomainValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: SlicesSliceGetByDomainValueConst +end function SlicesSliceGetByDomainValueConst + +!! Get, by domainValue, non-const +function SlicesSliceGetByDomainValue(handle, meta) & + bind(C, name='SlicesSliceGetByDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: SlicesSliceGetByDomainValue +end function SlicesSliceGetByDomainValue + +!! Set, by domainValue +subroutine SlicesSliceSetByDomainValue(handle, meta, fieldHandle) & + bind(C, name='SlicesSliceSetByDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SlicesSliceSetByDomainValue + +!! ------------------------ +!! Re: metadatum domainMin +!! ------------------------ + +!! Has, by domainMin +function SlicesSliceHasByDomainMin(handle, meta) & + bind(C, name='SlicesSliceHasByDomainMin') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: SlicesSliceHasByDomainMin +end function SlicesSliceHasByDomainMin + +!! Get, by domainMin, const +function SlicesSliceGetByDomainMinConst(handle, meta) & + bind(C, name='SlicesSliceGetByDomainMinConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: SlicesSliceGetByDomainMinConst +end function SlicesSliceGetByDomainMinConst + +!! Get, by domainMin, non-const +function SlicesSliceGetByDomainMin(handle, meta) & + bind(C, name='SlicesSliceGetByDomainMin') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: SlicesSliceGetByDomainMin +end function SlicesSliceGetByDomainMin + +!! Set, by domainMin +subroutine SlicesSliceSetByDomainMin(handle, meta, fieldHandle) & + bind(C, name='SlicesSliceSetByDomainMin') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SlicesSliceSetByDomainMin + +!! ------------------------ +!! Re: metadatum domainMax +!! ------------------------ + +!! Has, by domainMax +function SlicesSliceHasByDomainMax(handle, meta) & + bind(C, name='SlicesSliceHasByDomainMax') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: SlicesSliceHasByDomainMax +end function SlicesSliceHasByDomainMax + +!! Get, by domainMax, const +function SlicesSliceGetByDomainMaxConst(handle, meta) & + bind(C, name='SlicesSliceGetByDomainMaxConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: SlicesSliceGetByDomainMaxConst +end function SlicesSliceGetByDomainMaxConst + +!! Get, by domainMax, non-const +function SlicesSliceGetByDomainMax(handle, meta) & + bind(C, name='SlicesSliceGetByDomainMax') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: SlicesSliceGetByDomainMax +end function SlicesSliceGetByDomainMax + +!! Set, by domainMax +subroutine SlicesSliceSetByDomainMax(handle, meta, fieldHandle) & + bind(C, name='SlicesSliceSetByDomainMax') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SlicesSliceSetByDomainMax + +!! ------------------------ +!! Re: metadatum domainUnit +!! ------------------------ + +!! Has, by domainUnit +function SlicesSliceHasByDomainUnit(handle, meta, metaSize) & + bind(C, name='SlicesSliceHasByDomainUnit') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: SlicesSliceHasByDomainUnit +end function SlicesSliceHasByDomainUnit + +!! Get, by domainUnit, const +function SlicesSliceGetByDomainUnitConst(handle, meta, metaSize) & + bind(C, name='SlicesSliceGetByDomainUnitConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SlicesSliceGetByDomainUnitConst +end function SlicesSliceGetByDomainUnitConst + +!! Get, by domainUnit, non-const +function SlicesSliceGetByDomainUnit(handle, meta, metaSize) & + bind(C, name='SlicesSliceGetByDomainUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SlicesSliceGetByDomainUnit +end function SlicesSliceGetByDomainUnit + +!! Set, by domainUnit +subroutine SlicesSliceSetByDomainUnit(handle, meta, metaSize, fieldHandle) & + bind(C, name='SlicesSliceSetByDomainUnit') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SlicesSliceSetByDomainUnit + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSlices diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Spectra.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Spectra.f03 new file mode 100644 index 000000000..e8a8aeab8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Spectra.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSpectra +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SpectraDefaultConst() & + bind(C, name='SpectraDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SpectraDefaultConst +end function SpectraDefaultConst + +!! Create, default, non-const +function SpectraDefault() & + bind(C, name='SpectraDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SpectraDefault +end function SpectraDefault + +!! Create, general, const +function SpectraCreateConst( & + spectrum, spectrumSize & +) & + bind(C, name='SpectraCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: spectrumSize + type(c_ptr), intent(in) :: spectrum(spectrumSize) + type(c_ptr) :: SpectraCreateConst +end function SpectraCreateConst + +!! Create, general, non-const +function SpectraCreate( & + spectrum, spectrumSize & +) & + bind(C, name='SpectraCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: spectrumSize + type(c_ptr), intent(in) :: spectrum(spectrumSize) + type(c_ptr) :: SpectraCreate +end function SpectraCreate + +!! Assign +subroutine SpectraAssign(handleLHS, handleRHS) & + bind(C, name='SpectraAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SpectraAssign + +!! Delete +subroutine SpectraDelete(handle) & + bind(C, name='SpectraDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SpectraDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SpectraRead(handle, filename, filenameSize) & + bind(C, name='SpectraRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SpectraRead +end function SpectraRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SpectraWrite(handle, filename, filenameSize) & + bind(C, name='SpectraWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SpectraWrite +end function SpectraWrite + +!! Print to standard output, in our prettyprinting format +function SpectraPrint(handle) & + bind(C, name='SpectraPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpectraPrint +end function SpectraPrint + +!! Print to standard output, as XML +function SpectraPrintXML(handle) & + bind(C, name='SpectraPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpectraPrintXML +end function SpectraPrintXML + +!! Print to standard output, as JSON +function SpectraPrintJSON(handle) & + bind(C, name='SpectraPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpectraPrintJSON +end function SpectraPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: spectrum +!! ----------------------------------------------------------------------------- + +!! Has +function SpectraSpectrumHas(handle) & + bind(C, name='SpectraSpectrumHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpectraSpectrumHas +end function SpectraSpectrumHas + +!! Clear +subroutine SpectraSpectrumClear(handle) & + bind(C, name='SpectraSpectrumClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SpectraSpectrumClear + +!! Size +function SpectraSpectrumSize(handle) & + bind(C, name='SpectraSpectrumSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: SpectraSpectrumSize +end function SpectraSpectrumSize + +!! Add +subroutine SpectraSpectrumAdd(handle, fieldHandle) & + bind(C, name='SpectraSpectrumAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpectraSpectrumAdd + +!! Get, by index \in [0,size), const +function SpectraSpectrumGetConst(handle, index) & + bind(C, name='SpectraSpectrumGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SpectraSpectrumGetConst +end function SpectraSpectrumGetConst + +!! Get, by index \in [0,size), non-const +function SpectraSpectrumGet(handle, index) & + bind(C, name='SpectraSpectrumGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SpectraSpectrumGet +end function SpectraSpectrumGet + +!! Set, by index \in [0,size) +subroutine SpectraSpectrumSet(handle, index, fieldHandle) & + bind(C, name='SpectraSpectrumSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpectraSpectrumSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function SpectraSpectrumHasByLabel(handle, meta, metaSize) & + bind(C, name='SpectraSpectrumHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: SpectraSpectrumHasByLabel +end function SpectraSpectrumHasByLabel + +!! Get, by label, const +function SpectraSpectrumGetByLabelConst(handle, meta, metaSize) & + bind(C, name='SpectraSpectrumGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SpectraSpectrumGetByLabelConst +end function SpectraSpectrumGetByLabelConst + +!! Get, by label, non-const +function SpectraSpectrumGetByLabel(handle, meta, metaSize) & + bind(C, name='SpectraSpectrumGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SpectraSpectrumGetByLabel +end function SpectraSpectrumGetByLabel + +!! Set, by label +subroutine SpectraSpectrumSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='SpectraSpectrumSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpectraSpectrumSetByLabel + +!! ------------------------ +!! Re: metadatum pid +!! ------------------------ + +!! Has, by pid +function SpectraSpectrumHasByPid(handle, meta, metaSize) & + bind(C, name='SpectraSpectrumHasByPid') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: SpectraSpectrumHasByPid +end function SpectraSpectrumHasByPid + +!! Get, by pid, const +function SpectraSpectrumGetByPidConst(handle, meta, metaSize) & + bind(C, name='SpectraSpectrumGetByPidConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SpectraSpectrumGetByPidConst +end function SpectraSpectrumGetByPidConst + +!! Get, by pid, non-const +function SpectraSpectrumGetByPid(handle, meta, metaSize) & + bind(C, name='SpectraSpectrumGetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SpectraSpectrumGetByPid +end function SpectraSpectrumGetByPid + +!! Set, by pid +subroutine SpectraSpectrumSetByPid(handle, meta, metaSize, fieldHandle) & + bind(C, name='SpectraSpectrumSetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpectraSpectrumSetByPid + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSpectra diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Spectrum.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Spectrum.f03 new file mode 100644 index 000000000..c87f3fcc0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Spectrum.f03 @@ -0,0 +1,382 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSpectrum +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SpectrumDefaultConst() & + bind(C, name='SpectrumDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SpectrumDefaultConst +end function SpectrumDefaultConst + +!! Create, default, non-const +function SpectrumDefault() & + bind(C, name='SpectrumDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SpectrumDefault +end function SpectrumDefault + +!! Create, general, const +function SpectrumCreateConst( & + label, & + pid, & + discrete, discreteSize, & + continuum, & + labelSize, & + pidSize & +) & + bind(C, name='SpectrumCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: discreteSize + type(c_ptr), intent(in) :: discrete(discreteSize) + type(c_ptr), intent(in), value :: continuum + type(c_ptr) :: SpectrumCreateConst +end function SpectrumCreateConst + +!! Create, general, non-const +function SpectrumCreate( & + label, & + pid, & + discrete, discreteSize, & + continuum, & + labelSize, & + pidSize & +) & + bind(C, name='SpectrumCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: discreteSize + type(c_ptr), intent(in) :: discrete(discreteSize) + type(c_ptr), intent(in), value :: continuum + type(c_ptr) :: SpectrumCreate +end function SpectrumCreate + +!! Assign +subroutine SpectrumAssign(handleLHS, handleRHS) & + bind(C, name='SpectrumAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SpectrumAssign + +!! Delete +subroutine SpectrumDelete(handle) & + bind(C, name='SpectrumDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SpectrumDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SpectrumRead(handle, filename, filenameSize) & + bind(C, name='SpectrumRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SpectrumRead +end function SpectrumRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SpectrumWrite(handle, filename, filenameSize) & + bind(C, name='SpectrumWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SpectrumWrite +end function SpectrumWrite + +!! Print to standard output, in our prettyprinting format +function SpectrumPrint(handle) & + bind(C, name='SpectrumPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpectrumPrint +end function SpectrumPrint + +!! Print to standard output, as XML +function SpectrumPrintXML(handle) & + bind(C, name='SpectrumPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpectrumPrintXML +end function SpectrumPrintXML + +!! Print to standard output, as JSON +function SpectrumPrintJSON(handle) & + bind(C, name='SpectrumPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpectrumPrintJSON +end function SpectrumPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function SpectrumLabelHas(handle) & + bind(C, name='SpectrumLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpectrumLabelHas +end function SpectrumLabelHas + +!! Get +function SpectrumLabelGet(handle) & + bind(C, name='SpectrumLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SpectrumLabelGet +end function SpectrumLabelGet + +!! Set +subroutine SpectrumLabelSet(handle, label, labelSize) & + bind(C, name='SpectrumLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine SpectrumLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function SpectrumPidHas(handle) & + bind(C, name='SpectrumPidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpectrumPidHas +end function SpectrumPidHas + +!! Get +function SpectrumPidGet(handle) & + bind(C, name='SpectrumPidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SpectrumPidGet +end function SpectrumPidGet + +!! Set +subroutine SpectrumPidSet(handle, pid, pidSize) & + bind(C, name='SpectrumPidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine SpectrumPidSet + + +!! ----------------------------------------------------------------------------- +!! Child: discrete +!! ----------------------------------------------------------------------------- + +!! Has +function SpectrumDiscreteHas(handle) & + bind(C, name='SpectrumDiscreteHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpectrumDiscreteHas +end function SpectrumDiscreteHas + +!! Clear +subroutine SpectrumDiscreteClear(handle) & + bind(C, name='SpectrumDiscreteClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SpectrumDiscreteClear + +!! Size +function SpectrumDiscreteSize(handle) & + bind(C, name='SpectrumDiscreteSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: SpectrumDiscreteSize +end function SpectrumDiscreteSize + +!! Add +subroutine SpectrumDiscreteAdd(handle, fieldHandle) & + bind(C, name='SpectrumDiscreteAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpectrumDiscreteAdd + +!! Get, by index \in [0,size), const +function SpectrumDiscreteGetConst(handle, index) & + bind(C, name='SpectrumDiscreteGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SpectrumDiscreteGetConst +end function SpectrumDiscreteGetConst + +!! Get, by index \in [0,size), non-const +function SpectrumDiscreteGet(handle, index) & + bind(C, name='SpectrumDiscreteGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SpectrumDiscreteGet +end function SpectrumDiscreteGet + +!! Set, by index \in [0,size) +subroutine SpectrumDiscreteSet(handle, index, fieldHandle) & + bind(C, name='SpectrumDiscreteSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpectrumDiscreteSet + +!! ------------------------ +!! Re: metadatum type +!! ------------------------ + +!! Has, by type +function SpectrumDiscreteHasByType(handle, meta, metaSize) & + bind(C, name='SpectrumDiscreteHasByType') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: SpectrumDiscreteHasByType +end function SpectrumDiscreteHasByType + +!! Get, by type, const +function SpectrumDiscreteGetByTypeConst(handle, meta, metaSize) & + bind(C, name='SpectrumDiscreteGetByTypeConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SpectrumDiscreteGetByTypeConst +end function SpectrumDiscreteGetByTypeConst + +!! Get, by type, non-const +function SpectrumDiscreteGetByType(handle, meta, metaSize) & + bind(C, name='SpectrumDiscreteGetByType') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SpectrumDiscreteGetByType +end function SpectrumDiscreteGetByType + +!! Set, by type +subroutine SpectrumDiscreteSetByType(handle, meta, metaSize, fieldHandle) & + bind(C, name='SpectrumDiscreteSetByType') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpectrumDiscreteSetByType + + +!! ----------------------------------------------------------------------------- +!! Child: continuum +!! ----------------------------------------------------------------------------- + +!! Has +function SpectrumContinuumHas(handle) & + bind(C, name='SpectrumContinuumHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpectrumContinuumHas +end function SpectrumContinuumHas + +!! Get, const +function SpectrumContinuumGetConst(handle) & + bind(C, name='SpectrumContinuumGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SpectrumContinuumGetConst +end function SpectrumContinuumGetConst + +!! Get, non-const +function SpectrumContinuumGet(handle) & + bind(C, name='SpectrumContinuumGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: SpectrumContinuumGet +end function SpectrumContinuumGet + +!! Set +subroutine SpectrumContinuumSet(handle, fieldHandle) & + bind(C, name='SpectrumContinuumSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpectrumContinuumSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSpectrum diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Spin.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Spin.f03 new file mode 100644 index 000000000..535bb278f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Spin.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSpin +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SpinDefaultConst() & + bind(C, name='SpinDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SpinDefaultConst +end function SpinDefaultConst + +!! Create, default, non-const +function SpinDefault() & + bind(C, name='SpinDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SpinDefault +end function SpinDefault + +!! Create, general, const +function SpinCreateConst( & + fraction & +) & + bind(C, name='SpinCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: fraction + type(c_ptr) :: SpinCreateConst +end function SpinCreateConst + +!! Create, general, non-const +function SpinCreate( & + fraction & +) & + bind(C, name='SpinCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: fraction + type(c_ptr) :: SpinCreate +end function SpinCreate + +!! Assign +subroutine SpinAssign(handleLHS, handleRHS) & + bind(C, name='SpinAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SpinAssign + +!! Delete +subroutine SpinDelete(handle) & + bind(C, name='SpinDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SpinDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SpinRead(handle, filename, filenameSize) & + bind(C, name='SpinRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SpinRead +end function SpinRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SpinWrite(handle, filename, filenameSize) & + bind(C, name='SpinWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SpinWrite +end function SpinWrite + +!! Print to standard output, in our prettyprinting format +function SpinPrint(handle) & + bind(C, name='SpinPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinPrint +end function SpinPrint + +!! Print to standard output, as XML +function SpinPrintXML(handle) & + bind(C, name='SpinPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinPrintXML +end function SpinPrintXML + +!! Print to standard output, as JSON +function SpinPrintJSON(handle) & + bind(C, name='SpinPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinPrintJSON +end function SpinPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: fraction +!! ----------------------------------------------------------------------------- + +!! Has +function SpinFractionHas(handle) & + bind(C, name='SpinFractionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinFractionHas +end function SpinFractionHas + +!! Get, const +function SpinFractionGetConst(handle) & + bind(C, name='SpinFractionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SpinFractionGetConst +end function SpinFractionGetConst + +!! Get, non-const +function SpinFractionGet(handle) & + bind(C, name='SpinFractionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: SpinFractionGet +end function SpinFractionGet + +!! Set +subroutine SpinFractionSet(handle, fieldHandle) & + bind(C, name='SpinFractionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpinFractionSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSpin diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SpinGroup.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SpinGroup.f03 new file mode 100644 index 000000000..ac6a94f7d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SpinGroup.f03 @@ -0,0 +1,334 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSpinGroup +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SpinGroupDefaultConst() & + bind(C, name='SpinGroupDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SpinGroupDefaultConst +end function SpinGroupDefaultConst + +!! Create, default, non-const +function SpinGroupDefault() & + bind(C, name='SpinGroupDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SpinGroupDefault +end function SpinGroupDefault + +!! Create, general, const +function SpinGroupCreateConst( & + label, & + spin, & + parity, & + channels, & + resonanceParameters, & + labelSize & +) & + bind(C, name='SpinGroupCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: spin + integer(c_int), intent(in), value :: parity + type(c_ptr), intent(in), value :: channels + type(c_ptr), intent(in), value :: resonanceParameters + type(c_ptr) :: SpinGroupCreateConst +end function SpinGroupCreateConst + +!! Create, general, non-const +function SpinGroupCreate( & + label, & + spin, & + parity, & + channels, & + resonanceParameters, & + labelSize & +) & + bind(C, name='SpinGroupCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: spin + integer(c_int), intent(in), value :: parity + type(c_ptr), intent(in), value :: channels + type(c_ptr), intent(in), value :: resonanceParameters + type(c_ptr) :: SpinGroupCreate +end function SpinGroupCreate + +!! Assign +subroutine SpinGroupAssign(handleLHS, handleRHS) & + bind(C, name='SpinGroupAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SpinGroupAssign + +!! Delete +subroutine SpinGroupDelete(handle) & + bind(C, name='SpinGroupDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SpinGroupDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SpinGroupRead(handle, filename, filenameSize) & + bind(C, name='SpinGroupRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SpinGroupRead +end function SpinGroupRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SpinGroupWrite(handle, filename, filenameSize) & + bind(C, name='SpinGroupWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SpinGroupWrite +end function SpinGroupWrite + +!! Print to standard output, in our prettyprinting format +function SpinGroupPrint(handle) & + bind(C, name='SpinGroupPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupPrint +end function SpinGroupPrint + +!! Print to standard output, as XML +function SpinGroupPrintXML(handle) & + bind(C, name='SpinGroupPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupPrintXML +end function SpinGroupPrintXML + +!! Print to standard output, as JSON +function SpinGroupPrintJSON(handle) & + bind(C, name='SpinGroupPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupPrintJSON +end function SpinGroupPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function SpinGroupLabelHas(handle) & + bind(C, name='SpinGroupLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupLabelHas +end function SpinGroupLabelHas + +!! Get +function SpinGroupLabelGet(handle) & + bind(C, name='SpinGroupLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SpinGroupLabelGet +end function SpinGroupLabelGet + +!! Set +subroutine SpinGroupLabelSet(handle, label, labelSize) & + bind(C, name='SpinGroupLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine SpinGroupLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: spin +!! ----------------------------------------------------------------------------- + +!! Has +function SpinGroupSpinHas(handle) & + bind(C, name='SpinGroupSpinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupSpinHas +end function SpinGroupSpinHas + +!! Get +function SpinGroupSpinGet(handle) & + bind(C, name='SpinGroupSpinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupSpinGet +end function SpinGroupSpinGet + +!! Set +subroutine SpinGroupSpinSet(handle, spin) & + bind(C, name='SpinGroupSpinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: spin +end subroutine SpinGroupSpinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: parity +!! ----------------------------------------------------------------------------- + +!! Has +function SpinGroupParityHas(handle) & + bind(C, name='SpinGroupParityHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupParityHas +end function SpinGroupParityHas + +!! Get +function SpinGroupParityGet(handle) & + bind(C, name='SpinGroupParityGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupParityGet +end function SpinGroupParityGet + +!! Set +subroutine SpinGroupParitySet(handle, parity) & + bind(C, name='SpinGroupParitySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: parity +end subroutine SpinGroupParitySet + + +!! ----------------------------------------------------------------------------- +!! Child: channels +!! ----------------------------------------------------------------------------- + +!! Has +function SpinGroupChannelsHas(handle) & + bind(C, name='SpinGroupChannelsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupChannelsHas +end function SpinGroupChannelsHas + +!! Get, const +function SpinGroupChannelsGetConst(handle) & + bind(C, name='SpinGroupChannelsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SpinGroupChannelsGetConst +end function SpinGroupChannelsGetConst + +!! Get, non-const +function SpinGroupChannelsGet(handle) & + bind(C, name='SpinGroupChannelsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: SpinGroupChannelsGet +end function SpinGroupChannelsGet + +!! Set +subroutine SpinGroupChannelsSet(handle, fieldHandle) & + bind(C, name='SpinGroupChannelsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpinGroupChannelsSet + + +!! ----------------------------------------------------------------------------- +!! Child: resonanceParameters +!! ----------------------------------------------------------------------------- + +!! Has +function SpinGroupResonanceParametersHas(handle) & + bind(C, name='SpinGroupResonanceParametersHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupResonanceParametersHas +end function SpinGroupResonanceParametersHas + +!! Get, const +function SpinGroupResonanceParametersGetConst(handle) & + bind(C, name='SpinGroupResonanceParametersGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SpinGroupResonanceParametersGetConst +end function SpinGroupResonanceParametersGetConst + +!! Get, non-const +function SpinGroupResonanceParametersGet(handle) & + bind(C, name='SpinGroupResonanceParametersGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: SpinGroupResonanceParametersGet +end function SpinGroupResonanceParametersGet + +!! Set +subroutine SpinGroupResonanceParametersSet(handle, fieldHandle) & + bind(C, name='SpinGroupResonanceParametersSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpinGroupResonanceParametersSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSpinGroup diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SpinGroups.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SpinGroups.f03 new file mode 100644 index 000000000..0f9aef103 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/SpinGroups.f03 @@ -0,0 +1,343 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSpinGroups +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SpinGroupsDefaultConst() & + bind(C, name='SpinGroupsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SpinGroupsDefaultConst +end function SpinGroupsDefaultConst + +!! Create, default, non-const +function SpinGroupsDefault() & + bind(C, name='SpinGroupsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SpinGroupsDefault +end function SpinGroupsDefault + +!! Create, general, const +function SpinGroupsCreateConst( & + spinGroup, spinGroupSize & +) & + bind(C, name='SpinGroupsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: spinGroupSize + type(c_ptr), intent(in) :: spinGroup(spinGroupSize) + type(c_ptr) :: SpinGroupsCreateConst +end function SpinGroupsCreateConst + +!! Create, general, non-const +function SpinGroupsCreate( & + spinGroup, spinGroupSize & +) & + bind(C, name='SpinGroupsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: spinGroupSize + type(c_ptr), intent(in) :: spinGroup(spinGroupSize) + type(c_ptr) :: SpinGroupsCreate +end function SpinGroupsCreate + +!! Assign +subroutine SpinGroupsAssign(handleLHS, handleRHS) & + bind(C, name='SpinGroupsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SpinGroupsAssign + +!! Delete +subroutine SpinGroupsDelete(handle) & + bind(C, name='SpinGroupsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SpinGroupsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SpinGroupsRead(handle, filename, filenameSize) & + bind(C, name='SpinGroupsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SpinGroupsRead +end function SpinGroupsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SpinGroupsWrite(handle, filename, filenameSize) & + bind(C, name='SpinGroupsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SpinGroupsWrite +end function SpinGroupsWrite + +!! Print to standard output, in our prettyprinting format +function SpinGroupsPrint(handle) & + bind(C, name='SpinGroupsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupsPrint +end function SpinGroupsPrint + +!! Print to standard output, as XML +function SpinGroupsPrintXML(handle) & + bind(C, name='SpinGroupsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupsPrintXML +end function SpinGroupsPrintXML + +!! Print to standard output, as JSON +function SpinGroupsPrintJSON(handle) & + bind(C, name='SpinGroupsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupsPrintJSON +end function SpinGroupsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: spinGroup +!! ----------------------------------------------------------------------------- + +!! Has +function SpinGroupsSpinGroupHas(handle) & + bind(C, name='SpinGroupsSpinGroupHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SpinGroupsSpinGroupHas +end function SpinGroupsSpinGroupHas + +!! Clear +subroutine SpinGroupsSpinGroupClear(handle) & + bind(C, name='SpinGroupsSpinGroupClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SpinGroupsSpinGroupClear + +!! Size +function SpinGroupsSpinGroupSize(handle) & + bind(C, name='SpinGroupsSpinGroupSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: SpinGroupsSpinGroupSize +end function SpinGroupsSpinGroupSize + +!! Add +subroutine SpinGroupsSpinGroupAdd(handle, fieldHandle) & + bind(C, name='SpinGroupsSpinGroupAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpinGroupsSpinGroupAdd + +!! Get, by index \in [0,size), const +function SpinGroupsSpinGroupGetConst(handle, index) & + bind(C, name='SpinGroupsSpinGroupGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SpinGroupsSpinGroupGetConst +end function SpinGroupsSpinGroupGetConst + +!! Get, by index \in [0,size), non-const +function SpinGroupsSpinGroupGet(handle, index) & + bind(C, name='SpinGroupsSpinGroupGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SpinGroupsSpinGroupGet +end function SpinGroupsSpinGroupGet + +!! Set, by index \in [0,size) +subroutine SpinGroupsSpinGroupSet(handle, index, fieldHandle) & + bind(C, name='SpinGroupsSpinGroupSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpinGroupsSpinGroupSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function SpinGroupsSpinGroupHasByLabel(handle, meta, metaSize) & + bind(C, name='SpinGroupsSpinGroupHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: SpinGroupsSpinGroupHasByLabel +end function SpinGroupsSpinGroupHasByLabel + +!! Get, by label, const +function SpinGroupsSpinGroupGetByLabelConst(handle, meta, metaSize) & + bind(C, name='SpinGroupsSpinGroupGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SpinGroupsSpinGroupGetByLabelConst +end function SpinGroupsSpinGroupGetByLabelConst + +!! Get, by label, non-const +function SpinGroupsSpinGroupGetByLabel(handle, meta, metaSize) & + bind(C, name='SpinGroupsSpinGroupGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SpinGroupsSpinGroupGetByLabel +end function SpinGroupsSpinGroupGetByLabel + +!! Set, by label +subroutine SpinGroupsSpinGroupSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='SpinGroupsSpinGroupSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpinGroupsSpinGroupSetByLabel + +!! ------------------------ +!! Re: metadatum spin +!! ------------------------ + +!! Has, by spin +function SpinGroupsSpinGroupHasBySpin(handle, meta) & + bind(C, name='SpinGroupsSpinGroupHasBySpin') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: SpinGroupsSpinGroupHasBySpin +end function SpinGroupsSpinGroupHasBySpin + +!! Get, by spin, const +function SpinGroupsSpinGroupGetBySpinConst(handle, meta) & + bind(C, name='SpinGroupsSpinGroupGetBySpinConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: SpinGroupsSpinGroupGetBySpinConst +end function SpinGroupsSpinGroupGetBySpinConst + +!! Get, by spin, non-const +function SpinGroupsSpinGroupGetBySpin(handle, meta) & + bind(C, name='SpinGroupsSpinGroupGetBySpin') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: SpinGroupsSpinGroupGetBySpin +end function SpinGroupsSpinGroupGetBySpin + +!! Set, by spin +subroutine SpinGroupsSpinGroupSetBySpin(handle, meta, fieldHandle) & + bind(C, name='SpinGroupsSpinGroupSetBySpin') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpinGroupsSpinGroupSetBySpin + +!! ------------------------ +!! Re: metadatum parity +!! ------------------------ + +!! Has, by parity +function SpinGroupsSpinGroupHasByParity(handle, meta) & + bind(C, name='SpinGroupsSpinGroupHasByParity') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: SpinGroupsSpinGroupHasByParity +end function SpinGroupsSpinGroupHasByParity + +!! Get, by parity, const +function SpinGroupsSpinGroupGetByParityConst(handle, meta) & + bind(C, name='SpinGroupsSpinGroupGetByParityConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: SpinGroupsSpinGroupGetByParityConst +end function SpinGroupsSpinGroupGetByParityConst + +!! Get, by parity, non-const +function SpinGroupsSpinGroupGetByParity(handle, meta) & + bind(C, name='SpinGroupsSpinGroupGetByParity') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: SpinGroupsSpinGroupGetByParity +end function SpinGroupsSpinGroupGetByParity + +!! Set, by parity +subroutine SpinGroupsSpinGroupSetByParity(handle, meta, fieldHandle) & + bind(C, name='SpinGroupsSpinGroupSetByParity') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SpinGroupsSpinGroupSetByParity + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSpinGroups diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Standard.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Standard.f03 new file mode 100644 index 000000000..d5f77632b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Standard.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalStandard +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function StandardDefaultConst() & + bind(C, name='StandardDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: StandardDefaultConst +end function StandardDefaultConst + +!! Create, default, non-const +function StandardDefault() & + bind(C, name='StandardDefault') + use iso_c_binding + implicit none + type(c_ptr) :: StandardDefault +end function StandardDefault + +!! Create, general, const +function StandardCreateConst( & + Double & +) & + bind(C, name='StandardCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: StandardCreateConst +end function StandardCreateConst + +!! Create, general, non-const +function StandardCreate( & + Double & +) & + bind(C, name='StandardCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr) :: StandardCreate +end function StandardCreate + +!! Assign +subroutine StandardAssign(handleLHS, handleRHS) & + bind(C, name='StandardAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine StandardAssign + +!! Delete +subroutine StandardDelete(handle) & + bind(C, name='StandardDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine StandardDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function StandardRead(handle, filename, filenameSize) & + bind(C, name='StandardRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: StandardRead +end function StandardRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function StandardWrite(handle, filename, filenameSize) & + bind(C, name='StandardWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: StandardWrite +end function StandardWrite + +!! Print to standard output, in our prettyprinting format +function StandardPrint(handle) & + bind(C, name='StandardPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StandardPrint +end function StandardPrint + +!! Print to standard output, as XML +function StandardPrintXML(handle) & + bind(C, name='StandardPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StandardPrintXML +end function StandardPrintXML + +!! Print to standard output, as JSON +function StandardPrintJSON(handle) & + bind(C, name='StandardPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StandardPrintJSON +end function StandardPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: Double +!! ----------------------------------------------------------------------------- + +!! Has +function StandardDoubleHas(handle) & + bind(C, name='StandardDoubleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StandardDoubleHas +end function StandardDoubleHas + +!! Get, const +function StandardDoubleGetConst(handle) & + bind(C, name='StandardDoubleGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: StandardDoubleGetConst +end function StandardDoubleGetConst + +!! Get, non-const +function StandardDoubleGet(handle) & + bind(C, name='StandardDoubleGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: StandardDoubleGet +end function StandardDoubleGet + +!! Set +subroutine StandardDoubleSet(handle, fieldHandle) & + bind(C, name='StandardDoubleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine StandardDoubleSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalStandard diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/String.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/String.f03 new file mode 100644 index 000000000..3ab843a55 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/String.f03 @@ -0,0 +1,254 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalString +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function StringDefaultConst() & + bind(C, name='StringDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: StringDefaultConst +end function StringDefaultConst + +!! Create, default, non-const +function StringDefault() & + bind(C, name='StringDefault') + use iso_c_binding + implicit none + type(c_ptr) :: StringDefault +end function StringDefault + +!! Create, general, const +function StringCreateConst( & + label, & + value, & + unit, & + labelSize, & + valueSize, & + unitSize & +) & + bind(C, name='StringCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: valueSize + character(c_char), intent(in) :: value(valueSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: StringCreateConst +end function StringCreateConst + +!! Create, general, non-const +function StringCreate( & + label, & + value, & + unit, & + labelSize, & + valueSize, & + unitSize & +) & + bind(C, name='StringCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: valueSize + character(c_char), intent(in) :: value(valueSize) + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: StringCreate +end function StringCreate + +!! Assign +subroutine StringAssign(handleLHS, handleRHS) & + bind(C, name='StringAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine StringAssign + +!! Delete +subroutine StringDelete(handle) & + bind(C, name='StringDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine StringDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function StringRead(handle, filename, filenameSize) & + bind(C, name='StringRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: StringRead +end function StringRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function StringWrite(handle, filename, filenameSize) & + bind(C, name='StringWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: StringWrite +end function StringWrite + +!! Print to standard output, in our prettyprinting format +function StringPrint(handle) & + bind(C, name='StringPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StringPrint +end function StringPrint + +!! Print to standard output, as XML +function StringPrintXML(handle) & + bind(C, name='StringPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StringPrintXML +end function StringPrintXML + +!! Print to standard output, as JSON +function StringPrintJSON(handle) & + bind(C, name='StringPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StringPrintJSON +end function StringPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function StringLabelHas(handle) & + bind(C, name='StringLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StringLabelHas +end function StringLabelHas + +!! Get +function StringLabelGet(handle) & + bind(C, name='StringLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: StringLabelGet +end function StringLabelGet + +!! Set +subroutine StringLabelSet(handle, label, labelSize) & + bind(C, name='StringLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine StringLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function StringValueHas(handle) & + bind(C, name='StringValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StringValueHas +end function StringValueHas + +!! Get +function StringValueGet(handle) & + bind(C, name='StringValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: StringValueGet +end function StringValueGet + +!! Set +subroutine StringValueSet(handle, value, valueSize) & + bind(C, name='StringValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: valueSize + character(c_char), intent(in) :: value(valueSize) +end subroutine StringValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function StringUnitHas(handle) & + bind(C, name='StringUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StringUnitHas +end function StringUnitHas + +!! Get +function StringUnitGet(handle) & + bind(C, name='StringUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: StringUnitGet +end function StringUnitGet + +!! Set +subroutine StringUnitSet(handle, unit, unitSize) & + bind(C, name='StringUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine StringUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalString diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Styles.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Styles.f03 new file mode 100644 index 000000000..1fd7dbca7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Styles.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalStyles +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function StylesDefaultConst() & + bind(C, name='StylesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: StylesDefaultConst +end function StylesDefaultConst + +!! Create, default, non-const +function StylesDefault() & + bind(C, name='StylesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: StylesDefault +end function StylesDefault + +!! Create, general, const +function StylesCreateConst( & + evaluated, & + crossSectionReconstructed & +) & + bind(C, name='StylesCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: evaluated + type(c_ptr), intent(in), value :: crossSectionReconstructed + type(c_ptr) :: StylesCreateConst +end function StylesCreateConst + +!! Create, general, non-const +function StylesCreate( & + evaluated, & + crossSectionReconstructed & +) & + bind(C, name='StylesCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: evaluated + type(c_ptr), intent(in), value :: crossSectionReconstructed + type(c_ptr) :: StylesCreate +end function StylesCreate + +!! Assign +subroutine StylesAssign(handleLHS, handleRHS) & + bind(C, name='StylesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine StylesAssign + +!! Delete +subroutine StylesDelete(handle) & + bind(C, name='StylesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine StylesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function StylesRead(handle, filename, filenameSize) & + bind(C, name='StylesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: StylesRead +end function StylesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function StylesWrite(handle, filename, filenameSize) & + bind(C, name='StylesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: StylesWrite +end function StylesWrite + +!! Print to standard output, in our prettyprinting format +function StylesPrint(handle) & + bind(C, name='StylesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StylesPrint +end function StylesPrint + +!! Print to standard output, as XML +function StylesPrintXML(handle) & + bind(C, name='StylesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StylesPrintXML +end function StylesPrintXML + +!! Print to standard output, as JSON +function StylesPrintJSON(handle) & + bind(C, name='StylesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StylesPrintJSON +end function StylesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: evaluated +!! ----------------------------------------------------------------------------- + +!! Has +function StylesEvaluatedHas(handle) & + bind(C, name='StylesEvaluatedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StylesEvaluatedHas +end function StylesEvaluatedHas + +!! Get, const +function StylesEvaluatedGetConst(handle) & + bind(C, name='StylesEvaluatedGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: StylesEvaluatedGetConst +end function StylesEvaluatedGetConst + +!! Get, non-const +function StylesEvaluatedGet(handle) & + bind(C, name='StylesEvaluatedGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: StylesEvaluatedGet +end function StylesEvaluatedGet + +!! Set +subroutine StylesEvaluatedSet(handle, fieldHandle) & + bind(C, name='StylesEvaluatedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine StylesEvaluatedSet + + +!! ----------------------------------------------------------------------------- +!! Child: crossSectionReconstructed +!! ----------------------------------------------------------------------------- + +!! Has +function StylesCrossSectionReconstructedHas(handle) & + bind(C, name='StylesCrossSectionReconstructedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: StylesCrossSectionReconstructedHas +end function StylesCrossSectionReconstructedHas + +!! Get, const +function StylesCrossSectionReconstructedGetConst(handle) & + bind(C, name='StylesCrossSectionReconstructedGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: StylesCrossSectionReconstructedGetConst +end function StylesCrossSectionReconstructedGetConst + +!! Get, non-const +function StylesCrossSectionReconstructedGet(handle) & + bind(C, name='StylesCrossSectionReconstructedGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: StylesCrossSectionReconstructedGet +end function StylesCrossSectionReconstructedGet + +!! Set +subroutine StylesCrossSectionReconstructedSet(handle, fieldHandle) & + bind(C, name='StylesCrossSectionReconstructedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine StylesCrossSectionReconstructedSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalStyles diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Sum.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Sum.f03 new file mode 100644 index 000000000..abc4f25ae --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Sum.f03 @@ -0,0 +1,505 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSum +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SumDefaultConst() & + bind(C, name='SumDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SumDefaultConst +end function SumDefaultConst + +!! Create, default, non-const +function SumDefault() & + bind(C, name='SumDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SumDefault +end function SumDefault + +!! Create, general, const +function SumCreateConst( & + label, & + domainMin, & + domainMax, & + domainUnit, & + summand, summandSize, & + labelSize, & + domainUnitSize & +) & + bind(C, name='SumCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) + integer(c_size_t), intent(in), value :: summandSize + type(c_ptr), intent(in) :: summand(summandSize) + type(c_ptr) :: SumCreateConst +end function SumCreateConst + +!! Create, general, non-const +function SumCreate( & + label, & + domainMin, & + domainMax, & + domainUnit, & + summand, summandSize, & + labelSize, & + domainUnitSize & +) & + bind(C, name='SumCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) + integer(c_size_t), intent(in), value :: summandSize + type(c_ptr), intent(in) :: summand(summandSize) + type(c_ptr) :: SumCreate +end function SumCreate + +!! Assign +subroutine SumAssign(handleLHS, handleRHS) & + bind(C, name='SumAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SumAssign + +!! Delete +subroutine SumDelete(handle) & + bind(C, name='SumDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SumDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SumRead(handle, filename, filenameSize) & + bind(C, name='SumRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SumRead +end function SumRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SumWrite(handle, filename, filenameSize) & + bind(C, name='SumWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SumWrite +end function SumWrite + +!! Print to standard output, in our prettyprinting format +function SumPrint(handle) & + bind(C, name='SumPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumPrint +end function SumPrint + +!! Print to standard output, as XML +function SumPrintXML(handle) & + bind(C, name='SumPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumPrintXML +end function SumPrintXML + +!! Print to standard output, as JSON +function SumPrintJSON(handle) & + bind(C, name='SumPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumPrintJSON +end function SumPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function SumLabelHas(handle) & + bind(C, name='SumLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumLabelHas +end function SumLabelHas + +!! Get +function SumLabelGet(handle) & + bind(C, name='SumLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SumLabelGet +end function SumLabelGet + +!! Set +subroutine SumLabelSet(handle, label, labelSize) & + bind(C, name='SumLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine SumLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMin +!! ----------------------------------------------------------------------------- + +!! Has +function SumDomainMinHas(handle) & + bind(C, name='SumDomainMinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumDomainMinHas +end function SumDomainMinHas + +!! Get +function SumDomainMinGet(handle) & + bind(C, name='SumDomainMinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: SumDomainMinGet +end function SumDomainMinGet + +!! Set +subroutine SumDomainMinSet(handle, domainMin) & + bind(C, name='SumDomainMinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMin +end subroutine SumDomainMinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMax +!! ----------------------------------------------------------------------------- + +!! Has +function SumDomainMaxHas(handle) & + bind(C, name='SumDomainMaxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumDomainMaxHas +end function SumDomainMaxHas + +!! Get +function SumDomainMaxGet(handle) & + bind(C, name='SumDomainMaxGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: SumDomainMaxGet +end function SumDomainMaxGet + +!! Set +subroutine SumDomainMaxSet(handle, domainMax) & + bind(C, name='SumDomainMaxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMax +end subroutine SumDomainMaxSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainUnit +!! ----------------------------------------------------------------------------- + +!! Has +function SumDomainUnitHas(handle) & + bind(C, name='SumDomainUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumDomainUnitHas +end function SumDomainUnitHas + +!! Get +function SumDomainUnitGet(handle) & + bind(C, name='SumDomainUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SumDomainUnitGet +end function SumDomainUnitGet + +!! Set +subroutine SumDomainUnitSet(handle, domainUnit, domainUnitSize) & + bind(C, name='SumDomainUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) +end subroutine SumDomainUnitSet + + +!! ----------------------------------------------------------------------------- +!! Child: summand +!! ----------------------------------------------------------------------------- + +!! Has +function SumSummandHas(handle) & + bind(C, name='SumSummandHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumSummandHas +end function SumSummandHas + +!! Clear +subroutine SumSummandClear(handle) & + bind(C, name='SumSummandClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SumSummandClear + +!! Size +function SumSummandSize(handle) & + bind(C, name='SumSummandSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: SumSummandSize +end function SumSummandSize + +!! Add +subroutine SumSummandAdd(handle, fieldHandle) & + bind(C, name='SumSummandAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SumSummandAdd + +!! Get, by index \in [0,size), const +function SumSummandGetConst(handle, index) & + bind(C, name='SumSummandGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SumSummandGetConst +end function SumSummandGetConst + +!! Get, by index \in [0,size), non-const +function SumSummandGet(handle, index) & + bind(C, name='SumSummandGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SumSummandGet +end function SumSummandGet + +!! Set, by index \in [0,size) +subroutine SumSummandSet(handle, index, fieldHandle) & + bind(C, name='SumSummandSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SumSummandSet + +!! ------------------------ +!! Re: metadatum ENDF_MFMT +!! ------------------------ + +!! Has, by ENDF_MFMT +function SumSummandHasByENDFMFMT(handle, meta, metaSize) & + bind(C, name='SumSummandHasByENDFMFMT') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: SumSummandHasByENDFMFMT +end function SumSummandHasByENDFMFMT + +!! Get, by ENDF_MFMT, const +function SumSummandGetByENDFMFMTConst(handle, meta, metaSize) & + bind(C, name='SumSummandGetByENDFMFMTConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SumSummandGetByENDFMFMTConst +end function SumSummandGetByENDFMFMTConst + +!! Get, by ENDF_MFMT, non-const +function SumSummandGetByENDFMFMT(handle, meta, metaSize) & + bind(C, name='SumSummandGetByENDFMFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SumSummandGetByENDFMFMT +end function SumSummandGetByENDFMFMT + +!! Set, by ENDF_MFMT +subroutine SumSummandSetByENDFMFMT(handle, meta, metaSize, fieldHandle) & + bind(C, name='SumSummandSetByENDFMFMT') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SumSummandSetByENDFMFMT + +!! ------------------------ +!! Re: metadatum coefficient +!! ------------------------ + +!! Has, by coefficient +function SumSummandHasByCoefficient(handle, meta, metaSize) & + bind(C, name='SumSummandHasByCoefficient') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: SumSummandHasByCoefficient +end function SumSummandHasByCoefficient + +!! Get, by coefficient, const +function SumSummandGetByCoefficientConst(handle, meta, metaSize) & + bind(C, name='SumSummandGetByCoefficientConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SumSummandGetByCoefficientConst +end function SumSummandGetByCoefficientConst + +!! Get, by coefficient, non-const +function SumSummandGetByCoefficient(handle, meta, metaSize) & + bind(C, name='SumSummandGetByCoefficient') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SumSummandGetByCoefficient +end function SumSummandGetByCoefficient + +!! Set, by coefficient +subroutine SumSummandSetByCoefficient(handle, meta, metaSize, fieldHandle) & + bind(C, name='SumSummandSetByCoefficient') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SumSummandSetByCoefficient + +!! ------------------------ +!! Re: metadatum href +!! ------------------------ + +!! Has, by href +function SumSummandHasByHref(handle, meta, metaSize) & + bind(C, name='SumSummandHasByHref') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: SumSummandHasByHref +end function SumSummandHasByHref + +!! Get, by href, const +function SumSummandGetByHrefConst(handle, meta, metaSize) & + bind(C, name='SumSummandGetByHrefConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SumSummandGetByHrefConst +end function SumSummandGetByHrefConst + +!! Get, by href, non-const +function SumSummandGetByHref(handle, meta, metaSize) & + bind(C, name='SumSummandGetByHref') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SumSummandGetByHref +end function SumSummandGetByHref + +!! Set, by href +subroutine SumSummandSetByHref(handle, meta, metaSize, fieldHandle) & + bind(C, name='SumSummandSetByHref') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SumSummandSetByHref + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSum diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Summand.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Summand.f03 new file mode 100644 index 000000000..549afe75a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Summand.f03 @@ -0,0 +1,254 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSummand +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SummandDefaultConst() & + bind(C, name='SummandDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SummandDefaultConst +end function SummandDefaultConst + +!! Create, default, non-const +function SummandDefault() & + bind(C, name='SummandDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SummandDefault +end function SummandDefault + +!! Create, general, const +function SummandCreateConst( & + ENDF_MFMT, & + coefficient, & + href, & + ENDF_MFMTSize, & + coefficientSize, & + hrefSize & +) & + bind(C, name='SummandCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: ENDF_MFMTSize + character(c_char), intent(in) :: ENDF_MFMT(ENDF_MFMTSize) + integer(c_size_t), intent(in), value :: coefficientSize + character(c_char), intent(in) :: coefficient(coefficientSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: SummandCreateConst +end function SummandCreateConst + +!! Create, general, non-const +function SummandCreate( & + ENDF_MFMT, & + coefficient, & + href, & + ENDF_MFMTSize, & + coefficientSize, & + hrefSize & +) & + bind(C, name='SummandCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: ENDF_MFMTSize + character(c_char), intent(in) :: ENDF_MFMT(ENDF_MFMTSize) + integer(c_size_t), intent(in), value :: coefficientSize + character(c_char), intent(in) :: coefficient(coefficientSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: SummandCreate +end function SummandCreate + +!! Assign +subroutine SummandAssign(handleLHS, handleRHS) & + bind(C, name='SummandAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SummandAssign + +!! Delete +subroutine SummandDelete(handle) & + bind(C, name='SummandDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SummandDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SummandRead(handle, filename, filenameSize) & + bind(C, name='SummandRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SummandRead +end function SummandRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SummandWrite(handle, filename, filenameSize) & + bind(C, name='SummandWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SummandWrite +end function SummandWrite + +!! Print to standard output, in our prettyprinting format +function SummandPrint(handle) & + bind(C, name='SummandPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SummandPrint +end function SummandPrint + +!! Print to standard output, as XML +function SummandPrintXML(handle) & + bind(C, name='SummandPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SummandPrintXML +end function SummandPrintXML + +!! Print to standard output, as JSON +function SummandPrintJSON(handle) & + bind(C, name='SummandPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SummandPrintJSON +end function SummandPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: ENDF_MFMT +!! ----------------------------------------------------------------------------- + +!! Has +function SummandENDFMFMTHas(handle) & + bind(C, name='SummandENDFMFMTHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SummandENDFMFMTHas +end function SummandENDFMFMTHas + +!! Get +function SummandENDFMFMTGet(handle) & + bind(C, name='SummandENDFMFMTGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SummandENDFMFMTGet +end function SummandENDFMFMTGet + +!! Set +subroutine SummandENDFMFMTSet(handle, ENDF_MFMT, ENDF_MFMTSize) & + bind(C, name='SummandENDFMFMTSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: ENDF_MFMTSize + character(c_char), intent(in) :: ENDF_MFMT(ENDF_MFMTSize) +end subroutine SummandENDFMFMTSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: coefficient +!! ----------------------------------------------------------------------------- + +!! Has +function SummandCoefficientHas(handle) & + bind(C, name='SummandCoefficientHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SummandCoefficientHas +end function SummandCoefficientHas + +!! Get +function SummandCoefficientGet(handle) & + bind(C, name='SummandCoefficientGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SummandCoefficientGet +end function SummandCoefficientGet + +!! Set +subroutine SummandCoefficientSet(handle, coefficient, coefficientSize) & + bind(C, name='SummandCoefficientSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: coefficientSize + character(c_char), intent(in) :: coefficient(coefficientSize) +end subroutine SummandCoefficientSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function SummandHrefHas(handle) & + bind(C, name='SummandHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SummandHrefHas +end function SummandHrefHas + +!! Get +function SummandHrefGet(handle) & + bind(C, name='SummandHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SummandHrefGet +end function SummandHrefGet + +!! Set +subroutine SummandHrefSet(handle, href, hrefSize) & + bind(C, name='SummandHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine SummandHrefSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSummand diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Summands.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Summands.f03 new file mode 100644 index 000000000..006e8083a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Summands.f03 @@ -0,0 +1,255 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSummands +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SummandsDefaultConst() & + bind(C, name='SummandsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SummandsDefaultConst +end function SummandsDefaultConst + +!! Create, default, non-const +function SummandsDefault() & + bind(C, name='SummandsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SummandsDefault +end function SummandsDefault + +!! Create, general, const +function SummandsCreateConst( & + add, addSize & +) & + bind(C, name='SummandsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: addSize + type(c_ptr), intent(in) :: add(addSize) + type(c_ptr) :: SummandsCreateConst +end function SummandsCreateConst + +!! Create, general, non-const +function SummandsCreate( & + add, addSize & +) & + bind(C, name='SummandsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: addSize + type(c_ptr), intent(in) :: add(addSize) + type(c_ptr) :: SummandsCreate +end function SummandsCreate + +!! Assign +subroutine SummandsAssign(handleLHS, handleRHS) & + bind(C, name='SummandsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SummandsAssign + +!! Delete +subroutine SummandsDelete(handle) & + bind(C, name='SummandsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SummandsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SummandsRead(handle, filename, filenameSize) & + bind(C, name='SummandsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SummandsRead +end function SummandsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SummandsWrite(handle, filename, filenameSize) & + bind(C, name='SummandsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SummandsWrite +end function SummandsWrite + +!! Print to standard output, in our prettyprinting format +function SummandsPrint(handle) & + bind(C, name='SummandsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SummandsPrint +end function SummandsPrint + +!! Print to standard output, as XML +function SummandsPrintXML(handle) & + bind(C, name='SummandsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SummandsPrintXML +end function SummandsPrintXML + +!! Print to standard output, as JSON +function SummandsPrintJSON(handle) & + bind(C, name='SummandsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SummandsPrintJSON +end function SummandsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: add +!! ----------------------------------------------------------------------------- + +!! Has +function SummandsAddHas(handle) & + bind(C, name='SummandsAddHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SummandsAddHas +end function SummandsAddHas + +!! Clear +subroutine SummandsAddClear(handle) & + bind(C, name='SummandsAddClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SummandsAddClear + +!! Size +function SummandsAddSize(handle) & + bind(C, name='SummandsAddSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: SummandsAddSize +end function SummandsAddSize + +!! Add +subroutine SummandsAddAdd(handle, fieldHandle) & + bind(C, name='SummandsAddAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SummandsAddAdd + +!! Get, by index \in [0,size), const +function SummandsAddGetConst(handle, index) & + bind(C, name='SummandsAddGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SummandsAddGetConst +end function SummandsAddGetConst + +!! Get, by index \in [0,size), non-const +function SummandsAddGet(handle, index) & + bind(C, name='SummandsAddGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: SummandsAddGet +end function SummandsAddGet + +!! Set, by index \in [0,size) +subroutine SummandsAddSet(handle, index, fieldHandle) & + bind(C, name='SummandsAddSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SummandsAddSet + +!! ------------------------ +!! Re: metadatum href +!! ------------------------ + +!! Has, by href +function SummandsAddHasByHref(handle, meta, metaSize) & + bind(C, name='SummandsAddHasByHref') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: SummandsAddHasByHref +end function SummandsAddHasByHref + +!! Get, by href, const +function SummandsAddGetByHrefConst(handle, meta, metaSize) & + bind(C, name='SummandsAddGetByHrefConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SummandsAddGetByHrefConst +end function SummandsAddGetByHrefConst + +!! Get, by href, non-const +function SummandsAddGetByHref(handle, meta, metaSize) & + bind(C, name='SummandsAddGetByHref') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: SummandsAddGetByHref +end function SummandsAddGetByHref + +!! Set, by href +subroutine SummandsAddSetByHref(handle, meta, metaSize, fieldHandle) & + bind(C, name='SummandsAddSetByHref') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SummandsAddSetByHref + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSummands diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Sums.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Sums.f03 new file mode 100644 index 000000000..65144c13d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Sums.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalSums +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function SumsDefaultConst() & + bind(C, name='SumsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: SumsDefaultConst +end function SumsDefaultConst + +!! Create, default, non-const +function SumsDefault() & + bind(C, name='SumsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: SumsDefault +end function SumsDefault + +!! Create, general, const +function SumsCreateConst( & + crossSectionSums, & + multiplicitySums & +) & + bind(C, name='SumsCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: crossSectionSums + type(c_ptr), intent(in), value :: multiplicitySums + type(c_ptr) :: SumsCreateConst +end function SumsCreateConst + +!! Create, general, non-const +function SumsCreate( & + crossSectionSums, & + multiplicitySums & +) & + bind(C, name='SumsCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: crossSectionSums + type(c_ptr), intent(in), value :: multiplicitySums + type(c_ptr) :: SumsCreate +end function SumsCreate + +!! Assign +subroutine SumsAssign(handleLHS, handleRHS) & + bind(C, name='SumsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine SumsAssign + +!! Delete +subroutine SumsDelete(handle) & + bind(C, name='SumsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine SumsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function SumsRead(handle, filename, filenameSize) & + bind(C, name='SumsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SumsRead +end function SumsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function SumsWrite(handle, filename, filenameSize) & + bind(C, name='SumsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: SumsWrite +end function SumsWrite + +!! Print to standard output, in our prettyprinting format +function SumsPrint(handle) & + bind(C, name='SumsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumsPrint +end function SumsPrint + +!! Print to standard output, as XML +function SumsPrintXML(handle) & + bind(C, name='SumsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumsPrintXML +end function SumsPrintXML + +!! Print to standard output, as JSON +function SumsPrintJSON(handle) & + bind(C, name='SumsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumsPrintJSON +end function SumsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: crossSectionSums +!! ----------------------------------------------------------------------------- + +!! Has +function SumsCrossSectionSumsHas(handle) & + bind(C, name='SumsCrossSectionSumsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumsCrossSectionSumsHas +end function SumsCrossSectionSumsHas + +!! Get, const +function SumsCrossSectionSumsGetConst(handle) & + bind(C, name='SumsCrossSectionSumsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SumsCrossSectionSumsGetConst +end function SumsCrossSectionSumsGetConst + +!! Get, non-const +function SumsCrossSectionSumsGet(handle) & + bind(C, name='SumsCrossSectionSumsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: SumsCrossSectionSumsGet +end function SumsCrossSectionSumsGet + +!! Set +subroutine SumsCrossSectionSumsSet(handle, fieldHandle) & + bind(C, name='SumsCrossSectionSumsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SumsCrossSectionSumsSet + + +!! ----------------------------------------------------------------------------- +!! Child: multiplicitySums +!! ----------------------------------------------------------------------------- + +!! Has +function SumsMultiplicitySumsHas(handle) & + bind(C, name='SumsMultiplicitySumsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: SumsMultiplicitySumsHas +end function SumsMultiplicitySumsHas + +!! Get, const +function SumsMultiplicitySumsGetConst(handle) & + bind(C, name='SumsMultiplicitySumsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: SumsMultiplicitySumsGetConst +end function SumsMultiplicitySumsGetConst + +!! Get, non-const +function SumsMultiplicitySumsGet(handle) & + bind(C, name='SumsMultiplicitySumsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: SumsMultiplicitySumsGet +end function SumsMultiplicitySumsGet + +!! Set +subroutine SumsMultiplicitySumsSet(handle, fieldHandle) & + bind(C, name='SumsMultiplicitySumsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine SumsMultiplicitySumsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalSums diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/T_M.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/T_M.f03 new file mode 100644 index 000000000..3fbf3bc59 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/T_M.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalT_M +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function T_MDefaultConst() & + bind(C, name='T_MDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: T_MDefaultConst +end function T_MDefaultConst + +!! Create, default, non-const +function T_MDefault() & + bind(C, name='T_MDefault') + use iso_c_binding + implicit none + type(c_ptr) :: T_MDefault +end function T_MDefault + +!! Create, general, const +function T_MCreateConst( & + XYs1d & +) & + bind(C, name='T_MCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: T_MCreateConst +end function T_MCreateConst + +!! Create, general, non-const +function T_MCreate( & + XYs1d & +) & + bind(C, name='T_MCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: T_MCreate +end function T_MCreate + +!! Assign +subroutine T_MAssign(handleLHS, handleRHS) & + bind(C, name='T_MAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine T_MAssign + +!! Delete +subroutine T_MDelete(handle) & + bind(C, name='T_MDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine T_MDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function T_MRead(handle, filename, filenameSize) & + bind(C, name='T_MRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: T_MRead +end function T_MRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function T_MWrite(handle, filename, filenameSize) & + bind(C, name='T_MWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: T_MWrite +end function T_MWrite + +!! Print to standard output, in our prettyprinting format +function T_MPrint(handle) & + bind(C, name='T_MPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: T_MPrint +end function T_MPrint + +!! Print to standard output, as XML +function T_MPrintXML(handle) & + bind(C, name='T_MPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: T_MPrintXML +end function T_MPrintXML + +!! Print to standard output, as JSON +function T_MPrintJSON(handle) & + bind(C, name='T_MPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: T_MPrintJSON +end function T_MPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function T_MXYs1dHas(handle) & + bind(C, name='T_MXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: T_MXYs1dHas +end function T_MXYs1dHas + +!! Get, const +function T_MXYs1dGetConst(handle) & + bind(C, name='T_MXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: T_MXYs1dGetConst +end function T_MXYs1dGetConst + +!! Get, non-const +function T_MXYs1dGet(handle) & + bind(C, name='T_MXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: T_MXYs1dGet +end function T_MXYs1dGet + +!! Set +subroutine T_MXYs1dSet(handle, fieldHandle) & + bind(C, name='T_MXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine T_MXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalT_M diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/T_effective.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/T_effective.f03 new file mode 100644 index 000000000..0c8bfe023 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/T_effective.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalT_effective +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function T_effectiveDefaultConst() & + bind(C, name='T_effectiveDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: T_effectiveDefaultConst +end function T_effectiveDefaultConst + +!! Create, default, non-const +function T_effectiveDefault() & + bind(C, name='T_effectiveDefault') + use iso_c_binding + implicit none + type(c_ptr) :: T_effectiveDefault +end function T_effectiveDefault + +!! Create, general, const +function T_effectiveCreateConst( & + XYs1d & +) & + bind(C, name='T_effectiveCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: T_effectiveCreateConst +end function T_effectiveCreateConst + +!! Create, general, non-const +function T_effectiveCreate( & + XYs1d & +) & + bind(C, name='T_effectiveCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr) :: T_effectiveCreate +end function T_effectiveCreate + +!! Assign +subroutine T_effectiveAssign(handleLHS, handleRHS) & + bind(C, name='T_effectiveAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine T_effectiveAssign + +!! Delete +subroutine T_effectiveDelete(handle) & + bind(C, name='T_effectiveDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine T_effectiveDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function T_effectiveRead(handle, filename, filenameSize) & + bind(C, name='T_effectiveRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: T_effectiveRead +end function T_effectiveRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function T_effectiveWrite(handle, filename, filenameSize) & + bind(C, name='T_effectiveWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: T_effectiveWrite +end function T_effectiveWrite + +!! Print to standard output, in our prettyprinting format +function T_effectivePrint(handle) & + bind(C, name='T_effectivePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: T_effectivePrint +end function T_effectivePrint + +!! Print to standard output, as XML +function T_effectivePrintXML(handle) & + bind(C, name='T_effectivePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: T_effectivePrintXML +end function T_effectivePrintXML + +!! Print to standard output, as JSON +function T_effectivePrintJSON(handle) & + bind(C, name='T_effectivePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: T_effectivePrintJSON +end function T_effectivePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function T_effectiveXYs1dHas(handle) & + bind(C, name='T_effectiveXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: T_effectiveXYs1dHas +end function T_effectiveXYs1dHas + +!! Get, const +function T_effectiveXYs1dGetConst(handle) & + bind(C, name='T_effectiveXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: T_effectiveXYs1dGetConst +end function T_effectiveXYs1dGetConst + +!! Get, non-const +function T_effectiveXYs1dGet(handle) & + bind(C, name='T_effectiveXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: T_effectiveXYs1dGet +end function T_effectiveXYs1dGet + +!! Set +subroutine T_effectiveXYs1dSet(handle, fieldHandle) & + bind(C, name='T_effectiveXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine T_effectiveXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalT_effective diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Table.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Table.f03 new file mode 100644 index 000000000..b968e9c53 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Table.f03 @@ -0,0 +1,293 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalTable +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function TableDefaultConst() & + bind(C, name='TableDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: TableDefaultConst +end function TableDefaultConst + +!! Create, default, non-const +function TableDefault() & + bind(C, name='TableDefault') + use iso_c_binding + implicit none + type(c_ptr) :: TableDefault +end function TableDefault + +!! Create, general, const +function TableCreateConst( & + rows, & + columns, & + columnHeaders, & + data & +) & + bind(C, name='TableCreateConst') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: rows + integer(c_int), intent(in), value :: columns + type(c_ptr), intent(in), value :: columnHeaders + type(c_ptr), intent(in), value :: data + type(c_ptr) :: TableCreateConst +end function TableCreateConst + +!! Create, general, non-const +function TableCreate( & + rows, & + columns, & + columnHeaders, & + data & +) & + bind(C, name='TableCreate') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: rows + integer(c_int), intent(in), value :: columns + type(c_ptr), intent(in), value :: columnHeaders + type(c_ptr), intent(in), value :: data + type(c_ptr) :: TableCreate +end function TableCreate + +!! Assign +subroutine TableAssign(handleLHS, handleRHS) & + bind(C, name='TableAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine TableAssign + +!! Delete +subroutine TableDelete(handle) & + bind(C, name='TableDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine TableDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function TableRead(handle, filename, filenameSize) & + bind(C, name='TableRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TableRead +end function TableRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function TableWrite(handle, filename, filenameSize) & + bind(C, name='TableWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TableWrite +end function TableWrite + +!! Print to standard output, in our prettyprinting format +function TablePrint(handle) & + bind(C, name='TablePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TablePrint +end function TablePrint + +!! Print to standard output, as XML +function TablePrintXML(handle) & + bind(C, name='TablePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TablePrintXML +end function TablePrintXML + +!! Print to standard output, as JSON +function TablePrintJSON(handle) & + bind(C, name='TablePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TablePrintJSON +end function TablePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: rows +!! ----------------------------------------------------------------------------- + +!! Has +function TableRowsHas(handle) & + bind(C, name='TableRowsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TableRowsHas +end function TableRowsHas + +!! Get +function TableRowsGet(handle) & + bind(C, name='TableRowsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TableRowsGet +end function TableRowsGet + +!! Set +subroutine TableRowsSet(handle, rows) & + bind(C, name='TableRowsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: rows +end subroutine TableRowsSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: columns +!! ----------------------------------------------------------------------------- + +!! Has +function TableColumnsHas(handle) & + bind(C, name='TableColumnsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TableColumnsHas +end function TableColumnsHas + +!! Get +function TableColumnsGet(handle) & + bind(C, name='TableColumnsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TableColumnsGet +end function TableColumnsGet + +!! Set +subroutine TableColumnsSet(handle, columns) & + bind(C, name='TableColumnsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: columns +end subroutine TableColumnsSet + + +!! ----------------------------------------------------------------------------- +!! Child: columnHeaders +!! ----------------------------------------------------------------------------- + +!! Has +function TableColumnHeadersHas(handle) & + bind(C, name='TableColumnHeadersHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TableColumnHeadersHas +end function TableColumnHeadersHas + +!! Get, const +function TableColumnHeadersGetConst(handle) & + bind(C, name='TableColumnHeadersGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TableColumnHeadersGetConst +end function TableColumnHeadersGetConst + +!! Get, non-const +function TableColumnHeadersGet(handle) & + bind(C, name='TableColumnHeadersGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: TableColumnHeadersGet +end function TableColumnHeadersGet + +!! Set +subroutine TableColumnHeadersSet(handle, fieldHandle) & + bind(C, name='TableColumnHeadersSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine TableColumnHeadersSet + + +!! ----------------------------------------------------------------------------- +!! Child: data +!! ----------------------------------------------------------------------------- + +!! Has +function TableDataHas(handle) & + bind(C, name='TableDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TableDataHas +end function TableDataHas + +!! Get, const +function TableDataGetConst(handle) & + bind(C, name='TableDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TableDataGetConst +end function TableDataGetConst + +!! Get, non-const +function TableDataGet(handle) & + bind(C, name='TableDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: TableDataGet +end function TableDataGet + +!! Set +subroutine TableDataSet(handle, fieldHandle) & + bind(C, name='TableDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine TableDataSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalTable diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/TabulatedWidths.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/TabulatedWidths.f03 new file mode 100644 index 000000000..a565e3359 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/TabulatedWidths.f03 @@ -0,0 +1,429 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalTabulatedWidths +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function TabulatedWidthsDefaultConst() & + bind(C, name='TabulatedWidthsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: TabulatedWidthsDefaultConst +end function TabulatedWidthsDefaultConst + +!! Create, default, non-const +function TabulatedWidthsDefault() & + bind(C, name='TabulatedWidthsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: TabulatedWidthsDefault +end function TabulatedWidthsDefault + +!! Create, general, const +function TabulatedWidthsCreateConst( & + label, & + approximation, & + useForSelfShieldingOnly, & + resonanceReactions, & + Ls, & + PoPs, & + scatteringRadius, & + labelSize, & + approximationSize & +) & + bind(C, name='TabulatedWidthsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: approximationSize + character(c_char), intent(in) :: approximation(approximationSize) + logical(c_bool), intent(in), value :: useForSelfShieldingOnly + type(c_ptr), intent(in), value :: resonanceReactions + type(c_ptr), intent(in), value :: Ls + type(c_ptr), intent(in), value :: PoPs + type(c_ptr), intent(in), value :: scatteringRadius + type(c_ptr) :: TabulatedWidthsCreateConst +end function TabulatedWidthsCreateConst + +!! Create, general, non-const +function TabulatedWidthsCreate( & + label, & + approximation, & + useForSelfShieldingOnly, & + resonanceReactions, & + Ls, & + PoPs, & + scatteringRadius, & + labelSize, & + approximationSize & +) & + bind(C, name='TabulatedWidthsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: approximationSize + character(c_char), intent(in) :: approximation(approximationSize) + logical(c_bool), intent(in), value :: useForSelfShieldingOnly + type(c_ptr), intent(in), value :: resonanceReactions + type(c_ptr), intent(in), value :: Ls + type(c_ptr), intent(in), value :: PoPs + type(c_ptr), intent(in), value :: scatteringRadius + type(c_ptr) :: TabulatedWidthsCreate +end function TabulatedWidthsCreate + +!! Assign +subroutine TabulatedWidthsAssign(handleLHS, handleRHS) & + bind(C, name='TabulatedWidthsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine TabulatedWidthsAssign + +!! Delete +subroutine TabulatedWidthsDelete(handle) & + bind(C, name='TabulatedWidthsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine TabulatedWidthsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function TabulatedWidthsRead(handle, filename, filenameSize) & + bind(C, name='TabulatedWidthsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TabulatedWidthsRead +end function TabulatedWidthsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function TabulatedWidthsWrite(handle, filename, filenameSize) & + bind(C, name='TabulatedWidthsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TabulatedWidthsWrite +end function TabulatedWidthsWrite + +!! Print to standard output, in our prettyprinting format +function TabulatedWidthsPrint(handle) & + bind(C, name='TabulatedWidthsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TabulatedWidthsPrint +end function TabulatedWidthsPrint + +!! Print to standard output, as XML +function TabulatedWidthsPrintXML(handle) & + bind(C, name='TabulatedWidthsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TabulatedWidthsPrintXML +end function TabulatedWidthsPrintXML + +!! Print to standard output, as JSON +function TabulatedWidthsPrintJSON(handle) & + bind(C, name='TabulatedWidthsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TabulatedWidthsPrintJSON +end function TabulatedWidthsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function TabulatedWidthsLabelHas(handle) & + bind(C, name='TabulatedWidthsLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TabulatedWidthsLabelHas +end function TabulatedWidthsLabelHas + +!! Get +function TabulatedWidthsLabelGet(handle) & + bind(C, name='TabulatedWidthsLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TabulatedWidthsLabelGet +end function TabulatedWidthsLabelGet + +!! Set +subroutine TabulatedWidthsLabelSet(handle, label, labelSize) & + bind(C, name='TabulatedWidthsLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine TabulatedWidthsLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: approximation +!! ----------------------------------------------------------------------------- + +!! Has +function TabulatedWidthsApproximationHas(handle) & + bind(C, name='TabulatedWidthsApproximationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TabulatedWidthsApproximationHas +end function TabulatedWidthsApproximationHas + +!! Get +function TabulatedWidthsApproximationGet(handle) & + bind(C, name='TabulatedWidthsApproximationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TabulatedWidthsApproximationGet +end function TabulatedWidthsApproximationGet + +!! Set +subroutine TabulatedWidthsApproximationSet(handle, approximation, approximationSize) & + bind(C, name='TabulatedWidthsApproximationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: approximationSize + character(c_char), intent(in) :: approximation(approximationSize) +end subroutine TabulatedWidthsApproximationSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: useForSelfShieldingOnly +!! ----------------------------------------------------------------------------- + +!! Has +function TabulatedWidthsUseForSelfShieldingOnlyHas(handle) & + bind(C, name='TabulatedWidthsUseForSelfShieldingOnlyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TabulatedWidthsUseForSelfShieldingOnlyHas +end function TabulatedWidthsUseForSelfShieldingOnlyHas + +!! Get +function TabulatedWidthsUseForSelfShieldingOnlyGet(handle) & + bind(C, name='TabulatedWidthsUseForSelfShieldingOnlyGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: TabulatedWidthsUseForSelfShieldingOnlyGet +end function TabulatedWidthsUseForSelfShieldingOnlyGet + +!! Set +subroutine TabulatedWidthsUseForSelfShieldingOnlySet(handle, useForSelfShieldingOnly) & + bind(C, name='TabulatedWidthsUseForSelfShieldingOnlySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: useForSelfShieldingOnly +end subroutine TabulatedWidthsUseForSelfShieldingOnlySet + + +!! ----------------------------------------------------------------------------- +!! Child: resonanceReactions +!! ----------------------------------------------------------------------------- + +!! Has +function TabulatedWidthsResonanceReactionsHas(handle) & + bind(C, name='TabulatedWidthsResonanceReactionsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TabulatedWidthsResonanceReactionsHas +end function TabulatedWidthsResonanceReactionsHas + +!! Get, const +function TabulatedWidthsResonanceReactionsGetConst(handle) & + bind(C, name='TabulatedWidthsResonanceReactionsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TabulatedWidthsResonanceReactionsGetConst +end function TabulatedWidthsResonanceReactionsGetConst + +!! Get, non-const +function TabulatedWidthsResonanceReactionsGet(handle) & + bind(C, name='TabulatedWidthsResonanceReactionsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: TabulatedWidthsResonanceReactionsGet +end function TabulatedWidthsResonanceReactionsGet + +!! Set +subroutine TabulatedWidthsResonanceReactionsSet(handle, fieldHandle) & + bind(C, name='TabulatedWidthsResonanceReactionsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine TabulatedWidthsResonanceReactionsSet + + +!! ----------------------------------------------------------------------------- +!! Child: Ls +!! ----------------------------------------------------------------------------- + +!! Has +function TabulatedWidthsLsHas(handle) & + bind(C, name='TabulatedWidthsLsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TabulatedWidthsLsHas +end function TabulatedWidthsLsHas + +!! Get, const +function TabulatedWidthsLsGetConst(handle) & + bind(C, name='TabulatedWidthsLsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TabulatedWidthsLsGetConst +end function TabulatedWidthsLsGetConst + +!! Get, non-const +function TabulatedWidthsLsGet(handle) & + bind(C, name='TabulatedWidthsLsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: TabulatedWidthsLsGet +end function TabulatedWidthsLsGet + +!! Set +subroutine TabulatedWidthsLsSet(handle, fieldHandle) & + bind(C, name='TabulatedWidthsLsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine TabulatedWidthsLsSet + + +!! ----------------------------------------------------------------------------- +!! Child: PoPs +!! ----------------------------------------------------------------------------- + +!! Has +function TabulatedWidthsPoPsHas(handle) & + bind(C, name='TabulatedWidthsPoPsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TabulatedWidthsPoPsHas +end function TabulatedWidthsPoPsHas + +!! Get, const +function TabulatedWidthsPoPsGetConst(handle) & + bind(C, name='TabulatedWidthsPoPsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TabulatedWidthsPoPsGetConst +end function TabulatedWidthsPoPsGetConst + +!! Get, non-const +function TabulatedWidthsPoPsGet(handle) & + bind(C, name='TabulatedWidthsPoPsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: TabulatedWidthsPoPsGet +end function TabulatedWidthsPoPsGet + +!! Set +subroutine TabulatedWidthsPoPsSet(handle, fieldHandle) & + bind(C, name='TabulatedWidthsPoPsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine TabulatedWidthsPoPsSet + + +!! ----------------------------------------------------------------------------- +!! Child: scatteringRadius +!! ----------------------------------------------------------------------------- + +!! Has +function TabulatedWidthsScatteringRadiusHas(handle) & + bind(C, name='TabulatedWidthsScatteringRadiusHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TabulatedWidthsScatteringRadiusHas +end function TabulatedWidthsScatteringRadiusHas + +!! Get, const +function TabulatedWidthsScatteringRadiusGetConst(handle) & + bind(C, name='TabulatedWidthsScatteringRadiusGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TabulatedWidthsScatteringRadiusGetConst +end function TabulatedWidthsScatteringRadiusGetConst + +!! Get, non-const +function TabulatedWidthsScatteringRadiusGet(handle) & + bind(C, name='TabulatedWidthsScatteringRadiusGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: TabulatedWidthsScatteringRadiusGet +end function TabulatedWidthsScatteringRadiusGet + +!! Set +subroutine TabulatedWidthsScatteringRadiusSet(handle, fieldHandle) & + bind(C, name='TabulatedWidthsScatteringRadiusSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine TabulatedWidthsScatteringRadiusSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalTabulatedWidths diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Temperature.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Temperature.f03 new file mode 100644 index 000000000..bb8aba09e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Temperature.f03 @@ -0,0 +1,208 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalTemperature +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function TemperatureDefaultConst() & + bind(C, name='TemperatureDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: TemperatureDefaultConst +end function TemperatureDefaultConst + +!! Create, default, non-const +function TemperatureDefault() & + bind(C, name='TemperatureDefault') + use iso_c_binding + implicit none + type(c_ptr) :: TemperatureDefault +end function TemperatureDefault + +!! Create, general, const +function TemperatureCreateConst( & + value, & + unit, & + unitSize & +) & + bind(C, name='TemperatureCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: TemperatureCreateConst +end function TemperatureCreateConst + +!! Create, general, non-const +function TemperatureCreate( & + value, & + unit, & + unitSize & +) & + bind(C, name='TemperatureCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: TemperatureCreate +end function TemperatureCreate + +!! Assign +subroutine TemperatureAssign(handleLHS, handleRHS) & + bind(C, name='TemperatureAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine TemperatureAssign + +!! Delete +subroutine TemperatureDelete(handle) & + bind(C, name='TemperatureDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine TemperatureDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function TemperatureRead(handle, filename, filenameSize) & + bind(C, name='TemperatureRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TemperatureRead +end function TemperatureRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function TemperatureWrite(handle, filename, filenameSize) & + bind(C, name='TemperatureWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TemperatureWrite +end function TemperatureWrite + +!! Print to standard output, in our prettyprinting format +function TemperaturePrint(handle) & + bind(C, name='TemperaturePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TemperaturePrint +end function TemperaturePrint + +!! Print to standard output, as XML +function TemperaturePrintXML(handle) & + bind(C, name='TemperaturePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TemperaturePrintXML +end function TemperaturePrintXML + +!! Print to standard output, as JSON +function TemperaturePrintJSON(handle) & + bind(C, name='TemperaturePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TemperaturePrintJSON +end function TemperaturePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function TemperatureValueHas(handle) & + bind(C, name='TemperatureValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TemperatureValueHas +end function TemperatureValueHas + +!! Get +function TemperatureValueGet(handle) & + bind(C, name='TemperatureValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: TemperatureValueGet +end function TemperatureValueGet + +!! Set +subroutine TemperatureValueSet(handle, value) & + bind(C, name='TemperatureValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine TemperatureValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function TemperatureUnitHas(handle) & + bind(C, name='TemperatureUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TemperatureUnitHas +end function TemperatureUnitHas + +!! Get +function TemperatureUnitGet(handle) & + bind(C, name='TemperatureUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TemperatureUnitGet +end function TemperatureUnitGet + +!! Set +subroutine TemperatureUnitSet(handle, unit, unitSize) & + bind(C, name='TemperatureUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine TemperatureUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalTemperature diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw.f03 new file mode 100644 index 000000000..f1faad1d0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw.f03 @@ -0,0 +1,213 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalThermalNeutronScatteringLaw +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ThermalNeutronScatteringLawDefaultConst() & + bind(C, name='ThermalNeutronScatteringLawDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ThermalNeutronScatteringLawDefaultConst +end function ThermalNeutronScatteringLawDefaultConst + +!! Create, default, non-const +function ThermalNeutronScatteringLawDefault() & + bind(C, name='ThermalNeutronScatteringLawDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ThermalNeutronScatteringLawDefault +end function ThermalNeutronScatteringLawDefault + +!! Create, general, const +function ThermalNeutronScatteringLawCreateConst( & + label, & + href, & + labelSize, & + hrefSize & +) & + bind(C, name='ThermalNeutronScatteringLawCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: ThermalNeutronScatteringLawCreateConst +end function ThermalNeutronScatteringLawCreateConst + +!! Create, general, non-const +function ThermalNeutronScatteringLawCreate( & + label, & + href, & + labelSize, & + hrefSize & +) & + bind(C, name='ThermalNeutronScatteringLawCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: ThermalNeutronScatteringLawCreate +end function ThermalNeutronScatteringLawCreate + +!! Assign +subroutine ThermalNeutronScatteringLawAssign(handleLHS, handleRHS) & + bind(C, name='ThermalNeutronScatteringLawAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ThermalNeutronScatteringLawAssign + +!! Delete +subroutine ThermalNeutronScatteringLawDelete(handle) & + bind(C, name='ThermalNeutronScatteringLawDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ThermalNeutronScatteringLawDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ThermalNeutronScatteringLawRead(handle, filename, filenameSize) & + bind(C, name='ThermalNeutronScatteringLawRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThermalNeutronScatteringLawRead +end function ThermalNeutronScatteringLawRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ThermalNeutronScatteringLawWrite(handle, filename, filenameSize) & + bind(C, name='ThermalNeutronScatteringLawWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThermalNeutronScatteringLawWrite +end function ThermalNeutronScatteringLawWrite + +!! Print to standard output, in our prettyprinting format +function ThermalNeutronScatteringLawPrint(handle) & + bind(C, name='ThermalNeutronScatteringLawPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLawPrint +end function ThermalNeutronScatteringLawPrint + +!! Print to standard output, as XML +function ThermalNeutronScatteringLawPrintXML(handle) & + bind(C, name='ThermalNeutronScatteringLawPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLawPrintXML +end function ThermalNeutronScatteringLawPrintXML + +!! Print to standard output, as JSON +function ThermalNeutronScatteringLawPrintJSON(handle) & + bind(C, name='ThermalNeutronScatteringLawPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLawPrintJSON +end function ThermalNeutronScatteringLawPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLawLabelHas(handle) & + bind(C, name='ThermalNeutronScatteringLawLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLawLabelHas +end function ThermalNeutronScatteringLawLabelHas + +!! Get +function ThermalNeutronScatteringLawLabelGet(handle) & + bind(C, name='ThermalNeutronScatteringLawLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLawLabelGet +end function ThermalNeutronScatteringLawLabelGet + +!! Set +subroutine ThermalNeutronScatteringLawLabelSet(handle, label, labelSize) & + bind(C, name='ThermalNeutronScatteringLawLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ThermalNeutronScatteringLawLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLawHrefHas(handle) & + bind(C, name='ThermalNeutronScatteringLawHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLawHrefHas +end function ThermalNeutronScatteringLawHrefHas + +!! Get +function ThermalNeutronScatteringLawHrefGet(handle) & + bind(C, name='ThermalNeutronScatteringLawHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLawHrefGet +end function ThermalNeutronScatteringLawHrefGet + +!! Set +subroutine ThermalNeutronScatteringLawHrefSet(handle, href, hrefSize) & + bind(C, name='ThermalNeutronScatteringLawHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine ThermalNeutronScatteringLawHrefSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalThermalNeutronScatteringLaw diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw1d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw1d.f03 new file mode 100644 index 000000000..b872e7d5d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw1d.f03 @@ -0,0 +1,213 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalThermalNeutronScatteringLaw1d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ThermalNeutronScatteringLaw1dDefaultConst() & + bind(C, name='ThermalNeutronScatteringLaw1dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ThermalNeutronScatteringLaw1dDefaultConst +end function ThermalNeutronScatteringLaw1dDefaultConst + +!! Create, default, non-const +function ThermalNeutronScatteringLaw1dDefault() & + bind(C, name='ThermalNeutronScatteringLaw1dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ThermalNeutronScatteringLaw1dDefault +end function ThermalNeutronScatteringLaw1dDefault + +!! Create, general, const +function ThermalNeutronScatteringLaw1dCreateConst( & + label, & + href, & + labelSize, & + hrefSize & +) & + bind(C, name='ThermalNeutronScatteringLaw1dCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: ThermalNeutronScatteringLaw1dCreateConst +end function ThermalNeutronScatteringLaw1dCreateConst + +!! Create, general, non-const +function ThermalNeutronScatteringLaw1dCreate( & + label, & + href, & + labelSize, & + hrefSize & +) & + bind(C, name='ThermalNeutronScatteringLaw1dCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: ThermalNeutronScatteringLaw1dCreate +end function ThermalNeutronScatteringLaw1dCreate + +!! Assign +subroutine ThermalNeutronScatteringLaw1dAssign(handleLHS, handleRHS) & + bind(C, name='ThermalNeutronScatteringLaw1dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ThermalNeutronScatteringLaw1dAssign + +!! Delete +subroutine ThermalNeutronScatteringLaw1dDelete(handle) & + bind(C, name='ThermalNeutronScatteringLaw1dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ThermalNeutronScatteringLaw1dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ThermalNeutronScatteringLaw1dRead(handle, filename, filenameSize) & + bind(C, name='ThermalNeutronScatteringLaw1dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThermalNeutronScatteringLaw1dRead +end function ThermalNeutronScatteringLaw1dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ThermalNeutronScatteringLaw1dWrite(handle, filename, filenameSize) & + bind(C, name='ThermalNeutronScatteringLaw1dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThermalNeutronScatteringLaw1dWrite +end function ThermalNeutronScatteringLaw1dWrite + +!! Print to standard output, in our prettyprinting format +function ThermalNeutronScatteringLaw1dPrint(handle) & + bind(C, name='ThermalNeutronScatteringLaw1dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw1dPrint +end function ThermalNeutronScatteringLaw1dPrint + +!! Print to standard output, as XML +function ThermalNeutronScatteringLaw1dPrintXML(handle) & + bind(C, name='ThermalNeutronScatteringLaw1dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw1dPrintXML +end function ThermalNeutronScatteringLaw1dPrintXML + +!! Print to standard output, as JSON +function ThermalNeutronScatteringLaw1dPrintJSON(handle) & + bind(C, name='ThermalNeutronScatteringLaw1dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw1dPrintJSON +end function ThermalNeutronScatteringLaw1dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw1dLabelHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw1dLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw1dLabelHas +end function ThermalNeutronScatteringLaw1dLabelHas + +!! Get +function ThermalNeutronScatteringLaw1dLabelGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw1dLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw1dLabelGet +end function ThermalNeutronScatteringLaw1dLabelGet + +!! Set +subroutine ThermalNeutronScatteringLaw1dLabelSet(handle, label, labelSize) & + bind(C, name='ThermalNeutronScatteringLaw1dLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ThermalNeutronScatteringLaw1dLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw1dHrefHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw1dHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw1dHrefHas +end function ThermalNeutronScatteringLaw1dHrefHas + +!! Get +function ThermalNeutronScatteringLaw1dHrefGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw1dHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw1dHrefGet +end function ThermalNeutronScatteringLaw1dHrefGet + +!! Set +subroutine ThermalNeutronScatteringLaw1dHrefSet(handle, href, hrefSize) & + bind(C, name='ThermalNeutronScatteringLaw1dHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine ThermalNeutronScatteringLaw1dHrefSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalThermalNeutronScatteringLaw1d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.f03 new file mode 100644 index 000000000..bdeea2071 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.f03 @@ -0,0 +1,299 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalThermalNeutronScatteringLaw_coherentElastic +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ThermalNeutronScatteringLaw_coherentElasticDefaultConst() & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ThermalNeutronScatteringLaw_coherentElasticDefaultConst +end function ThermalNeutronScatteringLaw_coherentElasticDefaultConst + +!! Create, default, non-const +function ThermalNeutronScatteringLaw_coherentElasticDefault() & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ThermalNeutronScatteringLaw_coherentElasticDefault +end function ThermalNeutronScatteringLaw_coherentElasticDefault + +!! Create, general, const +function ThermalNeutronScatteringLaw_coherentElasticCreateConst( & + label, & + pid, & + productFrame, & + S_table, & + labelSize, & + pidSize, & + productFrameSize & +) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: S_table + type(c_ptr) :: ThermalNeutronScatteringLaw_coherentElasticCreateConst +end function ThermalNeutronScatteringLaw_coherentElasticCreateConst + +!! Create, general, non-const +function ThermalNeutronScatteringLaw_coherentElasticCreate( & + label, & + pid, & + productFrame, & + S_table, & + labelSize, & + pidSize, & + productFrameSize & +) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: S_table + type(c_ptr) :: ThermalNeutronScatteringLaw_coherentElasticCreate +end function ThermalNeutronScatteringLaw_coherentElasticCreate + +!! Assign +subroutine ThermalNeutronScatteringLaw_coherentElasticAssign(handleLHS, handleRHS) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ThermalNeutronScatteringLaw_coherentElasticAssign + +!! Delete +subroutine ThermalNeutronScatteringLaw_coherentElasticDelete(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ThermalNeutronScatteringLaw_coherentElasticDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ThermalNeutronScatteringLaw_coherentElasticRead(handle, filename, filenameSize) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThermalNeutronScatteringLaw_coherentElasticRead +end function ThermalNeutronScatteringLaw_coherentElasticRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ThermalNeutronScatteringLaw_coherentElasticWrite(handle, filename, filenameSize) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThermalNeutronScatteringLaw_coherentElasticWrite +end function ThermalNeutronScatteringLaw_coherentElasticWrite + +!! Print to standard output, in our prettyprinting format +function ThermalNeutronScatteringLaw_coherentElasticPrint(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_coherentElasticPrint +end function ThermalNeutronScatteringLaw_coherentElasticPrint + +!! Print to standard output, as XML +function ThermalNeutronScatteringLaw_coherentElasticPrintXML(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_coherentElasticPrintXML +end function ThermalNeutronScatteringLaw_coherentElasticPrintXML + +!! Print to standard output, as JSON +function ThermalNeutronScatteringLaw_coherentElasticPrintJSON(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_coherentElasticPrintJSON +end function ThermalNeutronScatteringLaw_coherentElasticPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_coherentElasticLabelHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_coherentElasticLabelHas +end function ThermalNeutronScatteringLaw_coherentElasticLabelHas + +!! Get +function ThermalNeutronScatteringLaw_coherentElasticLabelGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_coherentElasticLabelGet +end function ThermalNeutronScatteringLaw_coherentElasticLabelGet + +!! Set +subroutine ThermalNeutronScatteringLaw_coherentElasticLabelSet(handle, label, labelSize) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ThermalNeutronScatteringLaw_coherentElasticLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_coherentElasticPidHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticPidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_coherentElasticPidHas +end function ThermalNeutronScatteringLaw_coherentElasticPidHas + +!! Get +function ThermalNeutronScatteringLaw_coherentElasticPidGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticPidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_coherentElasticPidGet +end function ThermalNeutronScatteringLaw_coherentElasticPidGet + +!! Set +subroutine ThermalNeutronScatteringLaw_coherentElasticPidSet(handle, pid, pidSize) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticPidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine ThermalNeutronScatteringLaw_coherentElasticPidSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_coherentElasticProductFrameHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_coherentElasticProductFrameHas +end function ThermalNeutronScatteringLaw_coherentElasticProductFrameHas + +!! Get +function ThermalNeutronScatteringLaw_coherentElasticProductFrameGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_coherentElasticProductFrameGet +end function ThermalNeutronScatteringLaw_coherentElasticProductFrameGet + +!! Set +subroutine ThermalNeutronScatteringLaw_coherentElasticProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine ThermalNeutronScatteringLaw_coherentElasticProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Child: S_table +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_coherentElasticS_tableHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticS_tableHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_coherentElasticS_tableHas +end function ThermalNeutronScatteringLaw_coherentElasticS_tableHas + +!! Get, const +function ThermalNeutronScatteringLaw_coherentElasticS_tableGetConst(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticS_tableGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_coherentElasticS_tableGetConst +end function ThermalNeutronScatteringLaw_coherentElasticS_tableGetConst + +!! Get, non-const +function ThermalNeutronScatteringLaw_coherentElasticS_tableGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticS_tableGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_coherentElasticS_tableGet +end function ThermalNeutronScatteringLaw_coherentElasticS_tableGet + +!! Set +subroutine ThermalNeutronScatteringLaw_coherentElasticS_tableSet(handle, fieldHandle) & + bind(C, name='ThermalNeutronScatteringLaw_coherentElasticS_tableSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ThermalNeutronScatteringLaw_coherentElasticS_tableSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalThermalNeutronScatteringLaw_coherentElastic diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.f03 new file mode 100644 index 000000000..8d0d87bb0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.f03 @@ -0,0 +1,344 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalThermalNeutronScatteringLaw_incoherentElastic +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ThermalNeutronScatteringLaw_incoherentElasticDefaultConst() & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentElasticDefaultConst +end function ThermalNeutronScatteringLaw_incoherentElasticDefaultConst + +!! Create, default, non-const +function ThermalNeutronScatteringLaw_incoherentElasticDefault() & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentElasticDefault +end function ThermalNeutronScatteringLaw_incoherentElasticDefault + +!! Create, general, const +function ThermalNeutronScatteringLaw_incoherentElasticCreateConst( & + label, & + pid, & + productFrame, & + boundAtomCrossSection, & + DebyeWallerIntegral, & + labelSize, & + pidSize, & + productFrameSize & +) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: boundAtomCrossSection + type(c_ptr), intent(in), value :: DebyeWallerIntegral + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentElasticCreateConst +end function ThermalNeutronScatteringLaw_incoherentElasticCreateConst + +!! Create, general, non-const +function ThermalNeutronScatteringLaw_incoherentElasticCreate( & + label, & + pid, & + productFrame, & + boundAtomCrossSection, & + DebyeWallerIntegral, & + labelSize, & + pidSize, & + productFrameSize & +) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: boundAtomCrossSection + type(c_ptr), intent(in), value :: DebyeWallerIntegral + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentElasticCreate +end function ThermalNeutronScatteringLaw_incoherentElasticCreate + +!! Assign +subroutine ThermalNeutronScatteringLaw_incoherentElasticAssign(handleLHS, handleRHS) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ThermalNeutronScatteringLaw_incoherentElasticAssign + +!! Delete +subroutine ThermalNeutronScatteringLaw_incoherentElasticDelete(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ThermalNeutronScatteringLaw_incoherentElasticDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ThermalNeutronScatteringLaw_incoherentElasticRead(handle, filename, filenameSize) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentElasticRead +end function ThermalNeutronScatteringLaw_incoherentElasticRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ThermalNeutronScatteringLaw_incoherentElasticWrite(handle, filename, filenameSize) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentElasticWrite +end function ThermalNeutronScatteringLaw_incoherentElasticWrite + +!! Print to standard output, in our prettyprinting format +function ThermalNeutronScatteringLaw_incoherentElasticPrint(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentElasticPrint +end function ThermalNeutronScatteringLaw_incoherentElasticPrint + +!! Print to standard output, as XML +function ThermalNeutronScatteringLaw_incoherentElasticPrintXML(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentElasticPrintXML +end function ThermalNeutronScatteringLaw_incoherentElasticPrintXML + +!! Print to standard output, as JSON +function ThermalNeutronScatteringLaw_incoherentElasticPrintJSON(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentElasticPrintJSON +end function ThermalNeutronScatteringLaw_incoherentElasticPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_incoherentElasticLabelHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentElasticLabelHas +end function ThermalNeutronScatteringLaw_incoherentElasticLabelHas + +!! Get +function ThermalNeutronScatteringLaw_incoherentElasticLabelGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentElasticLabelGet +end function ThermalNeutronScatteringLaw_incoherentElasticLabelGet + +!! Set +subroutine ThermalNeutronScatteringLaw_incoherentElasticLabelSet(handle, label, labelSize) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ThermalNeutronScatteringLaw_incoherentElasticLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_incoherentElasticPidHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticPidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentElasticPidHas +end function ThermalNeutronScatteringLaw_incoherentElasticPidHas + +!! Get +function ThermalNeutronScatteringLaw_incoherentElasticPidGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticPidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentElasticPidGet +end function ThermalNeutronScatteringLaw_incoherentElasticPidGet + +!! Set +subroutine ThermalNeutronScatteringLaw_incoherentElasticPidSet(handle, pid, pidSize) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticPidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine ThermalNeutronScatteringLaw_incoherentElasticPidSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_incoherentElasticProductFrameHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentElasticProductFrameHas +end function ThermalNeutronScatteringLaw_incoherentElasticProductFrameHas + +!! Get +function ThermalNeutronScatteringLaw_incoherentElasticProductFrameGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentElasticProductFrameGet +end function ThermalNeutronScatteringLaw_incoherentElasticProductFrameGet + +!! Set +subroutine ThermalNeutronScatteringLaw_incoherentElasticProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine ThermalNeutronScatteringLaw_incoherentElasticProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Child: boundAtomCrossSection +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionHas +end function ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionHas + +!! Get, const +function ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGetConst(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGetConst +end function ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGetConst + +!! Get, non-const +function ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGet +end function ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionGet + +!! Set +subroutine ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionSet(handle, fieldHandle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ThermalNeutronScatteringLaw_incoherentElasticBoundAtomCrossSectionSet + + +!! ----------------------------------------------------------------------------- +!! Child: DebyeWallerIntegral +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralHas +end function ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralHas + +!! Get, const +function ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGetConst(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGetConst +end function ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGetConst + +!! Get, non-const +function ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGet +end function ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralGet + +!! Set +subroutine ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralSet(handle, fieldHandle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ThermalNeutronScatteringLaw_incoherentElasticDebyeWallerIntegralSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalThermalNeutronScatteringLaw_incoherentElastic diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.f03 new file mode 100644 index 000000000..e22bd94f3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.f03 @@ -0,0 +1,376 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalThermalNeutronScatteringLaw_incoherentInelastic +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ThermalNeutronScatteringLaw_incoherentInelasticDefaultConst() & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentInelasticDefaultConst +end function ThermalNeutronScatteringLaw_incoherentInelasticDefaultConst + +!! Create, default, non-const +function ThermalNeutronScatteringLaw_incoherentInelasticDefault() & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentInelasticDefault +end function ThermalNeutronScatteringLaw_incoherentInelasticDefault + +!! Create, general, const +function ThermalNeutronScatteringLaw_incoherentInelasticCreateConst( & + label, & + pid, & + productFrame, & + primaryScatterer, & + calculatedAtThermal, & + scatteringAtoms, & + labelSize, & + pidSize, & + productFrameSize, & + primaryScattererSize & +) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + integer(c_size_t), intent(in), value :: primaryScattererSize + character(c_char), intent(in) :: primaryScatterer(primaryScattererSize) + logical(c_bool), intent(in), value :: calculatedAtThermal + type(c_ptr), intent(in), value :: scatteringAtoms + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentInelasticCreateConst +end function ThermalNeutronScatteringLaw_incoherentInelasticCreateConst + +!! Create, general, non-const +function ThermalNeutronScatteringLaw_incoherentInelasticCreate( & + label, & + pid, & + productFrame, & + primaryScatterer, & + calculatedAtThermal, & + scatteringAtoms, & + labelSize, & + pidSize, & + productFrameSize, & + primaryScattererSize & +) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + integer(c_size_t), intent(in), value :: primaryScattererSize + character(c_char), intent(in) :: primaryScatterer(primaryScattererSize) + logical(c_bool), intent(in), value :: calculatedAtThermal + type(c_ptr), intent(in), value :: scatteringAtoms + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentInelasticCreate +end function ThermalNeutronScatteringLaw_incoherentInelasticCreate + +!! Assign +subroutine ThermalNeutronScatteringLaw_incoherentInelasticAssign(handleLHS, handleRHS) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ThermalNeutronScatteringLaw_incoherentInelasticAssign + +!! Delete +subroutine ThermalNeutronScatteringLaw_incoherentInelasticDelete(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ThermalNeutronScatteringLaw_incoherentInelasticDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ThermalNeutronScatteringLaw_incoherentInelasticRead(handle, filename, filenameSize) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentInelasticRead +end function ThermalNeutronScatteringLaw_incoherentInelasticRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ThermalNeutronScatteringLaw_incoherentInelasticWrite(handle, filename, filenameSize) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentInelasticWrite +end function ThermalNeutronScatteringLaw_incoherentInelasticWrite + +!! Print to standard output, in our prettyprinting format +function ThermalNeutronScatteringLaw_incoherentInelasticPrint(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentInelasticPrint +end function ThermalNeutronScatteringLaw_incoherentInelasticPrint + +!! Print to standard output, as XML +function ThermalNeutronScatteringLaw_incoherentInelasticPrintXML(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentInelasticPrintXML +end function ThermalNeutronScatteringLaw_incoherentInelasticPrintXML + +!! Print to standard output, as JSON +function ThermalNeutronScatteringLaw_incoherentInelasticPrintJSON(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentInelasticPrintJSON +end function ThermalNeutronScatteringLaw_incoherentInelasticPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_incoherentInelasticLabelHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentInelasticLabelHas +end function ThermalNeutronScatteringLaw_incoherentInelasticLabelHas + +!! Get +function ThermalNeutronScatteringLaw_incoherentInelasticLabelGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentInelasticLabelGet +end function ThermalNeutronScatteringLaw_incoherentInelasticLabelGet + +!! Set +subroutine ThermalNeutronScatteringLaw_incoherentInelasticLabelSet(handle, label, labelSize) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ThermalNeutronScatteringLaw_incoherentInelasticLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_incoherentInelasticPidHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticPidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentInelasticPidHas +end function ThermalNeutronScatteringLaw_incoherentInelasticPidHas + +!! Get +function ThermalNeutronScatteringLaw_incoherentInelasticPidGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticPidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentInelasticPidGet +end function ThermalNeutronScatteringLaw_incoherentInelasticPidGet + +!! Set +subroutine ThermalNeutronScatteringLaw_incoherentInelasticPidSet(handle, pid, pidSize) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticPidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine ThermalNeutronScatteringLaw_incoherentInelasticPidSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_incoherentInelasticProductFrameHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentInelasticProductFrameHas +end function ThermalNeutronScatteringLaw_incoherentInelasticProductFrameHas + +!! Get +function ThermalNeutronScatteringLaw_incoherentInelasticProductFrameGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentInelasticProductFrameGet +end function ThermalNeutronScatteringLaw_incoherentInelasticProductFrameGet + +!! Set +subroutine ThermalNeutronScatteringLaw_incoherentInelasticProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine ThermalNeutronScatteringLaw_incoherentInelasticProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: primaryScatterer +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererHas +end function ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererHas + +!! Get +function ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererGet +end function ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererGet + +!! Set +subroutine ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererSet(handle, primaryScatterer, primaryScattererSize) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: primaryScattererSize + character(c_char), intent(in) :: primaryScatterer(primaryScattererSize) +end subroutine ThermalNeutronScatteringLaw_incoherentInelasticPrimaryScattererSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: calculatedAtThermal +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalHas +end function ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalHas + +!! Get +function ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + logical(c_bool) :: ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalGet +end function ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalGet + +!! Set +subroutine ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalSet(handle, calculatedAtThermal) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + logical(c_bool), intent(in), value :: calculatedAtThermal +end subroutine ThermalNeutronScatteringLaw_incoherentInelasticCalculatedAtThermalSet + + +!! ----------------------------------------------------------------------------- +!! Child: scatteringAtoms +!! ----------------------------------------------------------------------------- + +!! Has +function ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsHas(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsHas +end function ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsHas + +!! Get, const +function ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGetConst(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGetConst +end function ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGetConst + +!! Get, non-const +function ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGet(handle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGet +end function ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsGet + +!! Set +subroutine ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsSet(handle, fieldHandle) & + bind(C, name='ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ThermalNeutronScatteringLaw_incoherentInelasticScatteringAtomsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalThermalNeutronScatteringLaw_incoherentInelastic diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Theta.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Theta.f03 new file mode 100644 index 000000000..0efcb5882 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Theta.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalTheta +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ThetaDefaultConst() & + bind(C, name='ThetaDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ThetaDefaultConst +end function ThetaDefaultConst + +!! Create, default, non-const +function ThetaDefault() & + bind(C, name='ThetaDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ThetaDefault +end function ThetaDefault + +!! Create, general, const +function ThetaCreateConst( & + XYs1d, & + regions1d & +) & + bind(C, name='ThetaCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr) :: ThetaCreateConst +end function ThetaCreateConst + +!! Create, general, non-const +function ThetaCreate( & + XYs1d, & + regions1d & +) & + bind(C, name='ThetaCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr) :: ThetaCreate +end function ThetaCreate + +!! Assign +subroutine ThetaAssign(handleLHS, handleRHS) & + bind(C, name='ThetaAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ThetaAssign + +!! Delete +subroutine ThetaDelete(handle) & + bind(C, name='ThetaDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ThetaDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ThetaRead(handle, filename, filenameSize) & + bind(C, name='ThetaRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThetaRead +end function ThetaRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ThetaWrite(handle, filename, filenameSize) & + bind(C, name='ThetaWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ThetaWrite +end function ThetaWrite + +!! Print to standard output, in our prettyprinting format +function ThetaPrint(handle) & + bind(C, name='ThetaPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThetaPrint +end function ThetaPrint + +!! Print to standard output, as XML +function ThetaPrintXML(handle) & + bind(C, name='ThetaPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThetaPrintXML +end function ThetaPrintXML + +!! Print to standard output, as JSON +function ThetaPrintJSON(handle) & + bind(C, name='ThetaPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThetaPrintJSON +end function ThetaPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function ThetaXYs1dHas(handle) & + bind(C, name='ThetaXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThetaXYs1dHas +end function ThetaXYs1dHas + +!! Get, const +function ThetaXYs1dGetConst(handle) & + bind(C, name='ThetaXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThetaXYs1dGetConst +end function ThetaXYs1dGetConst + +!! Get, non-const +function ThetaXYs1dGet(handle) & + bind(C, name='ThetaXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ThetaXYs1dGet +end function ThetaXYs1dGet + +!! Set +subroutine ThetaXYs1dSet(handle, fieldHandle) & + bind(C, name='ThetaXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ThetaXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: regions1d +!! ----------------------------------------------------------------------------- + +!! Has +function ThetaRegions1dHas(handle) & + bind(C, name='ThetaRegions1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ThetaRegions1dHas +end function ThetaRegions1dHas + +!! Get, const +function ThetaRegions1dGetConst(handle) & + bind(C, name='ThetaRegions1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ThetaRegions1dGetConst +end function ThetaRegions1dGetConst + +!! Get, non-const +function ThetaRegions1dGet(handle) & + bind(C, name='ThetaRegions1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ThetaRegions1dGet +end function ThetaRegions1dGet + +!! Set +subroutine ThetaRegions1dSet(handle, fieldHandle) & + bind(C, name='ThetaRegions1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ThetaRegions1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalTheta diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Time.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Time.f03 new file mode 100644 index 000000000..ab13b0e8b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Time.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalTime +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function TimeDefaultConst() & + bind(C, name='TimeDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: TimeDefaultConst +end function TimeDefaultConst + +!! Create, default, non-const +function TimeDefault() & + bind(C, name='TimeDefault') + use iso_c_binding + implicit none + type(c_ptr) :: TimeDefault +end function TimeDefault + +!! Create, general, const +function TimeCreateConst( & + Double, & + string & +) & + bind(C, name='TimeCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr), intent(in), value :: string + type(c_ptr) :: TimeCreateConst +end function TimeCreateConst + +!! Create, general, non-const +function TimeCreate( & + Double, & + string & +) & + bind(C, name='TimeCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: Double + type(c_ptr), intent(in), value :: string + type(c_ptr) :: TimeCreate +end function TimeCreate + +!! Assign +subroutine TimeAssign(handleLHS, handleRHS) & + bind(C, name='TimeAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine TimeAssign + +!! Delete +subroutine TimeDelete(handle) & + bind(C, name='TimeDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine TimeDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function TimeRead(handle, filename, filenameSize) & + bind(C, name='TimeRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TimeRead +end function TimeRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function TimeWrite(handle, filename, filenameSize) & + bind(C, name='TimeWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TimeWrite +end function TimeWrite + +!! Print to standard output, in our prettyprinting format +function TimePrint(handle) & + bind(C, name='TimePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TimePrint +end function TimePrint + +!! Print to standard output, as XML +function TimePrintXML(handle) & + bind(C, name='TimePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TimePrintXML +end function TimePrintXML + +!! Print to standard output, as JSON +function TimePrintJSON(handle) & + bind(C, name='TimePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TimePrintJSON +end function TimePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: Double +!! ----------------------------------------------------------------------------- + +!! Has +function TimeDoubleHas(handle) & + bind(C, name='TimeDoubleHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TimeDoubleHas +end function TimeDoubleHas + +!! Get, const +function TimeDoubleGetConst(handle) & + bind(C, name='TimeDoubleGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TimeDoubleGetConst +end function TimeDoubleGetConst + +!! Get, non-const +function TimeDoubleGet(handle) & + bind(C, name='TimeDoubleGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: TimeDoubleGet +end function TimeDoubleGet + +!! Set +subroutine TimeDoubleSet(handle, fieldHandle) & + bind(C, name='TimeDoubleSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine TimeDoubleSet + + +!! ----------------------------------------------------------------------------- +!! Child: string +!! ----------------------------------------------------------------------------- + +!! Has +function TimeStringHas(handle) & + bind(C, name='TimeStringHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TimeStringHas +end function TimeStringHas + +!! Get, const +function TimeStringGetConst(handle) & + bind(C, name='TimeStringGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TimeStringGetConst +end function TimeStringGetConst + +!! Get, non-const +function TimeStringGet(handle) & + bind(C, name='TimeStringGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: TimeStringGet +end function TimeStringGet + +!! Set +subroutine TimeStringSet(handle, fieldHandle) & + bind(C, name='TimeStringSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine TimeStringSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalTime diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Title.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Title.f03 new file mode 100644 index 000000000..624f535e6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Title.f03 @@ -0,0 +1,131 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalTitle +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function TitleDefaultConst() & + bind(C, name='TitleDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: TitleDefaultConst +end function TitleDefaultConst + +!! Create, default, non-const +function TitleDefault() & + bind(C, name='TitleDefault') + use iso_c_binding + implicit none + type(c_ptr) :: TitleDefault +end function TitleDefault + +!! Create, general, const +function TitleCreateConst( & +) & + bind(C, name='TitleCreateConst') + use iso_c_binding + implicit none + type(c_ptr) :: TitleCreateConst +end function TitleCreateConst + +!! Create, general, non-const +function TitleCreate( & +) & + bind(C, name='TitleCreate') + use iso_c_binding + implicit none + type(c_ptr) :: TitleCreate +end function TitleCreate + +!! Assign +subroutine TitleAssign(handleLHS, handleRHS) & + bind(C, name='TitleAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine TitleAssign + +!! Delete +subroutine TitleDelete(handle) & + bind(C, name='TitleDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine TitleDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function TitleRead(handle, filename, filenameSize) & + bind(C, name='TitleRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TitleRead +end function TitleRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function TitleWrite(handle, filename, filenameSize) & + bind(C, name='TitleWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TitleWrite +end function TitleWrite + +!! Print to standard output, in our prettyprinting format +function TitlePrint(handle) & + bind(C, name='TitlePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TitlePrint +end function TitlePrint + +!! Print to standard output, as XML +function TitlePrintXML(handle) & + bind(C, name='TitlePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TitlePrintXML +end function TitlePrintXML + +!! Print to standard output, as JSON +function TitlePrintJSON(handle) & + bind(C, name='TitlePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TitlePrintJSON +end function TitlePrintJSON + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalTitle diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/TotalEnergy.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/TotalEnergy.f03 new file mode 100644 index 000000000..4b8393e9b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/TotalEnergy.f03 @@ -0,0 +1,176 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalTotalEnergy +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function TotalEnergyDefaultConst() & + bind(C, name='TotalEnergyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: TotalEnergyDefaultConst +end function TotalEnergyDefaultConst + +!! Create, default, non-const +function TotalEnergyDefault() & + bind(C, name='TotalEnergyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: TotalEnergyDefault +end function TotalEnergyDefault + +!! Create, general, const +function TotalEnergyCreateConst( & + polynomial1d & +) & + bind(C, name='TotalEnergyCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: TotalEnergyCreateConst +end function TotalEnergyCreateConst + +!! Create, general, non-const +function TotalEnergyCreate( & + polynomial1d & +) & + bind(C, name='TotalEnergyCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: TotalEnergyCreate +end function TotalEnergyCreate + +!! Assign +subroutine TotalEnergyAssign(handleLHS, handleRHS) & + bind(C, name='TotalEnergyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine TotalEnergyAssign + +!! Delete +subroutine TotalEnergyDelete(handle) & + bind(C, name='TotalEnergyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine TotalEnergyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function TotalEnergyRead(handle, filename, filenameSize) & + bind(C, name='TotalEnergyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TotalEnergyRead +end function TotalEnergyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function TotalEnergyWrite(handle, filename, filenameSize) & + bind(C, name='TotalEnergyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: TotalEnergyWrite +end function TotalEnergyWrite + +!! Print to standard output, in our prettyprinting format +function TotalEnergyPrint(handle) & + bind(C, name='TotalEnergyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TotalEnergyPrint +end function TotalEnergyPrint + +!! Print to standard output, as XML +function TotalEnergyPrintXML(handle) & + bind(C, name='TotalEnergyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TotalEnergyPrintXML +end function TotalEnergyPrintXML + +!! Print to standard output, as JSON +function TotalEnergyPrintJSON(handle) & + bind(C, name='TotalEnergyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TotalEnergyPrintJSON +end function TotalEnergyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: polynomial1d +!! ----------------------------------------------------------------------------- + +!! Has +function TotalEnergyPolynomial1dHas(handle) & + bind(C, name='TotalEnergyPolynomial1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: TotalEnergyPolynomial1dHas +end function TotalEnergyPolynomial1dHas + +!! Get, const +function TotalEnergyPolynomial1dGetConst(handle) & + bind(C, name='TotalEnergyPolynomial1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: TotalEnergyPolynomial1dGetConst +end function TotalEnergyPolynomial1dGetConst + +!! Get, non-const +function TotalEnergyPolynomial1dGet(handle) & + bind(C, name='TotalEnergyPolynomial1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: TotalEnergyPolynomial1dGet +end function TotalEnergyPolynomial1dGet + +!! Set +subroutine TotalEnergyPolynomial1dSet(handle, fieldHandle) & + bind(C, name='TotalEnergyPolynomial1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine TotalEnergyPolynomial1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalTotalEnergy diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/U.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/U.f03 new file mode 100644 index 000000000..8787c5f2e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/U.f03 @@ -0,0 +1,208 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalU +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function UDefaultConst() & + bind(C, name='UDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: UDefaultConst +end function UDefaultConst + +!! Create, default, non-const +function UDefault() & + bind(C, name='UDefault') + use iso_c_binding + implicit none + type(c_ptr) :: UDefault +end function UDefault + +!! Create, general, const +function UCreateConst( & + value, & + unit, & + unitSize & +) & + bind(C, name='UCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: UCreateConst +end function UCreateConst + +!! Create, general, non-const +function UCreate( & + value, & + unit, & + unitSize & +) & + bind(C, name='UCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) + type(c_ptr) :: UCreate +end function UCreate + +!! Assign +subroutine UAssign(handleLHS, handleRHS) & + bind(C, name='UAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine UAssign + +!! Delete +subroutine UDelete(handle) & + bind(C, name='UDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine UDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function URead(handle, filename, filenameSize) & + bind(C, name='URead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: URead +end function URead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function UWrite(handle, filename, filenameSize) & + bind(C, name='UWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UWrite +end function UWrite + +!! Print to standard output, in our prettyprinting format +function UPrint(handle) & + bind(C, name='UPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UPrint +end function UPrint + +!! Print to standard output, as XML +function UPrintXML(handle) & + bind(C, name='UPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UPrintXML +end function UPrintXML + +!! Print to standard output, as JSON +function UPrintJSON(handle) & + bind(C, name='UPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UPrintJSON +end function UPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function UValueHas(handle) & + bind(C, name='UValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UValueHas +end function UValueHas + +!! Get +function UValueGet(handle) & + bind(C, name='UValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: UValueGet +end function UValueGet + +!! Set +subroutine UValueSet(handle, value) & + bind(C, name='UValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine UValueSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: unit +!! ----------------------------------------------------------------------------- + +!! Has +function UUnitHas(handle) & + bind(C, name='UUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UUnitHas +end function UUnitHas + +!! Get +function UUnitGet(handle) & + bind(C, name='UUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UUnitGet +end function UUnitGet + +!! Set +subroutine UUnitSet(handle, unit, unitSize) & + bind(C, name='UUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: unitSize + character(c_char), intent(in) :: unit(unitSize) +end subroutine UUnitSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalU diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Uncertainty.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Uncertainty.f03 new file mode 100644 index 000000000..60b2f0351 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Uncertainty.f03 @@ -0,0 +1,311 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalUncertainty +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function UncertaintyDefaultConst() & + bind(C, name='UncertaintyDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: UncertaintyDefaultConst +end function UncertaintyDefaultConst + +!! Create, default, non-const +function UncertaintyDefault() & + bind(C, name='UncertaintyDefault') + use iso_c_binding + implicit none + type(c_ptr) :: UncertaintyDefault +end function UncertaintyDefault + +!! Create, general, const +function UncertaintyCreateConst( & + covariance, & + standard, & + listOfCovariances, & + polynomial1d & +) & + bind(C, name='UncertaintyCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: covariance + type(c_ptr), intent(in), value :: standard + type(c_ptr), intent(in), value :: listOfCovariances + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: UncertaintyCreateConst +end function UncertaintyCreateConst + +!! Create, general, non-const +function UncertaintyCreate( & + covariance, & + standard, & + listOfCovariances, & + polynomial1d & +) & + bind(C, name='UncertaintyCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: covariance + type(c_ptr), intent(in), value :: standard + type(c_ptr), intent(in), value :: listOfCovariances + type(c_ptr), intent(in), value :: polynomial1d + type(c_ptr) :: UncertaintyCreate +end function UncertaintyCreate + +!! Assign +subroutine UncertaintyAssign(handleLHS, handleRHS) & + bind(C, name='UncertaintyAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine UncertaintyAssign + +!! Delete +subroutine UncertaintyDelete(handle) & + bind(C, name='UncertaintyDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine UncertaintyDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function UncertaintyRead(handle, filename, filenameSize) & + bind(C, name='UncertaintyRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UncertaintyRead +end function UncertaintyRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function UncertaintyWrite(handle, filename, filenameSize) & + bind(C, name='UncertaintyWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UncertaintyWrite +end function UncertaintyWrite + +!! Print to standard output, in our prettyprinting format +function UncertaintyPrint(handle) & + bind(C, name='UncertaintyPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncertaintyPrint +end function UncertaintyPrint + +!! Print to standard output, as XML +function UncertaintyPrintXML(handle) & + bind(C, name='UncertaintyPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncertaintyPrintXML +end function UncertaintyPrintXML + +!! Print to standard output, as JSON +function UncertaintyPrintJSON(handle) & + bind(C, name='UncertaintyPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncertaintyPrintJSON +end function UncertaintyPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: covariance +!! ----------------------------------------------------------------------------- + +!! Has +function UncertaintyCovarianceHas(handle) & + bind(C, name='UncertaintyCovarianceHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncertaintyCovarianceHas +end function UncertaintyCovarianceHas + +!! Get, const +function UncertaintyCovarianceGetConst(handle) & + bind(C, name='UncertaintyCovarianceGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UncertaintyCovarianceGetConst +end function UncertaintyCovarianceGetConst + +!! Get, non-const +function UncertaintyCovarianceGet(handle) & + bind(C, name='UncertaintyCovarianceGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: UncertaintyCovarianceGet +end function UncertaintyCovarianceGet + +!! Set +subroutine UncertaintyCovarianceSet(handle, fieldHandle) & + bind(C, name='UncertaintyCovarianceSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UncertaintyCovarianceSet + + +!! ----------------------------------------------------------------------------- +!! Child: standard +!! ----------------------------------------------------------------------------- + +!! Has +function UncertaintyStandardHas(handle) & + bind(C, name='UncertaintyStandardHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncertaintyStandardHas +end function UncertaintyStandardHas + +!! Get, const +function UncertaintyStandardGetConst(handle) & + bind(C, name='UncertaintyStandardGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UncertaintyStandardGetConst +end function UncertaintyStandardGetConst + +!! Get, non-const +function UncertaintyStandardGet(handle) & + bind(C, name='UncertaintyStandardGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: UncertaintyStandardGet +end function UncertaintyStandardGet + +!! Set +subroutine UncertaintyStandardSet(handle, fieldHandle) & + bind(C, name='UncertaintyStandardSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UncertaintyStandardSet + + +!! ----------------------------------------------------------------------------- +!! Child: listOfCovariances +!! ----------------------------------------------------------------------------- + +!! Has +function UncertaintyListOfCovariancesHas(handle) & + bind(C, name='UncertaintyListOfCovariancesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncertaintyListOfCovariancesHas +end function UncertaintyListOfCovariancesHas + +!! Get, const +function UncertaintyListOfCovariancesGetConst(handle) & + bind(C, name='UncertaintyListOfCovariancesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UncertaintyListOfCovariancesGetConst +end function UncertaintyListOfCovariancesGetConst + +!! Get, non-const +function UncertaintyListOfCovariancesGet(handle) & + bind(C, name='UncertaintyListOfCovariancesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: UncertaintyListOfCovariancesGet +end function UncertaintyListOfCovariancesGet + +!! Set +subroutine UncertaintyListOfCovariancesSet(handle, fieldHandle) & + bind(C, name='UncertaintyListOfCovariancesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UncertaintyListOfCovariancesSet + + +!! ----------------------------------------------------------------------------- +!! Child: polynomial1d +!! ----------------------------------------------------------------------------- + +!! Has +function UncertaintyPolynomial1dHas(handle) & + bind(C, name='UncertaintyPolynomial1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncertaintyPolynomial1dHas +end function UncertaintyPolynomial1dHas + +!! Get, const +function UncertaintyPolynomial1dGetConst(handle) & + bind(C, name='UncertaintyPolynomial1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UncertaintyPolynomial1dGetConst +end function UncertaintyPolynomial1dGetConst + +!! Get, non-const +function UncertaintyPolynomial1dGet(handle) & + bind(C, name='UncertaintyPolynomial1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: UncertaintyPolynomial1dGet +end function UncertaintyPolynomial1dGet + +!! Set +subroutine UncertaintyPolynomial1dSet(handle, fieldHandle) & + bind(C, name='UncertaintyPolynomial1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UncertaintyPolynomial1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalUncertainty diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Uncorrelated.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Uncorrelated.f03 new file mode 100644 index 000000000..7876b3e17 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Uncorrelated.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalUncorrelated +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function UncorrelatedDefaultConst() & + bind(C, name='UncorrelatedDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: UncorrelatedDefaultConst +end function UncorrelatedDefaultConst + +!! Create, default, non-const +function UncorrelatedDefault() & + bind(C, name='UncorrelatedDefault') + use iso_c_binding + implicit none + type(c_ptr) :: UncorrelatedDefault +end function UncorrelatedDefault + +!! Create, general, const +function UncorrelatedCreateConst( & + label, & + productFrame, & + angular, & + energy, & + labelSize, & + productFrameSize & +) & + bind(C, name='UncorrelatedCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: angular + type(c_ptr), intent(in), value :: energy + type(c_ptr) :: UncorrelatedCreateConst +end function UncorrelatedCreateConst + +!! Create, general, non-const +function UncorrelatedCreate( & + label, & + productFrame, & + angular, & + energy, & + labelSize, & + productFrameSize & +) & + bind(C, name='UncorrelatedCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr), intent(in), value :: angular + type(c_ptr), intent(in), value :: energy + type(c_ptr) :: UncorrelatedCreate +end function UncorrelatedCreate + +!! Assign +subroutine UncorrelatedAssign(handleLHS, handleRHS) & + bind(C, name='UncorrelatedAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine UncorrelatedAssign + +!! Delete +subroutine UncorrelatedDelete(handle) & + bind(C, name='UncorrelatedDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine UncorrelatedDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function UncorrelatedRead(handle, filename, filenameSize) & + bind(C, name='UncorrelatedRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UncorrelatedRead +end function UncorrelatedRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function UncorrelatedWrite(handle, filename, filenameSize) & + bind(C, name='UncorrelatedWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UncorrelatedWrite +end function UncorrelatedWrite + +!! Print to standard output, in our prettyprinting format +function UncorrelatedPrint(handle) & + bind(C, name='UncorrelatedPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncorrelatedPrint +end function UncorrelatedPrint + +!! Print to standard output, as XML +function UncorrelatedPrintXML(handle) & + bind(C, name='UncorrelatedPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncorrelatedPrintXML +end function UncorrelatedPrintXML + +!! Print to standard output, as JSON +function UncorrelatedPrintJSON(handle) & + bind(C, name='UncorrelatedPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncorrelatedPrintJSON +end function UncorrelatedPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function UncorrelatedLabelHas(handle) & + bind(C, name='UncorrelatedLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncorrelatedLabelHas +end function UncorrelatedLabelHas + +!! Get +function UncorrelatedLabelGet(handle) & + bind(C, name='UncorrelatedLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UncorrelatedLabelGet +end function UncorrelatedLabelGet + +!! Set +subroutine UncorrelatedLabelSet(handle, label, labelSize) & + bind(C, name='UncorrelatedLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine UncorrelatedLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function UncorrelatedProductFrameHas(handle) & + bind(C, name='UncorrelatedProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncorrelatedProductFrameHas +end function UncorrelatedProductFrameHas + +!! Get +function UncorrelatedProductFrameGet(handle) & + bind(C, name='UncorrelatedProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UncorrelatedProductFrameGet +end function UncorrelatedProductFrameGet + +!! Set +subroutine UncorrelatedProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='UncorrelatedProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine UncorrelatedProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! Child: angular +!! ----------------------------------------------------------------------------- + +!! Has +function UncorrelatedAngularHas(handle) & + bind(C, name='UncorrelatedAngularHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncorrelatedAngularHas +end function UncorrelatedAngularHas + +!! Get, const +function UncorrelatedAngularGetConst(handle) & + bind(C, name='UncorrelatedAngularGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UncorrelatedAngularGetConst +end function UncorrelatedAngularGetConst + +!! Get, non-const +function UncorrelatedAngularGet(handle) & + bind(C, name='UncorrelatedAngularGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: UncorrelatedAngularGet +end function UncorrelatedAngularGet + +!! Set +subroutine UncorrelatedAngularSet(handle, fieldHandle) & + bind(C, name='UncorrelatedAngularSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UncorrelatedAngularSet + + +!! ----------------------------------------------------------------------------- +!! Child: energy +!! ----------------------------------------------------------------------------- + +!! Has +function UncorrelatedEnergyHas(handle) & + bind(C, name='UncorrelatedEnergyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UncorrelatedEnergyHas +end function UncorrelatedEnergyHas + +!! Get, const +function UncorrelatedEnergyGetConst(handle) & + bind(C, name='UncorrelatedEnergyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UncorrelatedEnergyGetConst +end function UncorrelatedEnergyGetConst + +!! Get, non-const +function UncorrelatedEnergyGet(handle) & + bind(C, name='UncorrelatedEnergyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: UncorrelatedEnergyGet +end function UncorrelatedEnergyGet + +!! Set +subroutine UncorrelatedEnergySet(handle, fieldHandle) & + bind(C, name='UncorrelatedEnergySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UncorrelatedEnergySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalUncorrelated diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unorthodox.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unorthodox.f03 new file mode 100644 index 000000000..ef7c345d3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unorthodox.f03 @@ -0,0 +1,217 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalUnorthodox +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function UnorthodoxDefaultConst() & + bind(C, name='UnorthodoxDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: UnorthodoxDefaultConst +end function UnorthodoxDefaultConst + +!! Create, default, non-const +function UnorthodoxDefault() & + bind(C, name='UnorthodoxDefault') + use iso_c_binding + implicit none + type(c_ptr) :: UnorthodoxDefault +end function UnorthodoxDefault + +!! Create, general, const +function UnorthodoxCreateConst( & + id, & + mass, & + idSize & +) & + bind(C, name='UnorthodoxCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + type(c_ptr), intent(in), value :: mass + type(c_ptr) :: UnorthodoxCreateConst +end function UnorthodoxCreateConst + +!! Create, general, non-const +function UnorthodoxCreate( & + id, & + mass, & + idSize & +) & + bind(C, name='UnorthodoxCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) + type(c_ptr), intent(in), value :: mass + type(c_ptr) :: UnorthodoxCreate +end function UnorthodoxCreate + +!! Assign +subroutine UnorthodoxAssign(handleLHS, handleRHS) & + bind(C, name='UnorthodoxAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine UnorthodoxAssign + +!! Delete +subroutine UnorthodoxDelete(handle) & + bind(C, name='UnorthodoxDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine UnorthodoxDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function UnorthodoxRead(handle, filename, filenameSize) & + bind(C, name='UnorthodoxRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UnorthodoxRead +end function UnorthodoxRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function UnorthodoxWrite(handle, filename, filenameSize) & + bind(C, name='UnorthodoxWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UnorthodoxWrite +end function UnorthodoxWrite + +!! Print to standard output, in our prettyprinting format +function UnorthodoxPrint(handle) & + bind(C, name='UnorthodoxPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnorthodoxPrint +end function UnorthodoxPrint + +!! Print to standard output, as XML +function UnorthodoxPrintXML(handle) & + bind(C, name='UnorthodoxPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnorthodoxPrintXML +end function UnorthodoxPrintXML + +!! Print to standard output, as JSON +function UnorthodoxPrintJSON(handle) & + bind(C, name='UnorthodoxPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnorthodoxPrintJSON +end function UnorthodoxPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: id +!! ----------------------------------------------------------------------------- + +!! Has +function UnorthodoxIdHas(handle) & + bind(C, name='UnorthodoxIdHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnorthodoxIdHas +end function UnorthodoxIdHas + +!! Get +function UnorthodoxIdGet(handle) & + bind(C, name='UnorthodoxIdGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UnorthodoxIdGet +end function UnorthodoxIdGet + +!! Set +subroutine UnorthodoxIdSet(handle, id, idSize) & + bind(C, name='UnorthodoxIdSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: idSize + character(c_char), intent(in) :: id(idSize) +end subroutine UnorthodoxIdSet + + +!! ----------------------------------------------------------------------------- +!! Child: mass +!! ----------------------------------------------------------------------------- + +!! Has +function UnorthodoxMassHas(handle) & + bind(C, name='UnorthodoxMassHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnorthodoxMassHas +end function UnorthodoxMassHas + +!! Get, const +function UnorthodoxMassGetConst(handle) & + bind(C, name='UnorthodoxMassGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UnorthodoxMassGetConst +end function UnorthodoxMassGetConst + +!! Get, non-const +function UnorthodoxMassGet(handle) & + bind(C, name='UnorthodoxMassGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: UnorthodoxMassGet +end function UnorthodoxMassGet + +!! Set +subroutine UnorthodoxMassSet(handle, fieldHandle) & + bind(C, name='UnorthodoxMassSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UnorthodoxMassSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalUnorthodox diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unorthodoxes.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unorthodoxes.f03 new file mode 100644 index 000000000..e1ca93c39 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unorthodoxes.f03 @@ -0,0 +1,255 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalUnorthodoxes +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function UnorthodoxesDefaultConst() & + bind(C, name='UnorthodoxesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: UnorthodoxesDefaultConst +end function UnorthodoxesDefaultConst + +!! Create, default, non-const +function UnorthodoxesDefault() & + bind(C, name='UnorthodoxesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: UnorthodoxesDefault +end function UnorthodoxesDefault + +!! Create, general, const +function UnorthodoxesCreateConst( & + unorthodox, unorthodoxSize & +) & + bind(C, name='UnorthodoxesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: unorthodoxSize + type(c_ptr), intent(in) :: unorthodox(unorthodoxSize) + type(c_ptr) :: UnorthodoxesCreateConst +end function UnorthodoxesCreateConst + +!! Create, general, non-const +function UnorthodoxesCreate( & + unorthodox, unorthodoxSize & +) & + bind(C, name='UnorthodoxesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: unorthodoxSize + type(c_ptr), intent(in) :: unorthodox(unorthodoxSize) + type(c_ptr) :: UnorthodoxesCreate +end function UnorthodoxesCreate + +!! Assign +subroutine UnorthodoxesAssign(handleLHS, handleRHS) & + bind(C, name='UnorthodoxesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine UnorthodoxesAssign + +!! Delete +subroutine UnorthodoxesDelete(handle) & + bind(C, name='UnorthodoxesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine UnorthodoxesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function UnorthodoxesRead(handle, filename, filenameSize) & + bind(C, name='UnorthodoxesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UnorthodoxesRead +end function UnorthodoxesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function UnorthodoxesWrite(handle, filename, filenameSize) & + bind(C, name='UnorthodoxesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UnorthodoxesWrite +end function UnorthodoxesWrite + +!! Print to standard output, in our prettyprinting format +function UnorthodoxesPrint(handle) & + bind(C, name='UnorthodoxesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnorthodoxesPrint +end function UnorthodoxesPrint + +!! Print to standard output, as XML +function UnorthodoxesPrintXML(handle) & + bind(C, name='UnorthodoxesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnorthodoxesPrintXML +end function UnorthodoxesPrintXML + +!! Print to standard output, as JSON +function UnorthodoxesPrintJSON(handle) & + bind(C, name='UnorthodoxesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnorthodoxesPrintJSON +end function UnorthodoxesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: unorthodox +!! ----------------------------------------------------------------------------- + +!! Has +function UnorthodoxesUnorthodoxHas(handle) & + bind(C, name='UnorthodoxesUnorthodoxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnorthodoxesUnorthodoxHas +end function UnorthodoxesUnorthodoxHas + +!! Clear +subroutine UnorthodoxesUnorthodoxClear(handle) & + bind(C, name='UnorthodoxesUnorthodoxClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine UnorthodoxesUnorthodoxClear + +!! Size +function UnorthodoxesUnorthodoxSize(handle) & + bind(C, name='UnorthodoxesUnorthodoxSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: UnorthodoxesUnorthodoxSize +end function UnorthodoxesUnorthodoxSize + +!! Add +subroutine UnorthodoxesUnorthodoxAdd(handle, fieldHandle) & + bind(C, name='UnorthodoxesUnorthodoxAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UnorthodoxesUnorthodoxAdd + +!! Get, by index \in [0,size), const +function UnorthodoxesUnorthodoxGetConst(handle, index) & + bind(C, name='UnorthodoxesUnorthodoxGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: UnorthodoxesUnorthodoxGetConst +end function UnorthodoxesUnorthodoxGetConst + +!! Get, by index \in [0,size), non-const +function UnorthodoxesUnorthodoxGet(handle, index) & + bind(C, name='UnorthodoxesUnorthodoxGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: UnorthodoxesUnorthodoxGet +end function UnorthodoxesUnorthodoxGet + +!! Set, by index \in [0,size) +subroutine UnorthodoxesUnorthodoxSet(handle, index, fieldHandle) & + bind(C, name='UnorthodoxesUnorthodoxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UnorthodoxesUnorthodoxSet + +!! ------------------------ +!! Re: metadatum id +!! ------------------------ + +!! Has, by id +function UnorthodoxesUnorthodoxHasById(handle, meta, metaSize) & + bind(C, name='UnorthodoxesUnorthodoxHasById') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: UnorthodoxesUnorthodoxHasById +end function UnorthodoxesUnorthodoxHasById + +!! Get, by id, const +function UnorthodoxesUnorthodoxGetByIdConst(handle, meta, metaSize) & + bind(C, name='UnorthodoxesUnorthodoxGetByIdConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: UnorthodoxesUnorthodoxGetByIdConst +end function UnorthodoxesUnorthodoxGetByIdConst + +!! Get, by id, non-const +function UnorthodoxesUnorthodoxGetById(handle, meta, metaSize) & + bind(C, name='UnorthodoxesUnorthodoxGetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: UnorthodoxesUnorthodoxGetById +end function UnorthodoxesUnorthodoxGetById + +!! Set, by id +subroutine UnorthodoxesUnorthodoxSetById(handle, meta, metaSize, fieldHandle) & + bind(C, name='UnorthodoxesUnorthodoxSetById') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UnorthodoxesUnorthodoxSetById + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalUnorthodoxes diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unresolved.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unresolved.f03 new file mode 100644 index 000000000..8ef23337c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unresolved.f03 @@ -0,0 +1,289 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalUnresolved +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function UnresolvedDefaultConst() & + bind(C, name='UnresolvedDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: UnresolvedDefaultConst +end function UnresolvedDefaultConst + +!! Create, default, non-const +function UnresolvedDefault() & + bind(C, name='UnresolvedDefault') + use iso_c_binding + implicit none + type(c_ptr) :: UnresolvedDefault +end function UnresolvedDefault + +!! Create, general, const +function UnresolvedCreateConst( & + domainMin, & + domainMax, & + domainUnit, & + tabulatedWidths, & + domainUnitSize & +) & + bind(C, name='UnresolvedCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) + type(c_ptr), intent(in), value :: tabulatedWidths + type(c_ptr) :: UnresolvedCreateConst +end function UnresolvedCreateConst + +!! Create, general, non-const +function UnresolvedCreate( & + domainMin, & + domainMax, & + domainUnit, & + tabulatedWidths, & + domainUnitSize & +) & + bind(C, name='UnresolvedCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) + type(c_ptr), intent(in), value :: tabulatedWidths + type(c_ptr) :: UnresolvedCreate +end function UnresolvedCreate + +!! Assign +subroutine UnresolvedAssign(handleLHS, handleRHS) & + bind(C, name='UnresolvedAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine UnresolvedAssign + +!! Delete +subroutine UnresolvedDelete(handle) & + bind(C, name='UnresolvedDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine UnresolvedDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function UnresolvedRead(handle, filename, filenameSize) & + bind(C, name='UnresolvedRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UnresolvedRead +end function UnresolvedRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function UnresolvedWrite(handle, filename, filenameSize) & + bind(C, name='UnresolvedWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UnresolvedWrite +end function UnresolvedWrite + +!! Print to standard output, in our prettyprinting format +function UnresolvedPrint(handle) & + bind(C, name='UnresolvedPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedPrint +end function UnresolvedPrint + +!! Print to standard output, as XML +function UnresolvedPrintXML(handle) & + bind(C, name='UnresolvedPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedPrintXML +end function UnresolvedPrintXML + +!! Print to standard output, as JSON +function UnresolvedPrintJSON(handle) & + bind(C, name='UnresolvedPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedPrintJSON +end function UnresolvedPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMin +!! ----------------------------------------------------------------------------- + +!! Has +function UnresolvedDomainMinHas(handle) & + bind(C, name='UnresolvedDomainMinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedDomainMinHas +end function UnresolvedDomainMinHas + +!! Get +function UnresolvedDomainMinGet(handle) & + bind(C, name='UnresolvedDomainMinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: UnresolvedDomainMinGet +end function UnresolvedDomainMinGet + +!! Set +subroutine UnresolvedDomainMinSet(handle, domainMin) & + bind(C, name='UnresolvedDomainMinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMin +end subroutine UnresolvedDomainMinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMax +!! ----------------------------------------------------------------------------- + +!! Has +function UnresolvedDomainMaxHas(handle) & + bind(C, name='UnresolvedDomainMaxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedDomainMaxHas +end function UnresolvedDomainMaxHas + +!! Get +function UnresolvedDomainMaxGet(handle) & + bind(C, name='UnresolvedDomainMaxGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: UnresolvedDomainMaxGet +end function UnresolvedDomainMaxGet + +!! Set +subroutine UnresolvedDomainMaxSet(handle, domainMax) & + bind(C, name='UnresolvedDomainMaxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMax +end subroutine UnresolvedDomainMaxSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainUnit +!! ----------------------------------------------------------------------------- + +!! Has +function UnresolvedDomainUnitHas(handle) & + bind(C, name='UnresolvedDomainUnitHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedDomainUnitHas +end function UnresolvedDomainUnitHas + +!! Get +function UnresolvedDomainUnitGet(handle) & + bind(C, name='UnresolvedDomainUnitGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UnresolvedDomainUnitGet +end function UnresolvedDomainUnitGet + +!! Set +subroutine UnresolvedDomainUnitSet(handle, domainUnit, domainUnitSize) & + bind(C, name='UnresolvedDomainUnitSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: domainUnitSize + character(c_char), intent(in) :: domainUnit(domainUnitSize) +end subroutine UnresolvedDomainUnitSet + + +!! ----------------------------------------------------------------------------- +!! Child: tabulatedWidths +!! ----------------------------------------------------------------------------- + +!! Has +function UnresolvedTabulatedWidthsHas(handle) & + bind(C, name='UnresolvedTabulatedWidthsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedTabulatedWidthsHas +end function UnresolvedTabulatedWidthsHas + +!! Get, const +function UnresolvedTabulatedWidthsGetConst(handle) & + bind(C, name='UnresolvedTabulatedWidthsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UnresolvedTabulatedWidthsGetConst +end function UnresolvedTabulatedWidthsGetConst + +!! Get, non-const +function UnresolvedTabulatedWidthsGet(handle) & + bind(C, name='UnresolvedTabulatedWidthsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: UnresolvedTabulatedWidthsGet +end function UnresolvedTabulatedWidthsGet + +!! Set +subroutine UnresolvedTabulatedWidthsSet(handle, fieldHandle) & + bind(C, name='UnresolvedTabulatedWidthsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UnresolvedTabulatedWidthsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalUnresolved diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/UnresolvedRegion.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/UnresolvedRegion.f03 new file mode 100644 index 000000000..eefb23d2b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/UnresolvedRegion.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalUnresolvedRegion +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function UnresolvedRegionDefaultConst() & + bind(C, name='UnresolvedRegionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: UnresolvedRegionDefaultConst +end function UnresolvedRegionDefaultConst + +!! Create, default, non-const +function UnresolvedRegionDefault() & + bind(C, name='UnresolvedRegionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: UnresolvedRegionDefault +end function UnresolvedRegionDefault + +!! Create, general, const +function UnresolvedRegionCreateConst( & + XYs1d, & + regions1d & +) & + bind(C, name='UnresolvedRegionCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr) :: UnresolvedRegionCreateConst +end function UnresolvedRegionCreateConst + +!! Create, general, non-const +function UnresolvedRegionCreate( & + XYs1d, & + regions1d & +) & + bind(C, name='UnresolvedRegionCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr) :: UnresolvedRegionCreate +end function UnresolvedRegionCreate + +!! Assign +subroutine UnresolvedRegionAssign(handleLHS, handleRHS) & + bind(C, name='UnresolvedRegionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine UnresolvedRegionAssign + +!! Delete +subroutine UnresolvedRegionDelete(handle) & + bind(C, name='UnresolvedRegionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine UnresolvedRegionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function UnresolvedRegionRead(handle, filename, filenameSize) & + bind(C, name='UnresolvedRegionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UnresolvedRegionRead +end function UnresolvedRegionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function UnresolvedRegionWrite(handle, filename, filenameSize) & + bind(C, name='UnresolvedRegionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UnresolvedRegionWrite +end function UnresolvedRegionWrite + +!! Print to standard output, in our prettyprinting format +function UnresolvedRegionPrint(handle) & + bind(C, name='UnresolvedRegionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedRegionPrint +end function UnresolvedRegionPrint + +!! Print to standard output, as XML +function UnresolvedRegionPrintXML(handle) & + bind(C, name='UnresolvedRegionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedRegionPrintXML +end function UnresolvedRegionPrintXML + +!! Print to standard output, as JSON +function UnresolvedRegionPrintJSON(handle) & + bind(C, name='UnresolvedRegionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedRegionPrintJSON +end function UnresolvedRegionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function UnresolvedRegionXYs1dHas(handle) & + bind(C, name='UnresolvedRegionXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedRegionXYs1dHas +end function UnresolvedRegionXYs1dHas + +!! Get, const +function UnresolvedRegionXYs1dGetConst(handle) & + bind(C, name='UnresolvedRegionXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UnresolvedRegionXYs1dGetConst +end function UnresolvedRegionXYs1dGetConst + +!! Get, non-const +function UnresolvedRegionXYs1dGet(handle) & + bind(C, name='UnresolvedRegionXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: UnresolvedRegionXYs1dGet +end function UnresolvedRegionXYs1dGet + +!! Set +subroutine UnresolvedRegionXYs1dSet(handle, fieldHandle) & + bind(C, name='UnresolvedRegionXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UnresolvedRegionXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: regions1d +!! ----------------------------------------------------------------------------- + +!! Has +function UnresolvedRegionRegions1dHas(handle) & + bind(C, name='UnresolvedRegionRegions1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnresolvedRegionRegions1dHas +end function UnresolvedRegionRegions1dHas + +!! Get, const +function UnresolvedRegionRegions1dGetConst(handle) & + bind(C, name='UnresolvedRegionRegions1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UnresolvedRegionRegions1dGetConst +end function UnresolvedRegionRegions1dGetConst + +!! Get, non-const +function UnresolvedRegionRegions1dGet(handle) & + bind(C, name='UnresolvedRegionRegions1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: UnresolvedRegionRegions1dGet +end function UnresolvedRegionRegions1dGet + +!! Set +subroutine UnresolvedRegionRegions1dSet(handle, fieldHandle) & + bind(C, name='UnresolvedRegionRegions1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine UnresolvedRegionRegions1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalUnresolvedRegion diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unspecified.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unspecified.f03 new file mode 100644 index 000000000..cb73767ff --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Unspecified.f03 @@ -0,0 +1,213 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalUnspecified +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function UnspecifiedDefaultConst() & + bind(C, name='UnspecifiedDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: UnspecifiedDefaultConst +end function UnspecifiedDefaultConst + +!! Create, default, non-const +function UnspecifiedDefault() & + bind(C, name='UnspecifiedDefault') + use iso_c_binding + implicit none + type(c_ptr) :: UnspecifiedDefault +end function UnspecifiedDefault + +!! Create, general, const +function UnspecifiedCreateConst( & + label, & + productFrame, & + labelSize, & + productFrameSize & +) & + bind(C, name='UnspecifiedCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr) :: UnspecifiedCreateConst +end function UnspecifiedCreateConst + +!! Create, general, non-const +function UnspecifiedCreate( & + label, & + productFrame, & + labelSize, & + productFrameSize & +) & + bind(C, name='UnspecifiedCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) + type(c_ptr) :: UnspecifiedCreate +end function UnspecifiedCreate + +!! Assign +subroutine UnspecifiedAssign(handleLHS, handleRHS) & + bind(C, name='UnspecifiedAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine UnspecifiedAssign + +!! Delete +subroutine UnspecifiedDelete(handle) & + bind(C, name='UnspecifiedDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine UnspecifiedDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function UnspecifiedRead(handle, filename, filenameSize) & + bind(C, name='UnspecifiedRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UnspecifiedRead +end function UnspecifiedRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function UnspecifiedWrite(handle, filename, filenameSize) & + bind(C, name='UnspecifiedWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: UnspecifiedWrite +end function UnspecifiedWrite + +!! Print to standard output, in our prettyprinting format +function UnspecifiedPrint(handle) & + bind(C, name='UnspecifiedPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnspecifiedPrint +end function UnspecifiedPrint + +!! Print to standard output, as XML +function UnspecifiedPrintXML(handle) & + bind(C, name='UnspecifiedPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnspecifiedPrintXML +end function UnspecifiedPrintXML + +!! Print to standard output, as JSON +function UnspecifiedPrintJSON(handle) & + bind(C, name='UnspecifiedPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnspecifiedPrintJSON +end function UnspecifiedPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function UnspecifiedLabelHas(handle) & + bind(C, name='UnspecifiedLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnspecifiedLabelHas +end function UnspecifiedLabelHas + +!! Get +function UnspecifiedLabelGet(handle) & + bind(C, name='UnspecifiedLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UnspecifiedLabelGet +end function UnspecifiedLabelGet + +!! Set +subroutine UnspecifiedLabelSet(handle, label, labelSize) & + bind(C, name='UnspecifiedLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine UnspecifiedLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: productFrame +!! ----------------------------------------------------------------------------- + +!! Has +function UnspecifiedProductFrameHas(handle) & + bind(C, name='UnspecifiedProductFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: UnspecifiedProductFrameHas +end function UnspecifiedProductFrameHas + +!! Get +function UnspecifiedProductFrameGet(handle) & + bind(C, name='UnspecifiedProductFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: UnspecifiedProductFrameGet +end function UnspecifiedProductFrameGet + +!! Set +subroutine UnspecifiedProductFrameSet(handle, productFrame, productFrameSize) & + bind(C, name='UnspecifiedProductFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: productFrameSize + character(c_char), intent(in) :: productFrame(productFrameSize) +end subroutine UnspecifiedProductFrameSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalUnspecified diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Values.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Values.f03 new file mode 100644 index 000000000..798c8f8f9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Values.f03 @@ -0,0 +1,203 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalValues +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ValuesDefaultConst() & + bind(C, name='ValuesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ValuesDefaultConst +end function ValuesDefaultConst + +!! Create, default, non-const +function ValuesDefault() & + bind(C, name='ValuesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ValuesDefault +end function ValuesDefault + +!! Create, general, const +function ValuesCreateConst( & +) & + bind(C, name='ValuesCreateConst') + use iso_c_binding + implicit none + type(c_ptr) :: ValuesCreateConst +end function ValuesCreateConst + +!! Create, general, non-const +function ValuesCreate( & +) & + bind(C, name='ValuesCreate') + use iso_c_binding + implicit none + type(c_ptr) :: ValuesCreate +end function ValuesCreate + +!! Assign +subroutine ValuesAssign(handleLHS, handleRHS) & + bind(C, name='ValuesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ValuesAssign + +!! Delete +subroutine ValuesDelete(handle) & + bind(C, name='ValuesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ValuesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ValuesRead(handle, filename, filenameSize) & + bind(C, name='ValuesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ValuesRead +end function ValuesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ValuesWrite(handle, filename, filenameSize) & + bind(C, name='ValuesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ValuesWrite +end function ValuesWrite + +!! Print to standard output, in our prettyprinting format +function ValuesPrint(handle) & + bind(C, name='ValuesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ValuesPrint +end function ValuesPrint + +!! Print to standard output, as XML +function ValuesPrintXML(handle) & + bind(C, name='ValuesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ValuesPrintXML +end function ValuesPrintXML + +!! Print to standard output, as JSON +function ValuesPrintJSON(handle) & + bind(C, name='ValuesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ValuesPrintJSON +end function ValuesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Data vector +!! ----------------------------------------------------------------------------- + +!! Clear +subroutine ValuesDoublesClear(handle) & + bind(C, name='ValuesDoublesClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ValuesDoublesClear + +!! Get size +function ValuesDoublesSize(handle) & + bind(C, name='ValuesDoublesSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ValuesDoublesSize +end function ValuesDoublesSize + +!! Get value +!! By index \in [0,size) +function ValuesDoublesGet(handle, arrayIndex) & + bind(C, name='ValuesDoublesGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + real(c_double) :: ValuesDoublesGet +end function ValuesDoublesGet + +!! Set value +!! By index \in [0,size) +subroutine ValuesDoublesSet(handle, arrayIndex, valueAtIndex) & + bind(C, name='ValuesDoublesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + real(c_double), intent(in), value :: valueAtIndex +end subroutine ValuesDoublesSet + +!! Get pointer to existing values, const +function ValuesDoublesGetArrayConst(handle) & + bind(C, name='ValuesDoublesGetArrayConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ValuesDoublesGetArrayConst +end function ValuesDoublesGetArrayConst + +!! Get pointer to existing values, non-const +function ValuesDoublesGetArray(handle) & + bind(C, name='ValuesDoublesGetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ValuesDoublesGetArray +end function ValuesDoublesGetArray + +!! Set completely new values and size +subroutine ValuesDoublesSetArray(handle, values, valuesSize) & + bind(C, name='ValuesDoublesSetArray') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: valuesSize + real(c_double), intent(in) :: values(valuesSize) +end subroutine ValuesDoublesSetArray + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalValues diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Weighted.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Weighted.f03 new file mode 100644 index 000000000..feeddeca3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Weighted.f03 @@ -0,0 +1,221 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalWeighted +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function WeightedDefaultConst() & + bind(C, name='WeightedDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: WeightedDefaultConst +end function WeightedDefaultConst + +!! Create, default, non-const +function WeightedDefault() & + bind(C, name='WeightedDefault') + use iso_c_binding + implicit none + type(c_ptr) :: WeightedDefault +end function WeightedDefault + +!! Create, general, const +function WeightedCreateConst( & + XYs1d, & + evaporation & +) & + bind(C, name='WeightedCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: evaporation + type(c_ptr) :: WeightedCreateConst +end function WeightedCreateConst + +!! Create, general, non-const +function WeightedCreate( & + XYs1d, & + evaporation & +) & + bind(C, name='WeightedCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: evaporation + type(c_ptr) :: WeightedCreate +end function WeightedCreate + +!! Assign +subroutine WeightedAssign(handleLHS, handleRHS) & + bind(C, name='WeightedAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine WeightedAssign + +!! Delete +subroutine WeightedDelete(handle) & + bind(C, name='WeightedDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine WeightedDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function WeightedRead(handle, filename, filenameSize) & + bind(C, name='WeightedRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: WeightedRead +end function WeightedRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function WeightedWrite(handle, filename, filenameSize) & + bind(C, name='WeightedWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: WeightedWrite +end function WeightedWrite + +!! Print to standard output, in our prettyprinting format +function WeightedPrint(handle) & + bind(C, name='WeightedPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WeightedPrint +end function WeightedPrint + +!! Print to standard output, as XML +function WeightedPrintXML(handle) & + bind(C, name='WeightedPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WeightedPrintXML +end function WeightedPrintXML + +!! Print to standard output, as JSON +function WeightedPrintJSON(handle) & + bind(C, name='WeightedPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WeightedPrintJSON +end function WeightedPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function WeightedXYs1dHas(handle) & + bind(C, name='WeightedXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WeightedXYs1dHas +end function WeightedXYs1dHas + +!! Get, const +function WeightedXYs1dGetConst(handle) & + bind(C, name='WeightedXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: WeightedXYs1dGetConst +end function WeightedXYs1dGetConst + +!! Get, non-const +function WeightedXYs1dGet(handle) & + bind(C, name='WeightedXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: WeightedXYs1dGet +end function WeightedXYs1dGet + +!! Set +subroutine WeightedXYs1dSet(handle, fieldHandle) & + bind(C, name='WeightedXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WeightedXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: evaporation +!! ----------------------------------------------------------------------------- + +!! Has +function WeightedEvaporationHas(handle) & + bind(C, name='WeightedEvaporationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WeightedEvaporationHas +end function WeightedEvaporationHas + +!! Get, const +function WeightedEvaporationGetConst(handle) & + bind(C, name='WeightedEvaporationGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: WeightedEvaporationGetConst +end function WeightedEvaporationGetConst + +!! Get, non-const +function WeightedEvaporationGet(handle) & + bind(C, name='WeightedEvaporationGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: WeightedEvaporationGet +end function WeightedEvaporationGet + +!! Set +subroutine WeightedEvaporationSet(handle, fieldHandle) & + bind(C, name='WeightedEvaporationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WeightedEvaporationSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalWeighted diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/WeightedFunctionals.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/WeightedFunctionals.f03 new file mode 100644 index 000000000..a3f41cbb4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/WeightedFunctionals.f03 @@ -0,0 +1,207 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalWeightedFunctionals +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function WeightedFunctionalsDefaultConst() & + bind(C, name='WeightedFunctionalsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: WeightedFunctionalsDefaultConst +end function WeightedFunctionalsDefaultConst + +!! Create, default, non-const +function WeightedFunctionalsDefault() & + bind(C, name='WeightedFunctionalsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: WeightedFunctionalsDefault +end function WeightedFunctionalsDefault + +!! Create, general, const +function WeightedFunctionalsCreateConst( & + weighted, weightedSize & +) & + bind(C, name='WeightedFunctionalsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: weightedSize + type(c_ptr), intent(in) :: weighted(weightedSize) + type(c_ptr) :: WeightedFunctionalsCreateConst +end function WeightedFunctionalsCreateConst + +!! Create, general, non-const +function WeightedFunctionalsCreate( & + weighted, weightedSize & +) & + bind(C, name='WeightedFunctionalsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: weightedSize + type(c_ptr), intent(in) :: weighted(weightedSize) + type(c_ptr) :: WeightedFunctionalsCreate +end function WeightedFunctionalsCreate + +!! Assign +subroutine WeightedFunctionalsAssign(handleLHS, handleRHS) & + bind(C, name='WeightedFunctionalsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine WeightedFunctionalsAssign + +!! Delete +subroutine WeightedFunctionalsDelete(handle) & + bind(C, name='WeightedFunctionalsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine WeightedFunctionalsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function WeightedFunctionalsRead(handle, filename, filenameSize) & + bind(C, name='WeightedFunctionalsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: WeightedFunctionalsRead +end function WeightedFunctionalsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function WeightedFunctionalsWrite(handle, filename, filenameSize) & + bind(C, name='WeightedFunctionalsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: WeightedFunctionalsWrite +end function WeightedFunctionalsWrite + +!! Print to standard output, in our prettyprinting format +function WeightedFunctionalsPrint(handle) & + bind(C, name='WeightedFunctionalsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WeightedFunctionalsPrint +end function WeightedFunctionalsPrint + +!! Print to standard output, as XML +function WeightedFunctionalsPrintXML(handle) & + bind(C, name='WeightedFunctionalsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WeightedFunctionalsPrintXML +end function WeightedFunctionalsPrintXML + +!! Print to standard output, as JSON +function WeightedFunctionalsPrintJSON(handle) & + bind(C, name='WeightedFunctionalsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WeightedFunctionalsPrintJSON +end function WeightedFunctionalsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: weighted +!! ----------------------------------------------------------------------------- + +!! Has +function WeightedFunctionalsWeightedHas(handle) & + bind(C, name='WeightedFunctionalsWeightedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WeightedFunctionalsWeightedHas +end function WeightedFunctionalsWeightedHas + +!! Clear +subroutine WeightedFunctionalsWeightedClear(handle) & + bind(C, name='WeightedFunctionalsWeightedClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine WeightedFunctionalsWeightedClear + +!! Size +function WeightedFunctionalsWeightedSize(handle) & + bind(C, name='WeightedFunctionalsWeightedSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: WeightedFunctionalsWeightedSize +end function WeightedFunctionalsWeightedSize + +!! Add +subroutine WeightedFunctionalsWeightedAdd(handle, fieldHandle) & + bind(C, name='WeightedFunctionalsWeightedAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WeightedFunctionalsWeightedAdd + +!! Get, by index \in [0,size), const +function WeightedFunctionalsWeightedGetConst(handle, index) & + bind(C, name='WeightedFunctionalsWeightedGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: WeightedFunctionalsWeightedGetConst +end function WeightedFunctionalsWeightedGetConst + +!! Get, by index \in [0,size), non-const +function WeightedFunctionalsWeightedGet(handle, index) & + bind(C, name='WeightedFunctionalsWeightedGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: WeightedFunctionalsWeightedGet +end function WeightedFunctionalsWeightedGet + +!! Set, by index \in [0,size) +subroutine WeightedFunctionalsWeightedSet(handle, index, fieldHandle) & + bind(C, name='WeightedFunctionalsWeightedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WeightedFunctionalsWeightedSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalWeightedFunctionals diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Width.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Width.f03 new file mode 100644 index 000000000..5e4efb1bf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Width.f03 @@ -0,0 +1,384 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalWidth +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function WidthDefaultConst() & + bind(C, name='WidthDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: WidthDefaultConst +end function WidthDefaultConst + +!! Create, default, non-const +function WidthDefault() & + bind(C, name='WidthDefault') + use iso_c_binding + implicit none + type(c_ptr) :: WidthDefault +end function WidthDefault + +!! Create, general, const +function WidthCreateConst( & + label, & + resonanceReaction, & + degreesOfFreedom, & + XYs1d, & + constant1d, & + regions1d, & + labelSize, & + resonanceReactionSize & +) & + bind(C, name='WidthCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: resonanceReactionSize + character(c_char), intent(in) :: resonanceReaction(resonanceReactionSize) + integer(c_int), intent(in), value :: degreesOfFreedom + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: constant1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr) :: WidthCreateConst +end function WidthCreateConst + +!! Create, general, non-const +function WidthCreate( & + label, & + resonanceReaction, & + degreesOfFreedom, & + XYs1d, & + constant1d, & + regions1d, & + labelSize, & + resonanceReactionSize & +) & + bind(C, name='WidthCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: resonanceReactionSize + character(c_char), intent(in) :: resonanceReaction(resonanceReactionSize) + integer(c_int), intent(in), value :: degreesOfFreedom + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: constant1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr) :: WidthCreate +end function WidthCreate + +!! Assign +subroutine WidthAssign(handleLHS, handleRHS) & + bind(C, name='WidthAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine WidthAssign + +!! Delete +subroutine WidthDelete(handle) & + bind(C, name='WidthDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine WidthDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function WidthRead(handle, filename, filenameSize) & + bind(C, name='WidthRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: WidthRead +end function WidthRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function WidthWrite(handle, filename, filenameSize) & + bind(C, name='WidthWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: WidthWrite +end function WidthWrite + +!! Print to standard output, in our prettyprinting format +function WidthPrint(handle) & + bind(C, name='WidthPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthPrint +end function WidthPrint + +!! Print to standard output, as XML +function WidthPrintXML(handle) & + bind(C, name='WidthPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthPrintXML +end function WidthPrintXML + +!! Print to standard output, as JSON +function WidthPrintJSON(handle) & + bind(C, name='WidthPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthPrintJSON +end function WidthPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function WidthLabelHas(handle) & + bind(C, name='WidthLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthLabelHas +end function WidthLabelHas + +!! Get +function WidthLabelGet(handle) & + bind(C, name='WidthLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: WidthLabelGet +end function WidthLabelGet + +!! Set +subroutine WidthLabelSet(handle, label, labelSize) & + bind(C, name='WidthLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine WidthLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: resonanceReaction +!! ----------------------------------------------------------------------------- + +!! Has +function WidthResonanceReactionHas(handle) & + bind(C, name='WidthResonanceReactionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthResonanceReactionHas +end function WidthResonanceReactionHas + +!! Get +function WidthResonanceReactionGet(handle) & + bind(C, name='WidthResonanceReactionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: WidthResonanceReactionGet +end function WidthResonanceReactionGet + +!! Set +subroutine WidthResonanceReactionSet(handle, resonanceReaction, resonanceReactionSize) & + bind(C, name='WidthResonanceReactionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: resonanceReactionSize + character(c_char), intent(in) :: resonanceReaction(resonanceReactionSize) +end subroutine WidthResonanceReactionSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: degreesOfFreedom +!! ----------------------------------------------------------------------------- + +!! Has +function WidthDegreesOfFreedomHas(handle) & + bind(C, name='WidthDegreesOfFreedomHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthDegreesOfFreedomHas +end function WidthDegreesOfFreedomHas + +!! Get +function WidthDegreesOfFreedomGet(handle) & + bind(C, name='WidthDegreesOfFreedomGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthDegreesOfFreedomGet +end function WidthDegreesOfFreedomGet + +!! Set +subroutine WidthDegreesOfFreedomSet(handle, degreesOfFreedom) & + bind(C, name='WidthDegreesOfFreedomSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: degreesOfFreedom +end subroutine WidthDegreesOfFreedomSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function WidthXYs1dHas(handle) & + bind(C, name='WidthXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthXYs1dHas +end function WidthXYs1dHas + +!! Get, const +function WidthXYs1dGetConst(handle) & + bind(C, name='WidthXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: WidthXYs1dGetConst +end function WidthXYs1dGetConst + +!! Get, non-const +function WidthXYs1dGet(handle) & + bind(C, name='WidthXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: WidthXYs1dGet +end function WidthXYs1dGet + +!! Set +subroutine WidthXYs1dSet(handle, fieldHandle) & + bind(C, name='WidthXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WidthXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: constant1d +!! ----------------------------------------------------------------------------- + +!! Has +function WidthConstant1dHas(handle) & + bind(C, name='WidthConstant1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthConstant1dHas +end function WidthConstant1dHas + +!! Get, const +function WidthConstant1dGetConst(handle) & + bind(C, name='WidthConstant1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: WidthConstant1dGetConst +end function WidthConstant1dGetConst + +!! Get, non-const +function WidthConstant1dGet(handle) & + bind(C, name='WidthConstant1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: WidthConstant1dGet +end function WidthConstant1dGet + +!! Set +subroutine WidthConstant1dSet(handle, fieldHandle) & + bind(C, name='WidthConstant1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WidthConstant1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: regions1d +!! ----------------------------------------------------------------------------- + +!! Has +function WidthRegions1dHas(handle) & + bind(C, name='WidthRegions1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthRegions1dHas +end function WidthRegions1dHas + +!! Get, const +function WidthRegions1dGetConst(handle) & + bind(C, name='WidthRegions1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: WidthRegions1dGetConst +end function WidthRegions1dGetConst + +!! Get, non-const +function WidthRegions1dGet(handle) & + bind(C, name='WidthRegions1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: WidthRegions1dGet +end function WidthRegions1dGet + +!! Set +subroutine WidthRegions1dSet(handle, fieldHandle) & + bind(C, name='WidthRegions1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WidthRegions1dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalWidth diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Widths.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Widths.f03 new file mode 100644 index 000000000..6b0ec85e3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Widths.f03 @@ -0,0 +1,347 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalWidths +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function WidthsDefaultConst() & + bind(C, name='WidthsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: WidthsDefaultConst +end function WidthsDefaultConst + +!! Create, default, non-const +function WidthsDefault() & + bind(C, name='WidthsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: WidthsDefault +end function WidthsDefault + +!! Create, general, const +function WidthsCreateConst( & + width, widthSize & +) & + bind(C, name='WidthsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: widthSize + type(c_ptr), intent(in) :: width(widthSize) + type(c_ptr) :: WidthsCreateConst +end function WidthsCreateConst + +!! Create, general, non-const +function WidthsCreate( & + width, widthSize & +) & + bind(C, name='WidthsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: widthSize + type(c_ptr), intent(in) :: width(widthSize) + type(c_ptr) :: WidthsCreate +end function WidthsCreate + +!! Assign +subroutine WidthsAssign(handleLHS, handleRHS) & + bind(C, name='WidthsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine WidthsAssign + +!! Delete +subroutine WidthsDelete(handle) & + bind(C, name='WidthsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine WidthsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function WidthsRead(handle, filename, filenameSize) & + bind(C, name='WidthsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: WidthsRead +end function WidthsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function WidthsWrite(handle, filename, filenameSize) & + bind(C, name='WidthsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: WidthsWrite +end function WidthsWrite + +!! Print to standard output, in our prettyprinting format +function WidthsPrint(handle) & + bind(C, name='WidthsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthsPrint +end function WidthsPrint + +!! Print to standard output, as XML +function WidthsPrintXML(handle) & + bind(C, name='WidthsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthsPrintXML +end function WidthsPrintXML + +!! Print to standard output, as JSON +function WidthsPrintJSON(handle) & + bind(C, name='WidthsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthsPrintJSON +end function WidthsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: width +!! ----------------------------------------------------------------------------- + +!! Has +function WidthsWidthHas(handle) & + bind(C, name='WidthsWidthHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: WidthsWidthHas +end function WidthsWidthHas + +!! Clear +subroutine WidthsWidthClear(handle) & + bind(C, name='WidthsWidthClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine WidthsWidthClear + +!! Size +function WidthsWidthSize(handle) & + bind(C, name='WidthsWidthSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: WidthsWidthSize +end function WidthsWidthSize + +!! Add +subroutine WidthsWidthAdd(handle, fieldHandle) & + bind(C, name='WidthsWidthAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WidthsWidthAdd + +!! Get, by index \in [0,size), const +function WidthsWidthGetConst(handle, index) & + bind(C, name='WidthsWidthGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: WidthsWidthGetConst +end function WidthsWidthGetConst + +!! Get, by index \in [0,size), non-const +function WidthsWidthGet(handle, index) & + bind(C, name='WidthsWidthGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: WidthsWidthGet +end function WidthsWidthGet + +!! Set, by index \in [0,size) +subroutine WidthsWidthSet(handle, index, fieldHandle) & + bind(C, name='WidthsWidthSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WidthsWidthSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function WidthsWidthHasByLabel(handle, meta, metaSize) & + bind(C, name='WidthsWidthHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: WidthsWidthHasByLabel +end function WidthsWidthHasByLabel + +!! Get, by label, const +function WidthsWidthGetByLabelConst(handle, meta, metaSize) & + bind(C, name='WidthsWidthGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: WidthsWidthGetByLabelConst +end function WidthsWidthGetByLabelConst + +!! Get, by label, non-const +function WidthsWidthGetByLabel(handle, meta, metaSize) & + bind(C, name='WidthsWidthGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: WidthsWidthGetByLabel +end function WidthsWidthGetByLabel + +!! Set, by label +subroutine WidthsWidthSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='WidthsWidthSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WidthsWidthSetByLabel + +!! ------------------------ +!! Re: metadatum resonanceReaction +!! ------------------------ + +!! Has, by resonanceReaction +function WidthsWidthHasByResonanceReaction(handle, meta, metaSize) & + bind(C, name='WidthsWidthHasByResonanceReaction') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: WidthsWidthHasByResonanceReaction +end function WidthsWidthHasByResonanceReaction + +!! Get, by resonanceReaction, const +function WidthsWidthGetByResonanceReactionConst(handle, meta, metaSize) & + bind(C, name='WidthsWidthGetByResonanceReactionConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: WidthsWidthGetByResonanceReactionConst +end function WidthsWidthGetByResonanceReactionConst + +!! Get, by resonanceReaction, non-const +function WidthsWidthGetByResonanceReaction(handle, meta, metaSize) & + bind(C, name='WidthsWidthGetByResonanceReaction') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: WidthsWidthGetByResonanceReaction +end function WidthsWidthGetByResonanceReaction + +!! Set, by resonanceReaction +subroutine WidthsWidthSetByResonanceReaction(handle, meta, metaSize, fieldHandle) & + bind(C, name='WidthsWidthSetByResonanceReaction') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WidthsWidthSetByResonanceReaction + +!! ------------------------ +!! Re: metadatum degreesOfFreedom +!! ------------------------ + +!! Has, by degreesOfFreedom +function WidthsWidthHasByDegreesOfFreedom(handle, meta) & + bind(C, name='WidthsWidthHasByDegreesOfFreedom') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: WidthsWidthHasByDegreesOfFreedom +end function WidthsWidthHasByDegreesOfFreedom + +!! Get, by degreesOfFreedom, const +function WidthsWidthGetByDegreesOfFreedomConst(handle, meta) & + bind(C, name='WidthsWidthGetByDegreesOfFreedomConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: WidthsWidthGetByDegreesOfFreedomConst +end function WidthsWidthGetByDegreesOfFreedomConst + +!! Get, by degreesOfFreedom, non-const +function WidthsWidthGetByDegreesOfFreedom(handle, meta) & + bind(C, name='WidthsWidthGetByDegreesOfFreedom') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: WidthsWidthGetByDegreesOfFreedom +end function WidthsWidthGetByDegreesOfFreedom + +!! Set, by degreesOfFreedom +subroutine WidthsWidthSetByDegreesOfFreedom(handle, meta, fieldHandle) & + bind(C, name='WidthsWidthSetByDegreesOfFreedom') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine WidthsWidthSetByDegreesOfFreedom + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalWidths diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/XYs1d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/XYs1d.f03 new file mode 100644 index 000000000..922125774 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/XYs1d.f03 @@ -0,0 +1,420 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalXYs1d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function XYs1dDefaultConst() & + bind(C, name='XYs1dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: XYs1dDefaultConst +end function XYs1dDefaultConst + +!! Create, default, non-const +function XYs1dDefault() & + bind(C, name='XYs1dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: XYs1dDefault +end function XYs1dDefault + +!! Create, general, const +function XYs1dCreateConst( & + label, & + index, & + interpolation, & + outerDomainValue, & + axes, & + values, & + uncertainty, & + labelSize, & + interpolationSize & +) & + bind(C, name='XYs1dCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: interpolationSize + character(c_char), intent(in) :: interpolation(interpolationSize) + real(c_double), intent(in), value :: outerDomainValue + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: values + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: XYs1dCreateConst +end function XYs1dCreateConst + +!! Create, general, non-const +function XYs1dCreate( & + label, & + index, & + interpolation, & + outerDomainValue, & + axes, & + values, & + uncertainty, & + labelSize, & + interpolationSize & +) & + bind(C, name='XYs1dCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: interpolationSize + character(c_char), intent(in) :: interpolation(interpolationSize) + real(c_double), intent(in), value :: outerDomainValue + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: values + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: XYs1dCreate +end function XYs1dCreate + +!! Assign +subroutine XYs1dAssign(handleLHS, handleRHS) & + bind(C, name='XYs1dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine XYs1dAssign + +!! Delete +subroutine XYs1dDelete(handle) & + bind(C, name='XYs1dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine XYs1dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function XYs1dRead(handle, filename, filenameSize) & + bind(C, name='XYs1dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: XYs1dRead +end function XYs1dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function XYs1dWrite(handle, filename, filenameSize) & + bind(C, name='XYs1dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: XYs1dWrite +end function XYs1dWrite + +!! Print to standard output, in our prettyprinting format +function XYs1dPrint(handle) & + bind(C, name='XYs1dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dPrint +end function XYs1dPrint + +!! Print to standard output, as XML +function XYs1dPrintXML(handle) & + bind(C, name='XYs1dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dPrintXML +end function XYs1dPrintXML + +!! Print to standard output, as JSON +function XYs1dPrintJSON(handle) & + bind(C, name='XYs1dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dPrintJSON +end function XYs1dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dLabelHas(handle) & + bind(C, name='XYs1dLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dLabelHas +end function XYs1dLabelHas + +!! Get +function XYs1dLabelGet(handle) & + bind(C, name='XYs1dLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs1dLabelGet +end function XYs1dLabelGet + +!! Set +subroutine XYs1dLabelSet(handle, label, labelSize) & + bind(C, name='XYs1dLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine XYs1dLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: index +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dIndexHas(handle) & + bind(C, name='XYs1dIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dIndexHas +end function XYs1dIndexHas + +!! Get +function XYs1dIndexGet(handle) & + bind(C, name='XYs1dIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dIndexGet +end function XYs1dIndexGet + +!! Set +subroutine XYs1dIndexSet(handle, index) & + bind(C, name='XYs1dIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: index +end subroutine XYs1dIndexSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: interpolation +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dInterpolationHas(handle) & + bind(C, name='XYs1dInterpolationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dInterpolationHas +end function XYs1dInterpolationHas + +!! Get +function XYs1dInterpolationGet(handle) & + bind(C, name='XYs1dInterpolationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs1dInterpolationGet +end function XYs1dInterpolationGet + +!! Set +subroutine XYs1dInterpolationSet(handle, interpolation, interpolationSize) & + bind(C, name='XYs1dInterpolationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: interpolationSize + character(c_char), intent(in) :: interpolation(interpolationSize) +end subroutine XYs1dInterpolationSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: outerDomainValue +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dOuterDomainValueHas(handle) & + bind(C, name='XYs1dOuterDomainValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dOuterDomainValueHas +end function XYs1dOuterDomainValueHas + +!! Get +function XYs1dOuterDomainValueGet(handle) & + bind(C, name='XYs1dOuterDomainValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: XYs1dOuterDomainValueGet +end function XYs1dOuterDomainValueGet + +!! Set +subroutine XYs1dOuterDomainValueSet(handle, outerDomainValue) & + bind(C, name='XYs1dOuterDomainValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: outerDomainValue +end subroutine XYs1dOuterDomainValueSet + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dAxesHas(handle) & + bind(C, name='XYs1dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dAxesHas +end function XYs1dAxesHas + +!! Get, const +function XYs1dAxesGetConst(handle) & + bind(C, name='XYs1dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs1dAxesGetConst +end function XYs1dAxesGetConst + +!! Get, non-const +function XYs1dAxesGet(handle) & + bind(C, name='XYs1dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: XYs1dAxesGet +end function XYs1dAxesGet + +!! Set +subroutine XYs1dAxesSet(handle, fieldHandle) & + bind(C, name='XYs1dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine XYs1dAxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: values +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dValuesHas(handle) & + bind(C, name='XYs1dValuesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dValuesHas +end function XYs1dValuesHas + +!! Get, const +function XYs1dValuesGetConst(handle) & + bind(C, name='XYs1dValuesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs1dValuesGetConst +end function XYs1dValuesGetConst + +!! Get, non-const +function XYs1dValuesGet(handle) & + bind(C, name='XYs1dValuesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: XYs1dValuesGet +end function XYs1dValuesGet + +!! Set +subroutine XYs1dValuesSet(handle, fieldHandle) & + bind(C, name='XYs1dValuesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine XYs1dValuesSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function XYs1dUncertaintyHas(handle) & + bind(C, name='XYs1dUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs1dUncertaintyHas +end function XYs1dUncertaintyHas + +!! Get, const +function XYs1dUncertaintyGetConst(handle) & + bind(C, name='XYs1dUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs1dUncertaintyGetConst +end function XYs1dUncertaintyGetConst + +!! Get, non-const +function XYs1dUncertaintyGet(handle) & + bind(C, name='XYs1dUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: XYs1dUncertaintyGet +end function XYs1dUncertaintyGet + +!! Set +subroutine XYs1dUncertaintySet(handle, fieldHandle) & + bind(C, name='XYs1dUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine XYs1dUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalXYs1d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/XYs2d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/XYs2d.f03 new file mode 100644 index 000000000..e4d508834 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/XYs2d.f03 @@ -0,0 +1,420 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalXYs2d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function XYs2dDefaultConst() & + bind(C, name='XYs2dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: XYs2dDefaultConst +end function XYs2dDefaultConst + +!! Create, default, non-const +function XYs2dDefault() & + bind(C, name='XYs2dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: XYs2dDefault +end function XYs2dDefault + +!! Create, general, const +function XYs2dCreateConst( & + index, & + interpolation, & + interpolationQualifier, & + outerDomainValue, & + axes, & + function1ds, & + uncertainty, & + interpolationSize, & + interpolationQualifierSize & +) & + bind(C, name='XYs2dCreateConst') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: interpolationSize + character(c_char), intent(in) :: interpolation(interpolationSize) + integer(c_size_t), intent(in), value :: interpolationQualifierSize + character(c_char), intent(in) :: interpolationQualifier(interpolationQualifierSize) + real(c_double), intent(in), value :: outerDomainValue + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: function1ds + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: XYs2dCreateConst +end function XYs2dCreateConst + +!! Create, general, non-const +function XYs2dCreate( & + index, & + interpolation, & + interpolationQualifier, & + outerDomainValue, & + axes, & + function1ds, & + uncertainty, & + interpolationSize, & + interpolationQualifierSize & +) & + bind(C, name='XYs2dCreate') + use iso_c_binding + implicit none + integer(c_int), intent(in), value :: index + integer(c_size_t), intent(in), value :: interpolationSize + character(c_char), intent(in) :: interpolation(interpolationSize) + integer(c_size_t), intent(in), value :: interpolationQualifierSize + character(c_char), intent(in) :: interpolationQualifier(interpolationQualifierSize) + real(c_double), intent(in), value :: outerDomainValue + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: function1ds + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: XYs2dCreate +end function XYs2dCreate + +!! Assign +subroutine XYs2dAssign(handleLHS, handleRHS) & + bind(C, name='XYs2dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine XYs2dAssign + +!! Delete +subroutine XYs2dDelete(handle) & + bind(C, name='XYs2dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine XYs2dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function XYs2dRead(handle, filename, filenameSize) & + bind(C, name='XYs2dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: XYs2dRead +end function XYs2dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function XYs2dWrite(handle, filename, filenameSize) & + bind(C, name='XYs2dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: XYs2dWrite +end function XYs2dWrite + +!! Print to standard output, in our prettyprinting format +function XYs2dPrint(handle) & + bind(C, name='XYs2dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs2dPrint +end function XYs2dPrint + +!! Print to standard output, as XML +function XYs2dPrintXML(handle) & + bind(C, name='XYs2dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs2dPrintXML +end function XYs2dPrintXML + +!! Print to standard output, as JSON +function XYs2dPrintJSON(handle) & + bind(C, name='XYs2dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs2dPrintJSON +end function XYs2dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: index +!! ----------------------------------------------------------------------------- + +!! Has +function XYs2dIndexHas(handle) & + bind(C, name='XYs2dIndexHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs2dIndexHas +end function XYs2dIndexHas + +!! Get +function XYs2dIndexGet(handle) & + bind(C, name='XYs2dIndexGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs2dIndexGet +end function XYs2dIndexGet + +!! Set +subroutine XYs2dIndexSet(handle, index) & + bind(C, name='XYs2dIndexSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: index +end subroutine XYs2dIndexSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: interpolation +!! ----------------------------------------------------------------------------- + +!! Has +function XYs2dInterpolationHas(handle) & + bind(C, name='XYs2dInterpolationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs2dInterpolationHas +end function XYs2dInterpolationHas + +!! Get +function XYs2dInterpolationGet(handle) & + bind(C, name='XYs2dInterpolationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs2dInterpolationGet +end function XYs2dInterpolationGet + +!! Set +subroutine XYs2dInterpolationSet(handle, interpolation, interpolationSize) & + bind(C, name='XYs2dInterpolationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: interpolationSize + character(c_char), intent(in) :: interpolation(interpolationSize) +end subroutine XYs2dInterpolationSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: interpolationQualifier +!! ----------------------------------------------------------------------------- + +!! Has +function XYs2dInterpolationQualifierHas(handle) & + bind(C, name='XYs2dInterpolationQualifierHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs2dInterpolationQualifierHas +end function XYs2dInterpolationQualifierHas + +!! Get +function XYs2dInterpolationQualifierGet(handle) & + bind(C, name='XYs2dInterpolationQualifierGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs2dInterpolationQualifierGet +end function XYs2dInterpolationQualifierGet + +!! Set +subroutine XYs2dInterpolationQualifierSet(handle, interpolationQualifier, interpolationQualifierSize) & + bind(C, name='XYs2dInterpolationQualifierSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: interpolationQualifierSize + character(c_char), intent(in) :: interpolationQualifier(interpolationQualifierSize) +end subroutine XYs2dInterpolationQualifierSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: outerDomainValue +!! ----------------------------------------------------------------------------- + +!! Has +function XYs2dOuterDomainValueHas(handle) & + bind(C, name='XYs2dOuterDomainValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs2dOuterDomainValueHas +end function XYs2dOuterDomainValueHas + +!! Get +function XYs2dOuterDomainValueGet(handle) & + bind(C, name='XYs2dOuterDomainValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: XYs2dOuterDomainValueGet +end function XYs2dOuterDomainValueGet + +!! Set +subroutine XYs2dOuterDomainValueSet(handle, outerDomainValue) & + bind(C, name='XYs2dOuterDomainValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: outerDomainValue +end subroutine XYs2dOuterDomainValueSet + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function XYs2dAxesHas(handle) & + bind(C, name='XYs2dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs2dAxesHas +end function XYs2dAxesHas + +!! Get, const +function XYs2dAxesGetConst(handle) & + bind(C, name='XYs2dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs2dAxesGetConst +end function XYs2dAxesGetConst + +!! Get, non-const +function XYs2dAxesGet(handle) & + bind(C, name='XYs2dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: XYs2dAxesGet +end function XYs2dAxesGet + +!! Set +subroutine XYs2dAxesSet(handle, fieldHandle) & + bind(C, name='XYs2dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine XYs2dAxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: function1ds +!! ----------------------------------------------------------------------------- + +!! Has +function XYs2dFunction1dsHas(handle) & + bind(C, name='XYs2dFunction1dsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs2dFunction1dsHas +end function XYs2dFunction1dsHas + +!! Get, const +function XYs2dFunction1dsGetConst(handle) & + bind(C, name='XYs2dFunction1dsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs2dFunction1dsGetConst +end function XYs2dFunction1dsGetConst + +!! Get, non-const +function XYs2dFunction1dsGet(handle) & + bind(C, name='XYs2dFunction1dsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: XYs2dFunction1dsGet +end function XYs2dFunction1dsGet + +!! Set +subroutine XYs2dFunction1dsSet(handle, fieldHandle) & + bind(C, name='XYs2dFunction1dsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine XYs2dFunction1dsSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function XYs2dUncertaintyHas(handle) & + bind(C, name='XYs2dUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs2dUncertaintyHas +end function XYs2dUncertaintyHas + +!! Get, const +function XYs2dUncertaintyGetConst(handle) & + bind(C, name='XYs2dUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs2dUncertaintyGetConst +end function XYs2dUncertaintyGetConst + +!! Get, non-const +function XYs2dUncertaintyGet(handle) & + bind(C, name='XYs2dUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: XYs2dUncertaintyGet +end function XYs2dUncertaintyGet + +!! Set +subroutine XYs2dUncertaintySet(handle, fieldHandle) & + bind(C, name='XYs2dUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine XYs2dUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalXYs2d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/XYs3d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/XYs3d.f03 new file mode 100644 index 000000000..11ad10d4b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/XYs3d.f03 @@ -0,0 +1,293 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalXYs3d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function XYs3dDefaultConst() & + bind(C, name='XYs3dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: XYs3dDefaultConst +end function XYs3dDefaultConst + +!! Create, default, non-const +function XYs3dDefault() & + bind(C, name='XYs3dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: XYs3dDefault +end function XYs3dDefault + +!! Create, general, const +function XYs3dCreateConst( & + interpolationQualifier, & + axes, & + function2ds, function2dsSize, & + interpolationQualifierSize & +) & + bind(C, name='XYs3dCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: interpolationQualifierSize + character(c_char), intent(in) :: interpolationQualifier(interpolationQualifierSize) + type(c_ptr), intent(in), value :: axes + integer(c_size_t), intent(in), value :: function2dsSize + type(c_ptr), intent(in) :: function2ds(function2dsSize) + type(c_ptr) :: XYs3dCreateConst +end function XYs3dCreateConst + +!! Create, general, non-const +function XYs3dCreate( & + interpolationQualifier, & + axes, & + function2ds, function2dsSize, & + interpolationQualifierSize & +) & + bind(C, name='XYs3dCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: interpolationQualifierSize + character(c_char), intent(in) :: interpolationQualifier(interpolationQualifierSize) + type(c_ptr), intent(in), value :: axes + integer(c_size_t), intent(in), value :: function2dsSize + type(c_ptr), intent(in) :: function2ds(function2dsSize) + type(c_ptr) :: XYs3dCreate +end function XYs3dCreate + +!! Assign +subroutine XYs3dAssign(handleLHS, handleRHS) & + bind(C, name='XYs3dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine XYs3dAssign + +!! Delete +subroutine XYs3dDelete(handle) & + bind(C, name='XYs3dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine XYs3dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function XYs3dRead(handle, filename, filenameSize) & + bind(C, name='XYs3dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: XYs3dRead +end function XYs3dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function XYs3dWrite(handle, filename, filenameSize) & + bind(C, name='XYs3dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: XYs3dWrite +end function XYs3dWrite + +!! Print to standard output, in our prettyprinting format +function XYs3dPrint(handle) & + bind(C, name='XYs3dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs3dPrint +end function XYs3dPrint + +!! Print to standard output, as XML +function XYs3dPrintXML(handle) & + bind(C, name='XYs3dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs3dPrintXML +end function XYs3dPrintXML + +!! Print to standard output, as JSON +function XYs3dPrintJSON(handle) & + bind(C, name='XYs3dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs3dPrintJSON +end function XYs3dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: interpolationQualifier +!! ----------------------------------------------------------------------------- + +!! Has +function XYs3dInterpolationQualifierHas(handle) & + bind(C, name='XYs3dInterpolationQualifierHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs3dInterpolationQualifierHas +end function XYs3dInterpolationQualifierHas + +!! Get +function XYs3dInterpolationQualifierGet(handle) & + bind(C, name='XYs3dInterpolationQualifierGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs3dInterpolationQualifierGet +end function XYs3dInterpolationQualifierGet + +!! Set +subroutine XYs3dInterpolationQualifierSet(handle, interpolationQualifier, interpolationQualifierSize) & + bind(C, name='XYs3dInterpolationQualifierSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: interpolationQualifierSize + character(c_char), intent(in) :: interpolationQualifier(interpolationQualifierSize) +end subroutine XYs3dInterpolationQualifierSet + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function XYs3dAxesHas(handle) & + bind(C, name='XYs3dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs3dAxesHas +end function XYs3dAxesHas + +!! Get, const +function XYs3dAxesGetConst(handle) & + bind(C, name='XYs3dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: XYs3dAxesGetConst +end function XYs3dAxesGetConst + +!! Get, non-const +function XYs3dAxesGet(handle) & + bind(C, name='XYs3dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: XYs3dAxesGet +end function XYs3dAxesGet + +!! Set +subroutine XYs3dAxesSet(handle, fieldHandle) & + bind(C, name='XYs3dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine XYs3dAxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: function2ds +!! ----------------------------------------------------------------------------- + +!! Has +function XYs3dFunction2dsHas(handle) & + bind(C, name='XYs3dFunction2dsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: XYs3dFunction2dsHas +end function XYs3dFunction2dsHas + +!! Clear +subroutine XYs3dFunction2dsClear(handle) & + bind(C, name='XYs3dFunction2dsClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine XYs3dFunction2dsClear + +!! Size +function XYs3dFunction2dsSize(handle) & + bind(C, name='XYs3dFunction2dsSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: XYs3dFunction2dsSize +end function XYs3dFunction2dsSize + +!! Add +subroutine XYs3dFunction2dsAdd(handle, fieldHandle) & + bind(C, name='XYs3dFunction2dsAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine XYs3dFunction2dsAdd + +!! Get, by index \in [0,size), const +function XYs3dFunction2dsGetConst(handle, index) & + bind(C, name='XYs3dFunction2dsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: XYs3dFunction2dsGetConst +end function XYs3dFunction2dsGetConst + +!! Get, by index \in [0,size), non-const +function XYs3dFunction2dsGet(handle, index) & + bind(C, name='XYs3dFunction2dsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: XYs3dFunction2dsGet +end function XYs3dFunction2dsGet + +!! Set, by index \in [0,size) +subroutine XYs3dFunction2dsSet(handle, index, fieldHandle) & + bind(C, name='XYs3dFunction2dsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine XYs3dFunction2dsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalXYs3d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Yields.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Yields.f03 new file mode 100644 index 000000000..f5b18c0cd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/general/Yields.f03 @@ -0,0 +1,266 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module generalYields +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function YieldsDefaultConst() & + bind(C, name='YieldsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: YieldsDefaultConst +end function YieldsDefaultConst + +!! Create, default, non-const +function YieldsDefault() & + bind(C, name='YieldsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: YieldsDefault +end function YieldsDefault + +!! Create, general, const +function YieldsCreateConst( & + nuclides, & + values, & + uncertainty & +) & + bind(C, name='YieldsCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: nuclides + type(c_ptr), intent(in), value :: values + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: YieldsCreateConst +end function YieldsCreateConst + +!! Create, general, non-const +function YieldsCreate( & + nuclides, & + values, & + uncertainty & +) & + bind(C, name='YieldsCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: nuclides + type(c_ptr), intent(in), value :: values + type(c_ptr), intent(in), value :: uncertainty + type(c_ptr) :: YieldsCreate +end function YieldsCreate + +!! Assign +subroutine YieldsAssign(handleLHS, handleRHS) & + bind(C, name='YieldsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine YieldsAssign + +!! Delete +subroutine YieldsDelete(handle) & + bind(C, name='YieldsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine YieldsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function YieldsRead(handle, filename, filenameSize) & + bind(C, name='YieldsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: YieldsRead +end function YieldsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function YieldsWrite(handle, filename, filenameSize) & + bind(C, name='YieldsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: YieldsWrite +end function YieldsWrite + +!! Print to standard output, in our prettyprinting format +function YieldsPrint(handle) & + bind(C, name='YieldsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: YieldsPrint +end function YieldsPrint + +!! Print to standard output, as XML +function YieldsPrintXML(handle) & + bind(C, name='YieldsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: YieldsPrintXML +end function YieldsPrintXML + +!! Print to standard output, as JSON +function YieldsPrintJSON(handle) & + bind(C, name='YieldsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: YieldsPrintJSON +end function YieldsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: nuclides +!! ----------------------------------------------------------------------------- + +!! Has +function YieldsNuclidesHas(handle) & + bind(C, name='YieldsNuclidesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: YieldsNuclidesHas +end function YieldsNuclidesHas + +!! Get, const +function YieldsNuclidesGetConst(handle) & + bind(C, name='YieldsNuclidesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: YieldsNuclidesGetConst +end function YieldsNuclidesGetConst + +!! Get, non-const +function YieldsNuclidesGet(handle) & + bind(C, name='YieldsNuclidesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: YieldsNuclidesGet +end function YieldsNuclidesGet + +!! Set +subroutine YieldsNuclidesSet(handle, fieldHandle) & + bind(C, name='YieldsNuclidesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine YieldsNuclidesSet + + +!! ----------------------------------------------------------------------------- +!! Child: values +!! ----------------------------------------------------------------------------- + +!! Has +function YieldsValuesHas(handle) & + bind(C, name='YieldsValuesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: YieldsValuesHas +end function YieldsValuesHas + +!! Get, const +function YieldsValuesGetConst(handle) & + bind(C, name='YieldsValuesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: YieldsValuesGetConst +end function YieldsValuesGetConst + +!! Get, non-const +function YieldsValuesGet(handle) & + bind(C, name='YieldsValuesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: YieldsValuesGet +end function YieldsValuesGet + +!! Set +subroutine YieldsValuesSet(handle, fieldHandle) & + bind(C, name='YieldsValuesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine YieldsValuesSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncertainty +!! ----------------------------------------------------------------------------- + +!! Has +function YieldsUncertaintyHas(handle) & + bind(C, name='YieldsUncertaintyHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: YieldsUncertaintyHas +end function YieldsUncertaintyHas + +!! Get, const +function YieldsUncertaintyGetConst(handle) & + bind(C, name='YieldsUncertaintyGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: YieldsUncertaintyGetConst +end function YieldsUncertaintyGetConst + +!! Get, non-const +function YieldsUncertaintyGet(handle) & + bind(C, name='YieldsUncertaintyGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: YieldsUncertaintyGet +end function YieldsUncertaintyGet + +!! Set +subroutine YieldsUncertaintySet(handle, fieldHandle) & + bind(C, name='YieldsUncertaintySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine YieldsUncertaintySet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module generalYields diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/CrossSection.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/CrossSection.f03 new file mode 100644 index 000000000..9e1939e13 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/CrossSection.f03 @@ -0,0 +1,266 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module reducedCrossSection +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CrossSectionDefaultConst() & + bind(C, name='CrossSectionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionDefaultConst +end function CrossSectionDefaultConst + +!! Create, default, non-const +function CrossSectionDefault() & + bind(C, name='CrossSectionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CrossSectionDefault +end function CrossSectionDefault + +!! Create, general, const +function CrossSectionCreateConst( & + XYs1d, & + regions1d, & + reference & +) & + bind(C, name='CrossSectionCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr), intent(in), value :: reference + type(c_ptr) :: CrossSectionCreateConst +end function CrossSectionCreateConst + +!! Create, general, non-const +function CrossSectionCreate( & + XYs1d, & + regions1d, & + reference & +) & + bind(C, name='CrossSectionCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: XYs1d + type(c_ptr), intent(in), value :: regions1d + type(c_ptr), intent(in), value :: reference + type(c_ptr) :: CrossSectionCreate +end function CrossSectionCreate + +!! Assign +subroutine CrossSectionAssign(handleLHS, handleRHS) & + bind(C, name='CrossSectionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CrossSectionAssign + +!! Delete +subroutine CrossSectionDelete(handle) & + bind(C, name='CrossSectionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CrossSectionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CrossSectionRead(handle, filename, filenameSize) & + bind(C, name='CrossSectionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionRead +end function CrossSectionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CrossSectionWrite(handle, filename, filenameSize) & + bind(C, name='CrossSectionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CrossSectionWrite +end function CrossSectionWrite + +!! Print to standard output, in our prettyprinting format +function CrossSectionPrint(handle) & + bind(C, name='CrossSectionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionPrint +end function CrossSectionPrint + +!! Print to standard output, as XML +function CrossSectionPrintXML(handle) & + bind(C, name='CrossSectionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionPrintXML +end function CrossSectionPrintXML + +!! Print to standard output, as JSON +function CrossSectionPrintJSON(handle) & + bind(C, name='CrossSectionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionPrintJSON +end function CrossSectionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionXYs1dHas(handle) & + bind(C, name='CrossSectionXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionXYs1dHas +end function CrossSectionXYs1dHas + +!! Get, const +function CrossSectionXYs1dGetConst(handle) & + bind(C, name='CrossSectionXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionXYs1dGetConst +end function CrossSectionXYs1dGetConst + +!! Get, non-const +function CrossSectionXYs1dGet(handle) & + bind(C, name='CrossSectionXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionXYs1dGet +end function CrossSectionXYs1dGet + +!! Set +subroutine CrossSectionXYs1dSet(handle, fieldHandle) & + bind(C, name='CrossSectionXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionXYs1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: regions1d +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionRegions1dHas(handle) & + bind(C, name='CrossSectionRegions1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionRegions1dHas +end function CrossSectionRegions1dHas + +!! Get, const +function CrossSectionRegions1dGetConst(handle) & + bind(C, name='CrossSectionRegions1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionRegions1dGetConst +end function CrossSectionRegions1dGetConst + +!! Get, non-const +function CrossSectionRegions1dGet(handle) & + bind(C, name='CrossSectionRegions1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionRegions1dGet +end function CrossSectionRegions1dGet + +!! Set +subroutine CrossSectionRegions1dSet(handle, fieldHandle) & + bind(C, name='CrossSectionRegions1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionRegions1dSet + + +!! ----------------------------------------------------------------------------- +!! Child: reference +!! ----------------------------------------------------------------------------- + +!! Has +function CrossSectionReferenceHas(handle) & + bind(C, name='CrossSectionReferenceHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CrossSectionReferenceHas +end function CrossSectionReferenceHas + +!! Get, const +function CrossSectionReferenceGetConst(handle) & + bind(C, name='CrossSectionReferenceGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CrossSectionReferenceGetConst +end function CrossSectionReferenceGetConst + +!! Get, non-const +function CrossSectionReferenceGet(handle) & + bind(C, name='CrossSectionReferenceGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CrossSectionReferenceGet +end function CrossSectionReferenceGet + +!! Set +subroutine CrossSectionReferenceSet(handle, fieldHandle) & + bind(C, name='CrossSectionReferenceSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CrossSectionReferenceSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module reducedCrossSection diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Distribution.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Distribution.f03 new file mode 100644 index 000000000..a9ff84626 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Distribution.f03 @@ -0,0 +1,356 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module reducedDistribution +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DistributionDefaultConst() & + bind(C, name='DistributionDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DistributionDefaultConst +end function DistributionDefaultConst + +!! Create, default, non-const +function DistributionDefault() & + bind(C, name='DistributionDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DistributionDefault +end function DistributionDefault + +!! Create, general, const +function DistributionCreateConst( & + thermalNeutronScatteringLaw, & + uncorrelated, & + unspecified, & + XYs2d, & + branching3d & +) & + bind(C, name='DistributionCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw + type(c_ptr), intent(in), value :: uncorrelated + type(c_ptr), intent(in), value :: unspecified + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr), intent(in), value :: branching3d + type(c_ptr) :: DistributionCreateConst +end function DistributionCreateConst + +!! Create, general, non-const +function DistributionCreate( & + thermalNeutronScatteringLaw, & + uncorrelated, & + unspecified, & + XYs2d, & + branching3d & +) & + bind(C, name='DistributionCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: thermalNeutronScatteringLaw + type(c_ptr), intent(in), value :: uncorrelated + type(c_ptr), intent(in), value :: unspecified + type(c_ptr), intent(in), value :: XYs2d + type(c_ptr), intent(in), value :: branching3d + type(c_ptr) :: DistributionCreate +end function DistributionCreate + +!! Assign +subroutine DistributionAssign(handleLHS, handleRHS) & + bind(C, name='DistributionAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DistributionAssign + +!! Delete +subroutine DistributionDelete(handle) & + bind(C, name='DistributionDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DistributionDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DistributionRead(handle, filename, filenameSize) & + bind(C, name='DistributionRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DistributionRead +end function DistributionRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DistributionWrite(handle, filename, filenameSize) & + bind(C, name='DistributionWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DistributionWrite +end function DistributionWrite + +!! Print to standard output, in our prettyprinting format +function DistributionPrint(handle) & + bind(C, name='DistributionPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionPrint +end function DistributionPrint + +!! Print to standard output, as XML +function DistributionPrintXML(handle) & + bind(C, name='DistributionPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionPrintXML +end function DistributionPrintXML + +!! Print to standard output, as JSON +function DistributionPrintJSON(handle) & + bind(C, name='DistributionPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionPrintJSON +end function DistributionPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: thermalNeutronScatteringLaw +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionThermalNeutronScatteringLawHas(handle) & + bind(C, name='DistributionThermalNeutronScatteringLawHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionThermalNeutronScatteringLawHas +end function DistributionThermalNeutronScatteringLawHas + +!! Get, const +function DistributionThermalNeutronScatteringLawGetConst(handle) & + bind(C, name='DistributionThermalNeutronScatteringLawGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionThermalNeutronScatteringLawGetConst +end function DistributionThermalNeutronScatteringLawGetConst + +!! Get, non-const +function DistributionThermalNeutronScatteringLawGet(handle) & + bind(C, name='DistributionThermalNeutronScatteringLawGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionThermalNeutronScatteringLawGet +end function DistributionThermalNeutronScatteringLawGet + +!! Set +subroutine DistributionThermalNeutronScatteringLawSet(handle, fieldHandle) & + bind(C, name='DistributionThermalNeutronScatteringLawSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionThermalNeutronScatteringLawSet + + +!! ----------------------------------------------------------------------------- +!! Child: uncorrelated +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionUncorrelatedHas(handle) & + bind(C, name='DistributionUncorrelatedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionUncorrelatedHas +end function DistributionUncorrelatedHas + +!! Get, const +function DistributionUncorrelatedGetConst(handle) & + bind(C, name='DistributionUncorrelatedGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionUncorrelatedGetConst +end function DistributionUncorrelatedGetConst + +!! Get, non-const +function DistributionUncorrelatedGet(handle) & + bind(C, name='DistributionUncorrelatedGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionUncorrelatedGet +end function DistributionUncorrelatedGet + +!! Set +subroutine DistributionUncorrelatedSet(handle, fieldHandle) & + bind(C, name='DistributionUncorrelatedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionUncorrelatedSet + + +!! ----------------------------------------------------------------------------- +!! Child: unspecified +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionUnspecifiedHas(handle) & + bind(C, name='DistributionUnspecifiedHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionUnspecifiedHas +end function DistributionUnspecifiedHas + +!! Get, const +function DistributionUnspecifiedGetConst(handle) & + bind(C, name='DistributionUnspecifiedGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionUnspecifiedGetConst +end function DistributionUnspecifiedGetConst + +!! Get, non-const +function DistributionUnspecifiedGet(handle) & + bind(C, name='DistributionUnspecifiedGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionUnspecifiedGet +end function DistributionUnspecifiedGet + +!! Set +subroutine DistributionUnspecifiedSet(handle, fieldHandle) & + bind(C, name='DistributionUnspecifiedSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionUnspecifiedSet + + +!! ----------------------------------------------------------------------------- +!! Child: XYs2d +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionXYs2dHas(handle) & + bind(C, name='DistributionXYs2dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionXYs2dHas +end function DistributionXYs2dHas + +!! Get, const +function DistributionXYs2dGetConst(handle) & + bind(C, name='DistributionXYs2dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionXYs2dGetConst +end function DistributionXYs2dGetConst + +!! Get, non-const +function DistributionXYs2dGet(handle) & + bind(C, name='DistributionXYs2dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionXYs2dGet +end function DistributionXYs2dGet + +!! Set +subroutine DistributionXYs2dSet(handle, fieldHandle) & + bind(C, name='DistributionXYs2dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionXYs2dSet + + +!! ----------------------------------------------------------------------------- +!! Child: branching3d +!! ----------------------------------------------------------------------------- + +!! Has +function DistributionBranching3dHas(handle) & + bind(C, name='DistributionBranching3dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DistributionBranching3dHas +end function DistributionBranching3dHas + +!! Get, const +function DistributionBranching3dGetConst(handle) & + bind(C, name='DistributionBranching3dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: DistributionBranching3dGetConst +end function DistributionBranching3dGetConst + +!! Get, non-const +function DistributionBranching3dGet(handle) & + bind(C, name='DistributionBranching3dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: DistributionBranching3dGet +end function DistributionBranching3dGet + +!! Set +subroutine DistributionBranching3dSet(handle, fieldHandle) & + bind(C, name='DistributionBranching3dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine DistributionBranching3dSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module reducedDistribution diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Double.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Double.f03 new file mode 100644 index 000000000..3d96126ec --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Double.f03 @@ -0,0 +1,167 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module reducedDouble +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function DoubleDefaultConst() & + bind(C, name='DoubleDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: DoubleDefaultConst +end function DoubleDefaultConst + +!! Create, default, non-const +function DoubleDefault() & + bind(C, name='DoubleDefault') + use iso_c_binding + implicit none + type(c_ptr) :: DoubleDefault +end function DoubleDefault + +!! Create, general, const +function DoubleCreateConst( & + value & +) & + bind(C, name='DoubleCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + type(c_ptr) :: DoubleCreateConst +end function DoubleCreateConst + +!! Create, general, non-const +function DoubleCreate( & + value & +) & + bind(C, name='DoubleCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: value + type(c_ptr) :: DoubleCreate +end function DoubleCreate + +!! Assign +subroutine DoubleAssign(handleLHS, handleRHS) & + bind(C, name='DoubleAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine DoubleAssign + +!! Delete +subroutine DoubleDelete(handle) & + bind(C, name='DoubleDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine DoubleDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function DoubleRead(handle, filename, filenameSize) & + bind(C, name='DoubleRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DoubleRead +end function DoubleRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function DoubleWrite(handle, filename, filenameSize) & + bind(C, name='DoubleWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: DoubleWrite +end function DoubleWrite + +!! Print to standard output, in our prettyprinting format +function DoublePrint(handle) & + bind(C, name='DoublePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoublePrint +end function DoublePrint + +!! Print to standard output, as XML +function DoublePrintXML(handle) & + bind(C, name='DoublePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoublePrintXML +end function DoublePrintXML + +!! Print to standard output, as JSON +function DoublePrintJSON(handle) & + bind(C, name='DoublePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoublePrintJSON +end function DoublePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: value +!! ----------------------------------------------------------------------------- + +!! Has +function DoubleValueHas(handle) & + bind(C, name='DoubleValueHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: DoubleValueHas +end function DoubleValueHas + +!! Get +function DoubleValueGet(handle) & + bind(C, name='DoubleValueGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: DoubleValueGet +end function DoubleValueGet + +!! Set +subroutine DoubleValueSet(handle, value) & + bind(C, name='DoubleValueSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: value +end subroutine DoubleValueSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module reducedDouble diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Function1ds.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Function1ds.f03 new file mode 100644 index 000000000..dfb19c21a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Function1ds.f03 @@ -0,0 +1,511 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module reducedFunction1ds +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Function1dsDefaultConst() & + bind(C, name='Function1dsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Function1dsDefaultConst +end function Function1dsDefaultConst + +!! Create, default, non-const +function Function1dsDefault() & + bind(C, name='Function1dsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Function1dsDefault +end function Function1dsDefault + +!! Create, general, const +function Function1dsCreateConst( & + Legendre, LegendreSize, & + XYs1d, XYs1dSize & +) & + bind(C, name='Function1dsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: LegendreSize + type(c_ptr), intent(in) :: Legendre(LegendreSize) + integer(c_size_t), intent(in), value :: XYs1dSize + type(c_ptr), intent(in) :: XYs1d(XYs1dSize) + type(c_ptr) :: Function1dsCreateConst +end function Function1dsCreateConst + +!! Create, general, non-const +function Function1dsCreate( & + Legendre, LegendreSize, & + XYs1d, XYs1dSize & +) & + bind(C, name='Function1dsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: LegendreSize + type(c_ptr), intent(in) :: Legendre(LegendreSize) + integer(c_size_t), intent(in), value :: XYs1dSize + type(c_ptr), intent(in) :: XYs1d(XYs1dSize) + type(c_ptr) :: Function1dsCreate +end function Function1dsCreate + +!! Assign +subroutine Function1dsAssign(handleLHS, handleRHS) & + bind(C, name='Function1dsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Function1dsAssign + +!! Delete +subroutine Function1dsDelete(handle) & + bind(C, name='Function1dsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Function1dsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Function1dsRead(handle, filename, filenameSize) & + bind(C, name='Function1dsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Function1dsRead +end function Function1dsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Function1dsWrite(handle, filename, filenameSize) & + bind(C, name='Function1dsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Function1dsWrite +end function Function1dsWrite + +!! Print to standard output, in our prettyprinting format +function Function1dsPrint(handle) & + bind(C, name='Function1dsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function1dsPrint +end function Function1dsPrint + +!! Print to standard output, as XML +function Function1dsPrintXML(handle) & + bind(C, name='Function1dsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function1dsPrintXML +end function Function1dsPrintXML + +!! Print to standard output, as JSON +function Function1dsPrintJSON(handle) & + bind(C, name='Function1dsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function1dsPrintJSON +end function Function1dsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: Legendre +!! ----------------------------------------------------------------------------- + +!! Has +function Function1dsLegendreHas(handle) & + bind(C, name='Function1dsLegendreHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function1dsLegendreHas +end function Function1dsLegendreHas + +!! Clear +subroutine Function1dsLegendreClear(handle) & + bind(C, name='Function1dsLegendreClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Function1dsLegendreClear + +!! Size +function Function1dsLegendreSize(handle) & + bind(C, name='Function1dsLegendreSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: Function1dsLegendreSize +end function Function1dsLegendreSize + +!! Add +subroutine Function1dsLegendreAdd(handle, fieldHandle) & + bind(C, name='Function1dsLegendreAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsLegendreAdd + +!! Get, by index \in [0,size), const +function Function1dsLegendreGetConst(handle, index) & + bind(C, name='Function1dsLegendreGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function1dsLegendreGetConst +end function Function1dsLegendreGetConst + +!! Get, by index \in [0,size), non-const +function Function1dsLegendreGet(handle, index) & + bind(C, name='Function1dsLegendreGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function1dsLegendreGet +end function Function1dsLegendreGet + +!! Set, by index \in [0,size) +subroutine Function1dsLegendreSet(handle, index, fieldHandle) & + bind(C, name='Function1dsLegendreSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsLegendreSet + +!! ------------------------ +!! Re: metadatum outerDomainValue +!! ------------------------ + +!! Has, by outerDomainValue +function Function1dsLegendreHasByOuterDomainValue(handle, meta) & + bind(C, name='Function1dsLegendreHasByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: Function1dsLegendreHasByOuterDomainValue +end function Function1dsLegendreHasByOuterDomainValue + +!! Get, by outerDomainValue, const +function Function1dsLegendreGetByOuterDomainValueConst(handle, meta) & + bind(C, name='Function1dsLegendreGetByOuterDomainValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function1dsLegendreGetByOuterDomainValueConst +end function Function1dsLegendreGetByOuterDomainValueConst + +!! Get, by outerDomainValue, non-const +function Function1dsLegendreGetByOuterDomainValue(handle, meta) & + bind(C, name='Function1dsLegendreGetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function1dsLegendreGetByOuterDomainValue +end function Function1dsLegendreGetByOuterDomainValue + +!! Set, by outerDomainValue +subroutine Function1dsLegendreSetByOuterDomainValue(handle, meta, fieldHandle) & + bind(C, name='Function1dsLegendreSetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsLegendreSetByOuterDomainValue + + +!! ----------------------------------------------------------------------------- +!! Child: XYs1d +!! ----------------------------------------------------------------------------- + +!! Has +function Function1dsXYs1dHas(handle) & + bind(C, name='Function1dsXYs1dHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Function1dsXYs1dHas +end function Function1dsXYs1dHas + +!! Clear +subroutine Function1dsXYs1dClear(handle) & + bind(C, name='Function1dsXYs1dClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Function1dsXYs1dClear + +!! Size +function Function1dsXYs1dSize(handle) & + bind(C, name='Function1dsXYs1dSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: Function1dsXYs1dSize +end function Function1dsXYs1dSize + +!! Add +subroutine Function1dsXYs1dAdd(handle, fieldHandle) & + bind(C, name='Function1dsXYs1dAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dAdd + +!! Get, by index \in [0,size), const +function Function1dsXYs1dGetConst(handle, index) & + bind(C, name='Function1dsXYs1dGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function1dsXYs1dGetConst +end function Function1dsXYs1dGetConst + +!! Get, by index \in [0,size), non-const +function Function1dsXYs1dGet(handle, index) & + bind(C, name='Function1dsXYs1dGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: Function1dsXYs1dGet +end function Function1dsXYs1dGet + +!! Set, by index \in [0,size) +subroutine Function1dsXYs1dSet(handle, index, fieldHandle) & + bind(C, name='Function1dsXYs1dSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function Function1dsXYs1dHasByLabel(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: Function1dsXYs1dHasByLabel +end function Function1dsXYs1dHasByLabel + +!! Get, by label, const +function Function1dsXYs1dGetByLabelConst(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function1dsXYs1dGetByLabelConst +end function Function1dsXYs1dGetByLabelConst + +!! Get, by label, non-const +function Function1dsXYs1dGetByLabel(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function1dsXYs1dGetByLabel +end function Function1dsXYs1dGetByLabel + +!! Set, by label +subroutine Function1dsXYs1dSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='Function1dsXYs1dSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dSetByLabel + +!! ------------------------ +!! Re: metadatum index +!! ------------------------ + +!! Has, by index +function Function1dsXYs1dHasByIndex(handle, meta) & + bind(C, name='Function1dsXYs1dHasByIndex') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + integer(c_int) :: Function1dsXYs1dHasByIndex +end function Function1dsXYs1dHasByIndex + +!! Get, by index, const +function Function1dsXYs1dGetByIndexConst(handle, meta) & + bind(C, name='Function1dsXYs1dGetByIndexConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: Function1dsXYs1dGetByIndexConst +end function Function1dsXYs1dGetByIndexConst + +!! Get, by index, non-const +function Function1dsXYs1dGetByIndex(handle, meta) & + bind(C, name='Function1dsXYs1dGetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr) :: Function1dsXYs1dGetByIndex +end function Function1dsXYs1dGetByIndex + +!! Set, by index +subroutine Function1dsXYs1dSetByIndex(handle, meta, fieldHandle) & + bind(C, name='Function1dsXYs1dSetByIndex') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_int), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dSetByIndex + +!! ------------------------ +!! Re: metadatum interpolation +!! ------------------------ + +!! Has, by interpolation +function Function1dsXYs1dHasByInterpolation(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dHasByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: Function1dsXYs1dHasByInterpolation +end function Function1dsXYs1dHasByInterpolation + +!! Get, by interpolation, const +function Function1dsXYs1dGetByInterpolationConst(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dGetByInterpolationConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function1dsXYs1dGetByInterpolationConst +end function Function1dsXYs1dGetByInterpolationConst + +!! Get, by interpolation, non-const +function Function1dsXYs1dGetByInterpolation(handle, meta, metaSize) & + bind(C, name='Function1dsXYs1dGetByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: Function1dsXYs1dGetByInterpolation +end function Function1dsXYs1dGetByInterpolation + +!! Set, by interpolation +subroutine Function1dsXYs1dSetByInterpolation(handle, meta, metaSize, fieldHandle) & + bind(C, name='Function1dsXYs1dSetByInterpolation') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dSetByInterpolation + +!! ------------------------ +!! Re: metadatum outerDomainValue +!! ------------------------ + +!! Has, by outerDomainValue +function Function1dsXYs1dHasByOuterDomainValue(handle, meta) & + bind(C, name='Function1dsXYs1dHasByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + integer(c_int) :: Function1dsXYs1dHasByOuterDomainValue +end function Function1dsXYs1dHasByOuterDomainValue + +!! Get, by outerDomainValue, const +function Function1dsXYs1dGetByOuterDomainValueConst(handle, meta) & + bind(C, name='Function1dsXYs1dGetByOuterDomainValueConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function1dsXYs1dGetByOuterDomainValueConst +end function Function1dsXYs1dGetByOuterDomainValueConst + +!! Get, by outerDomainValue, non-const +function Function1dsXYs1dGetByOuterDomainValue(handle, meta) & + bind(C, name='Function1dsXYs1dGetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr) :: Function1dsXYs1dGetByOuterDomainValue +end function Function1dsXYs1dGetByOuterDomainValue + +!! Set, by outerDomainValue +subroutine Function1dsXYs1dSetByOuterDomainValue(handle, meta, fieldHandle) & + bind(C, name='Function1dsXYs1dSetByOuterDomainValue') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: meta + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Function1dsXYs1dSetByOuterDomainValue + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module reducedFunction1ds diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Nuclides.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Nuclides.f03 new file mode 100644 index 000000000..01e98a6cd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Nuclides.f03 @@ -0,0 +1,217 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module reducedNuclides +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function NuclidesDefaultConst() & + bind(C, name='NuclidesDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: NuclidesDefaultConst +end function NuclidesDefaultConst + +!! Create, default, non-const +function NuclidesDefault() & + bind(C, name='NuclidesDefault') + use iso_c_binding + implicit none + type(c_ptr) :: NuclidesDefault +end function NuclidesDefault + +!! Create, general, const +function NuclidesCreateConst( & + href, & + hrefSize & +) & + bind(C, name='NuclidesCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: NuclidesCreateConst +end function NuclidesCreateConst + +!! Create, general, non-const +function NuclidesCreate( & + href, & + hrefSize & +) & + bind(C, name='NuclidesCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) + type(c_ptr) :: NuclidesCreate +end function NuclidesCreate + +!! Assign +subroutine NuclidesAssign(handleLHS, handleRHS) & + bind(C, name='NuclidesAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine NuclidesAssign + +!! Delete +subroutine NuclidesDelete(handle) & + bind(C, name='NuclidesDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NuclidesDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function NuclidesRead(handle, filename, filenameSize) & + bind(C, name='NuclidesRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclidesRead +end function NuclidesRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function NuclidesWrite(handle, filename, filenameSize) & + bind(C, name='NuclidesWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: NuclidesWrite +end function NuclidesWrite + +!! Print to standard output, in our prettyprinting format +function NuclidesPrint(handle) & + bind(C, name='NuclidesPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclidesPrint +end function NuclidesPrint + +!! Print to standard output, as XML +function NuclidesPrintXML(handle) & + bind(C, name='NuclidesPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclidesPrintXML +end function NuclidesPrintXML + +!! Print to standard output, as JSON +function NuclidesPrintJSON(handle) & + bind(C, name='NuclidesPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclidesPrintJSON +end function NuclidesPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Data vector +!! ----------------------------------------------------------------------------- + +!! Clear +subroutine NuclidesStringsClear(handle) & + bind(C, name='NuclidesStringsClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine NuclidesStringsClear + +!! Get size +function NuclidesStringsSize(handle) & + bind(C, name='NuclidesStringsSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: NuclidesStringsSize +end function NuclidesStringsSize + +!! Get value +!! By index \in [0,size) +function NuclidesStringsGet(handle, arrayIndex) & + bind(C, name='NuclidesStringsGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + type(c_ptr) :: NuclidesStringsGet +end function NuclidesStringsGet + +!! Set value +!! By index \in [0,size) +subroutine NuclidesStringsSet(handle, arrayIndex, valueAtIndex, valueAtIndexSize) & + bind(C, name='NuclidesStringsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: arrayIndex + integer(c_size_t), intent(in), value :: valueAtIndexSize + character(c_char), intent(in) :: valueAtIndex(valueAtIndexSize) +end subroutine NuclidesStringsSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: href +!! ----------------------------------------------------------------------------- + +!! Has +function NuclidesHrefHas(handle) & + bind(C, name='NuclidesHrefHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: NuclidesHrefHas +end function NuclidesHrefHas + +!! Get +function NuclidesHrefGet(handle) & + bind(C, name='NuclidesHrefGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: NuclidesHrefGet +end function NuclidesHrefGet + +!! Set +subroutine NuclidesHrefSet(handle, href, hrefSize) & + bind(C, name='NuclidesHrefSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: hrefSize + character(c_char), intent(in) :: href(hrefSize) +end subroutine NuclidesHrefSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module reducedNuclides diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/OutputChannel.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/OutputChannel.f03 new file mode 100644 index 000000000..6e2f7e1b2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/OutputChannel.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module reducedOutputChannel +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function OutputChannelDefaultConst() & + bind(C, name='OutputChannelDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: OutputChannelDefaultConst +end function OutputChannelDefaultConst + +!! Create, default, non-const +function OutputChannelDefault() & + bind(C, name='OutputChannelDefault') + use iso_c_binding + implicit none + type(c_ptr) :: OutputChannelDefault +end function OutputChannelDefault + +!! Create, general, const +function OutputChannelCreateConst( & + genre, & + process, & + Q, & + products, & + genreSize, & + processSize & +) & + bind(C, name='OutputChannelCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: genreSize + character(c_char), intent(in) :: genre(genreSize) + integer(c_size_t), intent(in), value :: processSize + character(c_char), intent(in) :: process(processSize) + type(c_ptr), intent(in), value :: Q + type(c_ptr), intent(in), value :: products + type(c_ptr) :: OutputChannelCreateConst +end function OutputChannelCreateConst + +!! Create, general, non-const +function OutputChannelCreate( & + genre, & + process, & + Q, & + products, & + genreSize, & + processSize & +) & + bind(C, name='OutputChannelCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: genreSize + character(c_char), intent(in) :: genre(genreSize) + integer(c_size_t), intent(in), value :: processSize + character(c_char), intent(in) :: process(processSize) + type(c_ptr), intent(in), value :: Q + type(c_ptr), intent(in), value :: products + type(c_ptr) :: OutputChannelCreate +end function OutputChannelCreate + +!! Assign +subroutine OutputChannelAssign(handleLHS, handleRHS) & + bind(C, name='OutputChannelAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine OutputChannelAssign + +!! Delete +subroutine OutputChannelDelete(handle) & + bind(C, name='OutputChannelDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine OutputChannelDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function OutputChannelRead(handle, filename, filenameSize) & + bind(C, name='OutputChannelRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: OutputChannelRead +end function OutputChannelRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function OutputChannelWrite(handle, filename, filenameSize) & + bind(C, name='OutputChannelWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: OutputChannelWrite +end function OutputChannelWrite + +!! Print to standard output, in our prettyprinting format +function OutputChannelPrint(handle) & + bind(C, name='OutputChannelPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelPrint +end function OutputChannelPrint + +!! Print to standard output, as XML +function OutputChannelPrintXML(handle) & + bind(C, name='OutputChannelPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelPrintXML +end function OutputChannelPrintXML + +!! Print to standard output, as JSON +function OutputChannelPrintJSON(handle) & + bind(C, name='OutputChannelPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelPrintJSON +end function OutputChannelPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: genre +!! ----------------------------------------------------------------------------- + +!! Has +function OutputChannelGenreHas(handle) & + bind(C, name='OutputChannelGenreHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelGenreHas +end function OutputChannelGenreHas + +!! Get +function OutputChannelGenreGet(handle) & + bind(C, name='OutputChannelGenreGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OutputChannelGenreGet +end function OutputChannelGenreGet + +!! Set +subroutine OutputChannelGenreSet(handle, genre, genreSize) & + bind(C, name='OutputChannelGenreSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: genreSize + character(c_char), intent(in) :: genre(genreSize) +end subroutine OutputChannelGenreSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: process +!! ----------------------------------------------------------------------------- + +!! Has +function OutputChannelProcessHas(handle) & + bind(C, name='OutputChannelProcessHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelProcessHas +end function OutputChannelProcessHas + +!! Get +function OutputChannelProcessGet(handle) & + bind(C, name='OutputChannelProcessGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OutputChannelProcessGet +end function OutputChannelProcessGet + +!! Set +subroutine OutputChannelProcessSet(handle, process, processSize) & + bind(C, name='OutputChannelProcessSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: processSize + character(c_char), intent(in) :: process(processSize) +end subroutine OutputChannelProcessSet + + +!! ----------------------------------------------------------------------------- +!! Child: Q +!! ----------------------------------------------------------------------------- + +!! Has +function OutputChannelQHas(handle) & + bind(C, name='OutputChannelQHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelQHas +end function OutputChannelQHas + +!! Get, const +function OutputChannelQGetConst(handle) & + bind(C, name='OutputChannelQGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OutputChannelQGetConst +end function OutputChannelQGetConst + +!! Get, non-const +function OutputChannelQGet(handle) & + bind(C, name='OutputChannelQGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: OutputChannelQGet +end function OutputChannelQGet + +!! Set +subroutine OutputChannelQSet(handle, fieldHandle) & + bind(C, name='OutputChannelQSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine OutputChannelQSet + + +!! ----------------------------------------------------------------------------- +!! Child: products +!! ----------------------------------------------------------------------------- + +!! Has +function OutputChannelProductsHas(handle) & + bind(C, name='OutputChannelProductsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: OutputChannelProductsHas +end function OutputChannelProductsHas + +!! Get, const +function OutputChannelProductsGetConst(handle) & + bind(C, name='OutputChannelProductsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: OutputChannelProductsGetConst +end function OutputChannelProductsGetConst + +!! Get, non-const +function OutputChannelProductsGet(handle) & + bind(C, name='OutputChannelProductsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: OutputChannelProductsGet +end function OutputChannelProductsGet + +!! Set +subroutine OutputChannelProductsSet(handle, fieldHandle) & + bind(C, name='OutputChannelProductsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine OutputChannelProductsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module reducedOutputChannel diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Polynomial1d.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Polynomial1d.f03 new file mode 100644 index 000000000..2a9d6bfea --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Polynomial1d.f03 @@ -0,0 +1,293 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module reducedPolynomial1d +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function Polynomial1dDefaultConst() & + bind(C, name='Polynomial1dDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: Polynomial1dDefaultConst +end function Polynomial1dDefaultConst + +!! Create, default, non-const +function Polynomial1dDefault() & + bind(C, name='Polynomial1dDefault') + use iso_c_binding + implicit none + type(c_ptr) :: Polynomial1dDefault +end function Polynomial1dDefault + +!! Create, general, const +function Polynomial1dCreateConst( & + domainMin, & + domainMax, & + axes, & + values & +) & + bind(C, name='Polynomial1dCreateConst') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: values + type(c_ptr) :: Polynomial1dCreateConst +end function Polynomial1dCreateConst + +!! Create, general, non-const +function Polynomial1dCreate( & + domainMin, & + domainMax, & + axes, & + values & +) & + bind(C, name='Polynomial1dCreate') + use iso_c_binding + implicit none + real(c_double), intent(in), value :: domainMin + real(c_double), intent(in), value :: domainMax + type(c_ptr), intent(in), value :: axes + type(c_ptr), intent(in), value :: values + type(c_ptr) :: Polynomial1dCreate +end function Polynomial1dCreate + +!! Assign +subroutine Polynomial1dAssign(handleLHS, handleRHS) & + bind(C, name='Polynomial1dAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine Polynomial1dAssign + +!! Delete +subroutine Polynomial1dDelete(handle) & + bind(C, name='Polynomial1dDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine Polynomial1dDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function Polynomial1dRead(handle, filename, filenameSize) & + bind(C, name='Polynomial1dRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Polynomial1dRead +end function Polynomial1dRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function Polynomial1dWrite(handle, filename, filenameSize) & + bind(C, name='Polynomial1dWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: Polynomial1dWrite +end function Polynomial1dWrite + +!! Print to standard output, in our prettyprinting format +function Polynomial1dPrint(handle) & + bind(C, name='Polynomial1dPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dPrint +end function Polynomial1dPrint + +!! Print to standard output, as XML +function Polynomial1dPrintXML(handle) & + bind(C, name='Polynomial1dPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dPrintXML +end function Polynomial1dPrintXML + +!! Print to standard output, as JSON +function Polynomial1dPrintJSON(handle) & + bind(C, name='Polynomial1dPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dPrintJSON +end function Polynomial1dPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMin +!! ----------------------------------------------------------------------------- + +!! Has +function Polynomial1dDomainMinHas(handle) & + bind(C, name='Polynomial1dDomainMinHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dDomainMinHas +end function Polynomial1dDomainMinHas + +!! Get +function Polynomial1dDomainMinGet(handle) & + bind(C, name='Polynomial1dDomainMinGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: Polynomial1dDomainMinGet +end function Polynomial1dDomainMinGet + +!! Set +subroutine Polynomial1dDomainMinSet(handle, domainMin) & + bind(C, name='Polynomial1dDomainMinSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMin +end subroutine Polynomial1dDomainMinSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: domainMax +!! ----------------------------------------------------------------------------- + +!! Has +function Polynomial1dDomainMaxHas(handle) & + bind(C, name='Polynomial1dDomainMaxHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dDomainMaxHas +end function Polynomial1dDomainMaxHas + +!! Get +function Polynomial1dDomainMaxGet(handle) & + bind(C, name='Polynomial1dDomainMaxGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + real(c_double) :: Polynomial1dDomainMaxGet +end function Polynomial1dDomainMaxGet + +!! Set +subroutine Polynomial1dDomainMaxSet(handle, domainMax) & + bind(C, name='Polynomial1dDomainMaxSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + real(c_double), intent(in), value :: domainMax +end subroutine Polynomial1dDomainMaxSet + + +!! ----------------------------------------------------------------------------- +!! Child: axes +!! ----------------------------------------------------------------------------- + +!! Has +function Polynomial1dAxesHas(handle) & + bind(C, name='Polynomial1dAxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dAxesHas +end function Polynomial1dAxesHas + +!! Get, const +function Polynomial1dAxesGetConst(handle) & + bind(C, name='Polynomial1dAxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Polynomial1dAxesGetConst +end function Polynomial1dAxesGetConst + +!! Get, non-const +function Polynomial1dAxesGet(handle) & + bind(C, name='Polynomial1dAxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Polynomial1dAxesGet +end function Polynomial1dAxesGet + +!! Set +subroutine Polynomial1dAxesSet(handle, fieldHandle) & + bind(C, name='Polynomial1dAxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Polynomial1dAxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: values +!! ----------------------------------------------------------------------------- + +!! Has +function Polynomial1dValuesHas(handle) & + bind(C, name='Polynomial1dValuesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: Polynomial1dValuesHas +end function Polynomial1dValuesHas + +!! Get, const +function Polynomial1dValuesGetConst(handle) & + bind(C, name='Polynomial1dValuesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: Polynomial1dValuesGetConst +end function Polynomial1dValuesGetConst + +!! Get, non-const +function Polynomial1dValuesGet(handle) & + bind(C, name='Polynomial1dValuesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: Polynomial1dValuesGet +end function Polynomial1dValuesGet + +!! Set +subroutine Polynomial1dValuesSet(handle, fieldHandle) & + bind(C, name='Polynomial1dValuesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine Polynomial1dValuesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module reducedPolynomial1d diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Product.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Product.f03 new file mode 100644 index 000000000..c277786ca --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Product.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module reducedProduct +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ProductDefaultConst() & + bind(C, name='ProductDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ProductDefaultConst +end function ProductDefaultConst + +!! Create, default, non-const +function ProductDefault() & + bind(C, name='ProductDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ProductDefault +end function ProductDefault + +!! Create, general, const +function ProductCreateConst( & + label, & + pid, & + multiplicity, & + distribution, & + labelSize, & + pidSize & +) & + bind(C, name='ProductCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + type(c_ptr), intent(in), value :: multiplicity + type(c_ptr), intent(in), value :: distribution + type(c_ptr) :: ProductCreateConst +end function ProductCreateConst + +!! Create, general, non-const +function ProductCreate( & + label, & + pid, & + multiplicity, & + distribution, & + labelSize, & + pidSize & +) & + bind(C, name='ProductCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) + type(c_ptr), intent(in), value :: multiplicity + type(c_ptr), intent(in), value :: distribution + type(c_ptr) :: ProductCreate +end function ProductCreate + +!! Assign +subroutine ProductAssign(handleLHS, handleRHS) & + bind(C, name='ProductAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ProductAssign + +!! Delete +subroutine ProductDelete(handle) & + bind(C, name='ProductDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ProductRead(handle, filename, filenameSize) & + bind(C, name='ProductRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductRead +end function ProductRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ProductWrite(handle, filename, filenameSize) & + bind(C, name='ProductWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductWrite +end function ProductWrite + +!! Print to standard output, in our prettyprinting format +function ProductPrint(handle) & + bind(C, name='ProductPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductPrint +end function ProductPrint + +!! Print to standard output, as XML +function ProductPrintXML(handle) & + bind(C, name='ProductPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductPrintXML +end function ProductPrintXML + +!! Print to standard output, as JSON +function ProductPrintJSON(handle) & + bind(C, name='ProductPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductPrintJSON +end function ProductPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: label +!! ----------------------------------------------------------------------------- + +!! Has +function ProductLabelHas(handle) & + bind(C, name='ProductLabelHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductLabelHas +end function ProductLabelHas + +!! Get +function ProductLabelGet(handle) & + bind(C, name='ProductLabelGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductLabelGet +end function ProductLabelGet + +!! Set +subroutine ProductLabelSet(handle, label, labelSize) & + bind(C, name='ProductLabelSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: labelSize + character(c_char), intent(in) :: label(labelSize) +end subroutine ProductLabelSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: pid +!! ----------------------------------------------------------------------------- + +!! Has +function ProductPidHas(handle) & + bind(C, name='ProductPidHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductPidHas +end function ProductPidHas + +!! Get +function ProductPidGet(handle) & + bind(C, name='ProductPidGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductPidGet +end function ProductPidGet + +!! Set +subroutine ProductPidSet(handle, pid, pidSize) & + bind(C, name='ProductPidSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: pidSize + character(c_char), intent(in) :: pid(pidSize) +end subroutine ProductPidSet + + +!! ----------------------------------------------------------------------------- +!! Child: multiplicity +!! ----------------------------------------------------------------------------- + +!! Has +function ProductMultiplicityHas(handle) & + bind(C, name='ProductMultiplicityHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductMultiplicityHas +end function ProductMultiplicityHas + +!! Get, const +function ProductMultiplicityGetConst(handle) & + bind(C, name='ProductMultiplicityGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductMultiplicityGetConst +end function ProductMultiplicityGetConst + +!! Get, non-const +function ProductMultiplicityGet(handle) & + bind(C, name='ProductMultiplicityGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ProductMultiplicityGet +end function ProductMultiplicityGet + +!! Set +subroutine ProductMultiplicitySet(handle, fieldHandle) & + bind(C, name='ProductMultiplicitySet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductMultiplicitySet + + +!! ----------------------------------------------------------------------------- +!! Child: distribution +!! ----------------------------------------------------------------------------- + +!! Has +function ProductDistributionHas(handle) & + bind(C, name='ProductDistributionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductDistributionHas +end function ProductDistributionHas + +!! Get, const +function ProductDistributionGetConst(handle) & + bind(C, name='ProductDistributionGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ProductDistributionGetConst +end function ProductDistributionGetConst + +!! Get, non-const +function ProductDistributionGet(handle) & + bind(C, name='ProductDistributionGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ProductDistributionGet +end function ProductDistributionGet + +!! Set +subroutine ProductDistributionSet(handle, fieldHandle) & + bind(C, name='ProductDistributionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductDistributionSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module reducedProduct diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Products.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Products.f03 new file mode 100644 index 000000000..2f57b1ecb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/reduced/Products.f03 @@ -0,0 +1,303 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module reducedProducts +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ProductsDefaultConst() & + bind(C, name='ProductsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ProductsDefaultConst +end function ProductsDefaultConst + +!! Create, default, non-const +function ProductsDefault() & + bind(C, name='ProductsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ProductsDefault +end function ProductsDefault + +!! Create, general, const +function ProductsCreateConst( & + product, productSize & +) & + bind(C, name='ProductsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: productSize + type(c_ptr), intent(in) :: product(productSize) + type(c_ptr) :: ProductsCreateConst +end function ProductsCreateConst + +!! Create, general, non-const +function ProductsCreate( & + product, productSize & +) & + bind(C, name='ProductsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: productSize + type(c_ptr), intent(in) :: product(productSize) + type(c_ptr) :: ProductsCreate +end function ProductsCreate + +!! Assign +subroutine ProductsAssign(handleLHS, handleRHS) & + bind(C, name='ProductsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ProductsAssign + +!! Delete +subroutine ProductsDelete(handle) & + bind(C, name='ProductsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ProductsRead(handle, filename, filenameSize) & + bind(C, name='ProductsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductsRead +end function ProductsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ProductsWrite(handle, filename, filenameSize) & + bind(C, name='ProductsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ProductsWrite +end function ProductsWrite + +!! Print to standard output, in our prettyprinting format +function ProductsPrint(handle) & + bind(C, name='ProductsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductsPrint +end function ProductsPrint + +!! Print to standard output, as XML +function ProductsPrintXML(handle) & + bind(C, name='ProductsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductsPrintXML +end function ProductsPrintXML + +!! Print to standard output, as JSON +function ProductsPrintJSON(handle) & + bind(C, name='ProductsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductsPrintJSON +end function ProductsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: product +!! ----------------------------------------------------------------------------- + +!! Has +function ProductsProductHas(handle) & + bind(C, name='ProductsProductHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ProductsProductHas +end function ProductsProductHas + +!! Clear +subroutine ProductsProductClear(handle) & + bind(C, name='ProductsProductClear') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ProductsProductClear + +!! Size +function ProductsProductSize(handle) & + bind(C, name='ProductsProductSize') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t) :: ProductsProductSize +end function ProductsProductSize + +!! Add +subroutine ProductsProductAdd(handle, fieldHandle) & + bind(C, name='ProductsProductAdd') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductsProductAdd + +!! Get, by index \in [0,size), const +function ProductsProductGetConst(handle, index) & + bind(C, name='ProductsProductGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ProductsProductGetConst +end function ProductsProductGetConst + +!! Get, by index \in [0,size), non-const +function ProductsProductGet(handle, index) & + bind(C, name='ProductsProductGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr) :: ProductsProductGet +end function ProductsProductGet + +!! Set, by index \in [0,size) +subroutine ProductsProductSet(handle, index, fieldHandle) & + bind(C, name='ProductsProductSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: index + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductsProductSet + +!! ------------------------ +!! Re: metadatum label +!! ------------------------ + +!! Has, by label +function ProductsProductHasByLabel(handle, meta, metaSize) & + bind(C, name='ProductsProductHasByLabel') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ProductsProductHasByLabel +end function ProductsProductHasByLabel + +!! Get, by label, const +function ProductsProductGetByLabelConst(handle, meta, metaSize) & + bind(C, name='ProductsProductGetByLabelConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductsProductGetByLabelConst +end function ProductsProductGetByLabelConst + +!! Get, by label, non-const +function ProductsProductGetByLabel(handle, meta, metaSize) & + bind(C, name='ProductsProductGetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductsProductGetByLabel +end function ProductsProductGetByLabel + +!! Set, by label +subroutine ProductsProductSetByLabel(handle, meta, metaSize, fieldHandle) & + bind(C, name='ProductsProductSetByLabel') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductsProductSetByLabel + +!! ------------------------ +!! Re: metadatum pid +!! ------------------------ + +!! Has, by pid +function ProductsProductHasByPid(handle, meta, metaSize) & + bind(C, name='ProductsProductHasByPid') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + integer(c_int) :: ProductsProductHasByPid +end function ProductsProductHasByPid + +!! Get, by pid, const +function ProductsProductGetByPidConst(handle, meta, metaSize) & + bind(C, name='ProductsProductGetByPidConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductsProductGetByPidConst +end function ProductsProductGetByPidConst + +!! Get, by pid, non-const +function ProductsProductGetByPid(handle, meta, metaSize) & + bind(C, name='ProductsProductGetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr) :: ProductsProductGetByPid +end function ProductsProductGetByPid + +!! Set, by pid +subroutine ProductsProductSetByPid(handle, meta, metaSize, fieldHandle) & + bind(C, name='ProductsProductSetByPid') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: metaSize + character(c_char), intent(in) :: meta(metaSize) + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ProductsProductSetByPid + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module reducedProducts diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/CovarianceSuite.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/CovarianceSuite.f03 new file mode 100644 index 000000000..746cd339d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/CovarianceSuite.f03 @@ -0,0 +1,516 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module topCovarianceSuite +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function CovarianceSuiteDefaultConst() & + bind(C, name='CovarianceSuiteDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: CovarianceSuiteDefaultConst +end function CovarianceSuiteDefaultConst + +!! Create, default, non-const +function CovarianceSuiteDefault() & + bind(C, name='CovarianceSuiteDefault') + use iso_c_binding + implicit none + type(c_ptr) :: CovarianceSuiteDefault +end function CovarianceSuiteDefault + +!! Create, general, const +function CovarianceSuiteCreateConst( & + projectile, & + target, & + evaluation, & + interaction, & + format, & + externalFiles, & + styles, & + covarianceSections, & + parameterCovariances, & + projectileSize, & + targetSize, & + evaluationSize, & + interactionSize, & + formatSize & +) & + bind(C, name='CovarianceSuiteCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: projectileSize + character(c_char), intent(in) :: projectile(projectileSize) + integer(c_size_t), intent(in), value :: targetSize + character(c_char), intent(in) :: target(targetSize) + integer(c_size_t), intent(in), value :: evaluationSize + character(c_char), intent(in) :: evaluation(evaluationSize) + integer(c_size_t), intent(in), value :: interactionSize + character(c_char), intent(in) :: interaction(interactionSize) + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) + type(c_ptr), intent(in), value :: externalFiles + type(c_ptr), intent(in), value :: styles + type(c_ptr), intent(in), value :: covarianceSections + type(c_ptr), intent(in), value :: parameterCovariances + type(c_ptr) :: CovarianceSuiteCreateConst +end function CovarianceSuiteCreateConst + +!! Create, general, non-const +function CovarianceSuiteCreate( & + projectile, & + target, & + evaluation, & + interaction, & + format, & + externalFiles, & + styles, & + covarianceSections, & + parameterCovariances, & + projectileSize, & + targetSize, & + evaluationSize, & + interactionSize, & + formatSize & +) & + bind(C, name='CovarianceSuiteCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: projectileSize + character(c_char), intent(in) :: projectile(projectileSize) + integer(c_size_t), intent(in), value :: targetSize + character(c_char), intent(in) :: target(targetSize) + integer(c_size_t), intent(in), value :: evaluationSize + character(c_char), intent(in) :: evaluation(evaluationSize) + integer(c_size_t), intent(in), value :: interactionSize + character(c_char), intent(in) :: interaction(interactionSize) + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) + type(c_ptr), intent(in), value :: externalFiles + type(c_ptr), intent(in), value :: styles + type(c_ptr), intent(in), value :: covarianceSections + type(c_ptr), intent(in), value :: parameterCovariances + type(c_ptr) :: CovarianceSuiteCreate +end function CovarianceSuiteCreate + +!! Assign +subroutine CovarianceSuiteAssign(handleLHS, handleRHS) & + bind(C, name='CovarianceSuiteAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine CovarianceSuiteAssign + +!! Delete +subroutine CovarianceSuiteDelete(handle) & + bind(C, name='CovarianceSuiteDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine CovarianceSuiteDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function CovarianceSuiteRead(handle, filename, filenameSize) & + bind(C, name='CovarianceSuiteRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CovarianceSuiteRead +end function CovarianceSuiteRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function CovarianceSuiteWrite(handle, filename, filenameSize) & + bind(C, name='CovarianceSuiteWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: CovarianceSuiteWrite +end function CovarianceSuiteWrite + +!! Print to standard output, in our prettyprinting format +function CovarianceSuitePrint(handle) & + bind(C, name='CovarianceSuitePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuitePrint +end function CovarianceSuitePrint + +!! Print to standard output, as XML +function CovarianceSuitePrintXML(handle) & + bind(C, name='CovarianceSuitePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuitePrintXML +end function CovarianceSuitePrintXML + +!! Print to standard output, as JSON +function CovarianceSuitePrintJSON(handle) & + bind(C, name='CovarianceSuitePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuitePrintJSON +end function CovarianceSuitePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: projectile +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSuiteProjectileHas(handle) & + bind(C, name='CovarianceSuiteProjectileHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuiteProjectileHas +end function CovarianceSuiteProjectileHas + +!! Get +function CovarianceSuiteProjectileGet(handle) & + bind(C, name='CovarianceSuiteProjectileGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSuiteProjectileGet +end function CovarianceSuiteProjectileGet + +!! Set +subroutine CovarianceSuiteProjectileSet(handle, projectile, projectileSize) & + bind(C, name='CovarianceSuiteProjectileSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: projectileSize + character(c_char), intent(in) :: projectile(projectileSize) +end subroutine CovarianceSuiteProjectileSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: target +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSuiteTargetHas(handle) & + bind(C, name='CovarianceSuiteTargetHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuiteTargetHas +end function CovarianceSuiteTargetHas + +!! Get +function CovarianceSuiteTargetGet(handle) & + bind(C, name='CovarianceSuiteTargetGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSuiteTargetGet +end function CovarianceSuiteTargetGet + +!! Set +subroutine CovarianceSuiteTargetSet(handle, target, targetSize) & + bind(C, name='CovarianceSuiteTargetSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: targetSize + character(c_char), intent(in) :: target(targetSize) +end subroutine CovarianceSuiteTargetSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: evaluation +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSuiteEvaluationHas(handle) & + bind(C, name='CovarianceSuiteEvaluationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuiteEvaluationHas +end function CovarianceSuiteEvaluationHas + +!! Get +function CovarianceSuiteEvaluationGet(handle) & + bind(C, name='CovarianceSuiteEvaluationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSuiteEvaluationGet +end function CovarianceSuiteEvaluationGet + +!! Set +subroutine CovarianceSuiteEvaluationSet(handle, evaluation, evaluationSize) & + bind(C, name='CovarianceSuiteEvaluationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: evaluationSize + character(c_char), intent(in) :: evaluation(evaluationSize) +end subroutine CovarianceSuiteEvaluationSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: interaction +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSuiteInteractionHas(handle) & + bind(C, name='CovarianceSuiteInteractionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuiteInteractionHas +end function CovarianceSuiteInteractionHas + +!! Get +function CovarianceSuiteInteractionGet(handle) & + bind(C, name='CovarianceSuiteInteractionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSuiteInteractionGet +end function CovarianceSuiteInteractionGet + +!! Set +subroutine CovarianceSuiteInteractionSet(handle, interaction, interactionSize) & + bind(C, name='CovarianceSuiteInteractionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: interactionSize + character(c_char), intent(in) :: interaction(interactionSize) +end subroutine CovarianceSuiteInteractionSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: format +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSuiteFormatHas(handle) & + bind(C, name='CovarianceSuiteFormatHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuiteFormatHas +end function CovarianceSuiteFormatHas + +!! Get +function CovarianceSuiteFormatGet(handle) & + bind(C, name='CovarianceSuiteFormatGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSuiteFormatGet +end function CovarianceSuiteFormatGet + +!! Set +subroutine CovarianceSuiteFormatSet(handle, format, formatSize) & + bind(C, name='CovarianceSuiteFormatSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) +end subroutine CovarianceSuiteFormatSet + + +!! ----------------------------------------------------------------------------- +!! Child: externalFiles +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSuiteExternalFilesHas(handle) & + bind(C, name='CovarianceSuiteExternalFilesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuiteExternalFilesHas +end function CovarianceSuiteExternalFilesHas + +!! Get, const +function CovarianceSuiteExternalFilesGetConst(handle) & + bind(C, name='CovarianceSuiteExternalFilesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSuiteExternalFilesGetConst +end function CovarianceSuiteExternalFilesGetConst + +!! Get, non-const +function CovarianceSuiteExternalFilesGet(handle) & + bind(C, name='CovarianceSuiteExternalFilesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CovarianceSuiteExternalFilesGet +end function CovarianceSuiteExternalFilesGet + +!! Set +subroutine CovarianceSuiteExternalFilesSet(handle, fieldHandle) & + bind(C, name='CovarianceSuiteExternalFilesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSuiteExternalFilesSet + + +!! ----------------------------------------------------------------------------- +!! Child: styles +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSuiteStylesHas(handle) & + bind(C, name='CovarianceSuiteStylesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuiteStylesHas +end function CovarianceSuiteStylesHas + +!! Get, const +function CovarianceSuiteStylesGetConst(handle) & + bind(C, name='CovarianceSuiteStylesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSuiteStylesGetConst +end function CovarianceSuiteStylesGetConst + +!! Get, non-const +function CovarianceSuiteStylesGet(handle) & + bind(C, name='CovarianceSuiteStylesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CovarianceSuiteStylesGet +end function CovarianceSuiteStylesGet + +!! Set +subroutine CovarianceSuiteStylesSet(handle, fieldHandle) & + bind(C, name='CovarianceSuiteStylesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSuiteStylesSet + + +!! ----------------------------------------------------------------------------- +!! Child: covarianceSections +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSuiteCovarianceSectionsHas(handle) & + bind(C, name='CovarianceSuiteCovarianceSectionsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuiteCovarianceSectionsHas +end function CovarianceSuiteCovarianceSectionsHas + +!! Get, const +function CovarianceSuiteCovarianceSectionsGetConst(handle) & + bind(C, name='CovarianceSuiteCovarianceSectionsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSuiteCovarianceSectionsGetConst +end function CovarianceSuiteCovarianceSectionsGetConst + +!! Get, non-const +function CovarianceSuiteCovarianceSectionsGet(handle) & + bind(C, name='CovarianceSuiteCovarianceSectionsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CovarianceSuiteCovarianceSectionsGet +end function CovarianceSuiteCovarianceSectionsGet + +!! Set +subroutine CovarianceSuiteCovarianceSectionsSet(handle, fieldHandle) & + bind(C, name='CovarianceSuiteCovarianceSectionsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSuiteCovarianceSectionsSet + + +!! ----------------------------------------------------------------------------- +!! Child: parameterCovariances +!! ----------------------------------------------------------------------------- + +!! Has +function CovarianceSuiteParameterCovariancesHas(handle) & + bind(C, name='CovarianceSuiteParameterCovariancesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: CovarianceSuiteParameterCovariancesHas +end function CovarianceSuiteParameterCovariancesHas + +!! Get, const +function CovarianceSuiteParameterCovariancesGetConst(handle) & + bind(C, name='CovarianceSuiteParameterCovariancesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: CovarianceSuiteParameterCovariancesGetConst +end function CovarianceSuiteParameterCovariancesGetConst + +!! Get, non-const +function CovarianceSuiteParameterCovariancesGet(handle) & + bind(C, name='CovarianceSuiteParameterCovariancesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: CovarianceSuiteParameterCovariancesGet +end function CovarianceSuiteParameterCovariancesGet + +!! Set +subroutine CovarianceSuiteParameterCovariancesSet(handle, fieldHandle) & + bind(C, name='CovarianceSuiteParameterCovariancesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine CovarianceSuiteParameterCovariancesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module topCovarianceSuite diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/FissionFragmentData.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/FissionFragmentData.f03 new file mode 100644 index 000000000..69c7a55bc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/FissionFragmentData.f03 @@ -0,0 +1,266 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module topFissionFragmentData +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function FissionFragmentDataDefaultConst() & + bind(C, name='FissionFragmentDataDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: FissionFragmentDataDefaultConst +end function FissionFragmentDataDefaultConst + +!! Create, default, non-const +function FissionFragmentDataDefault() & + bind(C, name='FissionFragmentDataDefault') + use iso_c_binding + implicit none + type(c_ptr) :: FissionFragmentDataDefault +end function FissionFragmentDataDefault + +!! Create, general, const +function FissionFragmentDataCreateConst( & + productYields, & + delayedNeutrons, & + fissionEnergyReleases & +) & + bind(C, name='FissionFragmentDataCreateConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: productYields + type(c_ptr), intent(in), value :: delayedNeutrons + type(c_ptr), intent(in), value :: fissionEnergyReleases + type(c_ptr) :: FissionFragmentDataCreateConst +end function FissionFragmentDataCreateConst + +!! Create, general, non-const +function FissionFragmentDataCreate( & + productYields, & + delayedNeutrons, & + fissionEnergyReleases & +) & + bind(C, name='FissionFragmentDataCreate') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: productYields + type(c_ptr), intent(in), value :: delayedNeutrons + type(c_ptr), intent(in), value :: fissionEnergyReleases + type(c_ptr) :: FissionFragmentDataCreate +end function FissionFragmentDataCreate + +!! Assign +subroutine FissionFragmentDataAssign(handleLHS, handleRHS) & + bind(C, name='FissionFragmentDataAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine FissionFragmentDataAssign + +!! Delete +subroutine FissionFragmentDataDelete(handle) & + bind(C, name='FissionFragmentDataDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine FissionFragmentDataDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function FissionFragmentDataRead(handle, filename, filenameSize) & + bind(C, name='FissionFragmentDataRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FissionFragmentDataRead +end function FissionFragmentDataRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function FissionFragmentDataWrite(handle, filename, filenameSize) & + bind(C, name='FissionFragmentDataWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: FissionFragmentDataWrite +end function FissionFragmentDataWrite + +!! Print to standard output, in our prettyprinting format +function FissionFragmentDataPrint(handle) & + bind(C, name='FissionFragmentDataPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionFragmentDataPrint +end function FissionFragmentDataPrint + +!! Print to standard output, as XML +function FissionFragmentDataPrintXML(handle) & + bind(C, name='FissionFragmentDataPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionFragmentDataPrintXML +end function FissionFragmentDataPrintXML + +!! Print to standard output, as JSON +function FissionFragmentDataPrintJSON(handle) & + bind(C, name='FissionFragmentDataPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionFragmentDataPrintJSON +end function FissionFragmentDataPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Child: productYields +!! ----------------------------------------------------------------------------- + +!! Has +function FissionFragmentDataProductYieldsHas(handle) & + bind(C, name='FissionFragmentDataProductYieldsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionFragmentDataProductYieldsHas +end function FissionFragmentDataProductYieldsHas + +!! Get, const +function FissionFragmentDataProductYieldsGetConst(handle) & + bind(C, name='FissionFragmentDataProductYieldsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionFragmentDataProductYieldsGetConst +end function FissionFragmentDataProductYieldsGetConst + +!! Get, non-const +function FissionFragmentDataProductYieldsGet(handle) & + bind(C, name='FissionFragmentDataProductYieldsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionFragmentDataProductYieldsGet +end function FissionFragmentDataProductYieldsGet + +!! Set +subroutine FissionFragmentDataProductYieldsSet(handle, fieldHandle) & + bind(C, name='FissionFragmentDataProductYieldsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionFragmentDataProductYieldsSet + + +!! ----------------------------------------------------------------------------- +!! Child: delayedNeutrons +!! ----------------------------------------------------------------------------- + +!! Has +function FissionFragmentDataDelayedNeutronsHas(handle) & + bind(C, name='FissionFragmentDataDelayedNeutronsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionFragmentDataDelayedNeutronsHas +end function FissionFragmentDataDelayedNeutronsHas + +!! Get, const +function FissionFragmentDataDelayedNeutronsGetConst(handle) & + bind(C, name='FissionFragmentDataDelayedNeutronsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionFragmentDataDelayedNeutronsGetConst +end function FissionFragmentDataDelayedNeutronsGetConst + +!! Get, non-const +function FissionFragmentDataDelayedNeutronsGet(handle) & + bind(C, name='FissionFragmentDataDelayedNeutronsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionFragmentDataDelayedNeutronsGet +end function FissionFragmentDataDelayedNeutronsGet + +!! Set +subroutine FissionFragmentDataDelayedNeutronsSet(handle, fieldHandle) & + bind(C, name='FissionFragmentDataDelayedNeutronsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionFragmentDataDelayedNeutronsSet + + +!! ----------------------------------------------------------------------------- +!! Child: fissionEnergyReleases +!! ----------------------------------------------------------------------------- + +!! Has +function FissionFragmentDataFissionEnergyReleasesHas(handle) & + bind(C, name='FissionFragmentDataFissionEnergyReleasesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: FissionFragmentDataFissionEnergyReleasesHas +end function FissionFragmentDataFissionEnergyReleasesHas + +!! Get, const +function FissionFragmentDataFissionEnergyReleasesGetConst(handle) & + bind(C, name='FissionFragmentDataFissionEnergyReleasesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: FissionFragmentDataFissionEnergyReleasesGetConst +end function FissionFragmentDataFissionEnergyReleasesGetConst + +!! Get, non-const +function FissionFragmentDataFissionEnergyReleasesGet(handle) & + bind(C, name='FissionFragmentDataFissionEnergyReleasesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: FissionFragmentDataFissionEnergyReleasesGet +end function FissionFragmentDataFissionEnergyReleasesGet + +!! Set +subroutine FissionFragmentDataFissionEnergyReleasesSet(handle, fieldHandle) & + bind(C, name='FissionFragmentDataFissionEnergyReleasesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine FissionFragmentDataFissionEnergyReleasesSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module topFissionFragmentData diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/PoPs.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/PoPs.f03 new file mode 100644 index 000000000..a0469eae7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/PoPs.f03 @@ -0,0 +1,569 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module topPoPs +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function PoPsDefaultConst() & + bind(C, name='PoPsDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: PoPsDefaultConst +end function PoPsDefaultConst + +!! Create, default, non-const +function PoPsDefault() & + bind(C, name='PoPsDefault') + use iso_c_binding + implicit none + type(c_ptr) :: PoPsDefault +end function PoPsDefault + +!! Create, general, const +function PoPsCreateConst( & + name, & + version, & + format, & + aliases, & + baryons, & + chemicalElements, & + styles, & + unorthodoxes, & + gaugeBosons, & + leptons, & + nameSize, & + versionSize, & + formatSize & +) & + bind(C, name='PoPsCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) + integer(c_size_t), intent(in), value :: versionSize + character(c_char), intent(in) :: version(versionSize) + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) + type(c_ptr), intent(in), value :: aliases + type(c_ptr), intent(in), value :: baryons + type(c_ptr), intent(in), value :: chemicalElements + type(c_ptr), intent(in), value :: styles + type(c_ptr), intent(in), value :: unorthodoxes + type(c_ptr), intent(in), value :: gaugeBosons + type(c_ptr), intent(in), value :: leptons + type(c_ptr) :: PoPsCreateConst +end function PoPsCreateConst + +!! Create, general, non-const +function PoPsCreate( & + name, & + version, & + format, & + aliases, & + baryons, & + chemicalElements, & + styles, & + unorthodoxes, & + gaugeBosons, & + leptons, & + nameSize, & + versionSize, & + formatSize & +) & + bind(C, name='PoPsCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) + integer(c_size_t), intent(in), value :: versionSize + character(c_char), intent(in) :: version(versionSize) + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) + type(c_ptr), intent(in), value :: aliases + type(c_ptr), intent(in), value :: baryons + type(c_ptr), intent(in), value :: chemicalElements + type(c_ptr), intent(in), value :: styles + type(c_ptr), intent(in), value :: unorthodoxes + type(c_ptr), intent(in), value :: gaugeBosons + type(c_ptr), intent(in), value :: leptons + type(c_ptr) :: PoPsCreate +end function PoPsCreate + +!! Assign +subroutine PoPsAssign(handleLHS, handleRHS) & + bind(C, name='PoPsAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine PoPsAssign + +!! Delete +subroutine PoPsDelete(handle) & + bind(C, name='PoPsDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine PoPsDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function PoPsRead(handle, filename, filenameSize) & + bind(C, name='PoPsRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PoPsRead +end function PoPsRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function PoPsWrite(handle, filename, filenameSize) & + bind(C, name='PoPsWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: PoPsWrite +end function PoPsWrite + +!! Print to standard output, in our prettyprinting format +function PoPsPrint(handle) & + bind(C, name='PoPsPrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsPrint +end function PoPsPrint + +!! Print to standard output, as XML +function PoPsPrintXML(handle) & + bind(C, name='PoPsPrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsPrintXML +end function PoPsPrintXML + +!! Print to standard output, as JSON +function PoPsPrintJSON(handle) & + bind(C, name='PoPsPrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsPrintJSON +end function PoPsPrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: name +!! ----------------------------------------------------------------------------- + +!! Has +function PoPsNameHas(handle) & + bind(C, name='PoPsNameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsNameHas +end function PoPsNameHas + +!! Get +function PoPsNameGet(handle) & + bind(C, name='PoPsNameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PoPsNameGet +end function PoPsNameGet + +!! Set +subroutine PoPsNameSet(handle, name, nameSize) & + bind(C, name='PoPsNameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: nameSize + character(c_char), intent(in) :: name(nameSize) +end subroutine PoPsNameSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: version +!! ----------------------------------------------------------------------------- + +!! Has +function PoPsVersionHas(handle) & + bind(C, name='PoPsVersionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsVersionHas +end function PoPsVersionHas + +!! Get +function PoPsVersionGet(handle) & + bind(C, name='PoPsVersionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PoPsVersionGet +end function PoPsVersionGet + +!! Set +subroutine PoPsVersionSet(handle, version, versionSize) & + bind(C, name='PoPsVersionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: versionSize + character(c_char), intent(in) :: version(versionSize) +end subroutine PoPsVersionSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: format +!! ----------------------------------------------------------------------------- + +!! Has +function PoPsFormatHas(handle) & + bind(C, name='PoPsFormatHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsFormatHas +end function PoPsFormatHas + +!! Get +function PoPsFormatGet(handle) & + bind(C, name='PoPsFormatGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PoPsFormatGet +end function PoPsFormatGet + +!! Set +subroutine PoPsFormatSet(handle, format, formatSize) & + bind(C, name='PoPsFormatSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) +end subroutine PoPsFormatSet + + +!! ----------------------------------------------------------------------------- +!! Child: aliases +!! ----------------------------------------------------------------------------- + +!! Has +function PoPsAliasesHas(handle) & + bind(C, name='PoPsAliasesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsAliasesHas +end function PoPsAliasesHas + +!! Get, const +function PoPsAliasesGetConst(handle) & + bind(C, name='PoPsAliasesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PoPsAliasesGetConst +end function PoPsAliasesGetConst + +!! Get, non-const +function PoPsAliasesGet(handle) & + bind(C, name='PoPsAliasesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PoPsAliasesGet +end function PoPsAliasesGet + +!! Set +subroutine PoPsAliasesSet(handle, fieldHandle) & + bind(C, name='PoPsAliasesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PoPsAliasesSet + + +!! ----------------------------------------------------------------------------- +!! Child: baryons +!! ----------------------------------------------------------------------------- + +!! Has +function PoPsBaryonsHas(handle) & + bind(C, name='PoPsBaryonsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsBaryonsHas +end function PoPsBaryonsHas + +!! Get, const +function PoPsBaryonsGetConst(handle) & + bind(C, name='PoPsBaryonsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PoPsBaryonsGetConst +end function PoPsBaryonsGetConst + +!! Get, non-const +function PoPsBaryonsGet(handle) & + bind(C, name='PoPsBaryonsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PoPsBaryonsGet +end function PoPsBaryonsGet + +!! Set +subroutine PoPsBaryonsSet(handle, fieldHandle) & + bind(C, name='PoPsBaryonsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PoPsBaryonsSet + + +!! ----------------------------------------------------------------------------- +!! Child: chemicalElements +!! ----------------------------------------------------------------------------- + +!! Has +function PoPsChemicalElementsHas(handle) & + bind(C, name='PoPsChemicalElementsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsChemicalElementsHas +end function PoPsChemicalElementsHas + +!! Get, const +function PoPsChemicalElementsGetConst(handle) & + bind(C, name='PoPsChemicalElementsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PoPsChemicalElementsGetConst +end function PoPsChemicalElementsGetConst + +!! Get, non-const +function PoPsChemicalElementsGet(handle) & + bind(C, name='PoPsChemicalElementsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PoPsChemicalElementsGet +end function PoPsChemicalElementsGet + +!! Set +subroutine PoPsChemicalElementsSet(handle, fieldHandle) & + bind(C, name='PoPsChemicalElementsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PoPsChemicalElementsSet + + +!! ----------------------------------------------------------------------------- +!! Child: styles +!! ----------------------------------------------------------------------------- + +!! Has +function PoPsStylesHas(handle) & + bind(C, name='PoPsStylesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsStylesHas +end function PoPsStylesHas + +!! Get, const +function PoPsStylesGetConst(handle) & + bind(C, name='PoPsStylesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PoPsStylesGetConst +end function PoPsStylesGetConst + +!! Get, non-const +function PoPsStylesGet(handle) & + bind(C, name='PoPsStylesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PoPsStylesGet +end function PoPsStylesGet + +!! Set +subroutine PoPsStylesSet(handle, fieldHandle) & + bind(C, name='PoPsStylesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PoPsStylesSet + + +!! ----------------------------------------------------------------------------- +!! Child: unorthodoxes +!! ----------------------------------------------------------------------------- + +!! Has +function PoPsUnorthodoxesHas(handle) & + bind(C, name='PoPsUnorthodoxesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsUnorthodoxesHas +end function PoPsUnorthodoxesHas + +!! Get, const +function PoPsUnorthodoxesGetConst(handle) & + bind(C, name='PoPsUnorthodoxesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PoPsUnorthodoxesGetConst +end function PoPsUnorthodoxesGetConst + +!! Get, non-const +function PoPsUnorthodoxesGet(handle) & + bind(C, name='PoPsUnorthodoxesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PoPsUnorthodoxesGet +end function PoPsUnorthodoxesGet + +!! Set +subroutine PoPsUnorthodoxesSet(handle, fieldHandle) & + bind(C, name='PoPsUnorthodoxesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PoPsUnorthodoxesSet + + +!! ----------------------------------------------------------------------------- +!! Child: gaugeBosons +!! ----------------------------------------------------------------------------- + +!! Has +function PoPsGaugeBosonsHas(handle) & + bind(C, name='PoPsGaugeBosonsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsGaugeBosonsHas +end function PoPsGaugeBosonsHas + +!! Get, const +function PoPsGaugeBosonsGetConst(handle) & + bind(C, name='PoPsGaugeBosonsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PoPsGaugeBosonsGetConst +end function PoPsGaugeBosonsGetConst + +!! Get, non-const +function PoPsGaugeBosonsGet(handle) & + bind(C, name='PoPsGaugeBosonsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PoPsGaugeBosonsGet +end function PoPsGaugeBosonsGet + +!! Set +subroutine PoPsGaugeBosonsSet(handle, fieldHandle) & + bind(C, name='PoPsGaugeBosonsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PoPsGaugeBosonsSet + + +!! ----------------------------------------------------------------------------- +!! Child: leptons +!! ----------------------------------------------------------------------------- + +!! Has +function PoPsLeptonsHas(handle) & + bind(C, name='PoPsLeptonsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: PoPsLeptonsHas +end function PoPsLeptonsHas + +!! Get, const +function PoPsLeptonsGetConst(handle) & + bind(C, name='PoPsLeptonsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: PoPsLeptonsGetConst +end function PoPsLeptonsGetConst + +!! Get, non-const +function PoPsLeptonsGet(handle) & + bind(C, name='PoPsLeptonsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: PoPsLeptonsGet +end function PoPsLeptonsGet + +!! Set +subroutine PoPsLeptonsSet(handle, fieldHandle) & + bind(C, name='PoPsLeptonsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine PoPsLeptonsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module topPoPs diff --git a/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/ReactionSuite.f03 b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/ReactionSuite.f03 new file mode 100644 index 000000000..64eec9767 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/fortran/src/v2.0/top/ReactionSuite.f03 @@ -0,0 +1,872 @@ + +!! THIS FILE WAS AUTOGENERATED! +!! DO NOT MODIFY! + +module topReactionSuite +use iso_c_binding +interface + + +!! ----------------------------------------------------------------------------- +!! Basics +!! Create, Assign, Delete +!! ----------------------------------------------------------------------------- + +!! Create, default, const +function ReactionSuiteDefaultConst() & + bind(C, name='ReactionSuiteDefaultConst') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionSuiteDefaultConst +end function ReactionSuiteDefaultConst + +!! Create, default, non-const +function ReactionSuiteDefault() & + bind(C, name='ReactionSuiteDefault') + use iso_c_binding + implicit none + type(c_ptr) :: ReactionSuiteDefault +end function ReactionSuiteDefault + +!! Create, general, const +function ReactionSuiteCreateConst( & + projectile, & + target, & + evaluation, & + format, & + projectileFrame, & + interaction, & + styles, & + PoPs, & + reactions, & + applicationData, & + externalFiles, & + resonances, & + sums, & + productions, & + fissionComponents, & + orphanProducts, & + incompleteReactions, & + projectileSize, & + targetSize, & + evaluationSize, & + formatSize, & + projectileFrameSize, & + interactionSize & +) & + bind(C, name='ReactionSuiteCreateConst') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: projectileSize + character(c_char), intent(in) :: projectile(projectileSize) + integer(c_size_t), intent(in), value :: targetSize + character(c_char), intent(in) :: target(targetSize) + integer(c_size_t), intent(in), value :: evaluationSize + character(c_char), intent(in) :: evaluation(evaluationSize) + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) + integer(c_size_t), intent(in), value :: projectileFrameSize + character(c_char), intent(in) :: projectileFrame(projectileFrameSize) + integer(c_size_t), intent(in), value :: interactionSize + character(c_char), intent(in) :: interaction(interactionSize) + type(c_ptr), intent(in), value :: styles + type(c_ptr), intent(in), value :: PoPs + type(c_ptr), intent(in), value :: reactions + type(c_ptr), intent(in), value :: applicationData + type(c_ptr), intent(in), value :: externalFiles + type(c_ptr), intent(in), value :: resonances + type(c_ptr), intent(in), value :: sums + type(c_ptr), intent(in), value :: productions + type(c_ptr), intent(in), value :: fissionComponents + type(c_ptr), intent(in), value :: orphanProducts + type(c_ptr), intent(in), value :: incompleteReactions + type(c_ptr) :: ReactionSuiteCreateConst +end function ReactionSuiteCreateConst + +!! Create, general, non-const +function ReactionSuiteCreate( & + projectile, & + target, & + evaluation, & + format, & + projectileFrame, & + interaction, & + styles, & + PoPs, & + reactions, & + applicationData, & + externalFiles, & + resonances, & + sums, & + productions, & + fissionComponents, & + orphanProducts, & + incompleteReactions, & + projectileSize, & + targetSize, & + evaluationSize, & + formatSize, & + projectileFrameSize, & + interactionSize & +) & + bind(C, name='ReactionSuiteCreate') + use iso_c_binding + implicit none + integer(c_size_t), intent(in), value :: projectileSize + character(c_char), intent(in) :: projectile(projectileSize) + integer(c_size_t), intent(in), value :: targetSize + character(c_char), intent(in) :: target(targetSize) + integer(c_size_t), intent(in), value :: evaluationSize + character(c_char), intent(in) :: evaluation(evaluationSize) + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) + integer(c_size_t), intent(in), value :: projectileFrameSize + character(c_char), intent(in) :: projectileFrame(projectileFrameSize) + integer(c_size_t), intent(in), value :: interactionSize + character(c_char), intent(in) :: interaction(interactionSize) + type(c_ptr), intent(in), value :: styles + type(c_ptr), intent(in), value :: PoPs + type(c_ptr), intent(in), value :: reactions + type(c_ptr), intent(in), value :: applicationData + type(c_ptr), intent(in), value :: externalFiles + type(c_ptr), intent(in), value :: resonances + type(c_ptr), intent(in), value :: sums + type(c_ptr), intent(in), value :: productions + type(c_ptr), intent(in), value :: fissionComponents + type(c_ptr), intent(in), value :: orphanProducts + type(c_ptr), intent(in), value :: incompleteReactions + type(c_ptr) :: ReactionSuiteCreate +end function ReactionSuiteCreate + +!! Assign +subroutine ReactionSuiteAssign(handleLHS, handleRHS) & + bind(C, name='ReactionSuiteAssign') + use iso_c_binding + implicit none + type(c_ptr), value :: handleLHS + type(c_ptr), intent(in), value :: handleRHS +end subroutine ReactionSuiteAssign + +!! Delete +subroutine ReactionSuiteDelete(handle) & + bind(C, name='ReactionSuiteDelete') + use iso_c_binding + implicit none + type(c_ptr), value :: handle +end subroutine ReactionSuiteDelete + + +!! ----------------------------------------------------------------------------- +!! I/O +!! Read, Write, Print +!! Each returns 0 if failure, 1 if success. +!! ----------------------------------------------------------------------------- + +!! Read from file +!! File can be XML, JSON, or HDF5. +!! We'll examine the file's contents to determine its type automatically. +function ReactionSuiteRead(handle, filename, filenameSize) & + bind(C, name='ReactionSuiteRead') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionSuiteRead +end function ReactionSuiteRead + +!! Write to file +!! File can be XML, JSON, or HDF5. +!! We'll use filename's extension to determine the type you want written. +function ReactionSuiteWrite(handle, filename, filenameSize) & + bind(C, name='ReactionSuiteWrite') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_size_t), intent(in), value :: filenameSize + character(c_char), intent(in) :: filename(filenameSize) + integer(c_int) :: ReactionSuiteWrite +end function ReactionSuiteWrite + +!! Print to standard output, in our prettyprinting format +function ReactionSuitePrint(handle) & + bind(C, name='ReactionSuitePrint') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuitePrint +end function ReactionSuitePrint + +!! Print to standard output, as XML +function ReactionSuitePrintXML(handle) & + bind(C, name='ReactionSuitePrintXML') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuitePrintXML +end function ReactionSuitePrintXML + +!! Print to standard output, as JSON +function ReactionSuitePrintJSON(handle) & + bind(C, name='ReactionSuitePrintJSON') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuitePrintJSON +end function ReactionSuitePrintJSON + + +!! ----------------------------------------------------------------------------- +!! Metadatum: projectile +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteProjectileHas(handle) & + bind(C, name='ReactionSuiteProjectileHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteProjectileHas +end function ReactionSuiteProjectileHas + +!! Get +function ReactionSuiteProjectileGet(handle) & + bind(C, name='ReactionSuiteProjectileGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteProjectileGet +end function ReactionSuiteProjectileGet + +!! Set +subroutine ReactionSuiteProjectileSet(handle, projectile, projectileSize) & + bind(C, name='ReactionSuiteProjectileSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: projectileSize + character(c_char), intent(in) :: projectile(projectileSize) +end subroutine ReactionSuiteProjectileSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: target +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteTargetHas(handle) & + bind(C, name='ReactionSuiteTargetHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteTargetHas +end function ReactionSuiteTargetHas + +!! Get +function ReactionSuiteTargetGet(handle) & + bind(C, name='ReactionSuiteTargetGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteTargetGet +end function ReactionSuiteTargetGet + +!! Set +subroutine ReactionSuiteTargetSet(handle, target, targetSize) & + bind(C, name='ReactionSuiteTargetSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: targetSize + character(c_char), intent(in) :: target(targetSize) +end subroutine ReactionSuiteTargetSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: evaluation +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteEvaluationHas(handle) & + bind(C, name='ReactionSuiteEvaluationHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteEvaluationHas +end function ReactionSuiteEvaluationHas + +!! Get +function ReactionSuiteEvaluationGet(handle) & + bind(C, name='ReactionSuiteEvaluationGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteEvaluationGet +end function ReactionSuiteEvaluationGet + +!! Set +subroutine ReactionSuiteEvaluationSet(handle, evaluation, evaluationSize) & + bind(C, name='ReactionSuiteEvaluationSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: evaluationSize + character(c_char), intent(in) :: evaluation(evaluationSize) +end subroutine ReactionSuiteEvaluationSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: format +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteFormatHas(handle) & + bind(C, name='ReactionSuiteFormatHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteFormatHas +end function ReactionSuiteFormatHas + +!! Get +function ReactionSuiteFormatGet(handle) & + bind(C, name='ReactionSuiteFormatGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteFormatGet +end function ReactionSuiteFormatGet + +!! Set +subroutine ReactionSuiteFormatSet(handle, format, formatSize) & + bind(C, name='ReactionSuiteFormatSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: formatSize + character(c_char), intent(in) :: format(formatSize) +end subroutine ReactionSuiteFormatSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: projectileFrame +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteProjectileFrameHas(handle) & + bind(C, name='ReactionSuiteProjectileFrameHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteProjectileFrameHas +end function ReactionSuiteProjectileFrameHas + +!! Get +function ReactionSuiteProjectileFrameGet(handle) & + bind(C, name='ReactionSuiteProjectileFrameGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteProjectileFrameGet +end function ReactionSuiteProjectileFrameGet + +!! Set +subroutine ReactionSuiteProjectileFrameSet(handle, projectileFrame, projectileFrameSize) & + bind(C, name='ReactionSuiteProjectileFrameSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: projectileFrameSize + character(c_char), intent(in) :: projectileFrame(projectileFrameSize) +end subroutine ReactionSuiteProjectileFrameSet + + +!! ----------------------------------------------------------------------------- +!! Metadatum: interaction +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteInteractionHas(handle) & + bind(C, name='ReactionSuiteInteractionHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteInteractionHas +end function ReactionSuiteInteractionHas + +!! Get +function ReactionSuiteInteractionGet(handle) & + bind(C, name='ReactionSuiteInteractionGet') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteInteractionGet +end function ReactionSuiteInteractionGet + +!! Set +subroutine ReactionSuiteInteractionSet(handle, interaction, interactionSize) & + bind(C, name='ReactionSuiteInteractionSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + integer(c_size_t), intent(in), value :: interactionSize + character(c_char), intent(in) :: interaction(interactionSize) +end subroutine ReactionSuiteInteractionSet + + +!! ----------------------------------------------------------------------------- +!! Child: styles +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteStylesHas(handle) & + bind(C, name='ReactionSuiteStylesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteStylesHas +end function ReactionSuiteStylesHas + +!! Get, const +function ReactionSuiteStylesGetConst(handle) & + bind(C, name='ReactionSuiteStylesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteStylesGetConst +end function ReactionSuiteStylesGetConst + +!! Get, non-const +function ReactionSuiteStylesGet(handle) & + bind(C, name='ReactionSuiteStylesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionSuiteStylesGet +end function ReactionSuiteStylesGet + +!! Set +subroutine ReactionSuiteStylesSet(handle, fieldHandle) & + bind(C, name='ReactionSuiteStylesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionSuiteStylesSet + + +!! ----------------------------------------------------------------------------- +!! Child: PoPs +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuitePoPsHas(handle) & + bind(C, name='ReactionSuitePoPsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuitePoPsHas +end function ReactionSuitePoPsHas + +!! Get, const +function ReactionSuitePoPsGetConst(handle) & + bind(C, name='ReactionSuitePoPsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuitePoPsGetConst +end function ReactionSuitePoPsGetConst + +!! Get, non-const +function ReactionSuitePoPsGet(handle) & + bind(C, name='ReactionSuitePoPsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionSuitePoPsGet +end function ReactionSuitePoPsGet + +!! Set +subroutine ReactionSuitePoPsSet(handle, fieldHandle) & + bind(C, name='ReactionSuitePoPsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionSuitePoPsSet + + +!! ----------------------------------------------------------------------------- +!! Child: reactions +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteReactionsHas(handle) & + bind(C, name='ReactionSuiteReactionsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteReactionsHas +end function ReactionSuiteReactionsHas + +!! Get, const +function ReactionSuiteReactionsGetConst(handle) & + bind(C, name='ReactionSuiteReactionsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteReactionsGetConst +end function ReactionSuiteReactionsGetConst + +!! Get, non-const +function ReactionSuiteReactionsGet(handle) & + bind(C, name='ReactionSuiteReactionsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionSuiteReactionsGet +end function ReactionSuiteReactionsGet + +!! Set +subroutine ReactionSuiteReactionsSet(handle, fieldHandle) & + bind(C, name='ReactionSuiteReactionsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionSuiteReactionsSet + + +!! ----------------------------------------------------------------------------- +!! Child: applicationData +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteApplicationDataHas(handle) & + bind(C, name='ReactionSuiteApplicationDataHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteApplicationDataHas +end function ReactionSuiteApplicationDataHas + +!! Get, const +function ReactionSuiteApplicationDataGetConst(handle) & + bind(C, name='ReactionSuiteApplicationDataGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteApplicationDataGetConst +end function ReactionSuiteApplicationDataGetConst + +!! Get, non-const +function ReactionSuiteApplicationDataGet(handle) & + bind(C, name='ReactionSuiteApplicationDataGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionSuiteApplicationDataGet +end function ReactionSuiteApplicationDataGet + +!! Set +subroutine ReactionSuiteApplicationDataSet(handle, fieldHandle) & + bind(C, name='ReactionSuiteApplicationDataSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionSuiteApplicationDataSet + + +!! ----------------------------------------------------------------------------- +!! Child: externalFiles +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteExternalFilesHas(handle) & + bind(C, name='ReactionSuiteExternalFilesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteExternalFilesHas +end function ReactionSuiteExternalFilesHas + +!! Get, const +function ReactionSuiteExternalFilesGetConst(handle) & + bind(C, name='ReactionSuiteExternalFilesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteExternalFilesGetConst +end function ReactionSuiteExternalFilesGetConst + +!! Get, non-const +function ReactionSuiteExternalFilesGet(handle) & + bind(C, name='ReactionSuiteExternalFilesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionSuiteExternalFilesGet +end function ReactionSuiteExternalFilesGet + +!! Set +subroutine ReactionSuiteExternalFilesSet(handle, fieldHandle) & + bind(C, name='ReactionSuiteExternalFilesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionSuiteExternalFilesSet + + +!! ----------------------------------------------------------------------------- +!! Child: resonances +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteResonancesHas(handle) & + bind(C, name='ReactionSuiteResonancesHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteResonancesHas +end function ReactionSuiteResonancesHas + +!! Get, const +function ReactionSuiteResonancesGetConst(handle) & + bind(C, name='ReactionSuiteResonancesGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteResonancesGetConst +end function ReactionSuiteResonancesGetConst + +!! Get, non-const +function ReactionSuiteResonancesGet(handle) & + bind(C, name='ReactionSuiteResonancesGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionSuiteResonancesGet +end function ReactionSuiteResonancesGet + +!! Set +subroutine ReactionSuiteResonancesSet(handle, fieldHandle) & + bind(C, name='ReactionSuiteResonancesSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionSuiteResonancesSet + + +!! ----------------------------------------------------------------------------- +!! Child: sums +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteSumsHas(handle) & + bind(C, name='ReactionSuiteSumsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteSumsHas +end function ReactionSuiteSumsHas + +!! Get, const +function ReactionSuiteSumsGetConst(handle) & + bind(C, name='ReactionSuiteSumsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteSumsGetConst +end function ReactionSuiteSumsGetConst + +!! Get, non-const +function ReactionSuiteSumsGet(handle) & + bind(C, name='ReactionSuiteSumsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionSuiteSumsGet +end function ReactionSuiteSumsGet + +!! Set +subroutine ReactionSuiteSumsSet(handle, fieldHandle) & + bind(C, name='ReactionSuiteSumsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionSuiteSumsSet + + +!! ----------------------------------------------------------------------------- +!! Child: productions +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteProductionsHas(handle) & + bind(C, name='ReactionSuiteProductionsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteProductionsHas +end function ReactionSuiteProductionsHas + +!! Get, const +function ReactionSuiteProductionsGetConst(handle) & + bind(C, name='ReactionSuiteProductionsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteProductionsGetConst +end function ReactionSuiteProductionsGetConst + +!! Get, non-const +function ReactionSuiteProductionsGet(handle) & + bind(C, name='ReactionSuiteProductionsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionSuiteProductionsGet +end function ReactionSuiteProductionsGet + +!! Set +subroutine ReactionSuiteProductionsSet(handle, fieldHandle) & + bind(C, name='ReactionSuiteProductionsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionSuiteProductionsSet + + +!! ----------------------------------------------------------------------------- +!! Child: fissionComponents +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteFissionComponentsHas(handle) & + bind(C, name='ReactionSuiteFissionComponentsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteFissionComponentsHas +end function ReactionSuiteFissionComponentsHas + +!! Get, const +function ReactionSuiteFissionComponentsGetConst(handle) & + bind(C, name='ReactionSuiteFissionComponentsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteFissionComponentsGetConst +end function ReactionSuiteFissionComponentsGetConst + +!! Get, non-const +function ReactionSuiteFissionComponentsGet(handle) & + bind(C, name='ReactionSuiteFissionComponentsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionSuiteFissionComponentsGet +end function ReactionSuiteFissionComponentsGet + +!! Set +subroutine ReactionSuiteFissionComponentsSet(handle, fieldHandle) & + bind(C, name='ReactionSuiteFissionComponentsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionSuiteFissionComponentsSet + + +!! ----------------------------------------------------------------------------- +!! Child: orphanProducts +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteOrphanProductsHas(handle) & + bind(C, name='ReactionSuiteOrphanProductsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteOrphanProductsHas +end function ReactionSuiteOrphanProductsHas + +!! Get, const +function ReactionSuiteOrphanProductsGetConst(handle) & + bind(C, name='ReactionSuiteOrphanProductsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteOrphanProductsGetConst +end function ReactionSuiteOrphanProductsGetConst + +!! Get, non-const +function ReactionSuiteOrphanProductsGet(handle) & + bind(C, name='ReactionSuiteOrphanProductsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionSuiteOrphanProductsGet +end function ReactionSuiteOrphanProductsGet + +!! Set +subroutine ReactionSuiteOrphanProductsSet(handle, fieldHandle) & + bind(C, name='ReactionSuiteOrphanProductsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionSuiteOrphanProductsSet + + +!! ----------------------------------------------------------------------------- +!! Child: incompleteReactions +!! ----------------------------------------------------------------------------- + +!! Has +function ReactionSuiteIncompleteReactionsHas(handle) & + bind(C, name='ReactionSuiteIncompleteReactionsHas') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + integer(c_int) :: ReactionSuiteIncompleteReactionsHas +end function ReactionSuiteIncompleteReactionsHas + +!! Get, const +function ReactionSuiteIncompleteReactionsGetConst(handle) & + bind(C, name='ReactionSuiteIncompleteReactionsGetConst') + use iso_c_binding + implicit none + type(c_ptr), intent(in), value :: handle + type(c_ptr) :: ReactionSuiteIncompleteReactionsGetConst +end function ReactionSuiteIncompleteReactionsGetConst + +!! Get, non-const +function ReactionSuiteIncompleteReactionsGet(handle) & + bind(C, name='ReactionSuiteIncompleteReactionsGet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr) :: ReactionSuiteIncompleteReactionsGet +end function ReactionSuiteIncompleteReactionsGet + +!! Set +subroutine ReactionSuiteIncompleteReactionsSet(handle, fieldHandle) & + bind(C, name='ReactionSuiteIncompleteReactionsSet') + use iso_c_binding + implicit none + type(c_ptr), value :: handle + type(c_ptr), intent(in), value :: fieldHandle +end subroutine ReactionSuiteIncompleteReactionsSet + + +!! ----------------------------------------------------------------------------- +!! ----------------------------------------------------------------------------- + +end interface +end module topReactionSuite diff --git a/versions/GNDS-v2.0/GNDS/python/src/all.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/all.python.cpp new file mode 100644 index 000000000..fd078e957 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/all.python.cpp @@ -0,0 +1,314 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// ----------------------------------------------------------------------------- +// core +// ----------------------------------------------------------------------------- + +// core +#include "GNDStk.python.cpp" + +// node +#include "core/Node.python.cpp" + + +// ----------------------------------------------------------------------------- +// v2.0 +// ----------------------------------------------------------------------------- + +// v2.0 +#include "v2.0.python.cpp" + +// enumerations +#include "enums/BoundaryCondition.python.cpp" +#include "enums/ContributorType.python.cpp" +#include "enums/DateType.python.cpp" +#include "enums/DecayType.python.cpp" +#include "enums/Encoding.python.cpp" +#include "enums/Energy.python.cpp" +#include "enums/Frame.python.cpp" +#include "enums/GridStyle.python.cpp" +#include "enums/HashAlgorithm.python.cpp" +#include "enums/Interaction.python.cpp" +#include "enums/Interpolation.python.cpp" +#include "enums/InterpolationQualifier.python.cpp" +#include "enums/Length.python.cpp" +#include "enums/Parity.python.cpp" +#include "enums/RelationType.python.cpp" +#include "enums/StorageOrder.python.cpp" + +// namespace g2d +#include "v2.0/g2d.python.cpp" +#include "v2.0/g2d/Array.python.cpp" + +// namespace g3d +#include "v2.0/g3d.python.cpp" +#include "v2.0/g3d/Array.python.cpp" +#include "v2.0/g3d/Lengths.python.cpp" +#include "v2.0/g3d/Starts.python.cpp" + +// namespace general +#include "v2.0/general.python.cpp" +#include "v2.0/general/Add.python.cpp" +#include "v2.0/general/Alias.python.cpp" +#include "v2.0/general/Aliases.python.cpp" +#include "v2.0/general/Angular.python.cpp" +#include "v2.0/general/AngularEnergy.python.cpp" +#include "v2.0/general/AngularTwoBody.python.cpp" +#include "v2.0/general/ApplicationData.python.cpp" +#include "v2.0/general/Array.python.cpp" +#include "v2.0/general/Atomic.python.cpp" +#include "v2.0/general/Author.python.cpp" +#include "v2.0/general/Authors.python.cpp" +#include "v2.0/general/AverageEnergies.python.cpp" +#include "v2.0/general/AverageEnergy.python.cpp" +#include "v2.0/general/AverageParameterCovariance.python.cpp" +#include "v2.0/general/AverageProductEnergy.python.cpp" +#include "v2.0/general/Axes.python.cpp" +#include "v2.0/general/Axis.python.cpp" +#include "v2.0/general/Background.python.cpp" +#include "v2.0/general/Baryon.python.cpp" +#include "v2.0/general/Baryons.python.cpp" +#include "v2.0/general/BindingEnergy.python.cpp" +#include "v2.0/general/Body.python.cpp" +#include "v2.0/general/BoundAtomCrossSection.python.cpp" +#include "v2.0/general/Branching1d.python.cpp" +#include "v2.0/general/Branching3d.python.cpp" +#include "v2.0/general/BreitWigner.python.cpp" +#include "v2.0/general/Channel.python.cpp" +#include "v2.0/general/Channels.python.cpp" +#include "v2.0/general/Charge.python.cpp" +#include "v2.0/general/ChemicalElement.python.cpp" +#include "v2.0/general/ChemicalElements.python.cpp" +#include "v2.0/general/CoherentPhotonScattering.python.cpp" +#include "v2.0/general/Column.python.cpp" +#include "v2.0/general/ColumnData.python.cpp" +#include "v2.0/general/ColumnHeaders.python.cpp" +#include "v2.0/general/Configuration.python.cpp" +#include "v2.0/general/Configurations.python.cpp" +#include "v2.0/general/Constant1d.python.cpp" +#include "v2.0/general/Continuum.python.cpp" +#include "v2.0/general/Conversion.python.cpp" +#include "v2.0/general/CoulombPlusNuclearElastic.python.cpp" +#include "v2.0/general/Covariance.python.cpp" +#include "v2.0/general/CovarianceMatrix.python.cpp" +#include "v2.0/general/CovarianceSection.python.cpp" +#include "v2.0/general/CovarianceSections.python.cpp" +#include "v2.0/general/CrossSection.python.cpp" +#include "v2.0/general/CrossSectionReconstructed.python.cpp" +#include "v2.0/general/CrossSectionSum.python.cpp" +#include "v2.0/general/CrossSectionSums.python.cpp" +#include "v2.0/general/Data.python.cpp" +#include "v2.0/general/Date.python.cpp" +#include "v2.0/general/Dates.python.cpp" +#include "v2.0/general/DebyeWallerIntegral.python.cpp" +#include "v2.0/general/Decay.python.cpp" +#include "v2.0/general/DecayData.python.cpp" +#include "v2.0/general/DecayMode.python.cpp" +#include "v2.0/general/DecayModes.python.cpp" +#include "v2.0/general/DecayPath.python.cpp" +#include "v2.0/general/DelayedBetaEnergy.python.cpp" +#include "v2.0/general/DelayedGammaEnergy.python.cpp" +#include "v2.0/general/DelayedNeutron.python.cpp" +#include "v2.0/general/DelayedNeutronKE.python.cpp" +#include "v2.0/general/DelayedNeutrons.python.cpp" +#include "v2.0/general/Discrete.python.cpp" +#include "v2.0/general/DiscreteGamma.python.cpp" +#include "v2.0/general/Distribution.python.cpp" +#include "v2.0/general/Documentation.python.cpp" +#include "v2.0/general/Double.python.cpp" +#include "v2.0/general/DoubleDifferentialCrossSection.python.cpp" +#include "v2.0/general/EFH.python.cpp" +#include "v2.0/general/EFL.python.cpp" +#include "v2.0/general/ENDFconversionFlags.python.cpp" +#include "v2.0/general/E_critical.python.cpp" +#include "v2.0/general/E_max.python.cpp" +#include "v2.0/general/ElapsedTime.python.cpp" +#include "v2.0/general/ElapsedTimes.python.cpp" +#include "v2.0/general/EndfCompatible.python.cpp" +#include "v2.0/general/Energy.python.cpp" +#include "v2.0/general/EnergyAngular.python.cpp" +#include "v2.0/general/Evaluated.python.cpp" +#include "v2.0/general/Evaporation.python.cpp" +#include "v2.0/general/ExternalFile.python.cpp" +#include "v2.0/general/ExternalFiles.python.cpp" +#include "v2.0/general/F.python.cpp" +#include "v2.0/general/FastRegion.python.cpp" +#include "v2.0/general/FissionComponent.python.cpp" +#include "v2.0/general/FissionComponents.python.cpp" +#include "v2.0/general/FissionEnergyRelease.python.cpp" +#include "v2.0/general/FissionEnergyReleases.python.cpp" +#include "v2.0/general/FormFactor.python.cpp" +#include "v2.0/general/Fraction.python.cpp" +#include "v2.0/general/FreeGasApproximation.python.cpp" +#include "v2.0/general/Function1ds.python.cpp" +#include "v2.0/general/Function2ds.python.cpp" +#include "v2.0/general/G.python.cpp" +#include "v2.0/general/GaugeBoson.python.cpp" +#include "v2.0/general/GaugeBosons.python.cpp" +#include "v2.0/general/GeneralEvaporation.python.cpp" +#include "v2.0/general/Grid.python.cpp" +#include "v2.0/general/Gridded2d.python.cpp" +#include "v2.0/general/Gridded3d.python.cpp" +#include "v2.0/general/Halflife.python.cpp" +#include "v2.0/general/HardSphereRadius.python.cpp" +#include "v2.0/general/ImaginaryAnomalousFactor.python.cpp" +#include "v2.0/general/ImaginaryInterferenceTerm.python.cpp" +#include "v2.0/general/IncidentEnergies.python.cpp" +#include "v2.0/general/IncidentEnergy.python.cpp" +#include "v2.0/general/IncoherentPhotonScattering.python.cpp" +#include "v2.0/general/IncompleteReactions.python.cpp" +#include "v2.0/general/Institution.python.cpp" +#include "v2.0/general/Integer.python.cpp" +#include "v2.0/general/Intensity.python.cpp" +#include "v2.0/general/InternalConversionCoefficients.python.cpp" +#include "v2.0/general/Isotope.python.cpp" +#include "v2.0/general/Isotopes.python.cpp" +#include "v2.0/general/Isotropic2d.python.cpp" +#include "v2.0/general/J.python.cpp" +#include "v2.0/general/Js.python.cpp" +#include "v2.0/general/KalbachMann.python.cpp" +#include "v2.0/general/L.python.cpp" +#include "v2.0/general/Legendre.python.cpp" +#include "v2.0/general/Lepton.python.cpp" +#include "v2.0/general/Leptons.python.cpp" +#include "v2.0/general/LevelSpacing.python.cpp" +#include "v2.0/general/Link.python.cpp" +#include "v2.0/general/ListOfCovariances.python.cpp" +#include "v2.0/general/Ls.python.cpp" +#include "v2.0/general/MadlandNix.python.cpp" +#include "v2.0/general/Mass.python.cpp" +#include "v2.0/general/MetaStable.python.cpp" +#include "v2.0/general/Mixed.python.cpp" +#include "v2.0/general/Multiplicity.python.cpp" +#include "v2.0/general/MultiplicitySum.python.cpp" +#include "v2.0/general/MultiplicitySums.python.cpp" +#include "v2.0/general/NBodyPhaseSpace.python.cpp" +#include "v2.0/general/NeutrinoEnergy.python.cpp" +#include "v2.0/general/NonNeutrinoEnergy.python.cpp" +#include "v2.0/general/NuclearAmplitudeExpansion.python.cpp" +#include "v2.0/general/NuclearPlusInterference.python.cpp" +#include "v2.0/general/NuclearTerm.python.cpp" +#include "v2.0/general/Nucleus.python.cpp" +#include "v2.0/general/Nuclide.python.cpp" +#include "v2.0/general/Nuclides.python.cpp" +#include "v2.0/general/OrphanProduct.python.cpp" +#include "v2.0/general/OrphanProducts.python.cpp" +#include "v2.0/general/OutputChannel.python.cpp" +#include "v2.0/general/ParameterCovariance.python.cpp" +#include "v2.0/general/ParameterCovarianceMatrix.python.cpp" +#include "v2.0/general/ParameterCovariances.python.cpp" +#include "v2.0/general/ParameterLink.python.cpp" +#include "v2.0/general/Parameters.python.cpp" +#include "v2.0/general/Parity.python.cpp" +#include "v2.0/general/PhotonEmissionProbabilities.python.cpp" +#include "v2.0/general/Polynomial1d.python.cpp" +#include "v2.0/general/PositronEmissionIntensity.python.cpp" +#include "v2.0/general/PrimaryGamma.python.cpp" +#include "v2.0/general/Probability.python.cpp" +#include "v2.0/general/Product.python.cpp" +#include "v2.0/general/ProductYield.python.cpp" +#include "v2.0/general/ProductYields.python.cpp" +#include "v2.0/general/Production.python.cpp" +#include "v2.0/general/Productions.python.cpp" +#include "v2.0/general/Products.python.cpp" +#include "v2.0/general/ProjectileEnergyDomain.python.cpp" +#include "v2.0/general/PromptGammaEnergy.python.cpp" +#include "v2.0/general/PromptNeutronKE.python.cpp" +#include "v2.0/general/PromptProductKE.python.cpp" +#include "v2.0/general/Q.python.cpp" +#include "v2.0/general/R.python.cpp" +#include "v2.0/general/RMatrix.python.cpp" +#include "v2.0/general/Rate.python.cpp" +#include "v2.0/general/Reaction.python.cpp" +#include "v2.0/general/Reactions.python.cpp" +#include "v2.0/general/RealAnomalousFactor.python.cpp" +#include "v2.0/general/RealInterferenceTerm.python.cpp" +#include "v2.0/general/Recoil.python.cpp" +#include "v2.0/general/Reference.python.cpp" +#include "v2.0/general/Regions1d.python.cpp" +#include "v2.0/general/Regions2d.python.cpp" +#include "v2.0/general/Resolved.python.cpp" +#include "v2.0/general/ResolvedRegion.python.cpp" +#include "v2.0/general/ResonanceParameters.python.cpp" +#include "v2.0/general/ResonanceReaction.python.cpp" +#include "v2.0/general/ResonanceReactions.python.cpp" +#include "v2.0/general/Resonances.python.cpp" +#include "v2.0/general/ResonancesWithBackground.python.cpp" +#include "v2.0/general/RowData.python.cpp" +#include "v2.0/general/RutherfordScattering.python.cpp" +#include "v2.0/general/SCTApproximation.python.cpp" +#include "v2.0/general/S_table.python.cpp" +#include "v2.0/general/ScatteringAtom.python.cpp" +#include "v2.0/general/ScatteringAtoms.python.cpp" +#include "v2.0/general/ScatteringFactor.python.cpp" +#include "v2.0/general/ScatteringRadius.python.cpp" +#include "v2.0/general/SelfScatteringKernel.python.cpp" +#include "v2.0/general/Shell.python.cpp" +#include "v2.0/general/ShortRangeSelfScalingVariance.python.cpp" +#include "v2.0/general/SimpleMaxwellianFission.python.cpp" +#include "v2.0/general/Slice.python.cpp" +#include "v2.0/general/Slices.python.cpp" +#include "v2.0/general/Spectra.python.cpp" +#include "v2.0/general/Spectrum.python.cpp" +#include "v2.0/general/Spin.python.cpp" +#include "v2.0/general/SpinGroup.python.cpp" +#include "v2.0/general/SpinGroups.python.cpp" +#include "v2.0/general/Standard.python.cpp" +#include "v2.0/general/String.python.cpp" +#include "v2.0/general/Styles.python.cpp" +#include "v2.0/general/Sum.python.cpp" +#include "v2.0/general/Summand.python.cpp" +#include "v2.0/general/Summands.python.cpp" +#include "v2.0/general/Sums.python.cpp" +#include "v2.0/general/T_M.python.cpp" +#include "v2.0/general/T_effective.python.cpp" +#include "v2.0/general/Table.python.cpp" +#include "v2.0/general/TabulatedWidths.python.cpp" +#include "v2.0/general/Temperature.python.cpp" +#include "v2.0/general/ThermalNeutronScatteringLaw.python.cpp" +#include "v2.0/general/ThermalNeutronScatteringLaw1d.python.cpp" +#include "v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.python.cpp" +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp" +#include "v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp" +#include "v2.0/general/Theta.python.cpp" +#include "v2.0/general/Time.python.cpp" +#include "v2.0/general/Title.python.cpp" +#include "v2.0/general/TotalEnergy.python.cpp" +#include "v2.0/general/U.python.cpp" +#include "v2.0/general/Uncertainty.python.cpp" +#include "v2.0/general/Uncorrelated.python.cpp" +#include "v2.0/general/Unorthodox.python.cpp" +#include "v2.0/general/Unorthodoxes.python.cpp" +#include "v2.0/general/Unresolved.python.cpp" +#include "v2.0/general/UnresolvedRegion.python.cpp" +#include "v2.0/general/Unspecified.python.cpp" +#include "v2.0/general/Values.python.cpp" +#include "v2.0/general/Weighted.python.cpp" +#include "v2.0/general/WeightedFunctionals.python.cpp" +#include "v2.0/general/Width.python.cpp" +#include "v2.0/general/Widths.python.cpp" +#include "v2.0/general/XYs1d.python.cpp" +#include "v2.0/general/XYs2d.python.cpp" +#include "v2.0/general/XYs3d.python.cpp" +#include "v2.0/general/Yields.python.cpp" + +// namespace reduced +#include "v2.0/reduced.python.cpp" +#include "v2.0/reduced/CrossSection.python.cpp" +#include "v2.0/reduced/Distribution.python.cpp" +#include "v2.0/reduced/Double.python.cpp" +#include "v2.0/reduced/Function1ds.python.cpp" +#include "v2.0/reduced/Nuclides.python.cpp" +#include "v2.0/reduced/OutputChannel.python.cpp" +#include "v2.0/reduced/Polynomial1d.python.cpp" +#include "v2.0/reduced/Product.python.cpp" +#include "v2.0/reduced/Products.python.cpp" + +// namespace top +#include "v2.0/top.python.cpp" +#include "v2.0/top/CovarianceSuite.python.cpp" +#include "v2.0/top/FissionFragmentData.python.cpp" +#include "v2.0/top/PoPs.python.cpp" +#include "v2.0/top/ReactionSuite.python.cpp" diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0.python.cpp new file mode 100644 index 000000000..c6eea2ce5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include +#include + +// project GNDS +namespace python_GNDS { + + // version v2.0: enum wrapper declarations + namespace python_v2_0 { + namespace python_enums { + void wrapBoundaryCondition(pybind11::module &); + void wrapContributorType(pybind11::module &); + void wrapDateType(pybind11::module &); + void wrapDecayType(pybind11::module &); + void wrapEncoding(pybind11::module &); + void wrapEnergy(pybind11::module &); + void wrapFrame(pybind11::module &); + void wrapGridStyle(pybind11::module &); + void wrapHashAlgorithm(pybind11::module &); + void wrapInteraction(pybind11::module &); + void wrapInterpolation(pybind11::module &); + void wrapInterpolationQualifier(pybind11::module &); + void wrapLength(pybind11::module &); + void wrapParity(pybind11::module &); + void wrapRelationType(pybind11::module &); + void wrapStorageOrder(pybind11::module &); + } // namespace python_enums + } // namespace python_v2_0 + + // version v2.0: namespace wrapper declarations + namespace python_v2_0 { + void wrapG2d(pybind11::module &); + void wrapG3d(pybind11::module &); + void wrapGeneral(pybind11::module &); + void wrapReduced(pybind11::module &); + void wrapTop(pybind11::module &); + } // namespace python_v2_0 + + // version v2.0: wrapper + void wrapV2_0(pybind11::module &module) + { + // v2.0 + pybind11::module submodule = module.def_submodule( + "v2_0", + "GNDS v2.0" + ); + + // v2.0 enumerations + python_v2_0::python_enums::wrapBoundaryCondition(submodule); + python_v2_0::python_enums::wrapContributorType(submodule); + python_v2_0::python_enums::wrapDateType(submodule); + python_v2_0::python_enums::wrapDecayType(submodule); + python_v2_0::python_enums::wrapEncoding(submodule); + python_v2_0::python_enums::wrapEnergy(submodule); + python_v2_0::python_enums::wrapFrame(submodule); + python_v2_0::python_enums::wrapGridStyle(submodule); + python_v2_0::python_enums::wrapHashAlgorithm(submodule); + python_v2_0::python_enums::wrapInteraction(submodule); + python_v2_0::python_enums::wrapInterpolation(submodule); + python_v2_0::python_enums::wrapInterpolationQualifier(submodule); + python_v2_0::python_enums::wrapLength(submodule); + python_v2_0::python_enums::wrapParity(submodule); + python_v2_0::python_enums::wrapRelationType(submodule); + python_v2_0::python_enums::wrapStorageOrder(submodule); + + // v2.0 namespaces + python_v2_0::wrapG2d(submodule); + python_v2_0::wrapG3d(submodule); + python_v2_0::wrapGeneral(submodule); + python_v2_0::wrapReduced(submodule); + python_v2_0::wrapTop(submodule); + } + +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/g2d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g2d.python.cpp new file mode 100644 index 000000000..fcc259dfd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g2d.python.cpp @@ -0,0 +1,33 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include +#include + +// project GNDS +// version v2.0 +namespace python_GNDS { +namespace python_v2_0 { + + // namespace g2d: class wrapper declarations + namespace python_g2d { + void wrapArray(pybind11::module &); + } // namespace python_g2d + + // namespace g2d: wrapper + void wrapG2d(pybind11::module &module) + { + // g2d + pybind11::module submodule = module.def_submodule( + "g2d", + "GNDS v2.0 g2d" + ); + + // g2d classes + python_g2d::wrapArray(submodule); + } + +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/g2d/Array.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g2d/Array.python.cpp new file mode 100644 index 000000000..8dc3fafd5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g2d/Array.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/g2d/Array.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_g2d { + +// wrapper for g2d::Array +void wrapArray(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = g2d::Array; + + // create the Python object + pybind11::class_ object( + module, "Array", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const std::optional &, + const general::Values & + >(), + pybind11::arg("shape"), + pybind11::arg("compression") = std::nullopt, + pybind11::arg("symmetry") = std::nullopt, + pybind11::arg("values"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set shape + object.def_property( + "shape", + [](const cppCLASS &self) -> decltype(auto) + { + return self.shape(); + }, + [](cppCLASS &self, const std::string &value) + { + self.shape() = value; + }, + cppCLASS::component_t::documentation("shape").data() + ); + + // get/set compression + object.def_property( + "compression", + [](const cppCLASS &self) -> decltype(auto) + { + return self.compression(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.compression() = value; + }, + cppCLASS::component_t::documentation("compression").data() + ); + + // get/set symmetry + object.def_property( + "symmetry", + [](const cppCLASS &self) -> decltype(auto) + { + return self.symmetry(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.symmetry() = value; + }, + cppCLASS::component_t::documentation("symmetry").data() + ); + + // get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const general::Values &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_g2d +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d.python.cpp new file mode 100644 index 000000000..bacb037ba --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d.python.cpp @@ -0,0 +1,37 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include +#include + +// project GNDS +// version v2.0 +namespace python_GNDS { +namespace python_v2_0 { + + // namespace g3d: class wrapper declarations + namespace python_g3d { + void wrapStarts(pybind11::module &); + void wrapLengths(pybind11::module &); + void wrapArray(pybind11::module &); + } // namespace python_g3d + + // namespace g3d: wrapper + void wrapG3d(pybind11::module &module) + { + // g3d + pybind11::module submodule = module.def_submodule( + "g3d", + "GNDS v2.0 g3d" + ); + + // g3d classes + python_g3d::wrapStarts(submodule); + python_g3d::wrapLengths(submodule); + python_g3d::wrapArray(submodule); + } + +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Array.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Array.python.cpp new file mode 100644 index 000000000..dccdd5364 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Array.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/g3d/Array.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_g3d { + +// wrapper for g3d::Array +void wrapArray(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = g3d::Array; + + // create the Python object + pybind11::class_ object( + module, "Array", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const general::Values & + >(), + pybind11::arg("shape"), + pybind11::arg("compression") = std::nullopt, + pybind11::arg("symmetry") = std::nullopt, + pybind11::arg("starts") = std::nullopt, + pybind11::arg("lengths") = std::nullopt, + pybind11::arg("values"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set shape + object.def_property( + "shape", + [](const cppCLASS &self) -> decltype(auto) + { + return self.shape(); + }, + [](cppCLASS &self, const std::string &value) + { + self.shape() = value; + }, + cppCLASS::component_t::documentation("shape").data() + ); + + // get/set compression + object.def_property( + "compression", + [](const cppCLASS &self) -> decltype(auto) + { + return self.compression(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.compression() = value; + }, + cppCLASS::component_t::documentation("compression").data() + ); + + // get/set symmetry + object.def_property( + "symmetry", + [](const cppCLASS &self) -> decltype(auto) + { + return self.symmetry(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.symmetry() = value; + }, + cppCLASS::component_t::documentation("symmetry").data() + ); + + // get/set starts + object.def_property( + "starts", + [](const cppCLASS &self) -> decltype(auto) + { + return self.starts(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.starts() = value; + }, + cppCLASS::component_t::documentation("starts").data() + ); + + // get/set lengths + object.def_property( + "lengths", + [](const cppCLASS &self) -> decltype(auto) + { + return self.lengths(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.lengths() = value; + }, + cppCLASS::component_t::documentation("lengths").data() + ); + + // get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const general::Values &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_g3d +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Lengths.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Lengths.python.cpp new file mode 100644 index 000000000..8e50a8f43 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Lengths.python.cpp @@ -0,0 +1,101 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/g3d/Lengths.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_g3d { + +// wrapper for g3d::Lengths +void wrapLengths(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = g3d::Lengths; + + // create the Python object + pybind11::class_ object( + module, "Lengths", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string & + >(), + pybind11::arg("value_type"), + pybind11::arg("label"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set valueType + object.def_property( + "value_type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.valueType(); + }, + [](cppCLASS &self, const std::string &value) + { + self.valueType() = value; + }, + cppCLASS::component_t::documentation("value_type").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set vector + object.def_property( + "ints", + [](const cppCLASS &self) -> const std::vector & + { + return self; + }, + [](cppCLASS &self, const std::vector &value) + { + self = value; + }, + cppCLASS::component_t::documentation("ints").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_g3d +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Starts.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Starts.python.cpp new file mode 100644 index 000000000..cd4c70593 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/g3d/Starts.python.cpp @@ -0,0 +1,101 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/g3d/Starts.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_g3d { + +// wrapper for g3d::Starts +void wrapStarts(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = g3d::Starts; + + // create the Python object + pybind11::class_ object( + module, "Starts", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string & + >(), + pybind11::arg("value_type"), + pybind11::arg("label"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("ints"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set valueType + object.def_property( + "value_type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.valueType(); + }, + [](cppCLASS &self, const std::string &value) + { + self.valueType() = value; + }, + cppCLASS::component_t::documentation("value_type").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set vector + object.def_property( + "ints", + [](const cppCLASS &self) -> const std::vector & + { + return self; + }, + [](cppCLASS &self, const std::vector &value) + { + self = value; + }, + cppCLASS::component_t::documentation("ints").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_g3d +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general.python.cpp new file mode 100644 index 000000000..f2c1b0276 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general.python.cpp @@ -0,0 +1,517 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include +#include + +// project GNDS +// version v2.0 +namespace python_GNDS { +namespace python_v2_0 { + + // namespace general: class wrapper declarations + namespace python_general { + void wrapAuthor(pybind11::module &); + void wrapAuthors(pybind11::module &); + void wrapDate(pybind11::module &); + void wrapDates(pybind11::module &); + void wrapTitle(pybind11::module &); + void wrapBody(pybind11::module &); + void wrapEndfCompatible(pybind11::module &); + void wrapDocumentation(pybind11::module &); + void wrapTemperature(pybind11::module &); + void wrapProjectileEnergyDomain(pybind11::module &); + void wrapEvaluated(pybind11::module &); + void wrapCrossSectionReconstructed(pybind11::module &); + void wrapStyles(pybind11::module &); + void wrapAlias(pybind11::module &); + void wrapMetaStable(pybind11::module &); + void wrapAliases(pybind11::module &); + void wrapValues(pybind11::module &); + void wrapArray(pybind11::module &); + void wrapCovariance(pybind11::module &); + void wrapStandard(pybind11::module &); + void wrapListOfCovariances(pybind11::module &); + void wrapAxis(pybind11::module &); + void wrapLink(pybind11::module &); + void wrapGrid(pybind11::module &); + void wrapAxes(pybind11::module &); + void wrapUncertainty(pybind11::module &); + void wrapDouble(pybind11::module &); + void wrapMass(pybind11::module &); + void wrapFraction(pybind11::module &); + void wrapSpin(pybind11::module &); + void wrapInteger(pybind11::module &); + void wrapParity(pybind11::module &); + void wrapCharge(pybind11::module &); + void wrapString(pybind11::module &); + void wrapHalflife(pybind11::module &); + void wrapProbability(pybind11::module &); + void wrapConstant1d(pybind11::module &); + void wrapXYs1d(pybind11::module &); + void wrapLegendre(pybind11::module &); + void wrapRegions1d(pybind11::module &); + void wrapPolynomial1d(pybind11::module &); + void wrapReference(pybind11::module &); + void wrapBranching1d(pybind11::module &); + void wrapBranching3d(pybind11::module &); + void wrapUnspecified(pybind11::module &); + void wrapMultiplicity(pybind11::module &); + void wrapThermalNeutronScatteringLaw(pybind11::module &); + void wrapIsotropic2d(pybind11::module &); + void wrapFunction1ds(pybind11::module &); + void wrapXYs2d(pybind11::module &); + void wrapAngular(pybind11::module &); + void wrapNBodyPhaseSpace(pybind11::module &); + void wrapPrimaryGamma(pybind11::module &); + void wrapDiscreteGamma(pybind11::module &); + void wrapU(pybind11::module &); + void wrapTheta(pybind11::module &); + void wrapG(pybind11::module &); + void wrapGeneralEvaporation(pybind11::module &); + void wrapEvaporation(pybind11::module &); + void wrapWeighted(pybind11::module &); + void wrapWeightedFunctionals(pybind11::module &); + void wrapSimpleMaxwellianFission(pybind11::module &); + void wrapEFL(pybind11::module &); + void wrapEFH(pybind11::module &); + void wrapT_M(pybind11::module &); + void wrapMadlandNix(pybind11::module &); + void wrapEnergy(pybind11::module &); + void wrapUncorrelated(pybind11::module &); + void wrapFunction2ds(pybind11::module &); + void wrapRegions2d(pybind11::module &); + void wrapRecoil(pybind11::module &); + void wrapAngularTwoBody(pybind11::module &); + void wrapXYs3d(pybind11::module &); + void wrapEnergyAngular(pybind11::module &); + void wrapF(pybind11::module &); + void wrapR(pybind11::module &); + void wrapKalbachMann(pybind11::module &); + void wrapAngularEnergy(pybind11::module &); + void wrapRutherfordScattering(pybind11::module &); + void wrapNuclearTerm(pybind11::module &); + void wrapRealInterferenceTerm(pybind11::module &); + void wrapImaginaryInterferenceTerm(pybind11::module &); + void wrapNuclearAmplitudeExpansion(pybind11::module &); + void wrapNuclearPlusInterference(pybind11::module &); + void wrapCoulombPlusNuclearElastic(pybind11::module &); + void wrapFormFactor(pybind11::module &); + void wrapRealAnomalousFactor(pybind11::module &); + void wrapImaginaryAnomalousFactor(pybind11::module &); + void wrapCoherentPhotonScattering(pybind11::module &); + void wrapScatteringFactor(pybind11::module &); + void wrapIncoherentPhotonScattering(pybind11::module &); + void wrapDistribution(pybind11::module &); + void wrapQ(pybind11::module &); + void wrapAverageProductEnergy(pybind11::module &); + void wrapProduct(pybind11::module &); + void wrapProducts(pybind11::module &); + void wrapDecay(pybind11::module &); + void wrapDecayPath(pybind11::module &); + void wrapShell(pybind11::module &); + void wrapPhotonEmissionProbabilities(pybind11::module &); + void wrapIntensity(pybind11::module &); + void wrapInternalConversionCoefficients(pybind11::module &); + void wrapPositronEmissionIntensity(pybind11::module &); + void wrapDiscrete(pybind11::module &); + void wrapContinuum(pybind11::module &); + void wrapSpectrum(pybind11::module &); + void wrapSpectra(pybind11::module &); + void wrapDecayMode(pybind11::module &); + void wrapDecayModes(pybind11::module &); + void wrapAverageEnergy(pybind11::module &); + void wrapAverageEnergies(pybind11::module &); + void wrapDecayData(pybind11::module &); + void wrapBaryon(pybind11::module &); + void wrapBaryons(pybind11::module &); + void wrapBindingEnergy(pybind11::module &); + void wrapConfiguration(pybind11::module &); + void wrapConfigurations(pybind11::module &); + void wrapAtomic(pybind11::module &); + void wrapNucleus(pybind11::module &); + void wrapTime(pybind11::module &); + void wrapYields(pybind11::module &); + void wrapIncidentEnergy(pybind11::module &); + void wrapIncidentEnergies(pybind11::module &); + void wrapElapsedTime(pybind11::module &); + void wrapElapsedTimes(pybind11::module &); + void wrapProductYield(pybind11::module &); + void wrapProductYields(pybind11::module &); + void wrapRate(pybind11::module &); + void wrapDelayedNeutron(pybind11::module &); + void wrapDelayedNeutrons(pybind11::module &); + void wrapPromptProductKE(pybind11::module &); + void wrapPromptNeutronKE(pybind11::module &); + void wrapDelayedNeutronKE(pybind11::module &); + void wrapPromptGammaEnergy(pybind11::module &); + void wrapDelayedGammaEnergy(pybind11::module &); + void wrapDelayedBetaEnergy(pybind11::module &); + void wrapNeutrinoEnergy(pybind11::module &); + void wrapNonNeutrinoEnergy(pybind11::module &); + void wrapTotalEnergy(pybind11::module &); + void wrapFissionEnergyRelease(pybind11::module &); + void wrapFissionEnergyReleases(pybind11::module &); + void wrapNuclide(pybind11::module &); + void wrapNuclides(pybind11::module &); + void wrapIsotope(pybind11::module &); + void wrapIsotopes(pybind11::module &); + void wrapChemicalElement(pybind11::module &); + void wrapChemicalElements(pybind11::module &); + void wrapUnorthodox(pybind11::module &); + void wrapUnorthodoxes(pybind11::module &); + void wrapGaugeBoson(pybind11::module &); + void wrapGaugeBosons(pybind11::module &); + void wrapLepton(pybind11::module &); + void wrapLeptons(pybind11::module &); + void wrapScatteringRadius(pybind11::module &); + void wrapColumn(pybind11::module &); + void wrapColumnHeaders(pybind11::module &); + void wrapData(pybind11::module &); + void wrapTable(pybind11::module &); + void wrapResonanceParameters(pybind11::module &); + void wrapBreitWigner(pybind11::module &); + void wrapHardSphereRadius(pybind11::module &); + void wrapResonanceReaction(pybind11::module &); + void wrapResonanceReactions(pybind11::module &); + void wrapChannel(pybind11::module &); + void wrapChannels(pybind11::module &); + void wrapSpinGroup(pybind11::module &); + void wrapSpinGroups(pybind11::module &); + void wrapRMatrix(pybind11::module &); + void wrapResolved(pybind11::module &); + void wrapLevelSpacing(pybind11::module &); + void wrapWidth(pybind11::module &); + void wrapWidths(pybind11::module &); + void wrapJ(pybind11::module &); + void wrapJs(pybind11::module &); + void wrapL(pybind11::module &); + void wrapLs(pybind11::module &); + void wrapTabulatedWidths(pybind11::module &); + void wrapUnresolved(pybind11::module &); + void wrapResonances(pybind11::module &); + void wrapResolvedRegion(pybind11::module &); + void wrapFastRegion(pybind11::module &); + void wrapUnresolvedRegion(pybind11::module &); + void wrapBackground(pybind11::module &); + void wrapResonancesWithBackground(pybind11::module &); + void wrapThermalNeutronScatteringLaw1d(pybind11::module &); + void wrapCrossSection(pybind11::module &); + void wrapOutputChannel(pybind11::module &); + void wrapGridded2d(pybind11::module &); + void wrapS_table(pybind11::module &); + void wrapThermalNeutronScatteringLaw_coherentElastic(pybind11::module &); + void wrapBoundAtomCrossSection(pybind11::module &); + void wrapDebyeWallerIntegral(pybind11::module &); + void wrapThermalNeutronScatteringLaw_incoherentElastic(pybind11::module &); + void wrapE_critical(pybind11::module &); + void wrapE_max(pybind11::module &); + void wrapGridded3d(pybind11::module &); + void wrapSCTApproximation(pybind11::module &); + void wrapFreeGasApproximation(pybind11::module &); + void wrapSelfScatteringKernel(pybind11::module &); + void wrapT_effective(pybind11::module &); + void wrapScatteringAtom(pybind11::module &); + void wrapScatteringAtoms(pybind11::module &); + void wrapThermalNeutronScatteringLaw_incoherentInelastic(pybind11::module &); + void wrapDoubleDifferentialCrossSection(pybind11::module &); + void wrapReaction(pybind11::module &); + void wrapReactions(pybind11::module &); + void wrapConversion(pybind11::module &); + void wrapENDFconversionFlags(pybind11::module &); + void wrapInstitution(pybind11::module &); + void wrapApplicationData(pybind11::module &); + void wrapExternalFile(pybind11::module &); + void wrapExternalFiles(pybind11::module &); + void wrapAdd(pybind11::module &); + void wrapSummands(pybind11::module &); + void wrapCrossSectionSum(pybind11::module &); + void wrapCrossSectionSums(pybind11::module &); + void wrapMultiplicitySum(pybind11::module &); + void wrapMultiplicitySums(pybind11::module &); + void wrapSums(pybind11::module &); + void wrapProduction(pybind11::module &); + void wrapProductions(pybind11::module &); + void wrapFissionComponent(pybind11::module &); + void wrapFissionComponents(pybind11::module &); + void wrapOrphanProduct(pybind11::module &); + void wrapOrphanProducts(pybind11::module &); + void wrapIncompleteReactions(pybind11::module &); + void wrapSlice(pybind11::module &); + void wrapSlices(pybind11::module &); + void wrapRowData(pybind11::module &); + void wrapColumnData(pybind11::module &); + void wrapCovarianceMatrix(pybind11::module &); + void wrapSummand(pybind11::module &); + void wrapSum(pybind11::module &); + void wrapShortRangeSelfScalingVariance(pybind11::module &); + void wrapMixed(pybind11::module &); + void wrapCovarianceSection(pybind11::module &); + void wrapCovarianceSections(pybind11::module &); + void wrapParameterLink(pybind11::module &); + void wrapParameters(pybind11::module &); + void wrapParameterCovarianceMatrix(pybind11::module &); + void wrapParameterCovariance(pybind11::module &); + void wrapAverageParameterCovariance(pybind11::module &); + void wrapParameterCovariances(pybind11::module &); + } // namespace python_general + + // namespace general: wrapper + void wrapGeneral(pybind11::module &module) + { + // general + pybind11::module submodule = module.def_submodule( + "general", + "GNDS v2.0 general" + ); + + // general classes + python_general::wrapAuthor(submodule); + python_general::wrapAuthors(submodule); + python_general::wrapDate(submodule); + python_general::wrapDates(submodule); + python_general::wrapTitle(submodule); + python_general::wrapBody(submodule); + python_general::wrapEndfCompatible(submodule); + python_general::wrapDocumentation(submodule); + python_general::wrapTemperature(submodule); + python_general::wrapProjectileEnergyDomain(submodule); + python_general::wrapEvaluated(submodule); + python_general::wrapCrossSectionReconstructed(submodule); + python_general::wrapStyles(submodule); + python_general::wrapAlias(submodule); + python_general::wrapMetaStable(submodule); + python_general::wrapAliases(submodule); + python_general::wrapValues(submodule); + python_general::wrapArray(submodule); + python_general::wrapCovariance(submodule); + python_general::wrapStandard(submodule); + python_general::wrapListOfCovariances(submodule); + python_general::wrapAxis(submodule); + python_general::wrapLink(submodule); + python_general::wrapGrid(submodule); + python_general::wrapAxes(submodule); + python_general::wrapUncertainty(submodule); + python_general::wrapDouble(submodule); + python_general::wrapMass(submodule); + python_general::wrapFraction(submodule); + python_general::wrapSpin(submodule); + python_general::wrapInteger(submodule); + python_general::wrapParity(submodule); + python_general::wrapCharge(submodule); + python_general::wrapString(submodule); + python_general::wrapHalflife(submodule); + python_general::wrapProbability(submodule); + python_general::wrapConstant1d(submodule); + python_general::wrapXYs1d(submodule); + python_general::wrapLegendre(submodule); + python_general::wrapRegions1d(submodule); + python_general::wrapPolynomial1d(submodule); + python_general::wrapReference(submodule); + python_general::wrapBranching1d(submodule); + python_general::wrapBranching3d(submodule); + python_general::wrapUnspecified(submodule); + python_general::wrapMultiplicity(submodule); + python_general::wrapThermalNeutronScatteringLaw(submodule); + python_general::wrapIsotropic2d(submodule); + python_general::wrapFunction1ds(submodule); + python_general::wrapXYs2d(submodule); + python_general::wrapAngular(submodule); + python_general::wrapNBodyPhaseSpace(submodule); + python_general::wrapPrimaryGamma(submodule); + python_general::wrapDiscreteGamma(submodule); + python_general::wrapU(submodule); + python_general::wrapTheta(submodule); + python_general::wrapG(submodule); + python_general::wrapGeneralEvaporation(submodule); + python_general::wrapEvaporation(submodule); + python_general::wrapWeighted(submodule); + python_general::wrapWeightedFunctionals(submodule); + python_general::wrapSimpleMaxwellianFission(submodule); + python_general::wrapEFL(submodule); + python_general::wrapEFH(submodule); + python_general::wrapT_M(submodule); + python_general::wrapMadlandNix(submodule); + python_general::wrapEnergy(submodule); + python_general::wrapUncorrelated(submodule); + python_general::wrapFunction2ds(submodule); + python_general::wrapRegions2d(submodule); + python_general::wrapRecoil(submodule); + python_general::wrapAngularTwoBody(submodule); + python_general::wrapXYs3d(submodule); + python_general::wrapEnergyAngular(submodule); + python_general::wrapF(submodule); + python_general::wrapR(submodule); + python_general::wrapKalbachMann(submodule); + python_general::wrapAngularEnergy(submodule); + python_general::wrapRutherfordScattering(submodule); + python_general::wrapNuclearTerm(submodule); + python_general::wrapRealInterferenceTerm(submodule); + python_general::wrapImaginaryInterferenceTerm(submodule); + python_general::wrapNuclearAmplitudeExpansion(submodule); + python_general::wrapNuclearPlusInterference(submodule); + python_general::wrapCoulombPlusNuclearElastic(submodule); + python_general::wrapFormFactor(submodule); + python_general::wrapRealAnomalousFactor(submodule); + python_general::wrapImaginaryAnomalousFactor(submodule); + python_general::wrapCoherentPhotonScattering(submodule); + python_general::wrapScatteringFactor(submodule); + python_general::wrapIncoherentPhotonScattering(submodule); + python_general::wrapDistribution(submodule); + python_general::wrapQ(submodule); + python_general::wrapAverageProductEnergy(submodule); + python_general::wrapProduct(submodule); + python_general::wrapProducts(submodule); + python_general::wrapDecay(submodule); + python_general::wrapDecayPath(submodule); + python_general::wrapShell(submodule); + python_general::wrapPhotonEmissionProbabilities(submodule); + python_general::wrapIntensity(submodule); + python_general::wrapInternalConversionCoefficients(submodule); + python_general::wrapPositronEmissionIntensity(submodule); + python_general::wrapDiscrete(submodule); + python_general::wrapContinuum(submodule); + python_general::wrapSpectrum(submodule); + python_general::wrapSpectra(submodule); + python_general::wrapDecayMode(submodule); + python_general::wrapDecayModes(submodule); + python_general::wrapAverageEnergy(submodule); + python_general::wrapAverageEnergies(submodule); + python_general::wrapDecayData(submodule); + python_general::wrapBaryon(submodule); + python_general::wrapBaryons(submodule); + python_general::wrapBindingEnergy(submodule); + python_general::wrapConfiguration(submodule); + python_general::wrapConfigurations(submodule); + python_general::wrapAtomic(submodule); + python_general::wrapNucleus(submodule); + python_general::wrapTime(submodule); + python_general::wrapYields(submodule); + python_general::wrapIncidentEnergy(submodule); + python_general::wrapIncidentEnergies(submodule); + python_general::wrapElapsedTime(submodule); + python_general::wrapElapsedTimes(submodule); + python_general::wrapProductYield(submodule); + python_general::wrapProductYields(submodule); + python_general::wrapRate(submodule); + python_general::wrapDelayedNeutron(submodule); + python_general::wrapDelayedNeutrons(submodule); + python_general::wrapPromptProductKE(submodule); + python_general::wrapPromptNeutronKE(submodule); + python_general::wrapDelayedNeutronKE(submodule); + python_general::wrapPromptGammaEnergy(submodule); + python_general::wrapDelayedGammaEnergy(submodule); + python_general::wrapDelayedBetaEnergy(submodule); + python_general::wrapNeutrinoEnergy(submodule); + python_general::wrapNonNeutrinoEnergy(submodule); + python_general::wrapTotalEnergy(submodule); + python_general::wrapFissionEnergyRelease(submodule); + python_general::wrapFissionEnergyReleases(submodule); + python_general::wrapNuclide(submodule); + python_general::wrapNuclides(submodule); + python_general::wrapIsotope(submodule); + python_general::wrapIsotopes(submodule); + python_general::wrapChemicalElement(submodule); + python_general::wrapChemicalElements(submodule); + python_general::wrapUnorthodox(submodule); + python_general::wrapUnorthodoxes(submodule); + python_general::wrapGaugeBoson(submodule); + python_general::wrapGaugeBosons(submodule); + python_general::wrapLepton(submodule); + python_general::wrapLeptons(submodule); + python_general::wrapScatteringRadius(submodule); + python_general::wrapColumn(submodule); + python_general::wrapColumnHeaders(submodule); + python_general::wrapData(submodule); + python_general::wrapTable(submodule); + python_general::wrapResonanceParameters(submodule); + python_general::wrapBreitWigner(submodule); + python_general::wrapHardSphereRadius(submodule); + python_general::wrapResonanceReaction(submodule); + python_general::wrapResonanceReactions(submodule); + python_general::wrapChannel(submodule); + python_general::wrapChannels(submodule); + python_general::wrapSpinGroup(submodule); + python_general::wrapSpinGroups(submodule); + python_general::wrapRMatrix(submodule); + python_general::wrapResolved(submodule); + python_general::wrapLevelSpacing(submodule); + python_general::wrapWidth(submodule); + python_general::wrapWidths(submodule); + python_general::wrapJ(submodule); + python_general::wrapJs(submodule); + python_general::wrapL(submodule); + python_general::wrapLs(submodule); + python_general::wrapTabulatedWidths(submodule); + python_general::wrapUnresolved(submodule); + python_general::wrapResonances(submodule); + python_general::wrapResolvedRegion(submodule); + python_general::wrapFastRegion(submodule); + python_general::wrapUnresolvedRegion(submodule); + python_general::wrapBackground(submodule); + python_general::wrapResonancesWithBackground(submodule); + python_general::wrapThermalNeutronScatteringLaw1d(submodule); + python_general::wrapCrossSection(submodule); + python_general::wrapOutputChannel(submodule); + python_general::wrapGridded2d(submodule); + python_general::wrapS_table(submodule); + python_general::wrapThermalNeutronScatteringLaw_coherentElastic(submodule); + python_general::wrapBoundAtomCrossSection(submodule); + python_general::wrapDebyeWallerIntegral(submodule); + python_general::wrapThermalNeutronScatteringLaw_incoherentElastic(submodule); + python_general::wrapE_critical(submodule); + python_general::wrapE_max(submodule); + python_general::wrapGridded3d(submodule); + python_general::wrapSCTApproximation(submodule); + python_general::wrapFreeGasApproximation(submodule); + python_general::wrapSelfScatteringKernel(submodule); + python_general::wrapT_effective(submodule); + python_general::wrapScatteringAtom(submodule); + python_general::wrapScatteringAtoms(submodule); + python_general::wrapThermalNeutronScatteringLaw_incoherentInelastic(submodule); + python_general::wrapDoubleDifferentialCrossSection(submodule); + python_general::wrapReaction(submodule); + python_general::wrapReactions(submodule); + python_general::wrapConversion(submodule); + python_general::wrapENDFconversionFlags(submodule); + python_general::wrapInstitution(submodule); + python_general::wrapApplicationData(submodule); + python_general::wrapExternalFile(submodule); + python_general::wrapExternalFiles(submodule); + python_general::wrapAdd(submodule); + python_general::wrapSummands(submodule); + python_general::wrapCrossSectionSum(submodule); + python_general::wrapCrossSectionSums(submodule); + python_general::wrapMultiplicitySum(submodule); + python_general::wrapMultiplicitySums(submodule); + python_general::wrapSums(submodule); + python_general::wrapProduction(submodule); + python_general::wrapProductions(submodule); + python_general::wrapFissionComponent(submodule); + python_general::wrapFissionComponents(submodule); + python_general::wrapOrphanProduct(submodule); + python_general::wrapOrphanProducts(submodule); + python_general::wrapIncompleteReactions(submodule); + python_general::wrapSlice(submodule); + python_general::wrapSlices(submodule); + python_general::wrapRowData(submodule); + python_general::wrapColumnData(submodule); + python_general::wrapCovarianceMatrix(submodule); + python_general::wrapSummand(submodule); + python_general::wrapSum(submodule); + python_general::wrapShortRangeSelfScalingVariance(submodule); + python_general::wrapMixed(submodule); + python_general::wrapCovarianceSection(submodule); + python_general::wrapCovarianceSections(submodule); + python_general::wrapParameterLink(submodule); + python_general::wrapParameters(submodule); + python_general::wrapParameterCovarianceMatrix(submodule); + python_general::wrapParameterCovariance(submodule); + python_general::wrapAverageParameterCovariance(submodule); + python_general::wrapParameterCovariances(submodule); + } + +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Add.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Add.python.cpp new file mode 100644 index 000000000..fae879dd8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Add.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Add.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Add +void wrapAdd(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Add; + + // create the Python object + pybind11::class_ object( + module, "Add", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string & + >(), + pybind11::arg("href"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Alias.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Alias.python.cpp new file mode 100644 index 000000000..eecf99dfa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Alias.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Alias.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Alias +void wrapAlias(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Alias; + + // create the Python object + pybind11::class_ object( + module, "Alias", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("id") = std::nullopt, + pybind11::arg("pid") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set id + object.def_property( + "id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.id(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Aliases.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Aliases.python.cpp new file mode 100644 index 000000000..6e479b152 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Aliases.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Aliases.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Aliases +void wrapAliases(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Aliases; + + // create the Python object + pybind11::class_ object( + module, "Aliases", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional> &, + const std::optional> & + >(), + pybind11::arg("alias") = std::nullopt, + pybind11::arg("meta_stable") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set alias + object.def_property( + "alias", + [](const cppCLASS &self) -> decltype(auto) + { + return self.alias(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.alias() = value; + }, + cppCLASS::component_t::documentation("alias").data() + ); + + // get/set metaStable + object.def_property( + "meta_stable", + [](const cppCLASS &self) -> decltype(auto) + { + return self.metaStable(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.metaStable() = value; + }, + cppCLASS::component_t::documentation("meta_stable").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Angular.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Angular.python.cpp new file mode 100644 index 000000000..349c5aa90 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Angular.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Angular.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Angular +void wrapAngular(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Angular; + + // create the Python object + pybind11::class_ object( + module, "Angular", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("isotropic2d") = std::nullopt, + pybind11::arg("xys2d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set isotropic2d + object.def_property( + "isotropic2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.isotropic2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.isotropic2d() = value; + }, + cppCLASS::component_t::documentation("isotropic2d").data() + ); + + // get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AngularEnergy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AngularEnergy.python.cpp new file mode 100644 index 000000000..e39ae8bca --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AngularEnergy.python.cpp @@ -0,0 +1,122 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/AngularEnergy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AngularEnergy +void wrapAngularEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::AngularEnergy; + + // create the Python object + pybind11::class_ object( + module, "AngularEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const general::XYs3d & + >(), + pybind11::arg("label"), + pybind11::arg("product_frame"), + pybind11::arg("xys3d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::string &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set XYs3d + object.def_property( + "xys3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs3d(); + }, + [](cppCLASS &self, const general::XYs3d &value) + { + self.XYs3d() = value; + }, + cppCLASS::component_t::documentation("xys3d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set function2ds + object.def_property( + "function2ds", + [](const cppCLASS &self) -> decltype(auto) + { + return self.function2ds(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.function2ds() = value; + }, + cppCLASS::component_t::documentation("function2ds").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AngularTwoBody.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AngularTwoBody.python.cpp new file mode 100644 index 000000000..bf287b3e1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AngularTwoBody.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/AngularTwoBody.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AngularTwoBody +void wrapAngularTwoBody(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::AngularTwoBody; + + // create the Python object + pybind11::class_ object( + module, "AngularTwoBody", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("product_frame"), + pybind11::arg("xys2d") = std::nullopt, + pybind11::arg("regions2d") = std::nullopt, + pybind11::arg("recoil") = std::nullopt, + pybind11::arg("isotropic2d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::string &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // get/set regions2d + object.def_property( + "regions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions2d() = value; + }, + cppCLASS::component_t::documentation("regions2d").data() + ); + + // get/set recoil + object.def_property( + "recoil", + [](const cppCLASS &self) -> decltype(auto) + { + return self.recoil(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.recoil() = value; + }, + cppCLASS::component_t::documentation("recoil").data() + ); + + // get/set isotropic2d + object.def_property( + "isotropic2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.isotropic2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.isotropic2d() = value; + }, + cppCLASS::component_t::documentation("isotropic2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ApplicationData.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ApplicationData.python.cpp new file mode 100644 index 000000000..c52a0322e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ApplicationData.python.cpp @@ -0,0 +1,90 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ApplicationData.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ApplicationData +void wrapApplicationData(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ApplicationData; + + // create the Python object + pybind11::class_ object( + module, "ApplicationData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Institution & + >(), + pybind11::arg("institution"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set institution + object.def_property( + "institution", + [](const cppCLASS &self) -> decltype(auto) + { + return self.institution(); + }, + [](cppCLASS &self, const general::Institution &value) + { + self.institution() = value; + }, + cppCLASS::component_t::documentation("institution").data() + ); + + // shortcut: get/set ENDFconversionFlags + object.def_property( + "endfconversion_flags", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDFconversionFlags(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.ENDFconversionFlags() = value; + }, + cppCLASS::component_t::documentation("endfconversion_flags").data() + ); + + // shortcut: get/set conversion + object.def_property( + "conversion", + [](const cppCLASS &self) -> decltype(auto) + { + return self.conversion(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.conversion() = value; + }, + cppCLASS::component_t::documentation("conversion").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Array.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Array.python.cpp new file mode 100644 index 000000000..39a43c9d9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Array.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Array.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Array +void wrapArray(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Array; + + // create the Python object + pybind11::class_ object( + module, "Array", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const general::Values & + >(), + pybind11::arg("shape"), + pybind11::arg("compression") = std::nullopt, + pybind11::arg("values"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set shape + object.def_property( + "shape", + [](const cppCLASS &self) -> decltype(auto) + { + return self.shape(); + }, + [](cppCLASS &self, const std::string &value) + { + self.shape() = value; + }, + cppCLASS::component_t::documentation("shape").data() + ); + + // get/set compression + object.def_property( + "compression", + [](const cppCLASS &self) -> decltype(auto) + { + return self.compression(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.compression() = value; + }, + cppCLASS::component_t::documentation("compression").data() + ); + + // get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const general::Values &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Atomic.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Atomic.python.cpp new file mode 100644 index 000000000..3354f2d92 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Atomic.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Atomic.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Atomic +void wrapAtomic(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Atomic; + + // create the Python object + pybind11::class_ object( + module, "Atomic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Configurations & + >(), + pybind11::arg("configurations"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set configurations + object.def_property( + "configurations", + [](const cppCLASS &self) -> decltype(auto) + { + return self.configurations(); + }, + [](cppCLASS &self, const general::Configurations &value) + { + self.configurations() = value; + }, + cppCLASS::component_t::documentation("configurations").data() + ); + + // shortcut: get/set configuration + object.def_property( + "configuration", + [](const cppCLASS &self) -> decltype(auto) + { + return self.configuration(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.configuration() = value; + }, + cppCLASS::component_t::documentation("configuration").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Author.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Author.python.cpp new file mode 100644 index 000000000..3a81277f4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Author.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Author.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Author +void wrapAuthor(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Author; + + // create the Python object + pybind11::class_ object( + module, "Author", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string & + >(), + pybind11::arg("name"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set name + object.def_property( + "name", + [](const cppCLASS &self) -> decltype(auto) + { + return self.name(); + }, + [](cppCLASS &self, const std::string &value) + { + self.name() = value; + }, + cppCLASS::component_t::documentation("name").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Authors.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Authors.python.cpp new file mode 100644 index 000000000..e9b91c5f4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Authors.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Authors.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Authors +void wrapAuthors(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Authors; + + // create the Python object + pybind11::class_ object( + module, "Authors", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("author"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set author + object.def_property( + "author", + [](const cppCLASS &self) -> decltype(auto) + { + return self.author(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.author() = value; + }, + cppCLASS::component_t::documentation("author").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageEnergies.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageEnergies.python.cpp new file mode 100644 index 000000000..b459ce7fc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageEnergies.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/AverageEnergies.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AverageEnergies +void wrapAverageEnergies(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::AverageEnergies; + + // create the Python object + pybind11::class_ object( + module, "AverageEnergies", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("average_energy"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set averageEnergy + object.def_property( + "average_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.averageEnergy(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.averageEnergy() = value; + }, + cppCLASS::component_t::documentation("average_energy").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageEnergy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageEnergy.python.cpp new file mode 100644 index 000000000..537edf5fa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageEnergy.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/AverageEnergy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AverageEnergy +void wrapAverageEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::AverageEnergy; + + // create the Python object + pybind11::class_ object( + module, "AverageEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const double &, + const std::string &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("value"), + pybind11::arg("unit"), + pybind11::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageParameterCovariance.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageParameterCovariance.python.cpp new file mode 100644 index 000000000..3bf893cad --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageParameterCovariance.python.cpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/AverageParameterCovariance.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AverageParameterCovariance +void wrapAverageParameterCovariance(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::AverageParameterCovariance; + + // create the Python object + pybind11::class_ object( + module, "AverageParameterCovariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const general::CovarianceMatrix &, + const general::RowData &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("cross_term") = std::nullopt, + pybind11::arg("covariance_matrix"), + pybind11::arg("row_data"), + pybind11::arg("column_data") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set crossTerm + object.def_property( + "cross_term", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossTerm(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.crossTerm() = value; + }, + cppCLASS::component_t::documentation("cross_term").data() + ); + + // get/set covarianceMatrix + object.def_property( + "covariance_matrix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.covarianceMatrix(); + }, + [](cppCLASS &self, const general::CovarianceMatrix &value) + { + self.covarianceMatrix() = value; + }, + cppCLASS::component_t::documentation("covariance_matrix").data() + ); + + // get/set rowData + object.def_property( + "row_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.rowData(); + }, + [](cppCLASS &self, const general::RowData &value) + { + self.rowData() = value; + }, + cppCLASS::component_t::documentation("row_data").data() + ); + + // get/set columnData + object.def_property( + "column_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columnData(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.columnData() = value; + }, + cppCLASS::component_t::documentation("column_data").data() + ); + + // shortcut: get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set gridded2d + object.def_property( + "gridded2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.gridded2d() = value; + }, + cppCLASS::component_t::documentation("gridded2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageProductEnergy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageProductEnergy.python.cpp new file mode 100644 index 000000000..992055b24 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/AverageProductEnergy.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/AverageProductEnergy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::AverageProductEnergy +void wrapAverageProductEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::AverageProductEnergy; + + // create the Python object + pybind11::class_ object( + module, "AverageProductEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs1d & + >(), + pybind11::arg("xys1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const general::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Axes.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Axes.python.cpp new file mode 100644 index 000000000..6a6007482 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Axes.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Axes.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Axes +void wrapAxes(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Axes; + + // create the Python object + pybind11::class_ object( + module, "Axes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector &, + const std::optional> & + >(), + pybind11::arg("axis"), + pybind11::arg("grid") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Axis.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Axis.python.cpp new file mode 100644 index 000000000..bb05e2a01 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Axis.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Axis.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Axis +void wrapAxis(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Axis; + + // create the Python object + pybind11::class_ object( + module, "Axis", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const int &, + const std::string &, + const std::string & + >(), + pybind11::arg("index"), + pybind11::arg("label"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set index + object.def_property( + "index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.index(); + }, + [](cppCLASS &self, const int &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Background.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Background.python.cpp new file mode 100644 index 000000000..8005d653b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Background.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Background.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Background +void wrapBackground(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Background; + + // create the Python object + pybind11::class_ object( + module, "Background", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const general::FastRegion &, + const std::optional & + >(), + pybind11::arg("resolved_region") = std::nullopt, + pybind11::arg("fast_region"), + pybind11::arg("unresolved_region") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set resolvedRegion + object.def_property( + "resolved_region", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resolvedRegion(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.resolvedRegion() = value; + }, + cppCLASS::component_t::documentation("resolved_region").data() + ); + + // get/set fastRegion + object.def_property( + "fast_region", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fastRegion(); + }, + [](cppCLASS &self, const general::FastRegion &value) + { + self.fastRegion() = value; + }, + cppCLASS::component_t::documentation("fast_region").data() + ); + + // get/set unresolvedRegion + object.def_property( + "unresolved_region", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unresolvedRegion(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unresolvedRegion() = value; + }, + cppCLASS::component_t::documentation("unresolved_region").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Baryon.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Baryon.python.cpp new file mode 100644 index 000000000..06f4e7a5c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Baryon.python.cpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Baryon.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Baryon +void wrapBaryon(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Baryon; + + // create the Python object + pybind11::class_ object( + module, "Baryon", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const general::Mass &, + const general::Spin &, + const general::Parity &, + const general::Charge &, + const general::Halflife &, + const std::optional & + >(), + pybind11::arg("id"), + pybind11::arg("mass"), + pybind11::arg("spin"), + pybind11::arg("parity"), + pybind11::arg("charge"), + pybind11::arg("halflife"), + pybind11::arg("decay_data") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set id + object.def_property( + "id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.id(); + }, + [](cppCLASS &self, const std::string &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set mass + object.def_property( + "mass", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mass(); + }, + [](cppCLASS &self, const general::Mass &value) + { + self.mass() = value; + }, + cppCLASS::component_t::documentation("mass").data() + ); + + // get/set spin + object.def_property( + "spin", + [](const cppCLASS &self) -> decltype(auto) + { + return self.spin(); + }, + [](cppCLASS &self, const general::Spin &value) + { + self.spin() = value; + }, + cppCLASS::component_t::documentation("spin").data() + ); + + // get/set parity + object.def_property( + "parity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parity(); + }, + [](cppCLASS &self, const general::Parity &value) + { + self.parity() = value; + }, + cppCLASS::component_t::documentation("parity").data() + ); + + // get/set charge + object.def_property( + "charge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.charge(); + }, + [](cppCLASS &self, const general::Charge &value) + { + self.charge() = value; + }, + cppCLASS::component_t::documentation("charge").data() + ); + + // get/set halflife + object.def_property( + "halflife", + [](const cppCLASS &self) -> decltype(auto) + { + return self.halflife(); + }, + [](cppCLASS &self, const general::Halflife &value) + { + self.halflife() = value; + }, + cppCLASS::component_t::documentation("halflife").data() + ); + + // get/set decayData + object.def_property( + "decay_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.decayData(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.decayData() = value; + }, + cppCLASS::component_t::documentation("decay_data").data() + ); + + // shortcut: get/set fraction + object.def_property( + "fraction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fraction(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.fraction() = value; + }, + cppCLASS::component_t::documentation("fraction").data() + ); + + // shortcut: get/set string + object.def_property( + "string", + [](const cppCLASS &self) -> decltype(auto) + { + return self.string(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.string() = value; + }, + cppCLASS::component_t::documentation("string").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Baryons.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Baryons.python.cpp new file mode 100644 index 000000000..fc03b4582 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Baryons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Baryons.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Baryons +void wrapBaryons(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Baryons; + + // create the Python object + pybind11::class_ object( + module, "Baryons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("baryon"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set baryon + object.def_property( + "baryon", + [](const cppCLASS &self) -> decltype(auto) + { + return self.baryon(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.baryon() = value; + }, + cppCLASS::component_t::documentation("baryon").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BindingEnergy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BindingEnergy.python.cpp new file mode 100644 index 000000000..e4786f879 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BindingEnergy.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/BindingEnergy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::BindingEnergy +void wrapBindingEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::BindingEnergy; + + // create the Python object + pybind11::class_ object( + module, "BindingEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Double & + >(), + pybind11::arg("double"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const general::Double &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Body.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Body.python.cpp new file mode 100644 index 000000000..914b93dad --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Body.python.cpp @@ -0,0 +1,60 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Body.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Body +void wrapBody(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Body; + + // create the Python object + pybind11::class_ object( + module, "Body", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set data string + object.def_property( + "string", + [](const cppCLASS &self) -> const std::string & + { + return self; + }, + [](cppCLASS &self, const std::string &value) + { + self = value; + }, + cppCLASS::component_t::documentation("string").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BoundAtomCrossSection.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BoundAtomCrossSection.python.cpp new file mode 100644 index 000000000..d36434af9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BoundAtomCrossSection.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/BoundAtomCrossSection.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::BoundAtomCrossSection +void wrapBoundAtomCrossSection(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::BoundAtomCrossSection; + + // create the Python object + pybind11::class_ object( + module, "BoundAtomCrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const std::string & + >(), + pybind11::arg("value"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Branching1d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Branching1d.python.cpp new file mode 100644 index 000000000..7c8132366 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Branching1d.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Branching1d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Branching1d +void wrapBranching1d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Branching1d; + + // create the Python object + pybind11::class_ object( + module, "Branching1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string & + >(), + pybind11::arg("label"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Branching3d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Branching3d.python.cpp new file mode 100644 index 000000000..f70dfb392 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Branching3d.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Branching3d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Branching3d +void wrapBranching3d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Branching3d; + + // create the Python object + pybind11::class_ object( + module, "Branching3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string & + >(), + pybind11::arg("label"), + pybind11::arg("product_frame"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::string &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BreitWigner.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BreitWigner.python.cpp new file mode 100644 index 000000000..c9d838cd1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/BreitWigner.python.cpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/BreitWigner.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::BreitWigner +void wrapBreitWigner(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::BreitWigner; + + // create the Python object + pybind11::class_ object( + module, "BreitWigner", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::optional &, + const general::ResonanceParameters &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("approximation"), + pybind11::arg("calculate_channel_radius") = std::nullopt, + pybind11::arg("resonance_parameters"), + pybind11::arg("po_ps") = std::nullopt, + pybind11::arg("scattering_radius") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set approximation + object.def_property( + "approximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.approximation(); + }, + [](cppCLASS &self, const std::string &value) + { + self.approximation() = value; + }, + cppCLASS::component_t::documentation("approximation").data() + ); + + // get/set calculateChannelRadius + object.def_property( + "calculate_channel_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.calculateChannelRadius(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.calculateChannelRadius() = value; + }, + cppCLASS::component_t::documentation("calculate_channel_radius").data() + ); + + // get/set resonanceParameters + object.def_property( + "resonance_parameters", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceParameters(); + }, + [](cppCLASS &self, const general::ResonanceParameters &value) + { + self.resonanceParameters() = value; + }, + cppCLASS::component_t::documentation("resonance_parameters").data() + ); + + // get/set PoPs + object.def_property( + "po_ps", + [](const cppCLASS &self) -> decltype(auto) + { + return self.PoPs(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.PoPs() = value; + }, + cppCLASS::component_t::documentation("po_ps").data() + ); + + // get/set scatteringRadius + object.def_property( + "scattering_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringRadius(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.scatteringRadius() = value; + }, + cppCLASS::component_t::documentation("scattering_radius").data() + ); + + // shortcut: get/set columnHeaders + object.def_property( + "column_headers", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columnHeaders(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.columnHeaders() = value; + }, + cppCLASS::component_t::documentation("column_headers").data() + ); + + // shortcut: get/set data + object.def_property( + "data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.data(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.data() = value; + }, + cppCLASS::component_t::documentation("data").data() + ); + + // shortcut: get/set table + object.def_property( + "table", + [](const cppCLASS &self) -> decltype(auto) + { + return self.table(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.table() = value; + }, + cppCLASS::component_t::documentation("table").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Channel.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Channel.python.cpp new file mode 100644 index 000000000..e5148e095 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Channel.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Channel.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Channel +void wrapChannel(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Channel; + + // create the Python object + pybind11::class_ object( + module, "Channel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const int &, + const int &, + const int &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("resonance_reaction"), + pybind11::arg("l"), + pybind11::arg("channel_spin"), + pybind11::arg("column_index"), + pybind11::arg("scattering_radius") = std::nullopt, + pybind11::arg("hard_sphere_radius") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set resonanceReaction + object.def_property( + "resonance_reaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceReaction(); + }, + [](cppCLASS &self, const std::string &value) + { + self.resonanceReaction() = value; + }, + cppCLASS::component_t::documentation("resonance_reaction").data() + ); + + // get/set L + object.def_property( + "l", + [](const cppCLASS &self) -> decltype(auto) + { + return self.L(); + }, + [](cppCLASS &self, const int &value) + { + self.L() = value; + }, + cppCLASS::component_t::documentation("l").data() + ); + + // get/set channelSpin + object.def_property( + "channel_spin", + [](const cppCLASS &self) -> decltype(auto) + { + return self.channelSpin(); + }, + [](cppCLASS &self, const int &value) + { + self.channelSpin() = value; + }, + cppCLASS::component_t::documentation("channel_spin").data() + ); + + // get/set columnIndex + object.def_property( + "column_index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columnIndex(); + }, + [](cppCLASS &self, const int &value) + { + self.columnIndex() = value; + }, + cppCLASS::component_t::documentation("column_index").data() + ); + + // get/set scatteringRadius + object.def_property( + "scattering_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringRadius(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.scatteringRadius() = value; + }, + cppCLASS::component_t::documentation("scattering_radius").data() + ); + + // get/set hardSphereRadius + object.def_property( + "hard_sphere_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.hardSphereRadius(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.hardSphereRadius() = value; + }, + cppCLASS::component_t::documentation("hard_sphere_radius").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Channels.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Channels.python.cpp new file mode 100644 index 000000000..bd2d73549 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Channels.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Channels.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Channels +void wrapChannels(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Channels; + + // create the Python object + pybind11::class_ object( + module, "Channels", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("channel"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set channel + object.def_property( + "channel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.channel(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.channel() = value; + }, + cppCLASS::component_t::documentation("channel").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Charge.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Charge.python.cpp new file mode 100644 index 000000000..4cc9280dd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Charge.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Charge.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Charge +void wrapCharge(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Charge; + + // create the Python object + pybind11::class_ object( + module, "Charge", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Integer & + >(), + pybind11::arg("integer"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set integer + object.def_property( + "integer", + [](const cppCLASS &self) -> decltype(auto) + { + return self.integer(); + }, + [](cppCLASS &self, const general::Integer &value) + { + self.integer() = value; + }, + cppCLASS::component_t::documentation("integer").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ChemicalElement.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ChemicalElement.python.cpp new file mode 100644 index 000000000..0aa51262d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ChemicalElement.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ChemicalElement.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ChemicalElement +void wrapChemicalElement(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ChemicalElement; + + // create the Python object + pybind11::class_ object( + module, "ChemicalElement", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const std::string &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("symbol"), + pybind11::arg("z"), + pybind11::arg("name"), + pybind11::arg("atomic") = std::nullopt, + pybind11::arg("isotopes") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set symbol + object.def_property( + "symbol", + [](const cppCLASS &self) -> decltype(auto) + { + return self.symbol(); + }, + [](cppCLASS &self, const std::string &value) + { + self.symbol() = value; + }, + cppCLASS::component_t::documentation("symbol").data() + ); + + // get/set Z + object.def_property( + "z", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Z(); + }, + [](cppCLASS &self, const int &value) + { + self.Z() = value; + }, + cppCLASS::component_t::documentation("z").data() + ); + + // get/set name + object.def_property( + "name", + [](const cppCLASS &self) -> decltype(auto) + { + return self.name(); + }, + [](cppCLASS &self, const std::string &value) + { + self.name() = value; + }, + cppCLASS::component_t::documentation("name").data() + ); + + // get/set atomic + object.def_property( + "atomic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.atomic(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.atomic() = value; + }, + cppCLASS::component_t::documentation("atomic").data() + ); + + // get/set isotopes + object.def_property( + "isotopes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.isotopes(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.isotopes() = value; + }, + cppCLASS::component_t::documentation("isotopes").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ChemicalElements.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ChemicalElements.python.cpp new file mode 100644 index 000000000..540f5be8c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ChemicalElements.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ChemicalElements.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ChemicalElements +void wrapChemicalElements(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ChemicalElements; + + // create the Python object + pybind11::class_ object( + module, "ChemicalElements", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("chemical_element"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set chemicalElement + object.def_property( + "chemical_element", + [](const cppCLASS &self) -> decltype(auto) + { + return self.chemicalElement(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.chemicalElement() = value; + }, + cppCLASS::component_t::documentation("chemical_element").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CoherentPhotonScattering.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CoherentPhotonScattering.python.cpp new file mode 100644 index 000000000..1902a1480 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CoherentPhotonScattering.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/CoherentPhotonScattering.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CoherentPhotonScattering +void wrapCoherentPhotonScattering(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::CoherentPhotonScattering; + + // create the Python object + pybind11::class_ object( + module, "CoherentPhotonScattering", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("href") = std::nullopt, + pybind11::arg("pid") = std::nullopt, + pybind11::arg("product_frame") = std::nullopt, + pybind11::arg("form_factor") = std::nullopt, + pybind11::arg("real_anomalous_factor") = std::nullopt, + pybind11::arg("imaginary_anomalous_factor") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set formFactor + object.def_property( + "form_factor", + [](const cppCLASS &self) -> decltype(auto) + { + return self.formFactor(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.formFactor() = value; + }, + cppCLASS::component_t::documentation("form_factor").data() + ); + + // get/set realAnomalousFactor + object.def_property( + "real_anomalous_factor", + [](const cppCLASS &self) -> decltype(auto) + { + return self.realAnomalousFactor(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.realAnomalousFactor() = value; + }, + cppCLASS::component_t::documentation("real_anomalous_factor").data() + ); + + // get/set imaginaryAnomalousFactor + object.def_property( + "imaginary_anomalous_factor", + [](const cppCLASS &self) -> decltype(auto) + { + return self.imaginaryAnomalousFactor(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.imaginaryAnomalousFactor() = value; + }, + cppCLASS::component_t::documentation("imaginary_anomalous_factor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Column.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Column.python.cpp new file mode 100644 index 000000000..6f6ad2b14 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Column.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Column.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Column +void wrapColumn(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Column; + + // create the Python object + pybind11::class_ object( + module, "Column", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const int &, + const std::string &, + const std::string & + >(), + pybind11::arg("index"), + pybind11::arg("name"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set index + object.def_property( + "index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.index(); + }, + [](cppCLASS &self, const int &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set name + object.def_property( + "name", + [](const cppCLASS &self) -> decltype(auto) + { + return self.name(); + }, + [](cppCLASS &self, const std::string &value) + { + self.name() = value; + }, + cppCLASS::component_t::documentation("name").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ColumnData.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ColumnData.python.cpp new file mode 100644 index 000000000..aad905267 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ColumnData.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ColumnData.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ColumnData +void wrapColumnData(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ColumnData; + + // create the Python object + pybind11::class_ object( + module, "ColumnData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::string &, + const std::optional & + >(), + pybind11::arg("endf_mfmt") = std::nullopt, + pybind11::arg("href"), + pybind11::arg("slices") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set ENDF_MFMT + object.def_property( + "endf_mfmt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDF_MFMT(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.ENDF_MFMT() = value; + }, + cppCLASS::component_t::documentation("endf_mfmt").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // get/set slices + object.def_property( + "slices", + [](const cppCLASS &self) -> decltype(auto) + { + return self.slices(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.slices() = value; + }, + cppCLASS::component_t::documentation("slices").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ColumnHeaders.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ColumnHeaders.python.cpp new file mode 100644 index 000000000..4c6f44139 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ColumnHeaders.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ColumnHeaders.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ColumnHeaders +void wrapColumnHeaders(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ColumnHeaders; + + // create the Python object + pybind11::class_ object( + module, "ColumnHeaders", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("column"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set column + object.def_property( + "column", + [](const cppCLASS &self) -> decltype(auto) + { + return self.column(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.column() = value; + }, + cppCLASS::component_t::documentation("column").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Configuration.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Configuration.python.cpp new file mode 100644 index 000000000..d08d2c0a9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Configuration.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Configuration.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Configuration +void wrapConfiguration(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Configuration; + + // create the Python object + pybind11::class_ object( + module, "Configuration", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const double &, + const general::BindingEnergy &, + const std::vector & + >(), + pybind11::arg("subshell"), + pybind11::arg("electron_number"), + pybind11::arg("binding_energy"), + pybind11::arg("decay_data"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set subshell + object.def_property( + "subshell", + [](const cppCLASS &self) -> decltype(auto) + { + return self.subshell(); + }, + [](cppCLASS &self, const std::string &value) + { + self.subshell() = value; + }, + cppCLASS::component_t::documentation("subshell").data() + ); + + // get/set electronNumber + object.def_property( + "electron_number", + [](const cppCLASS &self) -> decltype(auto) + { + return self.electronNumber(); + }, + [](cppCLASS &self, const double &value) + { + self.electronNumber() = value; + }, + cppCLASS::component_t::documentation("electron_number").data() + ); + + // get/set bindingEnergy + object.def_property( + "binding_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.bindingEnergy(); + }, + [](cppCLASS &self, const general::BindingEnergy &value) + { + self.bindingEnergy() = value; + }, + cppCLASS::component_t::documentation("binding_energy").data() + ); + + // get/set decayData + object.def_property( + "decay_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.decayData(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.decayData() = value; + }, + cppCLASS::component_t::documentation("decay_data").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Configurations.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Configurations.python.cpp new file mode 100644 index 000000000..60c17c343 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Configurations.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Configurations.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Configurations +void wrapConfigurations(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Configurations; + + // create the Python object + pybind11::class_ object( + module, "Configurations", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("configuration"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set configuration + object.def_property( + "configuration", + [](const cppCLASS &self) -> decltype(auto) + { + return self.configuration(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.configuration() = value; + }, + cppCLASS::component_t::documentation("configuration").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Constant1d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Constant1d.python.cpp new file mode 100644 index 000000000..35e9ec612 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Constant1d.python.cpp @@ -0,0 +1,154 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Constant1d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Constant1d +void wrapConstant1d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Constant1d; + + // create the Python object + pybind11::class_ object( + module, "Constant1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const double &, + const double &, + const double &, + const general::Axes & + >(), + pybind11::arg("label") = std::nullopt, + pybind11::arg("value"), + pybind11::arg("domain_min"), + pybind11::arg("domain_max"), + pybind11::arg("axes"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMin() = value; + }, + cppCLASS::component_t::documentation("domain_min").data() + ); + + // get/set domainMax + object.def_property( + "domain_max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMax(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMax() = value; + }, + cppCLASS::component_t::documentation("domain_max").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const general::Axes &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Continuum.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Continuum.python.cpp new file mode 100644 index 000000000..898d7d169 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Continuum.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Continuum.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Continuum +void wrapContinuum(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Continuum; + + // create the Python object + pybind11::class_ object( + module, "Continuum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs1d & + >(), + pybind11::arg("xys1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const general::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Conversion.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Conversion.python.cpp new file mode 100644 index 000000000..2765f739e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Conversion.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Conversion.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Conversion +void wrapConversion(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Conversion; + + // create the Python object + pybind11::class_ object( + module, "Conversion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string & + >(), + pybind11::arg("flags"), + pybind11::arg("href"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set flags + object.def_property( + "flags", + [](const cppCLASS &self) -> decltype(auto) + { + return self.flags(); + }, + [](cppCLASS &self, const std::string &value) + { + self.flags() = value; + }, + cppCLASS::component_t::documentation("flags").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CoulombPlusNuclearElastic.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CoulombPlusNuclearElastic.python.cpp new file mode 100644 index 000000000..6ccfea760 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CoulombPlusNuclearElastic.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CoulombPlusNuclearElastic +void wrapCoulombPlusNuclearElastic(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::CoulombPlusNuclearElastic; + + // create the Python object + pybind11::class_ object( + module, "CoulombPlusNuclearElastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("href") = std::nullopt, + pybind11::arg("pid") = std::nullopt, + pybind11::arg("product_frame") = std::nullopt, + pybind11::arg("identical_particles") = std::nullopt, + pybind11::arg("rutherford_scattering") = std::nullopt, + pybind11::arg("nuclear_amplitude_expansion") = std::nullopt, + pybind11::arg("nuclear_plus_interference") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set identicalParticles + object.def_property( + "identical_particles", + [](const cppCLASS &self) -> decltype(auto) + { + return self.identicalParticles(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.identicalParticles() = value; + }, + cppCLASS::component_t::documentation("identical_particles").data() + ); + + // get/set RutherfordScattering + object.def_property( + "rutherford_scattering", + [](const cppCLASS &self) -> decltype(auto) + { + return self.RutherfordScattering(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.RutherfordScattering() = value; + }, + cppCLASS::component_t::documentation("rutherford_scattering").data() + ); + + // get/set nuclearAmplitudeExpansion + object.def_property( + "nuclear_amplitude_expansion", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nuclearAmplitudeExpansion(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.nuclearAmplitudeExpansion() = value; + }, + cppCLASS::component_t::documentation("nuclear_amplitude_expansion").data() + ); + + // get/set nuclearPlusInterference + object.def_property( + "nuclear_plus_interference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nuclearPlusInterference(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.nuclearPlusInterference() = value; + }, + cppCLASS::component_t::documentation("nuclear_plus_interference").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Covariance.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Covariance.python.cpp new file mode 100644 index 000000000..dd54bddf7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Covariance.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Covariance.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Covariance +void wrapCovariance(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Covariance; + + // create the Python object + pybind11::class_ object( + module, "Covariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label") = std::nullopt, + pybind11::arg("href") = std::nullopt, + pybind11::arg("array") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceMatrix.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceMatrix.python.cpp new file mode 100644 index 000000000..3ffe7932e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceMatrix.python.cpp @@ -0,0 +1,180 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/CovarianceMatrix.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CovarianceMatrix +void wrapCovarianceMatrix(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::CovarianceMatrix; + + // create the Python object + pybind11::class_ object( + module, "CovarianceMatrix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::optional &, + const general::Gridded2d & + >(), + pybind11::arg("label"), + pybind11::arg("type"), + pybind11::arg("product_frame") = std::nullopt, + pybind11::arg("gridded2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set type + object.def_property( + "type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.type(); + }, + [](cppCLASS &self, const std::string &value) + { + self.type() = value; + }, + cppCLASS::component_t::documentation("type").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set gridded2d + object.def_property( + "gridded2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded2d(); + }, + [](cppCLASS &self, const general::Gridded2d &value) + { + self.gridded2d() = value; + }, + cppCLASS::component_t::documentation("gridded2d").data() + ); + + // shortcut: get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceSection.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceSection.python.cpp new file mode 100644 index 000000000..341cdcdd0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceSection.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/CovarianceSection.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CovarianceSection +void wrapCovarianceSection(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::CovarianceSection; + + // create the Python object + pybind11::class_ object( + module, "CovarianceSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const general::RowData &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("cross_term") = std::nullopt, + pybind11::arg("row_data"), + pybind11::arg("column_data") = std::nullopt, + pybind11::arg("covariance_matrix") = std::nullopt, + pybind11::arg("mixed") = std::nullopt, + pybind11::arg("sum") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set crossTerm + object.def_property( + "cross_term", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossTerm(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.crossTerm() = value; + }, + cppCLASS::component_t::documentation("cross_term").data() + ); + + // get/set rowData + object.def_property( + "row_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.rowData(); + }, + [](cppCLASS &self, const general::RowData &value) + { + self.rowData() = value; + }, + cppCLASS::component_t::documentation("row_data").data() + ); + + // get/set columnData + object.def_property( + "column_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columnData(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.columnData() = value; + }, + cppCLASS::component_t::documentation("column_data").data() + ); + + // get/set covarianceMatrix + object.def_property( + "covariance_matrix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.covarianceMatrix(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.covarianceMatrix() = value; + }, + cppCLASS::component_t::documentation("covariance_matrix").data() + ); + + // get/set mixed + object.def_property( + "mixed", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mixed(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.mixed() = value; + }, + cppCLASS::component_t::documentation("mixed").data() + ); + + // get/set sum + object.def_property( + "sum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.sum(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.sum() = value; + }, + cppCLASS::component_t::documentation("sum").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceSections.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceSections.python.cpp new file mode 100644 index 000000000..8f0220e5f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CovarianceSections.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/CovarianceSections.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CovarianceSections +void wrapCovarianceSections(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::CovarianceSections; + + // create the Python object + pybind11::class_ object( + module, "CovarianceSections", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("covariance_section"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set covarianceSection + object.def_property( + "covariance_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.covarianceSection(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.covarianceSection() = value; + }, + cppCLASS::component_t::documentation("covariance_section").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSection.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSection.python.cpp new file mode 100644 index 000000000..eca03a317 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSection.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/CrossSection.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CrossSection +void wrapCrossSection(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::CrossSection; + + // create the Python object + pybind11::class_ object( + module, "CrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("xys1d") = std::nullopt, + pybind11::arg("regions1d") = std::nullopt, + pybind11::arg("reference") = std::nullopt, + pybind11::arg("resonances_with_background") = std::nullopt, + pybind11::arg("coulomb_plus_nuclear_elastic") = std::nullopt, + pybind11::arg("thermal_neutron_scattering_law1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // get/set resonancesWithBackground + object.def_property( + "resonances_with_background", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonancesWithBackground(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.resonancesWithBackground() = value; + }, + cppCLASS::component_t::documentation("resonances_with_background").data() + ); + + // get/set CoulombPlusNuclearElastic + object.def_property( + "coulomb_plus_nuclear_elastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.CoulombPlusNuclearElastic(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.CoulombPlusNuclearElastic() = value; + }, + cppCLASS::component_t::documentation("coulomb_plus_nuclear_elastic").data() + ); + + // get/set thermalNeutronScatteringLaw1d + object.def_property( + "thermal_neutron_scattering_law1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.thermalNeutronScatteringLaw1d() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionReconstructed.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionReconstructed.python.cpp new file mode 100644 index 000000000..a36aa981d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionReconstructed.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/CrossSectionReconstructed.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CrossSectionReconstructed +void wrapCrossSectionReconstructed(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::CrossSectionReconstructed; + + // create the Python object + pybind11::class_ object( + module, "CrossSectionReconstructed", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string & + >(), + pybind11::arg("label"), + pybind11::arg("derived_from"), + pybind11::arg("date"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set derivedFrom + object.def_property( + "derived_from", + [](const cppCLASS &self) -> decltype(auto) + { + return self.derivedFrom(); + }, + [](cppCLASS &self, const std::string &value) + { + self.derivedFrom() = value; + }, + cppCLASS::component_t::documentation("derived_from").data() + ); + + // get/set date + object.def_property( + "date", + [](const cppCLASS &self) -> decltype(auto) + { + return self.date(); + }, + [](cppCLASS &self, const std::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionSum.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionSum.python.cpp new file mode 100644 index 000000000..f0ca5a03f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionSum.python.cpp @@ -0,0 +1,252 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/CrossSectionSum.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CrossSectionSum +void wrapCrossSectionSum(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::CrossSectionSum; + + // create the Python object + pybind11::class_ object( + module, "CrossSectionSum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const general::Summands &, + const general::Q &, + const general::CrossSection & + >(), + pybind11::arg("label"), + pybind11::arg("endf_mt"), + pybind11::arg("summands"), + pybind11::arg("q"), + pybind11::arg("cross_section"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set ENDF_MT + object.def_property( + "endf_mt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDF_MT(); + }, + [](cppCLASS &self, const int &value) + { + self.ENDF_MT() = value; + }, + cppCLASS::component_t::documentation("endf_mt").data() + ); + + // get/set summands + object.def_property( + "summands", + [](const cppCLASS &self) -> decltype(auto) + { + return self.summands(); + }, + [](cppCLASS &self, const general::Summands &value) + { + self.summands() = value; + }, + cppCLASS::component_t::documentation("summands").data() + ); + + // get/set Q + object.def_property( + "q", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Q(); + }, + [](cppCLASS &self, const general::Q &value) + { + self.Q() = value; + }, + cppCLASS::component_t::documentation("q").data() + ); + + // get/set crossSection + object.def_property( + "cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSection(); + }, + [](cppCLASS &self, const general::CrossSection &value) + { + self.crossSection() = value; + }, + cppCLASS::component_t::documentation("cross_section").data() + ); + + // shortcut: get/set CoulombPlusNuclearElastic + object.def_property( + "coulomb_plus_nuclear_elastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.CoulombPlusNuclearElastic(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.CoulombPlusNuclearElastic() = value; + }, + cppCLASS::component_t::documentation("coulomb_plus_nuclear_elastic").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set add + object.def_property( + "add", + [](const cppCLASS &self) -> decltype(auto) + { + return self.add(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.add() = value; + }, + cppCLASS::component_t::documentation("add").data() + ); + + // shortcut: get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // shortcut: get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set resonancesWithBackground + object.def_property( + "resonances_with_background", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonancesWithBackground(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.resonancesWithBackground() = value; + }, + cppCLASS::component_t::documentation("resonances_with_background").data() + ); + + // shortcut: get/set thermalNeutronScatteringLaw1d + object.def_property( + "thermal_neutron_scattering_law1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.thermalNeutronScatteringLaw1d() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionSums.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionSums.python.cpp new file mode 100644 index 000000000..dd3295899 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/CrossSectionSums.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/CrossSectionSums.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::CrossSectionSums +void wrapCrossSectionSums(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::CrossSectionSums; + + // create the Python object + pybind11::class_ object( + module, "CrossSectionSums", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("cross_section_sum"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set crossSectionSum + object.def_property( + "cross_section_sum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSectionSum(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.crossSectionSum() = value; + }, + cppCLASS::component_t::documentation("cross_section_sum").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Data.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Data.python.cpp new file mode 100644 index 000000000..d2e1ae896 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Data.python.cpp @@ -0,0 +1,69 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Data.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Data +void wrapData(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Data; + + // create the Python object + pybind11::class_ object( + module, "Data", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set vector + object.def_property( + "doubles", + [](const cppCLASS &self) -> const std::vector & + { + return self; + }, + [](cppCLASS &self, const std::vector &value) + { + self = value; + }, + cppCLASS::component_t::documentation("doubles").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Date.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Date.python.cpp new file mode 100644 index 000000000..0f5d8c423 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Date.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Date.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Date +void wrapDate(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Date; + + // create the Python object + pybind11::class_ object( + module, "Date", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string & + >(), + pybind11::arg("value"), + pybind11::arg("date_type"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set dateType + object.def_property( + "date_type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.dateType(); + }, + [](cppCLASS &self, const std::string &value) + { + self.dateType() = value; + }, + cppCLASS::component_t::documentation("date_type").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Dates.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Dates.python.cpp new file mode 100644 index 000000000..aff2b6128 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Dates.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Dates.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Dates +void wrapDates(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Dates; + + // create the Python object + pybind11::class_ object( + module, "Dates", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("date"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set date + object.def_property( + "date", + [](const cppCLASS &self) -> decltype(auto) + { + return self.date(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DebyeWallerIntegral.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DebyeWallerIntegral.python.cpp new file mode 100644 index 000000000..bccd3c883 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DebyeWallerIntegral.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DebyeWallerIntegral.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DebyeWallerIntegral +void wrapDebyeWallerIntegral(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DebyeWallerIntegral; + + // create the Python object + pybind11::class_ object( + module, "DebyeWallerIntegral", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs1d & + >(), + pybind11::arg("xys1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const general::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Decay.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Decay.python.cpp new file mode 100644 index 000000000..26cb63e27 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Decay.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Decay.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Decay +void wrapDecay(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Decay; + + // create the Python object + pybind11::class_ object( + module, "Decay", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const int &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("index"), + pybind11::arg("mode") = std::nullopt, + pybind11::arg("complete") = std::nullopt, + pybind11::arg("products") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set index + object.def_property( + "index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.index(); + }, + [](cppCLASS &self, const int &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set mode + object.def_property( + "mode", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mode(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.mode() = value; + }, + cppCLASS::component_t::documentation("mode").data() + ); + + // get/set complete + object.def_property( + "complete", + [](const cppCLASS &self) -> decltype(auto) + { + return self.complete(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.complete() = value; + }, + cppCLASS::component_t::documentation("complete").data() + ); + + // get/set products + object.def_property( + "products", + [](const cppCLASS &self) -> decltype(auto) + { + return self.products(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.products() = value; + }, + cppCLASS::component_t::documentation("products").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayData.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayData.python.cpp new file mode 100644 index 000000000..8af83d364 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayData.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DecayData.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DecayData +void wrapDecayData(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DecayData; + + // create the Python object + pybind11::class_ object( + module, "DecayData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::DecayModes &, + const std::optional & + >(), + pybind11::arg("decay_modes"), + pybind11::arg("average_energies") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set decayModes + object.def_property( + "decay_modes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.decayModes(); + }, + [](cppCLASS &self, const general::DecayModes &value) + { + self.decayModes() = value; + }, + cppCLASS::component_t::documentation("decay_modes").data() + ); + + // get/set averageEnergies + object.def_property( + "average_energies", + [](const cppCLASS &self) -> decltype(auto) + { + return self.averageEnergies(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.averageEnergies() = value; + }, + cppCLASS::component_t::documentation("average_energies").data() + ); + + // shortcut: get/set decayMode + object.def_property( + "decay_mode", + [](const cppCLASS &self) -> decltype(auto) + { + return self.decayMode(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.decayMode() = value; + }, + cppCLASS::component_t::documentation("decay_mode").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayMode.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayMode.python.cpp new file mode 100644 index 000000000..16ce3f5f9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayMode.python.cpp @@ -0,0 +1,172 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DecayMode.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DecayMode +void wrapDecayMode(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DecayMode; + + // create the Python object + pybind11::class_ object( + module, "DecayMode", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const general::Probability &, + const general::DecayPath &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label") = std::nullopt, + pybind11::arg("mode") = std::nullopt, + pybind11::arg("probability"), + pybind11::arg("decay_path"), + pybind11::arg("photon_emission_probabilities") = std::nullopt, + pybind11::arg("q") = std::nullopt, + pybind11::arg("spectra") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set mode + object.def_property( + "mode", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mode(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.mode() = value; + }, + cppCLASS::component_t::documentation("mode").data() + ); + + // get/set probability + object.def_property( + "probability", + [](const cppCLASS &self) -> decltype(auto) + { + return self.probability(); + }, + [](cppCLASS &self, const general::Probability &value) + { + self.probability() = value; + }, + cppCLASS::component_t::documentation("probability").data() + ); + + // get/set decayPath + object.def_property( + "decay_path", + [](const cppCLASS &self) -> decltype(auto) + { + return self.decayPath(); + }, + [](cppCLASS &self, const general::DecayPath &value) + { + self.decayPath() = value; + }, + cppCLASS::component_t::documentation("decay_path").data() + ); + + // get/set photonEmissionProbabilities + object.def_property( + "photon_emission_probabilities", + [](const cppCLASS &self) -> decltype(auto) + { + return self.photonEmissionProbabilities(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.photonEmissionProbabilities() = value; + }, + cppCLASS::component_t::documentation("photon_emission_probabilities").data() + ); + + // get/set Q + object.def_property( + "q", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Q(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.Q() = value; + }, + cppCLASS::component_t::documentation("q").data() + ); + + // get/set spectra + object.def_property( + "spectra", + [](const cppCLASS &self) -> decltype(auto) + { + return self.spectra(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.spectra() = value; + }, + cppCLASS::component_t::documentation("spectra").data() + ); + + // shortcut: get/set decay + object.def_property( + "decay", + [](const cppCLASS &self) -> decltype(auto) + { + return self.decay(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.decay() = value; + }, + cppCLASS::component_t::documentation("decay").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayModes.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayModes.python.cpp new file mode 100644 index 000000000..bc2202a3e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayModes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DecayModes.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DecayModes +void wrapDecayModes(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DecayModes; + + // create the Python object + pybind11::class_ object( + module, "DecayModes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("decay_mode"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set decayMode + object.def_property( + "decay_mode", + [](const cppCLASS &self) -> decltype(auto) + { + return self.decayMode(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.decayMode() = value; + }, + cppCLASS::component_t::documentation("decay_mode").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayPath.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayPath.python.cpp new file mode 100644 index 000000000..b31b9c2fc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DecayPath.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DecayPath.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DecayPath +void wrapDecayPath(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DecayPath; + + // create the Python object + pybind11::class_ object( + module, "DecayPath", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("decay"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set decay + object.def_property( + "decay", + [](const cppCLASS &self) -> decltype(auto) + { + return self.decay(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.decay() = value; + }, + cppCLASS::component_t::documentation("decay").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedBetaEnergy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedBetaEnergy.python.cpp new file mode 100644 index 000000000..e5923237a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedBetaEnergy.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DelayedBetaEnergy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DelayedBetaEnergy +void wrapDelayedBetaEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DelayedBetaEnergy; + + // create the Python object + pybind11::class_ object( + module, "DelayedBetaEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Polynomial1d & + >(), + pybind11::arg("polynomial1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const general::Polynomial1d &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedGammaEnergy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedGammaEnergy.python.cpp new file mode 100644 index 000000000..53267aec1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedGammaEnergy.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DelayedGammaEnergy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DelayedGammaEnergy +void wrapDelayedGammaEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DelayedGammaEnergy; + + // create the Python object + pybind11::class_ object( + module, "DelayedGammaEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Polynomial1d & + >(), + pybind11::arg("polynomial1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const general::Polynomial1d &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutron.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutron.python.cpp new file mode 100644 index 000000000..7bcff560e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutron.python.cpp @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DelayedNeutron.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DelayedNeutron +void wrapDelayedNeutron(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DelayedNeutron; + + // create the Python object + pybind11::class_ object( + module, "DelayedNeutron", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const general::Rate &, + const reduced::Product & + >(), + pybind11::arg("label"), + pybind11::arg("rate"), + pybind11::arg("product"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set rate + object.def_property( + "rate", + [](const cppCLASS &self) -> decltype(auto) + { + return self.rate(); + }, + [](cppCLASS &self, const general::Rate &value) + { + self.rate() = value; + }, + cppCLASS::component_t::documentation("rate").data() + ); + + // get/set product + object.def_property( + "product", + [](const cppCLASS &self) -> decltype(auto) + { + return self.product(); + }, + [](cppCLASS &self, const reduced::Product &value) + { + self.product() = value; + }, + cppCLASS::component_t::documentation("product").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // shortcut: get/set branching1d + object.def_property( + "branching1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.branching1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.branching1d() = value; + }, + cppCLASS::component_t::documentation("branching1d").data() + ); + + // shortcut: get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // shortcut: get/set distribution + object.def_property( + "distribution", + [](const cppCLASS &self) -> decltype(auto) + { + return self.distribution(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.distribution() = value; + }, + cppCLASS::component_t::documentation("distribution").data() + ); + + // shortcut: get/set multiplicity + object.def_property( + "multiplicity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.multiplicity(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.multiplicity() = value; + }, + cppCLASS::component_t::documentation("multiplicity").data() + ); + + // shortcut: get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // shortcut: get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set thermalNeutronScatteringLaw + object.def_property( + "thermal_neutron_scattering_law", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.thermalNeutronScatteringLaw() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set uncorrelated + object.def_property( + "uncorrelated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncorrelated(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncorrelated() = value; + }, + cppCLASS::component_t::documentation("uncorrelated").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutronKE.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutronKE.python.cpp new file mode 100644 index 000000000..44713a2d3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutronKE.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DelayedNeutronKE.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DelayedNeutronKE +void wrapDelayedNeutronKE(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DelayedNeutronKE; + + // create the Python object + pybind11::class_ object( + module, "DelayedNeutronKE", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("polynomial1d") = std::nullopt, + pybind11::arg("xys1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutrons.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutrons.python.cpp new file mode 100644 index 000000000..44919344c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DelayedNeutrons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DelayedNeutrons.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DelayedNeutrons +void wrapDelayedNeutrons(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DelayedNeutrons; + + // create the Python object + pybind11::class_ object( + module, "DelayedNeutrons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("delayed_neutron"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set delayedNeutron + object.def_property( + "delayed_neutron", + [](const cppCLASS &self) -> decltype(auto) + { + return self.delayedNeutron(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.delayedNeutron() = value; + }, + cppCLASS::component_t::documentation("delayed_neutron").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Discrete.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Discrete.python.cpp new file mode 100644 index 000000000..9cb291e3a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Discrete.python.cpp @@ -0,0 +1,266 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Discrete.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Discrete +void wrapDiscrete(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Discrete; + + // create the Python object + pybind11::class_ object( + module, "Discrete", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const general::Intensity &, + const general::Energy &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("type") = std::nullopt, + pybind11::arg("intensity"), + pybind11::arg("energy"), + pybind11::arg("internal_conversion_coefficients") = std::nullopt, + pybind11::arg("positron_emission_intensity") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set type + object.def_property( + "type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.type(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.type() = value; + }, + cppCLASS::component_t::documentation("type").data() + ); + + // get/set intensity + object.def_property( + "intensity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.intensity(); + }, + [](cppCLASS &self, const general::Intensity &value) + { + self.intensity() = value; + }, + cppCLASS::component_t::documentation("intensity").data() + ); + + // get/set energy + object.def_property( + "energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energy(); + }, + [](cppCLASS &self, const general::Energy &value) + { + self.energy() = value; + }, + cppCLASS::component_t::documentation("energy").data() + ); + + // get/set internalConversionCoefficients + object.def_property( + "internal_conversion_coefficients", + [](const cppCLASS &self) -> decltype(auto) + { + return self.internalConversionCoefficients(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.internalConversionCoefficients() = value; + }, + cppCLASS::component_t::documentation("internal_conversion_coefficients").data() + ); + + // get/set positronEmissionIntensity + object.def_property( + "positron_emission_intensity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.positronEmissionIntensity(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.positronEmissionIntensity() = value; + }, + cppCLASS::component_t::documentation("positron_emission_intensity").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set MadlandNix + object.def_property( + "madland_nix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.MadlandNix(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.MadlandNix() = value; + }, + cppCLASS::component_t::documentation("madland_nix").data() + ); + + // shortcut: get/set NBodyPhaseSpace + object.def_property( + "nbody_phase_space", + [](const cppCLASS &self) -> decltype(auto) + { + return self.NBodyPhaseSpace(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.NBodyPhaseSpace() = value; + }, + cppCLASS::component_t::documentation("nbody_phase_space").data() + ); + + // shortcut: get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // shortcut: get/set discreteGamma + object.def_property( + "discrete_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.discreteGamma(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.discreteGamma() = value; + }, + cppCLASS::component_t::documentation("discrete_gamma").data() + ); + + // shortcut: get/set evaporation + object.def_property( + "evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaporation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.evaporation() = value; + }, + cppCLASS::component_t::documentation("evaporation").data() + ); + + // shortcut: get/set generalEvaporation + object.def_property( + "general_evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.generalEvaporation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.generalEvaporation() = value; + }, + cppCLASS::component_t::documentation("general_evaporation").data() + ); + + // shortcut: get/set primaryGamma + object.def_property( + "primary_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.primaryGamma(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.primaryGamma() = value; + }, + cppCLASS::component_t::documentation("primary_gamma").data() + ); + + // shortcut: get/set simpleMaxwellianFission + object.def_property( + "simple_maxwellian_fission", + [](const cppCLASS &self) -> decltype(auto) + { + return self.simpleMaxwellianFission(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.simpleMaxwellianFission() = value; + }, + cppCLASS::component_t::documentation("simple_maxwellian_fission").data() + ); + + // shortcut: get/set weightedFunctionals + object.def_property( + "weighted_functionals", + [](const cppCLASS &self) -> decltype(auto) + { + return self.weightedFunctionals(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.weightedFunctionals() = value; + }, + cppCLASS::component_t::documentation("weighted_functionals").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DiscreteGamma.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DiscreteGamma.python.cpp new file mode 100644 index 000000000..0c1bcc387 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DiscreteGamma.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DiscreteGamma.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DiscreteGamma +void wrapDiscreteGamma(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DiscreteGamma; + + // create the Python object + pybind11::class_ object( + module, "DiscreteGamma", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const double &, + const double &, + const general::Axes & + >(), + pybind11::arg("value"), + pybind11::arg("domain_min"), + pybind11::arg("domain_max"), + pybind11::arg("axes"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMin() = value; + }, + cppCLASS::component_t::documentation("domain_min").data() + ); + + // get/set domainMax + object.def_property( + "domain_max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMax(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMax() = value; + }, + cppCLASS::component_t::documentation("domain_max").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const general::Axes &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Distribution.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Distribution.python.cpp new file mode 100644 index 000000000..10f2f13c5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Distribution.python.cpp @@ -0,0 +1,222 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Distribution.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Distribution +void wrapDistribution(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Distribution; + + // create the Python object + pybind11::class_ object( + module, "Distribution", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("thermal_neutron_scattering_law") = std::nullopt, + pybind11::arg("uncorrelated") = std::nullopt, + pybind11::arg("unspecified") = std::nullopt, + pybind11::arg("branching3d") = std::nullopt, + pybind11::arg("angular_two_body") = std::nullopt, + pybind11::arg("energy_angular") = std::nullopt, + pybind11::arg("kalbach_mann") = std::nullopt, + pybind11::arg("angular_energy") = std::nullopt, + pybind11::arg("coulomb_plus_nuclear_elastic") = std::nullopt, + pybind11::arg("coherent_photon_scattering") = std::nullopt, + pybind11::arg("incoherent_photon_scattering") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set thermalNeutronScatteringLaw + object.def_property( + "thermal_neutron_scattering_law", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.thermalNeutronScatteringLaw() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law").data() + ); + + // get/set uncorrelated + object.def_property( + "uncorrelated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncorrelated(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncorrelated() = value; + }, + cppCLASS::component_t::documentation("uncorrelated").data() + ); + + // get/set unspecified + object.def_property( + "unspecified", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unspecified(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unspecified() = value; + }, + cppCLASS::component_t::documentation("unspecified").data() + ); + + // get/set branching3d + object.def_property( + "branching3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.branching3d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.branching3d() = value; + }, + cppCLASS::component_t::documentation("branching3d").data() + ); + + // get/set angularTwoBody + object.def_property( + "angular_two_body", + [](const cppCLASS &self) -> decltype(auto) + { + return self.angularTwoBody(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.angularTwoBody() = value; + }, + cppCLASS::component_t::documentation("angular_two_body").data() + ); + + // get/set energyAngular + object.def_property( + "energy_angular", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energyAngular(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.energyAngular() = value; + }, + cppCLASS::component_t::documentation("energy_angular").data() + ); + + // get/set KalbachMann + object.def_property( + "kalbach_mann", + [](const cppCLASS &self) -> decltype(auto) + { + return self.KalbachMann(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.KalbachMann() = value; + }, + cppCLASS::component_t::documentation("kalbach_mann").data() + ); + + // get/set angularEnergy + object.def_property( + "angular_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.angularEnergy(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.angularEnergy() = value; + }, + cppCLASS::component_t::documentation("angular_energy").data() + ); + + // get/set CoulombPlusNuclearElastic + object.def_property( + "coulomb_plus_nuclear_elastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.CoulombPlusNuclearElastic(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.CoulombPlusNuclearElastic() = value; + }, + cppCLASS::component_t::documentation("coulomb_plus_nuclear_elastic").data() + ); + + // get/set coherentPhotonScattering + object.def_property( + "coherent_photon_scattering", + [](const cppCLASS &self) -> decltype(auto) + { + return self.coherentPhotonScattering(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.coherentPhotonScattering() = value; + }, + cppCLASS::component_t::documentation("coherent_photon_scattering").data() + ); + + // get/set incoherentPhotonScattering + object.def_property( + "incoherent_photon_scattering", + [](const cppCLASS &self) -> decltype(auto) + { + return self.incoherentPhotonScattering(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.incoherentPhotonScattering() = value; + }, + cppCLASS::component_t::documentation("incoherent_photon_scattering").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Documentation.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Documentation.python.cpp new file mode 100644 index 000000000..7e99cbccc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Documentation.python.cpp @@ -0,0 +1,154 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Documentation.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Documentation +void wrapDocumentation(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Documentation; + + // create the Python object + pybind11::class_ object( + module, "Documentation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Authors &, + const general::Dates &, + const general::Title &, + const general::Body &, + const std::optional & + >(), + pybind11::arg("authors"), + pybind11::arg("dates"), + pybind11::arg("title"), + pybind11::arg("body"), + pybind11::arg("endf_compatible") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set authors + object.def_property( + "authors", + [](const cppCLASS &self) -> decltype(auto) + { + return self.authors(); + }, + [](cppCLASS &self, const general::Authors &value) + { + self.authors() = value; + }, + cppCLASS::component_t::documentation("authors").data() + ); + + // get/set dates + object.def_property( + "dates", + [](const cppCLASS &self) -> decltype(auto) + { + return self.dates(); + }, + [](cppCLASS &self, const general::Dates &value) + { + self.dates() = value; + }, + cppCLASS::component_t::documentation("dates").data() + ); + + // get/set title + object.def_property( + "title", + [](const cppCLASS &self) -> decltype(auto) + { + return self.title(); + }, + [](cppCLASS &self, const general::Title &value) + { + self.title() = value; + }, + cppCLASS::component_t::documentation("title").data() + ); + + // get/set body + object.def_property( + "body", + [](const cppCLASS &self) -> decltype(auto) + { + return self.body(); + }, + [](cppCLASS &self, const general::Body &value) + { + self.body() = value; + }, + cppCLASS::component_t::documentation("body").data() + ); + + // get/set endfCompatible + object.def_property( + "endf_compatible", + [](const cppCLASS &self) -> decltype(auto) + { + return self.endfCompatible(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.endfCompatible() = value; + }, + cppCLASS::component_t::documentation("endf_compatible").data() + ); + + // shortcut: get/set author + object.def_property( + "author", + [](const cppCLASS &self) -> decltype(auto) + { + return self.author(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.author() = value; + }, + cppCLASS::component_t::documentation("author").data() + ); + + // shortcut: get/set date + object.def_property( + "date", + [](const cppCLASS &self) -> decltype(auto) + { + return self.date(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Double.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Double.python.cpp new file mode 100644 index 000000000..4cac06e2a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Double.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Double.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Double +void wrapDouble(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Double; + + // create the Python object + pybind11::class_ object( + module, "Double", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const double &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("value"), + pybind11::arg("unit") = std::nullopt, + pybind11::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DoubleDifferentialCrossSection.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DoubleDifferentialCrossSection.python.cpp new file mode 100644 index 000000000..a25917b59 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/DoubleDifferentialCrossSection.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/DoubleDifferentialCrossSection.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::DoubleDifferentialCrossSection +void wrapDoubleDifferentialCrossSection(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::DoubleDifferentialCrossSection; + + // create the Python object + pybind11::class_ object( + module, "DoubleDifferentialCrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("coulomb_plus_nuclear_elastic") = std::nullopt, + pybind11::arg("coherent_photon_scattering") = std::nullopt, + pybind11::arg("incoherent_photon_scattering") = std::nullopt, + pybind11::arg("thermal_neutron_scattering_law_coherent_elastic") = std::nullopt, + pybind11::arg("thermal_neutron_scattering_law_incoherent_elastic") = std::nullopt, + pybind11::arg("thermal_neutron_scattering_law_incoherent_inelastic") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set CoulombPlusNuclearElastic + object.def_property( + "coulomb_plus_nuclear_elastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.CoulombPlusNuclearElastic(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.CoulombPlusNuclearElastic() = value; + }, + cppCLASS::component_t::documentation("coulomb_plus_nuclear_elastic").data() + ); + + // get/set coherentPhotonScattering + object.def_property( + "coherent_photon_scattering", + [](const cppCLASS &self) -> decltype(auto) + { + return self.coherentPhotonScattering(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.coherentPhotonScattering() = value; + }, + cppCLASS::component_t::documentation("coherent_photon_scattering").data() + ); + + // get/set incoherentPhotonScattering + object.def_property( + "incoherent_photon_scattering", + [](const cppCLASS &self) -> decltype(auto) + { + return self.incoherentPhotonScattering(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.incoherentPhotonScattering() = value; + }, + cppCLASS::component_t::documentation("incoherent_photon_scattering").data() + ); + + // get/set thermalNeutronScatteringLaw_coherentElastic + object.def_property( + "thermal_neutron_scattering_law_coherent_elastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw_coherentElastic(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.thermalNeutronScatteringLaw_coherentElastic() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law_coherent_elastic").data() + ); + + // get/set thermalNeutronScatteringLaw_incoherentElastic + object.def_property( + "thermal_neutron_scattering_law_incoherent_elastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw_incoherentElastic(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.thermalNeutronScatteringLaw_incoherentElastic() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law_incoherent_elastic").data() + ); + + // get/set thermalNeutronScatteringLaw_incoherentInelastic + object.def_property( + "thermal_neutron_scattering_law_incoherent_inelastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw_incoherentInelastic(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.thermalNeutronScatteringLaw_incoherentInelastic() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law_incoherent_inelastic").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EFH.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EFH.python.cpp new file mode 100644 index 000000000..157462910 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EFH.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/EFH.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::EFH +void wrapEFH(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::EFH; + + // create the Python object + pybind11::class_ object( + module, "EFH", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const std::string & + >(), + pybind11::arg("value"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EFL.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EFL.python.cpp new file mode 100644 index 000000000..cf0e5df4c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EFL.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/EFL.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::EFL +void wrapEFL(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::EFL; + + // create the Python object + pybind11::class_ object( + module, "EFL", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const std::string & + >(), + pybind11::arg("value"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ENDFconversionFlags.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ENDFconversionFlags.python.cpp new file mode 100644 index 000000000..91af574e0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ENDFconversionFlags.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ENDFconversionFlags.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ENDFconversionFlags +void wrapENDFconversionFlags(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ENDFconversionFlags; + + // create the Python object + pybind11::class_ object( + module, "ENDFconversionFlags", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::vector & + >(), + pybind11::arg("flags") = std::nullopt, + pybind11::arg("href") = std::nullopt, + pybind11::arg("conversion"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set flags + object.def_property( + "flags", + [](const cppCLASS &self) -> decltype(auto) + { + return self.flags(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.flags() = value; + }, + cppCLASS::component_t::documentation("flags").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // get/set conversion + object.def_property( + "conversion", + [](const cppCLASS &self) -> decltype(auto) + { + return self.conversion(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.conversion() = value; + }, + cppCLASS::component_t::documentation("conversion").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/E_critical.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/E_critical.python.cpp new file mode 100644 index 000000000..8ea7edd20 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/E_critical.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/E_critical.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::E_critical +void wrapE_critical(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::E_critical; + + // create the Python object + pybind11::class_ object( + module, "E_critical", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const std::string & + >(), + pybind11::arg("value"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/E_max.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/E_max.python.cpp new file mode 100644 index 000000000..37f714081 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/E_max.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/E_max.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::E_max +void wrapE_max(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::E_max; + + // create the Python object + pybind11::class_ object( + module, "E_max", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const std::string & + >(), + pybind11::arg("value"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ElapsedTime.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ElapsedTime.python.cpp new file mode 100644 index 000000000..8c3492272 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ElapsedTime.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ElapsedTime.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ElapsedTime +void wrapElapsedTime(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ElapsedTime; + + // create the Python object + pybind11::class_ object( + module, "ElapsedTime", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const general::Time &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("time"), + pybind11::arg("yields") = std::nullopt, + pybind11::arg("incident_energies") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set time + object.def_property( + "time", + [](const cppCLASS &self) -> decltype(auto) + { + return self.time(); + }, + [](cppCLASS &self, const general::Time &value) + { + self.time() = value; + }, + cppCLASS::component_t::documentation("time").data() + ); + + // get/set yields + object.def_property( + "yields", + [](const cppCLASS &self) -> decltype(auto) + { + return self.yields(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.yields() = value; + }, + cppCLASS::component_t::documentation("yields").data() + ); + + // get/set incidentEnergies + object.def_property( + "incident_energies", + [](const cppCLASS &self) -> decltype(auto) + { + return self.incidentEnergies(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.incidentEnergies() = value; + }, + cppCLASS::component_t::documentation("incident_energies").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set string + object.def_property( + "string", + [](const cppCLASS &self) -> decltype(auto) + { + return self.string(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.string() = value; + }, + cppCLASS::component_t::documentation("string").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ElapsedTimes.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ElapsedTimes.python.cpp new file mode 100644 index 000000000..34e0401d1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ElapsedTimes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ElapsedTimes.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ElapsedTimes +void wrapElapsedTimes(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ElapsedTimes; + + // create the Python object + pybind11::class_ object( + module, "ElapsedTimes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("elapsed_time"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set elapsedTime + object.def_property( + "elapsed_time", + [](const cppCLASS &self) -> decltype(auto) + { + return self.elapsedTime(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.elapsedTime() = value; + }, + cppCLASS::component_t::documentation("elapsed_time").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EndfCompatible.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EndfCompatible.python.cpp new file mode 100644 index 000000000..e7c7b2fb8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EndfCompatible.python.cpp @@ -0,0 +1,60 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/EndfCompatible.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::EndfCompatible +void wrapEndfCompatible(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::EndfCompatible; + + // create the Python object + pybind11::class_ object( + module, "EndfCompatible", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set data string + object.def_property( + "string", + [](const cppCLASS &self) -> const std::string & + { + return self; + }, + [](cppCLASS &self, const std::string &value) + { + self = value; + }, + cppCLASS::component_t::documentation("string").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Energy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Energy.python.cpp new file mode 100644 index 000000000..aef715cb4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Energy.python.cpp @@ -0,0 +1,254 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Energy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Energy +void wrapEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Energy; + + // create the Python object + pybind11::class_ object( + module, "Energy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("value") = std::nullopt, + pybind11::arg("unit") = std::nullopt, + pybind11::arg("double") = std::nullopt, + pybind11::arg("uncertainty") = std::nullopt, + pybind11::arg("nbody_phase_space") = std::nullopt, + pybind11::arg("primary_gamma") = std::nullopt, + pybind11::arg("discrete_gamma") = std::nullopt, + pybind11::arg("xys2d") = std::nullopt, + pybind11::arg("general_evaporation") = std::nullopt, + pybind11::arg("evaporation") = std::nullopt, + pybind11::arg("weighted_functionals") = std::nullopt, + pybind11::arg("simple_maxwellian_fission") = std::nullopt, + pybind11::arg("madland_nix") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // get/set NBodyPhaseSpace + object.def_property( + "nbody_phase_space", + [](const cppCLASS &self) -> decltype(auto) + { + return self.NBodyPhaseSpace(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.NBodyPhaseSpace() = value; + }, + cppCLASS::component_t::documentation("nbody_phase_space").data() + ); + + // get/set primaryGamma + object.def_property( + "primary_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.primaryGamma(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.primaryGamma() = value; + }, + cppCLASS::component_t::documentation("primary_gamma").data() + ); + + // get/set discreteGamma + object.def_property( + "discrete_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.discreteGamma(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.discreteGamma() = value; + }, + cppCLASS::component_t::documentation("discrete_gamma").data() + ); + + // get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // get/set generalEvaporation + object.def_property( + "general_evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.generalEvaporation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.generalEvaporation() = value; + }, + cppCLASS::component_t::documentation("general_evaporation").data() + ); + + // get/set evaporation + object.def_property( + "evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaporation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.evaporation() = value; + }, + cppCLASS::component_t::documentation("evaporation").data() + ); + + // get/set weightedFunctionals + object.def_property( + "weighted_functionals", + [](const cppCLASS &self) -> decltype(auto) + { + return self.weightedFunctionals(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.weightedFunctionals() = value; + }, + cppCLASS::component_t::documentation("weighted_functionals").data() + ); + + // get/set simpleMaxwellianFission + object.def_property( + "simple_maxwellian_fission", + [](const cppCLASS &self) -> decltype(auto) + { + return self.simpleMaxwellianFission(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.simpleMaxwellianFission() = value; + }, + cppCLASS::component_t::documentation("simple_maxwellian_fission").data() + ); + + // get/set MadlandNix + object.def_property( + "madland_nix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.MadlandNix(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.MadlandNix() = value; + }, + cppCLASS::component_t::documentation("madland_nix").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EnergyAngular.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EnergyAngular.python.cpp new file mode 100644 index 000000000..4830072c0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/EnergyAngular.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/EnergyAngular.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::EnergyAngular +void wrapEnergyAngular(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::EnergyAngular; + + // create the Python object + pybind11::class_ object( + module, "EnergyAngular", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("product_frame"), + pybind11::arg("xys3d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::string &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set XYs3d + object.def_property( + "xys3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs3d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs3d() = value; + }, + cppCLASS::component_t::documentation("xys3d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Evaluated.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Evaluated.python.cpp new file mode 100644 index 000000000..fbc2430e4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Evaluated.python.cpp @@ -0,0 +1,242 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Evaluated.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Evaluated +void wrapEvaluated(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Evaluated; + + // create the Python object + pybind11::class_ object( + module, "Evaluated", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string &, + const std::string &, + const general::Documentation &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("date"), + pybind11::arg("library"), + pybind11::arg("version"), + pybind11::arg("documentation"), + pybind11::arg("temperature") = std::nullopt, + pybind11::arg("projectile_energy_domain") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set date + object.def_property( + "date", + [](const cppCLASS &self) -> decltype(auto) + { + return self.date(); + }, + [](cppCLASS &self, const std::string &value) + { + self.date() = value; + }, + cppCLASS::component_t::documentation("date").data() + ); + + // get/set library + object.def_property( + "library", + [](const cppCLASS &self) -> decltype(auto) + { + return self.library(); + }, + [](cppCLASS &self, const std::string &value) + { + self.library() = value; + }, + cppCLASS::component_t::documentation("library").data() + ); + + // get/set version + object.def_property( + "version", + [](const cppCLASS &self) -> decltype(auto) + { + return self.version(); + }, + [](cppCLASS &self, const std::string &value) + { + self.version() = value; + }, + cppCLASS::component_t::documentation("version").data() + ); + + // get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const general::Documentation &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // get/set temperature + object.def_property( + "temperature", + [](const cppCLASS &self) -> decltype(auto) + { + return self.temperature(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.temperature() = value; + }, + cppCLASS::component_t::documentation("temperature").data() + ); + + // get/set projectileEnergyDomain + object.def_property( + "projectile_energy_domain", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectileEnergyDomain(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.projectileEnergyDomain() = value; + }, + cppCLASS::component_t::documentation("projectile_energy_domain").data() + ); + + // shortcut: get/set author + object.def_property( + "author", + [](const cppCLASS &self) -> decltype(auto) + { + return self.author(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.author() = value; + }, + cppCLASS::component_t::documentation("author").data() + ); + + // shortcut: get/set authors + object.def_property( + "authors", + [](const cppCLASS &self) -> decltype(auto) + { + return self.authors(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.authors() = value; + }, + cppCLASS::component_t::documentation("authors").data() + ); + + // shortcut: get/set body + object.def_property( + "body", + [](const cppCLASS &self) -> decltype(auto) + { + return self.body(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.body() = value; + }, + cppCLASS::component_t::documentation("body").data() + ); + + // shortcut: get/set dates + object.def_property( + "dates", + [](const cppCLASS &self) -> decltype(auto) + { + return self.dates(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.dates() = value; + }, + cppCLASS::component_t::documentation("dates").data() + ); + + // shortcut: get/set endfCompatible + object.def_property( + "endf_compatible", + [](const cppCLASS &self) -> decltype(auto) + { + return self.endfCompatible(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.endfCompatible() = value; + }, + cppCLASS::component_t::documentation("endf_compatible").data() + ); + + // shortcut: get/set title + object.def_property( + "title", + [](const cppCLASS &self) -> decltype(auto) + { + return self.title(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.title() = value; + }, + cppCLASS::component_t::documentation("title").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Evaporation.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Evaporation.python.cpp new file mode 100644 index 000000000..a5e615b5b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Evaporation.python.cpp @@ -0,0 +1,106 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Evaporation.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Evaporation +void wrapEvaporation(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Evaporation; + + // create the Python object + pybind11::class_ object( + module, "Evaporation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::U &, + const general::Theta & + >(), + pybind11::arg("u"), + pybind11::arg("theta"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set U + object.def_property( + "u", + [](const cppCLASS &self) -> decltype(auto) + { + return self.U(); + }, + [](cppCLASS &self, const general::U &value) + { + self.U() = value; + }, + cppCLASS::component_t::documentation("u").data() + ); + + // get/set theta + object.def_property( + "theta", + [](const cppCLASS &self) -> decltype(auto) + { + return self.theta(); + }, + [](cppCLASS &self, const general::Theta &value) + { + self.theta() = value; + }, + cppCLASS::component_t::documentation("theta").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ExternalFile.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ExternalFile.python.cpp new file mode 100644 index 000000000..763a4d70c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ExternalFile.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ExternalFile.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ExternalFile +void wrapExternalFile(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ExternalFile; + + // create the Python object + pybind11::class_ object( + module, "ExternalFile", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("path"), + pybind11::arg("checksum") = std::nullopt, + pybind11::arg("algorithm") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set path + object.def_property( + "path", + [](const cppCLASS &self) -> decltype(auto) + { + return self.path(); + }, + [](cppCLASS &self, const std::string &value) + { + self.path() = value; + }, + cppCLASS::component_t::documentation("path").data() + ); + + // get/set checksum + object.def_property( + "checksum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.checksum(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.checksum() = value; + }, + cppCLASS::component_t::documentation("checksum").data() + ); + + // get/set algorithm + object.def_property( + "algorithm", + [](const cppCLASS &self) -> decltype(auto) + { + return self.algorithm(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.algorithm() = value; + }, + cppCLASS::component_t::documentation("algorithm").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ExternalFiles.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ExternalFiles.python.cpp new file mode 100644 index 000000000..da37f59aa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ExternalFiles.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ExternalFiles.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ExternalFiles +void wrapExternalFiles(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ExternalFiles; + + // create the Python object + pybind11::class_ object( + module, "ExternalFiles", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("external_file"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set externalFile + object.def_property( + "external_file", + [](const cppCLASS &self) -> decltype(auto) + { + return self.externalFile(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.externalFile() = value; + }, + cppCLASS::component_t::documentation("external_file").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/F.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/F.python.cpp new file mode 100644 index 000000000..834f9bf96 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/F.python.cpp @@ -0,0 +1,146 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/F.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::F +void wrapF(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::F; + + // create the Python object + pybind11::class_ object( + module, "F", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs2d & + >(), + pybind11::arg("xys2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const general::XYs2d &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // shortcut: get/set Legendre + object.def_property( + "legendre", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Legendre(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Legendre() = value; + }, + cppCLASS::component_t::documentation("legendre").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set function1ds + object.def_property( + "function1ds", + [](const cppCLASS &self) -> decltype(auto) + { + return self.function1ds(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.function1ds() = value; + }, + cppCLASS::component_t::documentation("function1ds").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FastRegion.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FastRegion.python.cpp new file mode 100644 index 000000000..ea1502d0a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FastRegion.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/FastRegion.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FastRegion +void wrapFastRegion(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::FastRegion; + + // create the Python object + pybind11::class_ object( + module, "FastRegion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("xys1d") = std::nullopt, + pybind11::arg("regions1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionComponent.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionComponent.python.cpp new file mode 100644 index 000000000..0eaa5cbe0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionComponent.python.cpp @@ -0,0 +1,280 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/FissionComponent.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FissionComponent +void wrapFissionComponent(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::FissionComponent; + + // create the Python object + pybind11::class_ object( + module, "FissionComponent", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const std::string &, + const general::CrossSection &, + const general::OutputChannel & + >(), + pybind11::arg("label"), + pybind11::arg("endf_mt"), + pybind11::arg("fission_genre"), + pybind11::arg("cross_section"), + pybind11::arg("output_channel"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set ENDF_MT + object.def_property( + "endf_mt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDF_MT(); + }, + [](cppCLASS &self, const int &value) + { + self.ENDF_MT() = value; + }, + cppCLASS::component_t::documentation("endf_mt").data() + ); + + // get/set fissionGenre + object.def_property( + "fission_genre", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionGenre(); + }, + [](cppCLASS &self, const std::string &value) + { + self.fissionGenre() = value; + }, + cppCLASS::component_t::documentation("fission_genre").data() + ); + + // get/set crossSection + object.def_property( + "cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSection(); + }, + [](cppCLASS &self, const general::CrossSection &value) + { + self.crossSection() = value; + }, + cppCLASS::component_t::documentation("cross_section").data() + ); + + // get/set outputChannel + object.def_property( + "output_channel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outputChannel(); + }, + [](cppCLASS &self, const general::OutputChannel &value) + { + self.outputChannel() = value; + }, + cppCLASS::component_t::documentation("output_channel").data() + ); + + // shortcut: get/set CoulombPlusNuclearElastic + object.def_property( + "coulomb_plus_nuclear_elastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.CoulombPlusNuclearElastic(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.CoulombPlusNuclearElastic() = value; + }, + cppCLASS::component_t::documentation("coulomb_plus_nuclear_elastic").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set Q + object.def_property( + "q", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Q(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Q() = value; + }, + cppCLASS::component_t::documentation("q").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // shortcut: get/set fissionFragmentData + object.def_property( + "fission_fragment_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionFragmentData(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.fissionFragmentData() = value; + }, + cppCLASS::component_t::documentation("fission_fragment_data").data() + ); + + // shortcut: get/set products + object.def_property( + "products", + [](const cppCLASS &self) -> decltype(auto) + { + return self.products(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.products() = value; + }, + cppCLASS::component_t::documentation("products").data() + ); + + // shortcut: get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set resonancesWithBackground + object.def_property( + "resonances_with_background", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonancesWithBackground(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.resonancesWithBackground() = value; + }, + cppCLASS::component_t::documentation("resonances_with_background").data() + ); + + // shortcut: get/set thermalNeutronScatteringLaw1d + object.def_property( + "thermal_neutron_scattering_law1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.thermalNeutronScatteringLaw1d() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionComponents.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionComponents.python.cpp new file mode 100644 index 000000000..880ab9424 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionComponents.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/FissionComponents.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FissionComponents +void wrapFissionComponents(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::FissionComponents; + + // create the Python object + pybind11::class_ object( + module, "FissionComponents", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional> & + >(), + pybind11::arg("fission_component") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set fissionComponent + object.def_property( + "fission_component", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionComponent(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.fissionComponent() = value; + }, + cppCLASS::component_t::documentation("fission_component").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionEnergyRelease.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionEnergyRelease.python.cpp new file mode 100644 index 000000000..504e3acee --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionEnergyRelease.python.cpp @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/FissionEnergyRelease.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FissionEnergyRelease +void wrapFissionEnergyRelease(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::FissionEnergyRelease; + + // create the Python object + pybind11::class_ object( + module, "FissionEnergyRelease", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const general::PromptProductKE &, + const general::PromptNeutronKE &, + const general::DelayedNeutronKE &, + const general::PromptGammaEnergy &, + const general::DelayedGammaEnergy &, + const general::DelayedBetaEnergy &, + const general::NeutrinoEnergy &, + const general::NonNeutrinoEnergy &, + const general::TotalEnergy & + >(), + pybind11::arg("label"), + pybind11::arg("prompt_product_ke"), + pybind11::arg("prompt_neutron_ke"), + pybind11::arg("delayed_neutron_ke"), + pybind11::arg("prompt_gamma_energy"), + pybind11::arg("delayed_gamma_energy"), + pybind11::arg("delayed_beta_energy"), + pybind11::arg("neutrino_energy"), + pybind11::arg("non_neutrino_energy"), + pybind11::arg("total_energy"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set promptProductKE + object.def_property( + "prompt_product_ke", + [](const cppCLASS &self) -> decltype(auto) + { + return self.promptProductKE(); + }, + [](cppCLASS &self, const general::PromptProductKE &value) + { + self.promptProductKE() = value; + }, + cppCLASS::component_t::documentation("prompt_product_ke").data() + ); + + // get/set promptNeutronKE + object.def_property( + "prompt_neutron_ke", + [](const cppCLASS &self) -> decltype(auto) + { + return self.promptNeutronKE(); + }, + [](cppCLASS &self, const general::PromptNeutronKE &value) + { + self.promptNeutronKE() = value; + }, + cppCLASS::component_t::documentation("prompt_neutron_ke").data() + ); + + // get/set delayedNeutronKE + object.def_property( + "delayed_neutron_ke", + [](const cppCLASS &self) -> decltype(auto) + { + return self.delayedNeutronKE(); + }, + [](cppCLASS &self, const general::DelayedNeutronKE &value) + { + self.delayedNeutronKE() = value; + }, + cppCLASS::component_t::documentation("delayed_neutron_ke").data() + ); + + // get/set promptGammaEnergy + object.def_property( + "prompt_gamma_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.promptGammaEnergy(); + }, + [](cppCLASS &self, const general::PromptGammaEnergy &value) + { + self.promptGammaEnergy() = value; + }, + cppCLASS::component_t::documentation("prompt_gamma_energy").data() + ); + + // get/set delayedGammaEnergy + object.def_property( + "delayed_gamma_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.delayedGammaEnergy(); + }, + [](cppCLASS &self, const general::DelayedGammaEnergy &value) + { + self.delayedGammaEnergy() = value; + }, + cppCLASS::component_t::documentation("delayed_gamma_energy").data() + ); + + // get/set delayedBetaEnergy + object.def_property( + "delayed_beta_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.delayedBetaEnergy(); + }, + [](cppCLASS &self, const general::DelayedBetaEnergy &value) + { + self.delayedBetaEnergy() = value; + }, + cppCLASS::component_t::documentation("delayed_beta_energy").data() + ); + + // get/set neutrinoEnergy + object.def_property( + "neutrino_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.neutrinoEnergy(); + }, + [](cppCLASS &self, const general::NeutrinoEnergy &value) + { + self.neutrinoEnergy() = value; + }, + cppCLASS::component_t::documentation("neutrino_energy").data() + ); + + // get/set nonNeutrinoEnergy + object.def_property( + "non_neutrino_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nonNeutrinoEnergy(); + }, + [](cppCLASS &self, const general::NonNeutrinoEnergy &value) + { + self.nonNeutrinoEnergy() = value; + }, + cppCLASS::component_t::documentation("non_neutrino_energy").data() + ); + + // get/set totalEnergy + object.def_property( + "total_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.totalEnergy(); + }, + [](cppCLASS &self, const general::TotalEnergy &value) + { + self.totalEnergy() = value; + }, + cppCLASS::component_t::documentation("total_energy").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionEnergyReleases.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionEnergyReleases.python.cpp new file mode 100644 index 000000000..8f8131445 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FissionEnergyReleases.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/FissionEnergyReleases.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FissionEnergyReleases +void wrapFissionEnergyReleases(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::FissionEnergyReleases; + + // create the Python object + pybind11::class_ object( + module, "FissionEnergyReleases", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("fission_energy_release"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set fissionEnergyRelease + object.def_property( + "fission_energy_release", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionEnergyRelease(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.fissionEnergyRelease() = value; + }, + cppCLASS::component_t::documentation("fission_energy_release").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FormFactor.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FormFactor.python.cpp new file mode 100644 index 000000000..2627bf025 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FormFactor.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/FormFactor.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FormFactor +void wrapFormFactor(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::FormFactor; + + // create the Python object + pybind11::class_ object( + module, "FormFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs1d & + >(), + pybind11::arg("xys1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const general::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Fraction.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Fraction.python.cpp new file mode 100644 index 000000000..b38d6d60f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Fraction.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Fraction.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Fraction +void wrapFraction(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Fraction; + + // create the Python object + pybind11::class_ object( + module, "Fraction", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string & + >(), + pybind11::arg("label"), + pybind11::arg("value"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FreeGasApproximation.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FreeGasApproximation.python.cpp new file mode 100644 index 000000000..b390d2df0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/FreeGasApproximation.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/FreeGasApproximation.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::FreeGasApproximation +void wrapFreeGasApproximation(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::FreeGasApproximation; + + // create the Python object + pybind11::class_ object( + module, "FreeGasApproximation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Function1ds.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Function1ds.python.cpp new file mode 100644 index 000000000..7e245d26b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Function1ds.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Function1ds.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Function1ds +void wrapFunction1ds(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Function1ds; + + // create the Python object + pybind11::class_ object( + module, "Function1ds", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector &, + const std::optional> &, + const std::optional> & + >(), + pybind11::arg("legendre"), + pybind11::arg("xys1d") = std::nullopt, + pybind11::arg("regions1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set Legendre + object.def_property( + "legendre", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Legendre(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.Legendre() = value; + }, + cppCLASS::component_t::documentation("legendre").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Function2ds.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Function2ds.python.cpp new file mode 100644 index 000000000..0cd211c3f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Function2ds.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Function2ds.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Function2ds +void wrapFunction2ds(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Function2ds; + + // create the Python object + pybind11::class_ object( + module, "Function2ds", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("xys2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/G.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/G.python.cpp new file mode 100644 index 000000000..04202e536 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/G.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/G.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::G +void wrapG(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::G; + + // create the Python object + pybind11::class_ object( + module, "G", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional & + >(), + pybind11::arg("xys1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GaugeBoson.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GaugeBoson.python.cpp new file mode 100644 index 000000000..22fa5b977 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GaugeBoson.python.cpp @@ -0,0 +1,170 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/GaugeBoson.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::GaugeBoson +void wrapGaugeBoson(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::GaugeBoson; + + // create the Python object + pybind11::class_ object( + module, "GaugeBoson", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const general::Mass &, + const general::Spin &, + const general::Parity &, + const general::Charge &, + const general::Halflife & + >(), + pybind11::arg("id"), + pybind11::arg("mass"), + pybind11::arg("spin"), + pybind11::arg("parity"), + pybind11::arg("charge"), + pybind11::arg("halflife"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set id + object.def_property( + "id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.id(); + }, + [](cppCLASS &self, const std::string &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set mass + object.def_property( + "mass", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mass(); + }, + [](cppCLASS &self, const general::Mass &value) + { + self.mass() = value; + }, + cppCLASS::component_t::documentation("mass").data() + ); + + // get/set spin + object.def_property( + "spin", + [](const cppCLASS &self) -> decltype(auto) + { + return self.spin(); + }, + [](cppCLASS &self, const general::Spin &value) + { + self.spin() = value; + }, + cppCLASS::component_t::documentation("spin").data() + ); + + // get/set parity + object.def_property( + "parity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parity(); + }, + [](cppCLASS &self, const general::Parity &value) + { + self.parity() = value; + }, + cppCLASS::component_t::documentation("parity").data() + ); + + // get/set charge + object.def_property( + "charge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.charge(); + }, + [](cppCLASS &self, const general::Charge &value) + { + self.charge() = value; + }, + cppCLASS::component_t::documentation("charge").data() + ); + + // get/set halflife + object.def_property( + "halflife", + [](const cppCLASS &self) -> decltype(auto) + { + return self.halflife(); + }, + [](cppCLASS &self, const general::Halflife &value) + { + self.halflife() = value; + }, + cppCLASS::component_t::documentation("halflife").data() + ); + + // shortcut: get/set fraction + object.def_property( + "fraction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fraction(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.fraction() = value; + }, + cppCLASS::component_t::documentation("fraction").data() + ); + + // shortcut: get/set string + object.def_property( + "string", + [](const cppCLASS &self) -> decltype(auto) + { + return self.string(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.string() = value; + }, + cppCLASS::component_t::documentation("string").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GaugeBosons.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GaugeBosons.python.cpp new file mode 100644 index 000000000..e1e5f0850 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GaugeBosons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/GaugeBosons.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::GaugeBosons +void wrapGaugeBosons(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::GaugeBosons; + + // create the Python object + pybind11::class_ object( + module, "GaugeBosons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("gauge_boson"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set gaugeBoson + object.def_property( + "gauge_boson", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gaugeBoson(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.gaugeBoson() = value; + }, + cppCLASS::component_t::documentation("gauge_boson").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GeneralEvaporation.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GeneralEvaporation.python.cpp new file mode 100644 index 000000000..5363bd782 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/GeneralEvaporation.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/GeneralEvaporation.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::GeneralEvaporation +void wrapGeneralEvaporation(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::GeneralEvaporation; + + // create the Python object + pybind11::class_ object( + module, "GeneralEvaporation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::U &, + const general::Theta &, + const general::G & + >(), + pybind11::arg("u"), + pybind11::arg("theta"), + pybind11::arg("g"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set U + object.def_property( + "u", + [](const cppCLASS &self) -> decltype(auto) + { + return self.U(); + }, + [](cppCLASS &self, const general::U &value) + { + self.U() = value; + }, + cppCLASS::component_t::documentation("u").data() + ); + + // get/set theta + object.def_property( + "theta", + [](const cppCLASS &self) -> decltype(auto) + { + return self.theta(); + }, + [](cppCLASS &self, const general::Theta &value) + { + self.theta() = value; + }, + cppCLASS::component_t::documentation("theta").data() + ); + + // get/set g + object.def_property( + "g", + [](const cppCLASS &self) -> decltype(auto) + { + return self.g(); + }, + [](cppCLASS &self, const general::G &value) + { + self.g() = value; + }, + cppCLASS::component_t::documentation("g").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Grid.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Grid.python.cpp new file mode 100644 index 000000000..cba04ee48 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Grid.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Grid.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Grid +void wrapGrid(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Grid; + + // create the Python object + pybind11::class_ object( + module, "Grid", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const int &, + const std::string &, + const std::string &, + const std::string &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("index"), + pybind11::arg("label"), + pybind11::arg("unit"), + pybind11::arg("style"), + pybind11::arg("interpolation") = std::nullopt, + pybind11::arg("link") = std::nullopt, + pybind11::arg("values") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set index + object.def_property( + "index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.index(); + }, + [](cppCLASS &self, const int &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set style + object.def_property( + "style", + [](const cppCLASS &self) -> decltype(auto) + { + return self.style(); + }, + [](cppCLASS &self, const std::string &value) + { + self.style() = value; + }, + cppCLASS::component_t::documentation("style").data() + ); + + // get/set interpolation + object.def_property( + "interpolation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interpolation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.interpolation() = value; + }, + cppCLASS::component_t::documentation("interpolation").data() + ); + + // get/set link + object.def_property( + "link", + [](const cppCLASS &self) -> decltype(auto) + { + return self.link(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.link() = value; + }, + cppCLASS::component_t::documentation("link").data() + ); + + // get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Gridded2d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Gridded2d.python.cpp new file mode 100644 index 000000000..6efbde9a1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Gridded2d.python.cpp @@ -0,0 +1,106 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Gridded2d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Gridded2d +void wrapGridded2d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Gridded2d; + + // create the Python object + pybind11::class_ object( + module, "Gridded2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Axes &, + const g2d::Array & + >(), + pybind11::arg("axes"), + pybind11::arg("array"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const general::Axes &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const g2d::Array &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Gridded3d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Gridded3d.python.cpp new file mode 100644 index 000000000..693eec6d4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Gridded3d.python.cpp @@ -0,0 +1,134 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Gridded3d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Gridded3d +void wrapGridded3d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Gridded3d; + + // create the Python object + pybind11::class_ object( + module, "Gridded3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Axes &, + const g3d::Array & + >(), + pybind11::arg("axes"), + pybind11::arg("array"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const general::Axes &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const g3d::Array &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // shortcut: get/set lengths + object.def_property( + "lengths", + [](const cppCLASS &self) -> decltype(auto) + { + return self.lengths(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.lengths() = value; + }, + cppCLASS::component_t::documentation("lengths").data() + ); + + // shortcut: get/set starts + object.def_property( + "starts", + [](const cppCLASS &self) -> decltype(auto) + { + return self.starts(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.starts() = value; + }, + cppCLASS::component_t::documentation("starts").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Halflife.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Halflife.python.cpp new file mode 100644 index 000000000..5eb2f6641 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Halflife.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Halflife.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Halflife +void wrapHalflife(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Halflife; + + // create the Python object + pybind11::class_ object( + module, "Halflife", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("string") = std::nullopt, + pybind11::arg("double") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set string + object.def_property( + "string", + [](const cppCLASS &self) -> decltype(auto) + { + return self.string(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.string() = value; + }, + cppCLASS::component_t::documentation("string").data() + ); + + // get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/HardSphereRadius.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/HardSphereRadius.python.cpp new file mode 100644 index 000000000..a74e3b0cc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/HardSphereRadius.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/HardSphereRadius.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::HardSphereRadius +void wrapHardSphereRadius(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::HardSphereRadius; + + // create the Python object + pybind11::class_ object( + module, "HardSphereRadius", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Constant1d & + >(), + pybind11::arg("constant1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const general::Constant1d &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ImaginaryAnomalousFactor.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ImaginaryAnomalousFactor.python.cpp new file mode 100644 index 000000000..12cc556c8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ImaginaryAnomalousFactor.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ImaginaryAnomalousFactor.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ImaginaryAnomalousFactor +void wrapImaginaryAnomalousFactor(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ImaginaryAnomalousFactor; + + // create the Python object + pybind11::class_ object( + module, "ImaginaryAnomalousFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs1d & + >(), + pybind11::arg("xys1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const general::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ImaginaryInterferenceTerm.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ImaginaryInterferenceTerm.python.cpp new file mode 100644 index 000000000..0ed69a61f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ImaginaryInterferenceTerm.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ImaginaryInterferenceTerm.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ImaginaryInterferenceTerm +void wrapImaginaryInterferenceTerm(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ImaginaryInterferenceTerm; + + // create the Python object + pybind11::class_ object( + module, "ImaginaryInterferenceTerm", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("regions2d") = std::nullopt, + pybind11::arg("xys2d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set regions2d + object.def_property( + "regions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions2d() = value; + }, + cppCLASS::component_t::documentation("regions2d").data() + ); + + // get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncidentEnergies.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncidentEnergies.python.cpp new file mode 100644 index 000000000..a170eaea4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncidentEnergies.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/IncidentEnergies.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::IncidentEnergies +void wrapIncidentEnergies(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::IncidentEnergies; + + // create the Python object + pybind11::class_ object( + module, "IncidentEnergies", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("incident_energy"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set incidentEnergy + object.def_property( + "incident_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.incidentEnergy(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.incidentEnergy() = value; + }, + cppCLASS::component_t::documentation("incident_energy").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncidentEnergy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncidentEnergy.python.cpp new file mode 100644 index 000000000..00b2e0481 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncidentEnergy.python.cpp @@ -0,0 +1,262 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/IncidentEnergy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::IncidentEnergy +void wrapIncidentEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::IncidentEnergy; + + // create the Python object + pybind11::class_ object( + module, "IncidentEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const general::Energy &, + const general::Yields & + >(), + pybind11::arg("label"), + pybind11::arg("energy"), + pybind11::arg("yields"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set energy + object.def_property( + "energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energy(); + }, + [](cppCLASS &self, const general::Energy &value) + { + self.energy() = value; + }, + cppCLASS::component_t::documentation("energy").data() + ); + + // get/set yields + object.def_property( + "yields", + [](const cppCLASS &self) -> decltype(auto) + { + return self.yields(); + }, + [](cppCLASS &self, const general::Yields &value) + { + self.yields() = value; + }, + cppCLASS::component_t::documentation("yields").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set MadlandNix + object.def_property( + "madland_nix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.MadlandNix(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.MadlandNix() = value; + }, + cppCLASS::component_t::documentation("madland_nix").data() + ); + + // shortcut: get/set NBodyPhaseSpace + object.def_property( + "nbody_phase_space", + [](const cppCLASS &self) -> decltype(auto) + { + return self.NBodyPhaseSpace(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.NBodyPhaseSpace() = value; + }, + cppCLASS::component_t::documentation("nbody_phase_space").data() + ); + + // shortcut: get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // shortcut: get/set discreteGamma + object.def_property( + "discrete_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.discreteGamma(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.discreteGamma() = value; + }, + cppCLASS::component_t::documentation("discrete_gamma").data() + ); + + // shortcut: get/set evaporation + object.def_property( + "evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaporation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.evaporation() = value; + }, + cppCLASS::component_t::documentation("evaporation").data() + ); + + // shortcut: get/set generalEvaporation + object.def_property( + "general_evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.generalEvaporation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.generalEvaporation() = value; + }, + cppCLASS::component_t::documentation("general_evaporation").data() + ); + + // shortcut: get/set nuclides + object.def_property( + "nuclides", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nuclides(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.nuclides() = value; + }, + cppCLASS::component_t::documentation("nuclides").data() + ); + + // shortcut: get/set primaryGamma + object.def_property( + "primary_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.primaryGamma(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.primaryGamma() = value; + }, + cppCLASS::component_t::documentation("primary_gamma").data() + ); + + // shortcut: get/set simpleMaxwellianFission + object.def_property( + "simple_maxwellian_fission", + [](const cppCLASS &self) -> decltype(auto) + { + return self.simpleMaxwellianFission(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.simpleMaxwellianFission() = value; + }, + cppCLASS::component_t::documentation("simple_maxwellian_fission").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // shortcut: get/set weightedFunctionals + object.def_property( + "weighted_functionals", + [](const cppCLASS &self) -> decltype(auto) + { + return self.weightedFunctionals(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.weightedFunctionals() = value; + }, + cppCLASS::component_t::documentation("weighted_functionals").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncoherentPhotonScattering.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncoherentPhotonScattering.python.cpp new file mode 100644 index 000000000..cbc1eb7b5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncoherentPhotonScattering.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/IncoherentPhotonScattering.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::IncoherentPhotonScattering +void wrapIncoherentPhotonScattering(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::IncoherentPhotonScattering; + + // create the Python object + pybind11::class_ object( + module, "IncoherentPhotonScattering", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("href") = std::nullopt, + pybind11::arg("pid") = std::nullopt, + pybind11::arg("product_frame") = std::nullopt, + pybind11::arg("scattering_factor") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set scatteringFactor + object.def_property( + "scattering_factor", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringFactor(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.scatteringFactor() = value; + }, + cppCLASS::component_t::documentation("scattering_factor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncompleteReactions.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncompleteReactions.python.cpp new file mode 100644 index 000000000..0468c8a1d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/IncompleteReactions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/IncompleteReactions.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::IncompleteReactions +void wrapIncompleteReactions(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::IncompleteReactions; + + // create the Python object + pybind11::class_ object( + module, "IncompleteReactions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("reaction"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set reaction + object.def_property( + "reaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reaction(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.reaction() = value; + }, + cppCLASS::component_t::documentation("reaction").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Institution.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Institution.python.cpp new file mode 100644 index 000000000..bf2403b03 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Institution.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Institution.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Institution +void wrapInstitution(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Institution; + + // create the Python object + pybind11::class_ object( + module, "Institution", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const general::ENDFconversionFlags & + >(), + pybind11::arg("label") = std::nullopt, + pybind11::arg("endfconversion_flags"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set ENDFconversionFlags + object.def_property( + "endfconversion_flags", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDFconversionFlags(); + }, + [](cppCLASS &self, const general::ENDFconversionFlags &value) + { + self.ENDFconversionFlags() = value; + }, + cppCLASS::component_t::documentation("endfconversion_flags").data() + ); + + // shortcut: get/set conversion + object.def_property( + "conversion", + [](const cppCLASS &self) -> decltype(auto) + { + return self.conversion(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.conversion() = value; + }, + cppCLASS::component_t::documentation("conversion").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Integer.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Integer.python.cpp new file mode 100644 index 000000000..c594ee494 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Integer.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Integer.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Integer +void wrapInteger(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Integer; + + // create the Python object + pybind11::class_ object( + module, "Integer", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("value"), + pybind11::arg("unit") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const int &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Intensity.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Intensity.python.cpp new file mode 100644 index 000000000..440ce8dc1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Intensity.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Intensity.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Intensity +void wrapIntensity(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Intensity; + + // create the Python object + pybind11::class_ object( + module, "Intensity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const std::optional & + >(), + pybind11::arg("value"), + pybind11::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/InternalConversionCoefficients.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/InternalConversionCoefficients.python.cpp new file mode 100644 index 000000000..ae408b241 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/InternalConversionCoefficients.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/InternalConversionCoefficients.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::InternalConversionCoefficients +void wrapInternalConversionCoefficients(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::InternalConversionCoefficients; + + // create the Python object + pybind11::class_ object( + module, "InternalConversionCoefficients", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("shell"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set shell + object.def_property( + "shell", + [](const cppCLASS &self) -> decltype(auto) + { + return self.shell(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.shell() = value; + }, + cppCLASS::component_t::documentation("shell").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotope.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotope.python.cpp new file mode 100644 index 000000000..82fc86da2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotope.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Isotope.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Isotope +void wrapIsotope(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Isotope; + + // create the Python object + pybind11::class_ object( + module, "Isotope", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const general::Nuclides & + >(), + pybind11::arg("symbol"), + pybind11::arg("a"), + pybind11::arg("nuclides"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set symbol + object.def_property( + "symbol", + [](const cppCLASS &self) -> decltype(auto) + { + return self.symbol(); + }, + [](cppCLASS &self, const std::string &value) + { + self.symbol() = value; + }, + cppCLASS::component_t::documentation("symbol").data() + ); + + // get/set A + object.def_property( + "a", + [](const cppCLASS &self) -> decltype(auto) + { + return self.A(); + }, + [](cppCLASS &self, const int &value) + { + self.A() = value; + }, + cppCLASS::component_t::documentation("a").data() + ); + + // get/set nuclides + object.def_property( + "nuclides", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nuclides(); + }, + [](cppCLASS &self, const general::Nuclides &value) + { + self.nuclides() = value; + }, + cppCLASS::component_t::documentation("nuclides").data() + ); + + // shortcut: get/set nuclide + object.def_property( + "nuclide", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nuclide(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.nuclide() = value; + }, + cppCLASS::component_t::documentation("nuclide").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotopes.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotopes.python.cpp new file mode 100644 index 000000000..d0159f44a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotopes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Isotopes.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Isotopes +void wrapIsotopes(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Isotopes; + + // create the Python object + pybind11::class_ object( + module, "Isotopes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("isotope"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set isotope + object.def_property( + "isotope", + [](const cppCLASS &self) -> decltype(auto) + { + return self.isotope(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.isotope() = value; + }, + cppCLASS::component_t::documentation("isotope").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotropic2d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotropic2d.python.cpp new file mode 100644 index 000000000..fcb5f3870 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Isotropic2d.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Isotropic2d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Isotropic2d +void wrapIsotropic2d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Isotropic2d; + + // create the Python object + pybind11::class_ object( + module, "Isotropic2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/J.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/J.python.cpp new file mode 100644 index 000000000..679ed4c23 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/J.python.cpp @@ -0,0 +1,124 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/J.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::J +void wrapJ(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::J; + + // create the Python object + pybind11::class_ object( + module, "J", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const general::LevelSpacing &, + const general::Widths & + >(), + pybind11::arg("label"), + pybind11::arg("value"), + pybind11::arg("level_spacing"), + pybind11::arg("widths"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const int &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set levelSpacing + object.def_property( + "level_spacing", + [](const cppCLASS &self) -> decltype(auto) + { + return self.levelSpacing(); + }, + [](cppCLASS &self, const general::LevelSpacing &value) + { + self.levelSpacing() = value; + }, + cppCLASS::component_t::documentation("level_spacing").data() + ); + + // get/set widths + object.def_property( + "widths", + [](const cppCLASS &self) -> decltype(auto) + { + return self.widths(); + }, + [](cppCLASS &self, const general::Widths &value) + { + self.widths() = value; + }, + cppCLASS::component_t::documentation("widths").data() + ); + + // shortcut: get/set width + object.def_property( + "width", + [](const cppCLASS &self) -> decltype(auto) + { + return self.width(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.width() = value; + }, + cppCLASS::component_t::documentation("width").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Js.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Js.python.cpp new file mode 100644 index 000000000..edcc0e43e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Js.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Js.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Js +void wrapJs(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Js; + + // create the Python object + pybind11::class_ object( + module, "Js", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("j"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set J + object.def_property( + "j", + [](const cppCLASS &self) -> decltype(auto) + { + return self.J(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.J() = value; + }, + cppCLASS::component_t::documentation("j").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/KalbachMann.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/KalbachMann.python.cpp new file mode 100644 index 000000000..cd9b8acac --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/KalbachMann.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/KalbachMann.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::KalbachMann +void wrapKalbachMann(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::KalbachMann; + + // create the Python object + pybind11::class_ object( + module, "KalbachMann", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("product_frame"), + pybind11::arg("f") = std::nullopt, + pybind11::arg("r") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::string &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set f + object.def_property( + "f", + [](const cppCLASS &self) -> decltype(auto) + { + return self.f(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.f() = value; + }, + cppCLASS::component_t::documentation("f").data() + ); + + // get/set r + object.def_property( + "r", + [](const cppCLASS &self) -> decltype(auto) + { + return self.r(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.r() = value; + }, + cppCLASS::component_t::documentation("r").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/L.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/L.python.cpp new file mode 100644 index 000000000..0490567a5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/L.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/L.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::L +void wrapL(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::L; + + // create the Python object + pybind11::class_ object( + module, "L", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const general::Js & + >(), + pybind11::arg("label"), + pybind11::arg("value"), + pybind11::arg("js"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const int &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set Js + object.def_property( + "js", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Js(); + }, + [](cppCLASS &self, const general::Js &value) + { + self.Js() = value; + }, + cppCLASS::component_t::documentation("js").data() + ); + + // shortcut: get/set J + object.def_property( + "j", + [](const cppCLASS &self) -> decltype(auto) + { + return self.J(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.J() = value; + }, + cppCLASS::component_t::documentation("j").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Legendre.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Legendre.python.cpp new file mode 100644 index 000000000..63a46f8b9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Legendre.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Legendre.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Legendre +void wrapLegendre(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Legendre; + + // create the Python object + pybind11::class_ object( + module, "Legendre", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const general::Values & + >(), + pybind11::arg("outer_domain_value"), + pybind11::arg("values"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set outerDomainValue + object.def_property( + "outer_domain_value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outerDomainValue(); + }, + [](cppCLASS &self, const double &value) + { + self.outerDomainValue() = value; + }, + cppCLASS::component_t::documentation("outer_domain_value").data() + ); + + // get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const general::Values &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Lepton.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Lepton.python.cpp new file mode 100644 index 000000000..ac3973e76 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Lepton.python.cpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Lepton.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Lepton +void wrapLepton(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Lepton; + + // create the Python object + pybind11::class_ object( + module, "Lepton", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const general::Mass &, + const general::Spin &, + const general::Parity &, + const general::Charge &, + const general::Halflife & + >(), + pybind11::arg("id"), + pybind11::arg("generation"), + pybind11::arg("mass"), + pybind11::arg("spin"), + pybind11::arg("parity"), + pybind11::arg("charge"), + pybind11::arg("halflife"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set id + object.def_property( + "id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.id(); + }, + [](cppCLASS &self, const std::string &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set generation + object.def_property( + "generation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.generation(); + }, + [](cppCLASS &self, const std::string &value) + { + self.generation() = value; + }, + cppCLASS::component_t::documentation("generation").data() + ); + + // get/set mass + object.def_property( + "mass", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mass(); + }, + [](cppCLASS &self, const general::Mass &value) + { + self.mass() = value; + }, + cppCLASS::component_t::documentation("mass").data() + ); + + // get/set spin + object.def_property( + "spin", + [](const cppCLASS &self) -> decltype(auto) + { + return self.spin(); + }, + [](cppCLASS &self, const general::Spin &value) + { + self.spin() = value; + }, + cppCLASS::component_t::documentation("spin").data() + ); + + // get/set parity + object.def_property( + "parity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parity(); + }, + [](cppCLASS &self, const general::Parity &value) + { + self.parity() = value; + }, + cppCLASS::component_t::documentation("parity").data() + ); + + // get/set charge + object.def_property( + "charge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.charge(); + }, + [](cppCLASS &self, const general::Charge &value) + { + self.charge() = value; + }, + cppCLASS::component_t::documentation("charge").data() + ); + + // get/set halflife + object.def_property( + "halflife", + [](const cppCLASS &self) -> decltype(auto) + { + return self.halflife(); + }, + [](cppCLASS &self, const general::Halflife &value) + { + self.halflife() = value; + }, + cppCLASS::component_t::documentation("halflife").data() + ); + + // shortcut: get/set fraction + object.def_property( + "fraction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fraction(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.fraction() = value; + }, + cppCLASS::component_t::documentation("fraction").data() + ); + + // shortcut: get/set string + object.def_property( + "string", + [](const cppCLASS &self) -> decltype(auto) + { + return self.string(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.string() = value; + }, + cppCLASS::component_t::documentation("string").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Leptons.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Leptons.python.cpp new file mode 100644 index 000000000..cac768f93 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Leptons.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Leptons.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Leptons +void wrapLeptons(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Leptons; + + // create the Python object + pybind11::class_ object( + module, "Leptons", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("lepton"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set lepton + object.def_property( + "lepton", + [](const cppCLASS &self) -> decltype(auto) + { + return self.lepton(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.lepton() = value; + }, + cppCLASS::component_t::documentation("lepton").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/LevelSpacing.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/LevelSpacing.python.cpp new file mode 100644 index 000000000..fbc7d697f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/LevelSpacing.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/LevelSpacing.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::LevelSpacing +void wrapLevelSpacing(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::LevelSpacing; + + // create the Python object + pybind11::class_ object( + module, "LevelSpacing", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("xys1d") = std::nullopt, + pybind11::arg("constant1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Link.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Link.python.cpp new file mode 100644 index 000000000..892bf23cc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Link.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Link.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Link +void wrapLink(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Link; + + // create the Python object + pybind11::class_ object( + module, "Link", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string & + >(), + pybind11::arg("href"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ListOfCovariances.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ListOfCovariances.python.cpp new file mode 100644 index 000000000..ab35001d1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ListOfCovariances.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ListOfCovariances.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ListOfCovariances +void wrapListOfCovariances(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ListOfCovariances; + + // create the Python object + pybind11::class_ object( + module, "ListOfCovariances", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("covariance"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set covariance + object.def_property( + "covariance", + [](const cppCLASS &self) -> decltype(auto) + { + return self.covariance(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.covariance() = value; + }, + cppCLASS::component_t::documentation("covariance").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Ls.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Ls.python.cpp new file mode 100644 index 000000000..f6df2513f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Ls.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Ls.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Ls +void wrapLs(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Ls; + + // create the Python object + pybind11::class_ object( + module, "Ls", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("l"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set L + object.def_property( + "l", + [](const cppCLASS &self) -> decltype(auto) + { + return self.L(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.L() = value; + }, + cppCLASS::component_t::documentation("l").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MadlandNix.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MadlandNix.python.cpp new file mode 100644 index 000000000..fd6c7ef84 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MadlandNix.python.cpp @@ -0,0 +1,150 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/MadlandNix.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::MadlandNix +void wrapMadlandNix(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::MadlandNix; + + // create the Python object + pybind11::class_ object( + module, "MadlandNix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::EFL &, + const general::EFH &, + const general::T_M & + >(), + pybind11::arg("efl"), + pybind11::arg("efh"), + pybind11::arg("t_m"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set EFL + object.def_property( + "efl", + [](const cppCLASS &self) -> decltype(auto) + { + return self.EFL(); + }, + [](cppCLASS &self, const general::EFL &value) + { + self.EFL() = value; + }, + cppCLASS::component_t::documentation("efl").data() + ); + + // get/set EFH + object.def_property( + "efh", + [](const cppCLASS &self) -> decltype(auto) + { + return self.EFH(); + }, + [](cppCLASS &self, const general::EFH &value) + { + self.EFH() = value; + }, + cppCLASS::component_t::documentation("efh").data() + ); + + // get/set T_M + object.def_property( + "t_m", + [](const cppCLASS &self) -> decltype(auto) + { + return self.T_M(); + }, + [](cppCLASS &self, const general::T_M &value) + { + self.T_M() = value; + }, + cppCLASS::component_t::documentation("t_m").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Mass.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Mass.python.cpp new file mode 100644 index 000000000..71dda96cf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Mass.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Mass.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Mass +void wrapMass(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Mass; + + // create the Python object + pybind11::class_ object( + module, "Mass", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("value") = std::nullopt, + pybind11::arg("unit") = std::nullopt, + pybind11::arg("double") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MetaStable.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MetaStable.python.cpp new file mode 100644 index 000000000..1a8760300 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MetaStable.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/MetaStable.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::MetaStable +void wrapMetaStable(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::MetaStable; + + // create the Python object + pybind11::class_ object( + module, "MetaStable", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const int & + >(), + pybind11::arg("id"), + pybind11::arg("pid"), + pybind11::arg("meta_stable_index"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set id + object.def_property( + "id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.id(); + }, + [](cppCLASS &self, const std::string &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::string &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set metaStableIndex + object.def_property( + "meta_stable_index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.metaStableIndex(); + }, + [](cppCLASS &self, const int &value) + { + self.metaStableIndex() = value; + }, + cppCLASS::component_t::documentation("meta_stable_index").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Mixed.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Mixed.python.cpp new file mode 100644 index 000000000..800e5729f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Mixed.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Mixed.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Mixed +void wrapMixed(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Mixed; + + // create the Python object + pybind11::class_ object( + module, "Mixed", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::vector &, + const std::optional> &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("covariance_matrix"), + pybind11::arg("sum") = std::nullopt, + pybind11::arg("short_range_self_scaling_variance") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set covarianceMatrix + object.def_property( + "covariance_matrix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.covarianceMatrix(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.covarianceMatrix() = value; + }, + cppCLASS::component_t::documentation("covariance_matrix").data() + ); + + // get/set sum + object.def_property( + "sum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.sum(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.sum() = value; + }, + cppCLASS::component_t::documentation("sum").data() + ); + + // get/set shortRangeSelfScalingVariance + object.def_property( + "short_range_self_scaling_variance", + [](const cppCLASS &self) -> decltype(auto) + { + return self.shortRangeSelfScalingVariance(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.shortRangeSelfScalingVariance() = value; + }, + cppCLASS::component_t::documentation("short_range_self_scaling_variance").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Multiplicity.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Multiplicity.python.cpp new file mode 100644 index 000000000..26e2d1124 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Multiplicity.python.cpp @@ -0,0 +1,174 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Multiplicity.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Multiplicity +void wrapMultiplicity(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Multiplicity; + + // create the Python object + pybind11::class_ object( + module, "Multiplicity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("constant1d") = std::nullopt, + pybind11::arg("xys1d") = std::nullopt, + pybind11::arg("regions1d") = std::nullopt, + pybind11::arg("polynomial1d") = std::nullopt, + pybind11::arg("reference") = std::nullopt, + pybind11::arg("branching1d") = std::nullopt, + pybind11::arg("branching3d") = std::nullopt, + pybind11::arg("unspecified") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // get/set branching1d + object.def_property( + "branching1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.branching1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.branching1d() = value; + }, + cppCLASS::component_t::documentation("branching1d").data() + ); + + // get/set branching3d + object.def_property( + "branching3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.branching3d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.branching3d() = value; + }, + cppCLASS::component_t::documentation("branching3d").data() + ); + + // get/set unspecified + object.def_property( + "unspecified", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unspecified(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unspecified() = value; + }, + cppCLASS::component_t::documentation("unspecified").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MultiplicitySum.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MultiplicitySum.python.cpp new file mode 100644 index 000000000..73b95546c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MultiplicitySum.python.cpp @@ -0,0 +1,236 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/MultiplicitySum.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::MultiplicitySum +void wrapMultiplicitySum(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::MultiplicitySum; + + // create the Python object + pybind11::class_ object( + module, "MultiplicitySum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const general::Multiplicity &, + const general::Summands & + >(), + pybind11::arg("label"), + pybind11::arg("endf_mt"), + pybind11::arg("multiplicity"), + pybind11::arg("summands"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set ENDF_MT + object.def_property( + "endf_mt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDF_MT(); + }, + [](cppCLASS &self, const int &value) + { + self.ENDF_MT() = value; + }, + cppCLASS::component_t::documentation("endf_mt").data() + ); + + // get/set multiplicity + object.def_property( + "multiplicity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.multiplicity(); + }, + [](cppCLASS &self, const general::Multiplicity &value) + { + self.multiplicity() = value; + }, + cppCLASS::component_t::documentation("multiplicity").data() + ); + + // get/set summands + object.def_property( + "summands", + [](const cppCLASS &self) -> decltype(auto) + { + return self.summands(); + }, + [](cppCLASS &self, const general::Summands &value) + { + self.summands() = value; + }, + cppCLASS::component_t::documentation("summands").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set add + object.def_property( + "add", + [](const cppCLASS &self) -> decltype(auto) + { + return self.add(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.add() = value; + }, + cppCLASS::component_t::documentation("add").data() + ); + + // shortcut: get/set branching1d + object.def_property( + "branching1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.branching1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.branching1d() = value; + }, + cppCLASS::component_t::documentation("branching1d").data() + ); + + // shortcut: get/set branching3d + object.def_property( + "branching3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.branching3d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.branching3d() = value; + }, + cppCLASS::component_t::documentation("branching3d").data() + ); + + // shortcut: get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // shortcut: get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // shortcut: get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set unspecified + object.def_property( + "unspecified", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unspecified(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.unspecified() = value; + }, + cppCLASS::component_t::documentation("unspecified").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MultiplicitySums.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MultiplicitySums.python.cpp new file mode 100644 index 000000000..3f9a1df20 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/MultiplicitySums.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/MultiplicitySums.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::MultiplicitySums +void wrapMultiplicitySums(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::MultiplicitySums; + + // create the Python object + pybind11::class_ object( + module, "MultiplicitySums", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("multiplicity_sum"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set multiplicitySum + object.def_property( + "multiplicity_sum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.multiplicitySum(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.multiplicitySum() = value; + }, + cppCLASS::component_t::documentation("multiplicity_sum").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NBodyPhaseSpace.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NBodyPhaseSpace.python.cpp new file mode 100644 index 000000000..48d9911f6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NBodyPhaseSpace.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/NBodyPhaseSpace.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NBodyPhaseSpace +void wrapNBodyPhaseSpace(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::NBodyPhaseSpace; + + // create the Python object + pybind11::class_ object( + module, "NBodyPhaseSpace", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const int &, + const general::Mass & + >(), + pybind11::arg("number_of_products"), + pybind11::arg("mass"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set numberOfProducts + object.def_property( + "number_of_products", + [](const cppCLASS &self) -> decltype(auto) + { + return self.numberOfProducts(); + }, + [](cppCLASS &self, const int &value) + { + self.numberOfProducts() = value; + }, + cppCLASS::component_t::documentation("number_of_products").data() + ); + + // get/set mass + object.def_property( + "mass", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mass(); + }, + [](cppCLASS &self, const general::Mass &value) + { + self.mass() = value; + }, + cppCLASS::component_t::documentation("mass").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NeutrinoEnergy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NeutrinoEnergy.python.cpp new file mode 100644 index 000000000..831df3b13 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NeutrinoEnergy.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/NeutrinoEnergy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NeutrinoEnergy +void wrapNeutrinoEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::NeutrinoEnergy; + + // create the Python object + pybind11::class_ object( + module, "NeutrinoEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Polynomial1d & + >(), + pybind11::arg("polynomial1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const general::Polynomial1d &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NonNeutrinoEnergy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NonNeutrinoEnergy.python.cpp new file mode 100644 index 000000000..64df4ac72 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NonNeutrinoEnergy.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/NonNeutrinoEnergy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NonNeutrinoEnergy +void wrapNonNeutrinoEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::NonNeutrinoEnergy; + + // create the Python object + pybind11::class_ object( + module, "NonNeutrinoEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Polynomial1d & + >(), + pybind11::arg("polynomial1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const general::Polynomial1d &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearAmplitudeExpansion.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearAmplitudeExpansion.python.cpp new file mode 100644 index 000000000..8da8ca5bf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearAmplitudeExpansion.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/NuclearAmplitudeExpansion.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NuclearAmplitudeExpansion +void wrapNuclearAmplitudeExpansion(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::NuclearAmplitudeExpansion; + + // create the Python object + pybind11::class_ object( + module, "NuclearAmplitudeExpansion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::NuclearTerm &, + const general::RealInterferenceTerm &, + const general::ImaginaryInterferenceTerm & + >(), + pybind11::arg("nuclear_term"), + pybind11::arg("real_interference_term"), + pybind11::arg("imaginary_interference_term"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set nuclearTerm + object.def_property( + "nuclear_term", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nuclearTerm(); + }, + [](cppCLASS &self, const general::NuclearTerm &value) + { + self.nuclearTerm() = value; + }, + cppCLASS::component_t::documentation("nuclear_term").data() + ); + + // get/set realInterferenceTerm + object.def_property( + "real_interference_term", + [](const cppCLASS &self) -> decltype(auto) + { + return self.realInterferenceTerm(); + }, + [](cppCLASS &self, const general::RealInterferenceTerm &value) + { + self.realInterferenceTerm() = value; + }, + cppCLASS::component_t::documentation("real_interference_term").data() + ); + + // get/set imaginaryInterferenceTerm + object.def_property( + "imaginary_interference_term", + [](const cppCLASS &self) -> decltype(auto) + { + return self.imaginaryInterferenceTerm(); + }, + [](cppCLASS &self, const general::ImaginaryInterferenceTerm &value) + { + self.imaginaryInterferenceTerm() = value; + }, + cppCLASS::component_t::documentation("imaginary_interference_term").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearPlusInterference.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearPlusInterference.python.cpp new file mode 100644 index 000000000..164a0c839 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearPlusInterference.python.cpp @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/NuclearPlusInterference.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NuclearPlusInterference +void wrapNuclearPlusInterference(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::NuclearPlusInterference; + + // create the Python object + pybind11::class_ object( + module, "NuclearPlusInterference", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const reduced::CrossSection &, + const reduced::Distribution & + >(), + pybind11::arg("mu_cutoff"), + pybind11::arg("cross_section"), + pybind11::arg("distribution"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set muCutoff + object.def_property( + "mu_cutoff", + [](const cppCLASS &self) -> decltype(auto) + { + return self.muCutoff(); + }, + [](cppCLASS &self, const double &value) + { + self.muCutoff() = value; + }, + cppCLASS::component_t::documentation("mu_cutoff").data() + ); + + // get/set crossSection + object.def_property( + "cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSection(); + }, + [](cppCLASS &self, const reduced::CrossSection &value) + { + self.crossSection() = value; + }, + cppCLASS::component_t::documentation("cross_section").data() + ); + + // get/set distribution + object.def_property( + "distribution", + [](const cppCLASS &self) -> decltype(auto) + { + return self.distribution(); + }, + [](cppCLASS &self, const reduced::Distribution &value) + { + self.distribution() = value; + }, + cppCLASS::component_t::documentation("distribution").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // shortcut: get/set branching3d + object.def_property( + "branching3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.branching3d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.branching3d() = value; + }, + cppCLASS::component_t::documentation("branching3d").data() + ); + + // shortcut: get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set thermalNeutronScatteringLaw + object.def_property( + "thermal_neutron_scattering_law", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.thermalNeutronScatteringLaw() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law").data() + ); + + // shortcut: get/set uncorrelated + object.def_property( + "uncorrelated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncorrelated(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncorrelated() = value; + }, + cppCLASS::component_t::documentation("uncorrelated").data() + ); + + // shortcut: get/set unspecified + object.def_property( + "unspecified", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unspecified(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.unspecified() = value; + }, + cppCLASS::component_t::documentation("unspecified").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearTerm.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearTerm.python.cpp new file mode 100644 index 000000000..a0160d01d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/NuclearTerm.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/NuclearTerm.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::NuclearTerm +void wrapNuclearTerm(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::NuclearTerm; + + // create the Python object + pybind11::class_ object( + module, "NuclearTerm", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("regions2d") = std::nullopt, + pybind11::arg("xys2d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set regions2d + object.def_property( + "regions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions2d() = value; + }, + cppCLASS::component_t::documentation("regions2d").data() + ); + + // get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nucleus.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nucleus.python.cpp new file mode 100644 index 000000000..f66a3c7ee --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nucleus.python.cpp @@ -0,0 +1,316 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Nucleus.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Nucleus +void wrapNucleus(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Nucleus; + + // create the Python object + pybind11::class_ object( + module, "Nucleus", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const std::optional &, + const std::optional &, + const std::optional &, + const general::Charge &, + const std::optional &, + const general::Energy &, + const std::optional & + >(), + pybind11::arg("id"), + pybind11::arg("index"), + pybind11::arg("mass") = std::nullopt, + pybind11::arg("spin") = std::nullopt, + pybind11::arg("parity") = std::nullopt, + pybind11::arg("charge"), + pybind11::arg("halflife") = std::nullopt, + pybind11::arg("energy"), + pybind11::arg("decay_data") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set id + object.def_property( + "id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.id(); + }, + [](cppCLASS &self, const std::string &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set index + object.def_property( + "index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.index(); + }, + [](cppCLASS &self, const int &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set mass + object.def_property( + "mass", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mass(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.mass() = value; + }, + cppCLASS::component_t::documentation("mass").data() + ); + + // get/set spin + object.def_property( + "spin", + [](const cppCLASS &self) -> decltype(auto) + { + return self.spin(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.spin() = value; + }, + cppCLASS::component_t::documentation("spin").data() + ); + + // get/set parity + object.def_property( + "parity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parity(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.parity() = value; + }, + cppCLASS::component_t::documentation("parity").data() + ); + + // get/set charge + object.def_property( + "charge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.charge(); + }, + [](cppCLASS &self, const general::Charge &value) + { + self.charge() = value; + }, + cppCLASS::component_t::documentation("charge").data() + ); + + // get/set halflife + object.def_property( + "halflife", + [](const cppCLASS &self) -> decltype(auto) + { + return self.halflife(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.halflife() = value; + }, + cppCLASS::component_t::documentation("halflife").data() + ); + + // get/set energy + object.def_property( + "energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energy(); + }, + [](cppCLASS &self, const general::Energy &value) + { + self.energy() = value; + }, + cppCLASS::component_t::documentation("energy").data() + ); + + // get/set decayData + object.def_property( + "decay_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.decayData(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.decayData() = value; + }, + cppCLASS::component_t::documentation("decay_data").data() + ); + + // shortcut: get/set MadlandNix + object.def_property( + "madland_nix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.MadlandNix(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.MadlandNix() = value; + }, + cppCLASS::component_t::documentation("madland_nix").data() + ); + + // shortcut: get/set NBodyPhaseSpace + object.def_property( + "nbody_phase_space", + [](const cppCLASS &self) -> decltype(auto) + { + return self.NBodyPhaseSpace(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.NBodyPhaseSpace() = value; + }, + cppCLASS::component_t::documentation("nbody_phase_space").data() + ); + + // shortcut: get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // shortcut: get/set discreteGamma + object.def_property( + "discrete_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.discreteGamma(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.discreteGamma() = value; + }, + cppCLASS::component_t::documentation("discrete_gamma").data() + ); + + // shortcut: get/set evaporation + object.def_property( + "evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaporation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.evaporation() = value; + }, + cppCLASS::component_t::documentation("evaporation").data() + ); + + // shortcut: get/set generalEvaporation + object.def_property( + "general_evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.generalEvaporation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.generalEvaporation() = value; + }, + cppCLASS::component_t::documentation("general_evaporation").data() + ); + + // shortcut: get/set primaryGamma + object.def_property( + "primary_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.primaryGamma(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.primaryGamma() = value; + }, + cppCLASS::component_t::documentation("primary_gamma").data() + ); + + // shortcut: get/set simpleMaxwellianFission + object.def_property( + "simple_maxwellian_fission", + [](const cppCLASS &self) -> decltype(auto) + { + return self.simpleMaxwellianFission(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.simpleMaxwellianFission() = value; + }, + cppCLASS::component_t::documentation("simple_maxwellian_fission").data() + ); + + // shortcut: get/set weightedFunctionals + object.def_property( + "weighted_functionals", + [](const cppCLASS &self) -> decltype(auto) + { + return self.weightedFunctionals(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.weightedFunctionals() = value; + }, + cppCLASS::component_t::documentation("weighted_functionals").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nuclide.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nuclide.python.cpp new file mode 100644 index 000000000..8ae0f0f0f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nuclide.python.cpp @@ -0,0 +1,324 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Nuclide.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Nuclide +void wrapNuclide(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Nuclide; + + // create the Python object + pybind11::class_ object( + module, "Nuclide", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const general::Charge &, + const general::Nucleus &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("id"), + pybind11::arg("mass") = std::nullopt, + pybind11::arg("charge"), + pybind11::arg("nucleus"), + pybind11::arg("decay_data") = std::nullopt, + pybind11::arg("fission_fragment_data") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set id + object.def_property( + "id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.id(); + }, + [](cppCLASS &self, const std::string &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set mass + object.def_property( + "mass", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mass(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.mass() = value; + }, + cppCLASS::component_t::documentation("mass").data() + ); + + // get/set charge + object.def_property( + "charge", + [](const cppCLASS &self) -> decltype(auto) + { + return self.charge(); + }, + [](cppCLASS &self, const general::Charge &value) + { + self.charge() = value; + }, + cppCLASS::component_t::documentation("charge").data() + ); + + // get/set nucleus + object.def_property( + "nucleus", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nucleus(); + }, + [](cppCLASS &self, const general::Nucleus &value) + { + self.nucleus() = value; + }, + cppCLASS::component_t::documentation("nucleus").data() + ); + + // get/set decayData + object.def_property( + "decay_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.decayData(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.decayData() = value; + }, + cppCLASS::component_t::documentation("decay_data").data() + ); + + // get/set fissionFragmentData + object.def_property( + "fission_fragment_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionFragmentData(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.fissionFragmentData() = value; + }, + cppCLASS::component_t::documentation("fission_fragment_data").data() + ); + + // shortcut: get/set MadlandNix + object.def_property( + "madland_nix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.MadlandNix(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.MadlandNix() = value; + }, + cppCLASS::component_t::documentation("madland_nix").data() + ); + + // shortcut: get/set NBodyPhaseSpace + object.def_property( + "nbody_phase_space", + [](const cppCLASS &self) -> decltype(auto) + { + return self.NBodyPhaseSpace(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.NBodyPhaseSpace() = value; + }, + cppCLASS::component_t::documentation("nbody_phase_space").data() + ); + + // shortcut: get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // shortcut: get/set discreteGamma + object.def_property( + "discrete_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.discreteGamma(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.discreteGamma() = value; + }, + cppCLASS::component_t::documentation("discrete_gamma").data() + ); + + // shortcut: get/set energy + object.def_property( + "energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energy(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.energy() = value; + }, + cppCLASS::component_t::documentation("energy").data() + ); + + // shortcut: get/set evaporation + object.def_property( + "evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaporation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.evaporation() = value; + }, + cppCLASS::component_t::documentation("evaporation").data() + ); + + // shortcut: get/set generalEvaporation + object.def_property( + "general_evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.generalEvaporation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.generalEvaporation() = value; + }, + cppCLASS::component_t::documentation("general_evaporation").data() + ); + + // shortcut: get/set halflife + object.def_property( + "halflife", + [](const cppCLASS &self) -> decltype(auto) + { + return self.halflife(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.halflife() = value; + }, + cppCLASS::component_t::documentation("halflife").data() + ); + + // shortcut: get/set parity + object.def_property( + "parity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parity(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.parity() = value; + }, + cppCLASS::component_t::documentation("parity").data() + ); + + // shortcut: get/set primaryGamma + object.def_property( + "primary_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.primaryGamma(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.primaryGamma() = value; + }, + cppCLASS::component_t::documentation("primary_gamma").data() + ); + + // shortcut: get/set simpleMaxwellianFission + object.def_property( + "simple_maxwellian_fission", + [](const cppCLASS &self) -> decltype(auto) + { + return self.simpleMaxwellianFission(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.simpleMaxwellianFission() = value; + }, + cppCLASS::component_t::documentation("simple_maxwellian_fission").data() + ); + + // shortcut: get/set spin + object.def_property( + "spin", + [](const cppCLASS &self) -> decltype(auto) + { + return self.spin(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.spin() = value; + }, + cppCLASS::component_t::documentation("spin").data() + ); + + // shortcut: get/set weightedFunctionals + object.def_property( + "weighted_functionals", + [](const cppCLASS &self) -> decltype(auto) + { + return self.weightedFunctionals(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.weightedFunctionals() = value; + }, + cppCLASS::component_t::documentation("weighted_functionals").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nuclides.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nuclides.python.cpp new file mode 100644 index 000000000..b8da86048 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Nuclides.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Nuclides.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Nuclides +void wrapNuclides(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Nuclides; + + // create the Python object + pybind11::class_ object( + module, "Nuclides", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("nuclide"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set nuclide + object.def_property( + "nuclide", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nuclide(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.nuclide() = value; + }, + cppCLASS::component_t::documentation("nuclide").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OrphanProduct.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OrphanProduct.python.cpp new file mode 100644 index 000000000..fd6541e66 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OrphanProduct.python.cpp @@ -0,0 +1,264 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/OrphanProduct.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::OrphanProduct +void wrapOrphanProduct(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::OrphanProduct; + + // create the Python object + pybind11::class_ object( + module, "OrphanProduct", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const general::CrossSection &, + const general::OutputChannel & + >(), + pybind11::arg("label"), + pybind11::arg("endf_mt"), + pybind11::arg("cross_section"), + pybind11::arg("output_channel"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set ENDF_MT + object.def_property( + "endf_mt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDF_MT(); + }, + [](cppCLASS &self, const int &value) + { + self.ENDF_MT() = value; + }, + cppCLASS::component_t::documentation("endf_mt").data() + ); + + // get/set crossSection + object.def_property( + "cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSection(); + }, + [](cppCLASS &self, const general::CrossSection &value) + { + self.crossSection() = value; + }, + cppCLASS::component_t::documentation("cross_section").data() + ); + + // get/set outputChannel + object.def_property( + "output_channel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outputChannel(); + }, + [](cppCLASS &self, const general::OutputChannel &value) + { + self.outputChannel() = value; + }, + cppCLASS::component_t::documentation("output_channel").data() + ); + + // shortcut: get/set CoulombPlusNuclearElastic + object.def_property( + "coulomb_plus_nuclear_elastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.CoulombPlusNuclearElastic(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.CoulombPlusNuclearElastic() = value; + }, + cppCLASS::component_t::documentation("coulomb_plus_nuclear_elastic").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set Q + object.def_property( + "q", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Q(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Q() = value; + }, + cppCLASS::component_t::documentation("q").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // shortcut: get/set fissionFragmentData + object.def_property( + "fission_fragment_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionFragmentData(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.fissionFragmentData() = value; + }, + cppCLASS::component_t::documentation("fission_fragment_data").data() + ); + + // shortcut: get/set products + object.def_property( + "products", + [](const cppCLASS &self) -> decltype(auto) + { + return self.products(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.products() = value; + }, + cppCLASS::component_t::documentation("products").data() + ); + + // shortcut: get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set resonancesWithBackground + object.def_property( + "resonances_with_background", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonancesWithBackground(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.resonancesWithBackground() = value; + }, + cppCLASS::component_t::documentation("resonances_with_background").data() + ); + + // shortcut: get/set thermalNeutronScatteringLaw1d + object.def_property( + "thermal_neutron_scattering_law1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.thermalNeutronScatteringLaw1d() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OrphanProducts.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OrphanProducts.python.cpp new file mode 100644 index 000000000..716e84edc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OrphanProducts.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/OrphanProducts.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::OrphanProducts +void wrapOrphanProducts(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::OrphanProducts; + + // create the Python object + pybind11::class_ object( + module, "OrphanProducts", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("orphan_product"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set orphanProduct + object.def_property( + "orphan_product", + [](const cppCLASS &self) -> decltype(auto) + { + return self.orphanProduct(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.orphanProduct() = value; + }, + cppCLASS::component_t::documentation("orphan_product").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OutputChannel.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OutputChannel.python.cpp new file mode 100644 index 000000000..4b30aab1b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/OutputChannel.python.cpp @@ -0,0 +1,154 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/OutputChannel.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::OutputChannel +void wrapOutputChannel(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::OutputChannel; + + // create the Python object + pybind11::class_ object( + module, "OutputChannel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const general::Q &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("genre"), + pybind11::arg("process") = std::nullopt, + pybind11::arg("q"), + pybind11::arg("products") = std::nullopt, + pybind11::arg("fission_fragment_data") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set genre + object.def_property( + "genre", + [](const cppCLASS &self) -> decltype(auto) + { + return self.genre(); + }, + [](cppCLASS &self, const std::string &value) + { + self.genre() = value; + }, + cppCLASS::component_t::documentation("genre").data() + ); + + // get/set process + object.def_property( + "process", + [](const cppCLASS &self) -> decltype(auto) + { + return self.process(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.process() = value; + }, + cppCLASS::component_t::documentation("process").data() + ); + + // get/set Q + object.def_property( + "q", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Q(); + }, + [](cppCLASS &self, const general::Q &value) + { + self.Q() = value; + }, + cppCLASS::component_t::documentation("q").data() + ); + + // get/set products + object.def_property( + "products", + [](const cppCLASS &self) -> decltype(auto) + { + return self.products(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.products() = value; + }, + cppCLASS::component_t::documentation("products").data() + ); + + // get/set fissionFragmentData + object.def_property( + "fission_fragment_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionFragmentData(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.fissionFragmentData() = value; + }, + cppCLASS::component_t::documentation("fission_fragment_data").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovariance.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovariance.python.cpp new file mode 100644 index 000000000..9a5f2240e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovariance.python.cpp @@ -0,0 +1,192 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ParameterCovariance.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ParameterCovariance +void wrapParameterCovariance(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ParameterCovariance; + + // create the Python object + pybind11::class_ object( + module, "ParameterCovariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const general::RowData &, + const general::ParameterCovarianceMatrix & + >(), + pybind11::arg("label"), + pybind11::arg("row_data"), + pybind11::arg("parameter_covariance_matrix"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set rowData + object.def_property( + "row_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.rowData(); + }, + [](cppCLASS &self, const general::RowData &value) + { + self.rowData() = value; + }, + cppCLASS::component_t::documentation("row_data").data() + ); + + // get/set parameterCovarianceMatrix + object.def_property( + "parameter_covariance_matrix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parameterCovarianceMatrix(); + }, + [](cppCLASS &self, const general::ParameterCovarianceMatrix &value) + { + self.parameterCovarianceMatrix() = value; + }, + cppCLASS::component_t::documentation("parameter_covariance_matrix").data() + ); + + // shortcut: get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // shortcut: get/set lengths + object.def_property( + "lengths", + [](const cppCLASS &self) -> decltype(auto) + { + return self.lengths(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.lengths() = value; + }, + cppCLASS::component_t::documentation("lengths").data() + ); + + // shortcut: get/set parameterLink + object.def_property( + "parameter_link", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parameterLink(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.parameterLink() = value; + }, + cppCLASS::component_t::documentation("parameter_link").data() + ); + + // shortcut: get/set parameters + object.def_property( + "parameters", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parameters(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.parameters() = value; + }, + cppCLASS::component_t::documentation("parameters").data() + ); + + // shortcut: get/set slices + object.def_property( + "slices", + [](const cppCLASS &self) -> decltype(auto) + { + return self.slices(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.slices() = value; + }, + cppCLASS::component_t::documentation("slices").data() + ); + + // shortcut: get/set starts + object.def_property( + "starts", + [](const cppCLASS &self) -> decltype(auto) + { + return self.starts(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.starts() = value; + }, + cppCLASS::component_t::documentation("starts").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovarianceMatrix.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovarianceMatrix.python.cpp new file mode 100644 index 000000000..0ba410cfc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovarianceMatrix.python.cpp @@ -0,0 +1,166 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ParameterCovarianceMatrix.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ParameterCovarianceMatrix +void wrapParameterCovarianceMatrix(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ParameterCovarianceMatrix; + + // create the Python object + pybind11::class_ object( + module, "ParameterCovarianceMatrix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const g3d::Array &, + const general::Parameters & + >(), + pybind11::arg("label"), + pybind11::arg("type"), + pybind11::arg("array"), + pybind11::arg("parameters"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set type + object.def_property( + "type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.type(); + }, + [](cppCLASS &self, const std::string &value) + { + self.type() = value; + }, + cppCLASS::component_t::documentation("type").data() + ); + + // get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const g3d::Array &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // get/set parameters + object.def_property( + "parameters", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parameters(); + }, + [](cppCLASS &self, const general::Parameters &value) + { + self.parameters() = value; + }, + cppCLASS::component_t::documentation("parameters").data() + ); + + // shortcut: get/set lengths + object.def_property( + "lengths", + [](const cppCLASS &self) -> decltype(auto) + { + return self.lengths(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.lengths() = value; + }, + cppCLASS::component_t::documentation("lengths").data() + ); + + // shortcut: get/set parameterLink + object.def_property( + "parameter_link", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parameterLink(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.parameterLink() = value; + }, + cppCLASS::component_t::documentation("parameter_link").data() + ); + + // shortcut: get/set starts + object.def_property( + "starts", + [](const cppCLASS &self) -> decltype(auto) + { + return self.starts(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.starts() = value; + }, + cppCLASS::component_t::documentation("starts").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovariances.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovariances.python.cpp new file mode 100644 index 000000000..a2af7ebe2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterCovariances.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ParameterCovariances.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ParameterCovariances +void wrapParameterCovariances(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ParameterCovariances; + + // create the Python object + pybind11::class_ object( + module, "ParameterCovariances", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector &, + const std::optional> & + >(), + pybind11::arg("parameter_covariance"), + pybind11::arg("average_parameter_covariance") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set parameterCovariance + object.def_property( + "parameter_covariance", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parameterCovariance(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.parameterCovariance() = value; + }, + cppCLASS::component_t::documentation("parameter_covariance").data() + ); + + // get/set averageParameterCovariance + object.def_property( + "average_parameter_covariance", + [](const cppCLASS &self) -> decltype(auto) + { + return self.averageParameterCovariance(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.averageParameterCovariance() = value; + }, + cppCLASS::component_t::documentation("average_parameter_covariance").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterLink.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterLink.python.cpp new file mode 100644 index 000000000..a3dae38a6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ParameterLink.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ParameterLink.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ParameterLink +void wrapParameterLink(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ParameterLink; + + // create the Python object + pybind11::class_ object( + module, "ParameterLink", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("href"), + pybind11::arg("n_parameters") = std::nullopt, + pybind11::arg("matrix_start_index") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // get/set nParameters + object.def_property( + "n_parameters", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nParameters(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.nParameters() = value; + }, + cppCLASS::component_t::documentation("n_parameters").data() + ); + + // get/set matrixStartIndex + object.def_property( + "matrix_start_index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.matrixStartIndex(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.matrixStartIndex() = value; + }, + cppCLASS::component_t::documentation("matrix_start_index").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Parameters.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Parameters.python.cpp new file mode 100644 index 000000000..51bcd9204 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Parameters.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Parameters.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Parameters +void wrapParameters(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Parameters; + + // create the Python object + pybind11::class_ object( + module, "Parameters", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("parameter_link"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set parameterLink + object.def_property( + "parameter_link", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parameterLink(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.parameterLink() = value; + }, + cppCLASS::component_t::documentation("parameter_link").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Parity.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Parity.python.cpp new file mode 100644 index 000000000..d7504e2d1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Parity.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Parity.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Parity +void wrapParity(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Parity; + + // create the Python object + pybind11::class_ object( + module, "Parity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Integer & + >(), + pybind11::arg("integer"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set integer + object.def_property( + "integer", + [](const cppCLASS &self) -> decltype(auto) + { + return self.integer(); + }, + [](cppCLASS &self, const general::Integer &value) + { + self.integer() = value; + }, + cppCLASS::component_t::documentation("integer").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PhotonEmissionProbabilities.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PhotonEmissionProbabilities.python.cpp new file mode 100644 index 000000000..f686ec96a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PhotonEmissionProbabilities.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/PhotonEmissionProbabilities.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PhotonEmissionProbabilities +void wrapPhotonEmissionProbabilities(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::PhotonEmissionProbabilities; + + // create the Python object + pybind11::class_ object( + module, "PhotonEmissionProbabilities", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Shell & + >(), + pybind11::arg("shell"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set shell + object.def_property( + "shell", + [](const cppCLASS &self) -> decltype(auto) + { + return self.shell(); + }, + [](cppCLASS &self, const general::Shell &value) + { + self.shell() = value; + }, + cppCLASS::component_t::documentation("shell").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Polynomial1d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Polynomial1d.python.cpp new file mode 100644 index 000000000..de94914cc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Polynomial1d.python.cpp @@ -0,0 +1,170 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Polynomial1d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Polynomial1d +void wrapPolynomial1d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Polynomial1d; + + // create the Python object + pybind11::class_ object( + module, "Polynomial1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const double &, + const double &, + const general::Axes &, + const general::Values &, + const std::optional & + >(), + pybind11::arg("label") = std::nullopt, + pybind11::arg("domain_min"), + pybind11::arg("domain_max"), + pybind11::arg("axes"), + pybind11::arg("values"), + pybind11::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMin() = value; + }, + cppCLASS::component_t::documentation("domain_min").data() + ); + + // get/set domainMax + object.def_property( + "domain_max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMax(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMax() = value; + }, + cppCLASS::component_t::documentation("domain_max").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const general::Axes &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const general::Values &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PositronEmissionIntensity.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PositronEmissionIntensity.python.cpp new file mode 100644 index 000000000..1893ede72 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PositronEmissionIntensity.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/PositronEmissionIntensity.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PositronEmissionIntensity +void wrapPositronEmissionIntensity(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::PositronEmissionIntensity; + + // create the Python object + pybind11::class_ object( + module, "PositronEmissionIntensity", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const std::optional & + >(), + pybind11::arg("value"), + pybind11::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PrimaryGamma.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PrimaryGamma.python.cpp new file mode 100644 index 000000000..fb8cac04d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PrimaryGamma.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/PrimaryGamma.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PrimaryGamma +void wrapPrimaryGamma(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::PrimaryGamma; + + // create the Python object + pybind11::class_ object( + module, "PrimaryGamma", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const double &, + const double &, + const general::Axes & + >(), + pybind11::arg("value"), + pybind11::arg("domain_min"), + pybind11::arg("domain_max"), + pybind11::arg("axes"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMin() = value; + }, + cppCLASS::component_t::documentation("domain_min").data() + ); + + // get/set domainMax + object.def_property( + "domain_max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMax(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMax() = value; + }, + cppCLASS::component_t::documentation("domain_max").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const general::Axes &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Probability.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Probability.python.cpp new file mode 100644 index 000000000..76d6eef6e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Probability.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Probability.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Probability +void wrapProbability(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Probability; + + // create the Python object + pybind11::class_ object( + module, "Probability", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Double & + >(), + pybind11::arg("double"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const general::Double &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Product.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Product.python.cpp new file mode 100644 index 000000000..767a623f7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Product.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Product.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Product +void wrapProduct(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Product; + + // create the Python object + pybind11::class_ object( + module, "Product", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("pid"), + pybind11::arg("multiplicity") = std::nullopt, + pybind11::arg("distribution") = std::nullopt, + pybind11::arg("output_channel") = std::nullopt, + pybind11::arg("average_product_energy") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::string &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set multiplicity + object.def_property( + "multiplicity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.multiplicity(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.multiplicity() = value; + }, + cppCLASS::component_t::documentation("multiplicity").data() + ); + + // get/set distribution + object.def_property( + "distribution", + [](const cppCLASS &self) -> decltype(auto) + { + return self.distribution(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.distribution() = value; + }, + cppCLASS::component_t::documentation("distribution").data() + ); + + // get/set outputChannel + object.def_property( + "output_channel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outputChannel(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.outputChannel() = value; + }, + cppCLASS::component_t::documentation("output_channel").data() + ); + + // get/set averageProductEnergy + object.def_property( + "average_product_energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.averageProductEnergy(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.averageProductEnergy() = value; + }, + cppCLASS::component_t::documentation("average_product_energy").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProductYield.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProductYield.python.cpp new file mode 100644 index 000000000..dc6b4b193 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProductYield.python.cpp @@ -0,0 +1,108 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ProductYield.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ProductYield +void wrapProductYield(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ProductYield; + + // create the Python object + pybind11::class_ object( + module, "ProductYield", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const general::ElapsedTimes & + >(), + pybind11::arg("label") = std::nullopt, + pybind11::arg("nuclides") = std::nullopt, + pybind11::arg("elapsed_times"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set nuclides + object.def_property( + "nuclides", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nuclides(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.nuclides() = value; + }, + cppCLASS::component_t::documentation("nuclides").data() + ); + + // get/set elapsedTimes + object.def_property( + "elapsed_times", + [](const cppCLASS &self) -> decltype(auto) + { + return self.elapsedTimes(); + }, + [](cppCLASS &self, const general::ElapsedTimes &value) + { + self.elapsedTimes() = value; + }, + cppCLASS::component_t::documentation("elapsed_times").data() + ); + + // shortcut: get/set elapsedTime + object.def_property( + "elapsed_time", + [](const cppCLASS &self) -> decltype(auto) + { + return self.elapsedTime(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.elapsedTime() = value; + }, + cppCLASS::component_t::documentation("elapsed_time").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProductYields.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProductYields.python.cpp new file mode 100644 index 000000000..134283118 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProductYields.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ProductYields.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ProductYields +void wrapProductYields(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ProductYields; + + // create the Python object + pybind11::class_ object( + module, "ProductYields", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("product_yield"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set productYield + object.def_property( + "product_yield", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productYield(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.productYield() = value; + }, + cppCLASS::component_t::documentation("product_yield").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Production.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Production.python.cpp new file mode 100644 index 000000000..7370915b1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Production.python.cpp @@ -0,0 +1,264 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Production.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Production +void wrapProduction(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Production; + + // create the Python object + pybind11::class_ object( + module, "Production", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const general::CrossSection &, + const general::OutputChannel & + >(), + pybind11::arg("label"), + pybind11::arg("endf_mt"), + pybind11::arg("cross_section"), + pybind11::arg("output_channel"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set ENDF_MT + object.def_property( + "endf_mt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDF_MT(); + }, + [](cppCLASS &self, const int &value) + { + self.ENDF_MT() = value; + }, + cppCLASS::component_t::documentation("endf_mt").data() + ); + + // get/set crossSection + object.def_property( + "cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSection(); + }, + [](cppCLASS &self, const general::CrossSection &value) + { + self.crossSection() = value; + }, + cppCLASS::component_t::documentation("cross_section").data() + ); + + // get/set outputChannel + object.def_property( + "output_channel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outputChannel(); + }, + [](cppCLASS &self, const general::OutputChannel &value) + { + self.outputChannel() = value; + }, + cppCLASS::component_t::documentation("output_channel").data() + ); + + // shortcut: get/set CoulombPlusNuclearElastic + object.def_property( + "coulomb_plus_nuclear_elastic", + [](const cppCLASS &self) -> decltype(auto) + { + return self.CoulombPlusNuclearElastic(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.CoulombPlusNuclearElastic() = value; + }, + cppCLASS::component_t::documentation("coulomb_plus_nuclear_elastic").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set Q + object.def_property( + "q", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Q(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Q() = value; + }, + cppCLASS::component_t::documentation("q").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // shortcut: get/set fissionFragmentData + object.def_property( + "fission_fragment_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionFragmentData(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.fissionFragmentData() = value; + }, + cppCLASS::component_t::documentation("fission_fragment_data").data() + ); + + // shortcut: get/set products + object.def_property( + "products", + [](const cppCLASS &self) -> decltype(auto) + { + return self.products(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.products() = value; + }, + cppCLASS::component_t::documentation("products").data() + ); + + // shortcut: get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set resonancesWithBackground + object.def_property( + "resonances_with_background", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonancesWithBackground(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.resonancesWithBackground() = value; + }, + cppCLASS::component_t::documentation("resonances_with_background").data() + ); + + // shortcut: get/set thermalNeutronScatteringLaw1d + object.def_property( + "thermal_neutron_scattering_law1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.thermalNeutronScatteringLaw1d() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Productions.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Productions.python.cpp new file mode 100644 index 000000000..e60177ab4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Productions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Productions.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Productions +void wrapProductions(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Productions; + + // create the Python object + pybind11::class_ object( + module, "Productions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("production"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set production + object.def_property( + "production", + [](const cppCLASS &self) -> decltype(auto) + { + return self.production(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.production() = value; + }, + cppCLASS::component_t::documentation("production").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Products.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Products.python.cpp new file mode 100644 index 000000000..2cddbea7d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Products.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Products.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Products +void wrapProducts(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Products; + + // create the Python object + pybind11::class_ object( + module, "Products", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional> & + >(), + pybind11::arg("product") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set product + object.def_property( + "product", + [](const cppCLASS &self) -> decltype(auto) + { + return self.product(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.product() = value; + }, + cppCLASS::component_t::documentation("product").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProjectileEnergyDomain.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProjectileEnergyDomain.python.cpp new file mode 100644 index 000000000..b8a5809ff --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ProjectileEnergyDomain.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ProjectileEnergyDomain.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ProjectileEnergyDomain +void wrapProjectileEnergyDomain(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ProjectileEnergyDomain; + + // create the Python object + pybind11::class_ object( + module, "ProjectileEnergyDomain", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const double &, + const std::string & + >(), + pybind11::arg("min"), + pybind11::arg("max"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set min + object.def_property( + "min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.min(); + }, + [](cppCLASS &self, const double &value) + { + self.min() = value; + }, + cppCLASS::component_t::documentation("min").data() + ); + + // get/set max + object.def_property( + "max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.max(); + }, + [](cppCLASS &self, const double &value) + { + self.max() = value; + }, + cppCLASS::component_t::documentation("max").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptGammaEnergy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptGammaEnergy.python.cpp new file mode 100644 index 000000000..3f37ca8b2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptGammaEnergy.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/PromptGammaEnergy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PromptGammaEnergy +void wrapPromptGammaEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::PromptGammaEnergy; + + // create the Python object + pybind11::class_ object( + module, "PromptGammaEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("polynomial1d") = std::nullopt, + pybind11::arg("xys1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptNeutronKE.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptNeutronKE.python.cpp new file mode 100644 index 000000000..0cabdac3e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptNeutronKE.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/PromptNeutronKE.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PromptNeutronKE +void wrapPromptNeutronKE(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::PromptNeutronKE; + + // create the Python object + pybind11::class_ object( + module, "PromptNeutronKE", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("polynomial1d") = std::nullopt, + pybind11::arg("xys1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptProductKE.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptProductKE.python.cpp new file mode 100644 index 000000000..c63a0a32e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/PromptProductKE.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/PromptProductKE.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::PromptProductKE +void wrapPromptProductKE(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::PromptProductKE; + + // create the Python object + pybind11::class_ object( + module, "PromptProductKE", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("polynomial1d") = std::nullopt, + pybind11::arg("xys1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Q.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Q.python.cpp new file mode 100644 index 000000000..91185bc72 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Q.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Q.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Q +void wrapQ(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Q; + + // create the Python object + pybind11::class_ object( + module, "Q", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("double") = std::nullopt, + pybind11::arg("constant1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/R.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/R.python.cpp new file mode 100644 index 000000000..257a197f5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/R.python.cpp @@ -0,0 +1,146 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/R.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::R +void wrapR(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::R; + + // create the Python object + pybind11::class_ object( + module, "R", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs2d & + >(), + pybind11::arg("xys2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const general::XYs2d &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // shortcut: get/set Legendre + object.def_property( + "legendre", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Legendre(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Legendre() = value; + }, + cppCLASS::component_t::documentation("legendre").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set function1ds + object.def_property( + "function1ds", + [](const cppCLASS &self) -> decltype(auto) + { + return self.function1ds(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.function1ds() = value; + }, + cppCLASS::component_t::documentation("function1ds").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RMatrix.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RMatrix.python.cpp new file mode 100644 index 000000000..20b126f42 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RMatrix.python.cpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/RMatrix.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::RMatrix +void wrapRMatrix(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::RMatrix; + + // create the Python object + pybind11::class_ object( + module, "RMatrix", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const general::ResonanceReactions &, + const general::SpinGroups & + >(), + pybind11::arg("label"), + pybind11::arg("approximation"), + pybind11::arg("boundary_condition"), + pybind11::arg("calculate_channel_radius") = std::nullopt, + pybind11::arg("supports_angular_reconstruction") = std::nullopt, + pybind11::arg("po_ps") = std::nullopt, + pybind11::arg("resonance_reactions"), + pybind11::arg("spin_groups"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set approximation + object.def_property( + "approximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.approximation(); + }, + [](cppCLASS &self, const std::string &value) + { + self.approximation() = value; + }, + cppCLASS::component_t::documentation("approximation").data() + ); + + // get/set boundaryCondition + object.def_property( + "boundary_condition", + [](const cppCLASS &self) -> decltype(auto) + { + return self.boundaryCondition(); + }, + [](cppCLASS &self, const std::string &value) + { + self.boundaryCondition() = value; + }, + cppCLASS::component_t::documentation("boundary_condition").data() + ); + + // get/set calculateChannelRadius + object.def_property( + "calculate_channel_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.calculateChannelRadius(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.calculateChannelRadius() = value; + }, + cppCLASS::component_t::documentation("calculate_channel_radius").data() + ); + + // get/set supportsAngularReconstruction + object.def_property( + "supports_angular_reconstruction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.supportsAngularReconstruction(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.supportsAngularReconstruction() = value; + }, + cppCLASS::component_t::documentation("supports_angular_reconstruction").data() + ); + + // get/set PoPs + object.def_property( + "po_ps", + [](const cppCLASS &self) -> decltype(auto) + { + return self.PoPs(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.PoPs() = value; + }, + cppCLASS::component_t::documentation("po_ps").data() + ); + + // get/set resonanceReactions + object.def_property( + "resonance_reactions", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceReactions(); + }, + [](cppCLASS &self, const general::ResonanceReactions &value) + { + self.resonanceReactions() = value; + }, + cppCLASS::component_t::documentation("resonance_reactions").data() + ); + + // get/set spinGroups + object.def_property( + "spin_groups", + [](const cppCLASS &self) -> decltype(auto) + { + return self.spinGroups(); + }, + [](cppCLASS &self, const general::SpinGroups &value) + { + self.spinGroups() = value; + }, + cppCLASS::component_t::documentation("spin_groups").data() + ); + + // shortcut: get/set resonanceReaction + object.def_property( + "resonance_reaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceReaction(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.resonanceReaction() = value; + }, + cppCLASS::component_t::documentation("resonance_reaction").data() + ); + + // shortcut: get/set spinGroup + object.def_property( + "spin_group", + [](const cppCLASS &self) -> decltype(auto) + { + return self.spinGroup(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.spinGroup() = value; + }, + cppCLASS::component_t::documentation("spin_group").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Rate.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Rate.python.cpp new file mode 100644 index 000000000..37a6c0cac --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Rate.python.cpp @@ -0,0 +1,76 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Rate.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Rate +void wrapRate(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Rate; + + // create the Python object + pybind11::class_ object( + module, "Rate", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Double & + >(), + pybind11::arg("double"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const general::Double &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reaction.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reaction.python.cpp new file mode 100644 index 000000000..8e8a864ed --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reaction.python.cpp @@ -0,0 +1,282 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Reaction.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Reaction +void wrapReaction(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Reaction; + + // create the Python object + pybind11::class_ object( + module, "Reaction", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const std::optional &, + const general::CrossSection &, + const general::OutputChannel &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("endf_mt"), + pybind11::arg("fission_genre") = std::nullopt, + pybind11::arg("cross_section"), + pybind11::arg("output_channel"), + pybind11::arg("double_differential_cross_section") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set ENDF_MT + object.def_property( + "endf_mt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDF_MT(); + }, + [](cppCLASS &self, const int &value) + { + self.ENDF_MT() = value; + }, + cppCLASS::component_t::documentation("endf_mt").data() + ); + + // get/set fissionGenre + object.def_property( + "fission_genre", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionGenre(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.fissionGenre() = value; + }, + cppCLASS::component_t::documentation("fission_genre").data() + ); + + // get/set crossSection + object.def_property( + "cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSection(); + }, + [](cppCLASS &self, const general::CrossSection &value) + { + self.crossSection() = value; + }, + cppCLASS::component_t::documentation("cross_section").data() + ); + + // get/set outputChannel + object.def_property( + "output_channel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outputChannel(); + }, + [](cppCLASS &self, const general::OutputChannel &value) + { + self.outputChannel() = value; + }, + cppCLASS::component_t::documentation("output_channel").data() + ); + + // get/set doubleDifferentialCrossSection + object.def_property( + "double_differential_cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.doubleDifferentialCrossSection(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.doubleDifferentialCrossSection() = value; + }, + cppCLASS::component_t::documentation("double_differential_cross_section").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set Q + object.def_property( + "q", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Q(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Q() = value; + }, + cppCLASS::component_t::documentation("q").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // shortcut: get/set fissionFragmentData + object.def_property( + "fission_fragment_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionFragmentData(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.fissionFragmentData() = value; + }, + cppCLASS::component_t::documentation("fission_fragment_data").data() + ); + + // shortcut: get/set products + object.def_property( + "products", + [](const cppCLASS &self) -> decltype(auto) + { + return self.products(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.products() = value; + }, + cppCLASS::component_t::documentation("products").data() + ); + + // shortcut: get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set resonancesWithBackground + object.def_property( + "resonances_with_background", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonancesWithBackground(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.resonancesWithBackground() = value; + }, + cppCLASS::component_t::documentation("resonances_with_background").data() + ); + + // shortcut: get/set thermalNeutronScatteringLaw1d + object.def_property( + "thermal_neutron_scattering_law1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.thermalNeutronScatteringLaw1d() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reactions.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reactions.python.cpp new file mode 100644 index 000000000..2e59ba209 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reactions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Reactions.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Reactions +void wrapReactions(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Reactions; + + // create the Python object + pybind11::class_ object( + module, "Reactions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("reaction"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set reaction + object.def_property( + "reaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reaction(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.reaction() = value; + }, + cppCLASS::component_t::documentation("reaction").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RealAnomalousFactor.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RealAnomalousFactor.python.cpp new file mode 100644 index 000000000..8fe102f56 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RealAnomalousFactor.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/RealAnomalousFactor.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::RealAnomalousFactor +void wrapRealAnomalousFactor(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::RealAnomalousFactor; + + // create the Python object + pybind11::class_ object( + module, "RealAnomalousFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs1d & + >(), + pybind11::arg("xys1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const general::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RealInterferenceTerm.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RealInterferenceTerm.python.cpp new file mode 100644 index 000000000..81bdd339c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RealInterferenceTerm.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/RealInterferenceTerm.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::RealInterferenceTerm +void wrapRealInterferenceTerm(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::RealInterferenceTerm; + + // create the Python object + pybind11::class_ object( + module, "RealInterferenceTerm", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("regions2d") = std::nullopt, + pybind11::arg("xys2d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set regions2d + object.def_property( + "regions2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions2d() = value; + }, + cppCLASS::component_t::documentation("regions2d").data() + ); + + // get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Recoil.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Recoil.python.cpp new file mode 100644 index 000000000..3ccc20fd4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Recoil.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Recoil.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Recoil +void wrapRecoil(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Recoil; + + // create the Python object + pybind11::class_ object( + module, "Recoil", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string & + >(), + pybind11::arg("href"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reference.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reference.python.cpp new file mode 100644 index 000000000..b03c84633 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Reference.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Reference.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Reference +void wrapReference(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Reference; + + // create the Python object + pybind11::class_ object( + module, "Reference", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string & + >(), + pybind11::arg("label"), + pybind11::arg("href"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Regions1d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Regions1d.python.cpp new file mode 100644 index 000000000..425206de3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Regions1d.python.cpp @@ -0,0 +1,154 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Regions1d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Regions1d +void wrapRegions1d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Regions1d; + + // create the Python object + pybind11::class_ object( + module, "Regions1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const reduced::Function1ds & + >(), + pybind11::arg("label") = std::nullopt, + pybind11::arg("outer_domain_value") = std::nullopt, + pybind11::arg("axes") = std::nullopt, + pybind11::arg("uncertainty") = std::nullopt, + pybind11::arg("function1ds"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set outerDomainValue + object.def_property( + "outer_domain_value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outerDomainValue(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.outerDomainValue() = value; + }, + cppCLASS::component_t::documentation("outer_domain_value").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // get/set function1ds + object.def_property( + "function1ds", + [](const cppCLASS &self) -> decltype(auto) + { + return self.function1ds(); + }, + [](cppCLASS &self, const reduced::Function1ds &value) + { + self.function1ds() = value; + }, + cppCLASS::component_t::documentation("function1ds").data() + ); + + // shortcut: get/set Legendre + object.def_property( + "legendre", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Legendre(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Legendre() = value; + }, + cppCLASS::component_t::documentation("legendre").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Regions2d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Regions2d.python.cpp new file mode 100644 index 000000000..c9a6ecfc7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Regions2d.python.cpp @@ -0,0 +1,136 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Regions2d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Regions2d +void wrapRegions2d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Regions2d; + + // create the Python object + pybind11::class_ object( + module, "Regions2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Axes &, + const general::Function2ds &, + const std::optional & + >(), + pybind11::arg("axes"), + pybind11::arg("function2ds"), + pybind11::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const general::Axes &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set function2ds + object.def_property( + "function2ds", + [](const cppCLASS &self) -> decltype(auto) + { + return self.function2ds(); + }, + [](cppCLASS &self, const general::Function2ds &value) + { + self.function2ds() = value; + }, + cppCLASS::component_t::documentation("function2ds").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Resolved.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Resolved.python.cpp new file mode 100644 index 000000000..699977f66 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Resolved.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Resolved.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Resolved +void wrapResolved(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Resolved; + + // create the Python object + pybind11::class_ object( + module, "Resolved", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const double &, + const std::string &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("domain_min"), + pybind11::arg("domain_max"), + pybind11::arg("domain_unit"), + pybind11::arg("breit_wigner") = std::nullopt, + pybind11::arg("rmatrix") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMin() = value; + }, + cppCLASS::component_t::documentation("domain_min").data() + ); + + // get/set domainMax + object.def_property( + "domain_max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMax(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMax() = value; + }, + cppCLASS::component_t::documentation("domain_max").data() + ); + + // get/set domainUnit + object.def_property( + "domain_unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainUnit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.domainUnit() = value; + }, + cppCLASS::component_t::documentation("domain_unit").data() + ); + + // get/set BreitWigner + object.def_property( + "breit_wigner", + [](const cppCLASS &self) -> decltype(auto) + { + return self.BreitWigner(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.BreitWigner() = value; + }, + cppCLASS::component_t::documentation("breit_wigner").data() + ); + + // get/set RMatrix + object.def_property( + "rmatrix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.RMatrix(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.RMatrix() = value; + }, + cppCLASS::component_t::documentation("rmatrix").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResolvedRegion.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResolvedRegion.python.cpp new file mode 100644 index 000000000..c67d37cb5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResolvedRegion.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ResolvedRegion.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ResolvedRegion +void wrapResolvedRegion(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ResolvedRegion; + + // create the Python object + pybind11::class_ object( + module, "ResolvedRegion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("xys1d") = std::nullopt, + pybind11::arg("regions1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceParameters.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceParameters.python.cpp new file mode 100644 index 000000000..ae066286e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceParameters.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ResonanceParameters.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ResonanceParameters +void wrapResonanceParameters(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ResonanceParameters; + + // create the Python object + pybind11::class_ object( + module, "ResonanceParameters", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Table & + >(), + pybind11::arg("table"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set table + object.def_property( + "table", + [](const cppCLASS &self) -> decltype(auto) + { + return self.table(); + }, + [](cppCLASS &self, const general::Table &value) + { + self.table() = value; + }, + cppCLASS::component_t::documentation("table").data() + ); + + // shortcut: get/set column + object.def_property( + "column", + [](const cppCLASS &self) -> decltype(auto) + { + return self.column(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.column() = value; + }, + cppCLASS::component_t::documentation("column").data() + ); + + // shortcut: get/set columnHeaders + object.def_property( + "column_headers", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columnHeaders(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.columnHeaders() = value; + }, + cppCLASS::component_t::documentation("column_headers").data() + ); + + // shortcut: get/set data + object.def_property( + "data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.data(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.data() = value; + }, + cppCLASS::component_t::documentation("data").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceReaction.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceReaction.python.cpp new file mode 100644 index 000000000..07d60722b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceReaction.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ResonanceReaction.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ResonanceReaction +void wrapResonanceReaction(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ResonanceReaction; + + // create the Python object + pybind11::class_ object( + module, "ResonanceReaction", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const std::optional &, + const general::Link &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("ejectile") = std::nullopt, + pybind11::arg("eliminated") = std::nullopt, + pybind11::arg("link"), + pybind11::arg("hard_sphere_radius") = std::nullopt, + pybind11::arg("q") = std::nullopt, + pybind11::arg("scattering_radius") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set ejectile + object.def_property( + "ejectile", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ejectile(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.ejectile() = value; + }, + cppCLASS::component_t::documentation("ejectile").data() + ); + + // get/set eliminated + object.def_property( + "eliminated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.eliminated(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.eliminated() = value; + }, + cppCLASS::component_t::documentation("eliminated").data() + ); + + // get/set link + object.def_property( + "link", + [](const cppCLASS &self) -> decltype(auto) + { + return self.link(); + }, + [](cppCLASS &self, const general::Link &value) + { + self.link() = value; + }, + cppCLASS::component_t::documentation("link").data() + ); + + // get/set hardSphereRadius + object.def_property( + "hard_sphere_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.hardSphereRadius(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.hardSphereRadius() = value; + }, + cppCLASS::component_t::documentation("hard_sphere_radius").data() + ); + + // get/set Q + object.def_property( + "q", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Q(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.Q() = value; + }, + cppCLASS::component_t::documentation("q").data() + ); + + // get/set scatteringRadius + object.def_property( + "scattering_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringRadius(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.scatteringRadius() = value; + }, + cppCLASS::component_t::documentation("scattering_radius").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceReactions.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceReactions.python.cpp new file mode 100644 index 000000000..b66dab8c1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonanceReactions.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ResonanceReactions.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ResonanceReactions +void wrapResonanceReactions(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ResonanceReactions; + + // create the Python object + pybind11::class_ object( + module, "ResonanceReactions", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("resonance_reaction"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set resonanceReaction + object.def_property( + "resonance_reaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceReaction(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.resonanceReaction() = value; + }, + cppCLASS::component_t::documentation("resonance_reaction").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Resonances.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Resonances.python.cpp new file mode 100644 index 000000000..8c512562e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Resonances.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Resonances.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Resonances +void wrapResonances(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Resonances; + + // create the Python object + pybind11::class_ object( + module, "Resonances", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("href") = std::nullopt, + pybind11::arg("scattering_radius") = std::nullopt, + pybind11::arg("resolved") = std::nullopt, + pybind11::arg("unresolved") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // get/set scatteringRadius + object.def_property( + "scattering_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringRadius(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.scatteringRadius() = value; + }, + cppCLASS::component_t::documentation("scattering_radius").data() + ); + + // get/set resolved + object.def_property( + "resolved", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resolved(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.resolved() = value; + }, + cppCLASS::component_t::documentation("resolved").data() + ); + + // get/set unresolved + object.def_property( + "unresolved", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unresolved(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unresolved() = value; + }, + cppCLASS::component_t::documentation("unresolved").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonancesWithBackground.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonancesWithBackground.python.cpp new file mode 100644 index 000000000..4a6d02cb0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ResonancesWithBackground.python.cpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ResonancesWithBackground.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ResonancesWithBackground +void wrapResonancesWithBackground(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ResonancesWithBackground; + + // create the Python object + pybind11::class_ object( + module, "ResonancesWithBackground", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const general::Resonances &, + const general::Background &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("resonances"), + pybind11::arg("background"), + pybind11::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set resonances + object.def_property( + "resonances", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonances(); + }, + [](cppCLASS &self, const general::Resonances &value) + { + self.resonances() = value; + }, + cppCLASS::component_t::documentation("resonances").data() + ); + + // get/set background + object.def_property( + "background", + [](const cppCLASS &self) -> decltype(auto) + { + return self.background(); + }, + [](cppCLASS &self, const general::Background &value) + { + self.background() = value; + }, + cppCLASS::component_t::documentation("background").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set fastRegion + object.def_property( + "fast_region", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fastRegion(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.fastRegion() = value; + }, + cppCLASS::component_t::documentation("fast_region").data() + ); + + // shortcut: get/set resolved + object.def_property( + "resolved", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resolved(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.resolved() = value; + }, + cppCLASS::component_t::documentation("resolved").data() + ); + + // shortcut: get/set resolvedRegion + object.def_property( + "resolved_region", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resolvedRegion(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.resolvedRegion() = value; + }, + cppCLASS::component_t::documentation("resolved_region").data() + ); + + // shortcut: get/set scatteringRadius + object.def_property( + "scattering_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringRadius(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.scatteringRadius() = value; + }, + cppCLASS::component_t::documentation("scattering_radius").data() + ); + + // shortcut: get/set unresolved + object.def_property( + "unresolved", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unresolved(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.unresolved() = value; + }, + cppCLASS::component_t::documentation("unresolved").data() + ); + + // shortcut: get/set unresolvedRegion + object.def_property( + "unresolved_region", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unresolvedRegion(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.unresolvedRegion() = value; + }, + cppCLASS::component_t::documentation("unresolved_region").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RowData.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RowData.python.cpp new file mode 100644 index 000000000..48de86cb6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RowData.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/RowData.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::RowData +void wrapRowData(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::RowData; + + // create the Python object + pybind11::class_ object( + module, "RowData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::string &, + const std::optional & + >(), + pybind11::arg("endf_mfmt") = std::nullopt, + pybind11::arg("dimension") = std::nullopt, + pybind11::arg("href"), + pybind11::arg("slices") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set ENDF_MFMT + object.def_property( + "endf_mfmt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDF_MFMT(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.ENDF_MFMT() = value; + }, + cppCLASS::component_t::documentation("endf_mfmt").data() + ); + + // get/set dimension + object.def_property( + "dimension", + [](const cppCLASS &self) -> decltype(auto) + { + return self.dimension(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.dimension() = value; + }, + cppCLASS::component_t::documentation("dimension").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // get/set slices + object.def_property( + "slices", + [](const cppCLASS &self) -> decltype(auto) + { + return self.slices(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.slices() = value; + }, + cppCLASS::component_t::documentation("slices").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RutherfordScattering.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RutherfordScattering.python.cpp new file mode 100644 index 000000000..c72388e03 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/RutherfordScattering.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/RutherfordScattering.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::RutherfordScattering +void wrapRutherfordScattering(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::RutherfordScattering; + + // create the Python object + pybind11::class_ object( + module, "RutherfordScattering", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SCTApproximation.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SCTApproximation.python.cpp new file mode 100644 index 000000000..ff11bae5a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SCTApproximation.python.cpp @@ -0,0 +1,46 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/SCTApproximation.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::SCTApproximation +void wrapSCTApproximation(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::SCTApproximation; + + // create the Python object + pybind11::class_ object( + module, "SCTApproximation", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/S_table.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/S_table.python.cpp new file mode 100644 index 000000000..b1d769121 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/S_table.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/S_table.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::S_table +void wrapS_table(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::S_table; + + // create the Python object + pybind11::class_ object( + module, "S_table", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Gridded2d & + >(), + pybind11::arg("gridded2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set gridded2d + object.def_property( + "gridded2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded2d(); + }, + [](cppCLASS &self, const general::Gridded2d &value) + { + self.gridded2d() = value; + }, + cppCLASS::component_t::documentation("gridded2d").data() + ); + + // shortcut: get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringAtom.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringAtom.python.cpp new file mode 100644 index 000000000..0a05e5237 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringAtom.python.cpp @@ -0,0 +1,246 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ScatteringAtom.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ScatteringAtom +void wrapScatteringAtom(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ScatteringAtom; + + // create the Python object + pybind11::class_ object( + module, "ScatteringAtom", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const std::optional &, + const general::Mass &, + const std::optional &, + const general::E_max &, + const general::BoundAtomCrossSection &, + const general::SelfScatteringKernel &, + const std::optional & + >(), + pybind11::arg("pid"), + pybind11::arg("number_per_molecule"), + pybind11::arg("primary_scatterer") = std::nullopt, + pybind11::arg("mass"), + pybind11::arg("e_critical") = std::nullopt, + pybind11::arg("e_max"), + pybind11::arg("bound_atom_cross_section"), + pybind11::arg("self_scattering_kernel"), + pybind11::arg("t_effective") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::string &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set numberPerMolecule + object.def_property( + "number_per_molecule", + [](const cppCLASS &self) -> decltype(auto) + { + return self.numberPerMolecule(); + }, + [](cppCLASS &self, const int &value) + { + self.numberPerMolecule() = value; + }, + cppCLASS::component_t::documentation("number_per_molecule").data() + ); + + // get/set primaryScatterer + object.def_property( + "primary_scatterer", + [](const cppCLASS &self) -> decltype(auto) + { + return self.primaryScatterer(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.primaryScatterer() = value; + }, + cppCLASS::component_t::documentation("primary_scatterer").data() + ); + + // get/set mass + object.def_property( + "mass", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mass(); + }, + [](cppCLASS &self, const general::Mass &value) + { + self.mass() = value; + }, + cppCLASS::component_t::documentation("mass").data() + ); + + // get/set e_critical + object.def_property( + "e_critical", + [](const cppCLASS &self) -> decltype(auto) + { + return self.e_critical(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.e_critical() = value; + }, + cppCLASS::component_t::documentation("e_critical").data() + ); + + // get/set e_max + object.def_property( + "e_max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.e_max(); + }, + [](cppCLASS &self, const general::E_max &value) + { + self.e_max() = value; + }, + cppCLASS::component_t::documentation("e_max").data() + ); + + // get/set boundAtomCrossSection + object.def_property( + "bound_atom_cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.boundAtomCrossSection(); + }, + [](cppCLASS &self, const general::BoundAtomCrossSection &value) + { + self.boundAtomCrossSection() = value; + }, + cppCLASS::component_t::documentation("bound_atom_cross_section").data() + ); + + // get/set selfScatteringKernel + object.def_property( + "self_scattering_kernel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.selfScatteringKernel(); + }, + [](cppCLASS &self, const general::SelfScatteringKernel &value) + { + self.selfScatteringKernel() = value; + }, + cppCLASS::component_t::documentation("self_scattering_kernel").data() + ); + + // get/set T_effective + object.def_property( + "t_effective", + [](const cppCLASS &self) -> decltype(auto) + { + return self.T_effective(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.T_effective() = value; + }, + cppCLASS::component_t::documentation("t_effective").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set SCTApproximation + object.def_property( + "sctapproximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.SCTApproximation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.SCTApproximation() = value; + }, + cppCLASS::component_t::documentation("sctapproximation").data() + ); + + // shortcut: get/set freeGasApproximation + object.def_property( + "free_gas_approximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.freeGasApproximation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.freeGasApproximation() = value; + }, + cppCLASS::component_t::documentation("free_gas_approximation").data() + ); + + // shortcut: get/set gridded3d + object.def_property( + "gridded3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded3d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.gridded3d() = value; + }, + cppCLASS::component_t::documentation("gridded3d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringAtoms.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringAtoms.python.cpp new file mode 100644 index 000000000..b26dcfc6c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringAtoms.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ScatteringAtoms.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ScatteringAtoms +void wrapScatteringAtoms(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ScatteringAtoms; + + // create the Python object + pybind11::class_ object( + module, "ScatteringAtoms", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("scattering_atom"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set scatteringAtom + object.def_property( + "scattering_atom", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringAtom(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.scatteringAtom() = value; + }, + cppCLASS::component_t::documentation("scattering_atom").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringFactor.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringFactor.python.cpp new file mode 100644 index 000000000..b73b89662 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringFactor.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ScatteringFactor.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ScatteringFactor +void wrapScatteringFactor(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ScatteringFactor; + + // create the Python object + pybind11::class_ object( + module, "ScatteringFactor", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs1d & + >(), + pybind11::arg("xys1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const general::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringRadius.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringRadius.python.cpp new file mode 100644 index 000000000..5b94de1a0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ScatteringRadius.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ScatteringRadius.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ScatteringRadius +void wrapScatteringRadius(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ScatteringRadius; + + // create the Python object + pybind11::class_ object( + module, "ScatteringRadius", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("constant1d") = std::nullopt, + pybind11::arg("xys1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SelfScatteringKernel.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SelfScatteringKernel.python.cpp new file mode 100644 index 000000000..2a64821d6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SelfScatteringKernel.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/SelfScatteringKernel.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::SelfScatteringKernel +void wrapSelfScatteringKernel(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::SelfScatteringKernel; + + // create the Python object + pybind11::class_ object( + module, "SelfScatteringKernel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("symmetric") = std::nullopt, + pybind11::arg("gridded3d") = std::nullopt, + pybind11::arg("sctapproximation") = std::nullopt, + pybind11::arg("free_gas_approximation") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set symmetric + object.def_property( + "symmetric", + [](const cppCLASS &self) -> decltype(auto) + { + return self.symmetric(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.symmetric() = value; + }, + cppCLASS::component_t::documentation("symmetric").data() + ); + + // get/set gridded3d + object.def_property( + "gridded3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded3d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.gridded3d() = value; + }, + cppCLASS::component_t::documentation("gridded3d").data() + ); + + // get/set SCTApproximation + object.def_property( + "sctapproximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.SCTApproximation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.SCTApproximation() = value; + }, + cppCLASS::component_t::documentation("sctapproximation").data() + ); + + // get/set freeGasApproximation + object.def_property( + "free_gas_approximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.freeGasApproximation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.freeGasApproximation() = value; + }, + cppCLASS::component_t::documentation("free_gas_approximation").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Shell.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Shell.python.cpp new file mode 100644 index 000000000..8c7b7a852 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Shell.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Shell.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Shell +void wrapShell(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Shell; + + // create the Python object + pybind11::class_ object( + module, "Shell", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const double &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("value"), + pybind11::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ShortRangeSelfScalingVariance.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ShortRangeSelfScalingVariance.python.cpp new file mode 100644 index 000000000..8a841fc04 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ShortRangeSelfScalingVariance.python.cpp @@ -0,0 +1,180 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ShortRangeSelfScalingVariance.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ShortRangeSelfScalingVariance +void wrapShortRangeSelfScalingVariance(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ShortRangeSelfScalingVariance; + + // create the Python object + pybind11::class_ object( + module, "ShortRangeSelfScalingVariance", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string &, + const general::Gridded2d & + >(), + pybind11::arg("label"), + pybind11::arg("type"), + pybind11::arg("dependence_on_processed_group_width"), + pybind11::arg("gridded2d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set type + object.def_property( + "type", + [](const cppCLASS &self) -> decltype(auto) + { + return self.type(); + }, + [](cppCLASS &self, const std::string &value) + { + self.type() = value; + }, + cppCLASS::component_t::documentation("type").data() + ); + + // get/set dependenceOnProcessedGroupWidth + object.def_property( + "dependence_on_processed_group_width", + [](const cppCLASS &self) -> decltype(auto) + { + return self.dependenceOnProcessedGroupWidth(); + }, + [](cppCLASS &self, const std::string &value) + { + self.dependenceOnProcessedGroupWidth() = value; + }, + cppCLASS::component_t::documentation("dependence_on_processed_group_width").data() + ); + + // get/set gridded2d + object.def_property( + "gridded2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded2d(); + }, + [](cppCLASS &self, const general::Gridded2d &value) + { + self.gridded2d() = value; + }, + cppCLASS::component_t::documentation("gridded2d").data() + ); + + // shortcut: get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SimpleMaxwellianFission.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SimpleMaxwellianFission.python.cpp new file mode 100644 index 000000000..73bd99260 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SimpleMaxwellianFission.python.cpp @@ -0,0 +1,106 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/SimpleMaxwellianFission.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::SimpleMaxwellianFission +void wrapSimpleMaxwellianFission(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::SimpleMaxwellianFission; + + // create the Python object + pybind11::class_ object( + module, "SimpleMaxwellianFission", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::U &, + const general::Theta & + >(), + pybind11::arg("u"), + pybind11::arg("theta"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set U + object.def_property( + "u", + [](const cppCLASS &self) -> decltype(auto) + { + return self.U(); + }, + [](cppCLASS &self, const general::U &value) + { + self.U() = value; + }, + cppCLASS::component_t::documentation("u").data() + ); + + // get/set theta + object.def_property( + "theta", + [](const cppCLASS &self) -> decltype(auto) + { + return self.theta(); + }, + [](cppCLASS &self, const general::Theta &value) + { + self.theta() = value; + }, + cppCLASS::component_t::documentation("theta").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Slice.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Slice.python.cpp new file mode 100644 index 000000000..6db802601 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Slice.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Slice.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Slice +void wrapSlice(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Slice; + + // create the Python object + pybind11::class_ object( + module, "Slice", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const int &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("dimension"), + pybind11::arg("domain_value") = std::nullopt, + pybind11::arg("domain_min") = std::nullopt, + pybind11::arg("domain_max") = std::nullopt, + pybind11::arg("domain_unit") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set dimension + object.def_property( + "dimension", + [](const cppCLASS &self) -> decltype(auto) + { + return self.dimension(); + }, + [](cppCLASS &self, const int &value) + { + self.dimension() = value; + }, + cppCLASS::component_t::documentation("dimension").data() + ); + + // get/set domainValue + object.def_property( + "domain_value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainValue(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.domainValue() = value; + }, + cppCLASS::component_t::documentation("domain_value").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.domainMin() = value; + }, + cppCLASS::component_t::documentation("domain_min").data() + ); + + // get/set domainMax + object.def_property( + "domain_max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMax(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.domainMax() = value; + }, + cppCLASS::component_t::documentation("domain_max").data() + ); + + // get/set domainUnit + object.def_property( + "domain_unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainUnit(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.domainUnit() = value; + }, + cppCLASS::component_t::documentation("domain_unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Slices.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Slices.python.cpp new file mode 100644 index 000000000..d4ad4c290 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Slices.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Slices.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Slices +void wrapSlices(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Slices; + + // create the Python object + pybind11::class_ object( + module, "Slices", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("slice"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set slice + object.def_property( + "slice", + [](const cppCLASS &self) -> decltype(auto) + { + return self.slice(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.slice() = value; + }, + cppCLASS::component_t::documentation("slice").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spectra.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spectra.python.cpp new file mode 100644 index 000000000..caeda7dcd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spectra.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Spectra.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Spectra +void wrapSpectra(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Spectra; + + // create the Python object + pybind11::class_ object( + module, "Spectra", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("spectrum"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set spectrum + object.def_property( + "spectrum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.spectrum(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.spectrum() = value; + }, + cppCLASS::component_t::documentation("spectrum").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spectrum.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spectrum.python.cpp new file mode 100644 index 000000000..0b19fd305 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spectrum.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Spectrum.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Spectrum +void wrapSpectrum(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Spectrum; + + // create the Python object + pybind11::class_ object( + module, "Spectrum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::vector &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("pid"), + pybind11::arg("discrete"), + pybind11::arg("continuum") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::string &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set discrete + object.def_property( + "discrete", + [](const cppCLASS &self) -> decltype(auto) + { + return self.discrete(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.discrete() = value; + }, + cppCLASS::component_t::documentation("discrete").data() + ); + + // get/set continuum + object.def_property( + "continuum", + [](const cppCLASS &self) -> decltype(auto) + { + return self.continuum(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.continuum() = value; + }, + cppCLASS::component_t::documentation("continuum").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spin.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spin.python.cpp new file mode 100644 index 000000000..84c1e7152 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Spin.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Spin.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Spin +void wrapSpin(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Spin; + + // create the Python object + pybind11::class_ object( + module, "Spin", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Fraction & + >(), + pybind11::arg("fraction"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set fraction + object.def_property( + "fraction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fraction(); + }, + [](cppCLASS &self, const general::Fraction &value) + { + self.fraction() = value; + }, + cppCLASS::component_t::documentation("fraction").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SpinGroup.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SpinGroup.python.cpp new file mode 100644 index 000000000..1e7679177 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SpinGroup.python.cpp @@ -0,0 +1,182 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/SpinGroup.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::SpinGroup +void wrapSpinGroup(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::SpinGroup; + + // create the Python object + pybind11::class_ object( + module, "SpinGroup", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const int &, + const int &, + const general::Channels &, + const general::ResonanceParameters & + >(), + pybind11::arg("label"), + pybind11::arg("spin"), + pybind11::arg("parity"), + pybind11::arg("channels"), + pybind11::arg("resonance_parameters"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set spin + object.def_property( + "spin", + [](const cppCLASS &self) -> decltype(auto) + { + return self.spin(); + }, + [](cppCLASS &self, const int &value) + { + self.spin() = value; + }, + cppCLASS::component_t::documentation("spin").data() + ); + + // get/set parity + object.def_property( + "parity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parity(); + }, + [](cppCLASS &self, const int &value) + { + self.parity() = value; + }, + cppCLASS::component_t::documentation("parity").data() + ); + + // get/set channels + object.def_property( + "channels", + [](const cppCLASS &self) -> decltype(auto) + { + return self.channels(); + }, + [](cppCLASS &self, const general::Channels &value) + { + self.channels() = value; + }, + cppCLASS::component_t::documentation("channels").data() + ); + + // get/set resonanceParameters + object.def_property( + "resonance_parameters", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceParameters(); + }, + [](cppCLASS &self, const general::ResonanceParameters &value) + { + self.resonanceParameters() = value; + }, + cppCLASS::component_t::documentation("resonance_parameters").data() + ); + + // shortcut: get/set channel + object.def_property( + "channel", + [](const cppCLASS &self) -> decltype(auto) + { + return self.channel(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.channel() = value; + }, + cppCLASS::component_t::documentation("channel").data() + ); + + // shortcut: get/set columnHeaders + object.def_property( + "column_headers", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columnHeaders(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.columnHeaders() = value; + }, + cppCLASS::component_t::documentation("column_headers").data() + ); + + // shortcut: get/set data + object.def_property( + "data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.data(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.data() = value; + }, + cppCLASS::component_t::documentation("data").data() + ); + + // shortcut: get/set table + object.def_property( + "table", + [](const cppCLASS &self) -> decltype(auto) + { + return self.table(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.table() = value; + }, + cppCLASS::component_t::documentation("table").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SpinGroups.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SpinGroups.python.cpp new file mode 100644 index 000000000..6babc3d59 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/SpinGroups.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/SpinGroups.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::SpinGroups +void wrapSpinGroups(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::SpinGroups; + + // create the Python object + pybind11::class_ object( + module, "SpinGroups", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("spin_group"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set spinGroup + object.def_property( + "spin_group", + [](const cppCLASS &self) -> decltype(auto) + { + return self.spinGroup(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.spinGroup() = value; + }, + cppCLASS::component_t::documentation("spin_group").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Standard.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Standard.python.cpp new file mode 100644 index 000000000..b4eaa606e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Standard.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Standard.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Standard +void wrapStandard(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Standard; + + // create the Python object + pybind11::class_ object( + module, "Standard", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const reduced::Double & + >(), + pybind11::arg("double"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const reduced::Double &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/String.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/String.python.cpp new file mode 100644 index 000000000..4a00b825f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/String.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/String.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::String +void wrapString(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::String; + + // create the Python object + pybind11::class_ object( + module, "String", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string & + >(), + pybind11::arg("label"), + pybind11::arg("value"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const std::string &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Styles.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Styles.python.cpp new file mode 100644 index 000000000..c49e1e86c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Styles.python.cpp @@ -0,0 +1,190 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Styles.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Styles +void wrapStyles(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Styles; + + // create the Python object + pybind11::class_ object( + module, "Styles", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Evaluated &, + const std::optional & + >(), + pybind11::arg("evaluated"), + pybind11::arg("cross_section_reconstructed") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set evaluated + object.def_property( + "evaluated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaluated(); + }, + [](cppCLASS &self, const general::Evaluated &value) + { + self.evaluated() = value; + }, + cppCLASS::component_t::documentation("evaluated").data() + ); + + // get/set crossSectionReconstructed + object.def_property( + "cross_section_reconstructed", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSectionReconstructed(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.crossSectionReconstructed() = value; + }, + cppCLASS::component_t::documentation("cross_section_reconstructed").data() + ); + + // shortcut: get/set authors + object.def_property( + "authors", + [](const cppCLASS &self) -> decltype(auto) + { + return self.authors(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.authors() = value; + }, + cppCLASS::component_t::documentation("authors").data() + ); + + // shortcut: get/set body + object.def_property( + "body", + [](const cppCLASS &self) -> decltype(auto) + { + return self.body(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.body() = value; + }, + cppCLASS::component_t::documentation("body").data() + ); + + // shortcut: get/set dates + object.def_property( + "dates", + [](const cppCLASS &self) -> decltype(auto) + { + return self.dates(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.dates() = value; + }, + cppCLASS::component_t::documentation("dates").data() + ); + + // shortcut: get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // shortcut: get/set endfCompatible + object.def_property( + "endf_compatible", + [](const cppCLASS &self) -> decltype(auto) + { + return self.endfCompatible(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.endfCompatible() = value; + }, + cppCLASS::component_t::documentation("endf_compatible").data() + ); + + // shortcut: get/set projectileEnergyDomain + object.def_property( + "projectile_energy_domain", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectileEnergyDomain(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.projectileEnergyDomain() = value; + }, + cppCLASS::component_t::documentation("projectile_energy_domain").data() + ); + + // shortcut: get/set temperature + object.def_property( + "temperature", + [](const cppCLASS &self) -> decltype(auto) + { + return self.temperature(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.temperature() = value; + }, + cppCLASS::component_t::documentation("temperature").data() + ); + + // shortcut: get/set title + object.def_property( + "title", + [](const cppCLASS &self) -> decltype(auto) + { + return self.title(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.title() = value; + }, + cppCLASS::component_t::documentation("title").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Sum.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Sum.python.cpp new file mode 100644 index 000000000..c0140d117 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Sum.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Sum.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Sum +void wrapSum(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Sum; + + // create the Python object + pybind11::class_ object( + module, "Sum", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::vector & + >(), + pybind11::arg("label") = std::nullopt, + pybind11::arg("domain_min") = std::nullopt, + pybind11::arg("domain_max") = std::nullopt, + pybind11::arg("domain_unit") = std::nullopt, + pybind11::arg("summand"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.domainMin() = value; + }, + cppCLASS::component_t::documentation("domain_min").data() + ); + + // get/set domainMax + object.def_property( + "domain_max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMax(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.domainMax() = value; + }, + cppCLASS::component_t::documentation("domain_max").data() + ); + + // get/set domainUnit + object.def_property( + "domain_unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainUnit(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.domainUnit() = value; + }, + cppCLASS::component_t::documentation("domain_unit").data() + ); + + // get/set summand + object.def_property( + "summand", + [](const cppCLASS &self) -> decltype(auto) + { + return self.summand(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.summand() = value; + }, + cppCLASS::component_t::documentation("summand").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Summand.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Summand.python.cpp new file mode 100644 index 000000000..ea3e40417 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Summand.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Summand.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Summand +void wrapSummand(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Summand; + + // create the Python object + pybind11::class_ object( + module, "Summand", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("endf_mfmt") = std::nullopt, + pybind11::arg("coefficient") = std::nullopt, + pybind11::arg("href") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set ENDF_MFMT + object.def_property( + "endf_mfmt", + [](const cppCLASS &self) -> decltype(auto) + { + return self.ENDF_MFMT(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.ENDF_MFMT() = value; + }, + cppCLASS::component_t::documentation("endf_mfmt").data() + ); + + // get/set coefficient + object.def_property( + "coefficient", + [](const cppCLASS &self) -> decltype(auto) + { + return self.coefficient(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.coefficient() = value; + }, + cppCLASS::component_t::documentation("coefficient").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Summands.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Summands.python.cpp new file mode 100644 index 000000000..4c497411d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Summands.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Summands.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Summands +void wrapSummands(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Summands; + + // create the Python object + pybind11::class_ object( + module, "Summands", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("add"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set add + object.def_property( + "add", + [](const cppCLASS &self) -> decltype(auto) + { + return self.add(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.add() = value; + }, + cppCLASS::component_t::documentation("add").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Sums.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Sums.python.cpp new file mode 100644 index 000000000..80f0488a1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Sums.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Sums.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Sums +void wrapSums(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Sums; + + // create the Python object + pybind11::class_ object( + module, "Sums", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("cross_section_sums") = std::nullopt, + pybind11::arg("multiplicity_sums") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set crossSectionSums + object.def_property( + "cross_section_sums", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSectionSums(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.crossSectionSums() = value; + }, + cppCLASS::component_t::documentation("cross_section_sums").data() + ); + + // get/set multiplicitySums + object.def_property( + "multiplicity_sums", + [](const cppCLASS &self) -> decltype(auto) + { + return self.multiplicitySums(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.multiplicitySums() = value; + }, + cppCLASS::component_t::documentation("multiplicity_sums").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/T_M.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/T_M.python.cpp new file mode 100644 index 000000000..0dc1f30bb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/T_M.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/T_M.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::T_M +void wrapT_M(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::T_M; + + // create the Python object + pybind11::class_ object( + module, "T_M", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs1d & + >(), + pybind11::arg("xys1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const general::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/T_effective.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/T_effective.python.cpp new file mode 100644 index 000000000..2e951919e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/T_effective.python.cpp @@ -0,0 +1,104 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/T_effective.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::T_effective +void wrapT_effective(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::T_effective; + + // create the Python object + pybind11::class_ object( + module, "T_effective", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs1d & + >(), + pybind11::arg("xys1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const general::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Table.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Table.python.cpp new file mode 100644 index 000000000..e5ca35cd3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Table.python.cpp @@ -0,0 +1,124 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Table.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Table +void wrapTable(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Table; + + // create the Python object + pybind11::class_ object( + module, "Table", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const int &, + const int &, + const general::ColumnHeaders &, + const general::Data & + >(), + pybind11::arg("rows"), + pybind11::arg("columns"), + pybind11::arg("column_headers"), + pybind11::arg("data"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set rows + object.def_property( + "rows", + [](const cppCLASS &self) -> decltype(auto) + { + return self.rows(); + }, + [](cppCLASS &self, const int &value) + { + self.rows() = value; + }, + cppCLASS::component_t::documentation("rows").data() + ); + + // get/set columns + object.def_property( + "columns", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columns(); + }, + [](cppCLASS &self, const int &value) + { + self.columns() = value; + }, + cppCLASS::component_t::documentation("columns").data() + ); + + // get/set columnHeaders + object.def_property( + "column_headers", + [](const cppCLASS &self) -> decltype(auto) + { + return self.columnHeaders(); + }, + [](cppCLASS &self, const general::ColumnHeaders &value) + { + self.columnHeaders() = value; + }, + cppCLASS::component_t::documentation("column_headers").data() + ); + + // get/set data + object.def_property( + "data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.data(); + }, + [](cppCLASS &self, const general::Data &value) + { + self.data() = value; + }, + cppCLASS::component_t::documentation("data").data() + ); + + // shortcut: get/set column + object.def_property( + "column", + [](const cppCLASS &self) -> decltype(auto) + { + return self.column(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.column() = value; + }, + cppCLASS::component_t::documentation("column").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/TabulatedWidths.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/TabulatedWidths.python.cpp new file mode 100644 index 000000000..383eaf4d1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/TabulatedWidths.python.cpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/TabulatedWidths.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::TabulatedWidths +void wrapTabulatedWidths(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::TabulatedWidths; + + // create the Python object + pybind11::class_ object( + module, "TabulatedWidths", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::optional &, + const general::ResonanceReactions &, + const general::Ls &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("approximation"), + pybind11::arg("use_for_self_shielding_only") = std::nullopt, + pybind11::arg("resonance_reactions"), + pybind11::arg("ls"), + pybind11::arg("po_ps") = std::nullopt, + pybind11::arg("scattering_radius") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set approximation + object.def_property( + "approximation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.approximation(); + }, + [](cppCLASS &self, const std::string &value) + { + self.approximation() = value; + }, + cppCLASS::component_t::documentation("approximation").data() + ); + + // get/set useForSelfShieldingOnly + object.def_property( + "use_for_self_shielding_only", + [](const cppCLASS &self) -> decltype(auto) + { + return self.useForSelfShieldingOnly(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.useForSelfShieldingOnly() = value; + }, + cppCLASS::component_t::documentation("use_for_self_shielding_only").data() + ); + + // get/set resonanceReactions + object.def_property( + "resonance_reactions", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceReactions(); + }, + [](cppCLASS &self, const general::ResonanceReactions &value) + { + self.resonanceReactions() = value; + }, + cppCLASS::component_t::documentation("resonance_reactions").data() + ); + + // get/set Ls + object.def_property( + "ls", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Ls(); + }, + [](cppCLASS &self, const general::Ls &value) + { + self.Ls() = value; + }, + cppCLASS::component_t::documentation("ls").data() + ); + + // get/set PoPs + object.def_property( + "po_ps", + [](const cppCLASS &self) -> decltype(auto) + { + return self.PoPs(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.PoPs() = value; + }, + cppCLASS::component_t::documentation("po_ps").data() + ); + + // get/set scatteringRadius + object.def_property( + "scattering_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringRadius(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.scatteringRadius() = value; + }, + cppCLASS::component_t::documentation("scattering_radius").data() + ); + + // shortcut: get/set L + object.def_property( + "l", + [](const cppCLASS &self) -> decltype(auto) + { + return self.L(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.L() = value; + }, + cppCLASS::component_t::documentation("l").data() + ); + + // shortcut: get/set resonanceReaction + object.def_property( + "resonance_reaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceReaction(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.resonanceReaction() = value; + }, + cppCLASS::component_t::documentation("resonance_reaction").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Temperature.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Temperature.python.cpp new file mode 100644 index 000000000..041492884 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Temperature.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Temperature.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Temperature +void wrapTemperature(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Temperature; + + // create the Python object + pybind11::class_ object( + module, "Temperature", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const std::string & + >(), + pybind11::arg("value"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw.python.cpp new file mode 100644 index 000000000..a8e06d258 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ThermalNeutronScatteringLaw +void wrapThermalNeutronScatteringLaw(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ThermalNeutronScatteringLaw; + + // create the Python object + pybind11::class_ object( + module, "ThermalNeutronScatteringLaw", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string & + >(), + pybind11::arg("label"), + pybind11::arg("href"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw1d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw1d.python.cpp new file mode 100644 index 000000000..a477548cd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw1d.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw1d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ThermalNeutronScatteringLaw1d +void wrapThermalNeutronScatteringLaw1d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ThermalNeutronScatteringLaw1d; + + // create the Python object + pybind11::class_ object( + module, "ThermalNeutronScatteringLaw1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string & + >(), + pybind11::arg("label"), + pybind11::arg("href"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::string &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.python.cpp new file mode 100644 index 000000000..a9538c4d7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.python.cpp @@ -0,0 +1,152 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ThermalNeutronScatteringLaw_coherentElastic +void wrapThermalNeutronScatteringLaw_coherentElastic(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ThermalNeutronScatteringLaw_coherentElastic; + + // create the Python object + pybind11::class_ object( + module, "ThermalNeutronScatteringLaw_coherentElastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string &, + const general::S_table & + >(), + pybind11::arg("label"), + pybind11::arg("pid"), + pybind11::arg("product_frame"), + pybind11::arg("s_table"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::string &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::string &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set S_table + object.def_property( + "s_table", + [](const cppCLASS &self) -> decltype(auto) + { + return self.S_table(); + }, + [](cppCLASS &self, const general::S_table &value) + { + self.S_table() = value; + }, + cppCLASS::component_t::documentation("s_table").data() + ); + + // shortcut: get/set array + object.def_property( + "array", + [](const cppCLASS &self) -> decltype(auto) + { + return self.array(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.array() = value; + }, + cppCLASS::component_t::documentation("array").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set gridded2d + object.def_property( + "gridded2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gridded2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.gridded2d() = value; + }, + cppCLASS::component_t::documentation("gridded2d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp new file mode 100644 index 000000000..10becbe8c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.python.cpp @@ -0,0 +1,182 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ThermalNeutronScatteringLaw_incoherentElastic +void wrapThermalNeutronScatteringLaw_incoherentElastic(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ThermalNeutronScatteringLaw_incoherentElastic; + + // create the Python object + pybind11::class_ object( + module, "ThermalNeutronScatteringLaw_incoherentElastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string &, + const general::BoundAtomCrossSection &, + const general::DebyeWallerIntegral & + >(), + pybind11::arg("label"), + pybind11::arg("pid"), + pybind11::arg("product_frame"), + pybind11::arg("bound_atom_cross_section"), + pybind11::arg("debye_waller_integral"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::string &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::string &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set boundAtomCrossSection + object.def_property( + "bound_atom_cross_section", + [](const cppCLASS &self) -> decltype(auto) + { + return self.boundAtomCrossSection(); + }, + [](cppCLASS &self, const general::BoundAtomCrossSection &value) + { + self.boundAtomCrossSection() = value; + }, + cppCLASS::component_t::documentation("bound_atom_cross_section").data() + ); + + // get/set DebyeWallerIntegral + object.def_property( + "debye_waller_integral", + [](const cppCLASS &self) -> decltype(auto) + { + return self.DebyeWallerIntegral(); + }, + [](cppCLASS &self, const general::DebyeWallerIntegral &value) + { + self.DebyeWallerIntegral() = value; + }, + cppCLASS::component_t::documentation("debye_waller_integral").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp new file mode 100644 index 000000000..9f8b5b167 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.python.cpp @@ -0,0 +1,156 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::ThermalNeutronScatteringLaw_incoherentInelastic +void wrapThermalNeutronScatteringLaw_incoherentInelastic(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::ThermalNeutronScatteringLaw_incoherentInelastic; + + // create the Python object + pybind11::class_ object( + module, "ThermalNeutronScatteringLaw_incoherentInelastic", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string &, + const std::string &, + const std::optional &, + const general::ScatteringAtoms & + >(), + pybind11::arg("label"), + pybind11::arg("pid"), + pybind11::arg("product_frame"), + pybind11::arg("primary_scatterer"), + pybind11::arg("calculated_at_thermal") = std::nullopt, + pybind11::arg("scattering_atoms"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::string &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::string &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set primaryScatterer + object.def_property( + "primary_scatterer", + [](const cppCLASS &self) -> decltype(auto) + { + return self.primaryScatterer(); + }, + [](cppCLASS &self, const std::string &value) + { + self.primaryScatterer() = value; + }, + cppCLASS::component_t::documentation("primary_scatterer").data() + ); + + // get/set calculatedAtThermal + object.def_property( + "calculated_at_thermal", + [](const cppCLASS &self) -> decltype(auto) + { + return self.calculatedAtThermal(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.calculatedAtThermal() = value; + }, + cppCLASS::component_t::documentation("calculated_at_thermal").data() + ); + + // get/set scatteringAtoms + object.def_property( + "scattering_atoms", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringAtoms(); + }, + [](cppCLASS &self, const general::ScatteringAtoms &value) + { + self.scatteringAtoms() = value; + }, + cppCLASS::component_t::documentation("scattering_atoms").data() + ); + + // shortcut: get/set scatteringAtom + object.def_property( + "scattering_atom", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringAtom(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.scatteringAtom() = value; + }, + cppCLASS::component_t::documentation("scattering_atom").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Theta.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Theta.python.cpp new file mode 100644 index 000000000..19236a0d8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Theta.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Theta.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Theta +void wrapTheta(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Theta; + + // create the Python object + pybind11::class_ object( + module, "Theta", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("xys1d") = std::nullopt, + pybind11::arg("regions1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Time.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Time.python.cpp new file mode 100644 index 000000000..c351e22b7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Time.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Time.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Time +void wrapTime(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Time; + + // create the Python object + pybind11::class_ object( + module, "Time", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("double") = std::nullopt, + pybind11::arg("string") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // get/set string + object.def_property( + "string", + [](const cppCLASS &self) -> decltype(auto) + { + return self.string(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.string() = value; + }, + cppCLASS::component_t::documentation("string").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Title.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Title.python.cpp new file mode 100644 index 000000000..ce3470d94 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Title.python.cpp @@ -0,0 +1,60 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Title.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Title +void wrapTitle(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Title; + + // create the Python object + pybind11::class_ object( + module, "Title", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set data string + object.def_property( + "string", + [](const cppCLASS &self) -> const std::string & + { + return self; + }, + [](cppCLASS &self, const std::string &value) + { + self = value; + }, + cppCLASS::component_t::documentation("string").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/TotalEnergy.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/TotalEnergy.python.cpp new file mode 100644 index 000000000..3755dc897 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/TotalEnergy.python.cpp @@ -0,0 +1,132 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/TotalEnergy.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::TotalEnergy +void wrapTotalEnergy(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::TotalEnergy; + + // create the Python object + pybind11::class_ object( + module, "TotalEnergy", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::Polynomial1d & + >(), + pybind11::arg("polynomial1d"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const general::Polynomial1d &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/U.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/U.python.cpp new file mode 100644 index 000000000..796f5a90b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/U.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/U.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::U +void wrapU(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::U; + + // create the Python object + pybind11::class_ object( + module, "U", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const std::string & + >(), + pybind11::arg("value"), + pybind11::arg("unit"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // get/set unit + object.def_property( + "unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.unit() = value; + }, + cppCLASS::component_t::documentation("unit").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Uncertainty.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Uncertainty.python.cpp new file mode 100644 index 000000000..fe5a11d0f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Uncertainty.python.cpp @@ -0,0 +1,110 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Uncertainty.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Uncertainty +void wrapUncertainty(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Uncertainty; + + // create the Python object + pybind11::class_ object( + module, "Uncertainty", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("covariance") = std::nullopt, + pybind11::arg("standard") = std::nullopt, + pybind11::arg("list_of_covariances") = std::nullopt, + pybind11::arg("polynomial1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set covariance + object.def_property( + "covariance", + [](const cppCLASS &self) -> decltype(auto) + { + return self.covariance(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.covariance() = value; + }, + cppCLASS::component_t::documentation("covariance").data() + ); + + // get/set standard + object.def_property( + "standard", + [](const cppCLASS &self) -> decltype(auto) + { + return self.standard(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.standard() = value; + }, + cppCLASS::component_t::documentation("standard").data() + ); + + // get/set listOfCovariances + object.def_property( + "list_of_covariances", + [](const cppCLASS &self) -> decltype(auto) + { + return self.listOfCovariances(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.listOfCovariances() = value; + }, + cppCLASS::component_t::documentation("list_of_covariances").data() + ); + + // get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Uncorrelated.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Uncorrelated.python.cpp new file mode 100644 index 000000000..fd44ce6c4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Uncorrelated.python.cpp @@ -0,0 +1,250 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Uncorrelated.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Uncorrelated +void wrapUncorrelated(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Uncorrelated; + + // create the Python object + pybind11::class_ object( + module, "Uncorrelated", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const general::Angular &, + const general::Energy & + >(), + pybind11::arg("label"), + pybind11::arg("product_frame"), + pybind11::arg("angular"), + pybind11::arg("energy"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::string &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // get/set angular + object.def_property( + "angular", + [](const cppCLASS &self) -> decltype(auto) + { + return self.angular(); + }, + [](cppCLASS &self, const general::Angular &value) + { + self.angular() = value; + }, + cppCLASS::component_t::documentation("angular").data() + ); + + // get/set energy + object.def_property( + "energy", + [](const cppCLASS &self) -> decltype(auto) + { + return self.energy(); + }, + [](cppCLASS &self, const general::Energy &value) + { + self.energy() = value; + }, + cppCLASS::component_t::documentation("energy").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set MadlandNix + object.def_property( + "madland_nix", + [](const cppCLASS &self) -> decltype(auto) + { + return self.MadlandNix(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.MadlandNix() = value; + }, + cppCLASS::component_t::documentation("madland_nix").data() + ); + + // shortcut: get/set NBodyPhaseSpace + object.def_property( + "nbody_phase_space", + [](const cppCLASS &self) -> decltype(auto) + { + return self.NBodyPhaseSpace(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.NBodyPhaseSpace() = value; + }, + cppCLASS::component_t::documentation("nbody_phase_space").data() + ); + + // shortcut: get/set discreteGamma + object.def_property( + "discrete_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.discreteGamma(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.discreteGamma() = value; + }, + cppCLASS::component_t::documentation("discrete_gamma").data() + ); + + // shortcut: get/set evaporation + object.def_property( + "evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaporation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.evaporation() = value; + }, + cppCLASS::component_t::documentation("evaporation").data() + ); + + // shortcut: get/set generalEvaporation + object.def_property( + "general_evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.generalEvaporation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.generalEvaporation() = value; + }, + cppCLASS::component_t::documentation("general_evaporation").data() + ); + + // shortcut: get/set isotropic2d + object.def_property( + "isotropic2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.isotropic2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.isotropic2d() = value; + }, + cppCLASS::component_t::documentation("isotropic2d").data() + ); + + // shortcut: get/set primaryGamma + object.def_property( + "primary_gamma", + [](const cppCLASS &self) -> decltype(auto) + { + return self.primaryGamma(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.primaryGamma() = value; + }, + cppCLASS::component_t::documentation("primary_gamma").data() + ); + + // shortcut: get/set simpleMaxwellianFission + object.def_property( + "simple_maxwellian_fission", + [](const cppCLASS &self) -> decltype(auto) + { + return self.simpleMaxwellianFission(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.simpleMaxwellianFission() = value; + }, + cppCLASS::component_t::documentation("simple_maxwellian_fission").data() + ); + + // shortcut: get/set weightedFunctionals + object.def_property( + "weighted_functionals", + [](const cppCLASS &self) -> decltype(auto) + { + return self.weightedFunctionals(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.weightedFunctionals() = value; + }, + cppCLASS::component_t::documentation("weighted_functionals").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unorthodox.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unorthodox.python.cpp new file mode 100644 index 000000000..1dde219a3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unorthodox.python.cpp @@ -0,0 +1,92 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Unorthodox.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Unorthodox +void wrapUnorthodox(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Unorthodox; + + // create the Python object + pybind11::class_ object( + module, "Unorthodox", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const general::Mass & + >(), + pybind11::arg("id"), + pybind11::arg("mass"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set id + object.def_property( + "id", + [](const cppCLASS &self) -> decltype(auto) + { + return self.id(); + }, + [](cppCLASS &self, const std::string &value) + { + self.id() = value; + }, + cppCLASS::component_t::documentation("id").data() + ); + + // get/set mass + object.def_property( + "mass", + [](const cppCLASS &self) -> decltype(auto) + { + return self.mass(); + }, + [](cppCLASS &self, const general::Mass &value) + { + self.mass() = value; + }, + cppCLASS::component_t::documentation("mass").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unorthodoxes.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unorthodoxes.python.cpp new file mode 100644 index 000000000..762fc9b3c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unorthodoxes.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Unorthodoxes.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Unorthodoxes +void wrapUnorthodoxes(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Unorthodoxes; + + // create the Python object + pybind11::class_ object( + module, "Unorthodoxes", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("unorthodox"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set unorthodox + object.def_property( + "unorthodox", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unorthodox(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.unorthodox() = value; + }, + cppCLASS::component_t::documentation("unorthodox").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unresolved.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unresolved.python.cpp new file mode 100644 index 000000000..8d51b75a0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unresolved.python.cpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Unresolved.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Unresolved +void wrapUnresolved(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Unresolved; + + // create the Python object + pybind11::class_ object( + module, "Unresolved", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const double &, + const std::string &, + const general::TabulatedWidths & + >(), + pybind11::arg("domain_min"), + pybind11::arg("domain_max"), + pybind11::arg("domain_unit"), + pybind11::arg("tabulated_widths"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMin() = value; + }, + cppCLASS::component_t::documentation("domain_min").data() + ); + + // get/set domainMax + object.def_property( + "domain_max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMax(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMax() = value; + }, + cppCLASS::component_t::documentation("domain_max").data() + ); + + // get/set domainUnit + object.def_property( + "domain_unit", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainUnit(); + }, + [](cppCLASS &self, const std::string &value) + { + self.domainUnit() = value; + }, + cppCLASS::component_t::documentation("domain_unit").data() + ); + + // get/set tabulatedWidths + object.def_property( + "tabulated_widths", + [](const cppCLASS &self) -> decltype(auto) + { + return self.tabulatedWidths(); + }, + [](cppCLASS &self, const general::TabulatedWidths &value) + { + self.tabulatedWidths() = value; + }, + cppCLASS::component_t::documentation("tabulated_widths").data() + ); + + // shortcut: get/set L + object.def_property( + "l", + [](const cppCLASS &self) -> decltype(auto) + { + return self.L(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.L() = value; + }, + cppCLASS::component_t::documentation("l").data() + ); + + // shortcut: get/set Ls + object.def_property( + "ls", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Ls(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Ls() = value; + }, + cppCLASS::component_t::documentation("ls").data() + ); + + // shortcut: get/set PoPs + object.def_property( + "po_ps", + [](const cppCLASS &self) -> decltype(auto) + { + return self.PoPs(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.PoPs() = value; + }, + cppCLASS::component_t::documentation("po_ps").data() + ); + + // shortcut: get/set resonanceReaction + object.def_property( + "resonance_reaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceReaction(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.resonanceReaction() = value; + }, + cppCLASS::component_t::documentation("resonance_reaction").data() + ); + + // shortcut: get/set resonanceReactions + object.def_property( + "resonance_reactions", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceReactions(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.resonanceReactions() = value; + }, + cppCLASS::component_t::documentation("resonance_reactions").data() + ); + + // shortcut: get/set scatteringRadius + object.def_property( + "scattering_radius", + [](const cppCLASS &self) -> decltype(auto) + { + return self.scatteringRadius(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.scatteringRadius() = value; + }, + cppCLASS::component_t::documentation("scattering_radius").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/UnresolvedRegion.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/UnresolvedRegion.python.cpp new file mode 100644 index 000000000..74f5a486e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/UnresolvedRegion.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/UnresolvedRegion.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::UnresolvedRegion +void wrapUnresolvedRegion(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::UnresolvedRegion; + + // create the Python object + pybind11::class_ object( + module, "UnresolvedRegion", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional & + >(), + pybind11::arg("xys1d") = std::nullopt, + pybind11::arg("regions1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unspecified.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unspecified.python.cpp new file mode 100644 index 000000000..39d461e17 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Unspecified.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Unspecified.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Unspecified +void wrapUnspecified(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Unspecified; + + // create the Python object + pybind11::class_ object( + module, "Unspecified", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("product_frame") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set productFrame + object.def_property( + "product_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productFrame(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.productFrame() = value; + }, + cppCLASS::component_t::documentation("product_frame").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Values.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Values.python.cpp new file mode 100644 index 000000000..4683485b8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Values.python.cpp @@ -0,0 +1,69 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Values.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Values +void wrapValues(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Values; + + // create the Python object + pybind11::class_ object( + module, "Values", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + >(), + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("doubles"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set vector + object.def_property( + "doubles", + [](const cppCLASS &self) -> const std::vector & + { + return self; + }, + [](cppCLASS &self, const std::vector &value) + { + self = value; + }, + cppCLASS::component_t::documentation("doubles").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Weighted.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Weighted.python.cpp new file mode 100644 index 000000000..e238e3cc5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Weighted.python.cpp @@ -0,0 +1,162 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Weighted.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Weighted +void wrapWeighted(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Weighted; + + // create the Python object + pybind11::class_ object( + module, "Weighted", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const general::XYs1d &, + const general::Evaporation & + >(), + pybind11::arg("xys1d"), + pybind11::arg("evaporation"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const general::XYs1d &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set evaporation + object.def_property( + "evaporation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaporation(); + }, + [](cppCLASS &self, const general::Evaporation &value) + { + self.evaporation() = value; + }, + cppCLASS::component_t::documentation("evaporation").data() + ); + + // shortcut: get/set U + object.def_property( + "u", + [](const cppCLASS &self) -> decltype(auto) + { + return self.U(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.U() = value; + }, + cppCLASS::component_t::documentation("u").data() + ); + + // shortcut: get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set theta + object.def_property( + "theta", + [](const cppCLASS &self) -> decltype(auto) + { + return self.theta(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.theta() = value; + }, + cppCLASS::component_t::documentation("theta").data() + ); + + // shortcut: get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/WeightedFunctionals.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/WeightedFunctionals.python.cpp new file mode 100644 index 000000000..57bc66d55 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/WeightedFunctionals.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/WeightedFunctionals.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::WeightedFunctionals +void wrapWeightedFunctionals(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::WeightedFunctionals; + + // create the Python object + pybind11::class_ object( + module, "WeightedFunctionals", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("weighted"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set weighted + object.def_property( + "weighted", + [](const cppCLASS &self) -> decltype(auto) + { + return self.weighted(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.weighted() = value; + }, + cppCLASS::component_t::documentation("weighted").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Width.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Width.python.cpp new file mode 100644 index 000000000..da3d33e52 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Width.python.cpp @@ -0,0 +1,142 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Width.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Width +void wrapWidth(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Width; + + // create the Python object + pybind11::class_ object( + module, "Width", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const int &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("label"), + pybind11::arg("resonance_reaction"), + pybind11::arg("degrees_of_freedom"), + pybind11::arg("xys1d") = std::nullopt, + pybind11::arg("constant1d") = std::nullopt, + pybind11::arg("regions1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set resonanceReaction + object.def_property( + "resonance_reaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonanceReaction(); + }, + [](cppCLASS &self, const std::string &value) + { + self.resonanceReaction() = value; + }, + cppCLASS::component_t::documentation("resonance_reaction").data() + ); + + // get/set degreesOfFreedom + object.def_property( + "degrees_of_freedom", + [](const cppCLASS &self) -> decltype(auto) + { + return self.degreesOfFreedom(); + }, + [](cppCLASS &self, const int &value) + { + self.degreesOfFreedom() = value; + }, + cppCLASS::component_t::documentation("degrees_of_freedom").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Widths.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Widths.python.cpp new file mode 100644 index 000000000..700aa22ac --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Widths.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Widths.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Widths +void wrapWidths(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Widths; + + // create the Python object + pybind11::class_ object( + module, "Widths", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("width"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set width + object.def_property( + "width", + [](const cppCLASS &self) -> decltype(auto) + { + return self.width(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.width() = value; + }, + cppCLASS::component_t::documentation("width").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs1d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs1d.python.cpp new file mode 100644 index 000000000..32b01e271 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs1d.python.cpp @@ -0,0 +1,158 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::XYs1d +void wrapXYs1d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::XYs1d; + + // create the Python object + pybind11::class_ object( + module, "XYs1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const general::Values &, + const std::optional & + >(), + pybind11::arg("label") = std::nullopt, + pybind11::arg("index") = std::nullopt, + pybind11::arg("interpolation") = std::nullopt, + pybind11::arg("outer_domain_value") = std::nullopt, + pybind11::arg("axes") = std::nullopt, + pybind11::arg("values"), + pybind11::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set index + object.def_property( + "index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.index(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set interpolation + object.def_property( + "interpolation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interpolation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.interpolation() = value; + }, + cppCLASS::component_t::documentation("interpolation").data() + ); + + // get/set outerDomainValue + object.def_property( + "outer_domain_value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outerDomainValue(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.outerDomainValue() = value; + }, + cppCLASS::component_t::documentation("outer_domain_value").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const general::Values &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs2d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs2d.python.cpp new file mode 100644 index 000000000..e372d98b9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs2d.python.cpp @@ -0,0 +1,200 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/XYs2d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::XYs2d +void wrapXYs2d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::XYs2d; + + // create the Python object + pybind11::class_ object( + module, "XYs2d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const general::Function1ds &, + const std::optional & + >(), + pybind11::arg("index") = std::nullopt, + pybind11::arg("interpolation") = std::nullopt, + pybind11::arg("interpolation_qualifier") = std::nullopt, + pybind11::arg("outer_domain_value") = std::nullopt, + pybind11::arg("axes") = std::nullopt, + pybind11::arg("function1ds"), + pybind11::arg("uncertainty") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set index + object.def_property( + "index", + [](const cppCLASS &self) -> decltype(auto) + { + return self.index(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.index() = value; + }, + cppCLASS::component_t::documentation("index").data() + ); + + // get/set interpolation + object.def_property( + "interpolation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interpolation(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.interpolation() = value; + }, + cppCLASS::component_t::documentation("interpolation").data() + ); + + // get/set interpolationQualifier + object.def_property( + "interpolation_qualifier", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interpolationQualifier(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.interpolationQualifier() = value; + }, + cppCLASS::component_t::documentation("interpolation_qualifier").data() + ); + + // get/set outerDomainValue + object.def_property( + "outer_domain_value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.outerDomainValue(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.outerDomainValue() = value; + }, + cppCLASS::component_t::documentation("outer_domain_value").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set function1ds + object.def_property( + "function1ds", + [](const cppCLASS &self) -> decltype(auto) + { + return self.function1ds(); + }, + [](cppCLASS &self, const general::Function1ds &value) + { + self.function1ds() = value; + }, + cppCLASS::component_t::documentation("function1ds").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set Legendre + object.def_property( + "legendre", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Legendre(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Legendre() = value; + }, + cppCLASS::component_t::documentation("legendre").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs3d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs3d.python.cpp new file mode 100644 index 000000000..03bcb95e7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/XYs3d.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/XYs3d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::XYs3d +void wrapXYs3d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::XYs3d; + + // create the Python object + pybind11::class_ object( + module, "XYs3d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::vector & + >(), + pybind11::arg("interpolation_qualifier") = std::nullopt, + pybind11::arg("axes") = std::nullopt, + pybind11::arg("function2ds"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set interpolationQualifier + object.def_property( + "interpolation_qualifier", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interpolationQualifier(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.interpolationQualifier() = value; + }, + cppCLASS::component_t::documentation("interpolation_qualifier").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set function2ds + object.def_property( + "function2ds", + [](const cppCLASS &self) -> decltype(auto) + { + return self.function2ds(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.function2ds() = value; + }, + cppCLASS::component_t::documentation("function2ds").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Yields.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Yields.python.cpp new file mode 100644 index 000000000..399868cf4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/general/Yields.python.cpp @@ -0,0 +1,136 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/general/Yields.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_general { + +// wrapper for general::Yields +void wrapYields(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = general::Yields; + + // create the Python object + pybind11::class_ object( + module, "Yields", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const reduced::Nuclides &, + const general::Values &, + const general::Uncertainty & + >(), + pybind11::arg("nuclides"), + pybind11::arg("values"), + pybind11::arg("uncertainty"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set nuclides + object.def_property( + "nuclides", + [](const cppCLASS &self) -> decltype(auto) + { + return self.nuclides(); + }, + [](cppCLASS &self, const reduced::Nuclides &value) + { + self.nuclides() = value; + }, + cppCLASS::component_t::documentation("nuclides").data() + ); + + // get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const general::Values &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // get/set uncertainty + object.def_property( + "uncertainty", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncertainty(); + }, + [](cppCLASS &self, const general::Uncertainty &value) + { + self.uncertainty() = value; + }, + cppCLASS::component_t::documentation("uncertainty").data() + ); + + // shortcut: get/set listOfCovariances + object.def_property( + "list_of_covariances", + [](const cppCLASS &self) -> decltype(auto) + { + return self.listOfCovariances(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.listOfCovariances() = value; + }, + cppCLASS::component_t::documentation("list_of_covariances").data() + ); + + // shortcut: get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // shortcut: get/set standard + object.def_property( + "standard", + [](const cppCLASS &self) -> decltype(auto) + { + return self.standard(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.standard() = value; + }, + cppCLASS::component_t::documentation("standard").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_general +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced.python.cpp new file mode 100644 index 000000000..c1c914925 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced.python.cpp @@ -0,0 +1,49 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include +#include + +// project GNDS +// version v2.0 +namespace python_GNDS { +namespace python_v2_0 { + + // namespace reduced: class wrapper declarations + namespace python_reduced { + void wrapDouble(pybind11::module &); + void wrapPolynomial1d(pybind11::module &); + void wrapFunction1ds(pybind11::module &); + void wrapCrossSection(pybind11::module &); + void wrapDistribution(pybind11::module &); + void wrapProduct(pybind11::module &); + void wrapProducts(pybind11::module &); + void wrapOutputChannel(pybind11::module &); + void wrapNuclides(pybind11::module &); + } // namespace python_reduced + + // namespace reduced: wrapper + void wrapReduced(pybind11::module &module) + { + // reduced + pybind11::module submodule = module.def_submodule( + "reduced", + "GNDS v2.0 reduced" + ); + + // reduced classes + python_reduced::wrapDouble(submodule); + python_reduced::wrapPolynomial1d(submodule); + python_reduced::wrapFunction1ds(submodule); + python_reduced::wrapCrossSection(submodule); + python_reduced::wrapDistribution(submodule); + python_reduced::wrapProduct(submodule); + python_reduced::wrapProducts(submodule); + python_reduced::wrapOutputChannel(submodule); + python_reduced::wrapNuclides(submodule); + } + +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/CrossSection.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/CrossSection.python.cpp new file mode 100644 index 000000000..1a99a734a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/CrossSection.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/reduced/CrossSection.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::CrossSection +void wrapCrossSection(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = reduced::CrossSection; + + // create the Python object + pybind11::class_ object( + module, "CrossSection", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("xys1d") = std::nullopt, + pybind11::arg("regions1d") = std::nullopt, + pybind11::arg("reference") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_reduced +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Distribution.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Distribution.python.cpp new file mode 100644 index 000000000..cafcd131f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Distribution.python.cpp @@ -0,0 +1,126 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/reduced/Distribution.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Distribution +void wrapDistribution(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = reduced::Distribution; + + // create the Python object + pybind11::class_ object( + module, "Distribution", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("thermal_neutron_scattering_law") = std::nullopt, + pybind11::arg("uncorrelated") = std::nullopt, + pybind11::arg("unspecified") = std::nullopt, + pybind11::arg("xys2d") = std::nullopt, + pybind11::arg("branching3d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set thermalNeutronScatteringLaw + object.def_property( + "thermal_neutron_scattering_law", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.thermalNeutronScatteringLaw() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law").data() + ); + + // get/set uncorrelated + object.def_property( + "uncorrelated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncorrelated(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.uncorrelated() = value; + }, + cppCLASS::component_t::documentation("uncorrelated").data() + ); + + // get/set unspecified + object.def_property( + "unspecified", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unspecified(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unspecified() = value; + }, + cppCLASS::component_t::documentation("unspecified").data() + ); + + // get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // get/set branching3d + object.def_property( + "branching3d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.branching3d(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.branching3d() = value; + }, + cppCLASS::component_t::documentation("branching3d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_reduced +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Double.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Double.python.cpp new file mode 100644 index 000000000..ba7be0c39 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Double.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/reduced/Double.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Double +void wrapDouble(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = reduced::Double; + + // create the Python object + pybind11::class_ object( + module, "Double", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double & + >(), + pybind11::arg("value"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set value + object.def_property( + "value", + [](const cppCLASS &self) -> decltype(auto) + { + return self.value(); + }, + [](cppCLASS &self, const double &value) + { + self.value() = value; + }, + cppCLASS::component_t::documentation("value").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_reduced +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Function1ds.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Function1ds.python.cpp new file mode 100644 index 000000000..355b32139 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Function1ds.python.cpp @@ -0,0 +1,78 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/reduced/Function1ds.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Function1ds +void wrapFunction1ds(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = reduced::Function1ds; + + // create the Python object + pybind11::class_ object( + module, "Function1ds", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector &, + const std::optional> & + >(), + pybind11::arg("legendre"), + pybind11::arg("xys1d") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set Legendre + object.def_property( + "legendre", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Legendre(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.Legendre() = value; + }, + cppCLASS::component_t::documentation("legendre").data() + ); + + // get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::optional> &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_reduced +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Nuclides.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Nuclides.python.cpp new file mode 100644 index 000000000..43eab45a8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Nuclides.python.cpp @@ -0,0 +1,85 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/reduced/Nuclides.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Nuclides +void wrapNuclides(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = reduced::Nuclides; + + // create the Python object + pybind11::class_ object( + module, "Nuclides", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional & + >(), + pybind11::arg("href") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // constructor: from vector + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("strings"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set href + object.def_property( + "href", + [](const cppCLASS &self) -> decltype(auto) + { + return self.href(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.href() = value; + }, + cppCLASS::component_t::documentation("href").data() + ); + + // get/set vector + object.def_property( + "strings", + [](const cppCLASS &self) -> const std::vector & + { + return self; + }, + [](cppCLASS &self, const std::vector &value) + { + self = value; + }, + cppCLASS::component_t::documentation("strings").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_reduced +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/OutputChannel.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/OutputChannel.python.cpp new file mode 100644 index 000000000..6946adbc1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/OutputChannel.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/reduced/OutputChannel.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::OutputChannel +void wrapOutputChannel(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = reduced::OutputChannel; + + // create the Python object + pybind11::class_ object( + module, "OutputChannel", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::optional &, + const general::Q &, + const std::optional & + >(), + pybind11::arg("genre"), + pybind11::arg("process") = std::nullopt, + pybind11::arg("q"), + pybind11::arg("products") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set genre + object.def_property( + "genre", + [](const cppCLASS &self) -> decltype(auto) + { + return self.genre(); + }, + [](cppCLASS &self, const std::string &value) + { + self.genre() = value; + }, + cppCLASS::component_t::documentation("genre").data() + ); + + // get/set process + object.def_property( + "process", + [](const cppCLASS &self) -> decltype(auto) + { + return self.process(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.process() = value; + }, + cppCLASS::component_t::documentation("process").data() + ); + + // get/set Q + object.def_property( + "q", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Q(); + }, + [](cppCLASS &self, const general::Q &value) + { + self.Q() = value; + }, + cppCLASS::component_t::documentation("q").data() + ); + + // get/set products + object.def_property( + "products", + [](const cppCLASS &self) -> decltype(auto) + { + return self.products(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.products() = value; + }, + cppCLASS::component_t::documentation("products").data() + ); + + // shortcut: get/set Double + object.def_property( + "double", + [](const cppCLASS &self) -> decltype(auto) + { + return self.Double(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.Double() = value; + }, + cppCLASS::component_t::documentation("double").data() + ); + + // shortcut: get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_reduced +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Polynomial1d.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Polynomial1d.python.cpp new file mode 100644 index 000000000..a7c560bac --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Polynomial1d.python.cpp @@ -0,0 +1,138 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/reduced/Polynomial1d.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Polynomial1d +void wrapPolynomial1d(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = reduced::Polynomial1d; + + // create the Python object + pybind11::class_ object( + module, "Polynomial1d", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const double &, + const double &, + const general::Axes &, + const general::Values & + >(), + pybind11::arg("domain_min"), + pybind11::arg("domain_max"), + pybind11::arg("axes"), + pybind11::arg("values"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set domainMin + object.def_property( + "domain_min", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMin(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMin() = value; + }, + cppCLASS::component_t::documentation("domain_min").data() + ); + + // get/set domainMax + object.def_property( + "domain_max", + [](const cppCLASS &self) -> decltype(auto) + { + return self.domainMax(); + }, + [](cppCLASS &self, const double &value) + { + self.domainMax() = value; + }, + cppCLASS::component_t::documentation("domain_max").data() + ); + + // get/set axes + object.def_property( + "axes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axes(); + }, + [](cppCLASS &self, const general::Axes &value) + { + self.axes() = value; + }, + cppCLASS::component_t::documentation("axes").data() + ); + + // get/set values + object.def_property( + "values", + [](const cppCLASS &self) -> decltype(auto) + { + return self.values(); + }, + [](cppCLASS &self, const general::Values &value) + { + self.values() = value; + }, + cppCLASS::component_t::documentation("values").data() + ); + + // shortcut: get/set axis + object.def_property( + "axis", + [](const cppCLASS &self) -> decltype(auto) + { + return self.axis(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.axis() = value; + }, + cppCLASS::component_t::documentation("axis").data() + ); + + // shortcut: get/set grid + object.def_property( + "grid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.grid(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.grid() = value; + }, + cppCLASS::component_t::documentation("grid").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_reduced +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Product.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Product.python.cpp new file mode 100644 index 000000000..872051b7a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Product.python.cpp @@ -0,0 +1,236 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/reduced/Product.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Product +void wrapProduct(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = reduced::Product; + + // create the Python object + pybind11::class_ object( + module, "Product", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const general::Multiplicity &, + const reduced::Distribution & + >(), + pybind11::arg("label"), + pybind11::arg("pid"), + pybind11::arg("multiplicity"), + pybind11::arg("distribution"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set label + object.def_property( + "label", + [](const cppCLASS &self) -> decltype(auto) + { + return self.label(); + }, + [](cppCLASS &self, const std::string &value) + { + self.label() = value; + }, + cppCLASS::component_t::documentation("label").data() + ); + + // get/set pid + object.def_property( + "pid", + [](const cppCLASS &self) -> decltype(auto) + { + return self.pid(); + }, + [](cppCLASS &self, const std::string &value) + { + self.pid() = value; + }, + cppCLASS::component_t::documentation("pid").data() + ); + + // get/set multiplicity + object.def_property( + "multiplicity", + [](const cppCLASS &self) -> decltype(auto) + { + return self.multiplicity(); + }, + [](cppCLASS &self, const general::Multiplicity &value) + { + self.multiplicity() = value; + }, + cppCLASS::component_t::documentation("multiplicity").data() + ); + + // get/set distribution + object.def_property( + "distribution", + [](const cppCLASS &self) -> decltype(auto) + { + return self.distribution(); + }, + [](cppCLASS &self, const reduced::Distribution &value) + { + self.distribution() = value; + }, + cppCLASS::component_t::documentation("distribution").data() + ); + + // shortcut: get/set XYs1d + object.def_property( + "xys1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs1d() = value; + }, + cppCLASS::component_t::documentation("xys1d").data() + ); + + // shortcut: get/set XYs2d + object.def_property( + "xys2d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.XYs2d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.XYs2d() = value; + }, + cppCLASS::component_t::documentation("xys2d").data() + ); + + // shortcut: get/set branching1d + object.def_property( + "branching1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.branching1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.branching1d() = value; + }, + cppCLASS::component_t::documentation("branching1d").data() + ); + + // shortcut: get/set constant1d + object.def_property( + "constant1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.constant1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.constant1d() = value; + }, + cppCLASS::component_t::documentation("constant1d").data() + ); + + // shortcut: get/set polynomial1d + object.def_property( + "polynomial1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.polynomial1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.polynomial1d() = value; + }, + cppCLASS::component_t::documentation("polynomial1d").data() + ); + + // shortcut: get/set reference + object.def_property( + "reference", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reference(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.reference() = value; + }, + cppCLASS::component_t::documentation("reference").data() + ); + + // shortcut: get/set regions1d + object.def_property( + "regions1d", + [](const cppCLASS &self) -> decltype(auto) + { + return self.regions1d(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.regions1d() = value; + }, + cppCLASS::component_t::documentation("regions1d").data() + ); + + // shortcut: get/set thermalNeutronScatteringLaw + object.def_property( + "thermal_neutron_scattering_law", + [](const cppCLASS &self) -> decltype(auto) + { + return self.thermalNeutronScatteringLaw(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.thermalNeutronScatteringLaw() = value; + }, + cppCLASS::component_t::documentation("thermal_neutron_scattering_law").data() + ); + + // shortcut: get/set uncorrelated + object.def_property( + "uncorrelated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.uncorrelated(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.uncorrelated() = value; + }, + cppCLASS::component_t::documentation("uncorrelated").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_reduced +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Products.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Products.python.cpp new file mode 100644 index 000000000..b10bfde16 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/reduced/Products.python.cpp @@ -0,0 +1,62 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/reduced/Products.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_reduced { + +// wrapper for reduced::Products +void wrapProducts(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = reduced::Products; + + // create the Python object + pybind11::class_ object( + module, "Products", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::vector & + >(), + pybind11::arg("product"), + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set product + object.def_property( + "product", + [](const cppCLASS &self) -> decltype(auto) + { + return self.product(); + }, + [](cppCLASS &self, const std::vector &value) + { + self.product() = value; + }, + cppCLASS::component_t::documentation("product").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_reduced +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/top.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/top.python.cpp new file mode 100644 index 000000000..519c78d5f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/top.python.cpp @@ -0,0 +1,39 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#include +#include +#include + +// project GNDS +// version v2.0 +namespace python_GNDS { +namespace python_v2_0 { + + // namespace top: class wrapper declarations + namespace python_top { + void wrapFissionFragmentData(pybind11::module &); + void wrapPoPs(pybind11::module &); + void wrapReactionSuite(pybind11::module &); + void wrapCovarianceSuite(pybind11::module &); + } // namespace python_top + + // namespace top: wrapper + void wrapTop(pybind11::module &module) + { + // top + pybind11::module submodule = module.def_submodule( + "top", + "GNDS v2.0 top" + ); + + // top classes + python_top::wrapFissionFragmentData(submodule); + python_top::wrapPoPs(submodule); + python_top::wrapReactionSuite(submodule); + python_top::wrapCovarianceSuite(submodule); + } + +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/CovarianceSuite.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/CovarianceSuite.python.cpp new file mode 100644 index 000000000..c4280c077 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/CovarianceSuite.python.cpp @@ -0,0 +1,260 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/top/CovarianceSuite.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_top { + +// wrapper for top::CovarianceSuite +void wrapCovarianceSuite(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = top::CovarianceSuite; + + // create the Python object + pybind11::class_ object( + module, "CovarianceSuite", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string &, + const std::string &, + const std::string &, + const std::optional &, + const general::Styles &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("projectile"), + pybind11::arg("target"), + pybind11::arg("evaluation"), + pybind11::arg("interaction"), + pybind11::arg("format"), + pybind11::arg("external_files") = std::nullopt, + pybind11::arg("styles"), + pybind11::arg("covariance_sections") = std::nullopt, + pybind11::arg("parameter_covariances") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set projectile + object.def_property( + "projectile", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectile(); + }, + [](cppCLASS &self, const std::string &value) + { + self.projectile() = value; + }, + cppCLASS::component_t::documentation("projectile").data() + ); + + // get/set target + object.def_property( + "target", + [](const cppCLASS &self) -> decltype(auto) + { + return self.target(); + }, + [](cppCLASS &self, const std::string &value) + { + self.target() = value; + }, + cppCLASS::component_t::documentation("target").data() + ); + + // get/set evaluation + object.def_property( + "evaluation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaluation(); + }, + [](cppCLASS &self, const std::string &value) + { + self.evaluation() = value; + }, + cppCLASS::component_t::documentation("evaluation").data() + ); + + // get/set interaction + object.def_property( + "interaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interaction(); + }, + [](cppCLASS &self, const std::string &value) + { + self.interaction() = value; + }, + cppCLASS::component_t::documentation("interaction").data() + ); + + // get/set format + object.def_property( + "format", + [](const cppCLASS &self) -> decltype(auto) + { + return self.format(); + }, + [](cppCLASS &self, const std::string &value) + { + self.format() = value; + }, + cppCLASS::component_t::documentation("format").data() + ); + + // get/set externalFiles + object.def_property( + "external_files", + [](const cppCLASS &self) -> decltype(auto) + { + return self.externalFiles(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.externalFiles() = value; + }, + cppCLASS::component_t::documentation("external_files").data() + ); + + // get/set styles + object.def_property( + "styles", + [](const cppCLASS &self) -> decltype(auto) + { + return self.styles(); + }, + [](cppCLASS &self, const general::Styles &value) + { + self.styles() = value; + }, + cppCLASS::component_t::documentation("styles").data() + ); + + // get/set covarianceSections + object.def_property( + "covariance_sections", + [](const cppCLASS &self) -> decltype(auto) + { + return self.covarianceSections(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.covarianceSections() = value; + }, + cppCLASS::component_t::documentation("covariance_sections").data() + ); + + // get/set parameterCovariances + object.def_property( + "parameter_covariances", + [](const cppCLASS &self) -> decltype(auto) + { + return self.parameterCovariances(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.parameterCovariances() = value; + }, + cppCLASS::component_t::documentation("parameter_covariances").data() + ); + + // shortcut: get/set crossSectionReconstructed + object.def_property( + "cross_section_reconstructed", + [](const cppCLASS &self) -> decltype(auto) + { + return self.crossSectionReconstructed(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.crossSectionReconstructed() = value; + }, + cppCLASS::component_t::documentation("cross_section_reconstructed").data() + ); + + // shortcut: get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // shortcut: get/set evaluated + object.def_property( + "evaluated", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaluated(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.evaluated() = value; + }, + cppCLASS::component_t::documentation("evaluated").data() + ); + + // shortcut: get/set projectileEnergyDomain + object.def_property( + "projectile_energy_domain", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectileEnergyDomain(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.projectileEnergyDomain() = value; + }, + cppCLASS::component_t::documentation("projectile_energy_domain").data() + ); + + // shortcut: get/set temperature + object.def_property( + "temperature", + [](const cppCLASS &self) -> decltype(auto) + { + return self.temperature(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.temperature() = value; + }, + cppCLASS::component_t::documentation("temperature").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_top +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/FissionFragmentData.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/FissionFragmentData.python.cpp new file mode 100644 index 000000000..be86507bc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/FissionFragmentData.python.cpp @@ -0,0 +1,94 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/top/FissionFragmentData.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_top { + +// wrapper for top::FissionFragmentData +void wrapFissionFragmentData(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = top::FissionFragmentData; + + // create the Python object + pybind11::class_ object( + module, "FissionFragmentData", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("product_yields") = std::nullopt, + pybind11::arg("delayed_neutrons") = std::nullopt, + pybind11::arg("fission_energy_releases") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set productYields + object.def_property( + "product_yields", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productYields(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.productYields() = value; + }, + cppCLASS::component_t::documentation("product_yields").data() + ); + + // get/set delayedNeutrons + object.def_property( + "delayed_neutrons", + [](const cppCLASS &self) -> decltype(auto) + { + return self.delayedNeutrons(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.delayedNeutrons() = value; + }, + cppCLASS::component_t::documentation("delayed_neutrons").data() + ); + + // get/set fissionEnergyReleases + object.def_property( + "fission_energy_releases", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionEnergyReleases(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.fissionEnergyReleases() = value; + }, + cppCLASS::component_t::documentation("fission_energy_releases").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_top +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/PoPs.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/PoPs.python.cpp new file mode 100644 index 000000000..953be1fa4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/PoPs.python.cpp @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/top/PoPs.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_top { + +// wrapper for top::PoPs +void wrapPoPs(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = top::PoPs; + + // create the Python object + pybind11::class_ object( + module, "PoPs", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("name"), + pybind11::arg("version"), + pybind11::arg("format"), + pybind11::arg("aliases") = std::nullopt, + pybind11::arg("baryons") = std::nullopt, + pybind11::arg("chemical_elements") = std::nullopt, + pybind11::arg("styles") = std::nullopt, + pybind11::arg("unorthodoxes") = std::nullopt, + pybind11::arg("gauge_bosons") = std::nullopt, + pybind11::arg("leptons") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set name + object.def_property( + "name", + [](const cppCLASS &self) -> decltype(auto) + { + return self.name(); + }, + [](cppCLASS &self, const std::string &value) + { + self.name() = value; + }, + cppCLASS::component_t::documentation("name").data() + ); + + // get/set version + object.def_property( + "version", + [](const cppCLASS &self) -> decltype(auto) + { + return self.version(); + }, + [](cppCLASS &self, const std::string &value) + { + self.version() = value; + }, + cppCLASS::component_t::documentation("version").data() + ); + + // get/set format + object.def_property( + "format", + [](const cppCLASS &self) -> decltype(auto) + { + return self.format(); + }, + [](cppCLASS &self, const std::string &value) + { + self.format() = value; + }, + cppCLASS::component_t::documentation("format").data() + ); + + // get/set aliases + object.def_property( + "aliases", + [](const cppCLASS &self) -> decltype(auto) + { + return self.aliases(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.aliases() = value; + }, + cppCLASS::component_t::documentation("aliases").data() + ); + + // get/set baryons + object.def_property( + "baryons", + [](const cppCLASS &self) -> decltype(auto) + { + return self.baryons(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.baryons() = value; + }, + cppCLASS::component_t::documentation("baryons").data() + ); + + // get/set chemicalElements + object.def_property( + "chemical_elements", + [](const cppCLASS &self) -> decltype(auto) + { + return self.chemicalElements(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.chemicalElements() = value; + }, + cppCLASS::component_t::documentation("chemical_elements").data() + ); + + // get/set styles + object.def_property( + "styles", + [](const cppCLASS &self) -> decltype(auto) + { + return self.styles(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.styles() = value; + }, + cppCLASS::component_t::documentation("styles").data() + ); + + // get/set unorthodoxes + object.def_property( + "unorthodoxes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unorthodoxes(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.unorthodoxes() = value; + }, + cppCLASS::component_t::documentation("unorthodoxes").data() + ); + + // get/set gaugeBosons + object.def_property( + "gauge_bosons", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gaugeBosons(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.gaugeBosons() = value; + }, + cppCLASS::component_t::documentation("gauge_bosons").data() + ); + + // get/set leptons + object.def_property( + "leptons", + [](const cppCLASS &self) -> decltype(auto) + { + return self.leptons(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.leptons() = value; + }, + cppCLASS::component_t::documentation("leptons").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_top +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/ReactionSuite.python.cpp b/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/ReactionSuite.python.cpp new file mode 100644 index 000000000..2f7fa9522 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/python/src/v2.0/top/ReactionSuite.python.cpp @@ -0,0 +1,444 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +// system includes +#include +#include +#include + +// local includes +#include "GNDS/v2.0/top/ReactionSuite.hpp" +#include "definitions.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_top { + +// wrapper for top::ReactionSuite +void wrapReactionSuite(pybind11::module &module) +{ + using namespace GNDS; + using namespace GNDS::v2_0; + + // type aliases + using cppCLASS = top::ReactionSuite; + + // create the Python object + pybind11::class_ object( + module, "ReactionSuite", + cppCLASS::component_t::documentation().data() + ); + + // constructor: from fields + object.def( + pybind11::init< + const std::string &, + const std::string &, + const std::string &, + const std::string &, + const std::string &, + const std::string &, + const general::Styles &, + const top::PoPs &, + const general::Reactions &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional &, + const std::optional & + >(), + pybind11::arg("projectile"), + pybind11::arg("target"), + pybind11::arg("evaluation"), + pybind11::arg("format"), + pybind11::arg("projectile_frame"), + pybind11::arg("interaction"), + pybind11::arg("styles"), + pybind11::arg("po_ps"), + pybind11::arg("reactions"), + pybind11::arg("application_data") = std::nullopt, + pybind11::arg("external_files") = std::nullopt, + pybind11::arg("resonances") = std::nullopt, + pybind11::arg("sums") = std::nullopt, + pybind11::arg("productions") = std::nullopt, + pybind11::arg("fission_components") = std::nullopt, + pybind11::arg("orphan_products") = std::nullopt, + pybind11::arg("incomplete_reactions") = std::nullopt, + cppCLASS::component_t::documentation("constructor").data() + ); + + // get/set projectile + object.def_property( + "projectile", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectile(); + }, + [](cppCLASS &self, const std::string &value) + { + self.projectile() = value; + }, + cppCLASS::component_t::documentation("projectile").data() + ); + + // get/set target + object.def_property( + "target", + [](const cppCLASS &self) -> decltype(auto) + { + return self.target(); + }, + [](cppCLASS &self, const std::string &value) + { + self.target() = value; + }, + cppCLASS::component_t::documentation("target").data() + ); + + // get/set evaluation + object.def_property( + "evaluation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.evaluation(); + }, + [](cppCLASS &self, const std::string &value) + { + self.evaluation() = value; + }, + cppCLASS::component_t::documentation("evaluation").data() + ); + + // get/set format + object.def_property( + "format", + [](const cppCLASS &self) -> decltype(auto) + { + return self.format(); + }, + [](cppCLASS &self, const std::string &value) + { + self.format() = value; + }, + cppCLASS::component_t::documentation("format").data() + ); + + // get/set projectileFrame + object.def_property( + "projectile_frame", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectileFrame(); + }, + [](cppCLASS &self, const std::string &value) + { + self.projectileFrame() = value; + }, + cppCLASS::component_t::documentation("projectile_frame").data() + ); + + // get/set interaction + object.def_property( + "interaction", + [](const cppCLASS &self) -> decltype(auto) + { + return self.interaction(); + }, + [](cppCLASS &self, const std::string &value) + { + self.interaction() = value; + }, + cppCLASS::component_t::documentation("interaction").data() + ); + + // get/set styles + object.def_property( + "styles", + [](const cppCLASS &self) -> decltype(auto) + { + return self.styles(); + }, + [](cppCLASS &self, const general::Styles &value) + { + self.styles() = value; + }, + cppCLASS::component_t::documentation("styles").data() + ); + + // get/set PoPs + object.def_property( + "po_ps", + [](const cppCLASS &self) -> decltype(auto) + { + return self.PoPs(); + }, + [](cppCLASS &self, const top::PoPs &value) + { + self.PoPs() = value; + }, + cppCLASS::component_t::documentation("po_ps").data() + ); + + // get/set reactions + object.def_property( + "reactions", + [](const cppCLASS &self) -> decltype(auto) + { + return self.reactions(); + }, + [](cppCLASS &self, const general::Reactions &value) + { + self.reactions() = value; + }, + cppCLASS::component_t::documentation("reactions").data() + ); + + // get/set applicationData + object.def_property( + "application_data", + [](const cppCLASS &self) -> decltype(auto) + { + return self.applicationData(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.applicationData() = value; + }, + cppCLASS::component_t::documentation("application_data").data() + ); + + // get/set externalFiles + object.def_property( + "external_files", + [](const cppCLASS &self) -> decltype(auto) + { + return self.externalFiles(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.externalFiles() = value; + }, + cppCLASS::component_t::documentation("external_files").data() + ); + + // get/set resonances + object.def_property( + "resonances", + [](const cppCLASS &self) -> decltype(auto) + { + return self.resonances(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.resonances() = value; + }, + cppCLASS::component_t::documentation("resonances").data() + ); + + // get/set sums + object.def_property( + "sums", + [](const cppCLASS &self) -> decltype(auto) + { + return self.sums(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.sums() = value; + }, + cppCLASS::component_t::documentation("sums").data() + ); + + // get/set productions + object.def_property( + "productions", + [](const cppCLASS &self) -> decltype(auto) + { + return self.productions(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.productions() = value; + }, + cppCLASS::component_t::documentation("productions").data() + ); + + // get/set fissionComponents + object.def_property( + "fission_components", + [](const cppCLASS &self) -> decltype(auto) + { + return self.fissionComponents(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.fissionComponents() = value; + }, + cppCLASS::component_t::documentation("fission_components").data() + ); + + // get/set orphanProducts + object.def_property( + "orphan_products", + [](const cppCLASS &self) -> decltype(auto) + { + return self.orphanProducts(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.orphanProducts() = value; + }, + cppCLASS::component_t::documentation("orphan_products").data() + ); + + // get/set incompleteReactions + object.def_property( + "incomplete_reactions", + [](const cppCLASS &self) -> decltype(auto) + { + return self.incompleteReactions(); + }, + [](cppCLASS &self, const std::optional &value) + { + self.incompleteReactions() = value; + }, + cppCLASS::component_t::documentation("incomplete_reactions").data() + ); + + // shortcut: get/set aliases + object.def_property( + "aliases", + [](const cppCLASS &self) -> decltype(auto) + { + return self.aliases(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.aliases() = value; + }, + cppCLASS::component_t::documentation("aliases").data() + ); + + // shortcut: get/set baryons + object.def_property( + "baryons", + [](const cppCLASS &self) -> decltype(auto) + { + return self.baryons(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.baryons() = value; + }, + cppCLASS::component_t::documentation("baryons").data() + ); + + // shortcut: get/set chemicalElements + object.def_property( + "chemical_elements", + [](const cppCLASS &self) -> decltype(auto) + { + return self.chemicalElements(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.chemicalElements() = value; + }, + cppCLASS::component_t::documentation("chemical_elements").data() + ); + + // shortcut: get/set documentation + object.def_property( + "documentation", + [](const cppCLASS &self) -> decltype(auto) + { + return self.documentation(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.documentation() = value; + }, + cppCLASS::component_t::documentation("documentation").data() + ); + + // shortcut: get/set gaugeBosons + object.def_property( + "gauge_bosons", + [](const cppCLASS &self) -> decltype(auto) + { + return self.gaugeBosons(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.gaugeBosons() = value; + }, + cppCLASS::component_t::documentation("gauge_bosons").data() + ); + + // shortcut: get/set leptons + object.def_property( + "leptons", + [](const cppCLASS &self) -> decltype(auto) + { + return self.leptons(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.leptons() = value; + }, + cppCLASS::component_t::documentation("leptons").data() + ); + + // shortcut: get/set projectileEnergyDomain + object.def_property( + "projectile_energy_domain", + [](const cppCLASS &self) -> decltype(auto) + { + return self.projectileEnergyDomain(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.projectileEnergyDomain() = value; + }, + cppCLASS::component_t::documentation("projectile_energy_domain").data() + ); + + // shortcut: get/set temperature + object.def_property( + "temperature", + [](const cppCLASS &self) -> decltype(auto) + { + return self.temperature(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.temperature() = value; + }, + cppCLASS::component_t::documentation("temperature").data() + ); + + // shortcut: get/set unorthodoxes + object.def_property( + "unorthodoxes", + [](const cppCLASS &self) -> decltype(auto) + { + return self.unorthodoxes(); + }, + [](cppCLASS &self, const std::decay_t &value) + { + self.unorthodoxes() = value; + }, + cppCLASS::component_t::documentation("unorthodoxes").data() + ); + + // add standard definitions + addStandardComponentDefinitions(object); +} + +} // namespace python_top +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0.hpp new file mode 100644 index 000000000..97b8da2a3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0.hpp @@ -0,0 +1,319 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0 +#define GNDS_V2_0 + +#include "GNDS/v2.0/enums/BoundaryCondition.hpp" +#include "GNDS/v2.0/enums/ContributorType.hpp" +#include "GNDS/v2.0/enums/DateType.hpp" +#include "GNDS/v2.0/enums/DecayType.hpp" +#include "GNDS/v2.0/enums/Encoding.hpp" +#include "GNDS/v2.0/enums/Energy.hpp" +#include "GNDS/v2.0/enums/Frame.hpp" +#include "GNDS/v2.0/enums/GridStyle.hpp" +#include "GNDS/v2.0/enums/HashAlgorithm.hpp" +#include "GNDS/v2.0/enums/Interaction.hpp" +#include "GNDS/v2.0/enums/Interpolation.hpp" +#include "GNDS/v2.0/enums/InterpolationQualifier.hpp" +#include "GNDS/v2.0/enums/Length.hpp" +#include "GNDS/v2.0/enums/Parity.hpp" +#include "GNDS/v2.0/enums/RelationType.hpp" +#include "GNDS/v2.0/enums/StorageOrder.hpp" + +#include "GNDS/v2.0/general/Add.hpp" +#include "GNDS/v2.0/general/Alias.hpp" +#include "GNDS/v2.0/general/Aliases.hpp" +#include "GNDS/v2.0/general/Angular.hpp" +#include "GNDS/v2.0/general/AngularEnergy.hpp" +#include "GNDS/v2.0/general/AngularTwoBody.hpp" +#include "GNDS/v2.0/general/ApplicationData.hpp" + +#include "GNDS/v2.0/g2d/Array.hpp" + +#include "GNDS/v2.0/g3d/Array.hpp" + +#include "GNDS/v2.0/general/Array.hpp" +#include "GNDS/v2.0/general/Atomic.hpp" +#include "GNDS/v2.0/general/Author.hpp" +#include "GNDS/v2.0/general/Authors.hpp" +#include "GNDS/v2.0/general/AverageEnergies.hpp" +#include "GNDS/v2.0/general/AverageEnergy.hpp" +#include "GNDS/v2.0/general/AverageParameterCovariance.hpp" +#include "GNDS/v2.0/general/AverageProductEnergy.hpp" +#include "GNDS/v2.0/general/Axes.hpp" +#include "GNDS/v2.0/general/Axis.hpp" +#include "GNDS/v2.0/general/Background.hpp" +#include "GNDS/v2.0/general/Baryon.hpp" +#include "GNDS/v2.0/general/Baryons.hpp" +#include "GNDS/v2.0/general/BindingEnergy.hpp" +#include "GNDS/v2.0/general/Body.hpp" +#include "GNDS/v2.0/general/BoundAtomCrossSection.hpp" +#include "GNDS/v2.0/general/Branching1d.hpp" +#include "GNDS/v2.0/general/Branching3d.hpp" +#include "GNDS/v2.0/general/BreitWigner.hpp" +#include "GNDS/v2.0/general/Channel.hpp" +#include "GNDS/v2.0/general/Channels.hpp" +#include "GNDS/v2.0/general/Charge.hpp" +#include "GNDS/v2.0/general/ChemicalElement.hpp" +#include "GNDS/v2.0/general/ChemicalElements.hpp" +#include "GNDS/v2.0/general/CoherentPhotonScattering.hpp" +#include "GNDS/v2.0/general/Column.hpp" +#include "GNDS/v2.0/general/ColumnData.hpp" +#include "GNDS/v2.0/general/ColumnHeaders.hpp" +#include "GNDS/v2.0/general/Configuration.hpp" +#include "GNDS/v2.0/general/Configurations.hpp" +#include "GNDS/v2.0/general/Constant1d.hpp" +#include "GNDS/v2.0/general/Continuum.hpp" +#include "GNDS/v2.0/general/Conversion.hpp" +#include "GNDS/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "GNDS/v2.0/general/Covariance.hpp" +#include "GNDS/v2.0/general/CovarianceMatrix.hpp" +#include "GNDS/v2.0/general/CovarianceSection.hpp" +#include "GNDS/v2.0/general/CovarianceSections.hpp" + +#include "GNDS/v2.0/top/CovarianceSuite.hpp" + +#include "GNDS/v2.0/general/CrossSection.hpp" + +#include "GNDS/v2.0/reduced/CrossSection.hpp" + +#include "GNDS/v2.0/general/CrossSectionReconstructed.hpp" +#include "GNDS/v2.0/general/CrossSectionSum.hpp" +#include "GNDS/v2.0/general/CrossSectionSums.hpp" +#include "GNDS/v2.0/general/Data.hpp" +#include "GNDS/v2.0/general/Date.hpp" +#include "GNDS/v2.0/general/Dates.hpp" +#include "GNDS/v2.0/general/DebyeWallerIntegral.hpp" +#include "GNDS/v2.0/general/Decay.hpp" +#include "GNDS/v2.0/general/DecayData.hpp" +#include "GNDS/v2.0/general/DecayMode.hpp" +#include "GNDS/v2.0/general/DecayModes.hpp" +#include "GNDS/v2.0/general/DecayPath.hpp" +#include "GNDS/v2.0/general/DelayedBetaEnergy.hpp" +#include "GNDS/v2.0/general/DelayedGammaEnergy.hpp" +#include "GNDS/v2.0/general/DelayedNeutron.hpp" +#include "GNDS/v2.0/general/DelayedNeutronKE.hpp" +#include "GNDS/v2.0/general/DelayedNeutrons.hpp" +#include "GNDS/v2.0/general/Discrete.hpp" +#include "GNDS/v2.0/general/DiscreteGamma.hpp" +#include "GNDS/v2.0/general/Distribution.hpp" + +#include "GNDS/v2.0/reduced/Distribution.hpp" + +#include "GNDS/v2.0/general/Documentation.hpp" +#include "GNDS/v2.0/general/Double.hpp" + +#include "GNDS/v2.0/reduced/Double.hpp" + +#include "GNDS/v2.0/general/DoubleDifferentialCrossSection.hpp" +#include "GNDS/v2.0/general/EFH.hpp" +#include "GNDS/v2.0/general/EFL.hpp" +#include "GNDS/v2.0/general/ENDFconversionFlags.hpp" +#include "GNDS/v2.0/general/E_critical.hpp" +#include "GNDS/v2.0/general/E_max.hpp" +#include "GNDS/v2.0/general/ElapsedTime.hpp" +#include "GNDS/v2.0/general/ElapsedTimes.hpp" +#include "GNDS/v2.0/general/EndfCompatible.hpp" +#include "GNDS/v2.0/general/Energy.hpp" +#include "GNDS/v2.0/general/EnergyAngular.hpp" +#include "GNDS/v2.0/general/Evaluated.hpp" +#include "GNDS/v2.0/general/Evaporation.hpp" +#include "GNDS/v2.0/general/ExternalFile.hpp" +#include "GNDS/v2.0/general/ExternalFiles.hpp" +#include "GNDS/v2.0/general/F.hpp" +#include "GNDS/v2.0/general/FastRegion.hpp" +#include "GNDS/v2.0/general/FissionComponent.hpp" +#include "GNDS/v2.0/general/FissionComponents.hpp" +#include "GNDS/v2.0/general/FissionEnergyRelease.hpp" +#include "GNDS/v2.0/general/FissionEnergyReleases.hpp" + +#include "GNDS/v2.0/top/FissionFragmentData.hpp" + +#include "GNDS/v2.0/general/FormFactor.hpp" +#include "GNDS/v2.0/general/Fraction.hpp" +#include "GNDS/v2.0/general/FreeGasApproximation.hpp" +#include "GNDS/v2.0/general/Function1ds.hpp" + +#include "GNDS/v2.0/reduced/Function1ds.hpp" + +#include "GNDS/v2.0/general/Function2ds.hpp" +#include "GNDS/v2.0/general/G.hpp" +#include "GNDS/v2.0/general/GaugeBoson.hpp" +#include "GNDS/v2.0/general/GaugeBosons.hpp" +#include "GNDS/v2.0/general/GeneralEvaporation.hpp" +#include "GNDS/v2.0/general/Grid.hpp" +#include "GNDS/v2.0/general/Gridded2d.hpp" +#include "GNDS/v2.0/general/Gridded3d.hpp" +#include "GNDS/v2.0/general/Halflife.hpp" +#include "GNDS/v2.0/general/HardSphereRadius.hpp" +#include "GNDS/v2.0/general/ImaginaryAnomalousFactor.hpp" +#include "GNDS/v2.0/general/ImaginaryInterferenceTerm.hpp" +#include "GNDS/v2.0/general/IncidentEnergies.hpp" +#include "GNDS/v2.0/general/IncidentEnergy.hpp" +#include "GNDS/v2.0/general/IncoherentPhotonScattering.hpp" +#include "GNDS/v2.0/general/IncompleteReactions.hpp" +#include "GNDS/v2.0/general/Institution.hpp" +#include "GNDS/v2.0/general/Integer.hpp" +#include "GNDS/v2.0/general/Intensity.hpp" +#include "GNDS/v2.0/general/InternalConversionCoefficients.hpp" +#include "GNDS/v2.0/general/Isotope.hpp" +#include "GNDS/v2.0/general/Isotopes.hpp" +#include "GNDS/v2.0/general/Isotropic2d.hpp" +#include "GNDS/v2.0/general/J.hpp" +#include "GNDS/v2.0/general/Js.hpp" +#include "GNDS/v2.0/general/KalbachMann.hpp" +#include "GNDS/v2.0/general/L.hpp" +#include "GNDS/v2.0/general/Legendre.hpp" + +#include "GNDS/v2.0/g3d/Lengths.hpp" + +#include "GNDS/v2.0/general/Lepton.hpp" +#include "GNDS/v2.0/general/Leptons.hpp" +#include "GNDS/v2.0/general/LevelSpacing.hpp" +#include "GNDS/v2.0/general/Link.hpp" +#include "GNDS/v2.0/general/ListOfCovariances.hpp" +#include "GNDS/v2.0/general/Ls.hpp" +#include "GNDS/v2.0/general/MadlandNix.hpp" +#include "GNDS/v2.0/general/Mass.hpp" +#include "GNDS/v2.0/general/MetaStable.hpp" +#include "GNDS/v2.0/general/Mixed.hpp" +#include "GNDS/v2.0/general/Multiplicity.hpp" +#include "GNDS/v2.0/general/MultiplicitySum.hpp" +#include "GNDS/v2.0/general/MultiplicitySums.hpp" +#include "GNDS/v2.0/general/NBodyPhaseSpace.hpp" +#include "GNDS/v2.0/general/NeutrinoEnergy.hpp" +#include "GNDS/v2.0/general/NonNeutrinoEnergy.hpp" +#include "GNDS/v2.0/general/NuclearAmplitudeExpansion.hpp" +#include "GNDS/v2.0/general/NuclearPlusInterference.hpp" +#include "GNDS/v2.0/general/NuclearTerm.hpp" +#include "GNDS/v2.0/general/Nucleus.hpp" +#include "GNDS/v2.0/general/Nuclide.hpp" +#include "GNDS/v2.0/general/Nuclides.hpp" + +#include "GNDS/v2.0/reduced/Nuclides.hpp" + +#include "GNDS/v2.0/general/OrphanProduct.hpp" +#include "GNDS/v2.0/general/OrphanProducts.hpp" +#include "GNDS/v2.0/general/OutputChannel.hpp" + +#include "GNDS/v2.0/reduced/OutputChannel.hpp" + +#include "GNDS/v2.0/general/ParameterCovariance.hpp" +#include "GNDS/v2.0/general/ParameterCovarianceMatrix.hpp" +#include "GNDS/v2.0/general/ParameterCovariances.hpp" +#include "GNDS/v2.0/general/ParameterLink.hpp" +#include "GNDS/v2.0/general/Parameters.hpp" +#include "GNDS/v2.0/general/Parity.hpp" +#include "GNDS/v2.0/general/PhotonEmissionProbabilities.hpp" + +#include "GNDS/v2.0/top/PoPs.hpp" + +#include "GNDS/v2.0/general/Polynomial1d.hpp" + +#include "GNDS/v2.0/reduced/Polynomial1d.hpp" + +#include "GNDS/v2.0/general/PositronEmissionIntensity.hpp" +#include "GNDS/v2.0/general/PrimaryGamma.hpp" +#include "GNDS/v2.0/general/Probability.hpp" +#include "GNDS/v2.0/general/Product.hpp" + +#include "GNDS/v2.0/reduced/Product.hpp" + +#include "GNDS/v2.0/general/ProductYield.hpp" +#include "GNDS/v2.0/general/ProductYields.hpp" +#include "GNDS/v2.0/general/Production.hpp" +#include "GNDS/v2.0/general/Productions.hpp" +#include "GNDS/v2.0/general/Products.hpp" + +#include "GNDS/v2.0/reduced/Products.hpp" + +#include "GNDS/v2.0/general/ProjectileEnergyDomain.hpp" +#include "GNDS/v2.0/general/PromptGammaEnergy.hpp" +#include "GNDS/v2.0/general/PromptNeutronKE.hpp" +#include "GNDS/v2.0/general/PromptProductKE.hpp" +#include "GNDS/v2.0/general/Q.hpp" +#include "GNDS/v2.0/general/R.hpp" +#include "GNDS/v2.0/general/RMatrix.hpp" +#include "GNDS/v2.0/general/Rate.hpp" +#include "GNDS/v2.0/general/Reaction.hpp" + +#include "GNDS/v2.0/top/ReactionSuite.hpp" + +#include "GNDS/v2.0/general/Reactions.hpp" +#include "GNDS/v2.0/general/RealAnomalousFactor.hpp" +#include "GNDS/v2.0/general/RealInterferenceTerm.hpp" +#include "GNDS/v2.0/general/Recoil.hpp" +#include "GNDS/v2.0/general/Reference.hpp" +#include "GNDS/v2.0/general/Regions1d.hpp" +#include "GNDS/v2.0/general/Regions2d.hpp" +#include "GNDS/v2.0/general/Resolved.hpp" +#include "GNDS/v2.0/general/ResolvedRegion.hpp" +#include "GNDS/v2.0/general/ResonanceParameters.hpp" +#include "GNDS/v2.0/general/ResonanceReaction.hpp" +#include "GNDS/v2.0/general/ResonanceReactions.hpp" +#include "GNDS/v2.0/general/Resonances.hpp" +#include "GNDS/v2.0/general/ResonancesWithBackground.hpp" +#include "GNDS/v2.0/general/RowData.hpp" +#include "GNDS/v2.0/general/RutherfordScattering.hpp" +#include "GNDS/v2.0/general/SCTApproximation.hpp" +#include "GNDS/v2.0/general/S_table.hpp" +#include "GNDS/v2.0/general/ScatteringAtom.hpp" +#include "GNDS/v2.0/general/ScatteringAtoms.hpp" +#include "GNDS/v2.0/general/ScatteringFactor.hpp" +#include "GNDS/v2.0/general/ScatteringRadius.hpp" +#include "GNDS/v2.0/general/SelfScatteringKernel.hpp" +#include "GNDS/v2.0/general/Shell.hpp" +#include "GNDS/v2.0/general/ShortRangeSelfScalingVariance.hpp" +#include "GNDS/v2.0/general/SimpleMaxwellianFission.hpp" +#include "GNDS/v2.0/general/Slice.hpp" +#include "GNDS/v2.0/general/Slices.hpp" +#include "GNDS/v2.0/general/Spectra.hpp" +#include "GNDS/v2.0/general/Spectrum.hpp" +#include "GNDS/v2.0/general/Spin.hpp" +#include "GNDS/v2.0/general/SpinGroup.hpp" +#include "GNDS/v2.0/general/SpinGroups.hpp" +#include "GNDS/v2.0/general/Standard.hpp" + +#include "GNDS/v2.0/g3d/Starts.hpp" + +#include "GNDS/v2.0/general/String.hpp" +#include "GNDS/v2.0/general/Styles.hpp" +#include "GNDS/v2.0/general/Sum.hpp" +#include "GNDS/v2.0/general/Summand.hpp" +#include "GNDS/v2.0/general/Summands.hpp" +#include "GNDS/v2.0/general/Sums.hpp" +#include "GNDS/v2.0/general/T_M.hpp" +#include "GNDS/v2.0/general/T_effective.hpp" +#include "GNDS/v2.0/general/Table.hpp" +#include "GNDS/v2.0/general/TabulatedWidths.hpp" +#include "GNDS/v2.0/general/Temperature.hpp" +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw.hpp" +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw1d.hpp" +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" +#include "GNDS/v2.0/general/Theta.hpp" +#include "GNDS/v2.0/general/Time.hpp" +#include "GNDS/v2.0/general/Title.hpp" +#include "GNDS/v2.0/general/TotalEnergy.hpp" +#include "GNDS/v2.0/general/U.hpp" +#include "GNDS/v2.0/general/Uncertainty.hpp" +#include "GNDS/v2.0/general/Uncorrelated.hpp" +#include "GNDS/v2.0/general/Unorthodox.hpp" +#include "GNDS/v2.0/general/Unorthodoxes.hpp" +#include "GNDS/v2.0/general/Unresolved.hpp" +#include "GNDS/v2.0/general/UnresolvedRegion.hpp" +#include "GNDS/v2.0/general/Unspecified.hpp" +#include "GNDS/v2.0/general/Values.hpp" +#include "GNDS/v2.0/general/Weighted.hpp" +#include "GNDS/v2.0/general/WeightedFunctionals.hpp" +#include "GNDS/v2.0/general/Width.hpp" +#include "GNDS/v2.0/general/Widths.hpp" +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/XYs2d.hpp" +#include "GNDS/v2.0/general/XYs3d.hpp" +#include "GNDS/v2.0/general/Yields.hpp" + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition.hpp new file mode 100644 index 000000000..05c7ce22b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition.hpp @@ -0,0 +1,52 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class for reference boundary condition values + */ +enum class BoundaryCondition { + EliminateShiftFunction = 1, + NegativeOrbitalMomentum, + Brune, + Given +}; + +/** + * @brief Return whether or not a string is a valid boundary condition + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isBoundaryCondition(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert BoundaryCondition to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::EliminateShiftFunction, "EliminateShiftFunction" }, + { T::NegativeOrbitalMomentum, "NegativeOrbitalMomentum" }, + { T::Brune, "Brune" }, + { T::Given, "Given" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition.python.cpp new file mode 100644 index 000000000..6ff888a6a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition.python.cpp @@ -0,0 +1,41 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapBoundaryCondition( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::BoundaryCondition; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "BoundaryCondition", + "Enumeration class giving acceptable boundary condition values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "EliminateShiftFunction", Component::EliminateShiftFunction ) + .value( "NegativeOrbitalMomentum", Component::NegativeOrbitalMomentum ) + .value( "Brune", Component::Brune ) + .value( "Given", Component::Given ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition/test/BoundaryCondition.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition/test/BoundaryCondition.test.cpp new file mode 100644 index 000000000..3b5d9d108 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition/test/BoundaryCondition.test.cpp @@ -0,0 +1,110 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/BoundaryCondition.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "BoundaryCondition" ) { + + GIVEN( "valid BoundaryCondition values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "EliminateShiftFunction" + == enum2string( BoundaryCondition::EliminateShiftFunction ) ); + CHECK( "NegativeOrbitalMomentum" + == enum2string( BoundaryCondition::NegativeOrbitalMomentum ) ); + CHECK( "Brune" == enum2string( BoundaryCondition::Brune ) ); + CHECK( "Given" == enum2string( BoundaryCondition::Given ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( BoundaryCondition::EliminateShiftFunction + == string2enum< BoundaryCondition >( "EliminateShiftFunction" ) ); + CHECK( BoundaryCondition::NegativeOrbitalMomentum + == string2enum< BoundaryCondition >( "NegativeOrbitalMomentum" ) ); + CHECK( BoundaryCondition::Brune == string2enum< BoundaryCondition >( "Brune" ) ); + CHECK( BoundaryCondition::Given == string2enum< BoundaryCondition >( "Given" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< BoundaryCondition >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << BoundaryCondition::EliminateShiftFunction << ' ' + << BoundaryCondition::NegativeOrbitalMomentum << ' ' + << BoundaryCondition::Brune << ' ' + << BoundaryCondition::Given; + + CHECK( "EliminateShiftFunction NegativeOrbitalMomentum Brune Given" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + BoundaryCondition value; + std::istringstream in( "EliminateShiftFunction NegativeOrbitalMomentum Brune Given" ); + + in >> value; + CHECK( BoundaryCondition::EliminateShiftFunction == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( BoundaryCondition::NegativeOrbitalMomentum == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( BoundaryCondition::Brune == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( BoundaryCondition::Given == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + BoundaryCondition value = BoundaryCondition::EliminateShiftFunction; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( BoundaryCondition::EliminateShiftFunction == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isBoundaryCondition is used" ) { + + THEN( "registered BoundaryCondition values return true, " + "unregistered BoundaryCondition values return false" ) { + + CHECK( true == isBoundaryCondition( "EliminateShiftFunction" ) ); + CHECK( true == isBoundaryCondition( "NegativeOrbitalMomentum" ) ); + CHECK( true == isBoundaryCondition( "Brune" ) ); + CHECK( true == isBoundaryCondition( "Given" ) ); + CHECK( false == isBoundaryCondition( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition/test/CMakeLists.txt new file mode 100644 index 000000000..5caa71a14 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/BoundaryCondition/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.BoundaryCondition.test + BoundaryCondition.test.cpp +) + +target_compile_options( GNDStk.enums.BoundaryCondition.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.BoundaryCondition.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.BoundaryCondition COMMAND GNDStk.enums.BoundaryCondition.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType.hpp new file mode 100644 index 000000000..f6573baef --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType.hpp @@ -0,0 +1,86 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class for contributor type values + */ +enum class ContributorType { + ContactPerson = 1, + DataCollector, + DataCurator, + DataManager, + Distributor, + Editor, + HostingInstitution, + Producer, + ProjectLeader, + ProjectManager, + ProjectMember, + RegistrationAgency, + RegistrationAuthority, + RelatedPerson, + Researcher, + ResearchGroup, + RightsHolder, + Sponsor, + Supervisor, + WorkPackageLeader, + Other +}; + +/** + * @brief Return whether or not a string is a valid contributor type + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isContributorType(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert ContributorType to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::ContactPerson, "ContactPerson" }, + { T::DataCollector, "DataCollector" }, + { T::DataCurator, "DataCurator" }, + { T::DataManager, "DataManager" }, + { T::Distributor, "Distributor" }, + { T::Editor, "Editor" }, + { T::HostingInstitution, "HostingInstitution" }, + { T::Producer, "Producer" }, + { T::ProjectLeader, "ProjectLeader" }, + { T::ProjectManager, "ProjectManager" }, + { T::ProjectMember, "ProjectMember" }, + { T::RegistrationAgency, "RegistrationAgency" }, + { T::RegistrationAuthority, "RegistrationAuthority" }, + { T::RelatedPerson, "RelatedPerson" }, + { T::Researcher, "Researcher" }, + { T::ResearchGroup, "ResearchGroup" }, + { T::RightsHolder, "RightsHolder" }, + { T::Sponsor, "Sponsor" }, + { T::Supervisor, "Supervisor" }, + { T::WorkPackageLeader, "WorkPackageLeader" }, + { T::Other, "Other" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType.python.cpp new file mode 100644 index 000000000..645f2a6ad --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType.python.cpp @@ -0,0 +1,58 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapContributorType( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::ContributorType; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "ContributorType", + "Enumeration class giving acceptable contributor type values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "ContactPerson", Component::ContactPerson ) + .value( "DataCollector", Component::DataCollector ) + .value( "DataCurator", Component::DataCurator ) + .value( "DataManager", Component::DataManager ) + .value( "Distributor", Component::Distributor ) + .value( "Editor", Component::Editor ) + .value( "HostingInstitution", Component::HostingInstitution ) + .value( "Producer", Component::Producer ) + .value( "ProjectLeader", Component::ProjectLeader ) + .value( "ProjectManager", Component::ProjectManager ) + .value( "ProjectMember", Component::ProjectMember ) + .value( "RegistrationAgency", Component::RegistrationAgency ) + .value( "RegistrationAuthority", Component::RegistrationAuthority ) + .value( "RelatedPerson", Component::RelatedPerson ) + .value( "Researcher", Component::Researcher ) + .value( "ResearchGroup", Component::ResearchGroup ) + .value( "RightsHolder", Component::RightsHolder ) + .value( "Sponsor", Component::Sponsor ) + .value( "Supervisor", Component::Supervisor ) + .value( "WorkPackageLeader", Component::WorkPackageLeader ) + .value( "Other", Component::Other ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType/test/CMakeLists.txt new file mode 100644 index 000000000..667c5f8e2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.ContributorType.test + ContributorType.test.cpp +) + +target_compile_options( GNDStk.enums.ContributorType.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.ContributorType.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.ContributorType COMMAND GNDStk.enums.ContributorType.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType/test/ContributorType.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType/test/ContributorType.test.cpp new file mode 100644 index 000000000..962f01bcf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/ContributorType/test/ContributorType.test.cpp @@ -0,0 +1,289 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/ContributorType.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "ContributorType" ) { + + GIVEN( "valid encoding values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "ContactPerson" == enum2string( ContributorType::ContactPerson ) ); + CHECK( "DataCollector" == enum2string( ContributorType::DataCollector ) ); + CHECK( "DataCurator" == enum2string( ContributorType::DataCurator ) ); + CHECK( "DataManager" == enum2string( ContributorType::DataManager ) ); + CHECK( "Distributor" == enum2string( ContributorType::Distributor ) ); + CHECK( "Editor" == enum2string( ContributorType::Editor ) ); + CHECK( "HostingInstitution" == enum2string( ContributorType::HostingInstitution ) ); + CHECK( "Producer" == enum2string( ContributorType::Producer ) ); + CHECK( "ProjectLeader" == enum2string( ContributorType::ProjectLeader ) ); + CHECK( "ProjectManager" == enum2string( ContributorType::ProjectManager ) ); + CHECK( "ProjectMember" == enum2string( ContributorType::ProjectMember ) ); + CHECK( "RegistrationAgency" == enum2string( ContributorType::RegistrationAgency ) ); + CHECK( "RegistrationAuthority" == enum2string( ContributorType::RegistrationAuthority ) ); + CHECK( "RelatedPerson" == enum2string( ContributorType::RelatedPerson ) ); + CHECK( "Researcher" == enum2string( ContributorType::Researcher ) ); + CHECK( "ResearchGroup" == enum2string( ContributorType::ResearchGroup ) ); + CHECK( "RightsHolder" == enum2string( ContributorType::RightsHolder ) ); + CHECK( "Sponsor" == enum2string( ContributorType::Sponsor ) ); + CHECK( "Supervisor" == enum2string( ContributorType::Supervisor ) ); + CHECK( "WorkPackageLeader" == enum2string( ContributorType::WorkPackageLeader ) ); + CHECK( "Other" == enum2string( ContributorType::Other ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( ContributorType::ContactPerson + == string2enum< ContributorType >( "ContactPerson" ) ); + CHECK( ContributorType::DataCollector + == string2enum< ContributorType >( "DataCollector" ) ); + CHECK( ContributorType::DataCurator + == string2enum< ContributorType >( "DataCurator" ) ); + CHECK( ContributorType::DataManager + == string2enum< ContributorType >( "DataManager" ) ); + CHECK( ContributorType::Distributor + == string2enum< ContributorType >( "Distributor" ) ); + CHECK( ContributorType::Editor + == string2enum< ContributorType >( "Editor" ) ); + CHECK( ContributorType::HostingInstitution + == string2enum< ContributorType >( "HostingInstitution" ) ); + CHECK( ContributorType::Producer + == string2enum< ContributorType >( "Producer" ) ); + CHECK( ContributorType::ProjectLeader + == string2enum< ContributorType >( "ProjectLeader" ) ); + CHECK( ContributorType::ProjectManager + == string2enum< ContributorType >( "ProjectManager" ) ); + CHECK( ContributorType::ProjectMember + == string2enum< ContributorType >( "ProjectMember" ) ); + CHECK( ContributorType::RegistrationAgency + == string2enum< ContributorType >( "RegistrationAgency" ) ); + CHECK( ContributorType::RegistrationAuthority + == string2enum< ContributorType >( "RegistrationAuthority" ) ); + CHECK( ContributorType::RelatedPerson + == string2enum< ContributorType >( "RelatedPerson" ) ); + CHECK( ContributorType::Researcher + == string2enum< ContributorType >( "Researcher" ) ); + CHECK( ContributorType::ResearchGroup + == string2enum< ContributorType >( "ResearchGroup" ) ); + CHECK( ContributorType::RightsHolder + == string2enum< ContributorType >( "RightsHolder" ) ); + CHECK( ContributorType::Sponsor + == string2enum< ContributorType >( "Sponsor" ) ); + CHECK( ContributorType::Supervisor + == string2enum< ContributorType >( "Supervisor" ) ); + CHECK( ContributorType::WorkPackageLeader + == string2enum< ContributorType >( "WorkPackageLeader" ) ); + CHECK( ContributorType::Other + == string2enum< ContributorType >( "Other" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< ContributorType >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << ContributorType::ContactPerson << ' ' + << ContributorType::DataCollector << ' ' + << ContributorType::DataCurator << ' ' + << ContributorType::DataManager << ' ' + << ContributorType::Distributor << ' ' + << ContributorType::Editor << ' ' + << ContributorType::HostingInstitution << ' ' + << ContributorType::Producer << ' ' + << ContributorType::ProjectLeader << ' ' + << ContributorType::ProjectManager << ' ' + << ContributorType::ProjectMember << ' ' + << ContributorType::RegistrationAgency << ' ' + << ContributorType::RegistrationAuthority << ' ' + << ContributorType::RelatedPerson << ' ' + << ContributorType::Researcher << ' ' + << ContributorType::ResearchGroup << ' ' + << ContributorType::RightsHolder << ' ' + << ContributorType::Sponsor << ' ' + << ContributorType::Supervisor << ' ' + << ContributorType::WorkPackageLeader << ' ' + << ContributorType::Other; + + CHECK( "ContactPerson DataCollector DataCurator DataManager " + "Distributor Editor HostingInstitution Producer " + "ProjectLeader ProjectManager ProjectMember RegistrationAgency " + "RegistrationAuthority RelatedPerson Researcher ResearchGroup " + "RightsHolder Sponsor Supervisor WorkPackageLeader Other" + == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + ContributorType value; + std::istringstream in( "ContactPerson DataCollector DataCurator DataManager " + "Distributor Editor HostingInstitution Producer " + "ProjectLeader ProjectManager ProjectMember RegistrationAgency " + "RegistrationAuthority RelatedPerson Researcher ResearchGroup " + "RightsHolder Sponsor Supervisor WorkPackageLeader Other" ); + + in >> value; + CHECK( ContributorType::ContactPerson == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::DataCollector == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::DataCurator == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::DataManager == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::Distributor == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::Editor == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::HostingInstitution == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::Producer == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::ProjectLeader == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::ProjectManager == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::ProjectMember == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::RegistrationAgency == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::RegistrationAuthority == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::RelatedPerson == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::Researcher == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::ResearchGroup == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::RightsHolder == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::Sponsor == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::Supervisor == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::WorkPackageLeader == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( ContributorType::Other == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + ContributorType value = ContributorType::ContactPerson; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( ContributorType::ContactPerson == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isContributorType is used" ) { + + THEN( "registered date types return true, " + "unregistered date types return false" ) { + + CHECK( true == isContributorType( "ContactPerson" ) ); + CHECK( true == isContributorType( "DataCollector" ) ); + CHECK( true == isContributorType( "DataCurator" ) ); + CHECK( true == isContributorType( "DataManager" ) ); + CHECK( true == isContributorType( "Distributor" ) ); + CHECK( true == isContributorType( "Editor" ) ); + CHECK( true == isContributorType( "HostingInstitution" ) ); + CHECK( true == isContributorType( "Producer" ) ); + CHECK( true == isContributorType( "ProjectLeader" ) ); + CHECK( true == isContributorType( "ProjectManager" ) ); + CHECK( true == isContributorType( "ProjectMember" ) ); + CHECK( true == isContributorType( "RegistrationAgency" ) ); + CHECK( true == isContributorType( "RegistrationAuthority" ) ); + CHECK( true == isContributorType( "RelatedPerson" ) ); + CHECK( true == isContributorType( "Researcher" ) ); + CHECK( true == isContributorType( "ResearchGroup" ) ); + CHECK( true == isContributorType( "RightsHolder" ) ); + CHECK( true == isContributorType( "Sponsor" ) ); + CHECK( true == isContributorType( "Supervisor" ) ); + CHECK( true == isContributorType( "WorkPackageLeader" ) ); + CHECK( true == isContributorType( "Other" ) ); + CHECK( false == isContributorType( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType.hpp new file mode 100644 index 000000000..aec9b1bdf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType.hpp @@ -0,0 +1,64 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class for date type values + */ +enum class DateType { + accepted = 1, + available, + copyrighted, + collected, + created, + issued, + submitted, + updated, + valid, + withdrawn +}; + +/** + * @brief Return whether or not a string is a valid date type + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isDateType(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert DateType to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::accepted, "accepted" }, + { T::available, "available" }, + { T::copyrighted, "copyrighted" }, + { T::collected, "collected" }, + { T::created, "created" }, + { T::issued, "issued" }, + { T::submitted, "submitted" }, + { T::updated, "updated" }, + { T::valid, "valid" }, + { T::withdrawn, "withdrawn" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType.python.cpp new file mode 100644 index 000000000..b113b9955 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType.python.cpp @@ -0,0 +1,47 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapDateType( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::DateType; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "DateType", + "Enumeration class giving acceptable date type values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "accepted", Component::accepted ) + .value( "available", Component::available ) + .value( "copyrighted", Component::copyrighted ) + .value( "collected", Component::collected ) + .value( "created", Component::created ) + .value( "issued", Component::issued ) + .value( "submitted", Component::submitted ) + .value( "updated", Component::updated ) + .value( "valid", Component::valid ) + .value( "withdrawn", Component::withdrawn ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType/test/CMakeLists.txt new file mode 100644 index 000000000..4acb97625 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.DateType.test + DateType.test.cpp +) + +target_compile_options( GNDStk.enums.DateType.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.DateType.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.DateType COMMAND GNDStk.enums.DateType.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType/test/DateType.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType/test/DateType.test.cpp new file mode 100644 index 000000000..d72b4e0d3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DateType/test/DateType.test.cpp @@ -0,0 +1,156 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/DateType.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "DateType" ) { + + GIVEN( "valid encoding values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "accepted" == enum2string( DateType::accepted ) ); + CHECK( "available" == enum2string( DateType::available ) ); + CHECK( "copyrighted" == enum2string( DateType::copyrighted ) ); + CHECK( "collected" == enum2string( DateType::collected ) ); + CHECK( "created" == enum2string( DateType::created ) ); + CHECK( "issued" == enum2string( DateType::issued ) ); + CHECK( "submitted" == enum2string( DateType::submitted ) ); + CHECK( "updated" == enum2string( DateType::updated ) ); + CHECK( "valid" == enum2string( DateType::valid ) ); + CHECK( "withdrawn" == enum2string( DateType::withdrawn ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( DateType::accepted == string2enum< DateType >( "accepted" ) ); + CHECK( DateType::available == string2enum< DateType >( "available" ) ); + CHECK( DateType::copyrighted == string2enum< DateType >( "copyrighted" ) ); + CHECK( DateType::collected == string2enum< DateType >( "collected" ) ); + CHECK( DateType::created == string2enum< DateType >( "created" ) ); + CHECK( DateType::issued == string2enum< DateType >( "issued" ) ); + CHECK( DateType::submitted == string2enum< DateType >( "submitted" ) ); + CHECK( DateType::updated == string2enum< DateType >( "updated" ) ); + CHECK( DateType::valid == string2enum< DateType >( "valid" ) ); + CHECK( DateType::withdrawn == string2enum< DateType >( "withdrawn" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< DateType >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << DateType::accepted << ' ' << DateType::available << ' ' + << DateType::copyrighted << ' ' << DateType::collected << ' ' + << DateType::created << ' ' << DateType::issued << ' ' + << DateType::submitted << ' ' << DateType::updated << ' ' + << DateType::valid << ' ' << DateType::withdrawn; + + CHECK( "accepted available copyrighted collected " + "created issued submitted updated valid withdrawn" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + DateType value; + std::istringstream in( "accepted available copyrighted collected created issued submitted updated valid withdrawn" ); + + in >> value; + CHECK( DateType::accepted == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DateType::available == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DateType::copyrighted == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DateType::collected == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DateType::created == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DateType::issued == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DateType::submitted == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DateType::updated == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DateType::valid == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DateType::withdrawn == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + DateType value = DateType::accepted; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( DateType::accepted == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isDateType is used" ) { + + THEN( "registered date types return true, " + "unregistered date types return false" ) { + + CHECK( true == isDateType( "accepted" ) ); + CHECK( true == isDateType( "available" ) ); + CHECK( true == isDateType( "copyrighted" ) ); + CHECK( true == isDateType( "collected" ) ); + CHECK( true == isDateType( "created" ) ); + CHECK( true == isDateType( "issued" ) ); + CHECK( true == isDateType( "submitted" ) ); + CHECK( true == isDateType( "updated" ) ); + CHECK( true == isDateType( "valid" ) ); + CHECK( true == isDateType( "withdrawn" ) ); + CHECK( false == isDateType( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType.hpp new file mode 100644 index 000000000..e8cc1c643 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType.hpp @@ -0,0 +1,68 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class for interpolation decay type values + */ +enum class DecayType { + SpontaneousFission = 1, + BetaMinus, + BetaPlus, + ElectronCapture, + ElectroMagnetic, + IsomericTransition, + Neutron, + Proton, + Deuteron, + Triton, + Alpha, + AtomicRelaxation +}; + +/** + * @brief Return whether or not a string is a valid relation type + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isDecayType(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert DecayType to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::SpontaneousFission, "SF" }, + { T::BetaMinus, "beta-" }, + { T::BetaPlus, "beta+" }, + { T::ElectronCapture, "EC" }, + { T::ElectroMagnetic, "electroMagnetic" }, + { T::IsomericTransition, "IT" }, + { T::Neutron, "n" }, + { T::Proton, "p" }, + { T::Deuteron, "d" }, + { T::Triton, "t" }, + { T::Alpha, "alpha" }, + { T::AtomicRelaxation, "atomicRelaxation" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType.python.cpp new file mode 100644 index 000000000..6a0e9ffe8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType.python.cpp @@ -0,0 +1,49 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapDecayType( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::DecayType; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "DecayType", + "Enumeration class giving acceptable decay type values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "SF", Component::SpontaneousFission ) + .value( "beta-", Component::BetaMinus ) + .value( "beta+", Component::BetaPlus ) + .value( "EC", Component::ElectronCapture ) + .value( "electroMagnetic", Component::ElectroMagnetic ) + .value( "IT", Component::IsomericTransition ) + .value( "n", Component::Neutron ) + .value( "p", Component::Proton ) + .value( "d", Component::Deuteron ) + .value( "t", Component::Triton ) + .value( "alpha", Component::Alpha ) + .value( "atomicRelaxation", Component::AtomicRelaxation ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType/test/CMakeLists.txt new file mode 100644 index 000000000..ddaba24ef --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.DecayType.test + DecayType.test.cpp +) + +target_compile_options( GNDStk.enums.DecayType.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.DecayType.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.DecayType COMMAND GNDStk.enums.DecayType.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType/test/DecayType.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType/test/DecayType.test.cpp new file mode 100644 index 000000000..e6700093e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/DecayType/test/DecayType.test.cpp @@ -0,0 +1,178 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/DecayType.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "DecayType" ) { + + GIVEN( "valid DecayType values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "SF" == enum2string( DecayType::SpontaneousFission ) ); + CHECK( "beta-" == enum2string( DecayType::BetaMinus ) ); + CHECK( "beta+" == enum2string( DecayType::BetaPlus ) ); + CHECK( "EC" == enum2string( DecayType::ElectronCapture ) ); + CHECK( "electroMagnetic" == enum2string( DecayType::ElectroMagnetic ) ); + CHECK( "IT" == enum2string( DecayType::IsomericTransition ) ); + CHECK( "n" == enum2string( DecayType::Neutron ) ); + CHECK( "p" == enum2string( DecayType::Proton ) ); + CHECK( "d" == enum2string( DecayType::Deuteron ) ); + CHECK( "t" == enum2string( DecayType::Triton ) ); + CHECK( "alpha" == enum2string( DecayType::Alpha ) ); + CHECK( "atomicRelaxation" == enum2string( DecayType::AtomicRelaxation ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( DecayType::SpontaneousFission == string2enum< DecayType >( "SF" ) ); + CHECK( DecayType::BetaMinus == string2enum< DecayType >( "beta-" ) ); + CHECK( DecayType::BetaPlus == string2enum< DecayType >( "beta+" ) ); + CHECK( DecayType::ElectronCapture == string2enum< DecayType >( "EC" ) ); + CHECK( DecayType::ElectroMagnetic == string2enum< DecayType >( "electroMagnetic" ) ); + CHECK( DecayType::IsomericTransition == string2enum< DecayType >( "IT" ) ); + CHECK( DecayType::Neutron == string2enum< DecayType >( "n" ) ); + CHECK( DecayType::Proton == string2enum< DecayType >( "p" ) ); + CHECK( DecayType::Deuteron == string2enum< DecayType >( "d" ) ); + CHECK( DecayType::Triton == string2enum< DecayType >( "t" ) ); + CHECK( DecayType::Alpha == string2enum< DecayType >( "alpha" ) ); + CHECK( DecayType::AtomicRelaxation == string2enum< DecayType >( "atomicRelaxation" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< DecayType >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << DecayType::SpontaneousFission << ' ' + << DecayType::BetaMinus << ' ' + << DecayType::BetaPlus << ' ' + << DecayType::ElectronCapture << ' ' + << DecayType::ElectroMagnetic << ' ' + << DecayType::IsomericTransition << ' ' + << DecayType::Neutron << ' ' + << DecayType::Proton << ' ' + << DecayType::Deuteron << ' ' + << DecayType::Triton << ' ' + << DecayType::Alpha << ' ' + << DecayType::AtomicRelaxation; + + CHECK( "SF beta- beta+ EC electroMagnetic IT n p d t alpha atomicRelaxation" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + DecayType value; + std::istringstream in( "SF beta- beta+ EC electroMagnetic IT n p d t alpha atomicRelaxation" ); + + in >> value; + CHECK( DecayType::SpontaneousFission == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DecayType::BetaMinus == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DecayType::BetaPlus == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DecayType::ElectronCapture == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DecayType::ElectroMagnetic == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DecayType::IsomericTransition == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DecayType::Neutron == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DecayType::Proton == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DecayType::Deuteron == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DecayType::Triton == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DecayType::Alpha == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( DecayType::AtomicRelaxation == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + DecayType value = DecayType::SpontaneousFission; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( DecayType::SpontaneousFission == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isDecayType is used" ) { + + THEN( "registered DecayType values return true, " + "unregistered DecayType values return false" ) { + + CHECK( true == isDecayType( "SF" ) ); + CHECK( true == isDecayType( "beta-" ) ); + CHECK( true == isDecayType( "beta+" ) ); + CHECK( true == isDecayType( "EC" ) ); + CHECK( true == isDecayType( "electroMagnetic" ) ); + CHECK( true == isDecayType( "IT" ) ); + CHECK( true == isDecayType( "n" ) ); + CHECK( true == isDecayType( "p" ) ); + CHECK( true == isDecayType( "d" ) ); + CHECK( true == isDecayType( "t" ) ); + CHECK( true == isDecayType( "alpha" ) ); + CHECK( true == isDecayType( "atomicRelaxation" ) ); + CHECK( false == isDecayType( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding.hpp new file mode 100644 index 000000000..bb4a8f5d3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding.hpp @@ -0,0 +1,48 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class giving acceptable encoding values + */ +enum class Encoding { + ascii = 1, + utf8 = 2 +}; + +/** + * @brief Return whether or not a string is a valid encoding + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isEncoding(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert Encoding to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::ascii, "ascii" }, + { T::utf8, "utf8" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding.python.cpp new file mode 100644 index 000000000..974ec8fce --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding.python.cpp @@ -0,0 +1,39 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapEncoding( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::Encoding; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "Encoding", + "Enumeration class giving acceptable encoding values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "ascii", Component::ascii ) + .value( "utf8", Component::utf8 ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding/test/CMakeLists.txt new file mode 100644 index 000000000..d53b726aa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.Encoding.test + Encoding.test.cpp +) + +target_compile_options( GNDStk.enums.Encoding.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.Encoding.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.Encoding COMMAND GNDStk.enums.Encoding.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding/test/Encoding.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding/test/Encoding.test.cpp new file mode 100644 index 000000000..7ba61fee8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Encoding/test/Encoding.test.cpp @@ -0,0 +1,87 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/Encoding.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "Encoding" ) { + + GIVEN( "valid encoding values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "ascii" == enum2string( Encoding::ascii ) ); + CHECK( "utf8" == enum2string( Encoding::utf8 ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( Encoding::ascii == string2enum< Encoding >( "ascii" ) ); + CHECK( Encoding::utf8 == string2enum< Encoding >( "utf8" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< Encoding >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << Encoding::ascii << ' ' << Encoding::utf8; + + CHECK( "ascii utf8" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + Encoding value; + std::istringstream in( "ascii utf8" ); + + in >> value; + CHECK( Encoding::ascii == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Encoding::utf8 == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + Encoding value = Encoding::utf8; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( Encoding::utf8 == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isEncoding is used" ) { + + THEN( "registered encoding values return true, " + "unregistered encoding values return false" ) { + + CHECK( true == isEncoding( "ascii" ) ); + CHECK( true == isEncoding( "utf8" ) ); + CHECK( false == isEncoding( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy.hpp new file mode 100644 index 000000000..21172aab7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy.hpp @@ -0,0 +1,48 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class giving acceptable units for energy + */ +enum class Energy { + eV, + MeV +}; + +/** + * @brief Return whether or not a string is a valid energy unit + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isEnergyUnit(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert Energy to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::eV, "eV" }, + { T::MeV, "MeV" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy.python.cpp new file mode 100644 index 000000000..b206836b8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy.python.cpp @@ -0,0 +1,39 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapEnergy( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::Energy; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "Energy", + "Enumeration class giving acceptable energy values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "eV", Component::eV ) + .value( "MeV", Component::MeV ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy/test/CMakeLists.txt new file mode 100644 index 000000000..5f38e4242 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.Energy.test + Energy.test.cpp +) + +target_compile_options( GNDStk.enums.Energy.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.Energy.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.Energy COMMAND GNDStk.enums.Energy.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy/test/Energy.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy/test/Energy.test.cpp new file mode 100644 index 000000000..a23aac6b5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Energy/test/Energy.test.cpp @@ -0,0 +1,86 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/Energy.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "Energy" ) { + + GIVEN( "valid unit values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "eV" == enum2string( Energy::eV ) ); + CHECK( "MeV" == enum2string( Energy::MeV ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( Energy::eV == string2enum< Energy >( "eV" ) ); + CHECK( Energy::MeV == string2enum< Energy >( "MeV" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< Energy >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << Energy::eV << ' ' << Energy::MeV; + + CHECK( "eV MeV" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + Energy value; + std::istringstream in( "eV MeV" ); + + in >> value; + CHECK( Energy::eV == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Energy::MeV == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + Energy value = Energy::eV; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( Energy::eV == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isEnergyUnit is used" ) { + + THEN( "registered units return true, unregistered units return false" ) { + + CHECK( true == isEnergyUnit( "eV" ) ); + CHECK( true == isEnergyUnit( "MeV" ) ); + CHECK( false == isEnergyUnit( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame.hpp new file mode 100644 index 000000000..ba4f492d6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame.hpp @@ -0,0 +1,48 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class for reference frame values + */ +enum class Frame { + lab = 1, + centerOfMass = 2 +}; + +/** + * @brief Return whether or not a string is a valid frame + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isFrame(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert Frame to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::lab, "lab" }, + { T::centerOfMass, "centerOfMass" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame.python.cpp new file mode 100644 index 000000000..622f945b2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame.python.cpp @@ -0,0 +1,39 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapFrame( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::Frame; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "Frame", + "Enumeration class giving acceptable reference frame values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "lab", Component::lab ) + .value( "centerOfMass", Component::centerOfMass ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame/test/CMakeLists.txt new file mode 100644 index 000000000..cb6839d55 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.Frame.test + Frame.test.cpp +) + +target_compile_options( GNDStk.enums.Frame.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.Frame.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.Frame COMMAND GNDStk.enums.Frame.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame/test/Frame.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame/test/Frame.test.cpp new file mode 100644 index 000000000..31b03904d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Frame/test/Frame.test.cpp @@ -0,0 +1,89 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/Frame.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "Frame" ) { + + GIVEN( "valid frame values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "lab" == enum2string( Frame::lab ) ); + CHECK( "centerOfMass" == enum2string( Frame::centerOfMass ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( Frame::lab == + string2enum< Frame >( "lab" ) ); + CHECK( Frame::centerOfMass == + string2enum< Frame >( "centerOfMass" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< Frame >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << Frame::lab << ' ' << Frame::centerOfMass; + + CHECK( "lab centerOfMass" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + Frame value; + std::istringstream in( "lab centerOfMass" ); + + in >> value; + CHECK( Frame::lab == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Frame::centerOfMass == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + Frame value = Frame::centerOfMass; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( Frame::centerOfMass == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isFrame is used" ) { + + THEN( "registered frame values return true, " + "unregistered frame values return false" ) { + + CHECK( true == isFrame( "lab" ) ); + CHECK( true == isFrame( "centerOfMass" ) ); + CHECK( false == isFrame( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle.hpp new file mode 100644 index 000000000..ba2f4e383 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle.hpp @@ -0,0 +1,54 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class giving acceptable grid style values + */ +enum class GridStyle { + none, + link, + points, + boundaries, + parameters +}; + +/** + * @brief Return whether or not a string is a valid grid style + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isGridStyle(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert GridStyle to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::none, "none" }, + { T::link, "link" }, + { T::points, "points" }, + { T::boundaries, "boundaries" }, + { T::parameters, "parameters" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle.python.cpp new file mode 100644 index 000000000..02ac34811 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle.python.cpp @@ -0,0 +1,42 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapGridStyle( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::GridStyle; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "GridStyle", + "Enumeration class giving acceptable grid style values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "none", Component::none ) + .value( "link", Component::link ) + .value( "points", Component::points ) + .value( "boundaries", Component::boundaries ) + .value( "parameters", Component::parameters ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle/test/CMakeLists.txt new file mode 100644 index 000000000..4cbffa5f3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.GridStyle.test + GridStyle.test.cpp +) + +target_compile_options( GNDStk.enums.GridStyle.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.GridStyle.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.GridStyle COMMAND GNDStk.enums.GridStyle.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle/test/GridStyle.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle/test/GridStyle.test.cpp new file mode 100644 index 000000000..d8a2c8cf5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/GridStyle/test/GridStyle.test.cpp @@ -0,0 +1,117 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/GridStyle.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "GridStyle" ) { + + GIVEN( "valid unit values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "none" == enum2string( GridStyle::none ) ); + CHECK( "link" == enum2string( GridStyle::link ) ); + CHECK( "points" == enum2string( GridStyle::points ) ); + CHECK( "boundaries" == enum2string( GridStyle::boundaries ) ); + CHECK( "parameters" == enum2string( GridStyle::parameters ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( GridStyle::none == + string2enum< GridStyle >( "none" ) ); + CHECK( GridStyle::link == + string2enum< GridStyle >( "link" ) ); + CHECK( GridStyle::points == + string2enum< GridStyle >( "points" ) ); + CHECK( GridStyle::boundaries == + string2enum< GridStyle >( "boundaries" ) ); + CHECK( GridStyle::parameters == + string2enum< GridStyle >( "parameters" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< GridStyle >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << GridStyle::none << ' ' << GridStyle::link << ' ' + << GridStyle::points << ' ' << GridStyle::boundaries << ' ' + << GridStyle::parameters; + + CHECK( "none link points boundaries parameters" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + GridStyle value; + std::istringstream in( "none link points boundaries parameters" ); + + in >> value; + CHECK( GridStyle::none == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( GridStyle::link == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( GridStyle::points == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( GridStyle::boundaries == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( GridStyle::parameters == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + GridStyle value = GridStyle::points; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( GridStyle::points == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isGridStyle is used" ) { + + THEN( "registered units return true, unregistered units return false" ) { + + CHECK( true == isGridStyle( "none" ) ); + CHECK( true == isGridStyle( "link" ) ); + CHECK( true == isGridStyle( "points" ) ); + CHECK( true == isGridStyle( "boundaries" ) ); + CHECK( true == isGridStyle( "parameters" ) ); + CHECK( false == isGridStyle( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm.hpp new file mode 100644 index 000000000..8b1fba219 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm.hpp @@ -0,0 +1,48 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class for hash algorithm values + */ +enum class HashAlgorithm { + md5 = 1, + sha1 = 2 +}; + +/** + * @brief Return whether or not a string is a valid hash algorithm value + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isHashAlgorithm(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert HashAlgorithm to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::md5, "md5" }, + { T::sha1, "sha1" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm.python.cpp new file mode 100644 index 000000000..c986c120f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm.python.cpp @@ -0,0 +1,39 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapHashAlgorithm( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::HashAlgorithm; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "HashAlgorithm", + "Enumeration class giving acceptable hash algorithm values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "md5", Component::md5 ) + .value( "sha1", Component::sha1 ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm/test/CMakeLists.txt new file mode 100644 index 000000000..0fd24a56b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.HashAlgorithm.test + HashAlgorithm.test.cpp +) + +target_compile_options( GNDStk.enums.HashAlgorithm.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.HashAlgorithm.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.HashAlgorithm COMMAND GNDStk.enums.HashAlgorithm.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm/test/HashAlgorithm.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm/test/HashAlgorithm.test.cpp new file mode 100644 index 000000000..651afa248 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/HashAlgorithm/test/HashAlgorithm.test.cpp @@ -0,0 +1,87 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/HashAlgorithm.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "HashAlgorithm" ) { + + GIVEN( "valid frame values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "md5" == enum2string( HashAlgorithm::md5 ) ); + CHECK( "sha1" == enum2string( HashAlgorithm::sha1 ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( HashAlgorithm::md5 == string2enum< HashAlgorithm >( "md5" ) ); + CHECK( HashAlgorithm::sha1 == string2enum< HashAlgorithm >( "sha1" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< HashAlgorithm >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << HashAlgorithm::md5 << ' ' << HashAlgorithm::sha1; + + CHECK( "md5 sha1" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + HashAlgorithm value; + std::istringstream in( "md5 sha1" ); + + in >> value; + CHECK( HashAlgorithm::md5 == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( HashAlgorithm::sha1 == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + HashAlgorithm value = HashAlgorithm::sha1; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( HashAlgorithm::sha1 == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isHashAlgorithm is used" ) { + + THEN( "registered frame values return true, " + "unregistered frame values return false" ) { + + CHECK( true == isHashAlgorithm( "md5" ) ); + CHECK( true == isHashAlgorithm( "sha1" ) ); + CHECK( false == isHashAlgorithm( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction.hpp new file mode 100644 index 000000000..7ba0100c6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction.hpp @@ -0,0 +1,50 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class giving acceptable interaction values + */ +enum class Interaction { + nuclear = 1, + atomic = 2, + thermalNeutronScatteringLaw = 3 +}; + +/** + * @brief Return whether or not a string is a valid interaction + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isInteraction(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert Interaction to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::nuclear, "nuclear" }, + { T::atomic, "atomic" }, + { T::thermalNeutronScatteringLaw, "thermalNeutronScatteringLaw" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction.python.cpp new file mode 100644 index 000000000..9642ebd7a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction.python.cpp @@ -0,0 +1,40 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapInteraction( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::Interaction; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "Interaction", + "Enumeration class giving acceptable interaction type values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "nuclear", Component::nuclear ) + .value( "atomic", Component::atomic ) + .value( "thermalNeutronScatteringLaw", Component::thermalNeutronScatteringLaw ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction/test/CMakeLists.txt new file mode 100644 index 000000000..419e30ed6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.Interaction.test + Interaction.test.cpp +) + +target_compile_options( GNDStk.enums.Interaction.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.Interaction.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.Interaction COMMAND GNDStk.enums.Interaction.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction/test/Interaction.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction/test/Interaction.test.cpp new file mode 100644 index 000000000..10971cda6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interaction/test/Interaction.test.cpp @@ -0,0 +1,102 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/Interaction.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "Interaction" ) { + + GIVEN( "valid interaction values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "nuclear" == + enum2string( Interaction::nuclear ) ); + CHECK( "atomic" == + enum2string( Interaction::atomic ) ); + CHECK( "thermalNeutronScatteringLaw" == + enum2string( Interaction::thermalNeutronScatteringLaw ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( Interaction::nuclear == + string2enum("nuclear")); + CHECK( Interaction::atomic == + string2enum("atomic")); + CHECK( Interaction::thermalNeutronScatteringLaw == + string2enum("thermalNeutronScatteringLaw")); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< Interaction >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << Interaction::nuclear << ' ' << Interaction::atomic << ' ' + << Interaction::thermalNeutronScatteringLaw; + + CHECK( "nuclear atomic thermalNeutronScatteringLaw" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + Interaction value; + std::istringstream in( "nuclear atomic thermalNeutronScatteringLaw" ); + + in >> value; + CHECK( Interaction::nuclear == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Interaction::atomic == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Interaction::thermalNeutronScatteringLaw == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + Interaction value = Interaction::atomic; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( Interaction::atomic == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isInteraction is used" ) { + + THEN( "registered interaction values return true, " + "unregistered interaction values return false" ) { + + CHECK( true == isInteraction( "nuclear" ) ); + CHECK( true == isInteraction( "atomic" ) ); + CHECK( true == isInteraction( "thermalNeutronScatteringLaw" ) ); + CHECK( false == isInteraction( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation.hpp new file mode 100644 index 000000000..bd2d406d6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation.hpp @@ -0,0 +1,56 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class for interpolation values + */ +enum class Interpolation { + flat = 1, + linlin = 2, + linlog = 3, + loglin = 4, + loglog = 5, + chargedparticle = 6 +}; + +/** + * @brief Return whether or not a string is a valid interpolation value + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isInterpolation(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert Interpolation to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::flat, "flat" }, + { T::linlin, "lin-lin" }, + { T::linlog, "lin-log" }, + { T::loglin, "log-lin" }, + { T::loglog, "log-log" }, + { T::chargedparticle, "charged-particle" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation.python.cpp new file mode 100644 index 000000000..c2a2582ce --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation.python.cpp @@ -0,0 +1,43 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapInterpolation( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::Interpolation; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "Interpolation", + "Enumeration class giving acceptable interpolation values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "flat", Component::flat ) + .value( "linlin", Component::linlin ) + .value( "linlog", Component::linlog ) + .value( "loglin", Component::loglin ) + .value( "loglog", Component::loglog ) + .value( "chargedparticle", Component::chargedparticle ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation/test/CMakeLists.txt new file mode 100644 index 000000000..81693f9bf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.Interpolation.test + Interpolation.test.cpp +) + +target_compile_options( GNDStk.enums.Interpolation.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.Interpolation.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.Interpolation COMMAND GNDStk.enums.Interpolation.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation/test/Interpolation.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation/test/Interpolation.test.cpp new file mode 100644 index 000000000..fdfbdd15d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Interpolation/test/Interpolation.test.cpp @@ -0,0 +1,130 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/Interpolation.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "Interpolation" ) { + + GIVEN( "valid interpolation values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "flat" == enum2string( Interpolation::flat ) ); + CHECK( "lin-lin" == enum2string( Interpolation::linlin ) ); + CHECK( "lin-log" == enum2string( Interpolation::linlog ) ); + CHECK( "log-lin" == enum2string( Interpolation::loglin ) ); + CHECK( "log-log" == enum2string( Interpolation::loglog ) ); + CHECK( "charged-particle" == + enum2string( Interpolation::chargedparticle ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( Interpolation::flat == + string2enum< Interpolation >( "flat" ) ); + CHECK( Interpolation::linlin == + string2enum< Interpolation >( "lin-lin" ) ); + CHECK( Interpolation::linlog == + string2enum< Interpolation >( "lin-log" ) ); + CHECK( Interpolation::loglin == + string2enum< Interpolation >( "log-lin" ) ); + CHECK( Interpolation::loglog == + string2enum< Interpolation >( "log-log" ) ); + CHECK( Interpolation::chargedparticle == + string2enum< Interpolation >( "charged-particle" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< Interpolation >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << Interpolation::flat << ' ' << Interpolation::linlin << ' ' + << Interpolation::linlog << ' ' << Interpolation::loglin << ' ' + << Interpolation::loglog << ' ' << Interpolation::chargedparticle; + + CHECK( "flat lin-lin lin-log log-lin log-log charged-particle" == + out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + Interpolation value; + std::istringstream in( "flat lin-lin lin-log log-lin " + "log-log charged-particle" ); + + in >> value; + CHECK( Interpolation::flat == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Interpolation::linlin == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Interpolation::linlog == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Interpolation::loglin == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Interpolation::loglog == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Interpolation::chargedparticle == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + Interpolation value = Interpolation::linlin; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( Interpolation::linlin == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isInterpolation is used" ) { + + THEN( "registered interpolation values return true, " + "unregistered interpolation values return false" ) { + + CHECK( true == isInterpolation( "flat" ) ); + CHECK( true == isInterpolation( "lin-lin" ) ); + CHECK( true == isInterpolation( "lin-log" ) ); + CHECK( true == isInterpolation( "log-lin" ) ); + CHECK( true == isInterpolation( "log-log" ) ); + CHECK( true == isInterpolation( "charged-particle" ) ); + CHECK( false == isInterpolation( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier.hpp new file mode 100644 index 000000000..90c294ab2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier.hpp @@ -0,0 +1,53 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class for interpolation qualifier values + */ +enum class InterpolationQualifier { + direct = 1, + unitBase, + correspondingEnergies, + correspondingPoints +}; + +/** + * @brief Return whether or not a string is a valid interpolation qualifier + * value + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isInterpolationQualifier(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert InterpolationQualifier to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::direct, "direct" }, + { T::unitBase, "unitBase" }, + { T::correspondingEnergies, "correspondingEnergies" }, + { T::correspondingPoints, "correspondingPoints" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier.python.cpp new file mode 100644 index 000000000..367bcfbc1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier.python.cpp @@ -0,0 +1,41 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapInterpolationQualifier( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::InterpolationQualifier; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "InterpolationQualifier", + "Enumeration class giving acceptable interpolation qualifier values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "direct", Component::direct ) + .value( "unitBase", Component::unitBase ) + .value( "correspondingEnergies", Component::correspondingEnergies ) + .value( "correspondingPoints", Component::correspondingPoints ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier/test/CMakeLists.txt new file mode 100644 index 000000000..8e627bc3a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.InterpolationQualifier.test + InterpolationQualifier.test.cpp +) + +target_compile_options( GNDStk.enums.InterpolationQualifier.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.InterpolationQualifier.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.InterpolationQualifier COMMAND GNDStk.enums.InterpolationQualifier.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier/test/InterpolationQualifier.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier/test/InterpolationQualifier.test.cpp new file mode 100644 index 000000000..59e9581e3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/InterpolationQualifier/test/InterpolationQualifier.test.cpp @@ -0,0 +1,114 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/InterpolationQualifier.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "InterpolationQualifier" ) { + + GIVEN( "valid interpolation values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "direct" == enum2string( InterpolationQualifier::direct ) ); + CHECK( "unitBase" == enum2string( InterpolationQualifier::unitBase ) ); + CHECK( "correspondingEnergies" + == enum2string( InterpolationQualifier::correspondingEnergies ) ); + CHECK( "correspondingPoints" + == enum2string( InterpolationQualifier::correspondingPoints ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( InterpolationQualifier::direct + == string2enum< InterpolationQualifier >( "direct" ) ); + CHECK( InterpolationQualifier::unitBase + == string2enum< InterpolationQualifier >( "unitBase" ) ); + CHECK( InterpolationQualifier::correspondingEnergies + == string2enum< InterpolationQualifier >( "correspondingEnergies" ) ); + CHECK( InterpolationQualifier::correspondingPoints + == string2enum< InterpolationQualifier >( "correspondingPoints" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< InterpolationQualifier >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << InterpolationQualifier::direct << ' ' + << InterpolationQualifier::unitBase << ' ' + << InterpolationQualifier::correspondingEnergies << ' ' + << InterpolationQualifier::correspondingPoints; + + CHECK( "direct unitBase correspondingEnergies correspondingPoints" + == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + InterpolationQualifier value; + std::istringstream in( "direct unitBase correspondingEnergies " + "correspondingPoints" ); + + in >> value; + CHECK( InterpolationQualifier::direct == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( InterpolationQualifier::unitBase == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( InterpolationQualifier::correspondingEnergies == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( InterpolationQualifier::correspondingPoints == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + InterpolationQualifier value = InterpolationQualifier::unitBase; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( InterpolationQualifier::unitBase == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isInterpolationQualifier is used" ) { + + THEN( "registered interpolation qualifier values return true, " + "unregistered interpolation values return false" ) { + + CHECK( true == isInterpolationQualifier( "direct" ) ); + CHECK( true == isInterpolationQualifier( "unitBase" ) ); + CHECK( true == isInterpolationQualifier( "correspondingEnergies" ) ); + CHECK( true == isInterpolationQualifier( "correspondingPoints" ) ); + CHECK( false == isInterpolationQualifier( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length.hpp new file mode 100644 index 000000000..9027e7187 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length.hpp @@ -0,0 +1,50 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class giving acceptable units for length + */ +enum class Length { + m, + cm, + fm +}; + +/** + * @brief Return whether or not a string is a valid energy unit + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isLengthUnit(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert Length to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::m, "m" }, + { T::cm, "cm" }, + { T::fm, "fm" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length.python.cpp new file mode 100644 index 000000000..78b93ffb0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length.python.cpp @@ -0,0 +1,40 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapLength( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::Length; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "Length", + "Enumeration class giving acceptable length values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "m", Component::m ) + .value( "cm", Component::cm ) + .value( "fm", Component::fm ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length/test/CMakeLists.txt new file mode 100644 index 000000000..7c4fd017d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.Length.test + Length.test.cpp +) + +target_compile_options( GNDStk.enums.Length.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.Length.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.Length COMMAND GNDStk.enums.Length.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length/test/Length.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length/test/Length.test.cpp new file mode 100644 index 000000000..0441589d7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Length/test/Length.test.cpp @@ -0,0 +1,94 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/Length.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "Length" ) { + + GIVEN( "valid unit values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "m" == enum2string( Length::m ) ); + CHECK( "cm" == enum2string( Length::cm ) ); + CHECK( "fm" == enum2string( Length::fm ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( Length::m == string2enum< Length >( "m" ) ); + CHECK( Length::cm == string2enum< Length >( "cm" ) ); + CHECK( Length::fm == string2enum< Length >( "fm" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< Length >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << Length::m << ' ' << Length::cm << ' ' << Length::fm; + + CHECK( "m cm fm" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + Length value; + std::istringstream in( "m cm fm" ); + + in >> value; + CHECK( Length::m == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Length::cm == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Length::fm == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + Length value = Length::m; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( Length::m == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isLengthUnit is used" ) { + + THEN( "registered units return true, unregistered units return false" ) { + + CHECK( true == isLengthUnit( "m" ) ); + CHECK( true == isLengthUnit( "cm" ) ); + CHECK( true == isLengthUnit( "fm" ) ); + CHECK( false == isLengthUnit( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity.hpp new file mode 100644 index 000000000..836627e24 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity.hpp @@ -0,0 +1,48 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class for particle parity values + */ +enum class Parity { + minus = -1, + plus = +1 +}; + +/** + * @brief Return whether or not a string is a valid parity + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isParity(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert Parity to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::minus, "-1" }, + { T::plus, "+1" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity.python.cpp new file mode 100644 index 000000000..146df2c30 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity.python.cpp @@ -0,0 +1,39 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapParity( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::Parity; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "Parity", + "Enumeration class giving acceptable parity values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "minus", Component::minus ) + .value( "plus", Component::plus ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity/test/CMakeLists.txt new file mode 100644 index 000000000..628eefb4e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.Parity.test + Parity.test.cpp +) + +target_compile_options( GNDStk.enums.Parity.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.Parity.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.Parity COMMAND GNDStk.enums.Parity.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity/test/Parity.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity/test/Parity.test.cpp new file mode 100644 index 000000000..04b452ad3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/Parity/test/Parity.test.cpp @@ -0,0 +1,87 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/Parity.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "Parity" ) { + + GIVEN( "valid frame values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "-1" == enum2string( Parity::minus ) ); + CHECK( "+1" == enum2string( Parity::plus ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( Parity::minus == string2enum< Parity >( "-1" ) ); + CHECK( Parity::plus == string2enum< Parity >( "+1" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< Parity >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << Parity::minus << ' ' << Parity::plus; + + CHECK( "-1 +1" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + Parity value; + std::istringstream in( "-1 +1" ); + + in >> value; + CHECK( Parity::minus == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( Parity::plus == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + Parity value = Parity::plus; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( Parity::plus == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isParity is used" ) { + + THEN( "registered parity values return true, " + "unregistered parity values return false" ) { + + CHECK( true == isParity( "-1" ) ); + CHECK( true == isParity( "+1" ) ); + CHECK( false == isParity( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType.hpp new file mode 100644 index 000000000..14fcc9c14 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType.hpp @@ -0,0 +1,112 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class for interpolation qualifier values + */ +enum class RelationType { + IsCitedBy = 1, + Cites, + IsSupplementTo, + IsSupplementedBy, + IsContinuedBy, + Continues, + Describes, + IsDescribedBy, + HasMetadata, + IsMetadataFor, + HasVersion, + IsVersionOf, + IsNewVersionOf, + IsPreviousVersionOf, + IsPartOf, + HasPart, + IsPublishedIn, + IsReferencedBy, + References, + IsDocumentedBy, + Documents, + IsCompiledBy, + Compiles, + IsVariantFormOf, + IsOriginalFormOf, + IsIdenticalTo, + IsReviewedBy, + Reviews, + IsDerivedFrom, + IsSourceOf, + IsRequiredBy, + Requires, + Obsoletes, + IsObsoletedBy +}; + +/** + * @brief Return whether or not a string is a valid relation type + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isRelationType(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert RelationType to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::IsCitedBy, "IsCitedBy" }, + { T::Cites, "Cites" }, + { T::IsSupplementTo, "IsSupplementTo" }, + { T::IsSupplementedBy, "IsSupplementedBy" }, + { T::IsContinuedBy, "IsContinuedBy" }, + { T::Continues, "Continues" }, + { T::Describes, "Describes" }, + { T::IsDescribedBy, "IsDescribedBy" }, + { T::HasMetadata, "HasMetadata" }, + { T::IsMetadataFor, "IsMetadataFor" }, + { T::HasVersion, "HasVersion" }, + { T::IsVersionOf, "IsVersionOf" }, + { T::IsNewVersionOf, "IsNewVersionOf" }, + { T::IsPreviousVersionOf, "IsPreviousVersionOf" }, + { T::IsPartOf, "IsPartOf" }, + { T::HasPart, "HasPart" }, + { T::IsPublishedIn, "IsPublishedIn" }, + { T::IsReferencedBy, "IsReferencedBy" }, + { T::References, "References" }, + { T::IsDocumentedBy, "IsDocumentedBy" }, + { T::Documents, "Documents" }, + { T::IsCompiledBy, "IsCompiledBy" }, + { T::Compiles, "Compiles" }, + { T::IsVariantFormOf, "IsVariantFormOf" }, + { T::IsOriginalFormOf, "IsOriginalFormOf" }, + { T::IsIdenticalTo, "IsIdenticalTo" }, + { T::IsReviewedBy, "IsReviewedBy" }, + { T::Reviews, "Reviews" }, + { T::IsDerivedFrom, "IsDerivedFrom" }, + { T::IsSourceOf, "IsSourceOf" }, + { T::IsRequiredBy, "IsRequiredBy" }, + { T::Requires, "Requires" }, + { T::Obsoletes, "Obsoletes" }, + { T::IsObsoletedBy, "IsObsoletedBy" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType.python.cpp new file mode 100644 index 000000000..ee653e9e5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType.python.cpp @@ -0,0 +1,71 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapRelationType( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::RelationType; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "RelationType", + "Enumeration class giving acceptable relation type values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "IsCitedBy", Component::IsCitedBy ) + .value( "Cites", Component::Cites ) + .value( "IsSupplementTo", Component::IsSupplementTo ) + .value( "IsSupplementedBy", Component::IsSupplementedBy ) + .value( "IsContinuedBy", Component::IsContinuedBy ) + .value( "Continues", Component::Continues ) + .value( "Describes", Component::Describes ) + .value( "IsDescribedBy", Component::IsDescribedBy ) + .value( "HasMetadata", Component::HasMetadata ) + .value( "IsMetadataFor", Component::IsMetadataFor ) + .value( "HasVersion", Component::HasVersion ) + .value( "IsVersionOf", Component::IsVersionOf ) + .value( "IsNewVersionOf", Component::IsNewVersionOf ) + .value( "IsPreviousVersionOf", Component::IsPreviousVersionOf ) + .value( "IsPartOf", Component::IsPartOf ) + .value( "HasPart", Component::HasPart ) + .value( "IsPublishedIn", Component::IsPublishedIn ) + .value( "IsReferencedBy", Component::IsReferencedBy ) + .value( "References", Component::References ) + .value( "IsDocumentedBy", Component::IsDocumentedBy ) + .value( "Documents", Component::Documents ) + .value( "IsCompiledBy", Component::IsCompiledBy ) + .value( "Compiles", Component::Compiles ) + .value( "IsVariantFormOf", Component::IsVariantFormOf ) + .value( "IsOriginalFormOf", Component::IsOriginalFormOf ) + .value( "IsIdenticalTo", Component::IsIdenticalTo ) + .value( "IsReviewedBy", Component::IsReviewedBy ) + .value( "Reviews", Component::Reviews ) + .value( "IsDerivedFrom", Component::IsDerivedFrom ) + .value( "IsSourceOf", Component::IsSourceOf ) + .value( "IsRequiredBy", Component::IsRequiredBy ) + .value( "Requires", Component::Requires ) + .value( "Obsoletes", Component::Obsoletes ) + .value( "IsObsoletedBy", Component::IsObsoletedBy ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType/test/CMakeLists.txt new file mode 100644 index 000000000..53897e897 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.RelationType.test + RelationType.test.cpp +) + +target_compile_options( GNDStk.enums.RelationType.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.RelationType.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.RelationType COMMAND GNDStk.enums.RelationType.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType/test/RelationType.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType/test/RelationType.test.cpp new file mode 100644 index 000000000..4e6f21fc6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/RelationType/test/RelationType.test.cpp @@ -0,0 +1,389 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/RelationType.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "RelationType" ) { + + GIVEN( "valid encoding values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "IsCitedBy" == enum2string( RelationType::IsCitedBy ) ); + CHECK( "Cites" == enum2string( RelationType::Cites ) ); + CHECK( "IsSupplementTo" == enum2string( RelationType::IsSupplementTo ) ); + CHECK( "IsSupplementedBy" == enum2string( RelationType::IsSupplementedBy ) ); + CHECK( "IsContinuedBy" == enum2string( RelationType::IsContinuedBy ) ); + CHECK( "Continues" == enum2string( RelationType::Continues ) ); + CHECK( "Describes" == enum2string( RelationType::Describes ) ); + CHECK( "IsDescribedBy" == enum2string( RelationType::IsDescribedBy ) ); + CHECK( "HasMetadata" == enum2string( RelationType::HasMetadata ) ); + CHECK( "IsMetadataFor" == enum2string( RelationType::IsMetadataFor ) ); + CHECK( "HasVersion" == enum2string( RelationType::HasVersion ) ); + CHECK( "IsVersionOf" == enum2string( RelationType::IsVersionOf ) ); + CHECK( "IsNewVersionOf" == enum2string( RelationType::IsNewVersionOf ) ); + CHECK( "IsPreviousVersionOf" == enum2string( RelationType::IsPreviousVersionOf ) ); + CHECK( "IsPartOf" == enum2string( RelationType::IsPartOf ) ); + CHECK( "HasPart" == enum2string( RelationType::HasPart ) ); + CHECK( "IsPublishedIn" == enum2string( RelationType::IsPublishedIn ) ); + CHECK( "IsReferencedBy" == enum2string( RelationType::IsReferencedBy ) ); + CHECK( "References" == enum2string( RelationType::References ) ); + CHECK( "IsDocumentedBy" == enum2string( RelationType::IsDocumentedBy ) ); + CHECK( "Documents" == enum2string( RelationType::Documents ) ); + CHECK( "IsCompiledBy" == enum2string( RelationType::IsCompiledBy ) ); + CHECK( "Compiles" == enum2string( RelationType::Compiles ) ); + CHECK( "IsVariantFormOf" == enum2string( RelationType::IsVariantFormOf ) ); + CHECK( "IsOriginalFormOf" == enum2string( RelationType::IsOriginalFormOf ) ); + CHECK( "IsIdenticalTo" == enum2string( RelationType::IsIdenticalTo ) ); + CHECK( "IsReviewedBy" == enum2string( RelationType::IsReviewedBy ) ); + CHECK( "Reviews" == enum2string( RelationType::Reviews ) ); + CHECK( "IsDerivedFrom" == enum2string( RelationType::IsDerivedFrom ) ); + CHECK( "IsSourceOf" == enum2string( RelationType::IsSourceOf ) ); + CHECK( "IsRequiredBy" == enum2string( RelationType::IsRequiredBy ) ); + CHECK( "Requires" == enum2string( RelationType::Requires ) ); + CHECK( "Obsoletes" == enum2string( RelationType::Obsoletes ) ); + CHECK( "IsObsoletedBy" == enum2string( RelationType::IsObsoletedBy ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( RelationType::IsCitedBy == string2enum< RelationType >( "IsCitedBy" ) ); + CHECK( RelationType::Cites == string2enum< RelationType >( "Cites" ) ); + CHECK( RelationType::IsSupplementTo == string2enum< RelationType >( "IsSupplementTo" ) ); + CHECK( RelationType::IsSupplementedBy == string2enum< RelationType >( "IsSupplementedBy" ) ); + CHECK( RelationType::IsContinuedBy == string2enum< RelationType >( "IsContinuedBy" ) ); + CHECK( RelationType::Continues == string2enum< RelationType >( "Continues" ) ); + CHECK( RelationType::Describes == string2enum< RelationType >( "Describes" ) ); + CHECK( RelationType::IsDescribedBy == string2enum< RelationType >( "IsDescribedBy" ) ); + CHECK( RelationType::HasMetadata == string2enum< RelationType >( "HasMetadata" ) ); + CHECK( RelationType::IsMetadataFor == string2enum< RelationType >( "IsMetadataFor" ) ); + CHECK( RelationType::HasVersion == string2enum< RelationType >( "HasVersion" ) ); + CHECK( RelationType::IsVersionOf == string2enum< RelationType >( "IsVersionOf" ) ); + CHECK( RelationType::IsNewVersionOf == string2enum< RelationType >( "IsNewVersionOf" ) ); + CHECK( RelationType::IsPreviousVersionOf == string2enum< RelationType >( "IsPreviousVersionOf" ) ); + CHECK( RelationType::IsPartOf == string2enum< RelationType >( "IsPartOf" ) ); + CHECK( RelationType::HasPart == string2enum< RelationType >( "HasPart" ) ); + CHECK( RelationType::IsPublishedIn == string2enum< RelationType >( "IsPublishedIn" ) ); + CHECK( RelationType::IsReferencedBy == string2enum< RelationType >( "IsReferencedBy" ) ); + CHECK( RelationType::References == string2enum< RelationType >( "References" ) ); + CHECK( RelationType::IsDocumentedBy == string2enum< RelationType >( "IsDocumentedBy" ) ); + CHECK( RelationType::Documents == string2enum< RelationType >( "Documents" ) ); + CHECK( RelationType::IsCompiledBy == string2enum< RelationType >( "IsCompiledBy" ) ); + CHECK( RelationType::Compiles == string2enum< RelationType >( "Compiles" ) ); + CHECK( RelationType::IsVariantFormOf == string2enum< RelationType >( "IsVariantFormOf" ) ); + CHECK( RelationType::IsOriginalFormOf == string2enum< RelationType >( "IsOriginalFormOf" ) ); + CHECK( RelationType::IsIdenticalTo == string2enum< RelationType >( "IsIdenticalTo" ) ); + CHECK( RelationType::IsReviewedBy == string2enum< RelationType >( "IsReviewedBy" ) ); + CHECK( RelationType::Reviews == string2enum< RelationType >( "Reviews" ) ); + CHECK( RelationType::IsDerivedFrom == string2enum< RelationType >( "IsDerivedFrom" ) ); + CHECK( RelationType::IsSourceOf == string2enum< RelationType >( "IsSourceOf" ) ); + CHECK( RelationType::IsRequiredBy == string2enum< RelationType >( "IsRequiredBy" ) ); + CHECK( RelationType::Requires == string2enum< RelationType >( "Requires" ) ); + CHECK( RelationType::Obsoletes == string2enum< RelationType >( "Obsoletes" ) ); + CHECK( RelationType::IsObsoletedBy == string2enum< RelationType >( "IsObsoletedBy" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< RelationType >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << RelationType::IsCitedBy << ' ' + << RelationType::Cites << ' ' + << RelationType::IsSupplementTo << ' ' + << RelationType::IsSupplementedBy << ' ' + << RelationType::IsContinuedBy << ' ' + << RelationType::Continues << ' ' + << RelationType::Describes << ' ' + << RelationType::IsDescribedBy << ' ' + << RelationType::HasMetadata << ' ' + << RelationType::IsMetadataFor << ' ' + << RelationType::HasVersion << ' ' + << RelationType::IsVersionOf << ' ' + << RelationType::IsNewVersionOf << ' ' + << RelationType::IsPreviousVersionOf << ' ' + << RelationType::IsPartOf << ' ' + << RelationType::HasPart << ' ' + << RelationType::IsPublishedIn << ' ' + << RelationType::IsReferencedBy << ' ' + << RelationType::References << ' ' + << RelationType::IsDocumentedBy << ' ' + << RelationType::Documents << ' ' + << RelationType::IsCompiledBy << ' ' + << RelationType::Compiles << ' ' + << RelationType::IsVariantFormOf << ' ' + << RelationType::IsOriginalFormOf << ' ' + << RelationType::IsIdenticalTo << ' ' + << RelationType::IsReviewedBy << ' ' + << RelationType::Reviews << ' ' + << RelationType::IsDerivedFrom << ' ' + << RelationType::IsSourceOf << ' ' + << RelationType::IsRequiredBy << ' ' + << RelationType::Requires << ' ' + << RelationType::Obsoletes << ' ' + << RelationType::IsObsoletedBy; + + CHECK( "IsCitedBy Cites IsSupplementTo IsSupplementedBy IsContinuedBy " + "Continues Describes IsDescribedBy HasMetadata IsMetadataFor " + "HasVersion IsVersionOf IsNewVersionOf IsPreviousVersionOf " + "IsPartOf HasPart IsPublishedIn IsReferencedBy References " + "IsDocumentedBy Documents IsCompiledBy Compiles IsVariantFormOf " + "IsOriginalFormOf IsIdenticalTo IsReviewedBy Reviews IsDerivedFrom " + "IsSourceOf IsRequiredBy Requires Obsoletes IsObsoletedBy" + == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + RelationType value; + std::istringstream in( "IsCitedBy Cites IsSupplementTo IsSupplementedBy IsContinuedBy " + "Continues Describes IsDescribedBy HasMetadata IsMetadataFor " + "HasVersion IsVersionOf IsNewVersionOf IsPreviousVersionOf " + "IsPartOf HasPart IsPublishedIn IsReferencedBy References " + "IsDocumentedBy Documents IsCompiledBy Compiles IsVariantFormOf " + "IsOriginalFormOf IsIdenticalTo IsReviewedBy Reviews IsDerivedFrom " + "IsSourceOf IsRequiredBy Requires Obsoletes IsObsoletedBy" ); + + in >> value; + CHECK( RelationType::IsCitedBy == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::Cites == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsSupplementTo == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsSupplementedBy == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsContinuedBy == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::Continues == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::Describes == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsDescribedBy == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::HasMetadata == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsMetadataFor == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::HasVersion == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsVersionOf == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsNewVersionOf == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsPreviousVersionOf == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsPartOf == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::HasPart == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsPublishedIn == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsReferencedBy == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::References == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsDocumentedBy == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::Documents == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsCompiledBy == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::Compiles == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsVariantFormOf == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsOriginalFormOf == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsIdenticalTo == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsReviewedBy == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::Reviews == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsDerivedFrom == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsSourceOf == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsRequiredBy == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::Requires == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::Obsoletes == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( RelationType::IsObsoletedBy == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + RelationType value = RelationType::IsCitedBy; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( RelationType::IsCitedBy == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isRelationType is used" ) { + + THEN( "registered date types return true, " + "unregistered date types return false" ) { + + CHECK( true == isRelationType( "IsCitedBy" ) ); + CHECK( true == isRelationType( "Cites" ) ); + CHECK( true == isRelationType( "IsSupplementTo" ) ); + CHECK( true == isRelationType( "IsSupplementedBy" ) ); + CHECK( true == isRelationType( "IsContinuedBy" ) ); + CHECK( true == isRelationType( "Continues" ) ); + CHECK( true == isRelationType( "Describes" ) ); + CHECK( true == isRelationType( "IsDescribedBy" ) ); + CHECK( true == isRelationType( "HasMetadata" ) ); + CHECK( true == isRelationType( "IsMetadataFor" ) ); + CHECK( true == isRelationType( "HasVersion" ) ); + CHECK( true == isRelationType( "IsVersionOf" ) ); + CHECK( true == isRelationType( "IsNewVersionOf" ) ); + CHECK( true == isRelationType( "IsPreviousVersionOf" ) ); + CHECK( true == isRelationType( "IsPartOf" ) ); + CHECK( true == isRelationType( "HasPart" ) ); + CHECK( true == isRelationType( "IsPublishedIn" ) ); + CHECK( true == isRelationType( "IsReferencedBy" ) ); + CHECK( true == isRelationType( "References" ) ); + CHECK( true == isRelationType( "IsDocumentedBy" ) ); + CHECK( true == isRelationType( "Documents" ) ); + CHECK( true == isRelationType( "IsCompiledBy" ) ); + CHECK( true == isRelationType( "Compiles" ) ); + CHECK( true == isRelationType( "IsVariantFormOf" ) ); + CHECK( true == isRelationType( "IsOriginalFormOf" ) ); + CHECK( true == isRelationType( "IsIdenticalTo" ) ); + CHECK( true == isRelationType( "IsReviewedBy" ) ); + CHECK( true == isRelationType( "Reviews" ) ); + CHECK( true == isRelationType( "IsDerivedFrom" ) ); + CHECK( true == isRelationType( "IsSourceOf" ) ); + CHECK( true == isRelationType( "IsRequiredBy" ) ); + CHECK( true == isRelationType( "Requires" ) ); + CHECK( true == isRelationType( "Obsoletes" ) ); + CHECK( true == isRelationType( "IsObsoletedBy" ) ); + CHECK( false == isRelationType( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder.hpp new file mode 100644 index 000000000..e8db3a19d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder.hpp @@ -0,0 +1,48 @@ + +#pragma once + +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { +namespace enums { + +using namespace njoy::GNDStk::enums; + +/** + * @class + * @brief Enumeration class giving acceptable storage order values + */ +enum class StorageOrder { + rowMajor = 1, + columnMajor = 2 +}; + +/** + * @brief Return whether or not a string is a valid storage order + * + * @param[in] string the string to be verified + * + * @return true/false + */ +inline bool isStorageOrder(const std::string &string) +{ + return isSymbolForEnum(string); +} + +} // namespace enums +} // namespace v2_0 +} // namespace GNDS + +/** + * @brief Template specialisation to convert StorageOrder to/from strings + */ +template<> +struct njoy::GNDStk::enums::EnumMap { + using T = getEnum; + static inline const map2string values { + { T::rowMajor, "row-major" }, + { T::columnMajor, "column-major" } + }; + static inline const auto symbols = reverseMap(values); +}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder.python.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder.python.cpp new file mode 100644 index 000000000..1bd6a5063 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder.python.cpp @@ -0,0 +1,39 @@ + +// system includes +#include +#include +#include + +// local includes +#include "GNDStk.hpp" +#include "GNDS/v2.0.hpp" + +namespace python_GNDS { +namespace python_v2_0 { +namespace python_enums { + +void wrapStorageOrder( pybind11::module& module ) { + + // type aliases + using Component = GNDS::v2_0::enums::StorageOrder; + + // wrap views created by this component + + // create the component + pybind11::enum_< Component > component( + + module, + "StorageOrder", + "Enumeration class giving acceptable storage order values", + pybind11::arithmetic() + ); + + // wrap the component + component + .value( "rowMajor", Component::rowMajor ) + .value( "columnMajor", Component::columnMajor ); +} + +} // namespace python_enums +} // namespace python_v2_0 +} // namespace python_GNDS diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder/test/CMakeLists.txt b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder/test/CMakeLists.txt new file mode 100644 index 000000000..99671e9a1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder/test/CMakeLists.txt @@ -0,0 +1,22 @@ + +add_executable( + GNDStk.enums.StorageOrder.test + StorageOrder.test.cpp +) + +target_compile_options( GNDStk.enums.StorageOrder.test PRIVATE ${${PREFIX}_common_flags} +$<$:${${PREFIX}_strict_flags}>$<$: +${${PREFIX}_DEBUG_flags} +$<$:${${PREFIX}_coverage_flags}>> +$<$: +${${PREFIX}_RELEASE_flags} +$<$:${${PREFIX}_link_time_optimization_flags}> +$<$:${${PREFIX}_nonportable_optimization_flags}>> + +${CXX_appended_flags} ${GNDStk_appended_flags} ) +target_link_libraries( GNDStk.enums.StorageOrder.test PUBLIC GNDStk ) +file( GLOB resources "resources/*" ) +foreach( resource ${resources}) + file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) +endforeach() +add_test( NAME GNDStk.enums.StorageOrder COMMAND GNDStk.enums.StorageOrder.test ) diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder/test/StorageOrder.test.cpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder/test/StorageOrder.test.cpp new file mode 100644 index 000000000..a54756c76 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/enums/StorageOrder/test/StorageOrder.test.cpp @@ -0,0 +1,89 @@ + +#define CATCH_CONFIG_MAIN + +#include "catch.hpp" +#include "GNDS/v2.0/enums/StorageOrder.hpp" +using namespace GNDS::v2_0::enums; + +SCENARIO( "StorageOrder" ) { + + GIVEN( "valid storage order values and symbols" ) { + + WHEN( "enum2string is used" ) { + + THEN( "no exception is thrown and the correct string is returned" ) { + + CHECK( "row-major" == enum2string( StorageOrder::rowMajor ) ); + CHECK( "column-major" == enum2string( StorageOrder::columnMajor ) ); + } // THEN + } // WHEN + + WHEN( "string2enum is used" ) { + + THEN( "no exception is thrown when the symbol is registered" ) { + + CHECK( StorageOrder::rowMajor == + string2enum< StorageOrder >( "row-major" ) ); + CHECK( StorageOrder::columnMajor == + string2enum< StorageOrder >( "column-major" ) ); + } // THEN + + THEN( "an exception is thrown when the symbol is not registered" ) { + + CHECK_THROWS( string2enum< StorageOrder >( "unregistered" ) ); + } // THEN + } // WHEN + + WHEN( "operator<< is used" ) { + + THEN( "no exception is thrown and the symbol is written to the stream" ) { + + std::ostringstream out; + out << StorageOrder::rowMajor << ' ' << StorageOrder::columnMajor; + + CHECK( "row-major column-major" == out.str() ); + } // THEN + } // WHEN + + WHEN( "operator>> is used" ) { + + THEN( "the stream is not in fail() when the symbol is registered" ) { + + StorageOrder value; + std::istringstream in( "row-major column-major" ); + + in >> value; + CHECK( StorageOrder::rowMajor == value ); + CHECK( false == in.fail() ); + CHECK( false == in.eof() ); + + in >> value; + CHECK( StorageOrder::columnMajor == value ); + CHECK( false == in.fail() ); + CHECK( true == in.eof() ); + } // THEN + + THEN( "the stream is in fail() and the position has not changed when " + "the symbol is not registered" ) { + + StorageOrder value = StorageOrder::columnMajor; + std::istringstream in( "unregistered" ); + in >> value; + + CHECK( StorageOrder::columnMajor == value ); + CHECK( true == in.fail() ); + } // THEN + } // WHEN + + WHEN( "isStorageOrder is used" ) { + + THEN( "registered storage order values return true, " + "unregistered storage order values return false" ) { + + CHECK( true == isStorageOrder( "row-major" ) ); + CHECK( true == isStorageOrder( "column-major" ) ); + CHECK( false == isStorageOrder( "unregistered" ) ); + } // THEN + } // WHEN + } // GIVEN +} // SCENARIO diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g2d/Array.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g2d/Array.hpp new file mode 100644 index 000000000..0625836c9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g2d/Array.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_G2D_ARRAY +#define GNDS_V2_0_G2D_ARRAY + +#include "GNDS/v2.0/general/Values.hpp" + +namespace GNDS { +namespace v2_0 { +namespace g2d { + +// ----------------------------------------------------------------------------- +// g2d:: +// class Array +// ----------------------------------------------------------------------------- + +class Array : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "g2d"; } + static auto CLASS() { return "Array"; } + static auto NODENAME() { return "array"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("shape") | + std::optional{} + / Meta<>("compression") | + std::optional{} + / Meta<>("symmetry") | + + // children + --Child + ("values") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "shape", + "compression", + "symmetry", + "values" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "shape", + "compression", + "symmetry", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + shape{this}; + Field> + compression{this}; + Field> + symmetry{this}; + + // children + Field + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shape, \ + this->compression, \ + this->symmetry, \ + this->values \ + ) + + // default + Array() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Array( + const wrapper + &shape, + const wrapper> + &compression = {}, + const wrapper> + &symmetry = {}, + const wrapper + &values = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + shape(this,shape), + compression(this,compression), + symmetry(this,symmetry), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Array(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Array(const Array &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + shape(this,other.shape), + compression(this,other.compression), + symmetry(this,other.symmetry), + values(this,other.values) + { + Component::finish(other); + } + + // move + Array(Array &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + shape(this,std::move(other.shape)), + compression(this,std::move(other.compression)), + symmetry(this,std::move(other.symmetry)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Array &operator=(const Array &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + shape = other.shape; + compression = other.compression; + symmetry = other.symmetry; + values = other.values; + } + return *this; + } + + // move + Array &operator=(Array &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + shape = std::move(other.shape); + compression = std::move(other.compression); + symmetry = std::move(other.symmetry); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/g2d/Array/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Array + +} // namespace g2d +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g2d/Array/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g2d/Array/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g2d/Array/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Array.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Array.hpp new file mode 100644 index 000000000..935c1cda6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Array.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_G3D_ARRAY +#define GNDS_V2_0_G3D_ARRAY + +#include "GNDS/v2.0/g3d/Starts.hpp" +#include "GNDS/v2.0/g3d/Lengths.hpp" +#include "GNDS/v2.0/general/Values.hpp" + +namespace GNDS { +namespace v2_0 { +namespace g3d { + +// ----------------------------------------------------------------------------- +// g3d:: +// class Array +// ----------------------------------------------------------------------------- + +class Array : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "g3d"; } + static auto CLASS() { return "Array"; } + static auto NODENAME() { return "array"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("shape") | + std::optional{} + / Meta<>("compression") | + std::optional{} + / Meta<>("symmetry") | + + // children + --Child> + ("values") | "starts" | + --Child> + ("values") | "lengths" | + --Child + ("values") + [](auto &node) { return node.metadata.size() == 0; } + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "shape", + "compression", + "symmetry", + "starts", + "lengths", + "values" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "shape", + "compression", + "symmetry", + "starts", + "lengths", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + shape{this}; + Field> + compression{this}; + Field> + symmetry{this}; + + // children + Field> + starts{this}; + Field> + lengths{this}; + Field + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shape, \ + this->compression, \ + this->symmetry, \ + this->starts, \ + this->lengths, \ + this->values \ + ) + + // default + Array() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Array( + const wrapper + &shape, + const wrapper> + &compression = {}, + const wrapper> + &symmetry = {}, + const wrapper> + &starts = {}, + const wrapper> + &lengths = {}, + const wrapper + &values = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + shape(this,shape), + compression(this,compression), + symmetry(this,symmetry), + starts(this,starts), + lengths(this,lengths), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Array(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Array(const Array &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + shape(this,other.shape), + compression(this,other.compression), + symmetry(this,other.symmetry), + starts(this,other.starts), + lengths(this,other.lengths), + values(this,other.values) + { + Component::finish(other); + } + + // move + Array(Array &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + shape(this,std::move(other.shape)), + compression(this,std::move(other.compression)), + symmetry(this,std::move(other.symmetry)), + starts(this,std::move(other.starts)), + lengths(this,std::move(other.lengths)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Array &operator=(const Array &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + shape = other.shape; + compression = other.compression; + symmetry = other.symmetry; + starts = other.starts; + lengths = other.lengths; + values = other.values; + } + return *this; + } + + // move + Array &operator=(Array &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + shape = std::move(other.shape); + compression = std::move(other.compression); + symmetry = std::move(other.symmetry); + starts = std::move(other.starts); + lengths = std::move(other.lengths); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/g3d/Array/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Array + +} // namespace g3d +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Array/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Array/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Array/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Lengths.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Lengths.hpp new file mode 100644 index 000000000..2a07e1464 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Lengths.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_G3D_LENGTHS +#define GNDS_V2_0_G3D_LENGTHS + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace g3d { + +// ----------------------------------------------------------------------------- +// g3d:: +// class Lengths +// ----------------------------------------------------------------------------- + +class Lengths : + public Component, + public DataNode,false> +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "g3d"; } + static auto CLASS() { return "Lengths"; } + static auto NODENAME() { return "values"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("valueType") | + std::string{} + / Meta<>("label") | + + // data + --Child(special::self) / DataConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "valueType", + "label", + "ints" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value_type", + "label", + "ints" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using DataNode::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + valueType{this}; + Field + label{this}; + + // data + std::vector &ints = *this; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->valueType, \ + this->label, \ + static_cast(*this) \ + ) + + // default + Lengths() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Lengths( + const wrapper + &valueType, + const wrapper + &label = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + valueType(this,valueType), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Lengths(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Lengths(const std::vector &vector) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Lengths(const Lengths &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment), + valueType(this,other.valueType), + label(this,other.label) + { + Component::finish(other); + } + + // move + Lengths(Lengths &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(std::move(other)), + comment(this,std::move(other.comment)), + valueType(this,std::move(other.valueType)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Lengths &operator=(const Lengths &other) + { + if (this != &other) { + Component::operator=(other); + DataNode::operator=(other); + comment = other.comment; + valueType = other.valueType; + label = other.label; + } + return *this; + } + + // move + Lengths &operator=(Lengths &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + DataNode::operator=(std::move(other)); + comment = std::move(other.comment); + valueType = std::move(other.valueType); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/g3d/Lengths/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Lengths + +} // namespace g3d +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Lengths/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Lengths/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Lengths/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Starts.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Starts.hpp new file mode 100644 index 000000000..6ec1140a6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Starts.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_G3D_STARTS +#define GNDS_V2_0_G3D_STARTS + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace g3d { + +// ----------------------------------------------------------------------------- +// g3d:: +// class Starts +// ----------------------------------------------------------------------------- + +class Starts : + public Component, + public DataNode,false> +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "g3d"; } + static auto CLASS() { return "Starts"; } + static auto NODENAME() { return "values"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("valueType") | + std::string{} + / Meta<>("label") | + + // data + --Child(special::self) / DataConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "valueType", + "label", + "ints" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value_type", + "label", + "ints" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using DataNode::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + valueType{this}; + Field + label{this}; + + // data + std::vector &ints = *this; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->valueType, \ + this->label, \ + static_cast(*this) \ + ) + + // default + Starts() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Starts( + const wrapper + &valueType, + const wrapper + &label = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + valueType(this,valueType), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Starts(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Starts(const std::vector &vector) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Starts(const Starts &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment), + valueType(this,other.valueType), + label(this,other.label) + { + Component::finish(other); + } + + // move + Starts(Starts &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(std::move(other)), + comment(this,std::move(other.comment)), + valueType(this,std::move(other.valueType)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Starts &operator=(const Starts &other) + { + if (this != &other) { + Component::operator=(other); + DataNode::operator=(other); + comment = other.comment; + valueType = other.valueType; + label = other.label; + } + return *this; + } + + // move + Starts &operator=(Starts &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + DataNode::operator=(std::move(other)); + comment = std::move(other.comment); + valueType = std::move(other.valueType); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/g3d/Starts/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Starts + +} // namespace g3d +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Starts/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Starts/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/g3d/Starts/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Add.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Add.hpp new file mode 100644 index 000000000..ded2b5ceb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Add.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ADD +#define GNDS_V2_0_GENERAL_ADD + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Add +// ----------------------------------------------------------------------------- + +class Add : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Add"; } + static auto NODENAME() { return "add"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("href") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "href" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Add() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Add( + const wrapper + &href + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Add(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Add(const Add &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Add(Add &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Add &operator=(const Add &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + href = other.href; + } + return *this; + } + + // move + Add &operator=(Add &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Add/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Add + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Add/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Add/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Add/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Alias.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Alias.hpp new file mode 100644 index 000000000..6e273358b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Alias.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ALIAS +#define GNDS_V2_0_GENERAL_ALIAS + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Alias +// ----------------------------------------------------------------------------- + +class Alias : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Alias"; } + static auto NODENAME() { return "alias"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("id") | + std::optional{} + / Meta<>("pid") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "id", + "pid" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "id", + "pid" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + id{this}; + Field> + pid{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->pid \ + ) + + // default + Alias() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Alias( + const wrapper> + &id, + const wrapper> + &pid = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + id(this,id), + pid(this,pid) + { + Component::finish(); + } + + // from node + explicit Alias(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Alias(const Alias &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + pid(this,other.pid) + { + Component::finish(other); + } + + // move + Alias(Alias &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + pid(this,std::move(other.pid)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Alias &operator=(const Alias &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + id = other.id; + pid = other.pid; + } + return *this; + } + + // move + Alias &operator=(Alias &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + id = std::move(other.id); + pid = std::move(other.pid); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Alias/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Alias + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Alias/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Alias/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Alias/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Aliases.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Aliases.hpp new file mode 100644 index 000000000..180823dd3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Aliases.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ALIASES +#define GNDS_V2_0_GENERAL_ALIASES + +#include "GNDS/v2.0/general/Alias.hpp" +#include "GNDS/v2.0/general/MetaStable.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Aliases +// ----------------------------------------------------------------------------- + +class Aliases : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Aliases"; } + static auto NODENAME() { return "aliases"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child> + ("alias") | + ++Child> + ("metaStable") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "alias", + "metaStable" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "alias", + "meta_stable" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field>> + alias{this}; + Field>> + metaStable{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->alias, \ + this->metaStable \ + ) + + // default + Aliases() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Aliases( + const wrapper>> + &alias, + const wrapper>> + &metaStable = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + alias(this,alias), + metaStable(this,metaStable) + { + Component::finish(); + } + + // from node + explicit Aliases(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Aliases(const Aliases &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + alias(this,other.alias), + metaStable(this,other.metaStable) + { + Component::finish(other); + } + + // move + Aliases(Aliases &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + alias(this,std::move(other.alias)), + metaStable(this,std::move(other.metaStable)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Aliases &operator=(const Aliases &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + alias = other.alias; + metaStable = other.metaStable; + } + return *this; + } + + // move + Aliases &operator=(Aliases &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + alias = std::move(other.alias); + metaStable = std::move(other.metaStable); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Aliases/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Aliases + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Aliases/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Aliases/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Aliases/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Angular.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Angular.hpp new file mode 100644 index 000000000..7a90b5d3f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Angular.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ANGULAR +#define GNDS_V2_0_GENERAL_ANGULAR + +#include "GNDS/v2.0/general/Isotropic2d.hpp" +#include "GNDS/v2.0/general/XYs2d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Angular +// ----------------------------------------------------------------------------- + +class Angular : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Angular"; } + static auto NODENAME() { return "angular"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("isotropic2d") | + --Child> + ("XYs2d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "isotropic2d", + "XYs2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "isotropic2d", + "xys2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + isotropic2d{this}; + Field> + XYs2d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->isotropic2d, \ + this->XYs2d \ + ) + + // default + Angular() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Angular( + const wrapper> + &isotropic2d, + const wrapper> + &XYs2d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + isotropic2d(this,isotropic2d), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit Angular(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Angular(const Angular &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + isotropic2d(this,other.isotropic2d), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + Angular(Angular &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + isotropic2d(this,std::move(other.isotropic2d)), + XYs2d(this,std::move(other.XYs2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Angular &operator=(const Angular &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + isotropic2d = other.isotropic2d; + XYs2d = other.XYs2d; + } + return *this; + } + + // move + Angular &operator=(Angular &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + isotropic2d = std::move(other.isotropic2d); + XYs2d = std::move(other.XYs2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Angular/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Angular + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Angular/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Angular/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Angular/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularEnergy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularEnergy.hpp new file mode 100644 index 000000000..ba03cb38e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularEnergy.hpp @@ -0,0 +1,217 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ANGULARENERGY +#define GNDS_V2_0_GENERAL_ANGULARENERGY + +#include "GNDS/v2.0/general/XYs3d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class AngularEnergy +// ----------------------------------------------------------------------------- + +class AngularEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "AngularEnergy"; } + static auto NODENAME() { return "angularEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("productFrame") | + + // children + --Child + ("XYs3d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "productFrame", + "XYs3d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "product_frame", + "xys3d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + productFrame{this}; + + // children + Field + XYs3d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs3d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs3d(),function2ds); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->XYs3d \ + ) + + // default + AngularEnergy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AngularEnergy( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper + &XYs3d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + XYs3d(this,XYs3d) + { + Component::finish(); + } + + // from node + explicit AngularEnergy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AngularEnergy(const AngularEnergy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + XYs3d(this,other.XYs3d) + { + Component::finish(other); + } + + // move + AngularEnergy(AngularEnergy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)), + XYs3d(this,std::move(other.XYs3d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AngularEnergy &operator=(const AngularEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + XYs3d = other.XYs3d; + } + return *this; + } + + // move + AngularEnergy &operator=(AngularEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + productFrame = std::move(other.productFrame); + XYs3d = std::move(other.XYs3d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/AngularEnergy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class AngularEnergy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularEnergy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularTwoBody.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularTwoBody.hpp new file mode 100644 index 000000000..014026ac4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularTwoBody.hpp @@ -0,0 +1,256 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ANGULARTWOBODY +#define GNDS_V2_0_GENERAL_ANGULARTWOBODY + +#include "GNDS/v2.0/general/XYs2d.hpp" +#include "GNDS/v2.0/general/Regions2d.hpp" +#include "GNDS/v2.0/general/Recoil.hpp" +#include "GNDS/v2.0/general/Isotropic2d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class AngularTwoBody +// ----------------------------------------------------------------------------- + +class AngularTwoBody : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "AngularTwoBody"; } + static auto NODENAME() { return "angularTwoBody"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("productFrame") | + + // children + --Child> + ("XYs2d") | + --Child> + ("regions2d") | + --Child> + ("recoil") | + --Child> + ("isotropic2d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "productFrame", + "XYs2d", + "regions2d", + "recoil", + "isotropic2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "product_frame", + "xys2d", + "regions2d", + "recoil", + "isotropic2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + productFrame{this}; + + // children + Field> + XYs2d{this}; + Field> + regions2d{this}; + Field> + recoil{this}; + Field> + isotropic2d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->XYs2d, \ + this->regions2d, \ + this->recoil, \ + this->isotropic2d \ + ) + + // default + AngularTwoBody() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AngularTwoBody( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper> + &XYs2d = {}, + const wrapper> + ®ions2d = {}, + const wrapper> + &recoil = {}, + const wrapper> + &isotropic2d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + XYs2d(this,XYs2d), + regions2d(this,regions2d), + recoil(this,recoil), + isotropic2d(this,isotropic2d) + { + Component::finish(); + } + + // from node + explicit AngularTwoBody(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AngularTwoBody(const AngularTwoBody &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + XYs2d(this,other.XYs2d), + regions2d(this,other.regions2d), + recoil(this,other.recoil), + isotropic2d(this,other.isotropic2d) + { + Component::finish(other); + } + + // move + AngularTwoBody(AngularTwoBody &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)), + XYs2d(this,std::move(other.XYs2d)), + regions2d(this,std::move(other.regions2d)), + recoil(this,std::move(other.recoil)), + isotropic2d(this,std::move(other.isotropic2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AngularTwoBody &operator=(const AngularTwoBody &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + XYs2d = other.XYs2d; + regions2d = other.regions2d; + recoil = other.recoil; + isotropic2d = other.isotropic2d; + } + return *this; + } + + // move + AngularTwoBody &operator=(AngularTwoBody &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + productFrame = std::move(other.productFrame); + XYs2d = std::move(other.XYs2d); + regions2d = std::move(other.regions2d); + recoil = std::move(other.recoil); + isotropic2d = std::move(other.isotropic2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/AngularTwoBody/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class AngularTwoBody + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularTwoBody/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularTwoBody/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AngularTwoBody/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ApplicationData.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ApplicationData.hpp new file mode 100644 index 000000000..dc4db4312 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ApplicationData.hpp @@ -0,0 +1,185 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_APPLICATIONDATA +#define GNDS_V2_0_GENERAL_APPLICATIONDATA + +#include "GNDS/v2.0/general/Institution.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ApplicationData +// ----------------------------------------------------------------------------- + +class ApplicationData : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ApplicationData"; } + static auto NODENAME() { return "applicationData"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("institution") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "institution" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "institution" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + institution{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(institution(),ENDFconversionFlags); + NJOY_GNDSTK_SHORTCUT(institution().ENDFconversionFlags(),conversion); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->institution \ + ) + + // default + ApplicationData() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ApplicationData( + const wrapper + &institution + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + institution(this,institution) + { + Component::finish(); + } + + // from node + explicit ApplicationData(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ApplicationData(const ApplicationData &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + institution(this,other.institution) + { + Component::finish(other); + } + + // move + ApplicationData(ApplicationData &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + institution(this,std::move(other.institution)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ApplicationData &operator=(const ApplicationData &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + institution = other.institution; + } + return *this; + } + + // move + ApplicationData &operator=(ApplicationData &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + institution = std::move(other.institution); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ApplicationData/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ApplicationData + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ApplicationData/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ApplicationData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ApplicationData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Array.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Array.hpp new file mode 100644 index 000000000..672a4457c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Array.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ARRAY +#define GNDS_V2_0_GENERAL_ARRAY + +#include "GNDS/v2.0/general/Values.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Array +// ----------------------------------------------------------------------------- + +class Array : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Array"; } + static auto NODENAME() { return "array"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("shape") | + std::optional{} + / Meta<>("compression") | + + // children + --Child + ("values") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "shape", + "compression", + "values" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "shape", + "compression", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + shape{this}; + Field> + compression{this}; + + // children + Field + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shape, \ + this->compression, \ + this->values \ + ) + + // default + Array() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Array( + const wrapper + &shape, + const wrapper> + &compression = {}, + const wrapper + &values = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + shape(this,shape), + compression(this,compression), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Array(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Array(const Array &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + shape(this,other.shape), + compression(this,other.compression), + values(this,other.values) + { + Component::finish(other); + } + + // move + Array(Array &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + shape(this,std::move(other.shape)), + compression(this,std::move(other.compression)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Array &operator=(const Array &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + shape = other.shape; + compression = other.compression; + values = other.values; + } + return *this; + } + + // move + Array &operator=(Array &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + shape = std::move(other.shape); + compression = std::move(other.compression); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Array/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Array + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Array/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Array/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Array/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Atomic.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Atomic.hpp new file mode 100644 index 000000000..585e1d412 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Atomic.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ATOMIC +#define GNDS_V2_0_GENERAL_ATOMIC + +#include "GNDS/v2.0/general/Configurations.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Atomic +// ----------------------------------------------------------------------------- + +class Atomic : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Atomic"; } + static auto NODENAME() { return "atomic"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("configurations") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "configurations" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "configurations" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + configurations{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(configurations(),configuration); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->configurations \ + ) + + // default + Atomic() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Atomic( + const wrapper + &configurations + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + configurations(this,configurations) + { + Component::finish(); + } + + // from node + explicit Atomic(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Atomic(const Atomic &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + configurations(this,other.configurations) + { + Component::finish(other); + } + + // move + Atomic(Atomic &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + configurations(this,std::move(other.configurations)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Atomic &operator=(const Atomic &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + configurations = other.configurations; + } + return *this; + } + + // move + Atomic &operator=(Atomic &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + configurations = std::move(other.configurations); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Atomic/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Atomic + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Atomic/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Atomic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Atomic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Author.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Author.hpp new file mode 100644 index 000000000..81bd000a1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Author.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_AUTHOR +#define GNDS_V2_0_GENERAL_AUTHOR + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Author +// ----------------------------------------------------------------------------- + +class Author : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Author"; } + static auto NODENAME() { return "author"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("name") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "name" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "name" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + name{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name \ + ) + + // default + Author() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Author( + const wrapper + &name + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + name(this,name) + { + Component::finish(); + } + + // from node + explicit Author(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Author(const Author &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name) + { + Component::finish(other); + } + + // move + Author(Author &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + name(this,std::move(other.name)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Author &operator=(const Author &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + name = other.name; + } + return *this; + } + + // move + Author &operator=(Author &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + name = std::move(other.name); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Author/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Author + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Author/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Author/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Author/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Authors.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Authors.hpp new file mode 100644 index 000000000..8927d40ca --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Authors.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_AUTHORS +#define GNDS_V2_0_GENERAL_AUTHORS + +#include "GNDS/v2.0/general/Author.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Authors +// ----------------------------------------------------------------------------- + +class Authors : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Authors"; } + static auto NODENAME() { return "authors"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("author") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "author" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "author" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + author{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->author \ + ) + + // default + Authors() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Authors( + const wrapper> + &author + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + author(this,author) + { + Component::finish(); + } + + // from node + explicit Authors(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Authors(const Authors &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + author(this,other.author) + { + Component::finish(other); + } + + // move + Authors(Authors &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + author(this,std::move(other.author)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Authors &operator=(const Authors &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + author = other.author; + } + return *this; + } + + // move + Authors &operator=(Authors &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + author = std::move(other.author); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Authors/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Authors + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Authors/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Authors/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Authors/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergies.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergies.hpp new file mode 100644 index 000000000..9eb50dcdd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergies.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_AVERAGEENERGIES +#define GNDS_V2_0_GENERAL_AVERAGEENERGIES + +#include "GNDS/v2.0/general/AverageEnergy.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class AverageEnergies +// ----------------------------------------------------------------------------- + +class AverageEnergies : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "AverageEnergies"; } + static auto NODENAME() { return "averageEnergies"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("averageEnergy") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "averageEnergy" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "average_energy" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + averageEnergy{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->averageEnergy \ + ) + + // default + AverageEnergies() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageEnergies( + const wrapper> + &averageEnergy + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + averageEnergy(this,averageEnergy) + { + Component::finish(); + } + + // from node + explicit AverageEnergies(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageEnergies(const AverageEnergies &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + averageEnergy(this,other.averageEnergy) + { + Component::finish(other); + } + + // move + AverageEnergies(AverageEnergies &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + averageEnergy(this,std::move(other.averageEnergy)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AverageEnergies &operator=(const AverageEnergies &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + averageEnergy = other.averageEnergy; + } + return *this; + } + + // move + AverageEnergies &operator=(AverageEnergies &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + averageEnergy = std::move(other.averageEnergy); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/AverageEnergies/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class AverageEnergies + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergies/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergies/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergies/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergy.hpp new file mode 100644 index 000000000..752be23a4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergy.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_AVERAGEENERGY +#define GNDS_V2_0_GENERAL_AVERAGEENERGY + +#include "GNDS/v2.0/general/Uncertainty.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class AverageEnergy +// ----------------------------------------------------------------------------- + +class AverageEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "AverageEnergy"; } + static auto NODENAME() { return "averageEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + double{} + / Meta<>("value") | + std::string{} + / Meta<>("unit") | + + // children + --Child> + ("uncertainty") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "unit", + "uncertainty" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "unit", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + value{this}; + Field + unit{this}; + + // children + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit, \ + this->uncertainty \ + ) + + // default + AverageEnergy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageEnergy( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &unit = {}, + const wrapper> + &uncertainty = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit AverageEnergy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageEnergy(const AverageEnergy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + unit(this,other.unit), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + AverageEnergy(AverageEnergy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AverageEnergy &operator=(const AverageEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + unit = other.unit; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + AverageEnergy &operator=(AverageEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + value = std::move(other.value); + unit = std::move(other.unit); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/AverageEnergy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class AverageEnergy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageParameterCovariance.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageParameterCovariance.hpp new file mode 100644 index 000000000..ea7394b88 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageParameterCovariance.hpp @@ -0,0 +1,248 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_AVERAGEPARAMETERCOVARIANCE +#define GNDS_V2_0_GENERAL_AVERAGEPARAMETERCOVARIANCE + +#include "GNDS/v2.0/general/CovarianceMatrix.hpp" +#include "GNDS/v2.0/general/RowData.hpp" +#include "GNDS/v2.0/general/ColumnData.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class AverageParameterCovariance +// ----------------------------------------------------------------------------- + +class AverageParameterCovariance : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "AverageParameterCovariance"; } + static auto NODENAME() { return "averageParameterCovariance"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::optional{} + / Meta<>("crossTerm") | + + // children + --Child + ("covarianceMatrix") | + --Child + ("rowData") | + --Child> + ("columnData") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "crossTerm", + "covarianceMatrix", + "rowData", + "columnData" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "cross_term", + "covariance_matrix", + "row_data", + "column_data" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field> + crossTerm{this}; + + // children + Field + covarianceMatrix{this}; + Field + rowData{this}; + Field> + columnData{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(covarianceMatrix().gridded2d(),array); + NJOY_GNDSTK_SHORTCUT(covarianceMatrix().gridded2d(),axes); + NJOY_GNDSTK_SHORTCUT(covarianceMatrix(),gridded2d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->crossTerm, \ + this->covarianceMatrix, \ + this->rowData, \ + this->columnData \ + ) + + // default + AverageParameterCovariance() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageParameterCovariance( + const wrapper + &label, + const wrapper> + &crossTerm = {}, + const wrapper + &covarianceMatrix = {}, + const wrapper + &rowData = {}, + const wrapper> + &columnData = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + crossTerm(this,crossTerm), + covarianceMatrix(this,covarianceMatrix), + rowData(this,rowData), + columnData(this,columnData) + { + Component::finish(); + } + + // from node + explicit AverageParameterCovariance(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageParameterCovariance(const AverageParameterCovariance &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + crossTerm(this,other.crossTerm), + covarianceMatrix(this,other.covarianceMatrix), + rowData(this,other.rowData), + columnData(this,other.columnData) + { + Component::finish(other); + } + + // move + AverageParameterCovariance(AverageParameterCovariance &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + crossTerm(this,std::move(other.crossTerm)), + covarianceMatrix(this,std::move(other.covarianceMatrix)), + rowData(this,std::move(other.rowData)), + columnData(this,std::move(other.columnData)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AverageParameterCovariance &operator=(const AverageParameterCovariance &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + crossTerm = other.crossTerm; + covarianceMatrix = other.covarianceMatrix; + rowData = other.rowData; + columnData = other.columnData; + } + return *this; + } + + // move + AverageParameterCovariance &operator=(AverageParameterCovariance &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + crossTerm = std::move(other.crossTerm); + covarianceMatrix = std::move(other.covarianceMatrix); + rowData = std::move(other.rowData); + columnData = std::move(other.columnData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/AverageParameterCovariance/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class AverageParameterCovariance + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageParameterCovariance/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageParameterCovariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageParameterCovariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageProductEnergy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageProductEnergy.hpp new file mode 100644 index 000000000..0dfc64897 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageProductEnergy.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_AVERAGEPRODUCTENERGY +#define GNDS_V2_0_GENERAL_AVERAGEPRODUCTENERGY + +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class AverageProductEnergy +// ----------------------------------------------------------------------------- + +class AverageProductEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "AverageProductEnergy"; } + static auto NODENAME() { return "averageProductEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + AverageProductEnergy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit AverageProductEnergy( + const wrapper + &XYs1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit AverageProductEnergy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + AverageProductEnergy(const AverageProductEnergy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + AverageProductEnergy(AverageProductEnergy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + AverageProductEnergy &operator=(const AverageProductEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + AverageProductEnergy &operator=(AverageProductEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/AverageProductEnergy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class AverageProductEnergy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageProductEnergy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageProductEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/AverageProductEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axes.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axes.hpp new file mode 100644 index 000000000..513bf221e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axes.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_AXES +#define GNDS_V2_0_GENERAL_AXES + +#include "GNDS/v2.0/general/Axis.hpp" +#include "GNDS/v2.0/general/Grid.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Axes +// ----------------------------------------------------------------------------- + +class Axes : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Axes"; } + static auto NODENAME() { return "axes"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("axis") | + ++Child> + ("grid") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "axis", + "grid" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "axis", + "grid" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + axis{this}; + Field>> + grid{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->axis, \ + this->grid \ + ) + + // default + Axes() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Axes( + const wrapper> + &axis, + const wrapper>> + &grid = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + axis(this,axis), + grid(this,grid) + { + Component::finish(); + } + + // from node + explicit Axes(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Axes(const Axes &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + axis(this,other.axis), + grid(this,other.grid) + { + Component::finish(other); + } + + // move + Axes(Axes &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + axis(this,std::move(other.axis)), + grid(this,std::move(other.grid)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Axes &operator=(const Axes &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + axis = other.axis; + grid = other.grid; + } + return *this; + } + + // move + Axes &operator=(Axes &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + axis = std::move(other.axis); + grid = std::move(other.grid); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Axes/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Axes + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axes/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axis.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axis.hpp new file mode 100644 index 000000000..7b5b8415d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axis.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_AXIS +#define GNDS_V2_0_GENERAL_AXIS + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Axis +// ----------------------------------------------------------------------------- + +class Axis : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Axis"; } + static auto NODENAME() { return "axis"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + int{} + / Meta<>("index") | + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "index", + "label", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "index", + "label", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + index{this}; + Field + label{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->label, \ + this->unit \ + ) + + // default + Axis() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Axis( + const wrapper + &index, + const wrapper + &label = {}, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + index(this,index), + label(this,label), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Axis(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Axis(const Axis &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + index(this,other.index), + label(this,other.label), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + Axis(Axis &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + index(this,std::move(other.index)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Axis &operator=(const Axis &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + index = other.index; + label = other.label; + unit = other.unit; + } + return *this; + } + + // move + Axis &operator=(Axis &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + index = std::move(other.index); + label = std::move(other.label); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Axis/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Axis + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axis/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axis/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Axis/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Background.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Background.hpp new file mode 100644 index 000000000..962eeae57 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Background.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_BACKGROUND +#define GNDS_V2_0_GENERAL_BACKGROUND + +#include "GNDS/v2.0/general/ResolvedRegion.hpp" +#include "GNDS/v2.0/general/FastRegion.hpp" +#include "GNDS/v2.0/general/UnresolvedRegion.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Background +// ----------------------------------------------------------------------------- + +class Background : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Background"; } + static auto NODENAME() { return "background"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("resolvedRegion") | + --Child + ("fastRegion") | + --Child> + ("unresolvedRegion") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "resolvedRegion", + "fastRegion", + "unresolvedRegion" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "resolved_region", + "fast_region", + "unresolved_region" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + resolvedRegion{this}; + Field + fastRegion{this}; + Field> + unresolvedRegion{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->resolvedRegion, \ + this->fastRegion, \ + this->unresolvedRegion \ + ) + + // default + Background() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Background( + const wrapper> + &resolvedRegion, + const wrapper + &fastRegion = {}, + const wrapper> + &unresolvedRegion = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + resolvedRegion(this,resolvedRegion), + fastRegion(this,fastRegion), + unresolvedRegion(this,unresolvedRegion) + { + Component::finish(); + } + + // from node + explicit Background(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Background(const Background &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + resolvedRegion(this,other.resolvedRegion), + fastRegion(this,other.fastRegion), + unresolvedRegion(this,other.unresolvedRegion) + { + Component::finish(other); + } + + // move + Background(Background &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + resolvedRegion(this,std::move(other.resolvedRegion)), + fastRegion(this,std::move(other.fastRegion)), + unresolvedRegion(this,std::move(other.unresolvedRegion)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Background &operator=(const Background &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + resolvedRegion = other.resolvedRegion; + fastRegion = other.fastRegion; + unresolvedRegion = other.unresolvedRegion; + } + return *this; + } + + // move + Background &operator=(Background &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + resolvedRegion = std::move(other.resolvedRegion); + fastRegion = std::move(other.fastRegion); + unresolvedRegion = std::move(other.unresolvedRegion); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Background/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Background + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Background/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Background/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Background/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryon.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryon.hpp new file mode 100644 index 000000000..f33c41050 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryon.hpp @@ -0,0 +1,278 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_BARYON +#define GNDS_V2_0_GENERAL_BARYON + +#include "GNDS/v2.0/general/Mass.hpp" +#include "GNDS/v2.0/general/Spin.hpp" +#include "GNDS/v2.0/general/Parity.hpp" +#include "GNDS/v2.0/general/Charge.hpp" +#include "GNDS/v2.0/general/Halflife.hpp" +#include "GNDS/v2.0/general/DecayData.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Baryon +// ----------------------------------------------------------------------------- + +class Baryon : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Baryon"; } + static auto NODENAME() { return "baryon"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("id") | + + // children + --Child + ("mass") | + --Child + ("spin") | + --Child + ("parity") | + --Child + ("charge") | + --Child + ("halflife") | + --Child> + ("decayData") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "id", + "mass", + "spin", + "parity", + "charge", + "halflife", + "decayData" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "id", + "mass", + "spin", + "parity", + "charge", + "halflife", + "decay_data" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + id{this}; + + // children + Field + mass{this}; + Field + spin{this}; + Field + parity{this}; + Field + charge{this}; + Field + halflife{this}; + Field> + decayData{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(spin(),fraction); + NJOY_GNDSTK_SHORTCUT(halflife(),string); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->mass, \ + this->spin, \ + this->parity, \ + this->charge, \ + this->halflife, \ + this->decayData \ + ) + + // default + Baryon() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Baryon( + const wrapper + &id, + const wrapper + &mass = {}, + const wrapper + &spin = {}, + const wrapper + &parity = {}, + const wrapper + &charge = {}, + const wrapper + &halflife = {}, + const wrapper> + &decayData = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + id(this,id), + mass(this,mass), + spin(this,spin), + parity(this,parity), + charge(this,charge), + halflife(this,halflife), + decayData(this,decayData) + { + Component::finish(); + } + + // from node + explicit Baryon(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Baryon(const Baryon &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + mass(this,other.mass), + spin(this,other.spin), + parity(this,other.parity), + charge(this,other.charge), + halflife(this,other.halflife), + decayData(this,other.decayData) + { + Component::finish(other); + } + + // move + Baryon(Baryon &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + mass(this,std::move(other.mass)), + spin(this,std::move(other.spin)), + parity(this,std::move(other.parity)), + charge(this,std::move(other.charge)), + halflife(this,std::move(other.halflife)), + decayData(this,std::move(other.decayData)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Baryon &operator=(const Baryon &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + id = other.id; + mass = other.mass; + spin = other.spin; + parity = other.parity; + charge = other.charge; + halflife = other.halflife; + decayData = other.decayData; + } + return *this; + } + + // move + Baryon &operator=(Baryon &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + id = std::move(other.id); + mass = std::move(other.mass); + spin = std::move(other.spin); + parity = std::move(other.parity); + charge = std::move(other.charge); + halflife = std::move(other.halflife); + decayData = std::move(other.decayData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Baryon/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Baryon + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryon/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryon/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryon/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryons.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryons.hpp new file mode 100644 index 000000000..2f1ec12de --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_BARYONS +#define GNDS_V2_0_GENERAL_BARYONS + +#include "GNDS/v2.0/general/Baryon.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Baryons +// ----------------------------------------------------------------------------- + +class Baryons : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Baryons"; } + static auto NODENAME() { return "baryons"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("baryon") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "baryon" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "baryon" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + baryon{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->baryon \ + ) + + // default + Baryons() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Baryons( + const wrapper> + &baryon + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + baryon(this,baryon) + { + Component::finish(); + } + + // from node + explicit Baryons(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Baryons(const Baryons &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + baryon(this,other.baryon) + { + Component::finish(other); + } + + // move + Baryons(Baryons &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + baryon(this,std::move(other.baryon)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Baryons &operator=(const Baryons &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + baryon = other.baryon; + } + return *this; + } + + // move + Baryons &operator=(Baryons &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + baryon = std::move(other.baryon); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Baryons/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Baryons + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryons/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Baryons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BindingEnergy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BindingEnergy.hpp new file mode 100644 index 000000000..93b02710e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BindingEnergy.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_BINDINGENERGY +#define GNDS_V2_0_GENERAL_BINDINGENERGY + +#include "GNDS/v2.0/general/Double.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class BindingEnergy +// ----------------------------------------------------------------------------- + +class BindingEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "BindingEnergy"; } + static auto NODENAME() { return "bindingEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("double") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "Double" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + Double{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(Double(),uncertainty); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + BindingEnergy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit BindingEnergy( + const wrapper + &Double + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit BindingEnergy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BindingEnergy(const BindingEnergy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + BindingEnergy(BindingEnergy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + BindingEnergy &operator=(const BindingEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + Double = other.Double; + } + return *this; + } + + // move + BindingEnergy &operator=(BindingEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/BindingEnergy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class BindingEnergy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BindingEnergy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BindingEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BindingEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Body.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Body.hpp new file mode 100644 index 000000000..8fc3648a6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Body.hpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_BODY +#define GNDS_V2_0_GENERAL_BODY + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Body +// ----------------------------------------------------------------------------- + +class Body : + public Component, + public DataNode +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Body"; } + static auto NODENAME() { return "body"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // data + --Child(special::self) / DataConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "string" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "string" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using DataNode::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // data + std::string &string = *this; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + static_cast(*this) \ + ) + + // default + Body() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Body(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Body(const Body &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Body(Body &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(std::move(other)), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Body &operator=(const Body &other) + { + if (this != &other) { + Component::operator=(other); + DataNode::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + Body &operator=(Body &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + DataNode::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Body/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Body + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Body/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Body/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Body/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BoundAtomCrossSection.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BoundAtomCrossSection.hpp new file mode 100644 index 000000000..2e82b188a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BoundAtomCrossSection.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_BOUNDATOMCROSSSECTION +#define GNDS_V2_0_GENERAL_BOUNDATOMCROSSSECTION + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class BoundAtomCrossSection +// ----------------------------------------------------------------------------- + +class BoundAtomCrossSection : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "BoundAtomCrossSection"; } + static auto NODENAME() { return "boundAtomCrossSection"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + BoundAtomCrossSection() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit BoundAtomCrossSection( + const wrapper + &value, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit BoundAtomCrossSection(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BoundAtomCrossSection(const BoundAtomCrossSection &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + BoundAtomCrossSection(BoundAtomCrossSection &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + BoundAtomCrossSection &operator=(const BoundAtomCrossSection &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + unit = other.unit; + } + return *this; + } + + // move + BoundAtomCrossSection &operator=(BoundAtomCrossSection &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/BoundAtomCrossSection/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class BoundAtomCrossSection + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BoundAtomCrossSection/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BoundAtomCrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BoundAtomCrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching1d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching1d.hpp new file mode 100644 index 000000000..0df330cf4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching1d.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_BRANCHING1D +#define GNDS_V2_0_GENERAL_BRANCHING1D + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Branching1d +// ----------------------------------------------------------------------------- + +class Branching1d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Branching1d"; } + static auto NODENAME() { return "branching1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label \ + ) + + // default + Branching1d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Branching1d( + const wrapper + &label + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label) + { + Component::finish(); + } + + // from node + explicit Branching1d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Branching1d(const Branching1d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label) + { + Component::finish(other); + } + + // move + Branching1d(Branching1d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Branching1d &operator=(const Branching1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + } + return *this; + } + + // move + Branching1d &operator=(Branching1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Branching1d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Branching1d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching1d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching3d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching3d.hpp new file mode 100644 index 000000000..37c641efa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching3d.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_BRANCHING3D +#define GNDS_V2_0_GENERAL_BRANCHING3D + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Branching3d +// ----------------------------------------------------------------------------- + +class Branching3d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Branching3d"; } + static auto NODENAME() { return "branching3d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("productFrame") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "productFrame" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "product_frame" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + productFrame{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame \ + ) + + // default + Branching3d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Branching3d( + const wrapper + &label, + const wrapper + &productFrame = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame) + { + Component::finish(); + } + + // from node + explicit Branching3d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Branching3d(const Branching3d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame) + { + Component::finish(other); + } + + // move + Branching3d(Branching3d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Branching3d &operator=(const Branching3d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + } + return *this; + } + + // move + Branching3d &operator=(Branching3d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + productFrame = std::move(other.productFrame); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Branching3d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Branching3d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching3d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Branching3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BreitWigner.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BreitWigner.hpp new file mode 100644 index 000000000..cb0d88ef9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BreitWigner.hpp @@ -0,0 +1,262 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_BREITWIGNER +#define GNDS_V2_0_GENERAL_BREITWIGNER + +#include "GNDS/v2.0/general/ResonanceParameters.hpp" +#include "GNDS/v2.0/top/PoPs.hpp" +#include "GNDS/v2.0/general/ScatteringRadius.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class BreitWigner +// ----------------------------------------------------------------------------- + +class BreitWigner : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "BreitWigner"; } + static auto NODENAME() { return "BreitWigner"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("approximation") | + std::optional{} + / Meta<>("calculateChannelRadius") | + + // children + --Child + ("resonanceParameters") | + --Child> + ("PoPs") | + --Child> + ("scatteringRadius") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "approximation", + "calculateChannelRadius", + "resonanceParameters", + "PoPs", + "scatteringRadius" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "approximation", + "calculate_channel_radius", + "resonance_parameters", + "po_ps", + "scattering_radius" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + approximation{this}; + Field> + calculateChannelRadius{this}; + + // children + Field + resonanceParameters{this}; + Field> + PoPs{this}; + Field> + scatteringRadius{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(resonanceParameters().table(),columnHeaders); + NJOY_GNDSTK_SHORTCUT(resonanceParameters().table(),data); + NJOY_GNDSTK_SHORTCUT(resonanceParameters(),table); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->approximation, \ + this->calculateChannelRadius, \ + this->resonanceParameters, \ + this->PoPs, \ + this->scatteringRadius \ + ) + + // default + BreitWigner() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit BreitWigner( + const wrapper + &label, + const wrapper + &approximation = {}, + const wrapper> + &calculateChannelRadius = {}, + const wrapper + &resonanceParameters = {}, + const wrapper> + &PoPs = {}, + const wrapper> + &scatteringRadius = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + approximation(this,approximation), + calculateChannelRadius(this,calculateChannelRadius), + resonanceParameters(this,resonanceParameters), + PoPs(this,PoPs), + scatteringRadius(this,scatteringRadius) + { + Component::finish(); + } + + // from node + explicit BreitWigner(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + BreitWigner(const BreitWigner &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + approximation(this,other.approximation), + calculateChannelRadius(this,other.calculateChannelRadius), + resonanceParameters(this,other.resonanceParameters), + PoPs(this,other.PoPs), + scatteringRadius(this,other.scatteringRadius) + { + Component::finish(other); + } + + // move + BreitWigner(BreitWigner &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + approximation(this,std::move(other.approximation)), + calculateChannelRadius(this,std::move(other.calculateChannelRadius)), + resonanceParameters(this,std::move(other.resonanceParameters)), + PoPs(this,std::move(other.PoPs)), + scatteringRadius(this,std::move(other.scatteringRadius)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + BreitWigner &operator=(const BreitWigner &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + approximation = other.approximation; + calculateChannelRadius = other.calculateChannelRadius; + resonanceParameters = other.resonanceParameters; + PoPs = other.PoPs; + scatteringRadius = other.scatteringRadius; + } + return *this; + } + + // move + BreitWigner &operator=(BreitWigner &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + approximation = std::move(other.approximation); + calculateChannelRadius = std::move(other.calculateChannelRadius); + resonanceParameters = std::move(other.resonanceParameters); + PoPs = std::move(other.PoPs); + scatteringRadius = std::move(other.scatteringRadius); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/BreitWigner/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class BreitWigner + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BreitWigner/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BreitWigner/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/BreitWigner/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channel.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channel.hpp new file mode 100644 index 000000000..24790ba3d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channel.hpp @@ -0,0 +1,268 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CHANNEL +#define GNDS_V2_0_GENERAL_CHANNEL + +#include "GNDS/v2.0/general/ScatteringRadius.hpp" +#include "GNDS/v2.0/general/HardSphereRadius.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Channel +// ----------------------------------------------------------------------------- + +class Channel : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Channel"; } + static auto NODENAME() { return "channel"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("resonanceReaction") | + int{} + / Meta<>("L") | + int{} + / Meta<>("channelSpin") | + int{} + / Meta<>("columnIndex") | + + // children + --Child> + ("scatteringRadius") | + --Child> + ("hardSphereRadius") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "resonanceReaction", + "L", + "channelSpin", + "columnIndex", + "scatteringRadius", + "hardSphereRadius" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "resonance_reaction", + "l", + "channel_spin", + "column_index", + "scattering_radius", + "hard_sphere_radius" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + resonanceReaction{this}; + Field + L{this}; + Field + channelSpin{this}; + Field + columnIndex{this}; + + // children + Field> + scatteringRadius{this}; + Field> + hardSphereRadius{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->resonanceReaction, \ + this->L, \ + this->channelSpin, \ + this->columnIndex, \ + this->scatteringRadius, \ + this->hardSphereRadius \ + ) + + // default + Channel() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Channel( + const wrapper + &label, + const wrapper + &resonanceReaction = {}, + const wrapper + &L = {}, + const wrapper + &channelSpin = {}, + const wrapper + &columnIndex = {}, + const wrapper> + &scatteringRadius = {}, + const wrapper> + &hardSphereRadius = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + resonanceReaction(this,resonanceReaction), + L(this,L), + channelSpin(this,channelSpin), + columnIndex(this,columnIndex), + scatteringRadius(this,scatteringRadius), + hardSphereRadius(this,hardSphereRadius) + { + Component::finish(); + } + + // from node + explicit Channel(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Channel(const Channel &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + resonanceReaction(this,other.resonanceReaction), + L(this,other.L), + channelSpin(this,other.channelSpin), + columnIndex(this,other.columnIndex), + scatteringRadius(this,other.scatteringRadius), + hardSphereRadius(this,other.hardSphereRadius) + { + Component::finish(other); + } + + // move + Channel(Channel &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + resonanceReaction(this,std::move(other.resonanceReaction)), + L(this,std::move(other.L)), + channelSpin(this,std::move(other.channelSpin)), + columnIndex(this,std::move(other.columnIndex)), + scatteringRadius(this,std::move(other.scatteringRadius)), + hardSphereRadius(this,std::move(other.hardSphereRadius)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Channel &operator=(const Channel &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + resonanceReaction = other.resonanceReaction; + L = other.L; + channelSpin = other.channelSpin; + columnIndex = other.columnIndex; + scatteringRadius = other.scatteringRadius; + hardSphereRadius = other.hardSphereRadius; + } + return *this; + } + + // move + Channel &operator=(Channel &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + resonanceReaction = std::move(other.resonanceReaction); + L = std::move(other.L); + channelSpin = std::move(other.channelSpin); + columnIndex = std::move(other.columnIndex); + scatteringRadius = std::move(other.scatteringRadius); + hardSphereRadius = std::move(other.hardSphereRadius); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Channel/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Channel + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channel/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channels.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channels.hpp new file mode 100644 index 000000000..e17764257 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channels.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CHANNELS +#define GNDS_V2_0_GENERAL_CHANNELS + +#include "GNDS/v2.0/general/Channel.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Channels +// ----------------------------------------------------------------------------- + +class Channels : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Channels"; } + static auto NODENAME() { return "channels"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("channel") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "channel" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "channel" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + channel{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->channel \ + ) + + // default + Channels() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Channels( + const wrapper> + &channel + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + channel(this,channel) + { + Component::finish(); + } + + // from node + explicit Channels(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Channels(const Channels &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + channel(this,other.channel) + { + Component::finish(other); + } + + // move + Channels(Channels &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + channel(this,std::move(other.channel)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Channels &operator=(const Channels &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + channel = other.channel; + } + return *this; + } + + // move + Channels &operator=(Channels &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + channel = std::move(other.channel); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Channels/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Channels + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channels/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channels/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Channels/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Charge.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Charge.hpp new file mode 100644 index 000000000..f2eb5b60a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Charge.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CHARGE +#define GNDS_V2_0_GENERAL_CHARGE + +#include "GNDS/v2.0/general/Integer.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Charge +// ----------------------------------------------------------------------------- + +class Charge : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Charge"; } + static auto NODENAME() { return "charge"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("integer") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "integer" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "integer" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + integer{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->integer \ + ) + + // default + Charge() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Charge( + const wrapper + &integer + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + integer(this,integer) + { + Component::finish(); + } + + // from node + explicit Charge(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Charge(const Charge &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + integer(this,other.integer) + { + Component::finish(other); + } + + // move + Charge(Charge &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + integer(this,std::move(other.integer)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Charge &operator=(const Charge &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + integer = other.integer; + } + return *this; + } + + // move + Charge &operator=(Charge &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + integer = std::move(other.integer); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Charge/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Charge + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Charge/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Charge/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Charge/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElement.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElement.hpp new file mode 100644 index 000000000..8261b58a2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElement.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CHEMICALELEMENT +#define GNDS_V2_0_GENERAL_CHEMICALELEMENT + +#include "GNDS/v2.0/general/Atomic.hpp" +#include "GNDS/v2.0/general/Isotopes.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ChemicalElement +// ----------------------------------------------------------------------------- + +class ChemicalElement : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ChemicalElement"; } + static auto NODENAME() { return "chemicalElement"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("symbol") | + int{} + / Meta<>("Z") | + std::string{} + / Meta<>("name") | + + // children + --Child> + ("atomic") | + --Child> + ("isotopes") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "symbol", + "Z", + "name", + "atomic", + "isotopes" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "symbol", + "z", + "name", + "atomic", + "isotopes" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + symbol{this}; + Field + Z{this}; + Field + name{this}; + + // children + Field> + atomic{this}; + Field> + isotopes{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->symbol, \ + this->Z, \ + this->name, \ + this->atomic, \ + this->isotopes \ + ) + + // default + ChemicalElement() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ChemicalElement( + const wrapper + &symbol, + const wrapper + &Z = {}, + const wrapper + &name = {}, + const wrapper> + &atomic = {}, + const wrapper> + &isotopes = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + symbol(this,symbol), + Z(this,Z), + name(this,name), + atomic(this,atomic), + isotopes(this,isotopes) + { + Component::finish(); + } + + // from node + explicit ChemicalElement(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ChemicalElement(const ChemicalElement &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + symbol(this,other.symbol), + Z(this,other.Z), + name(this,other.name), + atomic(this,other.atomic), + isotopes(this,other.isotopes) + { + Component::finish(other); + } + + // move + ChemicalElement(ChemicalElement &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + symbol(this,std::move(other.symbol)), + Z(this,std::move(other.Z)), + name(this,std::move(other.name)), + atomic(this,std::move(other.atomic)), + isotopes(this,std::move(other.isotopes)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ChemicalElement &operator=(const ChemicalElement &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + symbol = other.symbol; + Z = other.Z; + name = other.name; + atomic = other.atomic; + isotopes = other.isotopes; + } + return *this; + } + + // move + ChemicalElement &operator=(ChemicalElement &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + symbol = std::move(other.symbol); + Z = std::move(other.Z); + name = std::move(other.name); + atomic = std::move(other.atomic); + isotopes = std::move(other.isotopes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ChemicalElement/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ChemicalElement + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElement/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElement/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElement/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElements.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElements.hpp new file mode 100644 index 000000000..e199af3a4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElements.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CHEMICALELEMENTS +#define GNDS_V2_0_GENERAL_CHEMICALELEMENTS + +#include "GNDS/v2.0/general/ChemicalElement.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ChemicalElements +// ----------------------------------------------------------------------------- + +class ChemicalElements : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ChemicalElements"; } + static auto NODENAME() { return "chemicalElements"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("chemicalElement") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "chemicalElement" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "chemical_element" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + chemicalElement{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->chemicalElement \ + ) + + // default + ChemicalElements() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ChemicalElements( + const wrapper> + &chemicalElement + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + chemicalElement(this,chemicalElement) + { + Component::finish(); + } + + // from node + explicit ChemicalElements(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ChemicalElements(const ChemicalElements &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + chemicalElement(this,other.chemicalElement) + { + Component::finish(other); + } + + // move + ChemicalElements(ChemicalElements &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + chemicalElement(this,std::move(other.chemicalElement)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ChemicalElements &operator=(const ChemicalElements &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + chemicalElement = other.chemicalElement; + } + return *this; + } + + // move + ChemicalElements &operator=(ChemicalElements &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + chemicalElement = std::move(other.chemicalElement); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ChemicalElements/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ChemicalElements + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElements/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElements/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ChemicalElements/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoherentPhotonScattering.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoherentPhotonScattering.hpp new file mode 100644 index 000000000..03ba98008 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoherentPhotonScattering.hpp @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_COHERENTPHOTONSCATTERING +#define GNDS_V2_0_GENERAL_COHERENTPHOTONSCATTERING + +#include "GNDS/v2.0/general/FormFactor.hpp" +#include "GNDS/v2.0/general/RealAnomalousFactor.hpp" +#include "GNDS/v2.0/general/ImaginaryAnomalousFactor.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class CoherentPhotonScattering +// ----------------------------------------------------------------------------- + +class CoherentPhotonScattering : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "CoherentPhotonScattering"; } + static auto NODENAME() { return "coherentPhotonScattering"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::optional{} + / Meta<>("href") | + std::optional{} + / Meta<>("pid") | + std::optional{} + / Meta<>("productFrame") | + + // children + --Child> + ("formFactor") | + --Child> + ("realAnomalousFactor") | + --Child> + ("imaginaryAnomalousFactor") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "href", + "pid", + "productFrame", + "formFactor", + "realAnomalousFactor", + "imaginaryAnomalousFactor" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "href", + "pid", + "product_frame", + "form_factor", + "real_anomalous_factor", + "imaginary_anomalous_factor" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field> + href{this}; + Field> + pid{this}; + Field> + productFrame{this}; + + // children + Field> + formFactor{this}; + Field> + realAnomalousFactor{this}; + Field> + imaginaryAnomalousFactor{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href, \ + this->pid, \ + this->productFrame, \ + this->formFactor, \ + this->realAnomalousFactor, \ + this->imaginaryAnomalousFactor \ + ) + + // default + CoherentPhotonScattering() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CoherentPhotonScattering( + const wrapper + &label, + const wrapper> + &href = {}, + const wrapper> + &pid = {}, + const wrapper> + &productFrame = {}, + const wrapper> + &formFactor = {}, + const wrapper> + &realAnomalousFactor = {}, + const wrapper> + &imaginaryAnomalousFactor = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href), + pid(this,pid), + productFrame(this,productFrame), + formFactor(this,formFactor), + realAnomalousFactor(this,realAnomalousFactor), + imaginaryAnomalousFactor(this,imaginaryAnomalousFactor) + { + Component::finish(); + } + + // from node + explicit CoherentPhotonScattering(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CoherentPhotonScattering(const CoherentPhotonScattering &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href), + pid(this,other.pid), + productFrame(this,other.productFrame), + formFactor(this,other.formFactor), + realAnomalousFactor(this,other.realAnomalousFactor), + imaginaryAnomalousFactor(this,other.imaginaryAnomalousFactor) + { + Component::finish(other); + } + + // move + CoherentPhotonScattering(CoherentPhotonScattering &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + href(this,std::move(other.href)), + pid(this,std::move(other.pid)), + productFrame(this,std::move(other.productFrame)), + formFactor(this,std::move(other.formFactor)), + realAnomalousFactor(this,std::move(other.realAnomalousFactor)), + imaginaryAnomalousFactor(this,std::move(other.imaginaryAnomalousFactor)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CoherentPhotonScattering &operator=(const CoherentPhotonScattering &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + href = other.href; + pid = other.pid; + productFrame = other.productFrame; + formFactor = other.formFactor; + realAnomalousFactor = other.realAnomalousFactor; + imaginaryAnomalousFactor = other.imaginaryAnomalousFactor; + } + return *this; + } + + // move + CoherentPhotonScattering &operator=(CoherentPhotonScattering &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + href = std::move(other.href); + pid = std::move(other.pid); + productFrame = std::move(other.productFrame); + formFactor = std::move(other.formFactor); + realAnomalousFactor = std::move(other.realAnomalousFactor); + imaginaryAnomalousFactor = std::move(other.imaginaryAnomalousFactor); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/CoherentPhotonScattering/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CoherentPhotonScattering + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoherentPhotonScattering/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoherentPhotonScattering/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoherentPhotonScattering/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Column.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Column.hpp new file mode 100644 index 000000000..4a9a1dff3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Column.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_COLUMN +#define GNDS_V2_0_GENERAL_COLUMN + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Column +// ----------------------------------------------------------------------------- + +class Column : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Column"; } + static auto NODENAME() { return "column"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + int{} + / Meta<>("index") | + std::string{} + / Meta<>("name") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "index", + "name", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "index", + "name", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + index{this}; + Field + name{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->name, \ + this->unit \ + ) + + // default + Column() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Column( + const wrapper + &index, + const wrapper + &name = {}, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + index(this,index), + name(this,name), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Column(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Column(const Column &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + index(this,other.index), + name(this,other.name), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + Column(Column &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + index(this,std::move(other.index)), + name(this,std::move(other.name)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Column &operator=(const Column &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + index = other.index; + name = other.name; + unit = other.unit; + } + return *this; + } + + // move + Column &operator=(Column &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + index = std::move(other.index); + name = std::move(other.name); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Column/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Column + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Column/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Column/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Column/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnData.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnData.hpp new file mode 100644 index 000000000..3de612196 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnData.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_COLUMNDATA +#define GNDS_V2_0_GENERAL_COLUMNDATA + +#include "GNDS/v2.0/general/Slices.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ColumnData +// ----------------------------------------------------------------------------- + +class ColumnData : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ColumnData"; } + static auto NODENAME() { return "columnData"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("ENDF_MFMT") | + std::string{} + / Meta<>("href") | + + // children + --Child> + ("slices") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "ENDF_MFMT", + "href", + "slices" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "endf_mfmt", + "href", + "slices" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + ENDF_MFMT{this}; + Field + href{this}; + + // children + Field> + slices{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MFMT, \ + this->href, \ + this->slices \ + ) + + // default + ColumnData() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ColumnData( + const wrapper> + &ENDF_MFMT, + const wrapper + &href = {}, + const wrapper> + &slices = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + ENDF_MFMT(this,ENDF_MFMT), + href(this,href), + slices(this,slices) + { + Component::finish(); + } + + // from node + explicit ColumnData(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ColumnData(const ColumnData &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + ENDF_MFMT(this,other.ENDF_MFMT), + href(this,other.href), + slices(this,other.slices) + { + Component::finish(other); + } + + // move + ColumnData(ColumnData &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + ENDF_MFMT(this,std::move(other.ENDF_MFMT)), + href(this,std::move(other.href)), + slices(this,std::move(other.slices)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ColumnData &operator=(const ColumnData &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + ENDF_MFMT = other.ENDF_MFMT; + href = other.href; + slices = other.slices; + } + return *this; + } + + // move + ColumnData &operator=(ColumnData &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + ENDF_MFMT = std::move(other.ENDF_MFMT); + href = std::move(other.href); + slices = std::move(other.slices); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ColumnData/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ColumnData + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnData/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnHeaders.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnHeaders.hpp new file mode 100644 index 000000000..31b43716f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnHeaders.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_COLUMNHEADERS +#define GNDS_V2_0_GENERAL_COLUMNHEADERS + +#include "GNDS/v2.0/general/Column.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ColumnHeaders +// ----------------------------------------------------------------------------- + +class ColumnHeaders : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ColumnHeaders"; } + static auto NODENAME() { return "columnHeaders"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("column") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "column" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "column" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + column{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->column \ + ) + + // default + ColumnHeaders() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ColumnHeaders( + const wrapper> + &column + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + column(this,column) + { + Component::finish(); + } + + // from node + explicit ColumnHeaders(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ColumnHeaders(const ColumnHeaders &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + column(this,other.column) + { + Component::finish(other); + } + + // move + ColumnHeaders(ColumnHeaders &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + column(this,std::move(other.column)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ColumnHeaders &operator=(const ColumnHeaders &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + column = other.column; + } + return *this; + } + + // move + ColumnHeaders &operator=(ColumnHeaders &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + column = std::move(other.column); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ColumnHeaders/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ColumnHeaders + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnHeaders/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnHeaders/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ColumnHeaders/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configuration.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configuration.hpp new file mode 100644 index 000000000..287895b71 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configuration.hpp @@ -0,0 +1,232 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CONFIGURATION +#define GNDS_V2_0_GENERAL_CONFIGURATION + +#include "GNDS/v2.0/general/BindingEnergy.hpp" +#include "GNDS/v2.0/general/DecayData.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Configuration +// ----------------------------------------------------------------------------- + +class Configuration : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Configuration"; } + static auto NODENAME() { return "configuration"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("subshell") | + double{} + / Meta<>("electronNumber") | + + // children + --Child + ("bindingEnergy") | + ++Child + ("decayData") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "subshell", + "electronNumber", + "bindingEnergy", + "decayData" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "subshell", + "electron_number", + "binding_energy", + "decay_data" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + subshell{this}; + Field + electronNumber{this}; + + // children + Field + bindingEnergy{this}; + Field> + decayData{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(bindingEnergy(),Double); + NJOY_GNDSTK_SHORTCUT(bindingEnergy().Double(),uncertainty); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->subshell, \ + this->electronNumber, \ + this->bindingEnergy, \ + this->decayData \ + ) + + // default + Configuration() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Configuration( + const wrapper + &subshell, + const wrapper + &electronNumber = {}, + const wrapper + &bindingEnergy = {}, + const wrapper> + &decayData = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + subshell(this,subshell), + electronNumber(this,electronNumber), + bindingEnergy(this,bindingEnergy), + decayData(this,decayData) + { + Component::finish(); + } + + // from node + explicit Configuration(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Configuration(const Configuration &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + subshell(this,other.subshell), + electronNumber(this,other.electronNumber), + bindingEnergy(this,other.bindingEnergy), + decayData(this,other.decayData) + { + Component::finish(other); + } + + // move + Configuration(Configuration &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + subshell(this,std::move(other.subshell)), + electronNumber(this,std::move(other.electronNumber)), + bindingEnergy(this,std::move(other.bindingEnergy)), + decayData(this,std::move(other.decayData)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Configuration &operator=(const Configuration &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + subshell = other.subshell; + electronNumber = other.electronNumber; + bindingEnergy = other.bindingEnergy; + decayData = other.decayData; + } + return *this; + } + + // move + Configuration &operator=(Configuration &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + subshell = std::move(other.subshell); + electronNumber = std::move(other.electronNumber); + bindingEnergy = std::move(other.bindingEnergy); + decayData = std::move(other.decayData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Configuration/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Configuration + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configuration/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configuration/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configuration/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configurations.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configurations.hpp new file mode 100644 index 000000000..dbc26ff68 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configurations.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CONFIGURATIONS +#define GNDS_V2_0_GENERAL_CONFIGURATIONS + +#include "GNDS/v2.0/general/Configuration.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Configurations +// ----------------------------------------------------------------------------- + +class Configurations : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Configurations"; } + static auto NODENAME() { return "configurations"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("configuration") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "configuration" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "configuration" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + configuration{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->configuration \ + ) + + // default + Configurations() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Configurations( + const wrapper> + &configuration + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + configuration(this,configuration) + { + Component::finish(); + } + + // from node + explicit Configurations(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Configurations(const Configurations &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + configuration(this,other.configuration) + { + Component::finish(other); + } + + // move + Configurations(Configurations &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + configuration(this,std::move(other.configuration)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Configurations &operator=(const Configurations &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + configuration = other.configuration; + } + return *this; + } + + // move + Configurations &operator=(Configurations &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + configuration = std::move(other.configuration); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Configurations/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Configurations + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configurations/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configurations/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Configurations/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Constant1d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Constant1d.hpp new file mode 100644 index 000000000..a183c0cdf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Constant1d.hpp @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CONSTANT1D +#define GNDS_V2_0_GENERAL_CONSTANT1D + +#include "GNDS/v2.0/general/Axes.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Constant1d +// ----------------------------------------------------------------------------- + +class Constant1d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Constant1d"; } + static auto NODENAME() { return "constant1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("label") | + double{} + / Meta<>("value") | + double{} + / Meta<>("domainMin") | + double{} + / Meta<>("domainMax") | + + // children + --Child + ("axes") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "domainMin", + "domainMax", + "axes" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "domain_min", + "domain_max", + "axes" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field + value{this}; + Field + domainMin{this}; + Field + domainMax{this}; + + // children + Field + axes{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(axes(),axis); + NJOY_GNDSTK_SHORTCUT(axes(),grid); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->domainMin, \ + this->domainMax, \ + this->axes \ + ) + + // default + Constant1d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Constant1d( + const wrapper> + &label, + const wrapper + &value = {}, + const wrapper + &domainMin = {}, + const wrapper + &domainMax = {}, + const wrapper + &axes = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + domainMin(this,domainMin), + domainMax(this,domainMax), + axes(this,axes) + { + Component::finish(); + } + + // from node + explicit Constant1d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Constant1d(const Constant1d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + axes(this,other.axes) + { + Component::finish(other); + } + + // move + Constant1d(Constant1d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + value(this,std::move(other.value)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + axes(this,std::move(other.axes)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Constant1d &operator=(const Constant1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + domainMin = other.domainMin; + domainMax = other.domainMax; + axes = other.axes; + } + return *this; + } + + // move + Constant1d &operator=(Constant1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + value = std::move(other.value); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + axes = std::move(other.axes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Constant1d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Constant1d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Constant1d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Constant1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Constant1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Continuum.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Continuum.hpp new file mode 100644 index 000000000..ec2cbd7be --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Continuum.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CONTINUUM +#define GNDS_V2_0_GENERAL_CONTINUUM + +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Continuum +// ----------------------------------------------------------------------------- + +class Continuum : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Continuum"; } + static auto NODENAME() { return "continuum"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + Continuum() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Continuum( + const wrapper + &XYs1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit Continuum(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Continuum(const Continuum &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + Continuum(Continuum &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Continuum &operator=(const Continuum &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + Continuum &operator=(Continuum &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Continuum/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Continuum + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Continuum/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Continuum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Continuum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Conversion.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Conversion.hpp new file mode 100644 index 000000000..0b1005626 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Conversion.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CONVERSION +#define GNDS_V2_0_GENERAL_CONVERSION + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Conversion +// ----------------------------------------------------------------------------- + +class Conversion : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Conversion"; } + static auto NODENAME() { return "conversion"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("flags") | + std::string{} + / Meta<>("href") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "flags", + "href" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "flags", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + flags{this}; + Field + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->flags, \ + this->href \ + ) + + // default + Conversion() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Conversion( + const wrapper + &flags, + const wrapper + &href = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + flags(this,flags), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Conversion(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Conversion(const Conversion &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + flags(this,other.flags), + href(this,other.href) + { + Component::finish(other); + } + + // move + Conversion(Conversion &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + flags(this,std::move(other.flags)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Conversion &operator=(const Conversion &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + flags = other.flags; + href = other.href; + } + return *this; + } + + // move + Conversion &operator=(Conversion &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + flags = std::move(other.flags); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Conversion/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Conversion + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Conversion/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Conversion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Conversion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoulombPlusNuclearElastic.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoulombPlusNuclearElastic.hpp new file mode 100644 index 000000000..1e03f51ed --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoulombPlusNuclearElastic.hpp @@ -0,0 +1,283 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_COULOMBPLUSNUCLEARELASTIC +#define GNDS_V2_0_GENERAL_COULOMBPLUSNUCLEARELASTIC + +#include "GNDS/v2.0/general/RutherfordScattering.hpp" +#include "GNDS/v2.0/general/NuclearAmplitudeExpansion.hpp" +#include "GNDS/v2.0/general/NuclearPlusInterference.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class CoulombPlusNuclearElastic +// ----------------------------------------------------------------------------- + +class CoulombPlusNuclearElastic : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "CoulombPlusNuclearElastic"; } + static auto NODENAME() { return "CoulombPlusNuclearElastic"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::optional{} + / Meta<>("href") | + std::optional{} + / Meta<>("pid") | + std::optional{} + / Meta<>("productFrame") | + std::optional{} + / Meta<>("identicalParticles") | + + // children + --Child> + ("RutherfordScattering") | + --Child> + ("nuclearAmplitudeExpansion") | + --Child> + ("nuclearPlusInterference") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "href", + "pid", + "productFrame", + "identicalParticles", + "RutherfordScattering", + "nuclearAmplitudeExpansion", + "nuclearPlusInterference" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "href", + "pid", + "product_frame", + "identical_particles", + "rutherford_scattering", + "nuclear_amplitude_expansion", + "nuclear_plus_interference" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field> + href{this}; + Field> + pid{this}; + Field> + productFrame{this}; + Field> + identicalParticles{this}; + + // children + Field> + RutherfordScattering{this}; + Field> + nuclearAmplitudeExpansion{this}; + Field> + nuclearPlusInterference{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href, \ + this->pid, \ + this->productFrame, \ + this->identicalParticles, \ + this->RutherfordScattering, \ + this->nuclearAmplitudeExpansion, \ + this->nuclearPlusInterference \ + ) + + // default + CoulombPlusNuclearElastic() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CoulombPlusNuclearElastic( + const wrapper + &label, + const wrapper> + &href = {}, + const wrapper> + &pid = {}, + const wrapper> + &productFrame = {}, + const wrapper> + &identicalParticles = {}, + const wrapper> + &RutherfordScattering = {}, + const wrapper> + &nuclearAmplitudeExpansion = {}, + const wrapper> + &nuclearPlusInterference = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href), + pid(this,pid), + productFrame(this,productFrame), + identicalParticles(this,identicalParticles), + RutherfordScattering(this,RutherfordScattering), + nuclearAmplitudeExpansion(this,nuclearAmplitudeExpansion), + nuclearPlusInterference(this,nuclearPlusInterference) + { + Component::finish(); + } + + // from node + explicit CoulombPlusNuclearElastic(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CoulombPlusNuclearElastic(const CoulombPlusNuclearElastic &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href), + pid(this,other.pid), + productFrame(this,other.productFrame), + identicalParticles(this,other.identicalParticles), + RutherfordScattering(this,other.RutherfordScattering), + nuclearAmplitudeExpansion(this,other.nuclearAmplitudeExpansion), + nuclearPlusInterference(this,other.nuclearPlusInterference) + { + Component::finish(other); + } + + // move + CoulombPlusNuclearElastic(CoulombPlusNuclearElastic &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + href(this,std::move(other.href)), + pid(this,std::move(other.pid)), + productFrame(this,std::move(other.productFrame)), + identicalParticles(this,std::move(other.identicalParticles)), + RutherfordScattering(this,std::move(other.RutherfordScattering)), + nuclearAmplitudeExpansion(this,std::move(other.nuclearAmplitudeExpansion)), + nuclearPlusInterference(this,std::move(other.nuclearPlusInterference)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CoulombPlusNuclearElastic &operator=(const CoulombPlusNuclearElastic &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + href = other.href; + pid = other.pid; + productFrame = other.productFrame; + identicalParticles = other.identicalParticles; + RutherfordScattering = other.RutherfordScattering; + nuclearAmplitudeExpansion = other.nuclearAmplitudeExpansion; + nuclearPlusInterference = other.nuclearPlusInterference; + } + return *this; + } + + // move + CoulombPlusNuclearElastic &operator=(CoulombPlusNuclearElastic &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + href = std::move(other.href); + pid = std::move(other.pid); + productFrame = std::move(other.productFrame); + identicalParticles = std::move(other.identicalParticles); + RutherfordScattering = std::move(other.RutherfordScattering); + nuclearAmplitudeExpansion = std::move(other.nuclearAmplitudeExpansion); + nuclearPlusInterference = std::move(other.nuclearPlusInterference); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/CoulombPlusNuclearElastic/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CoulombPlusNuclearElastic + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoulombPlusNuclearElastic/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoulombPlusNuclearElastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CoulombPlusNuclearElastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Covariance.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Covariance.hpp new file mode 100644 index 000000000..01e5e650a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Covariance.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_COVARIANCE +#define GNDS_V2_0_GENERAL_COVARIANCE + +#include "GNDS/v2.0/general/Array.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Covariance +// ----------------------------------------------------------------------------- + +class Covariance : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Covariance"; } + static auto NODENAME() { return "covariance"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("href") | + + // children + --Child> + ("array") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "href", + "array" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "href", + "array" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + href{this}; + + // children + Field> + array{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href, \ + this->array \ + ) + + // default + Covariance() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Covariance( + const wrapper> + &label, + const wrapper> + &href = {}, + const wrapper> + &array = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href), + array(this,array) + { + Component::finish(); + } + + // from node + explicit Covariance(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Covariance(const Covariance &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href), + array(this,other.array) + { + Component::finish(other); + } + + // move + Covariance(Covariance &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + href(this,std::move(other.href)), + array(this,std::move(other.array)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Covariance &operator=(const Covariance &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + href = other.href; + array = other.array; + } + return *this; + } + + // move + Covariance &operator=(Covariance &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + href = std::move(other.href); + array = std::move(other.array); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Covariance/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Covariance + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Covariance/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Covariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Covariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceMatrix.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceMatrix.hpp new file mode 100644 index 000000000..fe75c24fe --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceMatrix.hpp @@ -0,0 +1,234 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_COVARIANCEMATRIX +#define GNDS_V2_0_GENERAL_COVARIANCEMATRIX + +#include "GNDS/v2.0/general/Gridded2d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class CovarianceMatrix +// ----------------------------------------------------------------------------- + +class CovarianceMatrix : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "CovarianceMatrix"; } + static auto NODENAME() { return "covarianceMatrix"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("type") | + std::optional{} + / Meta<>("productFrame") | + + // children + --Child + ("gridded2d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "type", + "productFrame", + "gridded2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "type", + "product_frame", + "gridded2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + type{this}; + Field> + productFrame{this}; + + // children + Field + gridded2d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(gridded2d(),array); + NJOY_GNDSTK_SHORTCUT(gridded2d(),axes); + NJOY_GNDSTK_SHORTCUT(gridded2d().axes(),axis); + NJOY_GNDSTK_SHORTCUT(gridded2d().axes(),grid); + NJOY_GNDSTK_SHORTCUT(gridded2d().array(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->type, \ + this->productFrame, \ + this->gridded2d \ + ) + + // default + CovarianceMatrix() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CovarianceMatrix( + const wrapper + &label, + const wrapper + &type = {}, + const wrapper> + &productFrame = {}, + const wrapper + &gridded2d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + type(this,type), + productFrame(this,productFrame), + gridded2d(this,gridded2d) + { + Component::finish(); + } + + // from node + explicit CovarianceMatrix(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceMatrix(const CovarianceMatrix &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + type(this,other.type), + productFrame(this,other.productFrame), + gridded2d(this,other.gridded2d) + { + Component::finish(other); + } + + // move + CovarianceMatrix(CovarianceMatrix &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + type(this,std::move(other.type)), + productFrame(this,std::move(other.productFrame)), + gridded2d(this,std::move(other.gridded2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CovarianceMatrix &operator=(const CovarianceMatrix &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + type = other.type; + productFrame = other.productFrame; + gridded2d = other.gridded2d; + } + return *this; + } + + // move + CovarianceMatrix &operator=(CovarianceMatrix &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + type = std::move(other.type); + productFrame = std::move(other.productFrame); + gridded2d = std::move(other.gridded2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/CovarianceMatrix/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CovarianceMatrix + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceMatrix/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceMatrix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceMatrix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSection.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSection.hpp new file mode 100644 index 000000000..852dc59f2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSection.hpp @@ -0,0 +1,271 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_COVARIANCESECTION +#define GNDS_V2_0_GENERAL_COVARIANCESECTION + +#include "GNDS/v2.0/general/RowData.hpp" +#include "GNDS/v2.0/general/ColumnData.hpp" +#include "GNDS/v2.0/general/CovarianceMatrix.hpp" +#include "GNDS/v2.0/general/Mixed.hpp" +#include "GNDS/v2.0/general/Sum.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class CovarianceSection +// ----------------------------------------------------------------------------- + +class CovarianceSection : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "CovarianceSection"; } + static auto NODENAME() { return "covarianceSection"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::optional{} + / Meta<>("crossTerm") | + + // children + --Child + ("rowData") | + --Child> + ("columnData") | + --Child> + ("covarianceMatrix") | + --Child> + ("mixed") | + --Child> + ("sum") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "crossTerm", + "rowData", + "columnData", + "covarianceMatrix", + "mixed", + "sum" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "cross_term", + "row_data", + "column_data", + "covariance_matrix", + "mixed", + "sum" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field> + crossTerm{this}; + + // children + Field + rowData{this}; + Field> + columnData{this}; + Field> + covarianceMatrix{this}; + Field> + mixed{this}; + Field> + sum{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->crossTerm, \ + this->rowData, \ + this->columnData, \ + this->covarianceMatrix, \ + this->mixed, \ + this->sum \ + ) + + // default + CovarianceSection() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CovarianceSection( + const wrapper + &label, + const wrapper> + &crossTerm = {}, + const wrapper + &rowData = {}, + const wrapper> + &columnData = {}, + const wrapper> + &covarianceMatrix = {}, + const wrapper> + &mixed = {}, + const wrapper> + &sum = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + crossTerm(this,crossTerm), + rowData(this,rowData), + columnData(this,columnData), + covarianceMatrix(this,covarianceMatrix), + mixed(this,mixed), + sum(this,sum) + { + Component::finish(); + } + + // from node + explicit CovarianceSection(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceSection(const CovarianceSection &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + crossTerm(this,other.crossTerm), + rowData(this,other.rowData), + columnData(this,other.columnData), + covarianceMatrix(this,other.covarianceMatrix), + mixed(this,other.mixed), + sum(this,other.sum) + { + Component::finish(other); + } + + // move + CovarianceSection(CovarianceSection &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + crossTerm(this,std::move(other.crossTerm)), + rowData(this,std::move(other.rowData)), + columnData(this,std::move(other.columnData)), + covarianceMatrix(this,std::move(other.covarianceMatrix)), + mixed(this,std::move(other.mixed)), + sum(this,std::move(other.sum)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CovarianceSection &operator=(const CovarianceSection &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + crossTerm = other.crossTerm; + rowData = other.rowData; + columnData = other.columnData; + covarianceMatrix = other.covarianceMatrix; + mixed = other.mixed; + sum = other.sum; + } + return *this; + } + + // move + CovarianceSection &operator=(CovarianceSection &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + crossTerm = std::move(other.crossTerm); + rowData = std::move(other.rowData); + columnData = std::move(other.columnData); + covarianceMatrix = std::move(other.covarianceMatrix); + mixed = std::move(other.mixed); + sum = std::move(other.sum); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/CovarianceSection/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CovarianceSection + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSection/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSections.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSections.hpp new file mode 100644 index 000000000..d88374f53 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSections.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_COVARIANCESECTIONS +#define GNDS_V2_0_GENERAL_COVARIANCESECTIONS + +#include "GNDS/v2.0/general/CovarianceSection.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class CovarianceSections +// ----------------------------------------------------------------------------- + +class CovarianceSections : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "CovarianceSections"; } + static auto NODENAME() { return "covarianceSections"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("covarianceSection") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "covarianceSection" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "covariance_section" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + covarianceSection{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->covarianceSection \ + ) + + // default + CovarianceSections() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CovarianceSections( + const wrapper> + &covarianceSection + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + covarianceSection(this,covarianceSection) + { + Component::finish(); + } + + // from node + explicit CovarianceSections(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceSections(const CovarianceSections &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + covarianceSection(this,other.covarianceSection) + { + Component::finish(other); + } + + // move + CovarianceSections(CovarianceSections &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + covarianceSection(this,std::move(other.covarianceSection)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CovarianceSections &operator=(const CovarianceSections &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + covarianceSection = other.covarianceSection; + } + return *this; + } + + // move + CovarianceSections &operator=(CovarianceSections &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + covarianceSection = std::move(other.covarianceSection); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/CovarianceSections/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CovarianceSections + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSections/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSections/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CovarianceSections/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSection.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSection.hpp new file mode 100644 index 000000000..150151fb8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSection.hpp @@ -0,0 +1,254 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CROSSSECTION +#define GNDS_V2_0_GENERAL_CROSSSECTION + +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/Regions1d.hpp" +#include "GNDS/v2.0/general/Reference.hpp" +#include "GNDS/v2.0/general/ResonancesWithBackground.hpp" +#include "GNDS/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class CrossSection +// ----------------------------------------------------------------------------- + +class CrossSection : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "CrossSection"; } + static auto NODENAME() { return "crossSection"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("XYs1d") | + --Child> + ("regions1d") | + --Child> + ("reference") | + --Child> + ("resonancesWithBackground") | + --Child> + ("CoulombPlusNuclearElastic") | + --Child> + ("thermalNeutronScatteringLaw1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d", + "regions1d", + "reference", + "resonancesWithBackground", + "CoulombPlusNuclearElastic", + "thermalNeutronScatteringLaw1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d", + "regions1d", + "reference", + "resonances_with_background", + "coulomb_plus_nuclear_elastic", + "thermal_neutron_scattering_law1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + regions1d{this}; + Field> + reference{this}; + Field> + resonancesWithBackground{this}; + Field> + CoulombPlusNuclearElastic{this}; + Field> + thermalNeutronScatteringLaw1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d, \ + this->reference, \ + this->resonancesWithBackground, \ + this->CoulombPlusNuclearElastic, \ + this->thermalNeutronScatteringLaw1d \ + ) + + // default + CrossSection() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSection( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {}, + const wrapper> + &reference = {}, + const wrapper> + &resonancesWithBackground = {}, + const wrapper> + &CoulombPlusNuclearElastic = {}, + const wrapper> + &thermalNeutronScatteringLaw1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d), + reference(this,reference), + resonancesWithBackground(this,resonancesWithBackground), + CoulombPlusNuclearElastic(this,CoulombPlusNuclearElastic), + thermalNeutronScatteringLaw1d(this,thermalNeutronScatteringLaw1d) + { + Component::finish(); + } + + // from node + explicit CrossSection(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSection(const CrossSection &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d), + reference(this,other.reference), + resonancesWithBackground(this,other.resonancesWithBackground), + CoulombPlusNuclearElastic(this,other.CoulombPlusNuclearElastic), + thermalNeutronScatteringLaw1d(this,other.thermalNeutronScatteringLaw1d) + { + Component::finish(other); + } + + // move + CrossSection(CrossSection &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + regions1d(this,std::move(other.regions1d)), + reference(this,std::move(other.reference)), + resonancesWithBackground(this,std::move(other.resonancesWithBackground)), + CoulombPlusNuclearElastic(this,std::move(other.CoulombPlusNuclearElastic)), + thermalNeutronScatteringLaw1d(this,std::move(other.thermalNeutronScatteringLaw1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CrossSection &operator=(const CrossSection &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + reference = other.reference; + resonancesWithBackground = other.resonancesWithBackground; + CoulombPlusNuclearElastic = other.CoulombPlusNuclearElastic; + thermalNeutronScatteringLaw1d = other.thermalNeutronScatteringLaw1d; + } + return *this; + } + + // move + CrossSection &operator=(CrossSection &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + regions1d = std::move(other.regions1d); + reference = std::move(other.reference); + resonancesWithBackground = std::move(other.resonancesWithBackground); + CoulombPlusNuclearElastic = std::move(other.CoulombPlusNuclearElastic); + thermalNeutronScatteringLaw1d = std::move(other.thermalNeutronScatteringLaw1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/CrossSection/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CrossSection + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSection/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionReconstructed.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionReconstructed.hpp new file mode 100644 index 000000000..310fbebc0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionReconstructed.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CROSSSECTIONRECONSTRUCTED +#define GNDS_V2_0_GENERAL_CROSSSECTIONRECONSTRUCTED + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class CrossSectionReconstructed +// ----------------------------------------------------------------------------- + +class CrossSectionReconstructed : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "CrossSectionReconstructed"; } + static auto NODENAME() { return "crossSectionReconstructed"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("derivedFrom") | + std::string{} + / Meta<>("date") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "derivedFrom", + "date" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "derived_from", + "date" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + derivedFrom{this}; + Field + date{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->derivedFrom, \ + this->date \ + ) + + // default + CrossSectionReconstructed() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSectionReconstructed( + const wrapper + &label, + const wrapper + &derivedFrom = {}, + const wrapper + &date = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + derivedFrom(this,derivedFrom), + date(this,date) + { + Component::finish(); + } + + // from node + explicit CrossSectionReconstructed(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSectionReconstructed(const CrossSectionReconstructed &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + derivedFrom(this,other.derivedFrom), + date(this,other.date) + { + Component::finish(other); + } + + // move + CrossSectionReconstructed(CrossSectionReconstructed &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + derivedFrom(this,std::move(other.derivedFrom)), + date(this,std::move(other.date)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CrossSectionReconstructed &operator=(const CrossSectionReconstructed &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + derivedFrom = other.derivedFrom; + date = other.date; + } + return *this; + } + + // move + CrossSectionReconstructed &operator=(CrossSectionReconstructed &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + derivedFrom = std::move(other.derivedFrom); + date = std::move(other.date); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/CrossSectionReconstructed/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CrossSectionReconstructed + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionReconstructed/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionReconstructed/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionReconstructed/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSum.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSum.hpp new file mode 100644 index 000000000..f1cfaebdd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSum.hpp @@ -0,0 +1,254 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CROSSSECTIONSUM +#define GNDS_V2_0_GENERAL_CROSSSECTIONSUM + +#include "GNDS/v2.0/general/Summands.hpp" +#include "GNDS/v2.0/general/Q.hpp" +#include "GNDS/v2.0/general/CrossSection.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class CrossSectionSum +// ----------------------------------------------------------------------------- + +class CrossSectionSum : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "CrossSectionSum"; } + static auto NODENAME() { return "crossSectionSum"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + int{} + / Meta<>("ENDF_MT") | + + // children + --Child + ("summands") | + --Child + ("Q") | + --Child + ("crossSection") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "ENDF_MT", + "summands", + "Q", + "crossSection" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "endf_mt", + "summands", + "q", + "cross_section" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + ENDF_MT{this}; + + // children + Field + summands{this}; + Field + Q{this}; + Field + crossSection{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(crossSection(),CoulombPlusNuclearElastic); + NJOY_GNDSTK_SHORTCUT(Q(),Double); + NJOY_GNDSTK_SHORTCUT(crossSection(),XYs1d); + NJOY_GNDSTK_SHORTCUT(summands(),add); + NJOY_GNDSTK_SHORTCUT(Q(),constant1d); + NJOY_GNDSTK_SHORTCUT(crossSection(),reference); + NJOY_GNDSTK_SHORTCUT(crossSection(),regions1d); + NJOY_GNDSTK_SHORTCUT(crossSection(),resonancesWithBackground); + NJOY_GNDSTK_SHORTCUT(crossSection(),thermalNeutronScatteringLaw1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->summands, \ + this->Q, \ + this->crossSection \ + ) + + // default + CrossSectionSum() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSectionSum( + const wrapper + &label, + const wrapper + &ENDF_MT = {}, + const wrapper + &summands = {}, + const wrapper + &Q = {}, + const wrapper + &crossSection = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + ENDF_MT(this,ENDF_MT), + summands(this,summands), + Q(this,Q), + crossSection(this,crossSection) + { + Component::finish(); + } + + // from node + explicit CrossSectionSum(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSectionSum(const CrossSectionSum &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + ENDF_MT(this,other.ENDF_MT), + summands(this,other.summands), + Q(this,other.Q), + crossSection(this,other.crossSection) + { + Component::finish(other); + } + + // move + CrossSectionSum(CrossSectionSum &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + ENDF_MT(this,std::move(other.ENDF_MT)), + summands(this,std::move(other.summands)), + Q(this,std::move(other.Q)), + crossSection(this,std::move(other.crossSection)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CrossSectionSum &operator=(const CrossSectionSum &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + ENDF_MT = other.ENDF_MT; + summands = other.summands; + Q = other.Q; + crossSection = other.crossSection; + } + return *this; + } + + // move + CrossSectionSum &operator=(CrossSectionSum &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + ENDF_MT = std::move(other.ENDF_MT); + summands = std::move(other.summands); + Q = std::move(other.Q); + crossSection = std::move(other.crossSection); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/CrossSectionSum/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CrossSectionSum + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSum/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSums.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSums.hpp new file mode 100644 index 000000000..13c27598b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSums.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_CROSSSECTIONSUMS +#define GNDS_V2_0_GENERAL_CROSSSECTIONSUMS + +#include "GNDS/v2.0/general/CrossSectionSum.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class CrossSectionSums +// ----------------------------------------------------------------------------- + +class CrossSectionSums : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "CrossSectionSums"; } + static auto NODENAME() { return "crossSectionSums"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("crossSectionSum") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "crossSectionSum" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "cross_section_sum" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + crossSectionSum{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->crossSectionSum \ + ) + + // default + CrossSectionSums() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSectionSums( + const wrapper> + &crossSectionSum + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + crossSectionSum(this,crossSectionSum) + { + Component::finish(); + } + + // from node + explicit CrossSectionSums(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSectionSums(const CrossSectionSums &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + crossSectionSum(this,other.crossSectionSum) + { + Component::finish(other); + } + + // move + CrossSectionSums(CrossSectionSums &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + crossSectionSum(this,std::move(other.crossSectionSum)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CrossSectionSums &operator=(const CrossSectionSums &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + crossSectionSum = other.crossSectionSum; + } + return *this; + } + + // move + CrossSectionSums &operator=(CrossSectionSums &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + crossSectionSum = std::move(other.crossSectionSum); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/CrossSectionSums/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CrossSectionSums + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSums/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSums/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/CrossSectionSums/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Data.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Data.hpp new file mode 100644 index 000000000..d0d6a88f0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Data.hpp @@ -0,0 +1,176 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DATA +#define GNDS_V2_0_GENERAL_DATA + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Data +// ----------------------------------------------------------------------------- + +class Data : + public Component, + public DataNode,false> +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Data"; } + static auto NODENAME() { return "data"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // data + --Child(special::self) / DataConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "doubles" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "doubles" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using DataNode::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // data + std::vector &doubles = *this; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + static_cast(*this) \ + ) + + // default + Data() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Data(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Data(const std::vector &vector) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Data(const Data &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Data(Data &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(std::move(other)), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Data &operator=(const Data &other) + { + if (this != &other) { + Component::operator=(other); + DataNode::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + Data &operator=(Data &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + DataNode::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Data/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Data + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Data/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Data/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Data/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Date.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Date.hpp new file mode 100644 index 000000000..a59b43a0d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Date.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DATE +#define GNDS_V2_0_GENERAL_DATE + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Date +// ----------------------------------------------------------------------------- + +class Date : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Date"; } + static auto NODENAME() { return "date"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("value") | + std::string{} + / Meta<>("dateType") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "dateType" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "date_type" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + Field + dateType{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->dateType \ + ) + + // default + Date() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Date( + const wrapper + &value, + const wrapper + &dateType = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + dateType(this,dateType) + { + Component::finish(); + } + + // from node + explicit Date(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Date(const Date &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + dateType(this,other.dateType) + { + Component::finish(other); + } + + // move + Date(Date &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + dateType(this,std::move(other.dateType)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Date &operator=(const Date &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + dateType = other.dateType; + } + return *this; + } + + // move + Date &operator=(Date &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + dateType = std::move(other.dateType); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Date/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Date + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Date/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Date/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Date/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Dates.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Dates.hpp new file mode 100644 index 000000000..9ab2842d6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Dates.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DATES +#define GNDS_V2_0_GENERAL_DATES + +#include "GNDS/v2.0/general/Date.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Dates +// ----------------------------------------------------------------------------- + +class Dates : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Dates"; } + static auto NODENAME() { return "dates"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("date") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "date" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "date" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + date{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->date \ + ) + + // default + Dates() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Dates( + const wrapper> + &date + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + date(this,date) + { + Component::finish(); + } + + // from node + explicit Dates(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Dates(const Dates &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + date(this,other.date) + { + Component::finish(other); + } + + // move + Dates(Dates &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + date(this,std::move(other.date)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Dates &operator=(const Dates &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + date = other.date; + } + return *this; + } + + // move + Dates &operator=(Dates &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + date = std::move(other.date); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Dates/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Dates + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Dates/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Dates/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Dates/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DebyeWallerIntegral.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DebyeWallerIntegral.hpp new file mode 100644 index 000000000..136d9a0e3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DebyeWallerIntegral.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DEBYEWALLERINTEGRAL +#define GNDS_V2_0_GENERAL_DEBYEWALLERINTEGRAL + +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DebyeWallerIntegral +// ----------------------------------------------------------------------------- + +class DebyeWallerIntegral : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DebyeWallerIntegral"; } + static auto NODENAME() { return "DebyeWallerIntegral"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + DebyeWallerIntegral() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DebyeWallerIntegral( + const wrapper + &XYs1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit DebyeWallerIntegral(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DebyeWallerIntegral(const DebyeWallerIntegral &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + DebyeWallerIntegral(DebyeWallerIntegral &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DebyeWallerIntegral &operator=(const DebyeWallerIntegral &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + DebyeWallerIntegral &operator=(DebyeWallerIntegral &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DebyeWallerIntegral/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DebyeWallerIntegral + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DebyeWallerIntegral/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DebyeWallerIntegral/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DebyeWallerIntegral/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Decay.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Decay.hpp new file mode 100644 index 000000000..c6fdfc6ec --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Decay.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DECAY +#define GNDS_V2_0_GENERAL_DECAY + +#include "GNDS/v2.0/general/Products.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Decay +// ----------------------------------------------------------------------------- + +class Decay : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Decay"; } + static auto NODENAME() { return "decay"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + int{} + / Meta<>("index") | + std::optional{} + / Meta<>("mode") | + std::optional{} + / Meta<>("complete") | + + // children + --Child> + ("products") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "index", + "mode", + "complete", + "products" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "index", + "mode", + "complete", + "products" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + index{this}; + Field> + mode{this}; + Field> + complete{this}; + + // children + Field> + products{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->mode, \ + this->complete, \ + this->products \ + ) + + // default + Decay() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Decay( + const wrapper + &index, + const wrapper> + &mode = {}, + const wrapper> + &complete = {}, + const wrapper> + &products = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + index(this,index), + mode(this,mode), + complete(this,complete), + products(this,products) + { + Component::finish(); + } + + // from node + explicit Decay(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Decay(const Decay &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + index(this,other.index), + mode(this,other.mode), + complete(this,other.complete), + products(this,other.products) + { + Component::finish(other); + } + + // move + Decay(Decay &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + index(this,std::move(other.index)), + mode(this,std::move(other.mode)), + complete(this,std::move(other.complete)), + products(this,std::move(other.products)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Decay &operator=(const Decay &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + index = other.index; + mode = other.mode; + complete = other.complete; + products = other.products; + } + return *this; + } + + // move + Decay &operator=(Decay &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + index = std::move(other.index); + mode = std::move(other.mode); + complete = std::move(other.complete); + products = std::move(other.products); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Decay/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Decay + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Decay/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Decay/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Decay/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayData.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayData.hpp new file mode 100644 index 000000000..3f55e2a0e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayData.hpp @@ -0,0 +1,199 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DECAYDATA +#define GNDS_V2_0_GENERAL_DECAYDATA + +#include "GNDS/v2.0/general/DecayModes.hpp" +#include "GNDS/v2.0/general/AverageEnergies.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DecayData +// ----------------------------------------------------------------------------- + +class DecayData : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DecayData"; } + static auto NODENAME() { return "decayData"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("decayModes") | + --Child> + ("averageEnergies") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "decayModes", + "averageEnergies" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "decay_modes", + "average_energies" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + decayModes{this}; + Field> + averageEnergies{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(decayModes(),decayMode); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->decayModes, \ + this->averageEnergies \ + ) + + // default + DecayData() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DecayData( + const wrapper + &decayModes, + const wrapper> + &averageEnergies = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + decayModes(this,decayModes), + averageEnergies(this,averageEnergies) + { + Component::finish(); + } + + // from node + explicit DecayData(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayData(const DecayData &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + decayModes(this,other.decayModes), + averageEnergies(this,other.averageEnergies) + { + Component::finish(other); + } + + // move + DecayData(DecayData &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + decayModes(this,std::move(other.decayModes)), + averageEnergies(this,std::move(other.averageEnergies)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DecayData &operator=(const DecayData &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + decayModes = other.decayModes; + averageEnergies = other.averageEnergies; + } + return *this; + } + + // move + DecayData &operator=(DecayData &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + decayModes = std::move(other.decayModes); + averageEnergies = std::move(other.averageEnergies); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DecayData/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DecayData + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayData/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayMode.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayMode.hpp new file mode 100644 index 000000000..f42bf4f8e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayMode.hpp @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DECAYMODE +#define GNDS_V2_0_GENERAL_DECAYMODE + +#include "GNDS/v2.0/general/Probability.hpp" +#include "GNDS/v2.0/general/DecayPath.hpp" +#include "GNDS/v2.0/general/PhotonEmissionProbabilities.hpp" +#include "GNDS/v2.0/general/Q.hpp" +#include "GNDS/v2.0/general/Spectra.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DecayMode +// ----------------------------------------------------------------------------- + +class DecayMode : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DecayMode"; } + static auto NODENAME() { return "decayMode"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("mode") | + + // children + --Child + ("probability") | + --Child + ("decayPath") | + --Child> + ("photonEmissionProbabilities") | + --Child> + ("Q") | + --Child> + ("spectra") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "mode", + "probability", + "decayPath", + "photonEmissionProbabilities", + "Q", + "spectra" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "mode", + "probability", + "decay_path", + "photon_emission_probabilities", + "q", + "spectra" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + mode{this}; + + // children + Field + probability{this}; + Field + decayPath{this}; + Field> + photonEmissionProbabilities{this}; + Field> + Q{this}; + Field> + spectra{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(decayPath(),decay); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->mode, \ + this->probability, \ + this->decayPath, \ + this->photonEmissionProbabilities, \ + this->Q, \ + this->spectra \ + ) + + // default + DecayMode() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DecayMode( + const wrapper> + &label, + const wrapper> + &mode = {}, + const wrapper + &probability = {}, + const wrapper + &decayPath = {}, + const wrapper> + &photonEmissionProbabilities = {}, + const wrapper> + &Q = {}, + const wrapper> + &spectra = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + mode(this,mode), + probability(this,probability), + decayPath(this,decayPath), + photonEmissionProbabilities(this,photonEmissionProbabilities), + Q(this,Q), + spectra(this,spectra) + { + Component::finish(); + } + + // from node + explicit DecayMode(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayMode(const DecayMode &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + mode(this,other.mode), + probability(this,other.probability), + decayPath(this,other.decayPath), + photonEmissionProbabilities(this,other.photonEmissionProbabilities), + Q(this,other.Q), + spectra(this,other.spectra) + { + Component::finish(other); + } + + // move + DecayMode(DecayMode &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + mode(this,std::move(other.mode)), + probability(this,std::move(other.probability)), + decayPath(this,std::move(other.decayPath)), + photonEmissionProbabilities(this,std::move(other.photonEmissionProbabilities)), + Q(this,std::move(other.Q)), + spectra(this,std::move(other.spectra)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DecayMode &operator=(const DecayMode &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + mode = other.mode; + probability = other.probability; + decayPath = other.decayPath; + photonEmissionProbabilities = other.photonEmissionProbabilities; + Q = other.Q; + spectra = other.spectra; + } + return *this; + } + + // move + DecayMode &operator=(DecayMode &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + mode = std::move(other.mode); + probability = std::move(other.probability); + decayPath = std::move(other.decayPath); + photonEmissionProbabilities = std::move(other.photonEmissionProbabilities); + Q = std::move(other.Q); + spectra = std::move(other.spectra); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DecayMode/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DecayMode + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayMode/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayMode/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayMode/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayModes.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayModes.hpp new file mode 100644 index 000000000..87ccf9124 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayModes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DECAYMODES +#define GNDS_V2_0_GENERAL_DECAYMODES + +#include "GNDS/v2.0/general/DecayMode.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DecayModes +// ----------------------------------------------------------------------------- + +class DecayModes : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DecayModes"; } + static auto NODENAME() { return "decayModes"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("decayMode") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "decayMode" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "decay_mode" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + decayMode{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->decayMode \ + ) + + // default + DecayModes() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DecayModes( + const wrapper> + &decayMode + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + decayMode(this,decayMode) + { + Component::finish(); + } + + // from node + explicit DecayModes(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayModes(const DecayModes &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + decayMode(this,other.decayMode) + { + Component::finish(other); + } + + // move + DecayModes(DecayModes &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + decayMode(this,std::move(other.decayMode)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DecayModes &operator=(const DecayModes &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + decayMode = other.decayMode; + } + return *this; + } + + // move + DecayModes &operator=(DecayModes &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + decayMode = std::move(other.decayMode); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DecayModes/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DecayModes + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayModes/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayModes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayModes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayPath.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayPath.hpp new file mode 100644 index 000000000..c9e6fbdc2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayPath.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DECAYPATH +#define GNDS_V2_0_GENERAL_DECAYPATH + +#include "GNDS/v2.0/general/Decay.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DecayPath +// ----------------------------------------------------------------------------- + +class DecayPath : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DecayPath"; } + static auto NODENAME() { return "decayPath"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("decay") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "decay" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "decay" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + decay{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->decay \ + ) + + // default + DecayPath() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DecayPath( + const wrapper> + &decay + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + decay(this,decay) + { + Component::finish(); + } + + // from node + explicit DecayPath(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DecayPath(const DecayPath &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + decay(this,other.decay) + { + Component::finish(other); + } + + // move + DecayPath(DecayPath &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + decay(this,std::move(other.decay)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DecayPath &operator=(const DecayPath &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + decay = other.decay; + } + return *this; + } + + // move + DecayPath &operator=(DecayPath &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + decay = std::move(other.decay); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DecayPath/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DecayPath + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayPath/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayPath/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DecayPath/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedBetaEnergy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedBetaEnergy.hpp new file mode 100644 index 000000000..8741d04f5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedBetaEnergy.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DELAYEDBETAENERGY +#define GNDS_V2_0_GENERAL_DELAYEDBETAENERGY + +#include "GNDS/v2.0/general/Polynomial1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DelayedBetaEnergy +// ----------------------------------------------------------------------------- + +class DelayedBetaEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DelayedBetaEnergy"; } + static auto NODENAME() { return "delayedBetaEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("polynomial1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + polynomial1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(polynomial1d(),axes); + NJOY_GNDSTK_SHORTCUT(polynomial1d().axes(),axis); + NJOY_GNDSTK_SHORTCUT(polynomial1d().axes(),grid); + NJOY_GNDSTK_SHORTCUT(polynomial1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(polynomial1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + DelayedBetaEnergy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedBetaEnergy( + const wrapper + &polynomial1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit DelayedBetaEnergy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedBetaEnergy(const DelayedBetaEnergy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + DelayedBetaEnergy(DelayedBetaEnergy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + polynomial1d(this,std::move(other.polynomial1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DelayedBetaEnergy &operator=(const DelayedBetaEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + polynomial1d = other.polynomial1d; + } + return *this; + } + + // move + DelayedBetaEnergy &operator=(DelayedBetaEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + polynomial1d = std::move(other.polynomial1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DelayedBetaEnergy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DelayedBetaEnergy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedBetaEnergy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedBetaEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedBetaEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedGammaEnergy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedGammaEnergy.hpp new file mode 100644 index 000000000..2b5887ded --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedGammaEnergy.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DELAYEDGAMMAENERGY +#define GNDS_V2_0_GENERAL_DELAYEDGAMMAENERGY + +#include "GNDS/v2.0/general/Polynomial1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DelayedGammaEnergy +// ----------------------------------------------------------------------------- + +class DelayedGammaEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DelayedGammaEnergy"; } + static auto NODENAME() { return "delayedGammaEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("polynomial1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + polynomial1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(polynomial1d(),axes); + NJOY_GNDSTK_SHORTCUT(polynomial1d().axes(),axis); + NJOY_GNDSTK_SHORTCUT(polynomial1d().axes(),grid); + NJOY_GNDSTK_SHORTCUT(polynomial1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(polynomial1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + DelayedGammaEnergy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedGammaEnergy( + const wrapper + &polynomial1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit DelayedGammaEnergy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedGammaEnergy(const DelayedGammaEnergy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + DelayedGammaEnergy(DelayedGammaEnergy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + polynomial1d(this,std::move(other.polynomial1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DelayedGammaEnergy &operator=(const DelayedGammaEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + polynomial1d = other.polynomial1d; + } + return *this; + } + + // move + DelayedGammaEnergy &operator=(DelayedGammaEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + polynomial1d = std::move(other.polynomial1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DelayedGammaEnergy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DelayedGammaEnergy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedGammaEnergy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedGammaEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedGammaEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutron.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutron.hpp new file mode 100644 index 000000000..429cddf43 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutron.hpp @@ -0,0 +1,229 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DELAYEDNEUTRON +#define GNDS_V2_0_GENERAL_DELAYEDNEUTRON + +#include "GNDS/v2.0/general/Rate.hpp" +#include "GNDS/v2.0/reduced/Product.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DelayedNeutron +// ----------------------------------------------------------------------------- + +class DelayedNeutron : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DelayedNeutron"; } + static auto NODENAME() { return "delayedNeutron"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + + // children + --Child + ("rate") | + --Child + ("product") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "rate", + "product" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "rate", + "product" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children + Field + rate{this}; + Field + product{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(rate(),Double); + NJOY_GNDSTK_SHORTCUT(product().multiplicity(),XYs1d); + NJOY_GNDSTK_SHORTCUT(product().distribution(),XYs2d); + NJOY_GNDSTK_SHORTCUT(product().multiplicity(),branching1d); + NJOY_GNDSTK_SHORTCUT(product().multiplicity(),constant1d); + NJOY_GNDSTK_SHORTCUT(product(),distribution); + NJOY_GNDSTK_SHORTCUT(product(),multiplicity); + NJOY_GNDSTK_SHORTCUT(product().multiplicity(),polynomial1d); + NJOY_GNDSTK_SHORTCUT(product().multiplicity(),reference); + NJOY_GNDSTK_SHORTCUT(product().multiplicity(),regions1d); + NJOY_GNDSTK_SHORTCUT(product().distribution(),thermalNeutronScatteringLaw); + NJOY_GNDSTK_SHORTCUT(rate().Double(),uncertainty); + NJOY_GNDSTK_SHORTCUT(product().distribution(),uncorrelated); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->rate, \ + this->product \ + ) + + // default + DelayedNeutron() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedNeutron( + const wrapper + &label, + const wrapper + &rate = {}, + const wrapper + &product = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + rate(this,rate), + product(this,product) + { + Component::finish(); + } + + // from node + explicit DelayedNeutron(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedNeutron(const DelayedNeutron &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + rate(this,other.rate), + product(this,other.product) + { + Component::finish(other); + } + + // move + DelayedNeutron(DelayedNeutron &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + rate(this,std::move(other.rate)), + product(this,std::move(other.product)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DelayedNeutron &operator=(const DelayedNeutron &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + rate = other.rate; + product = other.product; + } + return *this; + } + + // move + DelayedNeutron &operator=(DelayedNeutron &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + rate = std::move(other.rate); + product = std::move(other.product); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DelayedNeutron/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DelayedNeutron + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutron/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutron/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutron/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutronKE.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutronKE.hpp new file mode 100644 index 000000000..3f7ab55e7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutronKE.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DELAYEDNEUTRONKE +#define GNDS_V2_0_GENERAL_DELAYEDNEUTRONKE + +#include "GNDS/v2.0/general/Polynomial1d.hpp" +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DelayedNeutronKE +// ----------------------------------------------------------------------------- + +class DelayedNeutronKE : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DelayedNeutronKE"; } + static auto NODENAME() { return "delayedNeutronKE"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("polynomial1d") | + --Child> + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + polynomial1d{this}; + Field> + XYs1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d, \ + this->XYs1d \ + ) + + // default + DelayedNeutronKE() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedNeutronKE( + const wrapper> + &polynomial1d, + const wrapper> + &XYs1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit DelayedNeutronKE(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedNeutronKE(const DelayedNeutronKE &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + DelayedNeutronKE(DelayedNeutronKE &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + polynomial1d(this,std::move(other.polynomial1d)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DelayedNeutronKE &operator=(const DelayedNeutronKE &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + polynomial1d = other.polynomial1d; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + DelayedNeutronKE &operator=(DelayedNeutronKE &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + polynomial1d = std::move(other.polynomial1d); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DelayedNeutronKE/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DelayedNeutronKE + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutronKE/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutronKE/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutronKE/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutrons.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutrons.hpp new file mode 100644 index 000000000..7dd9acfbb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutrons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DELAYEDNEUTRONS +#define GNDS_V2_0_GENERAL_DELAYEDNEUTRONS + +#include "GNDS/v2.0/general/DelayedNeutron.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DelayedNeutrons +// ----------------------------------------------------------------------------- + +class DelayedNeutrons : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DelayedNeutrons"; } + static auto NODENAME() { return "delayedNeutrons"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("delayedNeutron") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "delayedNeutron" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "delayed_neutron" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + delayedNeutron{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->delayedNeutron \ + ) + + // default + DelayedNeutrons() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DelayedNeutrons( + const wrapper> + &delayedNeutron + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + delayedNeutron(this,delayedNeutron) + { + Component::finish(); + } + + // from node + explicit DelayedNeutrons(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DelayedNeutrons(const DelayedNeutrons &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + delayedNeutron(this,other.delayedNeutron) + { + Component::finish(other); + } + + // move + DelayedNeutrons(DelayedNeutrons &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + delayedNeutron(this,std::move(other.delayedNeutron)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DelayedNeutrons &operator=(const DelayedNeutrons &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + delayedNeutron = other.delayedNeutron; + } + return *this; + } + + // move + DelayedNeutrons &operator=(DelayedNeutrons &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + delayedNeutron = std::move(other.delayedNeutron); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DelayedNeutrons/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DelayedNeutrons + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutrons/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutrons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DelayedNeutrons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Discrete.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Discrete.hpp new file mode 100644 index 000000000..925321012 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Discrete.hpp @@ -0,0 +1,256 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DISCRETE +#define GNDS_V2_0_GENERAL_DISCRETE + +#include "GNDS/v2.0/general/Intensity.hpp" +#include "GNDS/v2.0/general/Energy.hpp" +#include "GNDS/v2.0/general/InternalConversionCoefficients.hpp" +#include "GNDS/v2.0/general/PositronEmissionIntensity.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Discrete +// ----------------------------------------------------------------------------- + +class Discrete : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Discrete"; } + static auto NODENAME() { return "discrete"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("type") | + + // children + --Child + ("intensity") | + --Child + ("energy") | + --Child> + ("internalConversionCoefficients") | + --Child> + ("positronEmissionIntensity") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "type", + "intensity", + "energy", + "internalConversionCoefficients", + "positronEmissionIntensity" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "type", + "intensity", + "energy", + "internal_conversion_coefficients", + "positron_emission_intensity" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + type{this}; + + // children + Field + intensity{this}; + Field + energy{this}; + Field> + internalConversionCoefficients{this}; + Field> + positronEmissionIntensity{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(energy(),Double); + NJOY_GNDSTK_SHORTCUT(energy(),MadlandNix); + NJOY_GNDSTK_SHORTCUT(energy(),NBodyPhaseSpace); + NJOY_GNDSTK_SHORTCUT(energy(),XYs2d); + NJOY_GNDSTK_SHORTCUT(energy(),discreteGamma); + NJOY_GNDSTK_SHORTCUT(energy(),evaporation); + NJOY_GNDSTK_SHORTCUT(energy(),generalEvaporation); + NJOY_GNDSTK_SHORTCUT(energy(),primaryGamma); + NJOY_GNDSTK_SHORTCUT(energy(),simpleMaxwellianFission); + NJOY_GNDSTK_SHORTCUT(energy(),weightedFunctionals); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->type, \ + this->intensity, \ + this->energy, \ + this->internalConversionCoefficients, \ + this->positronEmissionIntensity \ + ) + + // default + Discrete() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Discrete( + const wrapper> + &type, + const wrapper + &intensity = {}, + const wrapper + &energy = {}, + const wrapper> + &internalConversionCoefficients = {}, + const wrapper> + &positronEmissionIntensity = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + type(this,type), + intensity(this,intensity), + energy(this,energy), + internalConversionCoefficients(this,internalConversionCoefficients), + positronEmissionIntensity(this,positronEmissionIntensity) + { + Component::finish(); + } + + // from node + explicit Discrete(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Discrete(const Discrete &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + type(this,other.type), + intensity(this,other.intensity), + energy(this,other.energy), + internalConversionCoefficients(this,other.internalConversionCoefficients), + positronEmissionIntensity(this,other.positronEmissionIntensity) + { + Component::finish(other); + } + + // move + Discrete(Discrete &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + type(this,std::move(other.type)), + intensity(this,std::move(other.intensity)), + energy(this,std::move(other.energy)), + internalConversionCoefficients(this,std::move(other.internalConversionCoefficients)), + positronEmissionIntensity(this,std::move(other.positronEmissionIntensity)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Discrete &operator=(const Discrete &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + type = other.type; + intensity = other.intensity; + energy = other.energy; + internalConversionCoefficients = other.internalConversionCoefficients; + positronEmissionIntensity = other.positronEmissionIntensity; + } + return *this; + } + + // move + Discrete &operator=(Discrete &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + type = std::move(other.type); + intensity = std::move(other.intensity); + energy = std::move(other.energy); + internalConversionCoefficients = std::move(other.internalConversionCoefficients); + positronEmissionIntensity = std::move(other.positronEmissionIntensity); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Discrete/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Discrete + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Discrete/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Discrete/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Discrete/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DiscreteGamma.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DiscreteGamma.hpp new file mode 100644 index 000000000..028d2be9e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DiscreteGamma.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DISCRETEGAMMA +#define GNDS_V2_0_GENERAL_DISCRETEGAMMA + +#include "GNDS/v2.0/general/Axes.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DiscreteGamma +// ----------------------------------------------------------------------------- + +class DiscreteGamma : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DiscreteGamma"; } + static auto NODENAME() { return "discreteGamma"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") | + double{} + / Meta<>("domainMin") | + double{} + / Meta<>("domainMax") | + + // children + --Child + ("axes") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "domainMin", + "domainMax", + "axes" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "domain_min", + "domain_max", + "axes" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + Field + domainMin{this}; + Field + domainMax{this}; + + // children + Field + axes{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(axes(),axis); + NJOY_GNDSTK_SHORTCUT(axes(),grid); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->domainMin, \ + this->domainMax, \ + this->axes \ + ) + + // default + DiscreteGamma() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DiscreteGamma( + const wrapper + &value, + const wrapper + &domainMin = {}, + const wrapper + &domainMax = {}, + const wrapper + &axes = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + domainMin(this,domainMin), + domainMax(this,domainMax), + axes(this,axes) + { + Component::finish(); + } + + // from node + explicit DiscreteGamma(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DiscreteGamma(const DiscreteGamma &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + axes(this,other.axes) + { + Component::finish(other); + } + + // move + DiscreteGamma(DiscreteGamma &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + axes(this,std::move(other.axes)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DiscreteGamma &operator=(const DiscreteGamma &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + domainMin = other.domainMin; + domainMax = other.domainMax; + axes = other.axes; + } + return *this; + } + + // move + DiscreteGamma &operator=(DiscreteGamma &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + axes = std::move(other.axes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DiscreteGamma/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DiscreteGamma + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DiscreteGamma/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DiscreteGamma/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DiscreteGamma/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Distribution.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Distribution.hpp new file mode 100644 index 000000000..2633355d3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Distribution.hpp @@ -0,0 +1,329 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DISTRIBUTION +#define GNDS_V2_0_GENERAL_DISTRIBUTION + +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw.hpp" +#include "GNDS/v2.0/general/Uncorrelated.hpp" +#include "GNDS/v2.0/general/Unspecified.hpp" +#include "GNDS/v2.0/general/Branching3d.hpp" +#include "GNDS/v2.0/general/AngularTwoBody.hpp" +#include "GNDS/v2.0/general/EnergyAngular.hpp" +#include "GNDS/v2.0/general/KalbachMann.hpp" +#include "GNDS/v2.0/general/AngularEnergy.hpp" +#include "GNDS/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "GNDS/v2.0/general/CoherentPhotonScattering.hpp" +#include "GNDS/v2.0/general/IncoherentPhotonScattering.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Distribution +// ----------------------------------------------------------------------------- + +class Distribution : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Distribution"; } + static auto NODENAME() { return "distribution"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("thermalNeutronScatteringLaw") | + --Child> + ("uncorrelated") | + --Child> + ("unspecified") | + --Child> + ("branching3d") | + --Child> + ("angularTwoBody") | + --Child> + ("energyAngular") | + --Child> + ("KalbachMann") | + --Child> + ("angularEnergy") | + --Child> + ("CoulombPlusNuclearElastic") | + --Child> + ("coherentPhotonScattering") | + --Child> + ("incoherentPhotonScattering") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "thermalNeutronScatteringLaw", + "uncorrelated", + "unspecified", + "branching3d", + "angularTwoBody", + "energyAngular", + "KalbachMann", + "angularEnergy", + "CoulombPlusNuclearElastic", + "coherentPhotonScattering", + "incoherentPhotonScattering" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "thermal_neutron_scattering_law", + "uncorrelated", + "unspecified", + "branching3d", + "angular_two_body", + "energy_angular", + "kalbach_mann", + "angular_energy", + "coulomb_plus_nuclear_elastic", + "coherent_photon_scattering", + "incoherent_photon_scattering" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + thermalNeutronScatteringLaw{this}; + Field> + uncorrelated{this}; + Field> + unspecified{this}; + Field> + branching3d{this}; + Field> + angularTwoBody{this}; + Field> + energyAngular{this}; + Field> + KalbachMann{this}; + Field> + angularEnergy{this}; + Field> + CoulombPlusNuclearElastic{this}; + Field> + coherentPhotonScattering{this}; + Field> + incoherentPhotonScattering{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->thermalNeutronScatteringLaw, \ + this->uncorrelated, \ + this->unspecified, \ + this->branching3d, \ + this->angularTwoBody, \ + this->energyAngular, \ + this->KalbachMann, \ + this->angularEnergy, \ + this->CoulombPlusNuclearElastic, \ + this->coherentPhotonScattering, \ + this->incoherentPhotonScattering \ + ) + + // default + Distribution() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Distribution( + const wrapper> + &thermalNeutronScatteringLaw, + const wrapper> + &uncorrelated = {}, + const wrapper> + &unspecified = {}, + const wrapper> + &branching3d = {}, + const wrapper> + &angularTwoBody = {}, + const wrapper> + &energyAngular = {}, + const wrapper> + &KalbachMann = {}, + const wrapper> + &angularEnergy = {}, + const wrapper> + &CoulombPlusNuclearElastic = {}, + const wrapper> + &coherentPhotonScattering = {}, + const wrapper> + &incoherentPhotonScattering = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + thermalNeutronScatteringLaw(this,thermalNeutronScatteringLaw), + uncorrelated(this,uncorrelated), + unspecified(this,unspecified), + branching3d(this,branching3d), + angularTwoBody(this,angularTwoBody), + energyAngular(this,energyAngular), + KalbachMann(this,KalbachMann), + angularEnergy(this,angularEnergy), + CoulombPlusNuclearElastic(this,CoulombPlusNuclearElastic), + coherentPhotonScattering(this,coherentPhotonScattering), + incoherentPhotonScattering(this,incoherentPhotonScattering) + { + Component::finish(); + } + + // from node + explicit Distribution(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Distribution(const Distribution &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + thermalNeutronScatteringLaw(this,other.thermalNeutronScatteringLaw), + uncorrelated(this,other.uncorrelated), + unspecified(this,other.unspecified), + branching3d(this,other.branching3d), + angularTwoBody(this,other.angularTwoBody), + energyAngular(this,other.energyAngular), + KalbachMann(this,other.KalbachMann), + angularEnergy(this,other.angularEnergy), + CoulombPlusNuclearElastic(this,other.CoulombPlusNuclearElastic), + coherentPhotonScattering(this,other.coherentPhotonScattering), + incoherentPhotonScattering(this,other.incoherentPhotonScattering) + { + Component::finish(other); + } + + // move + Distribution(Distribution &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + thermalNeutronScatteringLaw(this,std::move(other.thermalNeutronScatteringLaw)), + uncorrelated(this,std::move(other.uncorrelated)), + unspecified(this,std::move(other.unspecified)), + branching3d(this,std::move(other.branching3d)), + angularTwoBody(this,std::move(other.angularTwoBody)), + energyAngular(this,std::move(other.energyAngular)), + KalbachMann(this,std::move(other.KalbachMann)), + angularEnergy(this,std::move(other.angularEnergy)), + CoulombPlusNuclearElastic(this,std::move(other.CoulombPlusNuclearElastic)), + coherentPhotonScattering(this,std::move(other.coherentPhotonScattering)), + incoherentPhotonScattering(this,std::move(other.incoherentPhotonScattering)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Distribution &operator=(const Distribution &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + thermalNeutronScatteringLaw = other.thermalNeutronScatteringLaw; + uncorrelated = other.uncorrelated; + unspecified = other.unspecified; + branching3d = other.branching3d; + angularTwoBody = other.angularTwoBody; + energyAngular = other.energyAngular; + KalbachMann = other.KalbachMann; + angularEnergy = other.angularEnergy; + CoulombPlusNuclearElastic = other.CoulombPlusNuclearElastic; + coherentPhotonScattering = other.coherentPhotonScattering; + incoherentPhotonScattering = other.incoherentPhotonScattering; + } + return *this; + } + + // move + Distribution &operator=(Distribution &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + thermalNeutronScatteringLaw = std::move(other.thermalNeutronScatteringLaw); + uncorrelated = std::move(other.uncorrelated); + unspecified = std::move(other.unspecified); + branching3d = std::move(other.branching3d); + angularTwoBody = std::move(other.angularTwoBody); + energyAngular = std::move(other.energyAngular); + KalbachMann = std::move(other.KalbachMann); + angularEnergy = std::move(other.angularEnergy); + CoulombPlusNuclearElastic = std::move(other.CoulombPlusNuclearElastic); + coherentPhotonScattering = std::move(other.coherentPhotonScattering); + incoherentPhotonScattering = std::move(other.incoherentPhotonScattering); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Distribution/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Distribution + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Distribution/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Distribution/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Distribution/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Documentation.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Documentation.hpp new file mode 100644 index 000000000..23efa1f40 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Documentation.hpp @@ -0,0 +1,245 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DOCUMENTATION +#define GNDS_V2_0_GENERAL_DOCUMENTATION + +#include "GNDS/v2.0/general/Authors.hpp" +#include "GNDS/v2.0/general/Dates.hpp" +#include "GNDS/v2.0/general/Title.hpp" +#include "GNDS/v2.0/general/Body.hpp" +#include "GNDS/v2.0/general/EndfCompatible.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Documentation +// ----------------------------------------------------------------------------- + +class Documentation : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Documentation"; } + static auto NODENAME() { return "documentation"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("authors") | + --Child + ("dates") | + --Child + ("title") | + --Child + ("body") | + --Child> + ("endfCompatible") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "authors", + "dates", + "title", + "body", + "endfCompatible" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "authors", + "dates", + "title", + "body", + "endf_compatible" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + authors{this}; + Field + dates{this}; + Field + title{this}; + Field + body{this}; + Field> + endfCompatible{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(authors(),author); + NJOY_GNDSTK_SHORTCUT(dates(),date); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->authors, \ + this->dates, \ + this->title, \ + this->body, \ + this->endfCompatible \ + ) + + // default + Documentation() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Documentation( + const wrapper + &authors, + const wrapper + &dates = {}, + const wrapper + &title = {}, + const wrapper + &body = {}, + const wrapper> + &endfCompatible = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + authors(this,authors), + dates(this,dates), + title(this,title), + body(this,body), + endfCompatible(this,endfCompatible) + { + Component::finish(); + } + + // from node + explicit Documentation(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Documentation(const Documentation &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + authors(this,other.authors), + dates(this,other.dates), + title(this,other.title), + body(this,other.body), + endfCompatible(this,other.endfCompatible) + { + Component::finish(other); + } + + // move + Documentation(Documentation &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + authors(this,std::move(other.authors)), + dates(this,std::move(other.dates)), + title(this,std::move(other.title)), + body(this,std::move(other.body)), + endfCompatible(this,std::move(other.endfCompatible)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Documentation &operator=(const Documentation &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + authors = other.authors; + dates = other.dates; + title = other.title; + body = other.body; + endfCompatible = other.endfCompatible; + } + return *this; + } + + // move + Documentation &operator=(Documentation &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + authors = std::move(other.authors); + dates = std::move(other.dates); + title = std::move(other.title); + body = std::move(other.body); + endfCompatible = std::move(other.endfCompatible); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Documentation/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Documentation + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Documentation/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Documentation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Documentation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Double.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Double.hpp new file mode 100644 index 000000000..275b92bf1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Double.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DOUBLE +#define GNDS_V2_0_GENERAL_DOUBLE + +#include "GNDS/v2.0/general/Uncertainty.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Double +// ----------------------------------------------------------------------------- + +class Double : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Double"; } + static auto NODENAME() { return "double"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + double{} + / Meta<>("value") | + std::optional{} + / Meta<>("unit") | + + // children + --Child> + ("uncertainty") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "unit", + "uncertainty" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "unit", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + value{this}; + Field> + unit{this}; + + // children + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit, \ + this->uncertainty \ + ) + + // default + Double() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Double( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper> + &unit = {}, + const wrapper> + &uncertainty = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Double(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Double(const Double &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + unit(this,other.unit), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Double(Double &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Double &operator=(const Double &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + unit = other.unit; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + Double &operator=(Double &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + value = std::move(other.value); + unit = std::move(other.unit); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Double/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Double + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Double/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Double/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Double/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DoubleDifferentialCrossSection.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DoubleDifferentialCrossSection.hpp new file mode 100644 index 000000000..7731a4c00 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DoubleDifferentialCrossSection.hpp @@ -0,0 +1,254 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_DOUBLEDIFFERENTIALCROSSSECTION +#define GNDS_V2_0_GENERAL_DOUBLEDIFFERENTIALCROSSSECTION + +#include "GNDS/v2.0/general/CoulombPlusNuclearElastic.hpp" +#include "GNDS/v2.0/general/CoherentPhotonScattering.hpp" +#include "GNDS/v2.0/general/IncoherentPhotonScattering.hpp" +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp" +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp" +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class DoubleDifferentialCrossSection +// ----------------------------------------------------------------------------- + +class DoubleDifferentialCrossSection : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "DoubleDifferentialCrossSection"; } + static auto NODENAME() { return "doubleDifferentialCrossSection"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("CoulombPlusNuclearElastic") | + --Child> + ("coherentPhotonScattering") | + --Child> + ("incoherentPhotonScattering") | + --Child> + ("thermalNeutronScatteringLaw_coherentElastic") | + --Child> + ("thermalNeutronScatteringLaw_incoherentElastic") | + --Child> + ("thermalNeutronScatteringLaw_incoherentInelastic") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "CoulombPlusNuclearElastic", + "coherentPhotonScattering", + "incoherentPhotonScattering", + "thermalNeutronScatteringLaw_coherentElastic", + "thermalNeutronScatteringLaw_incoherentElastic", + "thermalNeutronScatteringLaw_incoherentInelastic" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "coulomb_plus_nuclear_elastic", + "coherent_photon_scattering", + "incoherent_photon_scattering", + "thermal_neutron_scattering_law_coherent_elastic", + "thermal_neutron_scattering_law_incoherent_elastic", + "thermal_neutron_scattering_law_incoherent_inelastic" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + CoulombPlusNuclearElastic{this}; + Field> + coherentPhotonScattering{this}; + Field> + incoherentPhotonScattering{this}; + Field> + thermalNeutronScatteringLaw_coherentElastic{this}; + Field> + thermalNeutronScatteringLaw_incoherentElastic{this}; + Field> + thermalNeutronScatteringLaw_incoherentInelastic{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->CoulombPlusNuclearElastic, \ + this->coherentPhotonScattering, \ + this->incoherentPhotonScattering, \ + this->thermalNeutronScatteringLaw_coherentElastic, \ + this->thermalNeutronScatteringLaw_incoherentElastic, \ + this->thermalNeutronScatteringLaw_incoherentInelastic \ + ) + + // default + DoubleDifferentialCrossSection() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit DoubleDifferentialCrossSection( + const wrapper> + &CoulombPlusNuclearElastic, + const wrapper> + &coherentPhotonScattering = {}, + const wrapper> + &incoherentPhotonScattering = {}, + const wrapper> + &thermalNeutronScatteringLaw_coherentElastic = {}, + const wrapper> + &thermalNeutronScatteringLaw_incoherentElastic = {}, + const wrapper> + &thermalNeutronScatteringLaw_incoherentInelastic = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + CoulombPlusNuclearElastic(this,CoulombPlusNuclearElastic), + coherentPhotonScattering(this,coherentPhotonScattering), + incoherentPhotonScattering(this,incoherentPhotonScattering), + thermalNeutronScatteringLaw_coherentElastic(this,thermalNeutronScatteringLaw_coherentElastic), + thermalNeutronScatteringLaw_incoherentElastic(this,thermalNeutronScatteringLaw_incoherentElastic), + thermalNeutronScatteringLaw_incoherentInelastic(this,thermalNeutronScatteringLaw_incoherentInelastic) + { + Component::finish(); + } + + // from node + explicit DoubleDifferentialCrossSection(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + DoubleDifferentialCrossSection(const DoubleDifferentialCrossSection &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + CoulombPlusNuclearElastic(this,other.CoulombPlusNuclearElastic), + coherentPhotonScattering(this,other.coherentPhotonScattering), + incoherentPhotonScattering(this,other.incoherentPhotonScattering), + thermalNeutronScatteringLaw_coherentElastic(this,other.thermalNeutronScatteringLaw_coherentElastic), + thermalNeutronScatteringLaw_incoherentElastic(this,other.thermalNeutronScatteringLaw_incoherentElastic), + thermalNeutronScatteringLaw_incoherentInelastic(this,other.thermalNeutronScatteringLaw_incoherentInelastic) + { + Component::finish(other); + } + + // move + DoubleDifferentialCrossSection(DoubleDifferentialCrossSection &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + CoulombPlusNuclearElastic(this,std::move(other.CoulombPlusNuclearElastic)), + coherentPhotonScattering(this,std::move(other.coherentPhotonScattering)), + incoherentPhotonScattering(this,std::move(other.incoherentPhotonScattering)), + thermalNeutronScatteringLaw_coherentElastic(this,std::move(other.thermalNeutronScatteringLaw_coherentElastic)), + thermalNeutronScatteringLaw_incoherentElastic(this,std::move(other.thermalNeutronScatteringLaw_incoherentElastic)), + thermalNeutronScatteringLaw_incoherentInelastic(this,std::move(other.thermalNeutronScatteringLaw_incoherentInelastic)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + DoubleDifferentialCrossSection &operator=(const DoubleDifferentialCrossSection &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + CoulombPlusNuclearElastic = other.CoulombPlusNuclearElastic; + coherentPhotonScattering = other.coherentPhotonScattering; + incoherentPhotonScattering = other.incoherentPhotonScattering; + thermalNeutronScatteringLaw_coherentElastic = other.thermalNeutronScatteringLaw_coherentElastic; + thermalNeutronScatteringLaw_incoherentElastic = other.thermalNeutronScatteringLaw_incoherentElastic; + thermalNeutronScatteringLaw_incoherentInelastic = other.thermalNeutronScatteringLaw_incoherentInelastic; + } + return *this; + } + + // move + DoubleDifferentialCrossSection &operator=(DoubleDifferentialCrossSection &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + CoulombPlusNuclearElastic = std::move(other.CoulombPlusNuclearElastic); + coherentPhotonScattering = std::move(other.coherentPhotonScattering); + incoherentPhotonScattering = std::move(other.incoherentPhotonScattering); + thermalNeutronScatteringLaw_coherentElastic = std::move(other.thermalNeutronScatteringLaw_coherentElastic); + thermalNeutronScatteringLaw_incoherentElastic = std::move(other.thermalNeutronScatteringLaw_incoherentElastic); + thermalNeutronScatteringLaw_incoherentInelastic = std::move(other.thermalNeutronScatteringLaw_incoherentInelastic); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/DoubleDifferentialCrossSection/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class DoubleDifferentialCrossSection + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DoubleDifferentialCrossSection/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DoubleDifferentialCrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/DoubleDifferentialCrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFH.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFH.hpp new file mode 100644 index 000000000..4570b659f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFH.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_EFH +#define GNDS_V2_0_GENERAL_EFH + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class EFH +// ----------------------------------------------------------------------------- + +class EFH : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "EFH"; } + static auto NODENAME() { return "EFH"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + EFH() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EFH( + const wrapper + &value, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit EFH(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EFH(const EFH &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + EFH(EFH &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EFH &operator=(const EFH &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + unit = other.unit; + } + return *this; + } + + // move + EFH &operator=(EFH &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/EFH/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class EFH + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFH/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFH/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFH/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFL.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFL.hpp new file mode 100644 index 000000000..c33c6b29a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFL.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_EFL +#define GNDS_V2_0_GENERAL_EFL + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class EFL +// ----------------------------------------------------------------------------- + +class EFL : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "EFL"; } + static auto NODENAME() { return "EFL"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + EFL() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EFL( + const wrapper + &value, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit EFL(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EFL(const EFL &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + EFL(EFL &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EFL &operator=(const EFL &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + unit = other.unit; + } + return *this; + } + + // move + EFL &operator=(EFL &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/EFL/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class EFL + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFL/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFL/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EFL/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ENDFconversionFlags.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ENDFconversionFlags.hpp new file mode 100644 index 000000000..4c9b05227 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ENDFconversionFlags.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ENDFCONVERSIONFLAGS +#define GNDS_V2_0_GENERAL_ENDFCONVERSIONFLAGS + +#include "GNDS/v2.0/general/Conversion.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ENDFconversionFlags +// ----------------------------------------------------------------------------- + +class ENDFconversionFlags : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ENDFconversionFlags"; } + static auto NODENAME() { return "ENDFconversionFlags"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("flags") | + std::optional{} + / Meta<>("href") | + + // children + ++Child + ("conversion") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "flags", + "href", + "conversion" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "flags", + "href", + "conversion" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + flags{this}; + Field> + href{this}; + + // children + Field> + conversion{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->flags, \ + this->href, \ + this->conversion \ + ) + + // default + ENDFconversionFlags() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ENDFconversionFlags( + const wrapper> + &flags, + const wrapper> + &href = {}, + const wrapper> + &conversion = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + flags(this,flags), + href(this,href), + conversion(this,conversion) + { + Component::finish(); + } + + // from node + explicit ENDFconversionFlags(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ENDFconversionFlags(const ENDFconversionFlags &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + flags(this,other.flags), + href(this,other.href), + conversion(this,other.conversion) + { + Component::finish(other); + } + + // move + ENDFconversionFlags(ENDFconversionFlags &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + flags(this,std::move(other.flags)), + href(this,std::move(other.href)), + conversion(this,std::move(other.conversion)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ENDFconversionFlags &operator=(const ENDFconversionFlags &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + flags = other.flags; + href = other.href; + conversion = other.conversion; + } + return *this; + } + + // move + ENDFconversionFlags &operator=(ENDFconversionFlags &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + flags = std::move(other.flags); + href = std::move(other.href); + conversion = std::move(other.conversion); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ENDFconversionFlags/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ENDFconversionFlags + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ENDFconversionFlags/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ENDFconversionFlags/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ENDFconversionFlags/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_critical.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_critical.hpp new file mode 100644 index 000000000..ae23542d9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_critical.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_E_CRITICAL +#define GNDS_V2_0_GENERAL_E_CRITICAL + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class E_critical +// ----------------------------------------------------------------------------- + +class E_critical : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "E_critical"; } + static auto NODENAME() { return "e_critical"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + E_critical() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit E_critical( + const wrapper + &value, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit E_critical(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + E_critical(const E_critical &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + E_critical(E_critical &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + E_critical &operator=(const E_critical &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + unit = other.unit; + } + return *this; + } + + // move + E_critical &operator=(E_critical &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/E_critical/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class E_critical + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_critical/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_critical/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_critical/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_max.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_max.hpp new file mode 100644 index 000000000..6426e0d77 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_max.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_E_MAX +#define GNDS_V2_0_GENERAL_E_MAX + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class E_max +// ----------------------------------------------------------------------------- + +class E_max : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "E_max"; } + static auto NODENAME() { return "e_max"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + E_max() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit E_max( + const wrapper + &value, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit E_max(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + E_max(const E_max &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + E_max(E_max &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + E_max &operator=(const E_max &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + unit = other.unit; + } + return *this; + } + + // move + E_max &operator=(E_max &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/E_max/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class E_max + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_max/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_max/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/E_max/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTime.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTime.hpp new file mode 100644 index 000000000..3b24829fb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTime.hpp @@ -0,0 +1,233 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ELAPSEDTIME +#define GNDS_V2_0_GENERAL_ELAPSEDTIME + +#include "GNDS/v2.0/general/Time.hpp" +#include "GNDS/v2.0/general/Yields.hpp" +#include "GNDS/v2.0/general/IncidentEnergies.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ElapsedTime +// ----------------------------------------------------------------------------- + +class ElapsedTime : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ElapsedTime"; } + static auto NODENAME() { return "elapsedTime"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + + // children + --Child + ("time") | + --Child> + ("yields") | + --Child> + ("incidentEnergies") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "time", + "yields", + "incidentEnergies" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "time", + "yields", + "incident_energies" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children + Field + time{this}; + Field> + yields{this}; + Field> + incidentEnergies{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(time(),Double); + NJOY_GNDSTK_SHORTCUT(time(),string); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->time, \ + this->yields, \ + this->incidentEnergies \ + ) + + // default + ElapsedTime() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ElapsedTime( + const wrapper + &label, + const wrapper + &time = {}, + const wrapper> + &yields = {}, + const wrapper> + &incidentEnergies = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + time(this,time), + yields(this,yields), + incidentEnergies(this,incidentEnergies) + { + Component::finish(); + } + + // from node + explicit ElapsedTime(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ElapsedTime(const ElapsedTime &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + time(this,other.time), + yields(this,other.yields), + incidentEnergies(this,other.incidentEnergies) + { + Component::finish(other); + } + + // move + ElapsedTime(ElapsedTime &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + time(this,std::move(other.time)), + yields(this,std::move(other.yields)), + incidentEnergies(this,std::move(other.incidentEnergies)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ElapsedTime &operator=(const ElapsedTime &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + time = other.time; + yields = other.yields; + incidentEnergies = other.incidentEnergies; + } + return *this; + } + + // move + ElapsedTime &operator=(ElapsedTime &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + time = std::move(other.time); + yields = std::move(other.yields); + incidentEnergies = std::move(other.incidentEnergies); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ElapsedTime/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ElapsedTime + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTime/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTime/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTime/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTimes.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTimes.hpp new file mode 100644 index 000000000..b12e01f6c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTimes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ELAPSEDTIMES +#define GNDS_V2_0_GENERAL_ELAPSEDTIMES + +#include "GNDS/v2.0/general/ElapsedTime.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ElapsedTimes +// ----------------------------------------------------------------------------- + +class ElapsedTimes : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ElapsedTimes"; } + static auto NODENAME() { return "elapsedTimes"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("elapsedTime") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "elapsedTime" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "elapsed_time" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + elapsedTime{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->elapsedTime \ + ) + + // default + ElapsedTimes() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ElapsedTimes( + const wrapper> + &elapsedTime + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + elapsedTime(this,elapsedTime) + { + Component::finish(); + } + + // from node + explicit ElapsedTimes(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ElapsedTimes(const ElapsedTimes &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + elapsedTime(this,other.elapsedTime) + { + Component::finish(other); + } + + // move + ElapsedTimes(ElapsedTimes &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + elapsedTime(this,std::move(other.elapsedTime)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ElapsedTimes &operator=(const ElapsedTimes &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + elapsedTime = other.elapsedTime; + } + return *this; + } + + // move + ElapsedTimes &operator=(ElapsedTimes &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + elapsedTime = std::move(other.elapsedTime); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ElapsedTimes/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ElapsedTimes + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTimes/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTimes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ElapsedTimes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EndfCompatible.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EndfCompatible.hpp new file mode 100644 index 000000000..06c5c6448 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EndfCompatible.hpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ENDFCOMPATIBLE +#define GNDS_V2_0_GENERAL_ENDFCOMPATIBLE + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class EndfCompatible +// ----------------------------------------------------------------------------- + +class EndfCompatible : + public Component, + public DataNode +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "EndfCompatible"; } + static auto NODENAME() { return "endfCompatible"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // data + --Child(special::self) / DataConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "string" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "string" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using DataNode::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // data + std::string &string = *this; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + static_cast(*this) \ + ) + + // default + EndfCompatible() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit EndfCompatible(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EndfCompatible(const EndfCompatible &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + EndfCompatible(EndfCompatible &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(std::move(other)), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EndfCompatible &operator=(const EndfCompatible &other) + { + if (this != &other) { + Component::operator=(other); + DataNode::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + EndfCompatible &operator=(EndfCompatible &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + DataNode::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/EndfCompatible/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class EndfCompatible + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EndfCompatible/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EndfCompatible/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EndfCompatible/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Energy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Energy.hpp new file mode 100644 index 000000000..7997f71ca --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Energy.hpp @@ -0,0 +1,361 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ENERGY +#define GNDS_V2_0_GENERAL_ENERGY + +#include "GNDS/v2.0/general/Double.hpp" +#include "GNDS/v2.0/general/Uncertainty.hpp" +#include "GNDS/v2.0/general/NBodyPhaseSpace.hpp" +#include "GNDS/v2.0/general/PrimaryGamma.hpp" +#include "GNDS/v2.0/general/DiscreteGamma.hpp" +#include "GNDS/v2.0/general/XYs2d.hpp" +#include "GNDS/v2.0/general/GeneralEvaporation.hpp" +#include "GNDS/v2.0/general/Evaporation.hpp" +#include "GNDS/v2.0/general/WeightedFunctionals.hpp" +#include "GNDS/v2.0/general/SimpleMaxwellianFission.hpp" +#include "GNDS/v2.0/general/MadlandNix.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Energy +// ----------------------------------------------------------------------------- + +class Energy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Energy"; } + static auto NODENAME() { return "energy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("value") | + std::optional{} + / Meta<>("unit") | + + // children + --Child> + ("double") | + --Child> + ("uncertainty") | + --Child> + ("NBodyPhaseSpace") | + --Child> + ("primaryGamma") | + --Child> + ("discreteGamma") | + --Child> + ("XYs2d") | + --Child> + ("generalEvaporation") | + --Child> + ("evaporation") | + --Child> + ("weightedFunctionals") | + --Child> + ("simpleMaxwellianFission") | + --Child> + ("MadlandNix") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit", + "Double", + "uncertainty", + "NBodyPhaseSpace", + "primaryGamma", + "discreteGamma", + "XYs2d", + "generalEvaporation", + "evaporation", + "weightedFunctionals", + "simpleMaxwellianFission", + "MadlandNix" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit", + "double", + "uncertainty", + "nbody_phase_space", + "primary_gamma", + "discrete_gamma", + "xys2d", + "general_evaporation", + "evaporation", + "weighted_functionals", + "simple_maxwellian_fission", + "madland_nix" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + value{this}; + Field> + unit{this}; + + // children + Field> + Double{this}; + Field> + uncertainty{this}; + Field> + NBodyPhaseSpace{this}; + Field> + primaryGamma{this}; + Field> + discreteGamma{this}; + Field> + XYs2d{this}; + Field> + generalEvaporation{this}; + Field> + evaporation{this}; + Field> + weightedFunctionals{this}; + Field> + simpleMaxwellianFission{this}; + Field> + MadlandNix{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit, \ + this->Double, \ + this->uncertainty, \ + this->NBodyPhaseSpace, \ + this->primaryGamma, \ + this->discreteGamma, \ + this->XYs2d, \ + this->generalEvaporation, \ + this->evaporation, \ + this->weightedFunctionals, \ + this->simpleMaxwellianFission, \ + this->MadlandNix \ + ) + + // default + Energy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Energy( + const wrapper> + &value, + const wrapper> + &unit = {}, + const wrapper> + &Double = {}, + const wrapper> + &uncertainty = {}, + const wrapper> + &NBodyPhaseSpace = {}, + const wrapper> + &primaryGamma = {}, + const wrapper> + &discreteGamma = {}, + const wrapper> + &XYs2d = {}, + const wrapper> + &generalEvaporation = {}, + const wrapper> + &evaporation = {}, + const wrapper> + &weightedFunctionals = {}, + const wrapper> + &simpleMaxwellianFission = {}, + const wrapper> + &MadlandNix = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit), + Double(this,Double), + uncertainty(this,uncertainty), + NBodyPhaseSpace(this,NBodyPhaseSpace), + primaryGamma(this,primaryGamma), + discreteGamma(this,discreteGamma), + XYs2d(this,XYs2d), + generalEvaporation(this,generalEvaporation), + evaporation(this,evaporation), + weightedFunctionals(this,weightedFunctionals), + simpleMaxwellianFission(this,simpleMaxwellianFission), + MadlandNix(this,MadlandNix) + { + Component::finish(); + } + + // from node + explicit Energy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Energy(const Energy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit), + Double(this,other.Double), + uncertainty(this,other.uncertainty), + NBodyPhaseSpace(this,other.NBodyPhaseSpace), + primaryGamma(this,other.primaryGamma), + discreteGamma(this,other.discreteGamma), + XYs2d(this,other.XYs2d), + generalEvaporation(this,other.generalEvaporation), + evaporation(this,other.evaporation), + weightedFunctionals(this,other.weightedFunctionals), + simpleMaxwellianFission(this,other.simpleMaxwellianFission), + MadlandNix(this,other.MadlandNix) + { + Component::finish(other); + } + + // move + Energy(Energy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)), + Double(this,std::move(other.Double)), + uncertainty(this,std::move(other.uncertainty)), + NBodyPhaseSpace(this,std::move(other.NBodyPhaseSpace)), + primaryGamma(this,std::move(other.primaryGamma)), + discreteGamma(this,std::move(other.discreteGamma)), + XYs2d(this,std::move(other.XYs2d)), + generalEvaporation(this,std::move(other.generalEvaporation)), + evaporation(this,std::move(other.evaporation)), + weightedFunctionals(this,std::move(other.weightedFunctionals)), + simpleMaxwellianFission(this,std::move(other.simpleMaxwellianFission)), + MadlandNix(this,std::move(other.MadlandNix)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Energy &operator=(const Energy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + unit = other.unit; + Double = other.Double; + uncertainty = other.uncertainty; + NBodyPhaseSpace = other.NBodyPhaseSpace; + primaryGamma = other.primaryGamma; + discreteGamma = other.discreteGamma; + XYs2d = other.XYs2d; + generalEvaporation = other.generalEvaporation; + evaporation = other.evaporation; + weightedFunctionals = other.weightedFunctionals; + simpleMaxwellianFission = other.simpleMaxwellianFission; + MadlandNix = other.MadlandNix; + } + return *this; + } + + // move + Energy &operator=(Energy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + unit = std::move(other.unit); + Double = std::move(other.Double); + uncertainty = std::move(other.uncertainty); + NBodyPhaseSpace = std::move(other.NBodyPhaseSpace); + primaryGamma = std::move(other.primaryGamma); + discreteGamma = std::move(other.discreteGamma); + XYs2d = std::move(other.XYs2d); + generalEvaporation = std::move(other.generalEvaporation); + evaporation = std::move(other.evaporation); + weightedFunctionals = std::move(other.weightedFunctionals); + simpleMaxwellianFission = std::move(other.simpleMaxwellianFission); + MadlandNix = std::move(other.MadlandNix); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Energy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Energy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Energy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Energy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Energy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EnergyAngular.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EnergyAngular.hpp new file mode 100644 index 000000000..d6737924e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EnergyAngular.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ENERGYANGULAR +#define GNDS_V2_0_GENERAL_ENERGYANGULAR + +#include "GNDS/v2.0/general/XYs3d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class EnergyAngular +// ----------------------------------------------------------------------------- + +class EnergyAngular : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "EnergyAngular"; } + static auto NODENAME() { return "energyAngular"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("productFrame") | + + // children + --Child> + ("XYs3d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "productFrame", + "XYs3d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "product_frame", + "xys3d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + productFrame{this}; + + // children + Field> + XYs3d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->XYs3d \ + ) + + // default + EnergyAngular() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit EnergyAngular( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper> + &XYs3d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + XYs3d(this,XYs3d) + { + Component::finish(); + } + + // from node + explicit EnergyAngular(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + EnergyAngular(const EnergyAngular &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + XYs3d(this,other.XYs3d) + { + Component::finish(other); + } + + // move + EnergyAngular(EnergyAngular &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)), + XYs3d(this,std::move(other.XYs3d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + EnergyAngular &operator=(const EnergyAngular &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + XYs3d = other.XYs3d; + } + return *this; + } + + // move + EnergyAngular &operator=(EnergyAngular &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + productFrame = std::move(other.productFrame); + XYs3d = std::move(other.XYs3d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/EnergyAngular/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class EnergyAngular + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EnergyAngular/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EnergyAngular/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/EnergyAngular/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaluated.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaluated.hpp new file mode 100644 index 000000000..a920d6d9f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaluated.hpp @@ -0,0 +1,279 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_EVALUATED +#define GNDS_V2_0_GENERAL_EVALUATED + +#include "GNDS/v2.0/general/Documentation.hpp" +#include "GNDS/v2.0/general/Temperature.hpp" +#include "GNDS/v2.0/general/ProjectileEnergyDomain.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Evaluated +// ----------------------------------------------------------------------------- + +class Evaluated : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Evaluated"; } + static auto NODENAME() { return "evaluated"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("date") | + std::string{} + / Meta<>("library") | + std::string{} + / Meta<>("version") | + + // children + --Child + ("documentation") | + --Child> + ("temperature") | + --Child> + ("projectileEnergyDomain") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "date", + "library", + "version", + "documentation", + "temperature", + "projectileEnergyDomain" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "date", + "library", + "version", + "documentation", + "temperature", + "projectile_energy_domain" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + date{this}; + Field + library{this}; + Field + version{this}; + + // children + Field + documentation{this}; + Field> + temperature{this}; + Field> + projectileEnergyDomain{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(documentation().authors(),author); + NJOY_GNDSTK_SHORTCUT(documentation(),authors); + NJOY_GNDSTK_SHORTCUT(documentation(),body); + NJOY_GNDSTK_SHORTCUT(documentation(),dates); + NJOY_GNDSTK_SHORTCUT(documentation(),endfCompatible); + NJOY_GNDSTK_SHORTCUT(documentation(),title); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->date, \ + this->library, \ + this->version, \ + this->documentation, \ + this->temperature, \ + this->projectileEnergyDomain \ + ) + + // default + Evaluated() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Evaluated( + const wrapper + &label, + const wrapper + &date = {}, + const wrapper + &library = {}, + const wrapper + &version = {}, + const wrapper + &documentation = {}, + const wrapper> + &temperature = {}, + const wrapper> + &projectileEnergyDomain = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + date(this,date), + library(this,library), + version(this,version), + documentation(this,documentation), + temperature(this,temperature), + projectileEnergyDomain(this,projectileEnergyDomain) + { + Component::finish(); + } + + // from node + explicit Evaluated(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Evaluated(const Evaluated &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + date(this,other.date), + library(this,other.library), + version(this,other.version), + documentation(this,other.documentation), + temperature(this,other.temperature), + projectileEnergyDomain(this,other.projectileEnergyDomain) + { + Component::finish(other); + } + + // move + Evaluated(Evaluated &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + date(this,std::move(other.date)), + library(this,std::move(other.library)), + version(this,std::move(other.version)), + documentation(this,std::move(other.documentation)), + temperature(this,std::move(other.temperature)), + projectileEnergyDomain(this,std::move(other.projectileEnergyDomain)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Evaluated &operator=(const Evaluated &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + date = other.date; + library = other.library; + version = other.version; + documentation = other.documentation; + temperature = other.temperature; + projectileEnergyDomain = other.projectileEnergyDomain; + } + return *this; + } + + // move + Evaluated &operator=(Evaluated &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + date = std::move(other.date); + library = std::move(other.library); + version = std::move(other.version); + documentation = std::move(other.documentation); + temperature = std::move(other.temperature); + projectileEnergyDomain = std::move(other.projectileEnergyDomain); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Evaluated/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Evaluated + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaluated/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaluated/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaluated/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaporation.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaporation.hpp new file mode 100644 index 000000000..ef4a854c3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaporation.hpp @@ -0,0 +1,200 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_EVAPORATION +#define GNDS_V2_0_GENERAL_EVAPORATION + +#include "GNDS/v2.0/general/U.hpp" +#include "GNDS/v2.0/general/Theta.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Evaporation +// ----------------------------------------------------------------------------- + +class Evaporation : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Evaporation"; } + static auto NODENAME() { return "evaporation"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("U") | + --Child + ("theta") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "U", + "theta" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "u", + "theta" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + U{this}; + Field + theta{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(theta(),XYs1d); + NJOY_GNDSTK_SHORTCUT(theta(),regions1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->U, \ + this->theta \ + ) + + // default + Evaporation() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Evaporation( + const wrapper + &U, + const wrapper + &theta = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + U(this,U), + theta(this,theta) + { + Component::finish(); + } + + // from node + explicit Evaporation(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Evaporation(const Evaporation &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + U(this,other.U), + theta(this,other.theta) + { + Component::finish(other); + } + + // move + Evaporation(Evaporation &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + U(this,std::move(other.U)), + theta(this,std::move(other.theta)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Evaporation &operator=(const Evaporation &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + U = other.U; + theta = other.theta; + } + return *this; + } + + // move + Evaporation &operator=(Evaporation &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + U = std::move(other.U); + theta = std::move(other.theta); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Evaporation/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Evaporation + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaporation/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaporation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Evaporation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFile.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFile.hpp new file mode 100644 index 000000000..27743df36 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFile.hpp @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_EXTERNALFILE +#define GNDS_V2_0_GENERAL_EXTERNALFILE + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ExternalFile +// ----------------------------------------------------------------------------- + +class ExternalFile : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ExternalFile"; } + static auto NODENAME() { return "externalFile"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("path") | + std::optional{} + / Meta<>("checksum") | + std::optional{} + / Meta<>("algorithm") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "path", + "checksum", + "algorithm" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "path", + "checksum", + "algorithm" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + path{this}; + Field> + checksum{this}; + Field> + algorithm{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->path, \ + this->checksum, \ + this->algorithm \ + ) + + // default + ExternalFile() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ExternalFile( + const wrapper + &label, + const wrapper + &path = {}, + const wrapper> + &checksum = {}, + const wrapper> + &algorithm = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + path(this,path), + checksum(this,checksum), + algorithm(this,algorithm) + { + Component::finish(); + } + + // from node + explicit ExternalFile(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ExternalFile(const ExternalFile &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + path(this,other.path), + checksum(this,other.checksum), + algorithm(this,other.algorithm) + { + Component::finish(other); + } + + // move + ExternalFile(ExternalFile &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + path(this,std::move(other.path)), + checksum(this,std::move(other.checksum)), + algorithm(this,std::move(other.algorithm)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ExternalFile &operator=(const ExternalFile &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + path = other.path; + checksum = other.checksum; + algorithm = other.algorithm; + } + return *this; + } + + // move + ExternalFile &operator=(ExternalFile &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + path = std::move(other.path); + checksum = std::move(other.checksum); + algorithm = std::move(other.algorithm); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ExternalFile/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ExternalFile + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFile/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFile/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFile/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFiles.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFiles.hpp new file mode 100644 index 000000000..48c5c4489 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFiles.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_EXTERNALFILES +#define GNDS_V2_0_GENERAL_EXTERNALFILES + +#include "GNDS/v2.0/general/ExternalFile.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ExternalFiles +// ----------------------------------------------------------------------------- + +class ExternalFiles : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ExternalFiles"; } + static auto NODENAME() { return "externalFiles"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("externalFile") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "externalFile" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "external_file" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + externalFile{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->externalFile \ + ) + + // default + ExternalFiles() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ExternalFiles( + const wrapper> + &externalFile + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + externalFile(this,externalFile) + { + Component::finish(); + } + + // from node + explicit ExternalFiles(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ExternalFiles(const ExternalFiles &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + externalFile(this,other.externalFile) + { + Component::finish(other); + } + + // move + ExternalFiles(ExternalFiles &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + externalFile(this,std::move(other.externalFile)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ExternalFiles &operator=(const ExternalFiles &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + externalFile = other.externalFile; + } + return *this; + } + + // move + ExternalFiles &operator=(ExternalFiles &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + externalFile = std::move(other.externalFile); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ExternalFiles/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ExternalFiles + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFiles/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFiles/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ExternalFiles/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/F.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/F.hpp new file mode 100644 index 000000000..92fd1196e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/F.hpp @@ -0,0 +1,189 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_F +#define GNDS_V2_0_GENERAL_F + +#include "GNDS/v2.0/general/XYs2d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class F +// ----------------------------------------------------------------------------- + +class F : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "F"; } + static auto NODENAME() { return "f"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs2d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs2d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs2d().function1ds(),Legendre); + NJOY_GNDSTK_SHORTCUT(XYs2d().function1ds(),XYs1d); + NJOY_GNDSTK_SHORTCUT(XYs2d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs2d(),function1ds); + NJOY_GNDSTK_SHORTCUT(XYs2d().function1ds(),regions1d); + NJOY_GNDSTK_SHORTCUT(XYs2d(),uncertainty); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs2d \ + ) + + // default + F() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit F( + const wrapper + &XYs2d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit F(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + F(const F &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + F(F &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs2d(this,std::move(other.XYs2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + F &operator=(const F &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs2d = other.XYs2d; + } + return *this; + } + + // move + F &operator=(F &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs2d = std::move(other.XYs2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/F/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class F + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/F/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/F/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/F/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FastRegion.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FastRegion.hpp new file mode 100644 index 000000000..fbc54b3c0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FastRegion.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_FASTREGION +#define GNDS_V2_0_GENERAL_FASTREGION + +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/Regions1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class FastRegion +// ----------------------------------------------------------------------------- + +class FastRegion : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "FastRegion"; } + static auto NODENAME() { return "fastRegion"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("XYs1d") | + --Child> + ("regions1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d", + "regions1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d", + "regions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + regions1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + FastRegion() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FastRegion( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit FastRegion(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FastRegion(const FastRegion &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + FastRegion(FastRegion &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + regions1d(this,std::move(other.regions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + FastRegion &operator=(const FastRegion &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + return *this; + } + + // move + FastRegion &operator=(FastRegion &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/FastRegion/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class FastRegion + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FastRegion/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FastRegion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FastRegion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponent.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponent.hpp new file mode 100644 index 000000000..ae1d72fc0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponent.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_FISSIONCOMPONENT +#define GNDS_V2_0_GENERAL_FISSIONCOMPONENT + +#include "GNDS/v2.0/general/CrossSection.hpp" +#include "GNDS/v2.0/general/OutputChannel.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class FissionComponent +// ----------------------------------------------------------------------------- + +class FissionComponent : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "FissionComponent"; } + static auto NODENAME() { return "fissionComponent"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + int{} + / Meta<>("ENDF_MT") | + std::string{} + / Meta<>("fissionGenre") | + + // children + --Child + ("crossSection") | + --Child + ("outputChannel") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "ENDF_MT", + "fissionGenre", + "crossSection", + "outputChannel" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "endf_mt", + "fission_genre", + "cross_section", + "output_channel" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + ENDF_MT{this}; + Field + fissionGenre{this}; + + // children + Field + crossSection{this}; + Field + outputChannel{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(crossSection(),CoulombPlusNuclearElastic); + NJOY_GNDSTK_SHORTCUT(outputChannel().Q(),Double); + NJOY_GNDSTK_SHORTCUT(outputChannel(),Q); + NJOY_GNDSTK_SHORTCUT(crossSection(),XYs1d); + NJOY_GNDSTK_SHORTCUT(outputChannel().Q(),constant1d); + NJOY_GNDSTK_SHORTCUT(outputChannel(),fissionFragmentData); + NJOY_GNDSTK_SHORTCUT(outputChannel(),products); + NJOY_GNDSTK_SHORTCUT(crossSection(),reference); + NJOY_GNDSTK_SHORTCUT(crossSection(),regions1d); + NJOY_GNDSTK_SHORTCUT(crossSection(),resonancesWithBackground); + NJOY_GNDSTK_SHORTCUT(crossSection(),thermalNeutronScatteringLaw1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->fissionGenre, \ + this->crossSection, \ + this->outputChannel \ + ) + + // default + FissionComponent() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionComponent( + const wrapper + &label, + const wrapper + &ENDF_MT = {}, + const wrapper + &fissionGenre = {}, + const wrapper + &crossSection = {}, + const wrapper + &outputChannel = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + ENDF_MT(this,ENDF_MT), + fissionGenre(this,fissionGenre), + crossSection(this,crossSection), + outputChannel(this,outputChannel) + { + Component::finish(); + } + + // from node + explicit FissionComponent(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionComponent(const FissionComponent &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + ENDF_MT(this,other.ENDF_MT), + fissionGenre(this,other.fissionGenre), + crossSection(this,other.crossSection), + outputChannel(this,other.outputChannel) + { + Component::finish(other); + } + + // move + FissionComponent(FissionComponent &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + ENDF_MT(this,std::move(other.ENDF_MT)), + fissionGenre(this,std::move(other.fissionGenre)), + crossSection(this,std::move(other.crossSection)), + outputChannel(this,std::move(other.outputChannel)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + FissionComponent &operator=(const FissionComponent &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + ENDF_MT = other.ENDF_MT; + fissionGenre = other.fissionGenre; + crossSection = other.crossSection; + outputChannel = other.outputChannel; + } + return *this; + } + + // move + FissionComponent &operator=(FissionComponent &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + ENDF_MT = std::move(other.ENDF_MT); + fissionGenre = std::move(other.fissionGenre); + crossSection = std::move(other.crossSection); + outputChannel = std::move(other.outputChannel); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/FissionComponent/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class FissionComponent + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponent/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponent/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponent/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponents.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponents.hpp new file mode 100644 index 000000000..3ca22f285 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponents.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_FISSIONCOMPONENTS +#define GNDS_V2_0_GENERAL_FISSIONCOMPONENTS + +#include "GNDS/v2.0/general/FissionComponent.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class FissionComponents +// ----------------------------------------------------------------------------- + +class FissionComponents : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "FissionComponents"; } + static auto NODENAME() { return "fissionComponents"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child> + ("fissionComponent") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "fissionComponent" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "fission_component" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field>> + fissionComponent{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->fissionComponent \ + ) + + // default + FissionComponents() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionComponents( + const wrapper>> + &fissionComponent + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + fissionComponent(this,fissionComponent) + { + Component::finish(); + } + + // from node + explicit FissionComponents(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionComponents(const FissionComponents &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + fissionComponent(this,other.fissionComponent) + { + Component::finish(other); + } + + // move + FissionComponents(FissionComponents &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + fissionComponent(this,std::move(other.fissionComponent)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + FissionComponents &operator=(const FissionComponents &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + fissionComponent = other.fissionComponent; + } + return *this; + } + + // move + FissionComponents &operator=(FissionComponents &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + fissionComponent = std::move(other.fissionComponent); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/FissionComponents/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class FissionComponents + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponents/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponents/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionComponents/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyRelease.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyRelease.hpp new file mode 100644 index 000000000..618bc265a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyRelease.hpp @@ -0,0 +1,317 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_FISSIONENERGYRELEASE +#define GNDS_V2_0_GENERAL_FISSIONENERGYRELEASE + +#include "GNDS/v2.0/general/PromptProductKE.hpp" +#include "GNDS/v2.0/general/PromptNeutronKE.hpp" +#include "GNDS/v2.0/general/DelayedNeutronKE.hpp" +#include "GNDS/v2.0/general/PromptGammaEnergy.hpp" +#include "GNDS/v2.0/general/DelayedGammaEnergy.hpp" +#include "GNDS/v2.0/general/DelayedBetaEnergy.hpp" +#include "GNDS/v2.0/general/NeutrinoEnergy.hpp" +#include "GNDS/v2.0/general/NonNeutrinoEnergy.hpp" +#include "GNDS/v2.0/general/TotalEnergy.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class FissionEnergyRelease +// ----------------------------------------------------------------------------- + +class FissionEnergyRelease : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "FissionEnergyRelease"; } + static auto NODENAME() { return "fissionEnergyRelease"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + + // children + --Child + ("promptProductKE") | + --Child + ("promptNeutronKE") | + --Child + ("delayedNeutronKE") | + --Child + ("promptGammaEnergy") | + --Child + ("delayedGammaEnergy") | + --Child + ("delayedBetaEnergy") | + --Child + ("neutrinoEnergy") | + --Child + ("nonNeutrinoEnergy") | + --Child + ("totalEnergy") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "promptProductKE", + "promptNeutronKE", + "delayedNeutronKE", + "promptGammaEnergy", + "delayedGammaEnergy", + "delayedBetaEnergy", + "neutrinoEnergy", + "nonNeutrinoEnergy", + "totalEnergy" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "prompt_product_ke", + "prompt_neutron_ke", + "delayed_neutron_ke", + "prompt_gamma_energy", + "delayed_gamma_energy", + "delayed_beta_energy", + "neutrino_energy", + "non_neutrino_energy", + "total_energy" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children + Field + promptProductKE{this}; + Field + promptNeutronKE{this}; + Field + delayedNeutronKE{this}; + Field + promptGammaEnergy{this}; + Field + delayedGammaEnergy{this}; + Field + delayedBetaEnergy{this}; + Field + neutrinoEnergy{this}; + Field + nonNeutrinoEnergy{this}; + Field + totalEnergy{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->promptProductKE, \ + this->promptNeutronKE, \ + this->delayedNeutronKE, \ + this->promptGammaEnergy, \ + this->delayedGammaEnergy, \ + this->delayedBetaEnergy, \ + this->neutrinoEnergy, \ + this->nonNeutrinoEnergy, \ + this->totalEnergy \ + ) + + // default + FissionEnergyRelease() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionEnergyRelease( + const wrapper + &label, + const wrapper + &promptProductKE = {}, + const wrapper + &promptNeutronKE = {}, + const wrapper + &delayedNeutronKE = {}, + const wrapper + &promptGammaEnergy = {}, + const wrapper + &delayedGammaEnergy = {}, + const wrapper + &delayedBetaEnergy = {}, + const wrapper + &neutrinoEnergy = {}, + const wrapper + &nonNeutrinoEnergy = {}, + const wrapper + &totalEnergy = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + promptProductKE(this,promptProductKE), + promptNeutronKE(this,promptNeutronKE), + delayedNeutronKE(this,delayedNeutronKE), + promptGammaEnergy(this,promptGammaEnergy), + delayedGammaEnergy(this,delayedGammaEnergy), + delayedBetaEnergy(this,delayedBetaEnergy), + neutrinoEnergy(this,neutrinoEnergy), + nonNeutrinoEnergy(this,nonNeutrinoEnergy), + totalEnergy(this,totalEnergy) + { + Component::finish(); + } + + // from node + explicit FissionEnergyRelease(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionEnergyRelease(const FissionEnergyRelease &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + promptProductKE(this,other.promptProductKE), + promptNeutronKE(this,other.promptNeutronKE), + delayedNeutronKE(this,other.delayedNeutronKE), + promptGammaEnergy(this,other.promptGammaEnergy), + delayedGammaEnergy(this,other.delayedGammaEnergy), + delayedBetaEnergy(this,other.delayedBetaEnergy), + neutrinoEnergy(this,other.neutrinoEnergy), + nonNeutrinoEnergy(this,other.nonNeutrinoEnergy), + totalEnergy(this,other.totalEnergy) + { + Component::finish(other); + } + + // move + FissionEnergyRelease(FissionEnergyRelease &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + promptProductKE(this,std::move(other.promptProductKE)), + promptNeutronKE(this,std::move(other.promptNeutronKE)), + delayedNeutronKE(this,std::move(other.delayedNeutronKE)), + promptGammaEnergy(this,std::move(other.promptGammaEnergy)), + delayedGammaEnergy(this,std::move(other.delayedGammaEnergy)), + delayedBetaEnergy(this,std::move(other.delayedBetaEnergy)), + neutrinoEnergy(this,std::move(other.neutrinoEnergy)), + nonNeutrinoEnergy(this,std::move(other.nonNeutrinoEnergy)), + totalEnergy(this,std::move(other.totalEnergy)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + FissionEnergyRelease &operator=(const FissionEnergyRelease &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + promptProductKE = other.promptProductKE; + promptNeutronKE = other.promptNeutronKE; + delayedNeutronKE = other.delayedNeutronKE; + promptGammaEnergy = other.promptGammaEnergy; + delayedGammaEnergy = other.delayedGammaEnergy; + delayedBetaEnergy = other.delayedBetaEnergy; + neutrinoEnergy = other.neutrinoEnergy; + nonNeutrinoEnergy = other.nonNeutrinoEnergy; + totalEnergy = other.totalEnergy; + } + return *this; + } + + // move + FissionEnergyRelease &operator=(FissionEnergyRelease &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + promptProductKE = std::move(other.promptProductKE); + promptNeutronKE = std::move(other.promptNeutronKE); + delayedNeutronKE = std::move(other.delayedNeutronKE); + promptGammaEnergy = std::move(other.promptGammaEnergy); + delayedGammaEnergy = std::move(other.delayedGammaEnergy); + delayedBetaEnergy = std::move(other.delayedBetaEnergy); + neutrinoEnergy = std::move(other.neutrinoEnergy); + nonNeutrinoEnergy = std::move(other.nonNeutrinoEnergy); + totalEnergy = std::move(other.totalEnergy); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/FissionEnergyRelease/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class FissionEnergyRelease + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyRelease/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyRelease/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyRelease/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyReleases.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyReleases.hpp new file mode 100644 index 000000000..37de6d573 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyReleases.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_FISSIONENERGYRELEASES +#define GNDS_V2_0_GENERAL_FISSIONENERGYRELEASES + +#include "GNDS/v2.0/general/FissionEnergyRelease.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class FissionEnergyReleases +// ----------------------------------------------------------------------------- + +class FissionEnergyReleases : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "FissionEnergyReleases"; } + static auto NODENAME() { return "fissionEnergyReleases"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("fissionEnergyRelease") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "fissionEnergyRelease" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "fission_energy_release" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + fissionEnergyRelease{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->fissionEnergyRelease \ + ) + + // default + FissionEnergyReleases() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionEnergyReleases( + const wrapper> + &fissionEnergyRelease + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + fissionEnergyRelease(this,fissionEnergyRelease) + { + Component::finish(); + } + + // from node + explicit FissionEnergyReleases(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionEnergyReleases(const FissionEnergyReleases &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + fissionEnergyRelease(this,other.fissionEnergyRelease) + { + Component::finish(other); + } + + // move + FissionEnergyReleases(FissionEnergyReleases &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + fissionEnergyRelease(this,std::move(other.fissionEnergyRelease)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + FissionEnergyReleases &operator=(const FissionEnergyReleases &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + fissionEnergyRelease = other.fissionEnergyRelease; + } + return *this; + } + + // move + FissionEnergyReleases &operator=(FissionEnergyReleases &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + fissionEnergyRelease = std::move(other.fissionEnergyRelease); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/FissionEnergyReleases/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class FissionEnergyReleases + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyReleases/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyReleases/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FissionEnergyReleases/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FormFactor.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FormFactor.hpp new file mode 100644 index 000000000..00c6d49c3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FormFactor.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_FORMFACTOR +#define GNDS_V2_0_GENERAL_FORMFACTOR + +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class FormFactor +// ----------------------------------------------------------------------------- + +class FormFactor : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "FormFactor"; } + static auto NODENAME() { return "formFactor"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + FormFactor() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FormFactor( + const wrapper + &XYs1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit FormFactor(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FormFactor(const FormFactor &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + FormFactor(FormFactor &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + FormFactor &operator=(const FormFactor &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + FormFactor &operator=(FormFactor &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/FormFactor/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class FormFactor + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FormFactor/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FormFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FormFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Fraction.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Fraction.hpp new file mode 100644 index 000000000..0511f554a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Fraction.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_FRACTION +#define GNDS_V2_0_GENERAL_FRACTION + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Fraction +// ----------------------------------------------------------------------------- + +class Fraction : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Fraction"; } + static auto NODENAME() { return "fraction"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("value") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + value{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit \ + ) + + // default + Fraction() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Fraction( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Fraction(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Fraction(const Fraction &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + Fraction(Fraction &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Fraction &operator=(const Fraction &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + unit = other.unit; + } + return *this; + } + + // move + Fraction &operator=(Fraction &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + value = std::move(other.value); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Fraction/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Fraction + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Fraction/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Fraction/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Fraction/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FreeGasApproximation.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FreeGasApproximation.hpp new file mode 100644 index 000000000..e0028ac57 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FreeGasApproximation.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_FREEGASAPPROXIMATION +#define GNDS_V2_0_GENERAL_FREEGASAPPROXIMATION + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class FreeGasApproximation +// ----------------------------------------------------------------------------- + +class FreeGasApproximation : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "FreeGasApproximation"; } + static auto NODENAME() { return "freeGasApproximation"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + FreeGasApproximation() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit FreeGasApproximation(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FreeGasApproximation(const FreeGasApproximation &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + FreeGasApproximation(FreeGasApproximation &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + FreeGasApproximation &operator=(const FreeGasApproximation &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + FreeGasApproximation &operator=(FreeGasApproximation &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/FreeGasApproximation/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class FreeGasApproximation + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FreeGasApproximation/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FreeGasApproximation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/FreeGasApproximation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function1ds.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function1ds.hpp new file mode 100644 index 000000000..31757756d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function1ds.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_FUNCTION1DS +#define GNDS_V2_0_GENERAL_FUNCTION1DS + +#include "GNDS/v2.0/general/Legendre.hpp" +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/Regions1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Function1ds +// ----------------------------------------------------------------------------- + +class Function1ds : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Function1ds"; } + static auto NODENAME() { return "function1ds"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("Legendre") | + ++Child> + ("XYs1d") | + ++Child> + ("regions1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "Legendre", + "XYs1d", + "regions1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "legendre", + "xys1d", + "regions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + Legendre{this}; + Field>> + XYs1d{this}; + Field>> + regions1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Legendre, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + Function1ds() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Function1ds( + const wrapper> + &Legendre, + const wrapper>> + &XYs1d = {}, + const wrapper>> + ®ions1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + Legendre(this,Legendre), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit Function1ds(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Function1ds(const Function1ds &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Legendre(this,other.Legendre), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + Function1ds(Function1ds &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + Legendre(this,std::move(other.Legendre)), + XYs1d(this,std::move(other.XYs1d)), + regions1d(this,std::move(other.regions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Function1ds &operator=(const Function1ds &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + Legendre = other.Legendre; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + return *this; + } + + // move + Function1ds &operator=(Function1ds &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + Legendre = std::move(other.Legendre); + XYs1d = std::move(other.XYs1d); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Function1ds/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Function1ds + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function1ds/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function1ds/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function1ds/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function2ds.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function2ds.hpp new file mode 100644 index 000000000..daa158e6c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function2ds.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_FUNCTION2DS +#define GNDS_V2_0_GENERAL_FUNCTION2DS + +#include "GNDS/v2.0/general/XYs2d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Function2ds +// ----------------------------------------------------------------------------- + +class Function2ds : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Function2ds"; } + static auto NODENAME() { return "function2ds"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("XYs2d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs2d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs2d \ + ) + + // default + Function2ds() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Function2ds( + const wrapper> + &XYs2d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit Function2ds(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Function2ds(const Function2ds &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + Function2ds(Function2ds &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs2d(this,std::move(other.XYs2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Function2ds &operator=(const Function2ds &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs2d = other.XYs2d; + } + return *this; + } + + // move + Function2ds &operator=(Function2ds &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs2d = std::move(other.XYs2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Function2ds/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Function2ds + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function2ds/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function2ds/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Function2ds/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/G.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/G.hpp new file mode 100644 index 000000000..85c40ff92 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/G.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_G +#define GNDS_V2_0_GENERAL_G + +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class G +// ----------------------------------------------------------------------------- + +class G : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "G"; } + static auto NODENAME() { return "g"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + G() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit G( + const wrapper> + &XYs1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit G(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + G(const G &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + G(G &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + G &operator=(const G &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + G &operator=(G &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/G/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class G + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/G/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/G/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/G/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBoson.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBoson.hpp new file mode 100644 index 000000000..2973fb48b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBoson.hpp @@ -0,0 +1,263 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_GAUGEBOSON +#define GNDS_V2_0_GENERAL_GAUGEBOSON + +#include "GNDS/v2.0/general/Mass.hpp" +#include "GNDS/v2.0/general/Spin.hpp" +#include "GNDS/v2.0/general/Parity.hpp" +#include "GNDS/v2.0/general/Charge.hpp" +#include "GNDS/v2.0/general/Halflife.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class GaugeBoson +// ----------------------------------------------------------------------------- + +class GaugeBoson : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "GaugeBoson"; } + static auto NODENAME() { return "gaugeBoson"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("id") | + + // children + --Child + ("mass") | + --Child + ("spin") | + --Child + ("parity") | + --Child + ("charge") | + --Child + ("halflife") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "id", + "mass", + "spin", + "parity", + "charge", + "halflife" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "id", + "mass", + "spin", + "parity", + "charge", + "halflife" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + id{this}; + + // children + Field + mass{this}; + Field + spin{this}; + Field + parity{this}; + Field + charge{this}; + Field + halflife{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(spin(),fraction); + NJOY_GNDSTK_SHORTCUT(halflife(),string); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->mass, \ + this->spin, \ + this->parity, \ + this->charge, \ + this->halflife \ + ) + + // default + GaugeBoson() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit GaugeBoson( + const wrapper + &id, + const wrapper + &mass = {}, + const wrapper + &spin = {}, + const wrapper + &parity = {}, + const wrapper + &charge = {}, + const wrapper + &halflife = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + id(this,id), + mass(this,mass), + spin(this,spin), + parity(this,parity), + charge(this,charge), + halflife(this,halflife) + { + Component::finish(); + } + + // from node + explicit GaugeBoson(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + GaugeBoson(const GaugeBoson &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + mass(this,other.mass), + spin(this,other.spin), + parity(this,other.parity), + charge(this,other.charge), + halflife(this,other.halflife) + { + Component::finish(other); + } + + // move + GaugeBoson(GaugeBoson &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + mass(this,std::move(other.mass)), + spin(this,std::move(other.spin)), + parity(this,std::move(other.parity)), + charge(this,std::move(other.charge)), + halflife(this,std::move(other.halflife)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + GaugeBoson &operator=(const GaugeBoson &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + id = other.id; + mass = other.mass; + spin = other.spin; + parity = other.parity; + charge = other.charge; + halflife = other.halflife; + } + return *this; + } + + // move + GaugeBoson &operator=(GaugeBoson &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + id = std::move(other.id); + mass = std::move(other.mass); + spin = std::move(other.spin); + parity = std::move(other.parity); + charge = std::move(other.charge); + halflife = std::move(other.halflife); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/GaugeBoson/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class GaugeBoson + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBoson/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBoson/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBoson/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBosons.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBosons.hpp new file mode 100644 index 000000000..0fd0a314a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBosons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_GAUGEBOSONS +#define GNDS_V2_0_GENERAL_GAUGEBOSONS + +#include "GNDS/v2.0/general/GaugeBoson.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class GaugeBosons +// ----------------------------------------------------------------------------- + +class GaugeBosons : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "GaugeBosons"; } + static auto NODENAME() { return "gaugeBosons"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("gaugeBoson") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "gaugeBoson" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "gauge_boson" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + gaugeBoson{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->gaugeBoson \ + ) + + // default + GaugeBosons() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit GaugeBosons( + const wrapper> + &gaugeBoson + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + gaugeBoson(this,gaugeBoson) + { + Component::finish(); + } + + // from node + explicit GaugeBosons(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + GaugeBosons(const GaugeBosons &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + gaugeBoson(this,other.gaugeBoson) + { + Component::finish(other); + } + + // move + GaugeBosons(GaugeBosons &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + gaugeBoson(this,std::move(other.gaugeBoson)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + GaugeBosons &operator=(const GaugeBosons &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + gaugeBoson = other.gaugeBoson; + } + return *this; + } + + // move + GaugeBosons &operator=(GaugeBosons &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + gaugeBoson = std::move(other.gaugeBoson); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/GaugeBosons/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class GaugeBosons + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBosons/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBosons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GaugeBosons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GeneralEvaporation.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GeneralEvaporation.hpp new file mode 100644 index 000000000..8b79c3437 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GeneralEvaporation.hpp @@ -0,0 +1,214 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_GENERALEVAPORATION +#define GNDS_V2_0_GENERAL_GENERALEVAPORATION + +#include "GNDS/v2.0/general/U.hpp" +#include "GNDS/v2.0/general/Theta.hpp" +#include "GNDS/v2.0/general/G.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class GeneralEvaporation +// ----------------------------------------------------------------------------- + +class GeneralEvaporation : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "GeneralEvaporation"; } + static auto NODENAME() { return "generalEvaporation"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("U") | + --Child + ("theta") | + --Child + ("g") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "U", + "theta", + "g" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "u", + "theta", + "g" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + U{this}; + Field + theta{this}; + Field + g{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(theta(),regions1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->U, \ + this->theta, \ + this->g \ + ) + + // default + GeneralEvaporation() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit GeneralEvaporation( + const wrapper + &U, + const wrapper + &theta = {}, + const wrapper + &g = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + U(this,U), + theta(this,theta), + g(this,g) + { + Component::finish(); + } + + // from node + explicit GeneralEvaporation(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + GeneralEvaporation(const GeneralEvaporation &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + U(this,other.U), + theta(this,other.theta), + g(this,other.g) + { + Component::finish(other); + } + + // move + GeneralEvaporation(GeneralEvaporation &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + U(this,std::move(other.U)), + theta(this,std::move(other.theta)), + g(this,std::move(other.g)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + GeneralEvaporation &operator=(const GeneralEvaporation &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + U = other.U; + theta = other.theta; + g = other.g; + } + return *this; + } + + // move + GeneralEvaporation &operator=(GeneralEvaporation &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + U = std::move(other.U); + theta = std::move(other.theta); + g = std::move(other.g); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/GeneralEvaporation/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class GeneralEvaporation + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GeneralEvaporation/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GeneralEvaporation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/GeneralEvaporation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Grid.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Grid.hpp new file mode 100644 index 000000000..cf58a4f25 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Grid.hpp @@ -0,0 +1,268 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_GRID +#define GNDS_V2_0_GENERAL_GRID + +#include "GNDS/v2.0/general/Link.hpp" +#include "GNDS/v2.0/general/Values.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Grid +// ----------------------------------------------------------------------------- + +class Grid : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Grid"; } + static auto NODENAME() { return "grid"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + int{} + / Meta<>("index") | + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("unit") | + std::string{} + / Meta<>("style") | + std::optional{} + / Meta<>("interpolation") | + + // children + --Child> + ("link") | + --Child> + ("values") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "index", + "label", + "unit", + "style", + "interpolation", + "link", + "values" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "index", + "label", + "unit", + "style", + "interpolation", + "link", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + index{this}; + Field + label{this}; + Field + unit{this}; + Field + style{this}; + Field> + interpolation{this}; + + // children + Field> + link{this}; + Field> + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->label, \ + this->unit, \ + this->style, \ + this->interpolation, \ + this->link, \ + this->values \ + ) + + // default + Grid() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Grid( + const wrapper + &index, + const wrapper + &label = {}, + const wrapper + &unit = {}, + const wrapper + &style = {}, + const wrapper> + &interpolation = {}, + const wrapper> + &link = {}, + const wrapper> + &values = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + index(this,index), + label(this,label), + unit(this,unit), + style(this,style), + interpolation(this,interpolation), + link(this,link), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Grid(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Grid(const Grid &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + index(this,other.index), + label(this,other.label), + unit(this,other.unit), + style(this,other.style), + interpolation(this,other.interpolation), + link(this,other.link), + values(this,other.values) + { + Component::finish(other); + } + + // move + Grid(Grid &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + index(this,std::move(other.index)), + label(this,std::move(other.label)), + unit(this,std::move(other.unit)), + style(this,std::move(other.style)), + interpolation(this,std::move(other.interpolation)), + link(this,std::move(other.link)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Grid &operator=(const Grid &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + index = other.index; + label = other.label; + unit = other.unit; + style = other.style; + interpolation = other.interpolation; + link = other.link; + values = other.values; + } + return *this; + } + + // move + Grid &operator=(Grid &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + index = std::move(other.index); + label = std::move(other.label); + unit = std::move(other.unit); + style = std::move(other.style); + interpolation = std::move(other.interpolation); + link = std::move(other.link); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Grid/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Grid + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Grid/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Grid/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Grid/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded2d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded2d.hpp new file mode 100644 index 000000000..5c34d5f48 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded2d.hpp @@ -0,0 +1,200 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_GRIDDED2D +#define GNDS_V2_0_GENERAL_GRIDDED2D + +#include "GNDS/v2.0/general/Axes.hpp" +#include "GNDS/v2.0/g2d/Array.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Gridded2d +// ----------------------------------------------------------------------------- + +class Gridded2d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Gridded2d"; } + static auto NODENAME() { return "gridded2d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("axes") | + --Child + ("array") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "axes", + "array" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "axes", + "array" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + axes{this}; + Field + array{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(axes(),axis); + NJOY_GNDSTK_SHORTCUT(axes(),grid); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->axes, \ + this->array \ + ) + + // default + Gridded2d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Gridded2d( + const wrapper + &axes, + const wrapper + &array = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + axes(this,axes), + array(this,array) + { + Component::finish(); + } + + // from node + explicit Gridded2d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Gridded2d(const Gridded2d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + axes(this,other.axes), + array(this,other.array) + { + Component::finish(other); + } + + // move + Gridded2d(Gridded2d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + axes(this,std::move(other.axes)), + array(this,std::move(other.array)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Gridded2d &operator=(const Gridded2d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + axes = other.axes; + array = other.array; + } + return *this; + } + + // move + Gridded2d &operator=(Gridded2d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + axes = std::move(other.axes); + array = std::move(other.array); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Gridded2d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Gridded2d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded2d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded3d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded3d.hpp new file mode 100644 index 000000000..99c8b2c73 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded3d.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_GRIDDED3D +#define GNDS_V2_0_GENERAL_GRIDDED3D + +#include "GNDS/v2.0/general/Axes.hpp" +#include "GNDS/v2.0/g3d/Array.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Gridded3d +// ----------------------------------------------------------------------------- + +class Gridded3d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Gridded3d"; } + static auto NODENAME() { return "gridded3d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("axes") | + --Child + ("array") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "axes", + "array" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "axes", + "array" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + axes{this}; + Field + array{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(axes(),axis); + NJOY_GNDSTK_SHORTCUT(axes(),grid); + NJOY_GNDSTK_SHORTCUT(array(),lengths); + NJOY_GNDSTK_SHORTCUT(array(),starts); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->axes, \ + this->array \ + ) + + // default + Gridded3d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Gridded3d( + const wrapper + &axes, + const wrapper + &array = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + axes(this,axes), + array(this,array) + { + Component::finish(); + } + + // from node + explicit Gridded3d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Gridded3d(const Gridded3d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + axes(this,other.axes), + array(this,other.array) + { + Component::finish(other); + } + + // move + Gridded3d(Gridded3d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + axes(this,std::move(other.axes)), + array(this,std::move(other.array)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Gridded3d &operator=(const Gridded3d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + axes = other.axes; + array = other.array; + } + return *this; + } + + // move + Gridded3d &operator=(Gridded3d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + axes = std::move(other.axes); + array = std::move(other.array); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Gridded3d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Gridded3d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded3d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Gridded3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Halflife.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Halflife.hpp new file mode 100644 index 000000000..6ed8d039d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Halflife.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_HALFLIFE +#define GNDS_V2_0_GENERAL_HALFLIFE + +#include "GNDS/v2.0/general/String.hpp" +#include "GNDS/v2.0/general/Double.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Halflife +// ----------------------------------------------------------------------------- + +class Halflife : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Halflife"; } + static auto NODENAME() { return "halflife"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("string") | + --Child> + ("double") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "string", + "Double" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "string", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + string{this}; + Field> + Double{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->string, \ + this->Double \ + ) + + // default + Halflife() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Halflife( + const wrapper> + &string, + const wrapper> + &Double = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + string(this,string), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Halflife(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Halflife(const Halflife &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + string(this,other.string), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Halflife(Halflife &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + string(this,std::move(other.string)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Halflife &operator=(const Halflife &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + string = other.string; + Double = other.Double; + } + return *this; + } + + // move + Halflife &operator=(Halflife &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + string = std::move(other.string); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Halflife/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Halflife + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Halflife/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Halflife/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Halflife/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/HardSphereRadius.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/HardSphereRadius.hpp new file mode 100644 index 000000000..84c2151ad --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/HardSphereRadius.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_HARDSPHERERADIUS +#define GNDS_V2_0_GENERAL_HARDSPHERERADIUS + +#include "GNDS/v2.0/general/Constant1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class HardSphereRadius +// ----------------------------------------------------------------------------- + +class HardSphereRadius : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "HardSphereRadius"; } + static auto NODENAME() { return "hardSphereRadius"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("constant1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "constant1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "constant1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + constant1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(constant1d(),axes); + NJOY_GNDSTK_SHORTCUT(constant1d().axes(),axis); + NJOY_GNDSTK_SHORTCUT(constant1d().axes(),grid); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->constant1d \ + ) + + // default + HardSphereRadius() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit HardSphereRadius( + const wrapper + &constant1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + constant1d(this,constant1d) + { + Component::finish(); + } + + // from node + explicit HardSphereRadius(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + HardSphereRadius(const HardSphereRadius &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + constant1d(this,other.constant1d) + { + Component::finish(other); + } + + // move + HardSphereRadius(HardSphereRadius &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + constant1d(this,std::move(other.constant1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + HardSphereRadius &operator=(const HardSphereRadius &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + constant1d = other.constant1d; + } + return *this; + } + + // move + HardSphereRadius &operator=(HardSphereRadius &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + constant1d = std::move(other.constant1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/HardSphereRadius/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class HardSphereRadius + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/HardSphereRadius/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/HardSphereRadius/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/HardSphereRadius/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryAnomalousFactor.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryAnomalousFactor.hpp new file mode 100644 index 000000000..e1bf3eaa4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryAnomalousFactor.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_IMAGINARYANOMALOUSFACTOR +#define GNDS_V2_0_GENERAL_IMAGINARYANOMALOUSFACTOR + +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ImaginaryAnomalousFactor +// ----------------------------------------------------------------------------- + +class ImaginaryAnomalousFactor : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ImaginaryAnomalousFactor"; } + static auto NODENAME() { return "imaginaryAnomalousFactor"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + ImaginaryAnomalousFactor() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ImaginaryAnomalousFactor( + const wrapper + &XYs1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit ImaginaryAnomalousFactor(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ImaginaryAnomalousFactor(const ImaginaryAnomalousFactor &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + ImaginaryAnomalousFactor(ImaginaryAnomalousFactor &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ImaginaryAnomalousFactor &operator=(const ImaginaryAnomalousFactor &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + ImaginaryAnomalousFactor &operator=(ImaginaryAnomalousFactor &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ImaginaryAnomalousFactor/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ImaginaryAnomalousFactor + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryAnomalousFactor/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryAnomalousFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryAnomalousFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryInterferenceTerm.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryInterferenceTerm.hpp new file mode 100644 index 000000000..cc2e52fbf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryInterferenceTerm.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_IMAGINARYINTERFERENCETERM +#define GNDS_V2_0_GENERAL_IMAGINARYINTERFERENCETERM + +#include "GNDS/v2.0/general/Regions2d.hpp" +#include "GNDS/v2.0/general/XYs2d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ImaginaryInterferenceTerm +// ----------------------------------------------------------------------------- + +class ImaginaryInterferenceTerm : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ImaginaryInterferenceTerm"; } + static auto NODENAME() { return "imaginaryInterferenceTerm"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("regions2d") | + --Child> + ("XYs2d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "regions2d", + "XYs2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "regions2d", + "xys2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + regions2d{this}; + Field> + XYs2d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->regions2d, \ + this->XYs2d \ + ) + + // default + ImaginaryInterferenceTerm() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ImaginaryInterferenceTerm( + const wrapper> + ®ions2d, + const wrapper> + &XYs2d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + regions2d(this,regions2d), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit ImaginaryInterferenceTerm(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ImaginaryInterferenceTerm(const ImaginaryInterferenceTerm &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + regions2d(this,other.regions2d), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + ImaginaryInterferenceTerm(ImaginaryInterferenceTerm &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + regions2d(this,std::move(other.regions2d)), + XYs2d(this,std::move(other.XYs2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ImaginaryInterferenceTerm &operator=(const ImaginaryInterferenceTerm &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + regions2d = other.regions2d; + XYs2d = other.XYs2d; + } + return *this; + } + + // move + ImaginaryInterferenceTerm &operator=(ImaginaryInterferenceTerm &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + regions2d = std::move(other.regions2d); + XYs2d = std::move(other.XYs2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ImaginaryInterferenceTerm/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ImaginaryInterferenceTerm + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryInterferenceTerm/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryInterferenceTerm/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ImaginaryInterferenceTerm/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergies.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergies.hpp new file mode 100644 index 000000000..9aecb3cf8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergies.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_INCIDENTENERGIES +#define GNDS_V2_0_GENERAL_INCIDENTENERGIES + +#include "GNDS/v2.0/general/IncidentEnergy.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class IncidentEnergies +// ----------------------------------------------------------------------------- + +class IncidentEnergies : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "IncidentEnergies"; } + static auto NODENAME() { return "incidentEnergies"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("incidentEnergy") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "incidentEnergy" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "incident_energy" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + incidentEnergy{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->incidentEnergy \ + ) + + // default + IncidentEnergies() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit IncidentEnergies( + const wrapper> + &incidentEnergy + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + incidentEnergy(this,incidentEnergy) + { + Component::finish(); + } + + // from node + explicit IncidentEnergies(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncidentEnergies(const IncidentEnergies &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + incidentEnergy(this,other.incidentEnergy) + { + Component::finish(other); + } + + // move + IncidentEnergies(IncidentEnergies &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + incidentEnergy(this,std::move(other.incidentEnergy)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + IncidentEnergies &operator=(const IncidentEnergies &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + incidentEnergy = other.incidentEnergy; + } + return *this; + } + + // move + IncidentEnergies &operator=(IncidentEnergies &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + incidentEnergy = std::move(other.incidentEnergy); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/IncidentEnergies/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class IncidentEnergies + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergies/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergies/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergies/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergy.hpp new file mode 100644 index 000000000..bd64b368a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergy.hpp @@ -0,0 +1,228 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_INCIDENTENERGY +#define GNDS_V2_0_GENERAL_INCIDENTENERGY + +#include "GNDS/v2.0/general/Energy.hpp" +#include "GNDS/v2.0/general/Yields.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class IncidentEnergy +// ----------------------------------------------------------------------------- + +class IncidentEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "IncidentEnergy"; } + static auto NODENAME() { return "incidentEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + + // children + --Child + ("energy") | + --Child + ("yields") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "energy", + "yields" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "energy", + "yields" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children + Field + energy{this}; + Field + yields{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(energy(),Double); + NJOY_GNDSTK_SHORTCUT(energy(),MadlandNix); + NJOY_GNDSTK_SHORTCUT(energy(),NBodyPhaseSpace); + NJOY_GNDSTK_SHORTCUT(energy(),XYs2d); + NJOY_GNDSTK_SHORTCUT(energy(),discreteGamma); + NJOY_GNDSTK_SHORTCUT(energy(),evaporation); + NJOY_GNDSTK_SHORTCUT(energy(),generalEvaporation); + NJOY_GNDSTK_SHORTCUT(yields(),nuclides); + NJOY_GNDSTK_SHORTCUT(energy(),primaryGamma); + NJOY_GNDSTK_SHORTCUT(energy(),simpleMaxwellianFission); + NJOY_GNDSTK_SHORTCUT(yields(),values); + NJOY_GNDSTK_SHORTCUT(energy(),weightedFunctionals); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->energy, \ + this->yields \ + ) + + // default + IncidentEnergy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit IncidentEnergy( + const wrapper + &label, + const wrapper + &energy = {}, + const wrapper + &yields = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + energy(this,energy), + yields(this,yields) + { + Component::finish(); + } + + // from node + explicit IncidentEnergy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncidentEnergy(const IncidentEnergy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + energy(this,other.energy), + yields(this,other.yields) + { + Component::finish(other); + } + + // move + IncidentEnergy(IncidentEnergy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + energy(this,std::move(other.energy)), + yields(this,std::move(other.yields)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + IncidentEnergy &operator=(const IncidentEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + energy = other.energy; + yields = other.yields; + } + return *this; + } + + // move + IncidentEnergy &operator=(IncidentEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + energy = std::move(other.energy); + yields = std::move(other.yields); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/IncidentEnergy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class IncidentEnergy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncidentEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncoherentPhotonScattering.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncoherentPhotonScattering.hpp new file mode 100644 index 000000000..ffdbccd11 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncoherentPhotonScattering.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_INCOHERENTPHOTONSCATTERING +#define GNDS_V2_0_GENERAL_INCOHERENTPHOTONSCATTERING + +#include "GNDS/v2.0/general/ScatteringFactor.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class IncoherentPhotonScattering +// ----------------------------------------------------------------------------- + +class IncoherentPhotonScattering : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "IncoherentPhotonScattering"; } + static auto NODENAME() { return "incoherentPhotonScattering"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::optional{} + / Meta<>("href") | + std::optional{} + / Meta<>("pid") | + std::optional{} + / Meta<>("productFrame") | + + // children + --Child> + ("scatteringFactor") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "href", + "pid", + "productFrame", + "scatteringFactor" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "href", + "pid", + "product_frame", + "scattering_factor" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field> + href{this}; + Field> + pid{this}; + Field> + productFrame{this}; + + // children + Field> + scatteringFactor{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href, \ + this->pid, \ + this->productFrame, \ + this->scatteringFactor \ + ) + + // default + IncoherentPhotonScattering() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit IncoherentPhotonScattering( + const wrapper + &label, + const wrapper> + &href = {}, + const wrapper> + &pid = {}, + const wrapper> + &productFrame = {}, + const wrapper> + &scatteringFactor = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href), + pid(this,pid), + productFrame(this,productFrame), + scatteringFactor(this,scatteringFactor) + { + Component::finish(); + } + + // from node + explicit IncoherentPhotonScattering(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncoherentPhotonScattering(const IncoherentPhotonScattering &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href), + pid(this,other.pid), + productFrame(this,other.productFrame), + scatteringFactor(this,other.scatteringFactor) + { + Component::finish(other); + } + + // move + IncoherentPhotonScattering(IncoherentPhotonScattering &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + href(this,std::move(other.href)), + pid(this,std::move(other.pid)), + productFrame(this,std::move(other.productFrame)), + scatteringFactor(this,std::move(other.scatteringFactor)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + IncoherentPhotonScattering &operator=(const IncoherentPhotonScattering &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + href = other.href; + pid = other.pid; + productFrame = other.productFrame; + scatteringFactor = other.scatteringFactor; + } + return *this; + } + + // move + IncoherentPhotonScattering &operator=(IncoherentPhotonScattering &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + href = std::move(other.href); + pid = std::move(other.pid); + productFrame = std::move(other.productFrame); + scatteringFactor = std::move(other.scatteringFactor); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/IncoherentPhotonScattering/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class IncoherentPhotonScattering + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncoherentPhotonScattering/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncoherentPhotonScattering/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncoherentPhotonScattering/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncompleteReactions.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncompleteReactions.hpp new file mode 100644 index 000000000..d53232476 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncompleteReactions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_INCOMPLETEREACTIONS +#define GNDS_V2_0_GENERAL_INCOMPLETEREACTIONS + +#include "GNDS/v2.0/general/Reaction.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class IncompleteReactions +// ----------------------------------------------------------------------------- + +class IncompleteReactions : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "IncompleteReactions"; } + static auto NODENAME() { return "incompleteReactions"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("reaction") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "reaction" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "reaction" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + reaction{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->reaction \ + ) + + // default + IncompleteReactions() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit IncompleteReactions( + const wrapper> + &reaction + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + reaction(this,reaction) + { + Component::finish(); + } + + // from node + explicit IncompleteReactions(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + IncompleteReactions(const IncompleteReactions &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + reaction(this,other.reaction) + { + Component::finish(other); + } + + // move + IncompleteReactions(IncompleteReactions &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + reaction(this,std::move(other.reaction)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + IncompleteReactions &operator=(const IncompleteReactions &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + reaction = other.reaction; + } + return *this; + } + + // move + IncompleteReactions &operator=(IncompleteReactions &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + reaction = std::move(other.reaction); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/IncompleteReactions/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class IncompleteReactions + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncompleteReactions/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncompleteReactions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/IncompleteReactions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Institution.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Institution.hpp new file mode 100644 index 000000000..02c6e4527 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Institution.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_INSTITUTION +#define GNDS_V2_0_GENERAL_INSTITUTION + +#include "GNDS/v2.0/general/ENDFconversionFlags.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Institution +// ----------------------------------------------------------------------------- + +class Institution : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Institution"; } + static auto NODENAME() { return "institution"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("label") | + + // children + --Child + ("ENDFconversionFlags") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "ENDFconversionFlags" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "endfconversion_flags" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + + // children + Field + ENDFconversionFlags{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(ENDFconversionFlags(),conversion); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDFconversionFlags \ + ) + + // default + Institution() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Institution( + const wrapper> + &label, + const wrapper + &ENDFconversionFlags = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + ENDFconversionFlags(this,ENDFconversionFlags) + { + Component::finish(); + } + + // from node + explicit Institution(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Institution(const Institution &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + ENDFconversionFlags(this,other.ENDFconversionFlags) + { + Component::finish(other); + } + + // move + Institution(Institution &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + ENDFconversionFlags(this,std::move(other.ENDFconversionFlags)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Institution &operator=(const Institution &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + ENDFconversionFlags = other.ENDFconversionFlags; + } + return *this; + } + + // move + Institution &operator=(Institution &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + ENDFconversionFlags = std::move(other.ENDFconversionFlags); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Institution/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Institution + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Institution/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Institution/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Institution/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Integer.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Integer.hpp new file mode 100644 index 000000000..0534f4b2a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Integer.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_INTEGER +#define GNDS_V2_0_GENERAL_INTEGER + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Integer +// ----------------------------------------------------------------------------- + +class Integer : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Integer"; } + static auto NODENAME() { return "integer"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + int{} + / Meta<>("value") | + std::optional{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + value{this}; + Field> + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit \ + ) + + // default + Integer() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Integer( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper> + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Integer(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Integer(const Integer &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + Integer(Integer &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Integer &operator=(const Integer &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + unit = other.unit; + } + return *this; + } + + // move + Integer &operator=(Integer &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + value = std::move(other.value); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Integer/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Integer + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Integer/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Integer/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Integer/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Intensity.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Intensity.hpp new file mode 100644 index 000000000..778d3e0d7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Intensity.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_INTENSITY +#define GNDS_V2_0_GENERAL_INTENSITY + +#include "GNDS/v2.0/general/Uncertainty.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Intensity +// ----------------------------------------------------------------------------- + +class Intensity : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Intensity"; } + static auto NODENAME() { return "intensity"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") | + + // children + --Child> + ("uncertainty") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "uncertainty" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + + // children + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->uncertainty \ + ) + + // default + Intensity() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Intensity( + const wrapper + &value, + const wrapper> + &uncertainty = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Intensity(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Intensity(const Intensity &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Intensity(Intensity &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Intensity &operator=(const Intensity &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + Intensity &operator=(Intensity &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Intensity/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Intensity + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Intensity/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Intensity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Intensity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/InternalConversionCoefficients.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/InternalConversionCoefficients.hpp new file mode 100644 index 000000000..f18506cfa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/InternalConversionCoefficients.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_INTERNALCONVERSIONCOEFFICIENTS +#define GNDS_V2_0_GENERAL_INTERNALCONVERSIONCOEFFICIENTS + +#include "GNDS/v2.0/general/Shell.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class InternalConversionCoefficients +// ----------------------------------------------------------------------------- + +class InternalConversionCoefficients : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "InternalConversionCoefficients"; } + static auto NODENAME() { return "internalConversionCoefficients"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("shell") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "shell" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "shell" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + shell{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shell \ + ) + + // default + InternalConversionCoefficients() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit InternalConversionCoefficients( + const wrapper> + &shell + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + shell(this,shell) + { + Component::finish(); + } + + // from node + explicit InternalConversionCoefficients(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + InternalConversionCoefficients(const InternalConversionCoefficients &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + shell(this,other.shell) + { + Component::finish(other); + } + + // move + InternalConversionCoefficients(InternalConversionCoefficients &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + shell(this,std::move(other.shell)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + InternalConversionCoefficients &operator=(const InternalConversionCoefficients &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + shell = other.shell; + } + return *this; + } + + // move + InternalConversionCoefficients &operator=(InternalConversionCoefficients &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + shell = std::move(other.shell); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/InternalConversionCoefficients/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class InternalConversionCoefficients + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/InternalConversionCoefficients/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/InternalConversionCoefficients/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/InternalConversionCoefficients/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotope.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotope.hpp new file mode 100644 index 000000000..7bfea7d05 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotope.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ISOTOPE +#define GNDS_V2_0_GENERAL_ISOTOPE + +#include "GNDS/v2.0/general/Nuclides.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Isotope +// ----------------------------------------------------------------------------- + +class Isotope : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Isotope"; } + static auto NODENAME() { return "isotope"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("symbol") | + int{} + / Meta<>("A") | + + // children + --Child + ("nuclides") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "symbol", + "A", + "nuclides" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "symbol", + "a", + "nuclides" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + symbol{this}; + Field + A{this}; + + // children + Field + nuclides{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(nuclides(),nuclide); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->symbol, \ + this->A, \ + this->nuclides \ + ) + + // default + Isotope() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Isotope( + const wrapper + &symbol, + const wrapper + &A = {}, + const wrapper + &nuclides = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + symbol(this,symbol), + A(this,A), + nuclides(this,nuclides) + { + Component::finish(); + } + + // from node + explicit Isotope(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Isotope(const Isotope &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + symbol(this,other.symbol), + A(this,other.A), + nuclides(this,other.nuclides) + { + Component::finish(other); + } + + // move + Isotope(Isotope &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + symbol(this,std::move(other.symbol)), + A(this,std::move(other.A)), + nuclides(this,std::move(other.nuclides)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Isotope &operator=(const Isotope &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + symbol = other.symbol; + A = other.A; + nuclides = other.nuclides; + } + return *this; + } + + // move + Isotope &operator=(Isotope &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + symbol = std::move(other.symbol); + A = std::move(other.A); + nuclides = std::move(other.nuclides); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Isotope/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Isotope + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotope/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotope/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotope/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotopes.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotopes.hpp new file mode 100644 index 000000000..2126ecedd --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotopes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ISOTOPES +#define GNDS_V2_0_GENERAL_ISOTOPES + +#include "GNDS/v2.0/general/Isotope.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Isotopes +// ----------------------------------------------------------------------------- + +class Isotopes : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Isotopes"; } + static auto NODENAME() { return "isotopes"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("isotope") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "isotope" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "isotope" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + isotope{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->isotope \ + ) + + // default + Isotopes() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Isotopes( + const wrapper> + &isotope + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + isotope(this,isotope) + { + Component::finish(); + } + + // from node + explicit Isotopes(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Isotopes(const Isotopes &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + isotope(this,other.isotope) + { + Component::finish(other); + } + + // move + Isotopes(Isotopes &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + isotope(this,std::move(other.isotope)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Isotopes &operator=(const Isotopes &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + isotope = other.isotope; + } + return *this; + } + + // move + Isotopes &operator=(Isotopes &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + isotope = std::move(other.isotope); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Isotopes/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Isotopes + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotopes/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotopes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotopes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotropic2d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotropic2d.hpp new file mode 100644 index 000000000..afe5eb05f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotropic2d.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ISOTROPIC2D +#define GNDS_V2_0_GENERAL_ISOTROPIC2D + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Isotropic2d +// ----------------------------------------------------------------------------- + +class Isotropic2d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Isotropic2d"; } + static auto NODENAME() { return "isotropic2d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + Isotropic2d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Isotropic2d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Isotropic2d(const Isotropic2d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Isotropic2d(Isotropic2d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Isotropic2d &operator=(const Isotropic2d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + Isotropic2d &operator=(Isotropic2d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Isotropic2d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Isotropic2d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotropic2d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotropic2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Isotropic2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/J.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/J.hpp new file mode 100644 index 000000000..8df58633f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/J.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_J +#define GNDS_V2_0_GENERAL_J + +#include "GNDS/v2.0/general/LevelSpacing.hpp" +#include "GNDS/v2.0/general/Widths.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class J +// ----------------------------------------------------------------------------- + +class J : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "J"; } + static auto NODENAME() { return "J"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + int{} + / Meta<>("value") | + + // children + --Child + ("levelSpacing") | + --Child + ("widths") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "levelSpacing", + "widths" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "level_spacing", + "widths" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + value{this}; + + // children + Field + levelSpacing{this}; + Field + widths{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(widths(),width); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->levelSpacing, \ + this->widths \ + ) + + // default + J() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit J( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &levelSpacing = {}, + const wrapper + &widths = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + levelSpacing(this,levelSpacing), + widths(this,widths) + { + Component::finish(); + } + + // from node + explicit J(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + J(const J &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + levelSpacing(this,other.levelSpacing), + widths(this,other.widths) + { + Component::finish(other); + } + + // move + J(J &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + value(this,std::move(other.value)), + levelSpacing(this,std::move(other.levelSpacing)), + widths(this,std::move(other.widths)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + J &operator=(const J &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + levelSpacing = other.levelSpacing; + widths = other.widths; + } + return *this; + } + + // move + J &operator=(J &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + value = std::move(other.value); + levelSpacing = std::move(other.levelSpacing); + widths = std::move(other.widths); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/J/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class J + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/J/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/J/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/J/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Js.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Js.hpp new file mode 100644 index 000000000..980c9830f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Js.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_JS +#define GNDS_V2_0_GENERAL_JS + +#include "GNDS/v2.0/general/J.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Js +// ----------------------------------------------------------------------------- + +class Js : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Js"; } + static auto NODENAME() { return "Js"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("J") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "J" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "j" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + J{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->J \ + ) + + // default + Js() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Js( + const wrapper> + &J + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + J(this,J) + { + Component::finish(); + } + + // from node + explicit Js(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Js(const Js &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + J(this,other.J) + { + Component::finish(other); + } + + // move + Js(Js &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + J(this,std::move(other.J)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Js &operator=(const Js &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + J = other.J; + } + return *this; + } + + // move + Js &operator=(Js &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + J = std::move(other.J); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Js/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Js + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Js/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Js/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Js/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/KalbachMann.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/KalbachMann.hpp new file mode 100644 index 000000000..ee2ec59fa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/KalbachMann.hpp @@ -0,0 +1,226 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_KALBACHMANN +#define GNDS_V2_0_GENERAL_KALBACHMANN + +#include "GNDS/v2.0/general/F.hpp" +#include "GNDS/v2.0/general/R.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class KalbachMann +// ----------------------------------------------------------------------------- + +class KalbachMann : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "KalbachMann"; } + static auto NODENAME() { return "KalbachMann"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("productFrame") | + + // children + --Child> + ("f") | + --Child> + ("r") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "productFrame", + "f", + "r" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "product_frame", + "f", + "r" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + productFrame{this}; + + // children + Field> + f{this}; + Field> + r{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->f, \ + this->r \ + ) + + // default + KalbachMann() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit KalbachMann( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper> + &f = {}, + const wrapper> + &r = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + f(this,f), + r(this,r) + { + Component::finish(); + } + + // from node + explicit KalbachMann(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + KalbachMann(const KalbachMann &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + f(this,other.f), + r(this,other.r) + { + Component::finish(other); + } + + // move + KalbachMann(KalbachMann &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)), + f(this,std::move(other.f)), + r(this,std::move(other.r)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + KalbachMann &operator=(const KalbachMann &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + f = other.f; + r = other.r; + } + return *this; + } + + // move + KalbachMann &operator=(KalbachMann &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + productFrame = std::move(other.productFrame); + f = std::move(other.f); + r = std::move(other.r); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/KalbachMann/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class KalbachMann + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/KalbachMann/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/KalbachMann/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/KalbachMann/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/L.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/L.hpp new file mode 100644 index 000000000..d2e8accd4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/L.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_L +#define GNDS_V2_0_GENERAL_L + +#include "GNDS/v2.0/general/Js.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class L +// ----------------------------------------------------------------------------- + +class L : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "L"; } + static auto NODENAME() { return "L"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + int{} + / Meta<>("value") | + + // children + --Child + ("Js") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "Js" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "js" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + value{this}; + + // children + Field + Js{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(Js(),J); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->Js \ + ) + + // default + L() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit L( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &Js = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + Js(this,Js) + { + Component::finish(); + } + + // from node + explicit L(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + L(const L &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + Js(this,other.Js) + { + Component::finish(other); + } + + // move + L(L &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + value(this,std::move(other.value)), + Js(this,std::move(other.Js)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + L &operator=(const L &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + Js = other.Js; + } + return *this; + } + + // move + L &operator=(L &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + value = std::move(other.value); + Js = std::move(other.Js); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/L/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class L + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/L/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/L/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/L/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Legendre.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Legendre.hpp new file mode 100644 index 000000000..84d614292 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Legendre.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_LEGENDRE +#define GNDS_V2_0_GENERAL_LEGENDRE + +#include "GNDS/v2.0/general/Values.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Legendre +// ----------------------------------------------------------------------------- + +class Legendre : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Legendre"; } + static auto NODENAME() { return "Legendre"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("outerDomainValue") | + + // children + --Child + ("values") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "outerDomainValue", + "values" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "outer_domain_value", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + outerDomainValue{this}; + + // children + Field + values{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->outerDomainValue, \ + this->values \ + ) + + // default + Legendre() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Legendre( + const wrapper + &outerDomainValue, + const wrapper + &values = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + outerDomainValue(this,outerDomainValue), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Legendre(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Legendre(const Legendre &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + outerDomainValue(this,other.outerDomainValue), + values(this,other.values) + { + Component::finish(other); + } + + // move + Legendre(Legendre &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + outerDomainValue(this,std::move(other.outerDomainValue)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Legendre &operator=(const Legendre &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + outerDomainValue = other.outerDomainValue; + values = other.values; + } + return *this; + } + + // move + Legendre &operator=(Legendre &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + outerDomainValue = std::move(other.outerDomainValue); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Legendre/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Legendre + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Legendre/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Legendre/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Legendre/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Lepton.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Lepton.hpp new file mode 100644 index 000000000..90198f742 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Lepton.hpp @@ -0,0 +1,277 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_LEPTON +#define GNDS_V2_0_GENERAL_LEPTON + +#include "GNDS/v2.0/general/Mass.hpp" +#include "GNDS/v2.0/general/Spin.hpp" +#include "GNDS/v2.0/general/Parity.hpp" +#include "GNDS/v2.0/general/Charge.hpp" +#include "GNDS/v2.0/general/Halflife.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Lepton +// ----------------------------------------------------------------------------- + +class Lepton : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Lepton"; } + static auto NODENAME() { return "lepton"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("id") | + std::string{} + / Meta<>("generation") | + + // children + --Child + ("mass") | + --Child + ("spin") | + --Child + ("parity") | + --Child + ("charge") | + --Child + ("halflife") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "id", + "generation", + "mass", + "spin", + "parity", + "charge", + "halflife" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "id", + "generation", + "mass", + "spin", + "parity", + "charge", + "halflife" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + id{this}; + Field + generation{this}; + + // children + Field + mass{this}; + Field + spin{this}; + Field + parity{this}; + Field + charge{this}; + Field + halflife{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(spin(),fraction); + NJOY_GNDSTK_SHORTCUT(halflife(),string); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->generation, \ + this->mass, \ + this->spin, \ + this->parity, \ + this->charge, \ + this->halflife \ + ) + + // default + Lepton() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Lepton( + const wrapper + &id, + const wrapper + &generation = {}, + const wrapper + &mass = {}, + const wrapper + &spin = {}, + const wrapper + &parity = {}, + const wrapper + &charge = {}, + const wrapper + &halflife = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + id(this,id), + generation(this,generation), + mass(this,mass), + spin(this,spin), + parity(this,parity), + charge(this,charge), + halflife(this,halflife) + { + Component::finish(); + } + + // from node + explicit Lepton(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Lepton(const Lepton &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + generation(this,other.generation), + mass(this,other.mass), + spin(this,other.spin), + parity(this,other.parity), + charge(this,other.charge), + halflife(this,other.halflife) + { + Component::finish(other); + } + + // move + Lepton(Lepton &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + generation(this,std::move(other.generation)), + mass(this,std::move(other.mass)), + spin(this,std::move(other.spin)), + parity(this,std::move(other.parity)), + charge(this,std::move(other.charge)), + halflife(this,std::move(other.halflife)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Lepton &operator=(const Lepton &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + id = other.id; + generation = other.generation; + mass = other.mass; + spin = other.spin; + parity = other.parity; + charge = other.charge; + halflife = other.halflife; + } + return *this; + } + + // move + Lepton &operator=(Lepton &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + id = std::move(other.id); + generation = std::move(other.generation); + mass = std::move(other.mass); + spin = std::move(other.spin); + parity = std::move(other.parity); + charge = std::move(other.charge); + halflife = std::move(other.halflife); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Lepton/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Lepton + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Lepton/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Lepton/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Lepton/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Leptons.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Leptons.hpp new file mode 100644 index 000000000..bf5123f88 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Leptons.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_LEPTONS +#define GNDS_V2_0_GENERAL_LEPTONS + +#include "GNDS/v2.0/general/Lepton.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Leptons +// ----------------------------------------------------------------------------- + +class Leptons : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Leptons"; } + static auto NODENAME() { return "leptons"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("lepton") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "lepton" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "lepton" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + lepton{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->lepton \ + ) + + // default + Leptons() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Leptons( + const wrapper> + &lepton + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + lepton(this,lepton) + { + Component::finish(); + } + + // from node + explicit Leptons(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Leptons(const Leptons &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + lepton(this,other.lepton) + { + Component::finish(other); + } + + // move + Leptons(Leptons &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + lepton(this,std::move(other.lepton)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Leptons &operator=(const Leptons &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + lepton = other.lepton; + } + return *this; + } + + // move + Leptons &operator=(Leptons &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + lepton = std::move(other.lepton); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Leptons/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Leptons + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Leptons/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Leptons/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Leptons/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/LevelSpacing.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/LevelSpacing.hpp new file mode 100644 index 000000000..03730f796 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/LevelSpacing.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_LEVELSPACING +#define GNDS_V2_0_GENERAL_LEVELSPACING + +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/Constant1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class LevelSpacing +// ----------------------------------------------------------------------------- + +class LevelSpacing : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "LevelSpacing"; } + static auto NODENAME() { return "levelSpacing"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("XYs1d") | + --Child> + ("constant1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d", + "constant1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d", + "constant1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + constant1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->constant1d \ + ) + + // default + LevelSpacing() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit LevelSpacing( + const wrapper> + &XYs1d, + const wrapper> + &constant1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + constant1d(this,constant1d) + { + Component::finish(); + } + + // from node + explicit LevelSpacing(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + LevelSpacing(const LevelSpacing &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + constant1d(this,other.constant1d) + { + Component::finish(other); + } + + // move + LevelSpacing(LevelSpacing &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + constant1d(this,std::move(other.constant1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + LevelSpacing &operator=(const LevelSpacing &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + constant1d = other.constant1d; + } + return *this; + } + + // move + LevelSpacing &operator=(LevelSpacing &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + constant1d = std::move(other.constant1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/LevelSpacing/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class LevelSpacing + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/LevelSpacing/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/LevelSpacing/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/LevelSpacing/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Link.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Link.hpp new file mode 100644 index 000000000..1ad082f0c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Link.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_LINK +#define GNDS_V2_0_GENERAL_LINK + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Link +// ----------------------------------------------------------------------------- + +class Link : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Link"; } + static auto NODENAME() { return "link"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("href") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "href" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Link() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Link( + const wrapper + &href + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Link(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Link(const Link &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Link(Link &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Link &operator=(const Link &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + href = other.href; + } + return *this; + } + + // move + Link &operator=(Link &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Link/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Link + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Link/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Link/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Link/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ListOfCovariances.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ListOfCovariances.hpp new file mode 100644 index 000000000..62c21fa4a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ListOfCovariances.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_LISTOFCOVARIANCES +#define GNDS_V2_0_GENERAL_LISTOFCOVARIANCES + +#include "GNDS/v2.0/general/Covariance.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ListOfCovariances +// ----------------------------------------------------------------------------- + +class ListOfCovariances : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ListOfCovariances"; } + static auto NODENAME() { return "listOfCovariances"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("covariance") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "covariance" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "covariance" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + covariance{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->covariance \ + ) + + // default + ListOfCovariances() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ListOfCovariances( + const wrapper> + &covariance + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + covariance(this,covariance) + { + Component::finish(); + } + + // from node + explicit ListOfCovariances(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ListOfCovariances(const ListOfCovariances &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + covariance(this,other.covariance) + { + Component::finish(other); + } + + // move + ListOfCovariances(ListOfCovariances &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + covariance(this,std::move(other.covariance)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ListOfCovariances &operator=(const ListOfCovariances &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + covariance = other.covariance; + } + return *this; + } + + // move + ListOfCovariances &operator=(ListOfCovariances &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + covariance = std::move(other.covariance); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ListOfCovariances/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ListOfCovariances + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ListOfCovariances/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ListOfCovariances/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ListOfCovariances/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Ls.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Ls.hpp new file mode 100644 index 000000000..d47ad41a5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Ls.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_LS +#define GNDS_V2_0_GENERAL_LS + +#include "GNDS/v2.0/general/L.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Ls +// ----------------------------------------------------------------------------- + +class Ls : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Ls"; } + static auto NODENAME() { return "Ls"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("L") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "L" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "l" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + L{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->L \ + ) + + // default + Ls() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Ls( + const wrapper> + &L + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + L(this,L) + { + Component::finish(); + } + + // from node + explicit Ls(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Ls(const Ls &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + L(this,other.L) + { + Component::finish(other); + } + + // move + Ls(Ls &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + L(this,std::move(other.L)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Ls &operator=(const Ls &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + L = other.L; + } + return *this; + } + + // move + Ls &operator=(Ls &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + L = std::move(other.L); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Ls/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Ls + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Ls/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Ls/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Ls/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MadlandNix.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MadlandNix.hpp new file mode 100644 index 000000000..ecb59c43c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MadlandNix.hpp @@ -0,0 +1,217 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_MADLANDNIX +#define GNDS_V2_0_GENERAL_MADLANDNIX + +#include "GNDS/v2.0/general/EFL.hpp" +#include "GNDS/v2.0/general/EFH.hpp" +#include "GNDS/v2.0/general/T_M.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class MadlandNix +// ----------------------------------------------------------------------------- + +class MadlandNix : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "MadlandNix"; } + static auto NODENAME() { return "MadlandNix"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("EFL") | + --Child + ("EFH") | + --Child + ("T_M") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "EFL", + "EFH", + "T_M" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "efl", + "efh", + "t_m" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + EFL{this}; + Field + EFH{this}; + Field + T_M{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(T_M(),XYs1d); + NJOY_GNDSTK_SHORTCUT(T_M().XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(T_M().XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(T_M().XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->EFL, \ + this->EFH, \ + this->T_M \ + ) + + // default + MadlandNix() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MadlandNix( + const wrapper + &EFL, + const wrapper + &EFH = {}, + const wrapper + &T_M = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + EFL(this,EFL), + EFH(this,EFH), + T_M(this,T_M) + { + Component::finish(); + } + + // from node + explicit MadlandNix(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MadlandNix(const MadlandNix &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + EFL(this,other.EFL), + EFH(this,other.EFH), + T_M(this,other.T_M) + { + Component::finish(other); + } + + // move + MadlandNix(MadlandNix &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + EFL(this,std::move(other.EFL)), + EFH(this,std::move(other.EFH)), + T_M(this,std::move(other.T_M)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + MadlandNix &operator=(const MadlandNix &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + EFL = other.EFL; + EFH = other.EFH; + T_M = other.T_M; + } + return *this; + } + + // move + MadlandNix &operator=(MadlandNix &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + EFL = std::move(other.EFL); + EFH = std::move(other.EFH); + T_M = std::move(other.T_M); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/MadlandNix/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class MadlandNix + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MadlandNix/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MadlandNix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MadlandNix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mass.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mass.hpp new file mode 100644 index 000000000..bd475668a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mass.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_MASS +#define GNDS_V2_0_GENERAL_MASS + +#include "GNDS/v2.0/general/Double.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Mass +// ----------------------------------------------------------------------------- + +class Mass : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Mass"; } + static auto NODENAME() { return "mass"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("value") | + std::optional{} + / Meta<>("unit") | + + // children + --Child> + ("double") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit", + "Double" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + value{this}; + Field> + unit{this}; + + // children + Field> + Double{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit, \ + this->Double \ + ) + + // default + Mass() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Mass( + const wrapper> + &value, + const wrapper> + &unit = {}, + const wrapper> + &Double = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Mass(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Mass(const Mass &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Mass(Mass &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Mass &operator=(const Mass &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + unit = other.unit; + Double = other.Double; + } + return *this; + } + + // move + Mass &operator=(Mass &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + unit = std::move(other.unit); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Mass/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Mass + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mass/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mass/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mass/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MetaStable.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MetaStable.hpp new file mode 100644 index 000000000..b6235b748 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MetaStable.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_METASTABLE +#define GNDS_V2_0_GENERAL_METASTABLE + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class MetaStable +// ----------------------------------------------------------------------------- + +class MetaStable : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "MetaStable"; } + static auto NODENAME() { return "metaStable"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("id") | + std::string{} + / Meta<>("pid") | + int{} + / Meta<>("metaStableIndex") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "id", + "pid", + "metaStableIndex" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "id", + "pid", + "meta_stable_index" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + id{this}; + Field + pid{this}; + Field + metaStableIndex{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->pid, \ + this->metaStableIndex \ + ) + + // default + MetaStable() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MetaStable( + const wrapper + &id, + const wrapper + &pid = {}, + const wrapper + &metaStableIndex = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + id(this,id), + pid(this,pid), + metaStableIndex(this,metaStableIndex) + { + Component::finish(); + } + + // from node + explicit MetaStable(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MetaStable(const MetaStable &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + pid(this,other.pid), + metaStableIndex(this,other.metaStableIndex) + { + Component::finish(other); + } + + // move + MetaStable(MetaStable &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + pid(this,std::move(other.pid)), + metaStableIndex(this,std::move(other.metaStableIndex)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + MetaStable &operator=(const MetaStable &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + id = other.id; + pid = other.pid; + metaStableIndex = other.metaStableIndex; + } + return *this; + } + + // move + MetaStable &operator=(MetaStable &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + id = std::move(other.id); + pid = std::move(other.pid); + metaStableIndex = std::move(other.metaStableIndex); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/MetaStable/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class MetaStable + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MetaStable/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MetaStable/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MetaStable/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mixed.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mixed.hpp new file mode 100644 index 000000000..bce488653 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mixed.hpp @@ -0,0 +1,227 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_MIXED +#define GNDS_V2_0_GENERAL_MIXED + +#include "GNDS/v2.0/general/CovarianceMatrix.hpp" +#include "GNDS/v2.0/general/Sum.hpp" +#include "GNDS/v2.0/general/ShortRangeSelfScalingVariance.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Mixed +// ----------------------------------------------------------------------------- + +class Mixed : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Mixed"; } + static auto NODENAME() { return "mixed"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + + // children + ++Child + ("covarianceMatrix") | + ++Child> + ("sum") | + --Child> + ("shortRangeSelfScalingVariance") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "covarianceMatrix", + "sum", + "shortRangeSelfScalingVariance" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "covariance_matrix", + "sum", + "short_range_self_scaling_variance" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children + Field> + covarianceMatrix{this}; + Field>> + sum{this}; + Field> + shortRangeSelfScalingVariance{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->covarianceMatrix, \ + this->sum, \ + this->shortRangeSelfScalingVariance \ + ) + + // default + Mixed() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Mixed( + const wrapper + &label, + const wrapper> + &covarianceMatrix = {}, + const wrapper>> + &sum = {}, + const wrapper> + &shortRangeSelfScalingVariance = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + covarianceMatrix(this,covarianceMatrix), + sum(this,sum), + shortRangeSelfScalingVariance(this,shortRangeSelfScalingVariance) + { + Component::finish(); + } + + // from node + explicit Mixed(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Mixed(const Mixed &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + covarianceMatrix(this,other.covarianceMatrix), + sum(this,other.sum), + shortRangeSelfScalingVariance(this,other.shortRangeSelfScalingVariance) + { + Component::finish(other); + } + + // move + Mixed(Mixed &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + covarianceMatrix(this,std::move(other.covarianceMatrix)), + sum(this,std::move(other.sum)), + shortRangeSelfScalingVariance(this,std::move(other.shortRangeSelfScalingVariance)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Mixed &operator=(const Mixed &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + covarianceMatrix = other.covarianceMatrix; + sum = other.sum; + shortRangeSelfScalingVariance = other.shortRangeSelfScalingVariance; + } + return *this; + } + + // move + Mixed &operator=(Mixed &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + covarianceMatrix = std::move(other.covarianceMatrix); + sum = std::move(other.sum); + shortRangeSelfScalingVariance = std::move(other.shortRangeSelfScalingVariance); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Mixed/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Mixed + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mixed/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mixed/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Mixed/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Multiplicity.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Multiplicity.hpp new file mode 100644 index 000000000..e13ea82f2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Multiplicity.hpp @@ -0,0 +1,284 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_MULTIPLICITY +#define GNDS_V2_0_GENERAL_MULTIPLICITY + +#include "GNDS/v2.0/general/Constant1d.hpp" +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/Regions1d.hpp" +#include "GNDS/v2.0/general/Polynomial1d.hpp" +#include "GNDS/v2.0/general/Reference.hpp" +#include "GNDS/v2.0/general/Branching1d.hpp" +#include "GNDS/v2.0/general/Branching3d.hpp" +#include "GNDS/v2.0/general/Unspecified.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Multiplicity +// ----------------------------------------------------------------------------- + +class Multiplicity : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Multiplicity"; } + static auto NODENAME() { return "multiplicity"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("constant1d") | + --Child> + ("XYs1d") | + --Child> + ("regions1d") | + --Child> + ("polynomial1d") | + --Child> + ("reference") | + --Child> + ("branching1d") | + --Child> + ("branching3d") | + --Child> + ("unspecified") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "constant1d", + "XYs1d", + "regions1d", + "polynomial1d", + "reference", + "branching1d", + "branching3d", + "unspecified" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "constant1d", + "xys1d", + "regions1d", + "polynomial1d", + "reference", + "branching1d", + "branching3d", + "unspecified" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + constant1d{this}; + Field> + XYs1d{this}; + Field> + regions1d{this}; + Field> + polynomial1d{this}; + Field> + reference{this}; + Field> + branching1d{this}; + Field> + branching3d{this}; + Field> + unspecified{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->constant1d, \ + this->XYs1d, \ + this->regions1d, \ + this->polynomial1d, \ + this->reference, \ + this->branching1d, \ + this->branching3d, \ + this->unspecified \ + ) + + // default + Multiplicity() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Multiplicity( + const wrapper> + &constant1d, + const wrapper> + &XYs1d = {}, + const wrapper> + ®ions1d = {}, + const wrapper> + &polynomial1d = {}, + const wrapper> + &reference = {}, + const wrapper> + &branching1d = {}, + const wrapper> + &branching3d = {}, + const wrapper> + &unspecified = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + constant1d(this,constant1d), + XYs1d(this,XYs1d), + regions1d(this,regions1d), + polynomial1d(this,polynomial1d), + reference(this,reference), + branching1d(this,branching1d), + branching3d(this,branching3d), + unspecified(this,unspecified) + { + Component::finish(); + } + + // from node + explicit Multiplicity(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Multiplicity(const Multiplicity &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + constant1d(this,other.constant1d), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d), + polynomial1d(this,other.polynomial1d), + reference(this,other.reference), + branching1d(this,other.branching1d), + branching3d(this,other.branching3d), + unspecified(this,other.unspecified) + { + Component::finish(other); + } + + // move + Multiplicity(Multiplicity &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + constant1d(this,std::move(other.constant1d)), + XYs1d(this,std::move(other.XYs1d)), + regions1d(this,std::move(other.regions1d)), + polynomial1d(this,std::move(other.polynomial1d)), + reference(this,std::move(other.reference)), + branching1d(this,std::move(other.branching1d)), + branching3d(this,std::move(other.branching3d)), + unspecified(this,std::move(other.unspecified)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Multiplicity &operator=(const Multiplicity &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + constant1d = other.constant1d; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + polynomial1d = other.polynomial1d; + reference = other.reference; + branching1d = other.branching1d; + branching3d = other.branching3d; + unspecified = other.unspecified; + } + return *this; + } + + // move + Multiplicity &operator=(Multiplicity &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + constant1d = std::move(other.constant1d); + XYs1d = std::move(other.XYs1d); + regions1d = std::move(other.regions1d); + polynomial1d = std::move(other.polynomial1d); + reference = std::move(other.reference); + branching1d = std::move(other.branching1d); + branching3d = std::move(other.branching3d); + unspecified = std::move(other.unspecified); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Multiplicity/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Multiplicity + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Multiplicity/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Multiplicity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Multiplicity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySum.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySum.hpp new file mode 100644 index 000000000..890d78d9c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySum.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_MULTIPLICITYSUM +#define GNDS_V2_0_GENERAL_MULTIPLICITYSUM + +#include "GNDS/v2.0/general/Multiplicity.hpp" +#include "GNDS/v2.0/general/Summands.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class MultiplicitySum +// ----------------------------------------------------------------------------- + +class MultiplicitySum : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "MultiplicitySum"; } + static auto NODENAME() { return "multiplicitySum"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + int{} + / Meta<>("ENDF_MT") | + + // children + --Child + ("multiplicity") | + --Child + ("summands") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "ENDF_MT", + "multiplicity", + "summands" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "endf_mt", + "multiplicity", + "summands" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + ENDF_MT{this}; + + // children + Field + multiplicity{this}; + Field + summands{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(multiplicity(),XYs1d); + NJOY_GNDSTK_SHORTCUT(summands(),add); + NJOY_GNDSTK_SHORTCUT(multiplicity(),branching1d); + NJOY_GNDSTK_SHORTCUT(multiplicity(),branching3d); + NJOY_GNDSTK_SHORTCUT(multiplicity(),constant1d); + NJOY_GNDSTK_SHORTCUT(multiplicity(),polynomial1d); + NJOY_GNDSTK_SHORTCUT(multiplicity(),reference); + NJOY_GNDSTK_SHORTCUT(multiplicity(),regions1d); + NJOY_GNDSTK_SHORTCUT(multiplicity(),unspecified); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->multiplicity, \ + this->summands \ + ) + + // default + MultiplicitySum() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MultiplicitySum( + const wrapper + &label, + const wrapper + &ENDF_MT = {}, + const wrapper + &multiplicity = {}, + const wrapper + &summands = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + ENDF_MT(this,ENDF_MT), + multiplicity(this,multiplicity), + summands(this,summands) + { + Component::finish(); + } + + // from node + explicit MultiplicitySum(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MultiplicitySum(const MultiplicitySum &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + ENDF_MT(this,other.ENDF_MT), + multiplicity(this,other.multiplicity), + summands(this,other.summands) + { + Component::finish(other); + } + + // move + MultiplicitySum(MultiplicitySum &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + ENDF_MT(this,std::move(other.ENDF_MT)), + multiplicity(this,std::move(other.multiplicity)), + summands(this,std::move(other.summands)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + MultiplicitySum &operator=(const MultiplicitySum &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + ENDF_MT = other.ENDF_MT; + multiplicity = other.multiplicity; + summands = other.summands; + } + return *this; + } + + // move + MultiplicitySum &operator=(MultiplicitySum &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + ENDF_MT = std::move(other.ENDF_MT); + multiplicity = std::move(other.multiplicity); + summands = std::move(other.summands); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/MultiplicitySum/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class MultiplicitySum + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySum/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySums.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySums.hpp new file mode 100644 index 000000000..91eb8ddc1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySums.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_MULTIPLICITYSUMS +#define GNDS_V2_0_GENERAL_MULTIPLICITYSUMS + +#include "GNDS/v2.0/general/MultiplicitySum.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class MultiplicitySums +// ----------------------------------------------------------------------------- + +class MultiplicitySums : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "MultiplicitySums"; } + static auto NODENAME() { return "multiplicitySums"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("multiplicitySum") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "multiplicitySum" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "multiplicity_sum" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + multiplicitySum{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->multiplicitySum \ + ) + + // default + MultiplicitySums() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit MultiplicitySums( + const wrapper> + &multiplicitySum + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + multiplicitySum(this,multiplicitySum) + { + Component::finish(); + } + + // from node + explicit MultiplicitySums(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + MultiplicitySums(const MultiplicitySums &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + multiplicitySum(this,other.multiplicitySum) + { + Component::finish(other); + } + + // move + MultiplicitySums(MultiplicitySums &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + multiplicitySum(this,std::move(other.multiplicitySum)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + MultiplicitySums &operator=(const MultiplicitySums &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + multiplicitySum = other.multiplicitySum; + } + return *this; + } + + // move + MultiplicitySums &operator=(MultiplicitySums &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + multiplicitySum = std::move(other.multiplicitySum); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/MultiplicitySums/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class MultiplicitySums + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySums/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySums/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/MultiplicitySums/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NBodyPhaseSpace.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NBodyPhaseSpace.hpp new file mode 100644 index 000000000..9aba83ac1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NBodyPhaseSpace.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_NBODYPHASESPACE +#define GNDS_V2_0_GENERAL_NBODYPHASESPACE + +#include "GNDS/v2.0/general/Mass.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class NBodyPhaseSpace +// ----------------------------------------------------------------------------- + +class NBodyPhaseSpace : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "NBodyPhaseSpace"; } + static auto NODENAME() { return "NBodyPhaseSpace"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + int{} + / Meta<>("numberOfProducts") | + + // children + --Child + ("mass") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "numberOfProducts", + "mass" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "number_of_products", + "mass" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + numberOfProducts{this}; + + // children + Field + mass{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(mass(),Double); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->numberOfProducts, \ + this->mass \ + ) + + // default + NBodyPhaseSpace() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NBodyPhaseSpace( + const wrapper + &numberOfProducts, + const wrapper + &mass = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + numberOfProducts(this,numberOfProducts), + mass(this,mass) + { + Component::finish(); + } + + // from node + explicit NBodyPhaseSpace(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NBodyPhaseSpace(const NBodyPhaseSpace &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + numberOfProducts(this,other.numberOfProducts), + mass(this,other.mass) + { + Component::finish(other); + } + + // move + NBodyPhaseSpace(NBodyPhaseSpace &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + numberOfProducts(this,std::move(other.numberOfProducts)), + mass(this,std::move(other.mass)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + NBodyPhaseSpace &operator=(const NBodyPhaseSpace &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + numberOfProducts = other.numberOfProducts; + mass = other.mass; + } + return *this; + } + + // move + NBodyPhaseSpace &operator=(NBodyPhaseSpace &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + numberOfProducts = std::move(other.numberOfProducts); + mass = std::move(other.mass); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/NBodyPhaseSpace/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class NBodyPhaseSpace + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NBodyPhaseSpace/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NBodyPhaseSpace/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NBodyPhaseSpace/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NeutrinoEnergy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NeutrinoEnergy.hpp new file mode 100644 index 000000000..bcf7be12d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NeutrinoEnergy.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_NEUTRINOENERGY +#define GNDS_V2_0_GENERAL_NEUTRINOENERGY + +#include "GNDS/v2.0/general/Polynomial1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class NeutrinoEnergy +// ----------------------------------------------------------------------------- + +class NeutrinoEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "NeutrinoEnergy"; } + static auto NODENAME() { return "neutrinoEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("polynomial1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + polynomial1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(polynomial1d(),axes); + NJOY_GNDSTK_SHORTCUT(polynomial1d().axes(),axis); + NJOY_GNDSTK_SHORTCUT(polynomial1d().axes(),grid); + NJOY_GNDSTK_SHORTCUT(polynomial1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(polynomial1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + NeutrinoEnergy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NeutrinoEnergy( + const wrapper + &polynomial1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit NeutrinoEnergy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NeutrinoEnergy(const NeutrinoEnergy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + NeutrinoEnergy(NeutrinoEnergy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + polynomial1d(this,std::move(other.polynomial1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + NeutrinoEnergy &operator=(const NeutrinoEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + polynomial1d = other.polynomial1d; + } + return *this; + } + + // move + NeutrinoEnergy &operator=(NeutrinoEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + polynomial1d = std::move(other.polynomial1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/NeutrinoEnergy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class NeutrinoEnergy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NeutrinoEnergy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NeutrinoEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NeutrinoEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NonNeutrinoEnergy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NonNeutrinoEnergy.hpp new file mode 100644 index 000000000..0eed4ede3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NonNeutrinoEnergy.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_NONNEUTRINOENERGY +#define GNDS_V2_0_GENERAL_NONNEUTRINOENERGY + +#include "GNDS/v2.0/general/Polynomial1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class NonNeutrinoEnergy +// ----------------------------------------------------------------------------- + +class NonNeutrinoEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "NonNeutrinoEnergy"; } + static auto NODENAME() { return "nonNeutrinoEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("polynomial1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + polynomial1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(polynomial1d(),axes); + NJOY_GNDSTK_SHORTCUT(polynomial1d().axes(),axis); + NJOY_GNDSTK_SHORTCUT(polynomial1d().axes(),grid); + NJOY_GNDSTK_SHORTCUT(polynomial1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(polynomial1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + NonNeutrinoEnergy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NonNeutrinoEnergy( + const wrapper + &polynomial1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit NonNeutrinoEnergy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NonNeutrinoEnergy(const NonNeutrinoEnergy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + NonNeutrinoEnergy(NonNeutrinoEnergy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + polynomial1d(this,std::move(other.polynomial1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + NonNeutrinoEnergy &operator=(const NonNeutrinoEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + polynomial1d = other.polynomial1d; + } + return *this; + } + + // move + NonNeutrinoEnergy &operator=(NonNeutrinoEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + polynomial1d = std::move(other.polynomial1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/NonNeutrinoEnergy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class NonNeutrinoEnergy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NonNeutrinoEnergy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NonNeutrinoEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NonNeutrinoEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearAmplitudeExpansion.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearAmplitudeExpansion.hpp new file mode 100644 index 000000000..7956e4423 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearAmplitudeExpansion.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_NUCLEARAMPLITUDEEXPANSION +#define GNDS_V2_0_GENERAL_NUCLEARAMPLITUDEEXPANSION + +#include "GNDS/v2.0/general/NuclearTerm.hpp" +#include "GNDS/v2.0/general/RealInterferenceTerm.hpp" +#include "GNDS/v2.0/general/ImaginaryInterferenceTerm.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class NuclearAmplitudeExpansion +// ----------------------------------------------------------------------------- + +class NuclearAmplitudeExpansion : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "NuclearAmplitudeExpansion"; } + static auto NODENAME() { return "nuclearAmplitudeExpansion"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("nuclearTerm") | + --Child + ("realInterferenceTerm") | + --Child + ("imaginaryInterferenceTerm") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "nuclearTerm", + "realInterferenceTerm", + "imaginaryInterferenceTerm" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "nuclear_term", + "real_interference_term", + "imaginary_interference_term" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + nuclearTerm{this}; + Field + realInterferenceTerm{this}; + Field + imaginaryInterferenceTerm{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->nuclearTerm, \ + this->realInterferenceTerm, \ + this->imaginaryInterferenceTerm \ + ) + + // default + NuclearAmplitudeExpansion() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NuclearAmplitudeExpansion( + const wrapper + &nuclearTerm, + const wrapper + &realInterferenceTerm = {}, + const wrapper + &imaginaryInterferenceTerm = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + nuclearTerm(this,nuclearTerm), + realInterferenceTerm(this,realInterferenceTerm), + imaginaryInterferenceTerm(this,imaginaryInterferenceTerm) + { + Component::finish(); + } + + // from node + explicit NuclearAmplitudeExpansion(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NuclearAmplitudeExpansion(const NuclearAmplitudeExpansion &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + nuclearTerm(this,other.nuclearTerm), + realInterferenceTerm(this,other.realInterferenceTerm), + imaginaryInterferenceTerm(this,other.imaginaryInterferenceTerm) + { + Component::finish(other); + } + + // move + NuclearAmplitudeExpansion(NuclearAmplitudeExpansion &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + nuclearTerm(this,std::move(other.nuclearTerm)), + realInterferenceTerm(this,std::move(other.realInterferenceTerm)), + imaginaryInterferenceTerm(this,std::move(other.imaginaryInterferenceTerm)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + NuclearAmplitudeExpansion &operator=(const NuclearAmplitudeExpansion &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + nuclearTerm = other.nuclearTerm; + realInterferenceTerm = other.realInterferenceTerm; + imaginaryInterferenceTerm = other.imaginaryInterferenceTerm; + } + return *this; + } + + // move + NuclearAmplitudeExpansion &operator=(NuclearAmplitudeExpansion &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + nuclearTerm = std::move(other.nuclearTerm); + realInterferenceTerm = std::move(other.realInterferenceTerm); + imaginaryInterferenceTerm = std::move(other.imaginaryInterferenceTerm); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/NuclearAmplitudeExpansion/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class NuclearAmplitudeExpansion + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearAmplitudeExpansion/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearAmplitudeExpansion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearAmplitudeExpansion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearPlusInterference.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearPlusInterference.hpp new file mode 100644 index 000000000..b49e84deb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearPlusInterference.hpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_NUCLEARPLUSINTERFERENCE +#define GNDS_V2_0_GENERAL_NUCLEARPLUSINTERFERENCE + +#include "GNDS/v2.0/reduced/CrossSection.hpp" +#include "GNDS/v2.0/reduced/Distribution.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class NuclearPlusInterference +// ----------------------------------------------------------------------------- + +class NuclearPlusInterference : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "NuclearPlusInterference"; } + static auto NODENAME() { return "nuclearPlusInterference"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("muCutoff") | + + // children + --Child + ("crossSection") | + --Child + ("distribution") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "muCutoff", + "crossSection", + "distribution" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "mu_cutoff", + "cross_section", + "distribution" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + muCutoff{this}; + + // children + Field + crossSection{this}; + Field + distribution{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(crossSection(),XYs1d); + NJOY_GNDSTK_SHORTCUT(distribution(),XYs2d); + NJOY_GNDSTK_SHORTCUT(distribution(),branching3d); + NJOY_GNDSTK_SHORTCUT(crossSection(),reference); + NJOY_GNDSTK_SHORTCUT(crossSection(),regions1d); + NJOY_GNDSTK_SHORTCUT(distribution(),thermalNeutronScatteringLaw); + NJOY_GNDSTK_SHORTCUT(distribution(),uncorrelated); + NJOY_GNDSTK_SHORTCUT(distribution(),unspecified); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->muCutoff, \ + this->crossSection, \ + this->distribution \ + ) + + // default + NuclearPlusInterference() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NuclearPlusInterference( + const wrapper + &muCutoff, + const wrapper + &crossSection = {}, + const wrapper + &distribution = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + muCutoff(this,muCutoff), + crossSection(this,crossSection), + distribution(this,distribution) + { + Component::finish(); + } + + // from node + explicit NuclearPlusInterference(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NuclearPlusInterference(const NuclearPlusInterference &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + muCutoff(this,other.muCutoff), + crossSection(this,other.crossSection), + distribution(this,other.distribution) + { + Component::finish(other); + } + + // move + NuclearPlusInterference(NuclearPlusInterference &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + muCutoff(this,std::move(other.muCutoff)), + crossSection(this,std::move(other.crossSection)), + distribution(this,std::move(other.distribution)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + NuclearPlusInterference &operator=(const NuclearPlusInterference &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + muCutoff = other.muCutoff; + crossSection = other.crossSection; + distribution = other.distribution; + } + return *this; + } + + // move + NuclearPlusInterference &operator=(NuclearPlusInterference &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + muCutoff = std::move(other.muCutoff); + crossSection = std::move(other.crossSection); + distribution = std::move(other.distribution); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/NuclearPlusInterference/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class NuclearPlusInterference + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearPlusInterference/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearPlusInterference/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearPlusInterference/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearTerm.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearTerm.hpp new file mode 100644 index 000000000..2157b8e65 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearTerm.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_NUCLEARTERM +#define GNDS_V2_0_GENERAL_NUCLEARTERM + +#include "GNDS/v2.0/general/Regions2d.hpp" +#include "GNDS/v2.0/general/XYs2d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class NuclearTerm +// ----------------------------------------------------------------------------- + +class NuclearTerm : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "NuclearTerm"; } + static auto NODENAME() { return "nuclearTerm"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("regions2d") | + --Child> + ("XYs2d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "regions2d", + "XYs2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "regions2d", + "xys2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + regions2d{this}; + Field> + XYs2d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->regions2d, \ + this->XYs2d \ + ) + + // default + NuclearTerm() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit NuclearTerm( + const wrapper> + ®ions2d, + const wrapper> + &XYs2d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + regions2d(this,regions2d), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit NuclearTerm(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + NuclearTerm(const NuclearTerm &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + regions2d(this,other.regions2d), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + NuclearTerm(NuclearTerm &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + regions2d(this,std::move(other.regions2d)), + XYs2d(this,std::move(other.XYs2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + NuclearTerm &operator=(const NuclearTerm &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + regions2d = other.regions2d; + XYs2d = other.XYs2d; + } + return *this; + } + + // move + NuclearTerm &operator=(NuclearTerm &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + regions2d = std::move(other.regions2d); + XYs2d = std::move(other.XYs2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/NuclearTerm/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class NuclearTerm + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearTerm/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearTerm/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/NuclearTerm/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nucleus.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nucleus.hpp new file mode 100644 index 000000000..91348c819 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nucleus.hpp @@ -0,0 +1,314 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_NUCLEUS +#define GNDS_V2_0_GENERAL_NUCLEUS + +#include "GNDS/v2.0/general/Mass.hpp" +#include "GNDS/v2.0/general/Spin.hpp" +#include "GNDS/v2.0/general/Parity.hpp" +#include "GNDS/v2.0/general/Charge.hpp" +#include "GNDS/v2.0/general/Halflife.hpp" +#include "GNDS/v2.0/general/Energy.hpp" +#include "GNDS/v2.0/general/DecayData.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Nucleus +// ----------------------------------------------------------------------------- + +class Nucleus : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Nucleus"; } + static auto NODENAME() { return "nucleus"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("id") | + int{} + / Meta<>("index") | + + // children + --Child> + ("mass") | + --Child> + ("spin") | + --Child> + ("parity") | + --Child + ("charge") | + --Child> + ("halflife") | + --Child + ("energy") | + --Child> + ("decayData") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "id", + "index", + "mass", + "spin", + "parity", + "charge", + "halflife", + "energy", + "decayData" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "id", + "index", + "mass", + "spin", + "parity", + "charge", + "halflife", + "energy", + "decay_data" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + id{this}; + Field + index{this}; + + // children + Field> + mass{this}; + Field> + spin{this}; + Field> + parity{this}; + Field + charge{this}; + Field> + halflife{this}; + Field + energy{this}; + Field> + decayData{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(energy(),MadlandNix); + NJOY_GNDSTK_SHORTCUT(energy(),NBodyPhaseSpace); + NJOY_GNDSTK_SHORTCUT(energy(),XYs2d); + NJOY_GNDSTK_SHORTCUT(energy(),discreteGamma); + NJOY_GNDSTK_SHORTCUT(energy(),evaporation); + NJOY_GNDSTK_SHORTCUT(energy(),generalEvaporation); + NJOY_GNDSTK_SHORTCUT(energy(),primaryGamma); + NJOY_GNDSTK_SHORTCUT(energy(),simpleMaxwellianFission); + NJOY_GNDSTK_SHORTCUT(energy(),weightedFunctionals); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->index, \ + this->mass, \ + this->spin, \ + this->parity, \ + this->charge, \ + this->halflife, \ + this->energy, \ + this->decayData \ + ) + + // default + Nucleus() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Nucleus( + const wrapper + &id, + const wrapper + &index = {}, + const wrapper> + &mass = {}, + const wrapper> + &spin = {}, + const wrapper> + &parity = {}, + const wrapper + &charge = {}, + const wrapper> + &halflife = {}, + const wrapper + &energy = {}, + const wrapper> + &decayData = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + id(this,id), + index(this,index), + mass(this,mass), + spin(this,spin), + parity(this,parity), + charge(this,charge), + halflife(this,halflife), + energy(this,energy), + decayData(this,decayData) + { + Component::finish(); + } + + // from node + explicit Nucleus(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Nucleus(const Nucleus &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + index(this,other.index), + mass(this,other.mass), + spin(this,other.spin), + parity(this,other.parity), + charge(this,other.charge), + halflife(this,other.halflife), + energy(this,other.energy), + decayData(this,other.decayData) + { + Component::finish(other); + } + + // move + Nucleus(Nucleus &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + index(this,std::move(other.index)), + mass(this,std::move(other.mass)), + spin(this,std::move(other.spin)), + parity(this,std::move(other.parity)), + charge(this,std::move(other.charge)), + halflife(this,std::move(other.halflife)), + energy(this,std::move(other.energy)), + decayData(this,std::move(other.decayData)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Nucleus &operator=(const Nucleus &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + id = other.id; + index = other.index; + mass = other.mass; + spin = other.spin; + parity = other.parity; + charge = other.charge; + halflife = other.halflife; + energy = other.energy; + decayData = other.decayData; + } + return *this; + } + + // move + Nucleus &operator=(Nucleus &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + id = std::move(other.id); + index = std::move(other.index); + mass = std::move(other.mass); + spin = std::move(other.spin); + parity = std::move(other.parity); + charge = std::move(other.charge); + halflife = std::move(other.halflife); + energy = std::move(other.energy); + decayData = std::move(other.decayData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Nucleus/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Nucleus + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nucleus/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nucleus/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nucleus/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclide.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclide.hpp new file mode 100644 index 000000000..35c9c8c12 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclide.hpp @@ -0,0 +1,274 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_NUCLIDE +#define GNDS_V2_0_GENERAL_NUCLIDE + +#include "GNDS/v2.0/general/Mass.hpp" +#include "GNDS/v2.0/general/Charge.hpp" +#include "GNDS/v2.0/general/Nucleus.hpp" +#include "GNDS/v2.0/general/DecayData.hpp" +#include "GNDS/v2.0/top/FissionFragmentData.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Nuclide +// ----------------------------------------------------------------------------- + +class Nuclide : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Nuclide"; } + static auto NODENAME() { return "nuclide"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("id") | + + // children + --Child> + ("mass") | + --Child + ("charge") | + --Child + ("nucleus") | + --Child> + ("decayData") | + --Child> + ("fissionFragmentData") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "id", + "mass", + "charge", + "nucleus", + "decayData", + "fissionFragmentData" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "id", + "mass", + "charge", + "nucleus", + "decay_data", + "fission_fragment_data" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + id{this}; + + // children + Field> + mass{this}; + Field + charge{this}; + Field + nucleus{this}; + Field> + decayData{this}; + Field> + fissionFragmentData{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(nucleus().energy(),MadlandNix); + NJOY_GNDSTK_SHORTCUT(nucleus().energy(),NBodyPhaseSpace); + NJOY_GNDSTK_SHORTCUT(nucleus().energy(),XYs2d); + NJOY_GNDSTK_SHORTCUT(nucleus().energy(),discreteGamma); + NJOY_GNDSTK_SHORTCUT(nucleus(),energy); + NJOY_GNDSTK_SHORTCUT(nucleus().energy(),evaporation); + NJOY_GNDSTK_SHORTCUT(nucleus().energy(),generalEvaporation); + NJOY_GNDSTK_SHORTCUT(nucleus(),halflife); + NJOY_GNDSTK_SHORTCUT(nucleus(),parity); + NJOY_GNDSTK_SHORTCUT(nucleus().energy(),primaryGamma); + NJOY_GNDSTK_SHORTCUT(nucleus().energy(),simpleMaxwellianFission); + NJOY_GNDSTK_SHORTCUT(nucleus(),spin); + NJOY_GNDSTK_SHORTCUT(nucleus().energy(),weightedFunctionals); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->mass, \ + this->charge, \ + this->nucleus, \ + this->decayData, \ + this->fissionFragmentData \ + ) + + // default + Nuclide() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Nuclide( + const wrapper + &id, + const wrapper> + &mass = {}, + const wrapper + &charge = {}, + const wrapper + &nucleus = {}, + const wrapper> + &decayData = {}, + const wrapper> + &fissionFragmentData = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + id(this,id), + mass(this,mass), + charge(this,charge), + nucleus(this,nucleus), + decayData(this,decayData), + fissionFragmentData(this,fissionFragmentData) + { + Component::finish(); + } + + // from node + explicit Nuclide(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Nuclide(const Nuclide &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + mass(this,other.mass), + charge(this,other.charge), + nucleus(this,other.nucleus), + decayData(this,other.decayData), + fissionFragmentData(this,other.fissionFragmentData) + { + Component::finish(other); + } + + // move + Nuclide(Nuclide &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + mass(this,std::move(other.mass)), + charge(this,std::move(other.charge)), + nucleus(this,std::move(other.nucleus)), + decayData(this,std::move(other.decayData)), + fissionFragmentData(this,std::move(other.fissionFragmentData)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Nuclide &operator=(const Nuclide &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + id = other.id; + mass = other.mass; + charge = other.charge; + nucleus = other.nucleus; + decayData = other.decayData; + fissionFragmentData = other.fissionFragmentData; + } + return *this; + } + + // move + Nuclide &operator=(Nuclide &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + id = std::move(other.id); + mass = std::move(other.mass); + charge = std::move(other.charge); + nucleus = std::move(other.nucleus); + decayData = std::move(other.decayData); + fissionFragmentData = std::move(other.fissionFragmentData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Nuclide/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Nuclide + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclide/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclide/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclide/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclides.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclides.hpp new file mode 100644 index 000000000..7b96fbcd9 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclides.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_NUCLIDES +#define GNDS_V2_0_GENERAL_NUCLIDES + +#include "GNDS/v2.0/general/Nuclide.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Nuclides +// ----------------------------------------------------------------------------- + +class Nuclides : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Nuclides"; } + static auto NODENAME() { return "nuclides"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("nuclide") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "nuclide" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "nuclide" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + nuclide{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->nuclide \ + ) + + // default + Nuclides() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Nuclides( + const wrapper> + &nuclide + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + nuclide(this,nuclide) + { + Component::finish(); + } + + // from node + explicit Nuclides(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Nuclides(const Nuclides &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + nuclide(this,other.nuclide) + { + Component::finish(other); + } + + // move + Nuclides(Nuclides &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + nuclide(this,std::move(other.nuclide)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Nuclides &operator=(const Nuclides &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + nuclide = other.nuclide; + } + return *this; + } + + // move + Nuclides &operator=(Nuclides &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + nuclide = std::move(other.nuclide); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Nuclides/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Nuclides + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclides/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclides/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Nuclides/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProduct.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProduct.hpp new file mode 100644 index 000000000..9006bde56 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProduct.hpp @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ORPHANPRODUCT +#define GNDS_V2_0_GENERAL_ORPHANPRODUCT + +#include "GNDS/v2.0/general/CrossSection.hpp" +#include "GNDS/v2.0/general/OutputChannel.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class OrphanProduct +// ----------------------------------------------------------------------------- + +class OrphanProduct : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "OrphanProduct"; } + static auto NODENAME() { return "orphanProduct"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + int{} + / Meta<>("ENDF_MT") | + + // children + --Child + ("crossSection") | + --Child + ("outputChannel") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "ENDF_MT", + "crossSection", + "outputChannel" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "endf_mt", + "cross_section", + "output_channel" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + ENDF_MT{this}; + + // children + Field + crossSection{this}; + Field + outputChannel{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(crossSection(),CoulombPlusNuclearElastic); + NJOY_GNDSTK_SHORTCUT(outputChannel().Q(),Double); + NJOY_GNDSTK_SHORTCUT(outputChannel(),Q); + NJOY_GNDSTK_SHORTCUT(crossSection(),XYs1d); + NJOY_GNDSTK_SHORTCUT(outputChannel().Q(),constant1d); + NJOY_GNDSTK_SHORTCUT(outputChannel(),fissionFragmentData); + NJOY_GNDSTK_SHORTCUT(outputChannel(),products); + NJOY_GNDSTK_SHORTCUT(crossSection(),reference); + NJOY_GNDSTK_SHORTCUT(crossSection(),regions1d); + NJOY_GNDSTK_SHORTCUT(crossSection(),resonancesWithBackground); + NJOY_GNDSTK_SHORTCUT(crossSection(),thermalNeutronScatteringLaw1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->crossSection, \ + this->outputChannel \ + ) + + // default + OrphanProduct() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit OrphanProduct( + const wrapper + &label, + const wrapper + &ENDF_MT = {}, + const wrapper + &crossSection = {}, + const wrapper + &outputChannel = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + ENDF_MT(this,ENDF_MT), + crossSection(this,crossSection), + outputChannel(this,outputChannel) + { + Component::finish(); + } + + // from node + explicit OrphanProduct(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OrphanProduct(const OrphanProduct &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + ENDF_MT(this,other.ENDF_MT), + crossSection(this,other.crossSection), + outputChannel(this,other.outputChannel) + { + Component::finish(other); + } + + // move + OrphanProduct(OrphanProduct &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + ENDF_MT(this,std::move(other.ENDF_MT)), + crossSection(this,std::move(other.crossSection)), + outputChannel(this,std::move(other.outputChannel)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + OrphanProduct &operator=(const OrphanProduct &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + ENDF_MT = other.ENDF_MT; + crossSection = other.crossSection; + outputChannel = other.outputChannel; + } + return *this; + } + + // move + OrphanProduct &operator=(OrphanProduct &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + ENDF_MT = std::move(other.ENDF_MT); + crossSection = std::move(other.crossSection); + outputChannel = std::move(other.outputChannel); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/OrphanProduct/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class OrphanProduct + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProduct/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProduct/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProduct/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProducts.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProducts.hpp new file mode 100644 index 000000000..fc89be3d4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProducts.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ORPHANPRODUCTS +#define GNDS_V2_0_GENERAL_ORPHANPRODUCTS + +#include "GNDS/v2.0/general/OrphanProduct.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class OrphanProducts +// ----------------------------------------------------------------------------- + +class OrphanProducts : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "OrphanProducts"; } + static auto NODENAME() { return "orphanProducts"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("orphanProduct") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "orphanProduct" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "orphan_product" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + orphanProduct{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->orphanProduct \ + ) + + // default + OrphanProducts() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit OrphanProducts( + const wrapper> + &orphanProduct + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + orphanProduct(this,orphanProduct) + { + Component::finish(); + } + + // from node + explicit OrphanProducts(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OrphanProducts(const OrphanProducts &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + orphanProduct(this,other.orphanProduct) + { + Component::finish(other); + } + + // move + OrphanProducts(OrphanProducts &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + orphanProduct(this,std::move(other.orphanProduct)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + OrphanProducts &operator=(const OrphanProducts &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + orphanProduct = other.orphanProduct; + } + return *this; + } + + // move + OrphanProducts &operator=(OrphanProducts &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + orphanProduct = std::move(other.orphanProduct); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/OrphanProducts/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class OrphanProducts + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProducts/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProducts/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OrphanProducts/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OutputChannel.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OutputChannel.hpp new file mode 100644 index 000000000..e5c9940f3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OutputChannel.hpp @@ -0,0 +1,247 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_OUTPUTCHANNEL +#define GNDS_V2_0_GENERAL_OUTPUTCHANNEL + +#include "GNDS/v2.0/general/Q.hpp" +#include "GNDS/v2.0/general/Products.hpp" +#include "GNDS/v2.0/top/FissionFragmentData.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class OutputChannel +// ----------------------------------------------------------------------------- + +class OutputChannel : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "OutputChannel"; } + static auto NODENAME() { return "outputChannel"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("genre") | + std::optional{} + / Meta<>("process") | + + // children + --Child + ("Q") | + --Child> + ("products") | + --Child> + ("fissionFragmentData") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "genre", + "process", + "Q", + "products", + "fissionFragmentData" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "genre", + "process", + "q", + "products", + "fission_fragment_data" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + genre{this}; + Field> + process{this}; + + // children + Field + Q{this}; + Field> + products{this}; + Field> + fissionFragmentData{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(Q(),Double); + NJOY_GNDSTK_SHORTCUT(Q(),constant1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->genre, \ + this->process, \ + this->Q, \ + this->products, \ + this->fissionFragmentData \ + ) + + // default + OutputChannel() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit OutputChannel( + const wrapper + &genre, + const wrapper> + &process = {}, + const wrapper + &Q = {}, + const wrapper> + &products = {}, + const wrapper> + &fissionFragmentData = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + genre(this,genre), + process(this,process), + Q(this,Q), + products(this,products), + fissionFragmentData(this,fissionFragmentData) + { + Component::finish(); + } + + // from node + explicit OutputChannel(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OutputChannel(const OutputChannel &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + genre(this,other.genre), + process(this,other.process), + Q(this,other.Q), + products(this,other.products), + fissionFragmentData(this,other.fissionFragmentData) + { + Component::finish(other); + } + + // move + OutputChannel(OutputChannel &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + genre(this,std::move(other.genre)), + process(this,std::move(other.process)), + Q(this,std::move(other.Q)), + products(this,std::move(other.products)), + fissionFragmentData(this,std::move(other.fissionFragmentData)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + OutputChannel &operator=(const OutputChannel &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + genre = other.genre; + process = other.process; + Q = other.Q; + products = other.products; + fissionFragmentData = other.fissionFragmentData; + } + return *this; + } + + // move + OutputChannel &operator=(OutputChannel &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + genre = std::move(other.genre); + process = std::move(other.process); + Q = std::move(other.Q); + products = std::move(other.products); + fissionFragmentData = std::move(other.fissionFragmentData); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/OutputChannel/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class OutputChannel + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OutputChannel/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OutputChannel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/OutputChannel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariance.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariance.hpp new file mode 100644 index 000000000..f4166f090 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariance.hpp @@ -0,0 +1,223 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PARAMETERCOVARIANCE +#define GNDS_V2_0_GENERAL_PARAMETERCOVARIANCE + +#include "GNDS/v2.0/general/RowData.hpp" +#include "GNDS/v2.0/general/ParameterCovarianceMatrix.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ParameterCovariance +// ----------------------------------------------------------------------------- + +class ParameterCovariance : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ParameterCovariance"; } + static auto NODENAME() { return "parameterCovariance"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + + // children + --Child + ("rowData") | + --Child + ("parameterCovarianceMatrix") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "rowData", + "parameterCovarianceMatrix" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "row_data", + "parameter_covariance_matrix" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children + Field + rowData{this}; + Field + parameterCovarianceMatrix{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(parameterCovarianceMatrix(),array); + NJOY_GNDSTK_SHORTCUT(parameterCovarianceMatrix().array(),lengths); + NJOY_GNDSTK_SHORTCUT(parameterCovarianceMatrix().parameters(),parameterLink); + NJOY_GNDSTK_SHORTCUT(parameterCovarianceMatrix(),parameters); + NJOY_GNDSTK_SHORTCUT(rowData(),slices); + NJOY_GNDSTK_SHORTCUT(parameterCovarianceMatrix().array(),starts); + NJOY_GNDSTK_SHORTCUT(parameterCovarianceMatrix().array(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->rowData, \ + this->parameterCovarianceMatrix \ + ) + + // default + ParameterCovariance() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ParameterCovariance( + const wrapper + &label, + const wrapper + &rowData = {}, + const wrapper + ¶meterCovarianceMatrix = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + rowData(this,rowData), + parameterCovarianceMatrix(this,parameterCovarianceMatrix) + { + Component::finish(); + } + + // from node + explicit ParameterCovariance(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterCovariance(const ParameterCovariance &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + rowData(this,other.rowData), + parameterCovarianceMatrix(this,other.parameterCovarianceMatrix) + { + Component::finish(other); + } + + // move + ParameterCovariance(ParameterCovariance &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + rowData(this,std::move(other.rowData)), + parameterCovarianceMatrix(this,std::move(other.parameterCovarianceMatrix)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ParameterCovariance &operator=(const ParameterCovariance &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + rowData = other.rowData; + parameterCovarianceMatrix = other.parameterCovarianceMatrix; + } + return *this; + } + + // move + ParameterCovariance &operator=(ParameterCovariance &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + rowData = std::move(other.rowData); + parameterCovarianceMatrix = std::move(other.parameterCovarianceMatrix); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ParameterCovariance/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ParameterCovariance + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariance/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovarianceMatrix.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovarianceMatrix.hpp new file mode 100644 index 000000000..a88f20e8b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovarianceMatrix.hpp @@ -0,0 +1,234 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PARAMETERCOVARIANCEMATRIX +#define GNDS_V2_0_GENERAL_PARAMETERCOVARIANCEMATRIX + +#include "GNDS/v2.0/g3d/Array.hpp" +#include "GNDS/v2.0/general/Parameters.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ParameterCovarianceMatrix +// ----------------------------------------------------------------------------- + +class ParameterCovarianceMatrix : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ParameterCovarianceMatrix"; } + static auto NODENAME() { return "parameterCovarianceMatrix"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("type") | + + // children + --Child + ("array") | + --Child + ("parameters") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "type", + "array", + "parameters" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "type", + "array", + "parameters" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + type{this}; + + // children + Field + array{this}; + Field + parameters{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(array(),lengths); + NJOY_GNDSTK_SHORTCUT(parameters(),parameterLink); + NJOY_GNDSTK_SHORTCUT(array(),starts); + NJOY_GNDSTK_SHORTCUT(array(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->type, \ + this->array, \ + this->parameters \ + ) + + // default + ParameterCovarianceMatrix() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ParameterCovarianceMatrix( + const wrapper + &label, + const wrapper + &type = {}, + const wrapper + &array = {}, + const wrapper + ¶meters = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + type(this,type), + array(this,array), + parameters(this,parameters) + { + Component::finish(); + } + + // from node + explicit ParameterCovarianceMatrix(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterCovarianceMatrix(const ParameterCovarianceMatrix &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + type(this,other.type), + array(this,other.array), + parameters(this,other.parameters) + { + Component::finish(other); + } + + // move + ParameterCovarianceMatrix(ParameterCovarianceMatrix &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + type(this,std::move(other.type)), + array(this,std::move(other.array)), + parameters(this,std::move(other.parameters)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ParameterCovarianceMatrix &operator=(const ParameterCovarianceMatrix &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + type = other.type; + array = other.array; + parameters = other.parameters; + } + return *this; + } + + // move + ParameterCovarianceMatrix &operator=(ParameterCovarianceMatrix &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + type = std::move(other.type); + array = std::move(other.array); + parameters = std::move(other.parameters); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ParameterCovarianceMatrix/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ParameterCovarianceMatrix + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovarianceMatrix/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovarianceMatrix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovarianceMatrix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariances.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariances.hpp new file mode 100644 index 000000000..856c54ef6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariances.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PARAMETERCOVARIANCES +#define GNDS_V2_0_GENERAL_PARAMETERCOVARIANCES + +#include "GNDS/v2.0/general/ParameterCovariance.hpp" +#include "GNDS/v2.0/general/AverageParameterCovariance.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ParameterCovariances +// ----------------------------------------------------------------------------- + +class ParameterCovariances : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ParameterCovariances"; } + static auto NODENAME() { return "parameterCovariances"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("parameterCovariance") | + ++Child> + ("averageParameterCovariance") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "parameterCovariance", + "averageParameterCovariance" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "parameter_covariance", + "average_parameter_covariance" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + parameterCovariance{this}; + Field>> + averageParameterCovariance{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->parameterCovariance, \ + this->averageParameterCovariance \ + ) + + // default + ParameterCovariances() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ParameterCovariances( + const wrapper> + ¶meterCovariance, + const wrapper>> + &averageParameterCovariance = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + parameterCovariance(this,parameterCovariance), + averageParameterCovariance(this,averageParameterCovariance) + { + Component::finish(); + } + + // from node + explicit ParameterCovariances(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterCovariances(const ParameterCovariances &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + parameterCovariance(this,other.parameterCovariance), + averageParameterCovariance(this,other.averageParameterCovariance) + { + Component::finish(other); + } + + // move + ParameterCovariances(ParameterCovariances &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + parameterCovariance(this,std::move(other.parameterCovariance)), + averageParameterCovariance(this,std::move(other.averageParameterCovariance)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ParameterCovariances &operator=(const ParameterCovariances &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + parameterCovariance = other.parameterCovariance; + averageParameterCovariance = other.averageParameterCovariance; + } + return *this; + } + + // move + ParameterCovariances &operator=(ParameterCovariances &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + parameterCovariance = std::move(other.parameterCovariance); + averageParameterCovariance = std::move(other.averageParameterCovariance); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ParameterCovariances/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ParameterCovariances + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariances/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariances/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterCovariances/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterLink.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterLink.hpp new file mode 100644 index 000000000..42114defc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterLink.hpp @@ -0,0 +1,221 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PARAMETERLINK +#define GNDS_V2_0_GENERAL_PARAMETERLINK + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ParameterLink +// ----------------------------------------------------------------------------- + +class ParameterLink : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ParameterLink"; } + static auto NODENAME() { return "parameterLink"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("href") | + std::optional{} + / Meta<>("nParameters") | + std::optional{} + / Meta<>("matrixStartIndex") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "href", + "nParameters", + "matrixStartIndex" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "href", + "n_parameters", + "matrix_start_index" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + href{this}; + Field> + nParameters{this}; + Field> + matrixStartIndex{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href, \ + this->nParameters, \ + this->matrixStartIndex \ + ) + + // default + ParameterLink() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ParameterLink( + const wrapper + &label, + const wrapper + &href = {}, + const wrapper> + &nParameters = {}, + const wrapper> + &matrixStartIndex = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href), + nParameters(this,nParameters), + matrixStartIndex(this,matrixStartIndex) + { + Component::finish(); + } + + // from node + explicit ParameterLink(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ParameterLink(const ParameterLink &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href), + nParameters(this,other.nParameters), + matrixStartIndex(this,other.matrixStartIndex) + { + Component::finish(other); + } + + // move + ParameterLink(ParameterLink &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + href(this,std::move(other.href)), + nParameters(this,std::move(other.nParameters)), + matrixStartIndex(this,std::move(other.matrixStartIndex)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ParameterLink &operator=(const ParameterLink &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + href = other.href; + nParameters = other.nParameters; + matrixStartIndex = other.matrixStartIndex; + } + return *this; + } + + // move + ParameterLink &operator=(ParameterLink &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + href = std::move(other.href); + nParameters = std::move(other.nParameters); + matrixStartIndex = std::move(other.matrixStartIndex); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ParameterLink/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ParameterLink + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterLink/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterLink/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ParameterLink/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parameters.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parameters.hpp new file mode 100644 index 000000000..30c9a9672 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parameters.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PARAMETERS +#define GNDS_V2_0_GENERAL_PARAMETERS + +#include "GNDS/v2.0/general/ParameterLink.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Parameters +// ----------------------------------------------------------------------------- + +class Parameters : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Parameters"; } + static auto NODENAME() { return "parameters"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("parameterLink") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "parameterLink" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "parameter_link" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + parameterLink{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->parameterLink \ + ) + + // default + Parameters() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Parameters( + const wrapper> + ¶meterLink + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + parameterLink(this,parameterLink) + { + Component::finish(); + } + + // from node + explicit Parameters(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Parameters(const Parameters &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + parameterLink(this,other.parameterLink) + { + Component::finish(other); + } + + // move + Parameters(Parameters &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + parameterLink(this,std::move(other.parameterLink)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Parameters &operator=(const Parameters &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + parameterLink = other.parameterLink; + } + return *this; + } + + // move + Parameters &operator=(Parameters &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + parameterLink = std::move(other.parameterLink); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Parameters/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Parameters + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parameters/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parameters/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parameters/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parity.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parity.hpp new file mode 100644 index 000000000..da06bc0ed --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parity.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PARITY +#define GNDS_V2_0_GENERAL_PARITY + +#include "GNDS/v2.0/general/Integer.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Parity +// ----------------------------------------------------------------------------- + +class Parity : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Parity"; } + static auto NODENAME() { return "parity"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("integer") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "integer" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "integer" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + integer{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->integer \ + ) + + // default + Parity() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Parity( + const wrapper + &integer + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + integer(this,integer) + { + Component::finish(); + } + + // from node + explicit Parity(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Parity(const Parity &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + integer(this,other.integer) + { + Component::finish(other); + } + + // move + Parity(Parity &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + integer(this,std::move(other.integer)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Parity &operator=(const Parity &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + integer = other.integer; + } + return *this; + } + + // move + Parity &operator=(Parity &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + integer = std::move(other.integer); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Parity/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Parity + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parity/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Parity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PhotonEmissionProbabilities.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PhotonEmissionProbabilities.hpp new file mode 100644 index 000000000..22537f4cc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PhotonEmissionProbabilities.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PHOTONEMISSIONPROBABILITIES +#define GNDS_V2_0_GENERAL_PHOTONEMISSIONPROBABILITIES + +#include "GNDS/v2.0/general/Shell.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class PhotonEmissionProbabilities +// ----------------------------------------------------------------------------- + +class PhotonEmissionProbabilities : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "PhotonEmissionProbabilities"; } + static auto NODENAME() { return "photonEmissionProbabilities"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("shell") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "shell" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "shell" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + shell{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(shell(),uncertainty); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->shell \ + ) + + // default + PhotonEmissionProbabilities() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PhotonEmissionProbabilities( + const wrapper + &shell + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + shell(this,shell) + { + Component::finish(); + } + + // from node + explicit PhotonEmissionProbabilities(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PhotonEmissionProbabilities(const PhotonEmissionProbabilities &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + shell(this,other.shell) + { + Component::finish(other); + } + + // move + PhotonEmissionProbabilities(PhotonEmissionProbabilities &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + shell(this,std::move(other.shell)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PhotonEmissionProbabilities &operator=(const PhotonEmissionProbabilities &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + shell = other.shell; + } + return *this; + } + + // move + PhotonEmissionProbabilities &operator=(PhotonEmissionProbabilities &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + shell = std::move(other.shell); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/PhotonEmissionProbabilities/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class PhotonEmissionProbabilities + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PhotonEmissionProbabilities/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PhotonEmissionProbabilities/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PhotonEmissionProbabilities/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Polynomial1d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Polynomial1d.hpp new file mode 100644 index 000000000..0c6043fab --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Polynomial1d.hpp @@ -0,0 +1,261 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_POLYNOMIAL1D +#define GNDS_V2_0_GENERAL_POLYNOMIAL1D + +#include "GNDS/v2.0/general/Axes.hpp" +#include "GNDS/v2.0/general/Values.hpp" +#include "GNDS/v2.0/general/Uncertainty.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Polynomial1d +// ----------------------------------------------------------------------------- + +class Polynomial1d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Polynomial1d"; } + static auto NODENAME() { return "polynomial1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("label") | + double{} + / Meta<>("domainMin") | + double{} + / Meta<>("domainMax") | + + // children + --Child + ("axes") | + --Child + ("values") | + --Child> + ("uncertainty") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "domainMin", + "domainMax", + "axes", + "values", + "uncertainty" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "domain_min", + "domain_max", + "axes", + "values", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field + domainMin{this}; + Field + domainMax{this}; + + // children + Field + axes{this}; + Field + values{this}; + Field> + uncertainty{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(axes(),axis); + NJOY_GNDSTK_SHORTCUT(axes(),grid); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->domainMin, \ + this->domainMax, \ + this->axes, \ + this->values, \ + this->uncertainty \ + ) + + // default + Polynomial1d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Polynomial1d( + const wrapper> + &label, + const wrapper + &domainMin = {}, + const wrapper + &domainMax = {}, + const wrapper + &axes = {}, + const wrapper + &values = {}, + const wrapper> + &uncertainty = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + domainMin(this,domainMin), + domainMax(this,domainMax), + axes(this,axes), + values(this,values), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Polynomial1d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Polynomial1d(const Polynomial1d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + axes(this,other.axes), + values(this,other.values), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Polynomial1d(Polynomial1d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + axes(this,std::move(other.axes)), + values(this,std::move(other.values)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Polynomial1d &operator=(const Polynomial1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + domainMin = other.domainMin; + domainMax = other.domainMax; + axes = other.axes; + values = other.values; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + Polynomial1d &operator=(Polynomial1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + axes = std::move(other.axes); + values = std::move(other.values); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Polynomial1d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Polynomial1d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Polynomial1d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Polynomial1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Polynomial1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PositronEmissionIntensity.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PositronEmissionIntensity.hpp new file mode 100644 index 000000000..fb7450869 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PositronEmissionIntensity.hpp @@ -0,0 +1,197 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_POSITRONEMISSIONINTENSITY +#define GNDS_V2_0_GENERAL_POSITRONEMISSIONINTENSITY + +#include "GNDS/v2.0/general/Uncertainty.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class PositronEmissionIntensity +// ----------------------------------------------------------------------------- + +class PositronEmissionIntensity : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "PositronEmissionIntensity"; } + static auto NODENAME() { return "positronEmissionIntensity"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") | + + // children + --Child> + ("uncertainty") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "uncertainty" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + + // children + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->uncertainty \ + ) + + // default + PositronEmissionIntensity() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PositronEmissionIntensity( + const wrapper + &value, + const wrapper> + &uncertainty = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit PositronEmissionIntensity(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PositronEmissionIntensity(const PositronEmissionIntensity &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + PositronEmissionIntensity(PositronEmissionIntensity &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PositronEmissionIntensity &operator=(const PositronEmissionIntensity &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + PositronEmissionIntensity &operator=(PositronEmissionIntensity &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/PositronEmissionIntensity/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class PositronEmissionIntensity + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PositronEmissionIntensity/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PositronEmissionIntensity/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PositronEmissionIntensity/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PrimaryGamma.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PrimaryGamma.hpp new file mode 100644 index 000000000..49e546972 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PrimaryGamma.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PRIMARYGAMMA +#define GNDS_V2_0_GENERAL_PRIMARYGAMMA + +#include "GNDS/v2.0/general/Axes.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class PrimaryGamma +// ----------------------------------------------------------------------------- + +class PrimaryGamma : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "PrimaryGamma"; } + static auto NODENAME() { return "primaryGamma"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") | + double{} + / Meta<>("domainMin") | + double{} + / Meta<>("domainMax") | + + // children + --Child + ("axes") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "domainMin", + "domainMax", + "axes" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "domain_min", + "domain_max", + "axes" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + Field + domainMin{this}; + Field + domainMax{this}; + + // children + Field + axes{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(axes(),axis); + NJOY_GNDSTK_SHORTCUT(axes(),grid); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->domainMin, \ + this->domainMax, \ + this->axes \ + ) + + // default + PrimaryGamma() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PrimaryGamma( + const wrapper + &value, + const wrapper + &domainMin = {}, + const wrapper + &domainMax = {}, + const wrapper + &axes = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + domainMin(this,domainMin), + domainMax(this,domainMax), + axes(this,axes) + { + Component::finish(); + } + + // from node + explicit PrimaryGamma(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PrimaryGamma(const PrimaryGamma &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + axes(this,other.axes) + { + Component::finish(other); + } + + // move + PrimaryGamma(PrimaryGamma &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + axes(this,std::move(other.axes)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PrimaryGamma &operator=(const PrimaryGamma &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + domainMin = other.domainMin; + domainMax = other.domainMax; + axes = other.axes; + } + return *this; + } + + // move + PrimaryGamma &operator=(PrimaryGamma &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + axes = std::move(other.axes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/PrimaryGamma/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class PrimaryGamma + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PrimaryGamma/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PrimaryGamma/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PrimaryGamma/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Probability.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Probability.hpp new file mode 100644 index 000000000..da7751f06 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Probability.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PROBABILITY +#define GNDS_V2_0_GENERAL_PROBABILITY + +#include "GNDS/v2.0/general/Double.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Probability +// ----------------------------------------------------------------------------- + +class Probability : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Probability"; } + static auto NODENAME() { return "probability"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("double") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "Double" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + Double{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(Double(),uncertainty); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Probability() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Probability( + const wrapper + &Double + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Probability(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Probability(const Probability &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Probability(Probability &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Probability &operator=(const Probability &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + Double = other.Double; + } + return *this; + } + + // move + Probability &operator=(Probability &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Probability/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Probability + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Probability/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Probability/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Probability/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Product.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Product.hpp new file mode 100644 index 000000000..00b535662 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Product.hpp @@ -0,0 +1,256 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PRODUCT +#define GNDS_V2_0_GENERAL_PRODUCT + +#include "GNDS/v2.0/general/Multiplicity.hpp" +#include "GNDS/v2.0/general/Distribution.hpp" +#include "GNDS/v2.0/reduced/OutputChannel.hpp" +#include "GNDS/v2.0/general/AverageProductEnergy.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Product +// ----------------------------------------------------------------------------- + +class Product : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Product"; } + static auto NODENAME() { return "product"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("pid") | + + // children + --Child> + ("multiplicity") | + --Child> + ("distribution") | + --Child> + ("outputChannel") | + --Child> + ("averageProductEnergy") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "multiplicity", + "distribution", + "outputChannel", + "averageProductEnergy" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "multiplicity", + "distribution", + "output_channel", + "average_product_energy" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + pid{this}; + + // children + Field> + multiplicity{this}; + Field> + distribution{this}; + Field> + outputChannel{this}; + Field> + averageProductEnergy{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->multiplicity, \ + this->distribution, \ + this->outputChannel, \ + this->averageProductEnergy \ + ) + + // default + Product() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Product( + const wrapper + &label, + const wrapper + &pid = {}, + const wrapper> + &multiplicity = {}, + const wrapper> + &distribution = {}, + const wrapper> + &outputChannel = {}, + const wrapper> + &averageProductEnergy = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,pid), + multiplicity(this,multiplicity), + distribution(this,distribution), + outputChannel(this,outputChannel), + averageProductEnergy(this,averageProductEnergy) + { + Component::finish(); + } + + // from node + explicit Product(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Product(const Product &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + pid(this,other.pid), + multiplicity(this,other.multiplicity), + distribution(this,other.distribution), + outputChannel(this,other.outputChannel), + averageProductEnergy(this,other.averageProductEnergy) + { + Component::finish(other); + } + + // move + Product(Product &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + pid(this,std::move(other.pid)), + multiplicity(this,std::move(other.multiplicity)), + distribution(this,std::move(other.distribution)), + outputChannel(this,std::move(other.outputChannel)), + averageProductEnergy(this,std::move(other.averageProductEnergy)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Product &operator=(const Product &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + pid = other.pid; + multiplicity = other.multiplicity; + distribution = other.distribution; + outputChannel = other.outputChannel; + averageProductEnergy = other.averageProductEnergy; + } + return *this; + } + + // move + Product &operator=(Product &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + pid = std::move(other.pid); + multiplicity = std::move(other.multiplicity); + distribution = std::move(other.distribution); + outputChannel = std::move(other.outputChannel); + averageProductEnergy = std::move(other.averageProductEnergy); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Product/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Product + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Product/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Product/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Product/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYield.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYield.hpp new file mode 100644 index 000000000..3c7ce4fd0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYield.hpp @@ -0,0 +1,217 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PRODUCTYIELD +#define GNDS_V2_0_GENERAL_PRODUCTYIELD + +#include "GNDS/v2.0/reduced/Nuclides.hpp" +#include "GNDS/v2.0/general/ElapsedTimes.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ProductYield +// ----------------------------------------------------------------------------- + +class ProductYield : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ProductYield"; } + static auto NODENAME() { return "productYield"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("label") | + + // children + --Child> + ("nuclides") | + --Child + ("elapsedTimes") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "nuclides", + "elapsedTimes" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "nuclides", + "elapsed_times" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + + // children + Field> + nuclides{this}; + Field + elapsedTimes{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(elapsedTimes(),elapsedTime); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->nuclides, \ + this->elapsedTimes \ + ) + + // default + ProductYield() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ProductYield( + const wrapper> + &label, + const wrapper> + &nuclides = {}, + const wrapper + &elapsedTimes = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + nuclides(this,nuclides), + elapsedTimes(this,elapsedTimes) + { + Component::finish(); + } + + // from node + explicit ProductYield(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ProductYield(const ProductYield &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + nuclides(this,other.nuclides), + elapsedTimes(this,other.elapsedTimes) + { + Component::finish(other); + } + + // move + ProductYield(ProductYield &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + nuclides(this,std::move(other.nuclides)), + elapsedTimes(this,std::move(other.elapsedTimes)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ProductYield &operator=(const ProductYield &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + nuclides = other.nuclides; + elapsedTimes = other.elapsedTimes; + } + return *this; + } + + // move + ProductYield &operator=(ProductYield &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + nuclides = std::move(other.nuclides); + elapsedTimes = std::move(other.elapsedTimes); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ProductYield/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ProductYield + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYield/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYield/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYield/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYields.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYields.hpp new file mode 100644 index 000000000..8684e2689 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYields.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PRODUCTYIELDS +#define GNDS_V2_0_GENERAL_PRODUCTYIELDS + +#include "GNDS/v2.0/general/ProductYield.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ProductYields +// ----------------------------------------------------------------------------- + +class ProductYields : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ProductYields"; } + static auto NODENAME() { return "productYields"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("productYield") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "productYield" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "product_yield" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + productYield{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->productYield \ + ) + + // default + ProductYields() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ProductYields( + const wrapper> + &productYield + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + productYield(this,productYield) + { + Component::finish(); + } + + // from node + explicit ProductYields(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ProductYields(const ProductYields &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + productYield(this,other.productYield) + { + Component::finish(other); + } + + // move + ProductYields(ProductYields &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + productYield(this,std::move(other.productYield)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ProductYields &operator=(const ProductYields &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + productYield = other.productYield; + } + return *this; + } + + // move + ProductYields &operator=(ProductYields &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + productYield = std::move(other.productYield); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ProductYields/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ProductYields + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYields/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYields/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProductYields/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Production.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Production.hpp new file mode 100644 index 000000000..9e157ddad --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Production.hpp @@ -0,0 +1,241 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PRODUCTION +#define GNDS_V2_0_GENERAL_PRODUCTION + +#include "GNDS/v2.0/general/CrossSection.hpp" +#include "GNDS/v2.0/general/OutputChannel.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Production +// ----------------------------------------------------------------------------- + +class Production : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Production"; } + static auto NODENAME() { return "production"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + int{} + / Meta<>("ENDF_MT") | + + // children + --Child + ("crossSection") | + --Child + ("outputChannel") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "ENDF_MT", + "crossSection", + "outputChannel" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "endf_mt", + "cross_section", + "output_channel" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + ENDF_MT{this}; + + // children + Field + crossSection{this}; + Field + outputChannel{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(crossSection(),CoulombPlusNuclearElastic); + NJOY_GNDSTK_SHORTCUT(outputChannel().Q(),Double); + NJOY_GNDSTK_SHORTCUT(outputChannel(),Q); + NJOY_GNDSTK_SHORTCUT(crossSection(),XYs1d); + NJOY_GNDSTK_SHORTCUT(outputChannel().Q(),constant1d); + NJOY_GNDSTK_SHORTCUT(outputChannel(),fissionFragmentData); + NJOY_GNDSTK_SHORTCUT(outputChannel(),products); + NJOY_GNDSTK_SHORTCUT(crossSection(),reference); + NJOY_GNDSTK_SHORTCUT(crossSection(),regions1d); + NJOY_GNDSTK_SHORTCUT(crossSection(),resonancesWithBackground); + NJOY_GNDSTK_SHORTCUT(crossSection(),thermalNeutronScatteringLaw1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->crossSection, \ + this->outputChannel \ + ) + + // default + Production() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Production( + const wrapper + &label, + const wrapper + &ENDF_MT = {}, + const wrapper + &crossSection = {}, + const wrapper + &outputChannel = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + ENDF_MT(this,ENDF_MT), + crossSection(this,crossSection), + outputChannel(this,outputChannel) + { + Component::finish(); + } + + // from node + explicit Production(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Production(const Production &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + ENDF_MT(this,other.ENDF_MT), + crossSection(this,other.crossSection), + outputChannel(this,other.outputChannel) + { + Component::finish(other); + } + + // move + Production(Production &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + ENDF_MT(this,std::move(other.ENDF_MT)), + crossSection(this,std::move(other.crossSection)), + outputChannel(this,std::move(other.outputChannel)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Production &operator=(const Production &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + ENDF_MT = other.ENDF_MT; + crossSection = other.crossSection; + outputChannel = other.outputChannel; + } + return *this; + } + + // move + Production &operator=(Production &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + ENDF_MT = std::move(other.ENDF_MT); + crossSection = std::move(other.crossSection); + outputChannel = std::move(other.outputChannel); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Production/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Production + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Production/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Production/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Production/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Productions.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Productions.hpp new file mode 100644 index 000000000..fe99b571f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Productions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PRODUCTIONS +#define GNDS_V2_0_GENERAL_PRODUCTIONS + +#include "GNDS/v2.0/general/Production.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Productions +// ----------------------------------------------------------------------------- + +class Productions : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Productions"; } + static auto NODENAME() { return "productions"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("production") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "production" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "production" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + production{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->production \ + ) + + // default + Productions() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Productions( + const wrapper> + &production + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + production(this,production) + { + Component::finish(); + } + + // from node + explicit Productions(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Productions(const Productions &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + production(this,other.production) + { + Component::finish(other); + } + + // move + Productions(Productions &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + production(this,std::move(other.production)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Productions &operator=(const Productions &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + production = other.production; + } + return *this; + } + + // move + Productions &operator=(Productions &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + production = std::move(other.production); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Productions/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Productions + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Productions/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Productions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Productions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Products.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Products.hpp new file mode 100644 index 000000000..17a72aefe --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Products.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PRODUCTS +#define GNDS_V2_0_GENERAL_PRODUCTS + +#include "GNDS/v2.0/general/Product.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Products +// ----------------------------------------------------------------------------- + +class Products : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Products"; } + static auto NODENAME() { return "products"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child> + ("product") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "product" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "product" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field>> + product{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->product \ + ) + + // default + Products() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Products( + const wrapper>> + &product + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + product(this,product) + { + Component::finish(); + } + + // from node + explicit Products(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Products(const Products &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + product(this,other.product) + { + Component::finish(other); + } + + // move + Products(Products &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + product(this,std::move(other.product)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Products &operator=(const Products &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + product = other.product; + } + return *this; + } + + // move + Products &operator=(Products &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + product = std::move(other.product); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Products/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Products + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Products/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Products/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Products/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProjectileEnergyDomain.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProjectileEnergyDomain.hpp new file mode 100644 index 000000000..b7e222d79 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProjectileEnergyDomain.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PROJECTILEENERGYDOMAIN +#define GNDS_V2_0_GENERAL_PROJECTILEENERGYDOMAIN + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ProjectileEnergyDomain +// ----------------------------------------------------------------------------- + +class ProjectileEnergyDomain : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ProjectileEnergyDomain"; } + static auto NODENAME() { return "projectileEnergyDomain"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("min") | + double{} + / Meta<>("max") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "min", + "max", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "min", + "max", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + min{this}; + Field + max{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->min, \ + this->max, \ + this->unit \ + ) + + // default + ProjectileEnergyDomain() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ProjectileEnergyDomain( + const wrapper + &min, + const wrapper + &max = {}, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + min(this,min), + max(this,max), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit ProjectileEnergyDomain(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ProjectileEnergyDomain(const ProjectileEnergyDomain &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + min(this,other.min), + max(this,other.max), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + ProjectileEnergyDomain(ProjectileEnergyDomain &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + min(this,std::move(other.min)), + max(this,std::move(other.max)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ProjectileEnergyDomain &operator=(const ProjectileEnergyDomain &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + min = other.min; + max = other.max; + unit = other.unit; + } + return *this; + } + + // move + ProjectileEnergyDomain &operator=(ProjectileEnergyDomain &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + min = std::move(other.min); + max = std::move(other.max); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ProjectileEnergyDomain/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ProjectileEnergyDomain + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProjectileEnergyDomain/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProjectileEnergyDomain/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ProjectileEnergyDomain/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptGammaEnergy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptGammaEnergy.hpp new file mode 100644 index 000000000..5e71c820c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptGammaEnergy.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PROMPTGAMMAENERGY +#define GNDS_V2_0_GENERAL_PROMPTGAMMAENERGY + +#include "GNDS/v2.0/general/Polynomial1d.hpp" +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class PromptGammaEnergy +// ----------------------------------------------------------------------------- + +class PromptGammaEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "PromptGammaEnergy"; } + static auto NODENAME() { return "promptGammaEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("polynomial1d") | + --Child> + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + polynomial1d{this}; + Field> + XYs1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d, \ + this->XYs1d \ + ) + + // default + PromptGammaEnergy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PromptGammaEnergy( + const wrapper> + &polynomial1d, + const wrapper> + &XYs1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit PromptGammaEnergy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PromptGammaEnergy(const PromptGammaEnergy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + PromptGammaEnergy(PromptGammaEnergy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + polynomial1d(this,std::move(other.polynomial1d)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PromptGammaEnergy &operator=(const PromptGammaEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + polynomial1d = other.polynomial1d; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + PromptGammaEnergy &operator=(PromptGammaEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + polynomial1d = std::move(other.polynomial1d); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/PromptGammaEnergy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class PromptGammaEnergy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptGammaEnergy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptGammaEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptGammaEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptNeutronKE.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptNeutronKE.hpp new file mode 100644 index 000000000..0e358cca0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptNeutronKE.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PROMPTNEUTRONKE +#define GNDS_V2_0_GENERAL_PROMPTNEUTRONKE + +#include "GNDS/v2.0/general/Polynomial1d.hpp" +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class PromptNeutronKE +// ----------------------------------------------------------------------------- + +class PromptNeutronKE : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "PromptNeutronKE"; } + static auto NODENAME() { return "promptNeutronKE"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("polynomial1d") | + --Child> + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + polynomial1d{this}; + Field> + XYs1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d, \ + this->XYs1d \ + ) + + // default + PromptNeutronKE() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PromptNeutronKE( + const wrapper> + &polynomial1d, + const wrapper> + &XYs1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit PromptNeutronKE(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PromptNeutronKE(const PromptNeutronKE &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + PromptNeutronKE(PromptNeutronKE &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + polynomial1d(this,std::move(other.polynomial1d)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PromptNeutronKE &operator=(const PromptNeutronKE &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + polynomial1d = other.polynomial1d; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + PromptNeutronKE &operator=(PromptNeutronKE &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + polynomial1d = std::move(other.polynomial1d); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/PromptNeutronKE/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class PromptNeutronKE + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptNeutronKE/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptNeutronKE/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptNeutronKE/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptProductKE.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptProductKE.hpp new file mode 100644 index 000000000..111ad7f53 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptProductKE.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_PROMPTPRODUCTKE +#define GNDS_V2_0_GENERAL_PROMPTPRODUCTKE + +#include "GNDS/v2.0/general/Polynomial1d.hpp" +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class PromptProductKE +// ----------------------------------------------------------------------------- + +class PromptProductKE : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "PromptProductKE"; } + static auto NODENAME() { return "promptProductKE"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("polynomial1d") | + --Child> + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + polynomial1d{this}; + Field> + XYs1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d, \ + this->XYs1d \ + ) + + // default + PromptProductKE() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PromptProductKE( + const wrapper> + &polynomial1d, + const wrapper> + &XYs1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit PromptProductKE(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PromptProductKE(const PromptProductKE &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + PromptProductKE(PromptProductKE &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + polynomial1d(this,std::move(other.polynomial1d)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PromptProductKE &operator=(const PromptProductKE &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + polynomial1d = other.polynomial1d; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + PromptProductKE &operator=(PromptProductKE &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + polynomial1d = std::move(other.polynomial1d); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/PromptProductKE/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class PromptProductKE + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptProductKE/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptProductKE/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/PromptProductKE/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Q.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Q.hpp new file mode 100644 index 000000000..123308caf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Q.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_Q +#define GNDS_V2_0_GENERAL_Q + +#include "GNDS/v2.0/general/Double.hpp" +#include "GNDS/v2.0/general/Constant1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Q +// ----------------------------------------------------------------------------- + +class Q : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Q"; } + static auto NODENAME() { return "Q"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("double") | + --Child> + ("constant1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "Double", + "constant1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "double", + "constant1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + Double{this}; + Field> + constant1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double, \ + this->constant1d \ + ) + + // default + Q() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Q( + const wrapper> + &Double, + const wrapper> + &constant1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + Double(this,Double), + constant1d(this,constant1d) + { + Component::finish(); + } + + // from node + explicit Q(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Q(const Q &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double), + constant1d(this,other.constant1d) + { + Component::finish(other); + } + + // move + Q(Q &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + Double(this,std::move(other.Double)), + constant1d(this,std::move(other.constant1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Q &operator=(const Q &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + Double = other.Double; + constant1d = other.constant1d; + } + return *this; + } + + // move + Q &operator=(Q &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + Double = std::move(other.Double); + constant1d = std::move(other.constant1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Q/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Q + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Q/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Q/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Q/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/R.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/R.hpp new file mode 100644 index 000000000..3dd6a554e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/R.hpp @@ -0,0 +1,189 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_R +#define GNDS_V2_0_GENERAL_R + +#include "GNDS/v2.0/general/XYs2d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class R +// ----------------------------------------------------------------------------- + +class R : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "R"; } + static auto NODENAME() { return "r"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs2d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs2d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs2d().function1ds(),Legendre); + NJOY_GNDSTK_SHORTCUT(XYs2d().function1ds(),XYs1d); + NJOY_GNDSTK_SHORTCUT(XYs2d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs2d(),function1ds); + NJOY_GNDSTK_SHORTCUT(XYs2d().function1ds(),regions1d); + NJOY_GNDSTK_SHORTCUT(XYs2d(),uncertainty); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs2d \ + ) + + // default + R() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit R( + const wrapper + &XYs2d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit R(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + R(const R &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + R(R &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs2d(this,std::move(other.XYs2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + R &operator=(const R &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs2d = other.XYs2d; + } + return *this; + } + + // move + R &operator=(R &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs2d = std::move(other.XYs2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/R/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class R + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/R/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/R/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/R/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RMatrix.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RMatrix.hpp new file mode 100644 index 000000000..d9b388f69 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RMatrix.hpp @@ -0,0 +1,289 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_RMATRIX +#define GNDS_V2_0_GENERAL_RMATRIX + +#include "GNDS/v2.0/top/PoPs.hpp" +#include "GNDS/v2.0/general/ResonanceReactions.hpp" +#include "GNDS/v2.0/general/SpinGroups.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class RMatrix +// ----------------------------------------------------------------------------- + +class RMatrix : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "RMatrix"; } + static auto NODENAME() { return "RMatrix"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("approximation") | + std::string{} + / Meta<>("boundaryCondition") | + std::optional{} + / Meta<>("calculateChannelRadius") | + std::optional{} + / Meta<>("supportsAngularReconstruction") | + + // children + --Child> + ("PoPs") | + --Child + ("resonanceReactions") | + --Child + ("spinGroups") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "approximation", + "boundaryCondition", + "calculateChannelRadius", + "supportsAngularReconstruction", + "PoPs", + "resonanceReactions", + "spinGroups" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "approximation", + "boundary_condition", + "calculate_channel_radius", + "supports_angular_reconstruction", + "po_ps", + "resonance_reactions", + "spin_groups" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + approximation{this}; + Field + boundaryCondition{this}; + Field> + calculateChannelRadius{this}; + Field> + supportsAngularReconstruction{this}; + + // children + Field> + PoPs{this}; + Field + resonanceReactions{this}; + Field + spinGroups{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(resonanceReactions(),resonanceReaction); + NJOY_GNDSTK_SHORTCUT(spinGroups(),spinGroup); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->approximation, \ + this->boundaryCondition, \ + this->calculateChannelRadius, \ + this->supportsAngularReconstruction, \ + this->PoPs, \ + this->resonanceReactions, \ + this->spinGroups \ + ) + + // default + RMatrix() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RMatrix( + const wrapper + &label, + const wrapper + &approximation = {}, + const wrapper + &boundaryCondition = {}, + const wrapper> + &calculateChannelRadius = {}, + const wrapper> + &supportsAngularReconstruction = {}, + const wrapper> + &PoPs = {}, + const wrapper + &resonanceReactions = {}, + const wrapper + &spinGroups = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + approximation(this,approximation), + boundaryCondition(this,boundaryCondition), + calculateChannelRadius(this,calculateChannelRadius), + supportsAngularReconstruction(this,supportsAngularReconstruction), + PoPs(this,PoPs), + resonanceReactions(this,resonanceReactions), + spinGroups(this,spinGroups) + { + Component::finish(); + } + + // from node + explicit RMatrix(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RMatrix(const RMatrix &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + approximation(this,other.approximation), + boundaryCondition(this,other.boundaryCondition), + calculateChannelRadius(this,other.calculateChannelRadius), + supportsAngularReconstruction(this,other.supportsAngularReconstruction), + PoPs(this,other.PoPs), + resonanceReactions(this,other.resonanceReactions), + spinGroups(this,other.spinGroups) + { + Component::finish(other); + } + + // move + RMatrix(RMatrix &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + approximation(this,std::move(other.approximation)), + boundaryCondition(this,std::move(other.boundaryCondition)), + calculateChannelRadius(this,std::move(other.calculateChannelRadius)), + supportsAngularReconstruction(this,std::move(other.supportsAngularReconstruction)), + PoPs(this,std::move(other.PoPs)), + resonanceReactions(this,std::move(other.resonanceReactions)), + spinGroups(this,std::move(other.spinGroups)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + RMatrix &operator=(const RMatrix &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + approximation = other.approximation; + boundaryCondition = other.boundaryCondition; + calculateChannelRadius = other.calculateChannelRadius; + supportsAngularReconstruction = other.supportsAngularReconstruction; + PoPs = other.PoPs; + resonanceReactions = other.resonanceReactions; + spinGroups = other.spinGroups; + } + return *this; + } + + // move + RMatrix &operator=(RMatrix &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + approximation = std::move(other.approximation); + boundaryCondition = std::move(other.boundaryCondition); + calculateChannelRadius = std::move(other.calculateChannelRadius); + supportsAngularReconstruction = std::move(other.supportsAngularReconstruction); + PoPs = std::move(other.PoPs); + resonanceReactions = std::move(other.resonanceReactions); + spinGroups = std::move(other.spinGroups); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/RMatrix/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class RMatrix + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RMatrix/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RMatrix/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RMatrix/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Rate.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Rate.hpp new file mode 100644 index 000000000..7bbe16d8e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Rate.hpp @@ -0,0 +1,184 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_RATE +#define GNDS_V2_0_GENERAL_RATE + +#include "GNDS/v2.0/general/Double.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Rate +// ----------------------------------------------------------------------------- + +class Rate : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Rate"; } + static auto NODENAME() { return "rate"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("double") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "Double" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + Double{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(Double(),uncertainty); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Rate() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Rate( + const wrapper + &Double + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Rate(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Rate(const Rate &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Rate(Rate &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Rate &operator=(const Rate &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + Double = other.Double; + } + return *this; + } + + // move + Rate &operator=(Rate &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Rate/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Rate + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Rate/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Rate/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Rate/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reaction.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reaction.hpp new file mode 100644 index 000000000..33234ff9d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reaction.hpp @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_REACTION +#define GNDS_V2_0_GENERAL_REACTION + +#include "GNDS/v2.0/general/CrossSection.hpp" +#include "GNDS/v2.0/general/OutputChannel.hpp" +#include "GNDS/v2.0/general/DoubleDifferentialCrossSection.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Reaction +// ----------------------------------------------------------------------------- + +class Reaction : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Reaction"; } + static auto NODENAME() { return "reaction"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + int{} + / Meta<>("ENDF_MT") | + std::optional{} + / Meta<>("fissionGenre") | + + // children + --Child + ("crossSection") | + --Child + ("outputChannel") | + --Child> + ("doubleDifferentialCrossSection") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "ENDF_MT", + "fissionGenre", + "crossSection", + "outputChannel", + "doubleDifferentialCrossSection" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "endf_mt", + "fission_genre", + "cross_section", + "output_channel", + "double_differential_cross_section" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + ENDF_MT{this}; + Field> + fissionGenre{this}; + + // children + Field + crossSection{this}; + Field + outputChannel{this}; + Field> + doubleDifferentialCrossSection{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(outputChannel().Q(),Double); + NJOY_GNDSTK_SHORTCUT(outputChannel(),Q); + NJOY_GNDSTK_SHORTCUT(crossSection(),XYs1d); + NJOY_GNDSTK_SHORTCUT(outputChannel().Q(),constant1d); + NJOY_GNDSTK_SHORTCUT(outputChannel(),fissionFragmentData); + NJOY_GNDSTK_SHORTCUT(outputChannel(),products); + NJOY_GNDSTK_SHORTCUT(crossSection(),reference); + NJOY_GNDSTK_SHORTCUT(crossSection(),regions1d); + NJOY_GNDSTK_SHORTCUT(crossSection(),resonancesWithBackground); + NJOY_GNDSTK_SHORTCUT(crossSection(),thermalNeutronScatteringLaw1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ENDF_MT, \ + this->fissionGenre, \ + this->crossSection, \ + this->outputChannel, \ + this->doubleDifferentialCrossSection \ + ) + + // default + Reaction() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reaction( + const wrapper + &label, + const wrapper + &ENDF_MT = {}, + const wrapper> + &fissionGenre = {}, + const wrapper + &crossSection = {}, + const wrapper + &outputChannel = {}, + const wrapper> + &doubleDifferentialCrossSection = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + ENDF_MT(this,ENDF_MT), + fissionGenre(this,fissionGenre), + crossSection(this,crossSection), + outputChannel(this,outputChannel), + doubleDifferentialCrossSection(this,doubleDifferentialCrossSection) + { + Component::finish(); + } + + // from node + explicit Reaction(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reaction(const Reaction &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + ENDF_MT(this,other.ENDF_MT), + fissionGenre(this,other.fissionGenre), + crossSection(this,other.crossSection), + outputChannel(this,other.outputChannel), + doubleDifferentialCrossSection(this,other.doubleDifferentialCrossSection) + { + Component::finish(other); + } + + // move + Reaction(Reaction &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + ENDF_MT(this,std::move(other.ENDF_MT)), + fissionGenre(this,std::move(other.fissionGenre)), + crossSection(this,std::move(other.crossSection)), + outputChannel(this,std::move(other.outputChannel)), + doubleDifferentialCrossSection(this,std::move(other.doubleDifferentialCrossSection)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Reaction &operator=(const Reaction &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + ENDF_MT = other.ENDF_MT; + fissionGenre = other.fissionGenre; + crossSection = other.crossSection; + outputChannel = other.outputChannel; + doubleDifferentialCrossSection = other.doubleDifferentialCrossSection; + } + return *this; + } + + // move + Reaction &operator=(Reaction &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + ENDF_MT = std::move(other.ENDF_MT); + fissionGenre = std::move(other.fissionGenre); + crossSection = std::move(other.crossSection); + outputChannel = std::move(other.outputChannel); + doubleDifferentialCrossSection = std::move(other.doubleDifferentialCrossSection); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Reaction/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Reaction + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reaction/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reaction/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reaction/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reactions.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reactions.hpp new file mode 100644 index 000000000..297f56954 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reactions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_REACTIONS +#define GNDS_V2_0_GENERAL_REACTIONS + +#include "GNDS/v2.0/general/Reaction.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Reactions +// ----------------------------------------------------------------------------- + +class Reactions : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Reactions"; } + static auto NODENAME() { return "reactions"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("reaction") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "reaction" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "reaction" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + reaction{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->reaction \ + ) + + // default + Reactions() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reactions( + const wrapper> + &reaction + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + reaction(this,reaction) + { + Component::finish(); + } + + // from node + explicit Reactions(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reactions(const Reactions &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + reaction(this,other.reaction) + { + Component::finish(other); + } + + // move + Reactions(Reactions &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + reaction(this,std::move(other.reaction)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Reactions &operator=(const Reactions &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + reaction = other.reaction; + } + return *this; + } + + // move + Reactions &operator=(Reactions &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + reaction = std::move(other.reaction); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Reactions/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Reactions + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reactions/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reactions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reactions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealAnomalousFactor.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealAnomalousFactor.hpp new file mode 100644 index 000000000..8612b5d07 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealAnomalousFactor.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_REALANOMALOUSFACTOR +#define GNDS_V2_0_GENERAL_REALANOMALOUSFACTOR + +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class RealAnomalousFactor +// ----------------------------------------------------------------------------- + +class RealAnomalousFactor : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "RealAnomalousFactor"; } + static auto NODENAME() { return "realAnomalousFactor"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + RealAnomalousFactor() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RealAnomalousFactor( + const wrapper + &XYs1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit RealAnomalousFactor(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RealAnomalousFactor(const RealAnomalousFactor &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + RealAnomalousFactor(RealAnomalousFactor &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + RealAnomalousFactor &operator=(const RealAnomalousFactor &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + RealAnomalousFactor &operator=(RealAnomalousFactor &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/RealAnomalousFactor/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class RealAnomalousFactor + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealAnomalousFactor/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealAnomalousFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealAnomalousFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealInterferenceTerm.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealInterferenceTerm.hpp new file mode 100644 index 000000000..6ef987f09 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealInterferenceTerm.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_REALINTERFERENCETERM +#define GNDS_V2_0_GENERAL_REALINTERFERENCETERM + +#include "GNDS/v2.0/general/Regions2d.hpp" +#include "GNDS/v2.0/general/XYs2d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class RealInterferenceTerm +// ----------------------------------------------------------------------------- + +class RealInterferenceTerm : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "RealInterferenceTerm"; } + static auto NODENAME() { return "realInterferenceTerm"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("regions2d") | + --Child> + ("XYs2d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "regions2d", + "XYs2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "regions2d", + "xys2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + regions2d{this}; + Field> + XYs2d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->regions2d, \ + this->XYs2d \ + ) + + // default + RealInterferenceTerm() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RealInterferenceTerm( + const wrapper> + ®ions2d, + const wrapper> + &XYs2d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + regions2d(this,regions2d), + XYs2d(this,XYs2d) + { + Component::finish(); + } + + // from node + explicit RealInterferenceTerm(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RealInterferenceTerm(const RealInterferenceTerm &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + regions2d(this,other.regions2d), + XYs2d(this,other.XYs2d) + { + Component::finish(other); + } + + // move + RealInterferenceTerm(RealInterferenceTerm &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + regions2d(this,std::move(other.regions2d)), + XYs2d(this,std::move(other.XYs2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + RealInterferenceTerm &operator=(const RealInterferenceTerm &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + regions2d = other.regions2d; + XYs2d = other.XYs2d; + } + return *this; + } + + // move + RealInterferenceTerm &operator=(RealInterferenceTerm &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + regions2d = std::move(other.regions2d); + XYs2d = std::move(other.XYs2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/RealInterferenceTerm/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class RealInterferenceTerm + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealInterferenceTerm/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealInterferenceTerm/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RealInterferenceTerm/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Recoil.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Recoil.hpp new file mode 100644 index 000000000..a465a2449 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Recoil.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_RECOIL +#define GNDS_V2_0_GENERAL_RECOIL + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Recoil +// ----------------------------------------------------------------------------- + +class Recoil : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Recoil"; } + static auto NODENAME() { return "recoil"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("href") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "href" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href \ + ) + + // default + Recoil() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Recoil( + const wrapper + &href + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Recoil(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Recoil(const Recoil &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Recoil(Recoil &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Recoil &operator=(const Recoil &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + href = other.href; + } + return *this; + } + + // move + Recoil &operator=(Recoil &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Recoil/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Recoil + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Recoil/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Recoil/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Recoil/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reference.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reference.hpp new file mode 100644 index 000000000..8e3f0d0de --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reference.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_REFERENCE +#define GNDS_V2_0_GENERAL_REFERENCE + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Reference +// ----------------------------------------------------------------------------- + +class Reference : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Reference"; } + static auto NODENAME() { return "reference"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("href") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "href" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href \ + ) + + // default + Reference() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Reference( + const wrapper + &label, + const wrapper + &href = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Reference(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Reference(const Reference &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href) + { + Component::finish(other); + } + + // move + Reference(Reference &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Reference &operator=(const Reference &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + href = other.href; + } + return *this; + } + + // move + Reference &operator=(Reference &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Reference/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Reference + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reference/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reference/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Reference/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions1d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions1d.hpp new file mode 100644 index 000000000..303b13fed --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions1d.hpp @@ -0,0 +1,247 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_REGIONS1D +#define GNDS_V2_0_GENERAL_REGIONS1D + +#include "GNDS/v2.0/general/Axes.hpp" +#include "GNDS/v2.0/general/Uncertainty.hpp" +#include "GNDS/v2.0/reduced/Function1ds.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Regions1d +// ----------------------------------------------------------------------------- + +class Regions1d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Regions1d"; } + static auto NODENAME() { return "regions1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("outerDomainValue") | + + // children + --Child> + ("axes") | + --Child> + ("uncertainty") | + --Child + ("function1ds") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "outerDomainValue", + "axes", + "uncertainty", + "function1ds" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "outer_domain_value", + "axes", + "uncertainty", + "function1ds" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + outerDomainValue{this}; + + // children + Field> + axes{this}; + Field> + uncertainty{this}; + Field + function1ds{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(function1ds(),Legendre); + NJOY_GNDSTK_SHORTCUT(function1ds(),XYs1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->outerDomainValue, \ + this->axes, \ + this->uncertainty, \ + this->function1ds \ + ) + + // default + Regions1d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Regions1d( + const wrapper> + &label, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &axes = {}, + const wrapper> + &uncertainty = {}, + const wrapper + &function1ds = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + outerDomainValue(this,outerDomainValue), + axes(this,axes), + uncertainty(this,uncertainty), + function1ds(this,function1ds) + { + Component::finish(); + } + + // from node + explicit Regions1d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Regions1d(const Regions1d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + outerDomainValue(this,other.outerDomainValue), + axes(this,other.axes), + uncertainty(this,other.uncertainty), + function1ds(this,other.function1ds) + { + Component::finish(other); + } + + // move + Regions1d(Regions1d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + outerDomainValue(this,std::move(other.outerDomainValue)), + axes(this,std::move(other.axes)), + uncertainty(this,std::move(other.uncertainty)), + function1ds(this,std::move(other.function1ds)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Regions1d &operator=(const Regions1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + outerDomainValue = other.outerDomainValue; + axes = other.axes; + uncertainty = other.uncertainty; + function1ds = other.function1ds; + } + return *this; + } + + // move + Regions1d &operator=(Regions1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + outerDomainValue = std::move(other.outerDomainValue); + axes = std::move(other.axes); + uncertainty = std::move(other.uncertainty); + function1ds = std::move(other.function1ds); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Regions1d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Regions1d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions1d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions2d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions2d.hpp new file mode 100644 index 000000000..0656d1736 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions2d.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_REGIONS2D +#define GNDS_V2_0_GENERAL_REGIONS2D + +#include "GNDS/v2.0/general/Axes.hpp" +#include "GNDS/v2.0/general/Function2ds.hpp" +#include "GNDS/v2.0/general/Uncertainty.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Regions2d +// ----------------------------------------------------------------------------- + +class Regions2d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Regions2d"; } + static auto NODENAME() { return "regions2d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("axes") | + --Child + ("function2ds") | + --Child> + ("uncertainty") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "axes", + "function2ds", + "uncertainty" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "axes", + "function2ds", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + axes{this}; + Field + function2ds{this}; + Field> + uncertainty{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(function2ds(),XYs2d); + NJOY_GNDSTK_SHORTCUT(axes(),axis); + NJOY_GNDSTK_SHORTCUT(axes(),grid); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->axes, \ + this->function2ds, \ + this->uncertainty \ + ) + + // default + Regions2d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Regions2d( + const wrapper + &axes, + const wrapper + &function2ds = {}, + const wrapper> + &uncertainty = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + axes(this,axes), + function2ds(this,function2ds), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Regions2d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Regions2d(const Regions2d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + axes(this,other.axes), + function2ds(this,other.function2ds), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Regions2d(Regions2d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + axes(this,std::move(other.axes)), + function2ds(this,std::move(other.function2ds)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Regions2d &operator=(const Regions2d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + axes = other.axes; + function2ds = other.function2ds; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + Regions2d &operator=(Regions2d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + axes = std::move(other.axes); + function2ds = std::move(other.function2ds); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Regions2d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Regions2d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions2d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Regions2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resolved.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resolved.hpp new file mode 100644 index 000000000..40dece1df --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resolved.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_RESOLVED +#define GNDS_V2_0_GENERAL_RESOLVED + +#include "GNDS/v2.0/general/BreitWigner.hpp" +#include "GNDS/v2.0/general/RMatrix.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Resolved +// ----------------------------------------------------------------------------- + +class Resolved : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Resolved"; } + static auto NODENAME() { return "resolved"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("domainMin") | + double{} + / Meta<>("domainMax") | + std::string{} + / Meta<>("domainUnit") | + + // children + --Child> + ("BreitWigner") | + --Child> + ("RMatrix") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "domainMin", + "domainMax", + "domainUnit", + "BreitWigner", + "RMatrix" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "domain_min", + "domain_max", + "domain_unit", + "breit_wigner", + "rmatrix" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + domainMin{this}; + Field + domainMax{this}; + Field + domainUnit{this}; + + // children + Field> + BreitWigner{this}; + Field> + RMatrix{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit, \ + this->BreitWigner, \ + this->RMatrix \ + ) + + // default + Resolved() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Resolved( + const wrapper + &domainMin, + const wrapper + &domainMax = {}, + const wrapper + &domainUnit = {}, + const wrapper> + &BreitWigner = {}, + const wrapper> + &RMatrix = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + domainMin(this,domainMin), + domainMax(this,domainMax), + domainUnit(this,domainUnit), + BreitWigner(this,BreitWigner), + RMatrix(this,RMatrix) + { + Component::finish(); + } + + // from node + explicit Resolved(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Resolved(const Resolved &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + domainUnit(this,other.domainUnit), + BreitWigner(this,other.BreitWigner), + RMatrix(this,other.RMatrix) + { + Component::finish(other); + } + + // move + Resolved(Resolved &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + domainUnit(this,std::move(other.domainUnit)), + BreitWigner(this,std::move(other.BreitWigner)), + RMatrix(this,std::move(other.RMatrix)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Resolved &operator=(const Resolved &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + domainMin = other.domainMin; + domainMax = other.domainMax; + domainUnit = other.domainUnit; + BreitWigner = other.BreitWigner; + RMatrix = other.RMatrix; + } + return *this; + } + + // move + Resolved &operator=(Resolved &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + domainUnit = std::move(other.domainUnit); + BreitWigner = std::move(other.BreitWigner); + RMatrix = std::move(other.RMatrix); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Resolved/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Resolved + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resolved/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resolved/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resolved/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResolvedRegion.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResolvedRegion.hpp new file mode 100644 index 000000000..83cfbeb22 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResolvedRegion.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_RESOLVEDREGION +#define GNDS_V2_0_GENERAL_RESOLVEDREGION + +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/Regions1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ResolvedRegion +// ----------------------------------------------------------------------------- + +class ResolvedRegion : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ResolvedRegion"; } + static auto NODENAME() { return "resolvedRegion"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("XYs1d") | + --Child> + ("regions1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d", + "regions1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d", + "regions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + regions1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + ResolvedRegion() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResolvedRegion( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit ResolvedRegion(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResolvedRegion(const ResolvedRegion &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + ResolvedRegion(ResolvedRegion &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + regions1d(this,std::move(other.regions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ResolvedRegion &operator=(const ResolvedRegion &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + return *this; + } + + // move + ResolvedRegion &operator=(ResolvedRegion &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ResolvedRegion/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ResolvedRegion + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResolvedRegion/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResolvedRegion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResolvedRegion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceParameters.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceParameters.hpp new file mode 100644 index 000000000..52e651ce4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceParameters.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_RESONANCEPARAMETERS +#define GNDS_V2_0_GENERAL_RESONANCEPARAMETERS + +#include "GNDS/v2.0/general/Table.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ResonanceParameters +// ----------------------------------------------------------------------------- + +class ResonanceParameters : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ResonanceParameters"; } + static auto NODENAME() { return "resonanceParameters"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("table") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "table" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "table" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + table{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(table().columnHeaders(),column); + NJOY_GNDSTK_SHORTCUT(table(),columnHeaders); + NJOY_GNDSTK_SHORTCUT(table(),data); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->table \ + ) + + // default + ResonanceParameters() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResonanceParameters( + const wrapper + &table + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + table(this,table) + { + Component::finish(); + } + + // from node + explicit ResonanceParameters(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonanceParameters(const ResonanceParameters &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + table(this,other.table) + { + Component::finish(other); + } + + // move + ResonanceParameters(ResonanceParameters &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + table(this,std::move(other.table)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ResonanceParameters &operator=(const ResonanceParameters &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + table = other.table; + } + return *this; + } + + // move + ResonanceParameters &operator=(ResonanceParameters &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + table = std::move(other.table); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ResonanceParameters/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ResonanceParameters + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceParameters/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceParameters/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceParameters/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReaction.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReaction.hpp new file mode 100644 index 000000000..96ea20b30 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReaction.hpp @@ -0,0 +1,270 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_RESONANCEREACTION +#define GNDS_V2_0_GENERAL_RESONANCEREACTION + +#include "GNDS/v2.0/general/Link.hpp" +#include "GNDS/v2.0/general/HardSphereRadius.hpp" +#include "GNDS/v2.0/general/Q.hpp" +#include "GNDS/v2.0/general/ScatteringRadius.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ResonanceReaction +// ----------------------------------------------------------------------------- + +class ResonanceReaction : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ResonanceReaction"; } + static auto NODENAME() { return "resonanceReaction"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::optional{} + / Meta<>("ejectile") | + std::optional{} + / Meta<>("eliminated") | + + // children + --Child + ("link") | + --Child> + ("hardSphereRadius") | + --Child> + ("Q") | + --Child> + ("scatteringRadius") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "ejectile", + "eliminated", + "link", + "hardSphereRadius", + "Q", + "scatteringRadius" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "ejectile", + "eliminated", + "link", + "hard_sphere_radius", + "q", + "scattering_radius" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field> + ejectile{this}; + Field> + eliminated{this}; + + // children + Field + link{this}; + Field> + hardSphereRadius{this}; + Field> + Q{this}; + Field> + scatteringRadius{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->ejectile, \ + this->eliminated, \ + this->link, \ + this->hardSphereRadius, \ + this->Q, \ + this->scatteringRadius \ + ) + + // default + ResonanceReaction() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResonanceReaction( + const wrapper + &label, + const wrapper> + &ejectile = {}, + const wrapper> + &eliminated = {}, + const wrapper + &link = {}, + const wrapper> + &hardSphereRadius = {}, + const wrapper> + &Q = {}, + const wrapper> + &scatteringRadius = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + ejectile(this,ejectile), + eliminated(this,eliminated), + link(this,link), + hardSphereRadius(this,hardSphereRadius), + Q(this,Q), + scatteringRadius(this,scatteringRadius) + { + Component::finish(); + } + + // from node + explicit ResonanceReaction(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonanceReaction(const ResonanceReaction &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + ejectile(this,other.ejectile), + eliminated(this,other.eliminated), + link(this,other.link), + hardSphereRadius(this,other.hardSphereRadius), + Q(this,other.Q), + scatteringRadius(this,other.scatteringRadius) + { + Component::finish(other); + } + + // move + ResonanceReaction(ResonanceReaction &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + ejectile(this,std::move(other.ejectile)), + eliminated(this,std::move(other.eliminated)), + link(this,std::move(other.link)), + hardSphereRadius(this,std::move(other.hardSphereRadius)), + Q(this,std::move(other.Q)), + scatteringRadius(this,std::move(other.scatteringRadius)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ResonanceReaction &operator=(const ResonanceReaction &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + ejectile = other.ejectile; + eliminated = other.eliminated; + link = other.link; + hardSphereRadius = other.hardSphereRadius; + Q = other.Q; + scatteringRadius = other.scatteringRadius; + } + return *this; + } + + // move + ResonanceReaction &operator=(ResonanceReaction &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + ejectile = std::move(other.ejectile); + eliminated = std::move(other.eliminated); + link = std::move(other.link); + hardSphereRadius = std::move(other.hardSphereRadius); + Q = std::move(other.Q); + scatteringRadius = std::move(other.scatteringRadius); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ResonanceReaction/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ResonanceReaction + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReaction/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReaction/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReaction/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReactions.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReactions.hpp new file mode 100644 index 000000000..a5f99021a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReactions.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_RESONANCEREACTIONS +#define GNDS_V2_0_GENERAL_RESONANCEREACTIONS + +#include "GNDS/v2.0/general/ResonanceReaction.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ResonanceReactions +// ----------------------------------------------------------------------------- + +class ResonanceReactions : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ResonanceReactions"; } + static auto NODENAME() { return "resonanceReactions"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("resonanceReaction") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "resonanceReaction" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "resonance_reaction" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + resonanceReaction{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->resonanceReaction \ + ) + + // default + ResonanceReactions() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResonanceReactions( + const wrapper> + &resonanceReaction + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + resonanceReaction(this,resonanceReaction) + { + Component::finish(); + } + + // from node + explicit ResonanceReactions(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonanceReactions(const ResonanceReactions &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + resonanceReaction(this,other.resonanceReaction) + { + Component::finish(other); + } + + // move + ResonanceReactions(ResonanceReactions &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + resonanceReaction(this,std::move(other.resonanceReaction)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ResonanceReactions &operator=(const ResonanceReactions &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + resonanceReaction = other.resonanceReaction; + } + return *this; + } + + // move + ResonanceReactions &operator=(ResonanceReactions &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + resonanceReaction = std::move(other.resonanceReaction); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ResonanceReactions/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ResonanceReactions + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReactions/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReactions/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonanceReactions/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resonances.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resonances.hpp new file mode 100644 index 000000000..b912d3e56 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resonances.hpp @@ -0,0 +1,227 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_RESONANCES +#define GNDS_V2_0_GENERAL_RESONANCES + +#include "GNDS/v2.0/general/ScatteringRadius.hpp" +#include "GNDS/v2.0/general/Resolved.hpp" +#include "GNDS/v2.0/general/Unresolved.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Resonances +// ----------------------------------------------------------------------------- + +class Resonances : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Resonances"; } + static auto NODENAME() { return "resonances"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("href") | + + // children + --Child> + ("scatteringRadius") | + --Child> + ("resolved") | + --Child> + ("unresolved") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "href", + "scatteringRadius", + "resolved", + "unresolved" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "href", + "scattering_radius", + "resolved", + "unresolved" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + href{this}; + + // children + Field> + scatteringRadius{this}; + Field> + resolved{this}; + Field> + unresolved{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + this->scatteringRadius, \ + this->resolved, \ + this->unresolved \ + ) + + // default + Resonances() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Resonances( + const wrapper> + &href, + const wrapper> + &scatteringRadius = {}, + const wrapper> + &resolved = {}, + const wrapper> + &unresolved = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + href(this,href), + scatteringRadius(this,scatteringRadius), + resolved(this,resolved), + unresolved(this,unresolved) + { + Component::finish(); + } + + // from node + explicit Resonances(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Resonances(const Resonances &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + href(this,other.href), + scatteringRadius(this,other.scatteringRadius), + resolved(this,other.resolved), + unresolved(this,other.unresolved) + { + Component::finish(other); + } + + // move + Resonances(Resonances &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)), + scatteringRadius(this,std::move(other.scatteringRadius)), + resolved(this,std::move(other.resolved)), + unresolved(this,std::move(other.unresolved)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Resonances &operator=(const Resonances &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + href = other.href; + scatteringRadius = other.scatteringRadius; + resolved = other.resolved; + unresolved = other.unresolved; + } + return *this; + } + + // move + Resonances &operator=(Resonances &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + href = std::move(other.href); + scatteringRadius = std::move(other.scatteringRadius); + resolved = std::move(other.resolved); + unresolved = std::move(other.unresolved); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Resonances/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Resonances + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resonances/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resonances/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Resonances/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonancesWithBackground.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonancesWithBackground.hpp new file mode 100644 index 000000000..019e56fc8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonancesWithBackground.hpp @@ -0,0 +1,237 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_RESONANCESWITHBACKGROUND +#define GNDS_V2_0_GENERAL_RESONANCESWITHBACKGROUND + +#include "GNDS/v2.0/general/Resonances.hpp" +#include "GNDS/v2.0/general/Background.hpp" +#include "GNDS/v2.0/general/Uncertainty.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ResonancesWithBackground +// ----------------------------------------------------------------------------- + +class ResonancesWithBackground : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ResonancesWithBackground"; } + static auto NODENAME() { return "resonancesWithBackground"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + + // children + --Child + ("resonances") | + --Child + ("background") | + --Child> + ("uncertainty") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "resonances", + "background", + "uncertainty" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "resonances", + "background", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + + // children + Field + resonances{this}; + Field + background{this}; + Field> + uncertainty{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(background(),fastRegion); + NJOY_GNDSTK_SHORTCUT(resonances(),resolved); + NJOY_GNDSTK_SHORTCUT(background(),resolvedRegion); + NJOY_GNDSTK_SHORTCUT(resonances(),scatteringRadius); + NJOY_GNDSTK_SHORTCUT(resonances(),unresolved); + NJOY_GNDSTK_SHORTCUT(background(),unresolvedRegion); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->resonances, \ + this->background, \ + this->uncertainty \ + ) + + // default + ResonancesWithBackground() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ResonancesWithBackground( + const wrapper + &label, + const wrapper + &resonances = {}, + const wrapper + &background = {}, + const wrapper> + &uncertainty = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + resonances(this,resonances), + background(this,background), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit ResonancesWithBackground(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ResonancesWithBackground(const ResonancesWithBackground &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + resonances(this,other.resonances), + background(this,other.background), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + ResonancesWithBackground(ResonancesWithBackground &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + resonances(this,std::move(other.resonances)), + background(this,std::move(other.background)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ResonancesWithBackground &operator=(const ResonancesWithBackground &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + resonances = other.resonances; + background = other.background; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + ResonancesWithBackground &operator=(ResonancesWithBackground &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + resonances = std::move(other.resonances); + background = std::move(other.background); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ResonancesWithBackground/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ResonancesWithBackground + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonancesWithBackground/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonancesWithBackground/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ResonancesWithBackground/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RowData.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RowData.hpp new file mode 100644 index 000000000..567e40e31 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RowData.hpp @@ -0,0 +1,225 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_ROWDATA +#define GNDS_V2_0_GENERAL_ROWDATA + +#include "GNDS/v2.0/general/Slices.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class RowData +// ----------------------------------------------------------------------------- + +class RowData : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "RowData"; } + static auto NODENAME() { return "rowData"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("ENDF_MFMT") | + std::optional{} + / Meta<>("dimension") | + std::string{} + / Meta<>("href") | + + // children + --Child> + ("slices") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "ENDF_MFMT", + "dimension", + "href", + "slices" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "endf_mfmt", + "dimension", + "href", + "slices" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + ENDF_MFMT{this}; + Field> + dimension{this}; + Field + href{this}; + + // children + Field> + slices{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MFMT, \ + this->dimension, \ + this->href, \ + this->slices \ + ) + + // default + RowData() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit RowData( + const wrapper> + &ENDF_MFMT, + const wrapper> + &dimension = {}, + const wrapper + &href = {}, + const wrapper> + &slices = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + ENDF_MFMT(this,ENDF_MFMT), + dimension(this,dimension), + href(this,href), + slices(this,slices) + { + Component::finish(); + } + + // from node + explicit RowData(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RowData(const RowData &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + ENDF_MFMT(this,other.ENDF_MFMT), + dimension(this,other.dimension), + href(this,other.href), + slices(this,other.slices) + { + Component::finish(other); + } + + // move + RowData(RowData &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + ENDF_MFMT(this,std::move(other.ENDF_MFMT)), + dimension(this,std::move(other.dimension)), + href(this,std::move(other.href)), + slices(this,std::move(other.slices)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + RowData &operator=(const RowData &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + ENDF_MFMT = other.ENDF_MFMT; + dimension = other.dimension; + href = other.href; + slices = other.slices; + } + return *this; + } + + // move + RowData &operator=(RowData &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + ENDF_MFMT = std::move(other.ENDF_MFMT); + dimension = std::move(other.dimension); + href = std::move(other.href); + slices = std::move(other.slices); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/RowData/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class RowData + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RowData/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RowData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RowData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RutherfordScattering.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RutherfordScattering.hpp new file mode 100644 index 000000000..0397a0717 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RutherfordScattering.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_RUTHERFORDSCATTERING +#define GNDS_V2_0_GENERAL_RUTHERFORDSCATTERING + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class RutherfordScattering +// ----------------------------------------------------------------------------- + +class RutherfordScattering : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "RutherfordScattering"; } + static auto NODENAME() { return "RutherfordScattering"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + RutherfordScattering() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit RutherfordScattering(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + RutherfordScattering(const RutherfordScattering &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + RutherfordScattering(RutherfordScattering &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + RutherfordScattering &operator=(const RutherfordScattering &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + RutherfordScattering &operator=(RutherfordScattering &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/RutherfordScattering/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class RutherfordScattering + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RutherfordScattering/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RutherfordScattering/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/RutherfordScattering/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SCTApproximation.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SCTApproximation.hpp new file mode 100644 index 000000000..aa212a57a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SCTApproximation.hpp @@ -0,0 +1,153 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SCTAPPROXIMATION +#define GNDS_V2_0_GENERAL_SCTAPPROXIMATION + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class SCTApproximation +// ----------------------------------------------------------------------------- + +class SCTApproximation : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "SCTApproximation"; } + static auto NODENAME() { return "SCTApproximation"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment \ + ) + + // default + SCTApproximation() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit SCTApproximation(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SCTApproximation(const SCTApproximation &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + SCTApproximation(SCTApproximation &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + SCTApproximation &operator=(const SCTApproximation &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + SCTApproximation &operator=(SCTApproximation &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/SCTApproximation/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class SCTApproximation + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SCTApproximation/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SCTApproximation/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SCTApproximation/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/S_table.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/S_table.hpp new file mode 100644 index 000000000..fed1ab7cc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/S_table.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_S_TABLE +#define GNDS_V2_0_GENERAL_S_TABLE + +#include "GNDS/v2.0/general/Gridded2d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class S_table +// ----------------------------------------------------------------------------- + +class S_table : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "S_table"; } + static auto NODENAME() { return "S_table"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("gridded2d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "gridded2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "gridded2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + gridded2d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(gridded2d(),array); + NJOY_GNDSTK_SHORTCUT(gridded2d(),axes); + NJOY_GNDSTK_SHORTCUT(gridded2d().axes(),axis); + NJOY_GNDSTK_SHORTCUT(gridded2d().axes(),grid); + NJOY_GNDSTK_SHORTCUT(gridded2d().array(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->gridded2d \ + ) + + // default + S_table() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit S_table( + const wrapper + &gridded2d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + gridded2d(this,gridded2d) + { + Component::finish(); + } + + // from node + explicit S_table(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + S_table(const S_table &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + gridded2d(this,other.gridded2d) + { + Component::finish(other); + } + + // move + S_table(S_table &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + gridded2d(this,std::move(other.gridded2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + S_table &operator=(const S_table &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + gridded2d = other.gridded2d; + } + return *this; + } + + // move + S_table &operator=(S_table &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + gridded2d = std::move(other.gridded2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/S_table/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class S_table + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/S_table/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/S_table/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/S_table/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtom.hpp new file mode 100644 index 000000000..dbe0c6340 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtom.hpp @@ -0,0 +1,308 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SCATTERINGATOM +#define GNDS_V2_0_GENERAL_SCATTERINGATOM + +#include "GNDS/v2.0/general/Mass.hpp" +#include "GNDS/v2.0/general/E_critical.hpp" +#include "GNDS/v2.0/general/E_max.hpp" +#include "GNDS/v2.0/general/BoundAtomCrossSection.hpp" +#include "GNDS/v2.0/general/SelfScatteringKernel.hpp" +#include "GNDS/v2.0/general/T_effective.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ScatteringAtom +// ----------------------------------------------------------------------------- + +class ScatteringAtom : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ScatteringAtom"; } + static auto NODENAME() { return "scatteringAtom"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("pid") | + int{} + / Meta<>("numberPerMolecule") | + std::optional{} + / Meta<>("primaryScatterer") | + + // children + --Child + ("mass") | + --Child> + ("e_critical") | + --Child + ("e_max") | + --Child + ("boundAtomCrossSection") | + --Child + ("selfScatteringKernel") | + --Child> + ("T_effective") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "pid", + "numberPerMolecule", + "primaryScatterer", + "mass", + "e_critical", + "e_max", + "boundAtomCrossSection", + "selfScatteringKernel", + "T_effective" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "pid", + "number_per_molecule", + "primary_scatterer", + "mass", + "e_critical", + "e_max", + "bound_atom_cross_section", + "self_scattering_kernel", + "t_effective" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + pid{this}; + Field + numberPerMolecule{this}; + Field> + primaryScatterer{this}; + + // children + Field + mass{this}; + Field> + e_critical{this}; + Field + e_max{this}; + Field + boundAtomCrossSection{this}; + Field + selfScatteringKernel{this}; + Field> + T_effective{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(mass(),Double); + NJOY_GNDSTK_SHORTCUT(selfScatteringKernel(),SCTApproximation); + NJOY_GNDSTK_SHORTCUT(selfScatteringKernel(),freeGasApproximation); + NJOY_GNDSTK_SHORTCUT(selfScatteringKernel(),gridded3d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->pid, \ + this->numberPerMolecule, \ + this->primaryScatterer, \ + this->mass, \ + this->e_critical, \ + this->e_max, \ + this->boundAtomCrossSection, \ + this->selfScatteringKernel, \ + this->T_effective \ + ) + + // default + ScatteringAtom() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ScatteringAtom( + const wrapper + &pid, + const wrapper + &numberPerMolecule = {}, + const wrapper> + &primaryScatterer = {}, + const wrapper + &mass = {}, + const wrapper> + &e_critical = {}, + const wrapper + &e_max = {}, + const wrapper + &boundAtomCrossSection = {}, + const wrapper + &selfScatteringKernel = {}, + const wrapper> + &T_effective = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + pid(this,pid), + numberPerMolecule(this,numberPerMolecule), + primaryScatterer(this,primaryScatterer), + mass(this,mass), + e_critical(this,e_critical), + e_max(this,e_max), + boundAtomCrossSection(this,boundAtomCrossSection), + selfScatteringKernel(this,selfScatteringKernel), + T_effective(this,T_effective) + { + Component::finish(); + } + + // from node + explicit ScatteringAtom(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringAtom(const ScatteringAtom &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + pid(this,other.pid), + numberPerMolecule(this,other.numberPerMolecule), + primaryScatterer(this,other.primaryScatterer), + mass(this,other.mass), + e_critical(this,other.e_critical), + e_max(this,other.e_max), + boundAtomCrossSection(this,other.boundAtomCrossSection), + selfScatteringKernel(this,other.selfScatteringKernel), + T_effective(this,other.T_effective) + { + Component::finish(other); + } + + // move + ScatteringAtom(ScatteringAtom &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + pid(this,std::move(other.pid)), + numberPerMolecule(this,std::move(other.numberPerMolecule)), + primaryScatterer(this,std::move(other.primaryScatterer)), + mass(this,std::move(other.mass)), + e_critical(this,std::move(other.e_critical)), + e_max(this,std::move(other.e_max)), + boundAtomCrossSection(this,std::move(other.boundAtomCrossSection)), + selfScatteringKernel(this,std::move(other.selfScatteringKernel)), + T_effective(this,std::move(other.T_effective)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ScatteringAtom &operator=(const ScatteringAtom &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + pid = other.pid; + numberPerMolecule = other.numberPerMolecule; + primaryScatterer = other.primaryScatterer; + mass = other.mass; + e_critical = other.e_critical; + e_max = other.e_max; + boundAtomCrossSection = other.boundAtomCrossSection; + selfScatteringKernel = other.selfScatteringKernel; + T_effective = other.T_effective; + } + return *this; + } + + // move + ScatteringAtom &operator=(ScatteringAtom &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + pid = std::move(other.pid); + numberPerMolecule = std::move(other.numberPerMolecule); + primaryScatterer = std::move(other.primaryScatterer); + mass = std::move(other.mass); + e_critical = std::move(other.e_critical); + e_max = std::move(other.e_max); + boundAtomCrossSection = std::move(other.boundAtomCrossSection); + selfScatteringKernel = std::move(other.selfScatteringKernel); + T_effective = std::move(other.T_effective); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ScatteringAtom/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ScatteringAtom + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtom/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtom/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtom/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtoms.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtoms.hpp new file mode 100644 index 000000000..cd595ccdf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtoms.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SCATTERINGATOMS +#define GNDS_V2_0_GENERAL_SCATTERINGATOMS + +#include "GNDS/v2.0/general/ScatteringAtom.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ScatteringAtoms +// ----------------------------------------------------------------------------- + +class ScatteringAtoms : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ScatteringAtoms"; } + static auto NODENAME() { return "scatteringAtoms"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("scatteringAtom") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "scatteringAtom" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "scattering_atom" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + scatteringAtom{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->scatteringAtom \ + ) + + // default + ScatteringAtoms() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ScatteringAtoms( + const wrapper> + &scatteringAtom + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + scatteringAtom(this,scatteringAtom) + { + Component::finish(); + } + + // from node + explicit ScatteringAtoms(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringAtoms(const ScatteringAtoms &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + scatteringAtom(this,other.scatteringAtom) + { + Component::finish(other); + } + + // move + ScatteringAtoms(ScatteringAtoms &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + scatteringAtom(this,std::move(other.scatteringAtom)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ScatteringAtoms &operator=(const ScatteringAtoms &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + scatteringAtom = other.scatteringAtom; + } + return *this; + } + + // move + ScatteringAtoms &operator=(ScatteringAtoms &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + scatteringAtom = std::move(other.scatteringAtom); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ScatteringAtoms/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ScatteringAtoms + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtoms/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtoms/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringAtoms/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringFactor.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringFactor.hpp new file mode 100644 index 000000000..933fdaab4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringFactor.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SCATTERINGFACTOR +#define GNDS_V2_0_GENERAL_SCATTERINGFACTOR + +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ScatteringFactor +// ----------------------------------------------------------------------------- + +class ScatteringFactor : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ScatteringFactor"; } + static auto NODENAME() { return "scatteringFactor"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + ScatteringFactor() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ScatteringFactor( + const wrapper + &XYs1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit ScatteringFactor(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringFactor(const ScatteringFactor &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + ScatteringFactor(ScatteringFactor &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ScatteringFactor &operator=(const ScatteringFactor &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + ScatteringFactor &operator=(ScatteringFactor &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ScatteringFactor/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ScatteringFactor + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringFactor/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringFactor/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringFactor/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringRadius.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringRadius.hpp new file mode 100644 index 000000000..d1ec391fb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringRadius.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SCATTERINGRADIUS +#define GNDS_V2_0_GENERAL_SCATTERINGRADIUS + +#include "GNDS/v2.0/general/Constant1d.hpp" +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ScatteringRadius +// ----------------------------------------------------------------------------- + +class ScatteringRadius : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ScatteringRadius"; } + static auto NODENAME() { return "scatteringRadius"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("constant1d") | + --Child> + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "constant1d", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "constant1d", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + constant1d{this}; + Field> + XYs1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->constant1d, \ + this->XYs1d \ + ) + + // default + ScatteringRadius() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ScatteringRadius( + const wrapper> + &constant1d, + const wrapper> + &XYs1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + constant1d(this,constant1d), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit ScatteringRadius(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ScatteringRadius(const ScatteringRadius &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + constant1d(this,other.constant1d), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + ScatteringRadius(ScatteringRadius &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + constant1d(this,std::move(other.constant1d)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ScatteringRadius &operator=(const ScatteringRadius &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + constant1d = other.constant1d; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + ScatteringRadius &operator=(ScatteringRadius &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + constant1d = std::move(other.constant1d); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ScatteringRadius/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ScatteringRadius + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringRadius/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringRadius/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ScatteringRadius/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SelfScatteringKernel.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SelfScatteringKernel.hpp new file mode 100644 index 000000000..c32f25970 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SelfScatteringKernel.hpp @@ -0,0 +1,227 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SELFSCATTERINGKERNEL +#define GNDS_V2_0_GENERAL_SELFSCATTERINGKERNEL + +#include "GNDS/v2.0/general/Gridded3d.hpp" +#include "GNDS/v2.0/general/SCTApproximation.hpp" +#include "GNDS/v2.0/general/FreeGasApproximation.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class SelfScatteringKernel +// ----------------------------------------------------------------------------- + +class SelfScatteringKernel : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "SelfScatteringKernel"; } + static auto NODENAME() { return "selfScatteringKernel"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("symmetric") | + + // children + --Child> + ("gridded3d") | + --Child> + ("SCTApproximation") | + --Child> + ("freeGasApproximation") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "symmetric", + "gridded3d", + "SCTApproximation", + "freeGasApproximation" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "symmetric", + "gridded3d", + "sctapproximation", + "free_gas_approximation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + symmetric{this}; + + // children + Field> + gridded3d{this}; + Field> + SCTApproximation{this}; + Field> + freeGasApproximation{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->symmetric, \ + this->gridded3d, \ + this->SCTApproximation, \ + this->freeGasApproximation \ + ) + + // default + SelfScatteringKernel() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SelfScatteringKernel( + const wrapper> + &symmetric, + const wrapper> + &gridded3d = {}, + const wrapper> + &SCTApproximation = {}, + const wrapper> + &freeGasApproximation = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + symmetric(this,symmetric), + gridded3d(this,gridded3d), + SCTApproximation(this,SCTApproximation), + freeGasApproximation(this,freeGasApproximation) + { + Component::finish(); + } + + // from node + explicit SelfScatteringKernel(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SelfScatteringKernel(const SelfScatteringKernel &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + symmetric(this,other.symmetric), + gridded3d(this,other.gridded3d), + SCTApproximation(this,other.SCTApproximation), + freeGasApproximation(this,other.freeGasApproximation) + { + Component::finish(other); + } + + // move + SelfScatteringKernel(SelfScatteringKernel &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + symmetric(this,std::move(other.symmetric)), + gridded3d(this,std::move(other.gridded3d)), + SCTApproximation(this,std::move(other.SCTApproximation)), + freeGasApproximation(this,std::move(other.freeGasApproximation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + SelfScatteringKernel &operator=(const SelfScatteringKernel &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + symmetric = other.symmetric; + gridded3d = other.gridded3d; + SCTApproximation = other.SCTApproximation; + freeGasApproximation = other.freeGasApproximation; + } + return *this; + } + + // move + SelfScatteringKernel &operator=(SelfScatteringKernel &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + symmetric = std::move(other.symmetric); + gridded3d = std::move(other.gridded3d); + SCTApproximation = std::move(other.SCTApproximation); + freeGasApproximation = std::move(other.freeGasApproximation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/SelfScatteringKernel/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class SelfScatteringKernel + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SelfScatteringKernel/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SelfScatteringKernel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SelfScatteringKernel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Shell.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Shell.hpp new file mode 100644 index 000000000..79decc8b8 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Shell.hpp @@ -0,0 +1,211 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SHELL +#define GNDS_V2_0_GENERAL_SHELL + +#include "GNDS/v2.0/general/Uncertainty.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Shell +// ----------------------------------------------------------------------------- + +class Shell : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Shell"; } + static auto NODENAME() { return "shell"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + double{} + / Meta<>("value") | + + // children + --Child> + ("uncertainty") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "uncertainty" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + value{this}; + + // children + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->uncertainty \ + ) + + // default + Shell() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Shell( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper> + &uncertainty = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Shell(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Shell(const Shell &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Shell(Shell &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + value(this,std::move(other.value)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Shell &operator=(const Shell &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + Shell &operator=(Shell &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + value = std::move(other.value); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Shell/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Shell + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Shell/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Shell/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Shell/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ShortRangeSelfScalingVariance.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ShortRangeSelfScalingVariance.hpp new file mode 100644 index 000000000..15d227ff6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ShortRangeSelfScalingVariance.hpp @@ -0,0 +1,234 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SHORTRANGESELFSCALINGVARIANCE +#define GNDS_V2_0_GENERAL_SHORTRANGESELFSCALINGVARIANCE + +#include "GNDS/v2.0/general/Gridded2d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ShortRangeSelfScalingVariance +// ----------------------------------------------------------------------------- + +class ShortRangeSelfScalingVariance : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ShortRangeSelfScalingVariance"; } + static auto NODENAME() { return "shortRangeSelfScalingVariance"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("type") | + std::string{} + / Meta<>("dependenceOnProcessedGroupWidth") | + + // children + --Child + ("gridded2d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "type", + "dependenceOnProcessedGroupWidth", + "gridded2d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "type", + "dependence_on_processed_group_width", + "gridded2d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + type{this}; + Field + dependenceOnProcessedGroupWidth{this}; + + // children + Field + gridded2d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(gridded2d(),array); + NJOY_GNDSTK_SHORTCUT(gridded2d(),axes); + NJOY_GNDSTK_SHORTCUT(gridded2d().axes(),axis); + NJOY_GNDSTK_SHORTCUT(gridded2d().axes(),grid); + NJOY_GNDSTK_SHORTCUT(gridded2d().array(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->type, \ + this->dependenceOnProcessedGroupWidth, \ + this->gridded2d \ + ) + + // default + ShortRangeSelfScalingVariance() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ShortRangeSelfScalingVariance( + const wrapper + &label, + const wrapper + &type = {}, + const wrapper + &dependenceOnProcessedGroupWidth = {}, + const wrapper + &gridded2d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + type(this,type), + dependenceOnProcessedGroupWidth(this,dependenceOnProcessedGroupWidth), + gridded2d(this,gridded2d) + { + Component::finish(); + } + + // from node + explicit ShortRangeSelfScalingVariance(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ShortRangeSelfScalingVariance(const ShortRangeSelfScalingVariance &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + type(this,other.type), + dependenceOnProcessedGroupWidth(this,other.dependenceOnProcessedGroupWidth), + gridded2d(this,other.gridded2d) + { + Component::finish(other); + } + + // move + ShortRangeSelfScalingVariance(ShortRangeSelfScalingVariance &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + type(this,std::move(other.type)), + dependenceOnProcessedGroupWidth(this,std::move(other.dependenceOnProcessedGroupWidth)), + gridded2d(this,std::move(other.gridded2d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ShortRangeSelfScalingVariance &operator=(const ShortRangeSelfScalingVariance &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + type = other.type; + dependenceOnProcessedGroupWidth = other.dependenceOnProcessedGroupWidth; + gridded2d = other.gridded2d; + } + return *this; + } + + // move + ShortRangeSelfScalingVariance &operator=(ShortRangeSelfScalingVariance &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + type = std::move(other.type); + dependenceOnProcessedGroupWidth = std::move(other.dependenceOnProcessedGroupWidth); + gridded2d = std::move(other.gridded2d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ShortRangeSelfScalingVariance/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ShortRangeSelfScalingVariance + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ShortRangeSelfScalingVariance/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ShortRangeSelfScalingVariance/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ShortRangeSelfScalingVariance/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SimpleMaxwellianFission.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SimpleMaxwellianFission.hpp new file mode 100644 index 000000000..a3478ab5b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SimpleMaxwellianFission.hpp @@ -0,0 +1,200 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SIMPLEMAXWELLIANFISSION +#define GNDS_V2_0_GENERAL_SIMPLEMAXWELLIANFISSION + +#include "GNDS/v2.0/general/U.hpp" +#include "GNDS/v2.0/general/Theta.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class SimpleMaxwellianFission +// ----------------------------------------------------------------------------- + +class SimpleMaxwellianFission : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "SimpleMaxwellianFission"; } + static auto NODENAME() { return "simpleMaxwellianFission"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("U") | + --Child + ("theta") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "U", + "theta" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "u", + "theta" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + U{this}; + Field + theta{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(theta(),XYs1d); + NJOY_GNDSTK_SHORTCUT(theta(),regions1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->U, \ + this->theta \ + ) + + // default + SimpleMaxwellianFission() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SimpleMaxwellianFission( + const wrapper + &U, + const wrapper + &theta = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + U(this,U), + theta(this,theta) + { + Component::finish(); + } + + // from node + explicit SimpleMaxwellianFission(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SimpleMaxwellianFission(const SimpleMaxwellianFission &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + U(this,other.U), + theta(this,other.theta) + { + Component::finish(other); + } + + // move + SimpleMaxwellianFission(SimpleMaxwellianFission &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + U(this,std::move(other.U)), + theta(this,std::move(other.theta)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + SimpleMaxwellianFission &operator=(const SimpleMaxwellianFission &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + U = other.U; + theta = other.theta; + } + return *this; + } + + // move + SimpleMaxwellianFission &operator=(SimpleMaxwellianFission &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + U = std::move(other.U); + theta = std::move(other.theta); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/SimpleMaxwellianFission/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class SimpleMaxwellianFission + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SimpleMaxwellianFission/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SimpleMaxwellianFission/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SimpleMaxwellianFission/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slice.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slice.hpp new file mode 100644 index 000000000..3f97e2182 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slice.hpp @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SLICE +#define GNDS_V2_0_GENERAL_SLICE + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Slice +// ----------------------------------------------------------------------------- + +class Slice : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Slice"; } + static auto NODENAME() { return "slice"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + int{} + / Meta<>("dimension") | + std::optional{} + / Meta<>("domainValue") | + std::optional{} + / Meta<>("domainMin") | + std::optional{} + / Meta<>("domainMax") | + std::optional{} + / Meta<>("domainUnit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "dimension", + "domainValue", + "domainMin", + "domainMax", + "domainUnit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "dimension", + "domain_value", + "domain_min", + "domain_max", + "domain_unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + dimension{this}; + Field> + domainValue{this}; + Field> + domainMin{this}; + Field> + domainMax{this}; + Field> + domainUnit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->dimension, \ + this->domainValue, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit \ + ) + + // default + Slice() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Slice( + const wrapper + &dimension, + const wrapper> + &domainValue = {}, + const wrapper> + &domainMin = {}, + const wrapper> + &domainMax = {}, + const wrapper> + &domainUnit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + dimension(this,dimension), + domainValue(this,domainValue), + domainMin(this,domainMin), + domainMax(this,domainMax), + domainUnit(this,domainUnit) + { + Component::finish(); + } + + // from node + explicit Slice(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Slice(const Slice &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + dimension(this,other.dimension), + domainValue(this,other.domainValue), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + domainUnit(this,other.domainUnit) + { + Component::finish(other); + } + + // move + Slice(Slice &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + dimension(this,std::move(other.dimension)), + domainValue(this,std::move(other.domainValue)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + domainUnit(this,std::move(other.domainUnit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Slice &operator=(const Slice &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + dimension = other.dimension; + domainValue = other.domainValue; + domainMin = other.domainMin; + domainMax = other.domainMax; + domainUnit = other.domainUnit; + } + return *this; + } + + // move + Slice &operator=(Slice &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + dimension = std::move(other.dimension); + domainValue = std::move(other.domainValue); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + domainUnit = std::move(other.domainUnit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Slice/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Slice + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slice/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slice/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slice/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slices.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slices.hpp new file mode 100644 index 000000000..dc1781e4e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slices.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SLICES +#define GNDS_V2_0_GENERAL_SLICES + +#include "GNDS/v2.0/general/Slice.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Slices +// ----------------------------------------------------------------------------- + +class Slices : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Slices"; } + static auto NODENAME() { return "slices"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("slice") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "slice" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "slice" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + slice{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->slice \ + ) + + // default + Slices() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Slices( + const wrapper> + &slice + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + slice(this,slice) + { + Component::finish(); + } + + // from node + explicit Slices(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Slices(const Slices &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + slice(this,other.slice) + { + Component::finish(other); + } + + // move + Slices(Slices &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + slice(this,std::move(other.slice)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Slices &operator=(const Slices &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + slice = other.slice; + } + return *this; + } + + // move + Slices &operator=(Slices &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + slice = std::move(other.slice); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Slices/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Slices + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slices/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slices/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Slices/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectra.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectra.hpp new file mode 100644 index 000000000..d8770683e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectra.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SPECTRA +#define GNDS_V2_0_GENERAL_SPECTRA + +#include "GNDS/v2.0/general/Spectrum.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Spectra +// ----------------------------------------------------------------------------- + +class Spectra : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Spectra"; } + static auto NODENAME() { return "spectra"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("spectrum") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "spectrum" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "spectrum" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + spectrum{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->spectrum \ + ) + + // default + Spectra() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Spectra( + const wrapper> + &spectrum + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + spectrum(this,spectrum) + { + Component::finish(); + } + + // from node + explicit Spectra(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Spectra(const Spectra &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + spectrum(this,other.spectrum) + { + Component::finish(other); + } + + // move + Spectra(Spectra &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + spectrum(this,std::move(other.spectrum)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Spectra &operator=(const Spectra &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + spectrum = other.spectrum; + } + return *this; + } + + // move + Spectra &operator=(Spectra &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + spectrum = std::move(other.spectrum); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Spectra/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Spectra + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectra/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectra/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectra/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectrum.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectrum.hpp new file mode 100644 index 000000000..1f481755f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectrum.hpp @@ -0,0 +1,226 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SPECTRUM +#define GNDS_V2_0_GENERAL_SPECTRUM + +#include "GNDS/v2.0/general/Discrete.hpp" +#include "GNDS/v2.0/general/Continuum.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Spectrum +// ----------------------------------------------------------------------------- + +class Spectrum : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Spectrum"; } + static auto NODENAME() { return "spectrum"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("pid") | + + // children + ++Child + ("discrete") | + --Child> + ("continuum") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "discrete", + "continuum" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "discrete", + "continuum" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + pid{this}; + + // children + Field> + discrete{this}; + Field> + continuum{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->discrete, \ + this->continuum \ + ) + + // default + Spectrum() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Spectrum( + const wrapper + &label, + const wrapper + &pid = {}, + const wrapper> + &discrete = {}, + const wrapper> + &continuum = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,pid), + discrete(this,discrete), + continuum(this,continuum) + { + Component::finish(); + } + + // from node + explicit Spectrum(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Spectrum(const Spectrum &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + pid(this,other.pid), + discrete(this,other.discrete), + continuum(this,other.continuum) + { + Component::finish(other); + } + + // move + Spectrum(Spectrum &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + pid(this,std::move(other.pid)), + discrete(this,std::move(other.discrete)), + continuum(this,std::move(other.continuum)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Spectrum &operator=(const Spectrum &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + pid = other.pid; + discrete = other.discrete; + continuum = other.continuum; + } + return *this; + } + + // move + Spectrum &operator=(Spectrum &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + pid = std::move(other.pid); + discrete = std::move(other.discrete); + continuum = std::move(other.continuum); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Spectrum/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Spectrum + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectrum/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectrum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spectrum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spin.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spin.hpp new file mode 100644 index 000000000..55af2e13e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spin.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SPIN +#define GNDS_V2_0_GENERAL_SPIN + +#include "GNDS/v2.0/general/Fraction.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Spin +// ----------------------------------------------------------------------------- + +class Spin : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Spin"; } + static auto NODENAME() { return "spin"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("fraction") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "fraction" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "fraction" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + fraction{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->fraction \ + ) + + // default + Spin() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Spin( + const wrapper + &fraction + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + fraction(this,fraction) + { + Component::finish(); + } + + // from node + explicit Spin(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Spin(const Spin &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + fraction(this,other.fraction) + { + Component::finish(other); + } + + // move + Spin(Spin &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + fraction(this,std::move(other.fraction)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Spin &operator=(const Spin &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + fraction = other.fraction; + } + return *this; + } + + // move + Spin &operator=(Spin &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + fraction = std::move(other.fraction); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Spin/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Spin + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spin/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spin/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Spin/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroup.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroup.hpp new file mode 100644 index 000000000..d05c070fe --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroup.hpp @@ -0,0 +1,248 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SPINGROUP +#define GNDS_V2_0_GENERAL_SPINGROUP + +#include "GNDS/v2.0/general/Channels.hpp" +#include "GNDS/v2.0/general/ResonanceParameters.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class SpinGroup +// ----------------------------------------------------------------------------- + +class SpinGroup : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "SpinGroup"; } + static auto NODENAME() { return "spinGroup"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + int{} + / Meta<>("spin") | + int{} + / Meta<>("parity") | + + // children + --Child + ("channels") | + --Child + ("resonanceParameters") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "spin", + "parity", + "channels", + "resonanceParameters" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "spin", + "parity", + "channels", + "resonance_parameters" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + spin{this}; + Field + parity{this}; + + // children + Field + channels{this}; + Field + resonanceParameters{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(channels(),channel); + NJOY_GNDSTK_SHORTCUT(resonanceParameters().table(),columnHeaders); + NJOY_GNDSTK_SHORTCUT(resonanceParameters().table(),data); + NJOY_GNDSTK_SHORTCUT(resonanceParameters(),table); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->spin, \ + this->parity, \ + this->channels, \ + this->resonanceParameters \ + ) + + // default + SpinGroup() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SpinGroup( + const wrapper + &label, + const wrapper + &spin = {}, + const wrapper + &parity = {}, + const wrapper + &channels = {}, + const wrapper + &resonanceParameters = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + spin(this,spin), + parity(this,parity), + channels(this,channels), + resonanceParameters(this,resonanceParameters) + { + Component::finish(); + } + + // from node + explicit SpinGroup(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SpinGroup(const SpinGroup &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + spin(this,other.spin), + parity(this,other.parity), + channels(this,other.channels), + resonanceParameters(this,other.resonanceParameters) + { + Component::finish(other); + } + + // move + SpinGroup(SpinGroup &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + spin(this,std::move(other.spin)), + parity(this,std::move(other.parity)), + channels(this,std::move(other.channels)), + resonanceParameters(this,std::move(other.resonanceParameters)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + SpinGroup &operator=(const SpinGroup &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + spin = other.spin; + parity = other.parity; + channels = other.channels; + resonanceParameters = other.resonanceParameters; + } + return *this; + } + + // move + SpinGroup &operator=(SpinGroup &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + spin = std::move(other.spin); + parity = std::move(other.parity); + channels = std::move(other.channels); + resonanceParameters = std::move(other.resonanceParameters); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/SpinGroup/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class SpinGroup + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroup/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroup/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroup/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroups.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroups.hpp new file mode 100644 index 000000000..5b7fbfc0b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroups.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SPINGROUPS +#define GNDS_V2_0_GENERAL_SPINGROUPS + +#include "GNDS/v2.0/general/SpinGroup.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class SpinGroups +// ----------------------------------------------------------------------------- + +class SpinGroups : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "SpinGroups"; } + static auto NODENAME() { return "spinGroups"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("spinGroup") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "spinGroup" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "spin_group" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + spinGroup{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->spinGroup \ + ) + + // default + SpinGroups() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit SpinGroups( + const wrapper> + &spinGroup + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + spinGroup(this,spinGroup) + { + Component::finish(); + } + + // from node + explicit SpinGroups(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + SpinGroups(const SpinGroups &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + spinGroup(this,other.spinGroup) + { + Component::finish(other); + } + + // move + SpinGroups(SpinGroups &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + spinGroup(this,std::move(other.spinGroup)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + SpinGroups &operator=(const SpinGroups &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + spinGroup = other.spinGroup; + } + return *this; + } + + // move + SpinGroups &operator=(SpinGroups &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + spinGroup = std::move(other.spinGroup); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/SpinGroups/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class SpinGroups + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroups/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroups/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/SpinGroups/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Standard.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Standard.hpp new file mode 100644 index 000000000..51a646c71 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Standard.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_STANDARD +#define GNDS_V2_0_GENERAL_STANDARD + +#include "GNDS/v2.0/reduced/Double.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Standard +// ----------------------------------------------------------------------------- + +class Standard : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Standard"; } + static auto NODENAME() { return "standard"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("double") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "Double" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "double" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + Double{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double \ + ) + + // default + Standard() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Standard( + const wrapper + &Double + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + Double(this,Double) + { + Component::finish(); + } + + // from node + explicit Standard(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Standard(const Standard &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double) + { + Component::finish(other); + } + + // move + Standard(Standard &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + Double(this,std::move(other.Double)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Standard &operator=(const Standard &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + Double = other.Double; + } + return *this; + } + + // move + Standard &operator=(Standard &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + Double = std::move(other.Double); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Standard/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Standard + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Standard/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Standard/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Standard/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/String.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/String.hpp new file mode 100644 index 000000000..d6f81b6b5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/String.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_STRING +#define GNDS_V2_0_GENERAL_STRING + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class String +// ----------------------------------------------------------------------------- + +class String : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "String"; } + static auto NODENAME() { return "string"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("value") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "value", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + value{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->value, \ + this->unit \ + ) + + // default + String() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit String( + const wrapper + &label, + const wrapper + &value = {}, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit String(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + String(const String &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + String(String &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + String &operator=(const String &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + value = other.value; + unit = other.unit; + } + return *this; + } + + // move + String &operator=(String &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + value = std::move(other.value); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/String/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class String + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/String/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/String/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/String/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Styles.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Styles.hpp new file mode 100644 index 000000000..497419775 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Styles.hpp @@ -0,0 +1,206 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_STYLES +#define GNDS_V2_0_GENERAL_STYLES + +#include "GNDS/v2.0/general/Evaluated.hpp" +#include "GNDS/v2.0/general/CrossSectionReconstructed.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Styles +// ----------------------------------------------------------------------------- + +class Styles : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Styles"; } + static auto NODENAME() { return "styles"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("evaluated") | + --Child> + ("crossSectionReconstructed") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "evaluated", + "crossSectionReconstructed" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "evaluated", + "cross_section_reconstructed" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + evaluated{this}; + Field> + crossSectionReconstructed{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(evaluated().documentation(),authors); + NJOY_GNDSTK_SHORTCUT(evaluated().documentation(),body); + NJOY_GNDSTK_SHORTCUT(evaluated().documentation(),dates); + NJOY_GNDSTK_SHORTCUT(evaluated(),documentation); + NJOY_GNDSTK_SHORTCUT(evaluated().documentation(),endfCompatible); + NJOY_GNDSTK_SHORTCUT(evaluated(),projectileEnergyDomain); + NJOY_GNDSTK_SHORTCUT(evaluated(),temperature); + NJOY_GNDSTK_SHORTCUT(evaluated().documentation(),title); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->evaluated, \ + this->crossSectionReconstructed \ + ) + + // default + Styles() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Styles( + const wrapper + &evaluated, + const wrapper> + &crossSectionReconstructed = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + evaluated(this,evaluated), + crossSectionReconstructed(this,crossSectionReconstructed) + { + Component::finish(); + } + + // from node + explicit Styles(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Styles(const Styles &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + evaluated(this,other.evaluated), + crossSectionReconstructed(this,other.crossSectionReconstructed) + { + Component::finish(other); + } + + // move + Styles(Styles &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + evaluated(this,std::move(other.evaluated)), + crossSectionReconstructed(this,std::move(other.crossSectionReconstructed)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Styles &operator=(const Styles &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + evaluated = other.evaluated; + crossSectionReconstructed = other.crossSectionReconstructed; + } + return *this; + } + + // move + Styles &operator=(Styles &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + evaluated = std::move(other.evaluated); + crossSectionReconstructed = std::move(other.crossSectionReconstructed); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Styles/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Styles + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Styles/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Styles/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Styles/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sum.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sum.hpp new file mode 100644 index 000000000..a7e1a3dd2 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sum.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SUM +#define GNDS_V2_0_GENERAL_SUM + +#include "GNDS/v2.0/general/Summand.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Sum +// ----------------------------------------------------------------------------- + +class Sum : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Sum"; } + static auto NODENAME() { return "sum"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("domainMin") | + std::optional{} + / Meta<>("domainMax") | + std::optional{} + / Meta<>("domainUnit") | + + // children + ++Child + ("summand") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "domainMin", + "domainMax", + "domainUnit", + "summand" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "domain_min", + "domain_max", + "domain_unit", + "summand" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + domainMin{this}; + Field> + domainMax{this}; + Field> + domainUnit{this}; + + // children + Field> + summand{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit, \ + this->summand \ + ) + + // default + Sum() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Sum( + const wrapper> + &label, + const wrapper> + &domainMin = {}, + const wrapper> + &domainMax = {}, + const wrapper> + &domainUnit = {}, + const wrapper> + &summand = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + domainMin(this,domainMin), + domainMax(this,domainMax), + domainUnit(this,domainUnit), + summand(this,summand) + { + Component::finish(); + } + + // from node + explicit Sum(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Sum(const Sum &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + domainUnit(this,other.domainUnit), + summand(this,other.summand) + { + Component::finish(other); + } + + // move + Sum(Sum &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + domainUnit(this,std::move(other.domainUnit)), + summand(this,std::move(other.summand)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Sum &operator=(const Sum &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + domainMin = other.domainMin; + domainMax = other.domainMax; + domainUnit = other.domainUnit; + summand = other.summand; + } + return *this; + } + + // move + Sum &operator=(Sum &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + domainUnit = std::move(other.domainUnit); + summand = std::move(other.summand); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Sum/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Sum + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sum/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sum/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sum/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summand.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summand.hpp new file mode 100644 index 000000000..3c3a3bbab --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summand.hpp @@ -0,0 +1,207 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SUMMAND +#define GNDS_V2_0_GENERAL_SUMMAND + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Summand +// ----------------------------------------------------------------------------- + +class Summand : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Summand"; } + static auto NODENAME() { return "summand"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("ENDF_MFMT") | + std::optional{} + / Meta<>("coefficient") | + std::optional{} + / Meta<>("href") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "ENDF_MFMT", + "coefficient", + "href" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "endf_mfmt", + "coefficient", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + ENDF_MFMT{this}; + Field> + coefficient{this}; + Field> + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->ENDF_MFMT, \ + this->coefficient, \ + this->href \ + ) + + // default + Summand() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Summand( + const wrapper> + &ENDF_MFMT, + const wrapper> + &coefficient = {}, + const wrapper> + &href = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + ENDF_MFMT(this,ENDF_MFMT), + coefficient(this,coefficient), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Summand(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Summand(const Summand &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + ENDF_MFMT(this,other.ENDF_MFMT), + coefficient(this,other.coefficient), + href(this,other.href) + { + Component::finish(other); + } + + // move + Summand(Summand &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + ENDF_MFMT(this,std::move(other.ENDF_MFMT)), + coefficient(this,std::move(other.coefficient)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Summand &operator=(const Summand &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + ENDF_MFMT = other.ENDF_MFMT; + coefficient = other.coefficient; + href = other.href; + } + return *this; + } + + // move + Summand &operator=(Summand &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + ENDF_MFMT = std::move(other.ENDF_MFMT); + coefficient = std::move(other.coefficient); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Summand/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Summand + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summand/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summand/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summand/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summands.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summands.hpp new file mode 100644 index 000000000..df9cffc53 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summands.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SUMMANDS +#define GNDS_V2_0_GENERAL_SUMMANDS + +#include "GNDS/v2.0/general/Add.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Summands +// ----------------------------------------------------------------------------- + +class Summands : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Summands"; } + static auto NODENAME() { return "summands"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("add") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "add" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "add" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + add{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->add \ + ) + + // default + Summands() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Summands( + const wrapper> + &add + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + add(this,add) + { + Component::finish(); + } + + // from node + explicit Summands(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Summands(const Summands &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + add(this,other.add) + { + Component::finish(other); + } + + // move + Summands(Summands &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + add(this,std::move(other.add)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Summands &operator=(const Summands &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + add = other.add; + } + return *this; + } + + // move + Summands &operator=(Summands &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + add = std::move(other.add); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Summands/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Summands + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summands/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summands/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Summands/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sums.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sums.hpp new file mode 100644 index 000000000..4a573eb20 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sums.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_SUMS +#define GNDS_V2_0_GENERAL_SUMS + +#include "GNDS/v2.0/general/CrossSectionSums.hpp" +#include "GNDS/v2.0/general/MultiplicitySums.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Sums +// ----------------------------------------------------------------------------- + +class Sums : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Sums"; } + static auto NODENAME() { return "sums"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("crossSectionSums") | + --Child> + ("multiplicitySums") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "crossSectionSums", + "multiplicitySums" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "cross_section_sums", + "multiplicity_sums" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + crossSectionSums{this}; + Field> + multiplicitySums{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->crossSectionSums, \ + this->multiplicitySums \ + ) + + // default + Sums() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Sums( + const wrapper> + &crossSectionSums, + const wrapper> + &multiplicitySums = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + crossSectionSums(this,crossSectionSums), + multiplicitySums(this,multiplicitySums) + { + Component::finish(); + } + + // from node + explicit Sums(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Sums(const Sums &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + crossSectionSums(this,other.crossSectionSums), + multiplicitySums(this,other.multiplicitySums) + { + Component::finish(other); + } + + // move + Sums(Sums &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + crossSectionSums(this,std::move(other.crossSectionSums)), + multiplicitySums(this,std::move(other.multiplicitySums)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Sums &operator=(const Sums &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + crossSectionSums = other.crossSectionSums; + multiplicitySums = other.multiplicitySums; + } + return *this; + } + + // move + Sums &operator=(Sums &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + crossSectionSums = std::move(other.crossSectionSums); + multiplicitySums = std::move(other.multiplicitySums); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Sums/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Sums + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sums/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sums/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Sums/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_M.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_M.hpp new file mode 100644 index 000000000..17b359ac1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_M.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_T_M +#define GNDS_V2_0_GENERAL_T_M + +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class T_M +// ----------------------------------------------------------------------------- + +class T_M : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "T_M"; } + static auto NODENAME() { return "T_M"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + T_M() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit T_M( + const wrapper + &XYs1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit T_M(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + T_M(const T_M &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + T_M(T_M &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + T_M &operator=(const T_M &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + T_M &operator=(T_M &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/T_M/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class T_M + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_M/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_M/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_M/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_effective.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_effective.hpp new file mode 100644 index 000000000..fc4f203d5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_effective.hpp @@ -0,0 +1,186 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_T_EFFECTIVE +#define GNDS_V2_0_GENERAL_T_EFFECTIVE + +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class T_effective +// ----------------------------------------------------------------------------- + +class T_effective : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "T_effective"; } + static auto NODENAME() { return "T_effective"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d \ + ) + + // default + T_effective() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit T_effective( + const wrapper + &XYs1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit T_effective(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + T_effective(const T_effective &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + T_effective(T_effective &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + T_effective &operator=(const T_effective &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + T_effective &operator=(T_effective &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/T_effective/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class T_effective + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_effective/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_effective/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/T_effective/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Table.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Table.hpp new file mode 100644 index 000000000..cde50078f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Table.hpp @@ -0,0 +1,231 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_TABLE +#define GNDS_V2_0_GENERAL_TABLE + +#include "GNDS/v2.0/general/ColumnHeaders.hpp" +#include "GNDS/v2.0/general/Data.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Table +// ----------------------------------------------------------------------------- + +class Table : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Table"; } + static auto NODENAME() { return "table"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + int{} + / Meta<>("rows") | + int{} + / Meta<>("columns") | + + // children + --Child + ("columnHeaders") | + --Child + ("data") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "rows", + "columns", + "columnHeaders", + "data" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "rows", + "columns", + "column_headers", + "data" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + rows{this}; + Field + columns{this}; + + // children + Field + columnHeaders{this}; + Field + data{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(columnHeaders(),column); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->rows, \ + this->columns, \ + this->columnHeaders, \ + this->data \ + ) + + // default + Table() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Table( + const wrapper + &rows, + const wrapper + &columns = {}, + const wrapper + &columnHeaders = {}, + const wrapper + &data = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + rows(this,rows), + columns(this,columns), + columnHeaders(this,columnHeaders), + data(this,data) + { + Component::finish(); + } + + // from node + explicit Table(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Table(const Table &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + rows(this,other.rows), + columns(this,other.columns), + columnHeaders(this,other.columnHeaders), + data(this,other.data) + { + Component::finish(other); + } + + // move + Table(Table &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + rows(this,std::move(other.rows)), + columns(this,std::move(other.columns)), + columnHeaders(this,std::move(other.columnHeaders)), + data(this,std::move(other.data)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Table &operator=(const Table &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + rows = other.rows; + columns = other.columns; + columnHeaders = other.columnHeaders; + data = other.data; + } + return *this; + } + + // move + Table &operator=(Table &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + rows = std::move(other.rows); + columns = std::move(other.columns); + columnHeaders = std::move(other.columnHeaders); + data = std::move(other.data); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Table/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Table + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Table/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Table/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Table/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TabulatedWidths.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TabulatedWidths.hpp new file mode 100644 index 000000000..4b313dd4f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TabulatedWidths.hpp @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_TABULATEDWIDTHS +#define GNDS_V2_0_GENERAL_TABULATEDWIDTHS + +#include "GNDS/v2.0/general/ResonanceReactions.hpp" +#include "GNDS/v2.0/general/Ls.hpp" +#include "GNDS/v2.0/top/PoPs.hpp" +#include "GNDS/v2.0/general/ScatteringRadius.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class TabulatedWidths +// ----------------------------------------------------------------------------- + +class TabulatedWidths : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "TabulatedWidths"; } + static auto NODENAME() { return "tabulatedWidths"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("approximation") | + std::optional{} + / Meta<>("useForSelfShieldingOnly") | + + // children + --Child + ("resonanceReactions") | + --Child + ("Ls") | + --Child> + ("PoPs") | + --Child> + ("scatteringRadius") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "approximation", + "useForSelfShieldingOnly", + "resonanceReactions", + "Ls", + "PoPs", + "scatteringRadius" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "approximation", + "use_for_self_shielding_only", + "resonance_reactions", + "ls", + "po_ps", + "scattering_radius" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + approximation{this}; + Field> + useForSelfShieldingOnly{this}; + + // children + Field + resonanceReactions{this}; + Field + Ls{this}; + Field> + PoPs{this}; + Field> + scatteringRadius{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(Ls(),L); + NJOY_GNDSTK_SHORTCUT(resonanceReactions(),resonanceReaction); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->approximation, \ + this->useForSelfShieldingOnly, \ + this->resonanceReactions, \ + this->Ls, \ + this->PoPs, \ + this->scatteringRadius \ + ) + + // default + TabulatedWidths() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit TabulatedWidths( + const wrapper + &label, + const wrapper + &approximation = {}, + const wrapper> + &useForSelfShieldingOnly = {}, + const wrapper + &resonanceReactions = {}, + const wrapper + &Ls = {}, + const wrapper> + &PoPs = {}, + const wrapper> + &scatteringRadius = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + approximation(this,approximation), + useForSelfShieldingOnly(this,useForSelfShieldingOnly), + resonanceReactions(this,resonanceReactions), + Ls(this,Ls), + PoPs(this,PoPs), + scatteringRadius(this,scatteringRadius) + { + Component::finish(); + } + + // from node + explicit TabulatedWidths(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + TabulatedWidths(const TabulatedWidths &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + approximation(this,other.approximation), + useForSelfShieldingOnly(this,other.useForSelfShieldingOnly), + resonanceReactions(this,other.resonanceReactions), + Ls(this,other.Ls), + PoPs(this,other.PoPs), + scatteringRadius(this,other.scatteringRadius) + { + Component::finish(other); + } + + // move + TabulatedWidths(TabulatedWidths &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + approximation(this,std::move(other.approximation)), + useForSelfShieldingOnly(this,std::move(other.useForSelfShieldingOnly)), + resonanceReactions(this,std::move(other.resonanceReactions)), + Ls(this,std::move(other.Ls)), + PoPs(this,std::move(other.PoPs)), + scatteringRadius(this,std::move(other.scatteringRadius)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + TabulatedWidths &operator=(const TabulatedWidths &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + approximation = other.approximation; + useForSelfShieldingOnly = other.useForSelfShieldingOnly; + resonanceReactions = other.resonanceReactions; + Ls = other.Ls; + PoPs = other.PoPs; + scatteringRadius = other.scatteringRadius; + } + return *this; + } + + // move + TabulatedWidths &operator=(TabulatedWidths &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + approximation = std::move(other.approximation); + useForSelfShieldingOnly = std::move(other.useForSelfShieldingOnly); + resonanceReactions = std::move(other.resonanceReactions); + Ls = std::move(other.Ls); + PoPs = std::move(other.PoPs); + scatteringRadius = std::move(other.scatteringRadius); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/TabulatedWidths/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class TabulatedWidths + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TabulatedWidths/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TabulatedWidths/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TabulatedWidths/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Temperature.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Temperature.hpp new file mode 100644 index 000000000..a1c21e93e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Temperature.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_TEMPERATURE +#define GNDS_V2_0_GENERAL_TEMPERATURE + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Temperature +// ----------------------------------------------------------------------------- + +class Temperature : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Temperature"; } + static auto NODENAME() { return "temperature"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + Temperature() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Temperature( + const wrapper + &value, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit Temperature(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Temperature(const Temperature &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + Temperature(Temperature &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Temperature &operator=(const Temperature &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + unit = other.unit; + } + return *this; + } + + // move + Temperature &operator=(Temperature &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Temperature/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Temperature + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Temperature/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Temperature/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Temperature/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw.hpp new file mode 100644 index 000000000..a17d69166 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW +#define GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ThermalNeutronScatteringLaw +// ----------------------------------------------------------------------------- + +class ThermalNeutronScatteringLaw : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ThermalNeutronScatteringLaw"; } + static auto NODENAME() { return "thermalNeutronScatteringLaw"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("href") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "href" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href \ + ) + + // default + ThermalNeutronScatteringLaw() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ThermalNeutronScatteringLaw( + const wrapper + &label, + const wrapper + &href = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href) + { + Component::finish(); + } + + // from node + explicit ThermalNeutronScatteringLaw(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw(const ThermalNeutronScatteringLaw &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href) + { + Component::finish(other); + } + + // move + ThermalNeutronScatteringLaw(ThermalNeutronScatteringLaw &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ThermalNeutronScatteringLaw &operator=(const ThermalNeutronScatteringLaw &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + href = other.href; + } + return *this; + } + + // move + ThermalNeutronScatteringLaw &operator=(ThermalNeutronScatteringLaw &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ThermalNeutronScatteringLaw/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw1d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw1d.hpp new file mode 100644 index 000000000..64ce76088 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw1d.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW1D +#define GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW1D + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ThermalNeutronScatteringLaw1d +// ----------------------------------------------------------------------------- + +class ThermalNeutronScatteringLaw1d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ThermalNeutronScatteringLaw1d"; } + static auto NODENAME() { return "thermalNeutronScatteringLaw1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("href") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "href" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "href" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + href{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->href \ + ) + + // default + ThermalNeutronScatteringLaw1d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ThermalNeutronScatteringLaw1d( + const wrapper + &label, + const wrapper + &href = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + href(this,href) + { + Component::finish(); + } + + // from node + explicit ThermalNeutronScatteringLaw1d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw1d(const ThermalNeutronScatteringLaw1d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + href(this,other.href) + { + Component::finish(other); + } + + // move + ThermalNeutronScatteringLaw1d(ThermalNeutronScatteringLaw1d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ThermalNeutronScatteringLaw1d &operator=(const ThermalNeutronScatteringLaw1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + href = other.href; + } + return *this; + } + + // move + ThermalNeutronScatteringLaw1d &operator=(ThermalNeutronScatteringLaw1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw1d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp new file mode 100644 index 000000000..5b24023bf --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic.hpp @@ -0,0 +1,232 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_COHERENTELASTIC +#define GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_COHERENTELASTIC + +#include "GNDS/v2.0/general/S_table.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ThermalNeutronScatteringLaw_coherentElastic +// ----------------------------------------------------------------------------- + +class ThermalNeutronScatteringLaw_coherentElastic : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ThermalNeutronScatteringLaw_coherentElastic"; } + static auto NODENAME() { return "thermalNeutronScatteringLaw_coherentElastic"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("pid") | + std::string{} + / Meta<>("productFrame") | + + // children + --Child + ("S_table") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "productFrame", + "S_table" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "product_frame", + "s_table" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + pid{this}; + Field + productFrame{this}; + + // children + Field + S_table{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(S_table().gridded2d(),array); + NJOY_GNDSTK_SHORTCUT(S_table().gridded2d(),axes); + NJOY_GNDSTK_SHORTCUT(S_table(),gridded2d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->S_table \ + ) + + // default + ThermalNeutronScatteringLaw_coherentElastic() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ThermalNeutronScatteringLaw_coherentElastic( + const wrapper + &label, + const wrapper + &pid = {}, + const wrapper + &productFrame = {}, + const wrapper + &S_table = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,pid), + productFrame(this,productFrame), + S_table(this,S_table) + { + Component::finish(); + } + + // from node + explicit ThermalNeutronScatteringLaw_coherentElastic(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw_coherentElastic(const ThermalNeutronScatteringLaw_coherentElastic &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + pid(this,other.pid), + productFrame(this,other.productFrame), + S_table(this,other.S_table) + { + Component::finish(other); + } + + // move + ThermalNeutronScatteringLaw_coherentElastic(ThermalNeutronScatteringLaw_coherentElastic &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + pid(this,std::move(other.pid)), + productFrame(this,std::move(other.productFrame)), + S_table(this,std::move(other.S_table)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ThermalNeutronScatteringLaw_coherentElastic &operator=(const ThermalNeutronScatteringLaw_coherentElastic &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + pid = other.pid; + productFrame = other.productFrame; + S_table = other.S_table; + } + return *this; + } + + // move + ThermalNeutronScatteringLaw_coherentElastic &operator=(ThermalNeutronScatteringLaw_coherentElastic &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + pid = std::move(other.pid); + productFrame = std::move(other.productFrame); + S_table = std::move(other.S_table); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw_coherentElastic + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_coherentElastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp new file mode 100644 index 000000000..9b0805c1c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic.hpp @@ -0,0 +1,248 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTELASTIC +#define GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTELASTIC + +#include "GNDS/v2.0/general/BoundAtomCrossSection.hpp" +#include "GNDS/v2.0/general/DebyeWallerIntegral.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ThermalNeutronScatteringLaw_incoherentElastic +// ----------------------------------------------------------------------------- + +class ThermalNeutronScatteringLaw_incoherentElastic : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ThermalNeutronScatteringLaw_incoherentElastic"; } + static auto NODENAME() { return "thermalNeutronScatteringLaw_incoherentElastic"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("pid") | + std::string{} + / Meta<>("productFrame") | + + // children + --Child + ("boundAtomCrossSection") | + --Child + ("DebyeWallerIntegral") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "productFrame", + "boundAtomCrossSection", + "DebyeWallerIntegral" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "product_frame", + "bound_atom_cross_section", + "debye_waller_integral" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + pid{this}; + Field + productFrame{this}; + + // children + Field + boundAtomCrossSection{this}; + Field + DebyeWallerIntegral{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(DebyeWallerIntegral(),XYs1d); + NJOY_GNDSTK_SHORTCUT(DebyeWallerIntegral().XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(DebyeWallerIntegral().XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(DebyeWallerIntegral().XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->boundAtomCrossSection, \ + this->DebyeWallerIntegral \ + ) + + // default + ThermalNeutronScatteringLaw_incoherentElastic() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ThermalNeutronScatteringLaw_incoherentElastic( + const wrapper + &label, + const wrapper + &pid = {}, + const wrapper + &productFrame = {}, + const wrapper + &boundAtomCrossSection = {}, + const wrapper + &DebyeWallerIntegral = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,pid), + productFrame(this,productFrame), + boundAtomCrossSection(this,boundAtomCrossSection), + DebyeWallerIntegral(this,DebyeWallerIntegral) + { + Component::finish(); + } + + // from node + explicit ThermalNeutronScatteringLaw_incoherentElastic(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw_incoherentElastic(const ThermalNeutronScatteringLaw_incoherentElastic &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + pid(this,other.pid), + productFrame(this,other.productFrame), + boundAtomCrossSection(this,other.boundAtomCrossSection), + DebyeWallerIntegral(this,other.DebyeWallerIntegral) + { + Component::finish(other); + } + + // move + ThermalNeutronScatteringLaw_incoherentElastic(ThermalNeutronScatteringLaw_incoherentElastic &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + pid(this,std::move(other.pid)), + productFrame(this,std::move(other.productFrame)), + boundAtomCrossSection(this,std::move(other.boundAtomCrossSection)), + DebyeWallerIntegral(this,std::move(other.DebyeWallerIntegral)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ThermalNeutronScatteringLaw_incoherentElastic &operator=(const ThermalNeutronScatteringLaw_incoherentElastic &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + pid = other.pid; + productFrame = other.productFrame; + boundAtomCrossSection = other.boundAtomCrossSection; + DebyeWallerIntegral = other.DebyeWallerIntegral; + } + return *this; + } + + // move + ThermalNeutronScatteringLaw_incoherentElastic &operator=(ThermalNeutronScatteringLaw_incoherentElastic &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + pid = std::move(other.pid); + productFrame = std::move(other.productFrame); + boundAtomCrossSection = std::move(other.boundAtomCrossSection); + DebyeWallerIntegral = std::move(other.DebyeWallerIntegral); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw_incoherentElastic + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentElastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp new file mode 100644 index 000000000..db2846126 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic.hpp @@ -0,0 +1,258 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTINELASTIC +#define GNDS_V2_0_GENERAL_THERMALNEUTRONSCATTERINGLAW_INCOHERENTINELASTIC + +#include "GNDS/v2.0/general/ScatteringAtoms.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class ThermalNeutronScatteringLaw_incoherentInelastic +// ----------------------------------------------------------------------------- + +class ThermalNeutronScatteringLaw_incoherentInelastic : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "ThermalNeutronScatteringLaw_incoherentInelastic"; } + static auto NODENAME() { return "thermalNeutronScatteringLaw_incoherentInelastic"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("pid") | + std::string{} + / Meta<>("productFrame") | + std::string{} + / Meta<>("primaryScatterer") | + std::optional{} + / Meta<>("calculatedAtThermal") | + + // children + --Child + ("scatteringAtoms") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "productFrame", + "primaryScatterer", + "calculatedAtThermal", + "scatteringAtoms" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "product_frame", + "primary_scatterer", + "calculated_at_thermal", + "scattering_atoms" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + pid{this}; + Field + productFrame{this}; + Field + primaryScatterer{this}; + Field> + calculatedAtThermal{this}; + + // children + Field + scatteringAtoms{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(scatteringAtoms(),scatteringAtom); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->productFrame, \ + this->primaryScatterer, \ + this->calculatedAtThermal, \ + this->scatteringAtoms \ + ) + + // default + ThermalNeutronScatteringLaw_incoherentInelastic() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ThermalNeutronScatteringLaw_incoherentInelastic( + const wrapper + &label, + const wrapper + &pid = {}, + const wrapper + &productFrame = {}, + const wrapper + &primaryScatterer = {}, + const wrapper> + &calculatedAtThermal = {}, + const wrapper + &scatteringAtoms = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,pid), + productFrame(this,productFrame), + primaryScatterer(this,primaryScatterer), + calculatedAtThermal(this,calculatedAtThermal), + scatteringAtoms(this,scatteringAtoms) + { + Component::finish(); + } + + // from node + explicit ThermalNeutronScatteringLaw_incoherentInelastic(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ThermalNeutronScatteringLaw_incoherentInelastic(const ThermalNeutronScatteringLaw_incoherentInelastic &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + pid(this,other.pid), + productFrame(this,other.productFrame), + primaryScatterer(this,other.primaryScatterer), + calculatedAtThermal(this,other.calculatedAtThermal), + scatteringAtoms(this,other.scatteringAtoms) + { + Component::finish(other); + } + + // move + ThermalNeutronScatteringLaw_incoherentInelastic(ThermalNeutronScatteringLaw_incoherentInelastic &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + pid(this,std::move(other.pid)), + productFrame(this,std::move(other.productFrame)), + primaryScatterer(this,std::move(other.primaryScatterer)), + calculatedAtThermal(this,std::move(other.calculatedAtThermal)), + scatteringAtoms(this,std::move(other.scatteringAtoms)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ThermalNeutronScatteringLaw_incoherentInelastic &operator=(const ThermalNeutronScatteringLaw_incoherentInelastic &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + pid = other.pid; + productFrame = other.productFrame; + primaryScatterer = other.primaryScatterer; + calculatedAtThermal = other.calculatedAtThermal; + scatteringAtoms = other.scatteringAtoms; + } + return *this; + } + + // move + ThermalNeutronScatteringLaw_incoherentInelastic &operator=(ThermalNeutronScatteringLaw_incoherentInelastic &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + pid = std::move(other.pid); + productFrame = std::move(other.productFrame); + primaryScatterer = std::move(other.primaryScatterer); + calculatedAtThermal = std::move(other.calculatedAtThermal); + scatteringAtoms = std::move(other.scatteringAtoms); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ThermalNeutronScatteringLaw_incoherentInelastic + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/ThermalNeutronScatteringLaw_incoherentInelastic/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Theta.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Theta.hpp new file mode 100644 index 000000000..f1095cfaa --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Theta.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_THETA +#define GNDS_V2_0_GENERAL_THETA + +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/Regions1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Theta +// ----------------------------------------------------------------------------- + +class Theta : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Theta"; } + static auto NODENAME() { return "theta"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("XYs1d") | + --Child> + ("regions1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d", + "regions1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d", + "regions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + regions1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + Theta() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Theta( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit Theta(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Theta(const Theta &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + Theta(Theta &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + regions1d(this,std::move(other.regions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Theta &operator=(const Theta &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + return *this; + } + + // move + Theta &operator=(Theta &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Theta/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Theta + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Theta/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Theta/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Theta/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Time.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Time.hpp new file mode 100644 index 000000000..b0be10187 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Time.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_TIME +#define GNDS_V2_0_GENERAL_TIME + +#include "GNDS/v2.0/general/Double.hpp" +#include "GNDS/v2.0/general/String.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Time +// ----------------------------------------------------------------------------- + +class Time : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Time"; } + static auto NODENAME() { return "time"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("double") | + --Child> + ("string") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "Double", + "string" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "double", + "string" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + Double{this}; + Field> + string{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Double, \ + this->string \ + ) + + // default + Time() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Time( + const wrapper> + &Double, + const wrapper> + &string = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + Double(this,Double), + string(this,string) + { + Component::finish(); + } + + // from node + explicit Time(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Time(const Time &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Double(this,other.Double), + string(this,other.string) + { + Component::finish(other); + } + + // move + Time(Time &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + Double(this,std::move(other.Double)), + string(this,std::move(other.string)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Time &operator=(const Time &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + Double = other.Double; + string = other.string; + } + return *this; + } + + // move + Time &operator=(Time &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + Double = std::move(other.Double); + string = std::move(other.string); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Time/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Time + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Time/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Time/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Time/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Title.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Title.hpp new file mode 100644 index 000000000..65fe9158b --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Title.hpp @@ -0,0 +1,168 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_TITLE +#define GNDS_V2_0_GENERAL_TITLE + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Title +// ----------------------------------------------------------------------------- + +class Title : + public Component, + public DataNode +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Title"; } + static auto NODENAME() { return "title"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // data + --Child(special::self) / DataConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "string" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "string" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using DataNode::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // data + std::string &string = *this; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + static_cast(*this) \ + ) + + // default + Title() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Title(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Title(const Title &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Title(Title &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(std::move(other)), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Title &operator=(const Title &other) + { + if (this != &other) { + Component::operator=(other); + DataNode::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + Title &operator=(Title &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + DataNode::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Title/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Title + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Title/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Title/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Title/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TotalEnergy.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TotalEnergy.hpp new file mode 100644 index 000000000..4b77e587f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TotalEnergy.hpp @@ -0,0 +1,188 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_TOTALENERGY +#define GNDS_V2_0_GENERAL_TOTALENERGY + +#include "GNDS/v2.0/general/Polynomial1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class TotalEnergy +// ----------------------------------------------------------------------------- + +class TotalEnergy : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "TotalEnergy"; } + static auto NODENAME() { return "totalEnergy"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("polynomial1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "polynomial1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + polynomial1d{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(polynomial1d(),axes); + NJOY_GNDSTK_SHORTCUT(polynomial1d().axes(),axis); + NJOY_GNDSTK_SHORTCUT(polynomial1d().axes(),grid); + NJOY_GNDSTK_SHORTCUT(polynomial1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(polynomial1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->polynomial1d \ + ) + + // default + TotalEnergy() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit TotalEnergy( + const wrapper + &polynomial1d + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit TotalEnergy(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + TotalEnergy(const TotalEnergy &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + TotalEnergy(TotalEnergy &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + polynomial1d(this,std::move(other.polynomial1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + TotalEnergy &operator=(const TotalEnergy &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + polynomial1d = other.polynomial1d; + } + return *this; + } + + // move + TotalEnergy &operator=(TotalEnergy &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + polynomial1d = std::move(other.polynomial1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/TotalEnergy/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class TotalEnergy + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TotalEnergy/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TotalEnergy/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/TotalEnergy/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/U.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/U.hpp new file mode 100644 index 000000000..ddb2393f6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/U.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_U +#define GNDS_V2_0_GENERAL_U + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class U +// ----------------------------------------------------------------------------- + +class U : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "U"; } + static auto NODENAME() { return "U"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") | + std::string{} + / Meta<>("unit") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value", + "unit" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + Field + unit{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value, \ + this->unit \ + ) + + // default + U() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit U( + const wrapper + &value, + const wrapper + &unit = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value), + unit(this,unit) + { + Component::finish(); + } + + // from node + explicit U(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + U(const U &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value), + unit(this,other.unit) + { + Component::finish(other); + } + + // move + U(U &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)), + unit(this,std::move(other.unit)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + U &operator=(const U &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + unit = other.unit; + } + return *this; + } + + // move + U &operator=(U &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + unit = std::move(other.unit); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/U/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class U + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/U/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/U/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/U/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncertainty.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncertainty.hpp new file mode 100644 index 000000000..a408adecb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncertainty.hpp @@ -0,0 +1,224 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_UNCERTAINTY +#define GNDS_V2_0_GENERAL_UNCERTAINTY + +#include "GNDS/v2.0/general/Covariance.hpp" +#include "GNDS/v2.0/general/Standard.hpp" +#include "GNDS/v2.0/general/ListOfCovariances.hpp" +#include "GNDS/v2.0/reduced/Polynomial1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Uncertainty +// ----------------------------------------------------------------------------- + +class Uncertainty : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Uncertainty"; } + static auto NODENAME() { return "uncertainty"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("covariance") | + --Child> + ("standard") | + --Child> + ("listOfCovariances") | + --Child> + ("polynomial1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "covariance", + "standard", + "listOfCovariances", + "polynomial1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "covariance", + "standard", + "list_of_covariances", + "polynomial1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + covariance{this}; + Field> + standard{this}; + Field> + listOfCovariances{this}; + Field> + polynomial1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->covariance, \ + this->standard, \ + this->listOfCovariances, \ + this->polynomial1d \ + ) + + // default + Uncertainty() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Uncertainty( + const wrapper> + &covariance, + const wrapper> + &standard = {}, + const wrapper> + &listOfCovariances = {}, + const wrapper> + &polynomial1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + covariance(this,covariance), + standard(this,standard), + listOfCovariances(this,listOfCovariances), + polynomial1d(this,polynomial1d) + { + Component::finish(); + } + + // from node + explicit Uncertainty(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Uncertainty(const Uncertainty &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + covariance(this,other.covariance), + standard(this,other.standard), + listOfCovariances(this,other.listOfCovariances), + polynomial1d(this,other.polynomial1d) + { + Component::finish(other); + } + + // move + Uncertainty(Uncertainty &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + covariance(this,std::move(other.covariance)), + standard(this,std::move(other.standard)), + listOfCovariances(this,std::move(other.listOfCovariances)), + polynomial1d(this,std::move(other.polynomial1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Uncertainty &operator=(const Uncertainty &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + covariance = other.covariance; + standard = other.standard; + listOfCovariances = other.listOfCovariances; + polynomial1d = other.polynomial1d; + } + return *this; + } + + // move + Uncertainty &operator=(Uncertainty &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + covariance = std::move(other.covariance); + standard = std::move(other.standard); + listOfCovariances = std::move(other.listOfCovariances); + polynomial1d = std::move(other.polynomial1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Uncertainty/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Uncertainty + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncertainty/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncertainty/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncertainty/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncorrelated.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncorrelated.hpp new file mode 100644 index 000000000..879aba3c6 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncorrelated.hpp @@ -0,0 +1,240 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_UNCORRELATED +#define GNDS_V2_0_GENERAL_UNCORRELATED + +#include "GNDS/v2.0/general/Angular.hpp" +#include "GNDS/v2.0/general/Energy.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Uncorrelated +// ----------------------------------------------------------------------------- + +class Uncorrelated : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Uncorrelated"; } + static auto NODENAME() { return "uncorrelated"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("productFrame") | + + // children + --Child + ("angular") | + --Child + ("energy") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "productFrame", + "angular", + "energy" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "product_frame", + "angular", + "energy" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + productFrame{this}; + + // children + Field + angular{this}; + Field + energy{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(energy(),Double); + NJOY_GNDSTK_SHORTCUT(energy(),MadlandNix); + NJOY_GNDSTK_SHORTCUT(energy(),NBodyPhaseSpace); + NJOY_GNDSTK_SHORTCUT(energy(),discreteGamma); + NJOY_GNDSTK_SHORTCUT(energy(),evaporation); + NJOY_GNDSTK_SHORTCUT(energy(),generalEvaporation); + NJOY_GNDSTK_SHORTCUT(angular(),isotropic2d); + NJOY_GNDSTK_SHORTCUT(energy(),primaryGamma); + NJOY_GNDSTK_SHORTCUT(energy(),simpleMaxwellianFission); + NJOY_GNDSTK_SHORTCUT(energy(),weightedFunctionals); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame, \ + this->angular, \ + this->energy \ + ) + + // default + Uncorrelated() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Uncorrelated( + const wrapper + &label, + const wrapper + &productFrame = {}, + const wrapper + &angular = {}, + const wrapper + &energy = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame), + angular(this,angular), + energy(this,energy) + { + Component::finish(); + } + + // from node + explicit Uncorrelated(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Uncorrelated(const Uncorrelated &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame), + angular(this,other.angular), + energy(this,other.energy) + { + Component::finish(other); + } + + // move + Uncorrelated(Uncorrelated &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)), + angular(this,std::move(other.angular)), + energy(this,std::move(other.energy)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Uncorrelated &operator=(const Uncorrelated &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + angular = other.angular; + energy = other.energy; + } + return *this; + } + + // move + Uncorrelated &operator=(Uncorrelated &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + productFrame = std::move(other.productFrame); + angular = std::move(other.angular); + energy = std::move(other.energy); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Uncorrelated/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Uncorrelated + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncorrelated/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncorrelated/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Uncorrelated/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodox.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodox.hpp new file mode 100644 index 000000000..8f037dd23 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodox.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_UNORTHODOX +#define GNDS_V2_0_GENERAL_UNORTHODOX + +#include "GNDS/v2.0/general/Mass.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Unorthodox +// ----------------------------------------------------------------------------- + +class Unorthodox : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Unorthodox"; } + static auto NODENAME() { return "unorthodox"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("id") | + + // children + --Child + ("mass") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "id", + "mass" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "id", + "mass" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + id{this}; + + // children + Field + mass{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(mass(),Double); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->id, \ + this->mass \ + ) + + // default + Unorthodox() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unorthodox( + const wrapper + &id, + const wrapper + &mass = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + id(this,id), + mass(this,mass) + { + Component::finish(); + } + + // from node + explicit Unorthodox(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unorthodox(const Unorthodox &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + id(this,other.id), + mass(this,other.mass) + { + Component::finish(other); + } + + // move + Unorthodox(Unorthodox &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + id(this,std::move(other.id)), + mass(this,std::move(other.mass)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Unorthodox &operator=(const Unorthodox &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + id = other.id; + mass = other.mass; + } + return *this; + } + + // move + Unorthodox &operator=(Unorthodox &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + id = std::move(other.id); + mass = std::move(other.mass); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Unorthodox/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Unorthodox + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodox/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodox/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodox/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodoxes.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodoxes.hpp new file mode 100644 index 000000000..161d75617 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodoxes.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_UNORTHODOXES +#define GNDS_V2_0_GENERAL_UNORTHODOXES + +#include "GNDS/v2.0/general/Unorthodox.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Unorthodoxes +// ----------------------------------------------------------------------------- + +class Unorthodoxes : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Unorthodoxes"; } + static auto NODENAME() { return "unorthodoxes"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("unorthodox") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "unorthodox" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "unorthodox" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + unorthodox{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->unorthodox \ + ) + + // default + Unorthodoxes() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unorthodoxes( + const wrapper> + &unorthodox + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + unorthodox(this,unorthodox) + { + Component::finish(); + } + + // from node + explicit Unorthodoxes(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unorthodoxes(const Unorthodoxes &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + unorthodox(this,other.unorthodox) + { + Component::finish(other); + } + + // move + Unorthodoxes(Unorthodoxes &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + unorthodox(this,std::move(other.unorthodox)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Unorthodoxes &operator=(const Unorthodoxes &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + unorthodox = other.unorthodox; + } + return *this; + } + + // move + Unorthodoxes &operator=(Unorthodoxes &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + unorthodox = std::move(other.unorthodox); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Unorthodoxes/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Unorthodoxes + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodoxes/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodoxes/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unorthodoxes/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unresolved.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unresolved.hpp new file mode 100644 index 000000000..a43194000 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unresolved.hpp @@ -0,0 +1,235 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_UNRESOLVED +#define GNDS_V2_0_GENERAL_UNRESOLVED + +#include "GNDS/v2.0/general/TabulatedWidths.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Unresolved +// ----------------------------------------------------------------------------- + +class Unresolved : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Unresolved"; } + static auto NODENAME() { return "unresolved"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("domainMin") | + double{} + / Meta<>("domainMax") | + std::string{} + / Meta<>("domainUnit") | + + // children + --Child + ("tabulatedWidths") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "domainMin", + "domainMax", + "domainUnit", + "tabulatedWidths" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "domain_min", + "domain_max", + "domain_unit", + "tabulated_widths" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + domainMin{this}; + Field + domainMax{this}; + Field + domainUnit{this}; + + // children + Field + tabulatedWidths{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(tabulatedWidths().Ls(),L); + NJOY_GNDSTK_SHORTCUT(tabulatedWidths(),Ls); + NJOY_GNDSTK_SHORTCUT(tabulatedWidths(),PoPs); + NJOY_GNDSTK_SHORTCUT(tabulatedWidths().resonanceReactions(),resonanceReaction); + NJOY_GNDSTK_SHORTCUT(tabulatedWidths(),resonanceReactions); + NJOY_GNDSTK_SHORTCUT(tabulatedWidths(),scatteringRadius); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMin, \ + this->domainMax, \ + this->domainUnit, \ + this->tabulatedWidths \ + ) + + // default + Unresolved() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unresolved( + const wrapper + &domainMin, + const wrapper + &domainMax = {}, + const wrapper + &domainUnit = {}, + const wrapper + &tabulatedWidths = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + domainMin(this,domainMin), + domainMax(this,domainMax), + domainUnit(this,domainUnit), + tabulatedWidths(this,tabulatedWidths) + { + Component::finish(); + } + + // from node + explicit Unresolved(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unresolved(const Unresolved &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + domainUnit(this,other.domainUnit), + tabulatedWidths(this,other.tabulatedWidths) + { + Component::finish(other); + } + + // move + Unresolved(Unresolved &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + domainUnit(this,std::move(other.domainUnit)), + tabulatedWidths(this,std::move(other.tabulatedWidths)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Unresolved &operator=(const Unresolved &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + domainMin = other.domainMin; + domainMax = other.domainMax; + domainUnit = other.domainUnit; + tabulatedWidths = other.tabulatedWidths; + } + return *this; + } + + // move + Unresolved &operator=(Unresolved &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + domainUnit = std::move(other.domainUnit); + tabulatedWidths = std::move(other.tabulatedWidths); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Unresolved/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Unresolved + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unresolved/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unresolved/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unresolved/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/UnresolvedRegion.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/UnresolvedRegion.hpp new file mode 100644 index 000000000..cc3f324fc --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/UnresolvedRegion.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_UNRESOLVEDREGION +#define GNDS_V2_0_GENERAL_UNRESOLVEDREGION + +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/Regions1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class UnresolvedRegion +// ----------------------------------------------------------------------------- + +class UnresolvedRegion : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "UnresolvedRegion"; } + static auto NODENAME() { return "unresolvedRegion"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("XYs1d") | + --Child> + ("regions1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d", + "regions1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d", + "regions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + regions1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d \ + ) + + // default + UnresolvedRegion() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit UnresolvedRegion( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit UnresolvedRegion(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + UnresolvedRegion(const UnresolvedRegion &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + UnresolvedRegion(UnresolvedRegion &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + regions1d(this,std::move(other.regions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + UnresolvedRegion &operator=(const UnresolvedRegion &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + } + return *this; + } + + // move + UnresolvedRegion &operator=(UnresolvedRegion &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/UnresolvedRegion/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class UnresolvedRegion + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/UnresolvedRegion/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/UnresolvedRegion/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/UnresolvedRegion/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unspecified.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unspecified.hpp new file mode 100644 index 000000000..c93d28f7e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unspecified.hpp @@ -0,0 +1,193 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_UNSPECIFIED +#define GNDS_V2_0_GENERAL_UNSPECIFIED + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Unspecified +// ----------------------------------------------------------------------------- + +class Unspecified : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Unspecified"; } + static auto NODENAME() { return "unspecified"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::optional{} + / Meta<>("productFrame") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "productFrame" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "product_frame" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field> + productFrame{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->productFrame \ + ) + + // default + Unspecified() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Unspecified( + const wrapper + &label, + const wrapper> + &productFrame = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + productFrame(this,productFrame) + { + Component::finish(); + } + + // from node + explicit Unspecified(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Unspecified(const Unspecified &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + productFrame(this,other.productFrame) + { + Component::finish(other); + } + + // move + Unspecified(Unspecified &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + productFrame(this,std::move(other.productFrame)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Unspecified &operator=(const Unspecified &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + productFrame = other.productFrame; + } + return *this; + } + + // move + Unspecified &operator=(Unspecified &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + productFrame = std::move(other.productFrame); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Unspecified/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Unspecified + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unspecified/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unspecified/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Unspecified/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Values.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Values.hpp new file mode 100644 index 000000000..2342ea62f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Values.hpp @@ -0,0 +1,176 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_VALUES +#define GNDS_V2_0_GENERAL_VALUES + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Values +// ----------------------------------------------------------------------------- + +class Values : + public Component, + public DataNode,false> +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Values"; } + static auto NODENAME() { return "values"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // data + --Child(special::self) / DataConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "doubles" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "doubles" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using DataNode::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // data + std::vector &doubles = *this; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + static_cast(*this) \ + ) + + // default + Values() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from node + explicit Values(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Values(const std::vector &vector) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Values(const Values &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment) + { + Component::finish(other); + } + + // move + Values(Values &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(std::move(other)), + comment(this,std::move(other.comment)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Values &operator=(const Values &other) + { + if (this != &other) { + Component::operator=(other); + DataNode::operator=(other); + comment = other.comment; + } + return *this; + } + + // move + Values &operator=(Values &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + DataNode::operator=(std::move(other)); + comment = std::move(other.comment); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Values/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Values + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Values/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Values/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Values/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Weighted.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Weighted.hpp new file mode 100644 index 000000000..a2cc6a84f --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Weighted.hpp @@ -0,0 +1,204 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_WEIGHTED +#define GNDS_V2_0_GENERAL_WEIGHTED + +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/Evaporation.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Weighted +// ----------------------------------------------------------------------------- + +class Weighted : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Weighted"; } + static auto NODENAME() { return "weighted"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("XYs1d") | + --Child + ("evaporation") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d", + "evaporation" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d", + "evaporation" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + XYs1d{this}; + Field + evaporation{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(evaporation(),U); + NJOY_GNDSTK_SHORTCUT(XYs1d(),axes); + NJOY_GNDSTK_SHORTCUT(evaporation().theta(),regions1d); + NJOY_GNDSTK_SHORTCUT(evaporation(),theta); + NJOY_GNDSTK_SHORTCUT(XYs1d(),uncertainty); + NJOY_GNDSTK_SHORTCUT(XYs1d(),values); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->evaporation \ + ) + + // default + Weighted() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Weighted( + const wrapper + &XYs1d, + const wrapper + &evaporation = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + evaporation(this,evaporation) + { + Component::finish(); + } + + // from node + explicit Weighted(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Weighted(const Weighted &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + evaporation(this,other.evaporation) + { + Component::finish(other); + } + + // move + Weighted(Weighted &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + evaporation(this,std::move(other.evaporation)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Weighted &operator=(const Weighted &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + evaporation = other.evaporation; + } + return *this; + } + + // move + Weighted &operator=(Weighted &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + evaporation = std::move(other.evaporation); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Weighted/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Weighted + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Weighted/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Weighted/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Weighted/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/WeightedFunctionals.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/WeightedFunctionals.hpp new file mode 100644 index 000000000..027608242 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/WeightedFunctionals.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_WEIGHTEDFUNCTIONALS +#define GNDS_V2_0_GENERAL_WEIGHTEDFUNCTIONALS + +#include "GNDS/v2.0/general/Weighted.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class WeightedFunctionals +// ----------------------------------------------------------------------------- + +class WeightedFunctionals : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "WeightedFunctionals"; } + static auto NODENAME() { return "weightedFunctionals"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("weighted") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "weighted" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "weighted" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + weighted{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->weighted \ + ) + + // default + WeightedFunctionals() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit WeightedFunctionals( + const wrapper> + &weighted + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + weighted(this,weighted) + { + Component::finish(); + } + + // from node + explicit WeightedFunctionals(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + WeightedFunctionals(const WeightedFunctionals &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + weighted(this,other.weighted) + { + Component::finish(other); + } + + // move + WeightedFunctionals(WeightedFunctionals &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + weighted(this,std::move(other.weighted)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + WeightedFunctionals &operator=(const WeightedFunctionals &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + weighted = other.weighted; + } + return *this; + } + + // move + WeightedFunctionals &operator=(WeightedFunctionals &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + weighted = std::move(other.weighted); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/WeightedFunctionals/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class WeightedFunctionals + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/WeightedFunctionals/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/WeightedFunctionals/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/WeightedFunctionals/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Width.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Width.hpp new file mode 100644 index 000000000..fd970b75e --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Width.hpp @@ -0,0 +1,255 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_WIDTH +#define GNDS_V2_0_GENERAL_WIDTH + +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/Constant1d.hpp" +#include "GNDS/v2.0/general/Regions1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Width +// ----------------------------------------------------------------------------- + +class Width : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Width"; } + static auto NODENAME() { return "width"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("resonanceReaction") | + int{} + / Meta<>("degreesOfFreedom") | + + // children + --Child> + ("XYs1d") | + --Child> + ("constant1d") | + --Child> + ("regions1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "resonanceReaction", + "degreesOfFreedom", + "XYs1d", + "constant1d", + "regions1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "resonance_reaction", + "degrees_of_freedom", + "xys1d", + "constant1d", + "regions1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + resonanceReaction{this}; + Field + degreesOfFreedom{this}; + + // children + Field> + XYs1d{this}; + Field> + constant1d{this}; + Field> + regions1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->resonanceReaction, \ + this->degreesOfFreedom, \ + this->XYs1d, \ + this->constant1d, \ + this->regions1d \ + ) + + // default + Width() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Width( + const wrapper + &label, + const wrapper + &resonanceReaction = {}, + const wrapper + °reesOfFreedom = {}, + const wrapper> + &XYs1d = {}, + const wrapper> + &constant1d = {}, + const wrapper> + ®ions1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + resonanceReaction(this,resonanceReaction), + degreesOfFreedom(this,degreesOfFreedom), + XYs1d(this,XYs1d), + constant1d(this,constant1d), + regions1d(this,regions1d) + { + Component::finish(); + } + + // from node + explicit Width(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Width(const Width &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + resonanceReaction(this,other.resonanceReaction), + degreesOfFreedom(this,other.degreesOfFreedom), + XYs1d(this,other.XYs1d), + constant1d(this,other.constant1d), + regions1d(this,other.regions1d) + { + Component::finish(other); + } + + // move + Width(Width &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + resonanceReaction(this,std::move(other.resonanceReaction)), + degreesOfFreedom(this,std::move(other.degreesOfFreedom)), + XYs1d(this,std::move(other.XYs1d)), + constant1d(this,std::move(other.constant1d)), + regions1d(this,std::move(other.regions1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Width &operator=(const Width &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + resonanceReaction = other.resonanceReaction; + degreesOfFreedom = other.degreesOfFreedom; + XYs1d = other.XYs1d; + constant1d = other.constant1d; + regions1d = other.regions1d; + } + return *this; + } + + // move + Width &operator=(Width &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + resonanceReaction = std::move(other.resonanceReaction); + degreesOfFreedom = std::move(other.degreesOfFreedom); + XYs1d = std::move(other.XYs1d); + constant1d = std::move(other.constant1d); + regions1d = std::move(other.regions1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Width/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Width + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Width/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Width/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Width/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Widths.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Widths.hpp new file mode 100644 index 000000000..94441f878 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Widths.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_WIDTHS +#define GNDS_V2_0_GENERAL_WIDTHS + +#include "GNDS/v2.0/general/Width.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Widths +// ----------------------------------------------------------------------------- + +class Widths : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Widths"; } + static auto NODENAME() { return "widths"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("width") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "width" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "width" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + width{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->width \ + ) + + // default + Widths() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Widths( + const wrapper> + &width + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + width(this,width) + { + Component::finish(); + } + + // from node + explicit Widths(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Widths(const Widths &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + width(this,other.width) + { + Component::finish(other); + } + + // move + Widths(Widths &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + width(this,std::move(other.width)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Widths &operator=(const Widths &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + width = other.width; + } + return *this; + } + + // move + Widths &operator=(Widths &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + width = std::move(other.width); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Widths/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Widths + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Widths/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Widths/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Widths/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs1d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs1d.hpp new file mode 100644 index 000000000..52a9f9075 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs1d.hpp @@ -0,0 +1,269 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_XYS1D +#define GNDS_V2_0_GENERAL_XYS1D + +#include "GNDS/v2.0/general/Axes.hpp" +#include "GNDS/v2.0/general/Values.hpp" +#include "GNDS/v2.0/general/Uncertainty.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class XYs1d +// ----------------------------------------------------------------------------- + +class XYs1d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "XYs1d"; } + static auto NODENAME() { return "XYs1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("label") | + std::optional{} + / Meta<>("index") | + std::optional{} + / Meta<>("interpolation") | + std::optional{} + / Meta<>("outerDomainValue") | + + // children + --Child> + ("axes") | + --Child + ("values") | + --Child> + ("uncertainty") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "index", + "interpolation", + "outerDomainValue", + "axes", + "values", + "uncertainty" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "index", + "interpolation", + "outer_domain_value", + "axes", + "values", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + label{this}; + Field> + index{this}; + Field> + interpolation{this}; + Field> + outerDomainValue{this}; + + // children + Field> + axes{this}; + Field + values{this}; + Field> + uncertainty{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->index, \ + this->interpolation, \ + this->outerDomainValue, \ + this->axes, \ + this->values, \ + this->uncertainty \ + ) + + // default + XYs1d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit XYs1d( + const wrapper> + &label, + const wrapper> + &index = {}, + const wrapper> + &interpolation = {}, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &axes = {}, + const wrapper + &values = {}, + const wrapper> + &uncertainty = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + index(this,index), + interpolation(this,interpolation), + outerDomainValue(this,outerDomainValue), + axes(this,axes), + values(this,values), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit XYs1d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + XYs1d(const XYs1d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + index(this,other.index), + interpolation(this,other.interpolation), + outerDomainValue(this,other.outerDomainValue), + axes(this,other.axes), + values(this,other.values), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + XYs1d(XYs1d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + index(this,std::move(other.index)), + interpolation(this,std::move(other.interpolation)), + outerDomainValue(this,std::move(other.outerDomainValue)), + axes(this,std::move(other.axes)), + values(this,std::move(other.values)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + XYs1d &operator=(const XYs1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + index = other.index; + interpolation = other.interpolation; + outerDomainValue = other.outerDomainValue; + axes = other.axes; + values = other.values; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + XYs1d &operator=(XYs1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + index = std::move(other.index); + interpolation = std::move(other.interpolation); + outerDomainValue = std::move(other.outerDomainValue); + axes = std::move(other.axes); + values = std::move(other.values); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/XYs1d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class XYs1d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs1d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs2d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs2d.hpp new file mode 100644 index 000000000..77c8173ca --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs2d.hpp @@ -0,0 +1,276 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_XYS2D +#define GNDS_V2_0_GENERAL_XYS2D + +#include "GNDS/v2.0/general/Axes.hpp" +#include "GNDS/v2.0/general/Function1ds.hpp" +#include "GNDS/v2.0/general/Uncertainty.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class XYs2d +// ----------------------------------------------------------------------------- + +class XYs2d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "XYs2d"; } + static auto NODENAME() { return "XYs2d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("index") | + std::optional{} + / Meta<>("interpolation") | + std::optional{} + / Meta<>("interpolationQualifier") | + std::optional{} + / Meta<>("outerDomainValue") | + + // children + --Child> + ("axes") | + --Child + ("function1ds") | + --Child> + ("uncertainty") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "index", + "interpolation", + "interpolationQualifier", + "outerDomainValue", + "axes", + "function1ds", + "uncertainty" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "index", + "interpolation", + "interpolation_qualifier", + "outer_domain_value", + "axes", + "function1ds", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + index{this}; + Field> + interpolation{this}; + Field> + interpolationQualifier{this}; + Field> + outerDomainValue{this}; + + // children + Field> + axes{this}; + Field + function1ds{this}; + Field> + uncertainty{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(function1ds(),Legendre); + NJOY_GNDSTK_SHORTCUT(function1ds(),XYs1d); + NJOY_GNDSTK_SHORTCUT(function1ds(),regions1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->index, \ + this->interpolation, \ + this->interpolationQualifier, \ + this->outerDomainValue, \ + this->axes, \ + this->function1ds, \ + this->uncertainty \ + ) + + // default + XYs2d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit XYs2d( + const wrapper> + &index, + const wrapper> + &interpolation = {}, + const wrapper> + &interpolationQualifier = {}, + const wrapper> + &outerDomainValue = {}, + const wrapper> + &axes = {}, + const wrapper + &function1ds = {}, + const wrapper> + &uncertainty = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + index(this,index), + interpolation(this,interpolation), + interpolationQualifier(this,interpolationQualifier), + outerDomainValue(this,outerDomainValue), + axes(this,axes), + function1ds(this,function1ds), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit XYs2d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + XYs2d(const XYs2d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + index(this,other.index), + interpolation(this,other.interpolation), + interpolationQualifier(this,other.interpolationQualifier), + outerDomainValue(this,other.outerDomainValue), + axes(this,other.axes), + function1ds(this,other.function1ds), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + XYs2d(XYs2d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + index(this,std::move(other.index)), + interpolation(this,std::move(other.interpolation)), + interpolationQualifier(this,std::move(other.interpolationQualifier)), + outerDomainValue(this,std::move(other.outerDomainValue)), + axes(this,std::move(other.axes)), + function1ds(this,std::move(other.function1ds)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + XYs2d &operator=(const XYs2d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + index = other.index; + interpolation = other.interpolation; + interpolationQualifier = other.interpolationQualifier; + outerDomainValue = other.outerDomainValue; + axes = other.axes; + function1ds = other.function1ds; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + XYs2d &operator=(XYs2d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + index = std::move(other.index); + interpolation = std::move(other.interpolation); + interpolationQualifier = std::move(other.interpolationQualifier); + outerDomainValue = std::move(other.outerDomainValue); + axes = std::move(other.axes); + function1ds = std::move(other.function1ds); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/XYs2d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class XYs2d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs2d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs2d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs2d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs3d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs3d.hpp new file mode 100644 index 000000000..8b6c806d5 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs3d.hpp @@ -0,0 +1,212 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_XYS3D +#define GNDS_V2_0_GENERAL_XYS3D + +#include "GNDS/v2.0/general/Axes.hpp" +#include "GNDS/v2.0/general/Function2ds.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class XYs3d +// ----------------------------------------------------------------------------- + +class XYs3d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "XYs3d"; } + static auto NODENAME() { return "XYs3d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("interpolationQualifier") | + + // children + --Child> + ("axes") | + ++Child + ("function2ds") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "interpolationQualifier", + "axes", + "function2ds" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "interpolation_qualifier", + "axes", + "function2ds" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + interpolationQualifier{this}; + + // children + Field> + axes{this}; + Field> + function2ds{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->interpolationQualifier, \ + this->axes, \ + this->function2ds \ + ) + + // default + XYs3d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit XYs3d( + const wrapper> + &interpolationQualifier, + const wrapper> + &axes = {}, + const wrapper> + &function2ds = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + interpolationQualifier(this,interpolationQualifier), + axes(this,axes), + function2ds(this,function2ds) + { + Component::finish(); + } + + // from node + explicit XYs3d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + XYs3d(const XYs3d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + interpolationQualifier(this,other.interpolationQualifier), + axes(this,other.axes), + function2ds(this,other.function2ds) + { + Component::finish(other); + } + + // move + XYs3d(XYs3d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + interpolationQualifier(this,std::move(other.interpolationQualifier)), + axes(this,std::move(other.axes)), + function2ds(this,std::move(other.function2ds)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + XYs3d &operator=(const XYs3d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + interpolationQualifier = other.interpolationQualifier; + axes = other.axes; + function2ds = other.function2ds; + } + return *this; + } + + // move + XYs3d &operator=(XYs3d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + interpolationQualifier = std::move(other.interpolationQualifier); + axes = std::move(other.axes); + function2ds = std::move(other.function2ds); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/XYs3d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class XYs3d + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs3d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs3d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/XYs3d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Yields.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Yields.hpp new file mode 100644 index 000000000..c4bafcff7 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Yields.hpp @@ -0,0 +1,216 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_GENERAL_YIELDS +#define GNDS_V2_0_GENERAL_YIELDS + +#include "GNDS/v2.0/reduced/Nuclides.hpp" +#include "GNDS/v2.0/general/Values.hpp" +#include "GNDS/v2.0/general/Uncertainty.hpp" + +namespace GNDS { +namespace v2_0 { +namespace general { + +// ----------------------------------------------------------------------------- +// general:: +// class Yields +// ----------------------------------------------------------------------------- + +class Yields : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "general"; } + static auto CLASS() { return "Yields"; } + static auto NODENAME() { return "yields"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child + ("nuclides") | + --Child + ("values") | + --Child + ("uncertainty") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "nuclides", + "values", + "uncertainty" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "nuclides", + "values", + "uncertainty" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field + nuclides{this}; + Field + values{this}; + Field + uncertainty{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(uncertainty(),listOfCovariances); + NJOY_GNDSTK_SHORTCUT(uncertainty(),polynomial1d); + NJOY_GNDSTK_SHORTCUT(uncertainty(),standard); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->nuclides, \ + this->values, \ + this->uncertainty \ + ) + + // default + Yields() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Yields( + const wrapper + &nuclides, + const wrapper + &values = {}, + const wrapper + &uncertainty = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + nuclides(this,nuclides), + values(this,values), + uncertainty(this,uncertainty) + { + Component::finish(); + } + + // from node + explicit Yields(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Yields(const Yields &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + nuclides(this,other.nuclides), + values(this,other.values), + uncertainty(this,other.uncertainty) + { + Component::finish(other); + } + + // move + Yields(Yields &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + nuclides(this,std::move(other.nuclides)), + values(this,std::move(other.values)), + uncertainty(this,std::move(other.uncertainty)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Yields &operator=(const Yields &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + nuclides = other.nuclides; + values = other.values; + uncertainty = other.uncertainty; + } + return *this; + } + + // move + Yields &operator=(Yields &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + nuclides = std::move(other.nuclides); + values = std::move(other.values); + uncertainty = std::move(other.uncertainty); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/general/Yields/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Yields + +} // namespace general +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Yields/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Yields/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/general/Yields/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/key.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/key.hpp new file mode 100644 index 000000000..5a3f54e84 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/key.hpp @@ -0,0 +1,474 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_KEY +#define GNDS_V2_0_KEY + +// GNDStk Core Interface +#include "GNDStk.hpp" + +namespace GNDS { +namespace v2_0 { + +using namespace njoy; +using namespace GNDStk; + + +// ----------------------------------------------------------------------------- +// meta:: +// ----------------------------------------------------------------------------- + +namespace meta { + +#define NJOY_GNDSTK_MAKE_LOOKUP(nameField,nameGNDS) \ + inline const auto nameField = makeLookup( \ + #nameGNDS, \ + [](const auto &obj) -> decltype(obj.nameField()) \ + { \ + return obj.nameField(); \ + } \ + ) +// nameField vs. nameGNDS: e.g. Double, vs. double in GNDS; usually identical + +NJOY_GNDSTK_MAKE_LOOKUP(A,A); +NJOY_GNDSTK_MAKE_LOOKUP(ENDF_MFMT,ENDF_MFMT); +NJOY_GNDSTK_MAKE_LOOKUP(ENDF_MT,ENDF_MT); +NJOY_GNDSTK_MAKE_LOOKUP(L,L); +NJOY_GNDSTK_MAKE_LOOKUP(Z,Z); +NJOY_GNDSTK_MAKE_LOOKUP(algorithm,algorithm); +NJOY_GNDSTK_MAKE_LOOKUP(approximation,approximation); +NJOY_GNDSTK_MAKE_LOOKUP(boundaryCondition,boundaryCondition); +NJOY_GNDSTK_MAKE_LOOKUP(calculateChannelRadius,calculateChannelRadius); +NJOY_GNDSTK_MAKE_LOOKUP(calculatedAtThermal,calculatedAtThermal); +NJOY_GNDSTK_MAKE_LOOKUP(channelSpin,channelSpin); +NJOY_GNDSTK_MAKE_LOOKUP(checksum,checksum); +NJOY_GNDSTK_MAKE_LOOKUP(coefficient,coefficient); +NJOY_GNDSTK_MAKE_LOOKUP(columnIndex,columnIndex); +NJOY_GNDSTK_MAKE_LOOKUP(columns,columns); +NJOY_GNDSTK_MAKE_LOOKUP(complete,complete); +NJOY_GNDSTK_MAKE_LOOKUP(compression,compression); +NJOY_GNDSTK_MAKE_LOOKUP(crossTerm,crossTerm); +NJOY_GNDSTK_MAKE_LOOKUP(date,date); +NJOY_GNDSTK_MAKE_LOOKUP(dateType,dateType); +NJOY_GNDSTK_MAKE_LOOKUP(degreesOfFreedom,degreesOfFreedom); +NJOY_GNDSTK_MAKE_LOOKUP(dependenceOnProcessedGroupWidth,dependenceOnProcessedGroupWidth); +NJOY_GNDSTK_MAKE_LOOKUP(derivedFrom,derivedFrom); +NJOY_GNDSTK_MAKE_LOOKUP(dimension,dimension); +NJOY_GNDSTK_MAKE_LOOKUP(domainMax,domainMax); +NJOY_GNDSTK_MAKE_LOOKUP(domainMin,domainMin); +NJOY_GNDSTK_MAKE_LOOKUP(domainUnit,domainUnit); +NJOY_GNDSTK_MAKE_LOOKUP(domainValue,domainValue); +NJOY_GNDSTK_MAKE_LOOKUP(ejectile,ejectile); +NJOY_GNDSTK_MAKE_LOOKUP(electronNumber,electronNumber); +NJOY_GNDSTK_MAKE_LOOKUP(eliminated,eliminated); +NJOY_GNDSTK_MAKE_LOOKUP(evaluation,evaluation); +NJOY_GNDSTK_MAKE_LOOKUP(fissionGenre,fissionGenre); +NJOY_GNDSTK_MAKE_LOOKUP(flags,flags); +NJOY_GNDSTK_MAKE_LOOKUP(format,format); +NJOY_GNDSTK_MAKE_LOOKUP(generation,generation); +NJOY_GNDSTK_MAKE_LOOKUP(genre,genre); +NJOY_GNDSTK_MAKE_LOOKUP(href,href); +NJOY_GNDSTK_MAKE_LOOKUP(id,id); +NJOY_GNDSTK_MAKE_LOOKUP(identicalParticles,identicalParticles); +NJOY_GNDSTK_MAKE_LOOKUP(index,index); +NJOY_GNDSTK_MAKE_LOOKUP(interaction,interaction); +NJOY_GNDSTK_MAKE_LOOKUP(interpolation,interpolation); +NJOY_GNDSTK_MAKE_LOOKUP(interpolationQualifier,interpolationQualifier); +NJOY_GNDSTK_MAKE_LOOKUP(label,label); +NJOY_GNDSTK_MAKE_LOOKUP(library,library); +NJOY_GNDSTK_MAKE_LOOKUP(matrixStartIndex,matrixStartIndex); +NJOY_GNDSTK_MAKE_LOOKUP(max,max); +NJOY_GNDSTK_MAKE_LOOKUP(metaStableIndex,metaStableIndex); +NJOY_GNDSTK_MAKE_LOOKUP(min,min); +NJOY_GNDSTK_MAKE_LOOKUP(mode,mode); +NJOY_GNDSTK_MAKE_LOOKUP(muCutoff,muCutoff); +NJOY_GNDSTK_MAKE_LOOKUP(nParameters,nParameters); +NJOY_GNDSTK_MAKE_LOOKUP(name,name); +NJOY_GNDSTK_MAKE_LOOKUP(numberOfProducts,numberOfProducts); +NJOY_GNDSTK_MAKE_LOOKUP(numberPerMolecule,numberPerMolecule); +NJOY_GNDSTK_MAKE_LOOKUP(outerDomainValue,outerDomainValue); +NJOY_GNDSTK_MAKE_LOOKUP(parity,parity); +NJOY_GNDSTK_MAKE_LOOKUP(path,path); +NJOY_GNDSTK_MAKE_LOOKUP(pid,pid); +NJOY_GNDSTK_MAKE_LOOKUP(primaryScatterer,primaryScatterer); +NJOY_GNDSTK_MAKE_LOOKUP(process,process); +NJOY_GNDSTK_MAKE_LOOKUP(productFrame,productFrame); +NJOY_GNDSTK_MAKE_LOOKUP(projectile,projectile); +NJOY_GNDSTK_MAKE_LOOKUP(projectileFrame,projectileFrame); +NJOY_GNDSTK_MAKE_LOOKUP(resonanceReaction,resonanceReaction); +NJOY_GNDSTK_MAKE_LOOKUP(rows,rows); +NJOY_GNDSTK_MAKE_LOOKUP(shape,shape); +NJOY_GNDSTK_MAKE_LOOKUP(spin,spin); +NJOY_GNDSTK_MAKE_LOOKUP(style,style); +NJOY_GNDSTK_MAKE_LOOKUP(subshell,subshell); +NJOY_GNDSTK_MAKE_LOOKUP(supportsAngularReconstruction,supportsAngularReconstruction); +NJOY_GNDSTK_MAKE_LOOKUP(symbol,symbol); +NJOY_GNDSTK_MAKE_LOOKUP(symmetric,symmetric); +NJOY_GNDSTK_MAKE_LOOKUP(symmetry,symmetry); +NJOY_GNDSTK_MAKE_LOOKUP(target,target); +NJOY_GNDSTK_MAKE_LOOKUP(type,type); +NJOY_GNDSTK_MAKE_LOOKUP(unit,unit); +NJOY_GNDSTK_MAKE_LOOKUP(useForSelfShieldingOnly,useForSelfShieldingOnly); +NJOY_GNDSTK_MAKE_LOOKUP(value,value); +NJOY_GNDSTK_MAKE_LOOKUP(valueType,valueType); +NJOY_GNDSTK_MAKE_LOOKUP(version,version); + +#undef NJOY_GNDSTK_MAKE_LOOKUP + +} // namespace meta + + +// ----------------------------------------------------------------------------- +// g2d::child:: +// ----------------------------------------------------------------------------- + +namespace g2d { +namespace child { + +inline const Child<> array("array"); + +} // namespace child +using namespace child; +} // namespace g2d + + +// ----------------------------------------------------------------------------- +// g3d::child:: +// ----------------------------------------------------------------------------- + +namespace g3d { +namespace child { + +inline const Child<> array("array"); +inline const Child<> lengths("values"); +inline const Child<> starts("values"); + +} // namespace child +using namespace child; +} // namespace g3d + + +// ----------------------------------------------------------------------------- +// general::child:: +// ----------------------------------------------------------------------------- + +namespace general { +namespace child { + +inline const Child<> BreitWigner("BreitWigner"); +inline const Child<> CoulombPlusNuclearElastic("CoulombPlusNuclearElastic"); +inline const Child<> DebyeWallerIntegral("DebyeWallerIntegral"); +inline const Child<> Double("double"); +inline const Child<> EFH("EFH"); +inline const Child<> EFL("EFL"); +inline const Child<> ENDFconversionFlags("ENDFconversionFlags"); +inline const Child<> J("J"); +inline const Child<> Js("Js"); +inline const Child<> KalbachMann("KalbachMann"); +inline const Child<> L("L"); +inline const Child<> Legendre("Legendre"); +inline const Child<> Ls("Ls"); +inline const Child<> MadlandNix("MadlandNix"); +inline const Child<> NBodyPhaseSpace("NBodyPhaseSpace"); +inline const Child<> Q("Q"); +inline const Child<> RMatrix("RMatrix"); +inline const Child<> RutherfordScattering("RutherfordScattering"); +inline const Child<> SCTApproximation("SCTApproximation"); +inline const Child<> S_table("S_table"); +inline const Child<> T_M("T_M"); +inline const Child<> T_effective("T_effective"); +inline const Child<> U("U"); +inline const Child<> XYs1d("XYs1d"); +inline const Child<> XYs2d("XYs2d"); +inline const Child<> XYs3d("XYs3d"); +inline const Child<> add("add"); +inline const Child<> alias("alias"); +inline const Child<> aliases("aliases"); +inline const Child<> angular("angular"); +inline const Child<> angularEnergy("angularEnergy"); +inline const Child<> angularTwoBody("angularTwoBody"); +inline const Child<> applicationData("applicationData"); +inline const Child<> array("array"); +inline const Child<> atomic("atomic"); +inline const Child<> author("author"); +inline const Child<> authors("authors"); +inline const Child<> averageEnergies("averageEnergies"); +inline const Child<> averageEnergy("averageEnergy"); +inline const Child<> averageParameterCovariance("averageParameterCovariance"); +inline const Child<> averageProductEnergy("averageProductEnergy"); +inline const Child<> axes("axes"); +inline const Child<> axis("axis"); +inline const Child<> background("background"); +inline const Child<> baryon("baryon"); +inline const Child<> baryons("baryons"); +inline const Child<> bindingEnergy("bindingEnergy"); +inline const Child<> body("body"); +inline const Child<> boundAtomCrossSection("boundAtomCrossSection"); +inline const Child<> branching1d("branching1d"); +inline const Child<> branching3d("branching3d"); +inline const Child<> channel("channel"); +inline const Child<> channels("channels"); +inline const Child<> charge("charge"); +inline const Child<> chemicalElement("chemicalElement"); +inline const Child<> chemicalElements("chemicalElements"); +inline const Child<> coherentPhotonScattering("coherentPhotonScattering"); +inline const Child<> column("column"); +inline const Child<> columnData("columnData"); +inline const Child<> columnHeaders("columnHeaders"); +inline const Child<> configuration("configuration"); +inline const Child<> configurations("configurations"); +inline const Child<> constant1d("constant1d"); +inline const Child<> continuum("continuum"); +inline const Child<> conversion("conversion"); +inline const Child<> covariance("covariance"); +inline const Child<> covarianceMatrix("covarianceMatrix"); +inline const Child<> covarianceSection("covarianceSection"); +inline const Child<> covarianceSections("covarianceSections"); +inline const Child<> crossSection("crossSection"); +inline const Child<> crossSectionReconstructed("crossSectionReconstructed"); +inline const Child<> crossSectionSum("crossSectionSum"); +inline const Child<> crossSectionSums("crossSectionSums"); +inline const Child<> data("data"); +inline const Child<> date("date"); +inline const Child<> dates("dates"); +inline const Child<> decay("decay"); +inline const Child<> decayData("decayData"); +inline const Child<> decayMode("decayMode"); +inline const Child<> decayModes("decayModes"); +inline const Child<> decayPath("decayPath"); +inline const Child<> delayedBetaEnergy("delayedBetaEnergy"); +inline const Child<> delayedGammaEnergy("delayedGammaEnergy"); +inline const Child<> delayedNeutron("delayedNeutron"); +inline const Child<> delayedNeutronKE("delayedNeutronKE"); +inline const Child<> delayedNeutrons("delayedNeutrons"); +inline const Child<> discrete("discrete"); +inline const Child<> discreteGamma("discreteGamma"); +inline const Child<> distribution("distribution"); +inline const Child<> documentation("documentation"); +inline const Child<> doubleDifferentialCrossSection("doubleDifferentialCrossSection"); +inline const Child<> e_critical("e_critical"); +inline const Child<> e_max("e_max"); +inline const Child<> elapsedTime("elapsedTime"); +inline const Child<> elapsedTimes("elapsedTimes"); +inline const Child<> endfCompatible("endfCompatible"); +inline const Child<> energy("energy"); +inline const Child<> energyAngular("energyAngular"); +inline const Child<> evaluated("evaluated"); +inline const Child<> evaporation("evaporation"); +inline const Child<> externalFile("externalFile"); +inline const Child<> externalFiles("externalFiles"); +inline const Child<> f("f"); +inline const Child<> fastRegion("fastRegion"); +inline const Child<> fissionComponent("fissionComponent"); +inline const Child<> fissionComponents("fissionComponents"); +inline const Child<> fissionEnergyRelease("fissionEnergyRelease"); +inline const Child<> fissionEnergyReleases("fissionEnergyReleases"); +inline const Child<> formFactor("formFactor"); +inline const Child<> fraction("fraction"); +inline const Child<> freeGasApproximation("freeGasApproximation"); +inline const Child<> function1ds("function1ds"); +inline const Child<> function2ds("function2ds"); +inline const Child<> g("g"); +inline const Child<> gaugeBoson("gaugeBoson"); +inline const Child<> gaugeBosons("gaugeBosons"); +inline const Child<> generalEvaporation("generalEvaporation"); +inline const Child<> grid("grid"); +inline const Child<> gridded2d("gridded2d"); +inline const Child<> gridded3d("gridded3d"); +inline const Child<> halflife("halflife"); +inline const Child<> hardSphereRadius("hardSphereRadius"); +inline const Child<> imaginaryAnomalousFactor("imaginaryAnomalousFactor"); +inline const Child<> imaginaryInterferenceTerm("imaginaryInterferenceTerm"); +inline const Child<> incidentEnergies("incidentEnergies"); +inline const Child<> incidentEnergy("incidentEnergy"); +inline const Child<> incoherentPhotonScattering("incoherentPhotonScattering"); +inline const Child<> incompleteReactions("incompleteReactions"); +inline const Child<> institution("institution"); +inline const Child<> integer("integer"); +inline const Child<> intensity("intensity"); +inline const Child<> internalConversionCoefficients("internalConversionCoefficients"); +inline const Child<> isotope("isotope"); +inline const Child<> isotopes("isotopes"); +inline const Child<> isotropic2d("isotropic2d"); +inline const Child<> lepton("lepton"); +inline const Child<> leptons("leptons"); +inline const Child<> levelSpacing("levelSpacing"); +inline const Child<> link("link"); +inline const Child<> listOfCovariances("listOfCovariances"); +inline const Child<> mass("mass"); +inline const Child<> metaStable("metaStable"); +inline const Child<> mixed("mixed"); +inline const Child<> multiplicity("multiplicity"); +inline const Child<> multiplicitySum("multiplicitySum"); +inline const Child<> multiplicitySums("multiplicitySums"); +inline const Child<> neutrinoEnergy("neutrinoEnergy"); +inline const Child<> nonNeutrinoEnergy("nonNeutrinoEnergy"); +inline const Child<> nuclearAmplitudeExpansion("nuclearAmplitudeExpansion"); +inline const Child<> nuclearPlusInterference("nuclearPlusInterference"); +inline const Child<> nuclearTerm("nuclearTerm"); +inline const Child<> nucleus("nucleus"); +inline const Child<> nuclide("nuclide"); +inline const Child<> nuclides("nuclides"); +inline const Child<> orphanProduct("orphanProduct"); +inline const Child<> orphanProducts("orphanProducts"); +inline const Child<> outputChannel("outputChannel"); +inline const Child<> parameterCovariance("parameterCovariance"); +inline const Child<> parameterCovarianceMatrix("parameterCovarianceMatrix"); +inline const Child<> parameterCovariances("parameterCovariances"); +inline const Child<> parameterLink("parameterLink"); +inline const Child<> parameters("parameters"); +inline const Child<> parity("parity"); +inline const Child<> photonEmissionProbabilities("photonEmissionProbabilities"); +inline const Child<> polynomial1d("polynomial1d"); +inline const Child<> positronEmissionIntensity("positronEmissionIntensity"); +inline const Child<> primaryGamma("primaryGamma"); +inline const Child<> probability("probability"); +inline const Child<> product("product"); +inline const Child<> productYield("productYield"); +inline const Child<> productYields("productYields"); +inline const Child<> production("production"); +inline const Child<> productions("productions"); +inline const Child<> products("products"); +inline const Child<> projectileEnergyDomain("projectileEnergyDomain"); +inline const Child<> promptGammaEnergy("promptGammaEnergy"); +inline const Child<> promptNeutronKE("promptNeutronKE"); +inline const Child<> promptProductKE("promptProductKE"); +inline const Child<> r("r"); +inline const Child<> rate("rate"); +inline const Child<> reaction("reaction"); +inline const Child<> reactions("reactions"); +inline const Child<> realAnomalousFactor("realAnomalousFactor"); +inline const Child<> realInterferenceTerm("realInterferenceTerm"); +inline const Child<> recoil("recoil"); +inline const Child<> reference("reference"); +inline const Child<> regions1d("regions1d"); +inline const Child<> regions2d("regions2d"); +inline const Child<> resolved("resolved"); +inline const Child<> resolvedRegion("resolvedRegion"); +inline const Child<> resonanceParameters("resonanceParameters"); +inline const Child<> resonanceReaction("resonanceReaction"); +inline const Child<> resonanceReactions("resonanceReactions"); +inline const Child<> resonances("resonances"); +inline const Child<> resonancesWithBackground("resonancesWithBackground"); +inline const Child<> rowData("rowData"); +inline const Child<> scatteringAtom("scatteringAtom"); +inline const Child<> scatteringAtoms("scatteringAtoms"); +inline const Child<> scatteringFactor("scatteringFactor"); +inline const Child<> scatteringRadius("scatteringRadius"); +inline const Child<> selfScatteringKernel("selfScatteringKernel"); +inline const Child<> shell("shell"); +inline const Child<> shortRangeSelfScalingVariance("shortRangeSelfScalingVariance"); +inline const Child<> simpleMaxwellianFission("simpleMaxwellianFission"); +inline const Child<> slice("slice"); +inline const Child<> slices("slices"); +inline const Child<> spectra("spectra"); +inline const Child<> spectrum("spectrum"); +inline const Child<> spin("spin"); +inline const Child<> spinGroup("spinGroup"); +inline const Child<> spinGroups("spinGroups"); +inline const Child<> standard("standard"); +inline const Child<> string("string"); +inline const Child<> styles("styles"); +inline const Child<> sum("sum"); +inline const Child<> summand("summand"); +inline const Child<> summands("summands"); +inline const Child<> sums("sums"); +inline const Child<> table("table"); +inline const Child<> tabulatedWidths("tabulatedWidths"); +inline const Child<> temperature("temperature"); +inline const Child<> thermalNeutronScatteringLaw("thermalNeutronScatteringLaw"); +inline const Child<> thermalNeutronScatteringLaw1d("thermalNeutronScatteringLaw1d"); +inline const Child<> thermalNeutronScatteringLaw_coherentElastic("thermalNeutronScatteringLaw_coherentElastic"); +inline const Child<> thermalNeutronScatteringLaw_incoherentElastic("thermalNeutronScatteringLaw_incoherentElastic"); +inline const Child<> thermalNeutronScatteringLaw_incoherentInelastic("thermalNeutronScatteringLaw_incoherentInelastic"); +inline const Child<> theta("theta"); +inline const Child<> time("time"); +inline const Child<> title("title"); +inline const Child<> totalEnergy("totalEnergy"); +inline const Child<> uncertainty("uncertainty"); +inline const Child<> uncorrelated("uncorrelated"); +inline const Child<> unorthodox("unorthodox"); +inline const Child<> unorthodoxes("unorthodoxes"); +inline const Child<> unresolved("unresolved"); +inline const Child<> unresolvedRegion("unresolvedRegion"); +inline const Child<> unspecified("unspecified"); +inline const Child<> values("values"); +inline const Child<> weighted("weighted"); +inline const Child<> weightedFunctionals("weightedFunctionals"); +inline const Child<> width("width"); +inline const Child<> widths("widths"); +inline const Child<> yields("yields"); + +} // namespace child +using namespace child; +} // namespace general + + +// ----------------------------------------------------------------------------- +// reduced::child:: +// ----------------------------------------------------------------------------- + +namespace reduced { +namespace child { + +inline const Child<> Double("double"); +inline const Child<> crossSection("crossSection"); +inline const Child<> distribution("distribution"); +inline const Child<> function1ds("function1ds"); +inline const Child<> nuclides("nuclides"); +inline const Child<> outputChannel("outputChannel"); +inline const Child<> polynomial1d("polynomial1d"); +inline const Child<> product("product"); +inline const Child<> products("products"); + +} // namespace child +using namespace child; +} // namespace reduced + + +// ----------------------------------------------------------------------------- +// top::child:: +// ----------------------------------------------------------------------------- + +namespace top { +namespace child { + +inline const Child<> PoPs("PoPs"); +inline const Child<> covarianceSuite("covarianceSuite"); +inline const Child<> fissionFragmentData("fissionFragmentData"); +inline const Child<> reactionSuite("reactionSuite"); + +} // namespace child +using namespace child; +} // namespace top + + +// ----------------------------------------------------------------------------- +// For convenience: using directives +// ----------------------------------------------------------------------------- + +namespace key { + using namespace meta; + using namespace g2d::child; + using namespace g3d::child; + using namespace general::child; + using namespace reduced::child; + using namespace top::child; +} // namespace key + +using namespace key; +using namespace g2d; +using namespace g3d; +using namespace general; +using namespace reduced; +using namespace top; + + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- + +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/CrossSection.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/CrossSection.hpp new file mode 100644 index 000000000..0a867f4b3 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/CrossSection.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_REDUCED_CROSSSECTION +#define GNDS_V2_0_REDUCED_CROSSSECTION + +#include "GNDS/v2.0/general/XYs1d.hpp" +#include "GNDS/v2.0/general/Regions1d.hpp" +#include "GNDS/v2.0/general/Reference.hpp" + +namespace GNDS { +namespace v2_0 { +namespace reduced { + +// ----------------------------------------------------------------------------- +// reduced:: +// class CrossSection +// ----------------------------------------------------------------------------- + +class CrossSection : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "reduced"; } + static auto CLASS() { return "CrossSection"; } + static auto NODENAME() { return "crossSection"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("XYs1d") | + --Child> + ("regions1d") | + --Child> + ("reference") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "XYs1d", + "regions1d", + "reference" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "xys1d", + "regions1d", + "reference" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + XYs1d{this}; + Field> + regions1d{this}; + Field> + reference{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->XYs1d, \ + this->regions1d, \ + this->reference \ + ) + + // default + CrossSection() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CrossSection( + const wrapper> + &XYs1d, + const wrapper> + ®ions1d = {}, + const wrapper> + &reference = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + XYs1d(this,XYs1d), + regions1d(this,regions1d), + reference(this,reference) + { + Component::finish(); + } + + // from node + explicit CrossSection(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CrossSection(const CrossSection &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + XYs1d(this,other.XYs1d), + regions1d(this,other.regions1d), + reference(this,other.reference) + { + Component::finish(other); + } + + // move + CrossSection(CrossSection &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + XYs1d(this,std::move(other.XYs1d)), + regions1d(this,std::move(other.regions1d)), + reference(this,std::move(other.reference)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CrossSection &operator=(const CrossSection &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + XYs1d = other.XYs1d; + regions1d = other.regions1d; + reference = other.reference; + } + return *this; + } + + // move + CrossSection &operator=(CrossSection &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + XYs1d = std::move(other.XYs1d); + regions1d = std::move(other.regions1d); + reference = std::move(other.reference); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/reduced/CrossSection/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CrossSection + +} // namespace reduced +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/CrossSection/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/CrossSection/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/CrossSection/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Distribution.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Distribution.hpp new file mode 100644 index 000000000..2cf10070d --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Distribution.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_REDUCED_DISTRIBUTION +#define GNDS_V2_0_REDUCED_DISTRIBUTION + +#include "GNDS/v2.0/general/ThermalNeutronScatteringLaw.hpp" +#include "GNDS/v2.0/general/Uncorrelated.hpp" +#include "GNDS/v2.0/general/Unspecified.hpp" +#include "GNDS/v2.0/general/XYs2d.hpp" +#include "GNDS/v2.0/general/Branching3d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace reduced { + +// ----------------------------------------------------------------------------- +// reduced:: +// class Distribution +// ----------------------------------------------------------------------------- + +class Distribution : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "reduced"; } + static auto CLASS() { return "Distribution"; } + static auto NODENAME() { return "distribution"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("thermalNeutronScatteringLaw") | + --Child> + ("uncorrelated") | + --Child> + ("unspecified") | + --Child> + ("XYs2d") | + --Child> + ("branching3d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "thermalNeutronScatteringLaw", + "uncorrelated", + "unspecified", + "XYs2d", + "branching3d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "thermal_neutron_scattering_law", + "uncorrelated", + "unspecified", + "xys2d", + "branching3d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + thermalNeutronScatteringLaw{this}; + Field> + uncorrelated{this}; + Field> + unspecified{this}; + Field> + XYs2d{this}; + Field> + branching3d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->thermalNeutronScatteringLaw, \ + this->uncorrelated, \ + this->unspecified, \ + this->XYs2d, \ + this->branching3d \ + ) + + // default + Distribution() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Distribution( + const wrapper> + &thermalNeutronScatteringLaw, + const wrapper> + &uncorrelated = {}, + const wrapper> + &unspecified = {}, + const wrapper> + &XYs2d = {}, + const wrapper> + &branching3d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + thermalNeutronScatteringLaw(this,thermalNeutronScatteringLaw), + uncorrelated(this,uncorrelated), + unspecified(this,unspecified), + XYs2d(this,XYs2d), + branching3d(this,branching3d) + { + Component::finish(); + } + + // from node + explicit Distribution(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Distribution(const Distribution &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + thermalNeutronScatteringLaw(this,other.thermalNeutronScatteringLaw), + uncorrelated(this,other.uncorrelated), + unspecified(this,other.unspecified), + XYs2d(this,other.XYs2d), + branching3d(this,other.branching3d) + { + Component::finish(other); + } + + // move + Distribution(Distribution &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + thermalNeutronScatteringLaw(this,std::move(other.thermalNeutronScatteringLaw)), + uncorrelated(this,std::move(other.uncorrelated)), + unspecified(this,std::move(other.unspecified)), + XYs2d(this,std::move(other.XYs2d)), + branching3d(this,std::move(other.branching3d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Distribution &operator=(const Distribution &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + thermalNeutronScatteringLaw = other.thermalNeutronScatteringLaw; + uncorrelated = other.uncorrelated; + unspecified = other.unspecified; + XYs2d = other.XYs2d; + branching3d = other.branching3d; + } + return *this; + } + + // move + Distribution &operator=(Distribution &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + thermalNeutronScatteringLaw = std::move(other.thermalNeutronScatteringLaw); + uncorrelated = std::move(other.uncorrelated); + unspecified = std::move(other.unspecified); + XYs2d = std::move(other.XYs2d); + branching3d = std::move(other.branching3d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/reduced/Distribution/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Distribution + +} // namespace reduced +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Distribution/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Distribution/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Distribution/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Double.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Double.hpp new file mode 100644 index 000000000..baf4e0ea0 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Double.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_REDUCED_DOUBLE +#define GNDS_V2_0_REDUCED_DOUBLE + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace reduced { + +// ----------------------------------------------------------------------------- +// reduced:: +// class Double +// ----------------------------------------------------------------------------- + +class Double : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "reduced"; } + static auto CLASS() { return "Double"; } + static auto NODENAME() { return "double"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("value") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "value" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "value" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + value{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->value \ + ) + + // default + Double() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Double( + const wrapper + &value + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + value(this,value) + { + Component::finish(); + } + + // from node + explicit Double(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Double(const Double &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + value(this,other.value) + { + Component::finish(other); + } + + // move + Double(Double &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + value(this,std::move(other.value)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Double &operator=(const Double &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + value = other.value; + } + return *this; + } + + // move + Double &operator=(Double &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + value = std::move(other.value); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/reduced/Double/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Double + +} // namespace reduced +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Double/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Double/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Double/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Function1ds.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Function1ds.hpp new file mode 100644 index 000000000..ba3294b0c --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Function1ds.hpp @@ -0,0 +1,194 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_REDUCED_FUNCTION1DS +#define GNDS_V2_0_REDUCED_FUNCTION1DS + +#include "GNDS/v2.0/general/Legendre.hpp" +#include "GNDS/v2.0/general/XYs1d.hpp" + +namespace GNDS { +namespace v2_0 { +namespace reduced { + +// ----------------------------------------------------------------------------- +// reduced:: +// class Function1ds +// ----------------------------------------------------------------------------- + +class Function1ds : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "reduced"; } + static auto CLASS() { return "Function1ds"; } + static auto NODENAME() { return "function1ds"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("Legendre") | + ++Child> + ("XYs1d") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "Legendre", + "XYs1d" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "legendre", + "xys1d" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + Legendre{this}; + Field>> + XYs1d{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->Legendre, \ + this->XYs1d \ + ) + + // default + Function1ds() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Function1ds( + const wrapper> + &Legendre, + const wrapper>> + &XYs1d = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + Legendre(this,Legendre), + XYs1d(this,XYs1d) + { + Component::finish(); + } + + // from node + explicit Function1ds(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Function1ds(const Function1ds &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + Legendre(this,other.Legendre), + XYs1d(this,other.XYs1d) + { + Component::finish(other); + } + + // move + Function1ds(Function1ds &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + Legendre(this,std::move(other.Legendre)), + XYs1d(this,std::move(other.XYs1d)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Function1ds &operator=(const Function1ds &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + Legendre = other.Legendre; + XYs1d = other.XYs1d; + } + return *this; + } + + // move + Function1ds &operator=(Function1ds &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + Legendre = std::move(other.Legendre); + XYs1d = std::move(other.XYs1d); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/reduced/Function1ds/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Function1ds + +} // namespace reduced +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Function1ds/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Function1ds/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Function1ds/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Nuclides.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Nuclides.hpp new file mode 100644 index 000000000..9f858c734 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Nuclides.hpp @@ -0,0 +1,202 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_REDUCED_NUCLIDES +#define GNDS_V2_0_REDUCED_NUCLIDES + +#include "GNDS/v2.0/key.hpp" + +namespace GNDS { +namespace v2_0 { +namespace reduced { + +// ----------------------------------------------------------------------------- +// reduced:: +// class Nuclides +// ----------------------------------------------------------------------------- + +class Nuclides : + public Component, + public DataNode,false> +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "reduced"; } + static auto CLASS() { return "Nuclides"; } + static auto NODENAME() { return "nuclides"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::optional{} + / Meta<>("href") | + + // data + --Child(special::self) / DataConverter{} + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "href", + "strings" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "href", + "strings" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + using DataNode::operator=; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field> + href{this}; + + // data + std::vector &strings = *this; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->href, \ + static_cast(*this) \ + ) + + // default + Nuclides() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Nuclides( + const wrapper> + &href + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + href(this,href) + { + Component::finish(); + } + + // from node + explicit Nuclides(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // from vector + explicit Nuclides(const std::vector &vector) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + DataNode(vector) + { + Component::finish(vector); + } + + // copy + Nuclides(const Nuclides &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(other), + comment(this,other.comment), + href(this,other.href) + { + Component::finish(other); + } + + // move + Nuclides(Nuclides &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + DataNode(std::move(other)), + comment(this,std::move(other.comment)), + href(this,std::move(other.href)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Nuclides &operator=(const Nuclides &other) + { + if (this != &other) { + Component::operator=(other); + DataNode::operator=(other); + comment = other.comment; + href = other.href; + } + return *this; + } + + // move + Nuclides &operator=(Nuclides &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + DataNode::operator=(std::move(other)); + comment = std::move(other.comment); + href = std::move(other.href); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/reduced/Nuclides/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Nuclides + +} // namespace reduced +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Nuclides/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Nuclides/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Nuclides/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/OutputChannel.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/OutputChannel.hpp new file mode 100644 index 000000000..2586c8706 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/OutputChannel.hpp @@ -0,0 +1,232 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_REDUCED_OUTPUTCHANNEL +#define GNDS_V2_0_REDUCED_OUTPUTCHANNEL + +#include "GNDS/v2.0/general/Q.hpp" +#include "GNDS/v2.0/reduced/Products.hpp" + +namespace GNDS { +namespace v2_0 { +namespace reduced { + +// ----------------------------------------------------------------------------- +// reduced:: +// class OutputChannel +// ----------------------------------------------------------------------------- + +class OutputChannel : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "reduced"; } + static auto CLASS() { return "OutputChannel"; } + static auto NODENAME() { return "outputChannel"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("genre") | + std::optional{} + / Meta<>("process") | + + // children + --Child + ("Q") | + --Child> + ("products") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "genre", + "process", + "Q", + "products" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "genre", + "process", + "q", + "products" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + genre{this}; + Field> + process{this}; + + // children + Field + Q{this}; + Field> + products{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(Q(),Double); + NJOY_GNDSTK_SHORTCUT(Q(),constant1d); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->genre, \ + this->process, \ + this->Q, \ + this->products \ + ) + + // default + OutputChannel() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit OutputChannel( + const wrapper + &genre, + const wrapper> + &process = {}, + const wrapper + &Q = {}, + const wrapper> + &products = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + genre(this,genre), + process(this,process), + Q(this,Q), + products(this,products) + { + Component::finish(); + } + + // from node + explicit OutputChannel(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + OutputChannel(const OutputChannel &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + genre(this,other.genre), + process(this,other.process), + Q(this,other.Q), + products(this,other.products) + { + Component::finish(other); + } + + // move + OutputChannel(OutputChannel &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + genre(this,std::move(other.genre)), + process(this,std::move(other.process)), + Q(this,std::move(other.Q)), + products(this,std::move(other.products)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + OutputChannel &operator=(const OutputChannel &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + genre = other.genre; + process = other.process; + Q = other.Q; + products = other.products; + } + return *this; + } + + // move + OutputChannel &operator=(OutputChannel &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + genre = std::move(other.genre); + process = std::move(other.process); + Q = std::move(other.Q); + products = std::move(other.products); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/reduced/OutputChannel/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class OutputChannel + +} // namespace reduced +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/OutputChannel/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/OutputChannel/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/OutputChannel/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Polynomial1d.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Polynomial1d.hpp new file mode 100644 index 000000000..82b620997 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Polynomial1d.hpp @@ -0,0 +1,232 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_REDUCED_POLYNOMIAL1D +#define GNDS_V2_0_REDUCED_POLYNOMIAL1D + +#include "GNDS/v2.0/general/Axes.hpp" +#include "GNDS/v2.0/general/Values.hpp" + +namespace GNDS { +namespace v2_0 { +namespace reduced { + +// ----------------------------------------------------------------------------- +// reduced:: +// class Polynomial1d +// ----------------------------------------------------------------------------- + +class Polynomial1d : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "reduced"; } + static auto CLASS() { return "Polynomial1d"; } + static auto NODENAME() { return "polynomial1d"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + double{} + / Meta<>("domainMin") | + double{} + / Meta<>("domainMax") | + + // children + --Child + ("axes") | + --Child + ("values") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "domainMin", + "domainMax", + "axes", + "values" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "domain_min", + "domain_max", + "axes", + "values" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + domainMin{this}; + Field + domainMax{this}; + + // children + Field + axes{this}; + Field + values{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(axes(),axis); + NJOY_GNDSTK_SHORTCUT(axes(),grid); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->domainMin, \ + this->domainMax, \ + this->axes, \ + this->values \ + ) + + // default + Polynomial1d() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Polynomial1d( + const wrapper + &domainMin, + const wrapper + &domainMax = {}, + const wrapper + &axes = {}, + const wrapper + &values = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + domainMin(this,domainMin), + domainMax(this,domainMax), + axes(this,axes), + values(this,values) + { + Component::finish(); + } + + // from node + explicit Polynomial1d(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Polynomial1d(const Polynomial1d &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + domainMin(this,other.domainMin), + domainMax(this,other.domainMax), + axes(this,other.axes), + values(this,other.values) + { + Component::finish(other); + } + + // move + Polynomial1d(Polynomial1d &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + domainMin(this,std::move(other.domainMin)), + domainMax(this,std::move(other.domainMax)), + axes(this,std::move(other.axes)), + values(this,std::move(other.values)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Polynomial1d &operator=(const Polynomial1d &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + domainMin = other.domainMin; + domainMax = other.domainMax; + axes = other.axes; + values = other.values; + } + return *this; + } + + // move + Polynomial1d &operator=(Polynomial1d &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + domainMin = std::move(other.domainMin); + domainMax = std::move(other.domainMax); + axes = std::move(other.axes); + values = std::move(other.values); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/reduced/Polynomial1d/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Polynomial1d + +} // namespace reduced +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Polynomial1d/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Polynomial1d/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Polynomial1d/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Product.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Product.hpp new file mode 100644 index 000000000..a79a0ddfb --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Product.hpp @@ -0,0 +1,239 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_REDUCED_PRODUCT +#define GNDS_V2_0_REDUCED_PRODUCT + +#include "GNDS/v2.0/general/Multiplicity.hpp" +#include "GNDS/v2.0/reduced/Distribution.hpp" + +namespace GNDS { +namespace v2_0 { +namespace reduced { + +// ----------------------------------------------------------------------------- +// reduced:: +// class Product +// ----------------------------------------------------------------------------- + +class Product : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "reduced"; } + static auto CLASS() { return "Product"; } + static auto NODENAME() { return "product"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("label") | + std::string{} + / Meta<>("pid") | + + // children + --Child + ("multiplicity") | + --Child + ("distribution") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "multiplicity", + "distribution" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "label", + "pid", + "multiplicity", + "distribution" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + label{this}; + Field + pid{this}; + + // children + Field + multiplicity{this}; + Field + distribution{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(multiplicity(),XYs1d); + NJOY_GNDSTK_SHORTCUT(distribution(),XYs2d); + NJOY_GNDSTK_SHORTCUT(multiplicity(),branching1d); + NJOY_GNDSTK_SHORTCUT(multiplicity(),constant1d); + NJOY_GNDSTK_SHORTCUT(multiplicity(),polynomial1d); + NJOY_GNDSTK_SHORTCUT(multiplicity(),reference); + NJOY_GNDSTK_SHORTCUT(multiplicity(),regions1d); + NJOY_GNDSTK_SHORTCUT(distribution(),thermalNeutronScatteringLaw); + NJOY_GNDSTK_SHORTCUT(distribution(),uncorrelated); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->label, \ + this->pid, \ + this->multiplicity, \ + this->distribution \ + ) + + // default + Product() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Product( + const wrapper + &label, + const wrapper + &pid = {}, + const wrapper + &multiplicity = {}, + const wrapper + &distribution = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + label(this,label), + pid(this,pid), + multiplicity(this,multiplicity), + distribution(this,distribution) + { + Component::finish(); + } + + // from node + explicit Product(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Product(const Product &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + label(this,other.label), + pid(this,other.pid), + multiplicity(this,other.multiplicity), + distribution(this,other.distribution) + { + Component::finish(other); + } + + // move + Product(Product &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + label(this,std::move(other.label)), + pid(this,std::move(other.pid)), + multiplicity(this,std::move(other.multiplicity)), + distribution(this,std::move(other.distribution)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Product &operator=(const Product &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + label = other.label; + pid = other.pid; + multiplicity = other.multiplicity; + distribution = other.distribution; + } + return *this; + } + + // move + Product &operator=(Product &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + label = std::move(other.label); + pid = std::move(other.pid); + multiplicity = std::move(other.multiplicity); + distribution = std::move(other.distribution); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/reduced/Product/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Product + +} // namespace reduced +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Product/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Product/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Product/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Products.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Products.hpp new file mode 100644 index 000000000..8ad881842 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Products.hpp @@ -0,0 +1,179 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_REDUCED_PRODUCTS +#define GNDS_V2_0_REDUCED_PRODUCTS + +#include "GNDS/v2.0/reduced/Product.hpp" + +namespace GNDS { +namespace v2_0 { +namespace reduced { + +// ----------------------------------------------------------------------------- +// reduced:: +// class Products +// ----------------------------------------------------------------------------- + +class Products : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "reduced"; } + static auto CLASS() { return "Products"; } + static auto NODENAME() { return "products"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + ++Child + ("product") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "product" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "product" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + product{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->product \ + ) + + // default + Products() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit Products( + const wrapper> + &product + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + product(this,product) + { + Component::finish(); + } + + // from node + explicit Products(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + Products(const Products &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + product(this,other.product) + { + Component::finish(other); + } + + // move + Products(Products &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + product(this,std::move(other.product)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + Products &operator=(const Products &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + product = other.product; + } + return *this; + } + + // move + Products &operator=(Products &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + product = std::move(other.product); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/reduced/Products/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class Products + +} // namespace reduced +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Products/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Products/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/reduced/Products/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/CovarianceSuite.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/CovarianceSuite.hpp new file mode 100644 index 000000000..832977158 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/CovarianceSuite.hpp @@ -0,0 +1,307 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_TOP_COVARIANCESUITE +#define GNDS_V2_0_TOP_COVARIANCESUITE + +#include "GNDS/v2.0/general/ExternalFiles.hpp" +#include "GNDS/v2.0/general/Styles.hpp" +#include "GNDS/v2.0/general/CovarianceSections.hpp" +#include "GNDS/v2.0/general/ParameterCovariances.hpp" + +namespace GNDS { +namespace v2_0 { +namespace top { + +// ----------------------------------------------------------------------------- +// top:: +// class CovarianceSuite +// ----------------------------------------------------------------------------- + +class CovarianceSuite : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "top"; } + static auto CLASS() { return "CovarianceSuite"; } + static auto NODENAME() { return "covarianceSuite"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("projectile") | + std::string{} + / Meta<>("target") | + std::string{} + / Meta<>("evaluation") | + std::string{} + / Meta<>("interaction") | + std::string{} + / Meta<>("format") | + + // children + --Child> + ("externalFiles") | + --Child + ("styles") | + --Child> + ("covarianceSections") | + --Child> + ("parameterCovariances") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "projectile", + "target", + "evaluation", + "interaction", + "format", + "externalFiles", + "styles", + "covarianceSections", + "parameterCovariances" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "projectile", + "target", + "evaluation", + "interaction", + "format", + "external_files", + "styles", + "covariance_sections", + "parameter_covariances" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + projectile{this}; + Field + target{this}; + Field + evaluation{this}; + Field + interaction{this}; + Field + format{this}; + + // children + Field> + externalFiles{this}; + Field + styles{this}; + Field> + covarianceSections{this}; + Field> + parameterCovariances{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(styles(),crossSectionReconstructed); + NJOY_GNDSTK_SHORTCUT(styles().evaluated(),documentation); + NJOY_GNDSTK_SHORTCUT(styles(),evaluated); + NJOY_GNDSTK_SHORTCUT(styles().evaluated(),projectileEnergyDomain); + NJOY_GNDSTK_SHORTCUT(styles().evaluated(),temperature); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->projectile, \ + this->target, \ + this->evaluation, \ + this->interaction, \ + this->format, \ + this->externalFiles, \ + this->styles, \ + this->covarianceSections, \ + this->parameterCovariances \ + ) + + // default + CovarianceSuite() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit CovarianceSuite( + const wrapper + &projectile, + const wrapper + &target = {}, + const wrapper + &evaluation = {}, + const wrapper + &interaction = {}, + const wrapper + &format = {}, + const wrapper> + &externalFiles = {}, + const wrapper + &styles = {}, + const wrapper> + &covarianceSections = {}, + const wrapper> + ¶meterCovariances = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + projectile(this,projectile), + target(this,target), + evaluation(this,evaluation), + interaction(this,interaction), + format(this,format), + externalFiles(this,externalFiles), + styles(this,styles), + covarianceSections(this,covarianceSections), + parameterCovariances(this,parameterCovariances) + { + Component::finish(); + } + + // from node + explicit CovarianceSuite(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + CovarianceSuite(const CovarianceSuite &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + projectile(this,other.projectile), + target(this,other.target), + evaluation(this,other.evaluation), + interaction(this,other.interaction), + format(this,other.format), + externalFiles(this,other.externalFiles), + styles(this,other.styles), + covarianceSections(this,other.covarianceSections), + parameterCovariances(this,other.parameterCovariances) + { + Component::finish(other); + } + + // move + CovarianceSuite(CovarianceSuite &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + projectile(this,std::move(other.projectile)), + target(this,std::move(other.target)), + evaluation(this,std::move(other.evaluation)), + interaction(this,std::move(other.interaction)), + format(this,std::move(other.format)), + externalFiles(this,std::move(other.externalFiles)), + styles(this,std::move(other.styles)), + covarianceSections(this,std::move(other.covarianceSections)), + parameterCovariances(this,std::move(other.parameterCovariances)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + CovarianceSuite &operator=(const CovarianceSuite &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + projectile = other.projectile; + target = other.target; + evaluation = other.evaluation; + interaction = other.interaction; + format = other.format; + externalFiles = other.externalFiles; + styles = other.styles; + covarianceSections = other.covarianceSections; + parameterCovariances = other.parameterCovariances; + } + return *this; + } + + // move + CovarianceSuite &operator=(CovarianceSuite &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + projectile = std::move(other.projectile); + target = std::move(other.target); + evaluation = std::move(other.evaluation); + interaction = std::move(other.interaction); + format = std::move(other.format); + externalFiles = std::move(other.externalFiles); + styles = std::move(other.styles); + covarianceSections = std::move(other.covarianceSections); + parameterCovariances = std::move(other.parameterCovariances); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/top/CovarianceSuite/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class CovarianceSuite + +} // namespace top +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/CovarianceSuite/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/CovarianceSuite/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/CovarianceSuite/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/FissionFragmentData.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/FissionFragmentData.hpp new file mode 100644 index 000000000..cb30300e1 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/FissionFragmentData.hpp @@ -0,0 +1,209 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_TOP_FISSIONFRAGMENTDATA +#define GNDS_V2_0_TOP_FISSIONFRAGMENTDATA + +#include "GNDS/v2.0/general/ProductYields.hpp" +#include "GNDS/v2.0/general/DelayedNeutrons.hpp" +#include "GNDS/v2.0/general/FissionEnergyReleases.hpp" + +namespace GNDS { +namespace v2_0 { +namespace top { + +// ----------------------------------------------------------------------------- +// top:: +// class FissionFragmentData +// ----------------------------------------------------------------------------- + +class FissionFragmentData : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "top"; } + static auto CLASS() { return "FissionFragmentData"; } + static auto NODENAME() { return "fissionFragmentData"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // children + --Child> + ("productYields") | + --Child> + ("delayedNeutrons") | + --Child> + ("fissionEnergyReleases") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "productYields", + "delayedNeutrons", + "fissionEnergyReleases" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "product_yields", + "delayed_neutrons", + "fission_energy_releases" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // children + Field> + productYields{this}; + Field> + delayedNeutrons{this}; + Field> + fissionEnergyReleases{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->productYields, \ + this->delayedNeutrons, \ + this->fissionEnergyReleases \ + ) + + // default + FissionFragmentData() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit FissionFragmentData( + const wrapper> + &productYields, + const wrapper> + &delayedNeutrons = {}, + const wrapper> + &fissionEnergyReleases = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + productYields(this,productYields), + delayedNeutrons(this,delayedNeutrons), + fissionEnergyReleases(this,fissionEnergyReleases) + { + Component::finish(); + } + + // from node + explicit FissionFragmentData(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + FissionFragmentData(const FissionFragmentData &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + productYields(this,other.productYields), + delayedNeutrons(this,other.delayedNeutrons), + fissionEnergyReleases(this,other.fissionEnergyReleases) + { + Component::finish(other); + } + + // move + FissionFragmentData(FissionFragmentData &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + productYields(this,std::move(other.productYields)), + delayedNeutrons(this,std::move(other.delayedNeutrons)), + fissionEnergyReleases(this,std::move(other.fissionEnergyReleases)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + FissionFragmentData &operator=(const FissionFragmentData &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + productYields = other.productYields; + delayedNeutrons = other.delayedNeutrons; + fissionEnergyReleases = other.fissionEnergyReleases; + } + return *this; + } + + // move + FissionFragmentData &operator=(FissionFragmentData &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + productYields = std::move(other.productYields); + delayedNeutrons = std::move(other.delayedNeutrons); + fissionEnergyReleases = std::move(other.fissionEnergyReleases); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/top/FissionFragmentData/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class FissionFragmentData + +} // namespace top +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/FissionFragmentData/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/FissionFragmentData/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/FissionFragmentData/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/PoPs.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/PoPs.hpp new file mode 100644 index 000000000..37330bd05 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/PoPs.hpp @@ -0,0 +1,315 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_TOP_POPS +#define GNDS_V2_0_TOP_POPS + +#include "GNDS/v2.0/general/Aliases.hpp" +#include "GNDS/v2.0/general/Baryons.hpp" +#include "GNDS/v2.0/general/ChemicalElements.hpp" +#include "GNDS/v2.0/general/Styles.hpp" +#include "GNDS/v2.0/general/Unorthodoxes.hpp" +#include "GNDS/v2.0/general/GaugeBosons.hpp" +#include "GNDS/v2.0/general/Leptons.hpp" + +namespace GNDS { +namespace v2_0 { +namespace top { + +// ----------------------------------------------------------------------------- +// top:: +// class PoPs +// ----------------------------------------------------------------------------- + +class PoPs : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "top"; } + static auto CLASS() { return "PoPs"; } + static auto NODENAME() { return "PoPs"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("name") | + std::string{} + / Meta<>("version") | + std::string{} + / Meta<>("format") | + + // children + --Child> + ("aliases") | + --Child> + ("baryons") | + --Child> + ("chemicalElements") | + --Child> + ("styles") | + --Child> + ("unorthodoxes") | + --Child> + ("gaugeBosons") | + --Child> + ("leptons") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "name", + "version", + "format", + "aliases", + "baryons", + "chemicalElements", + "styles", + "unorthodoxes", + "gaugeBosons", + "leptons" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "name", + "version", + "format", + "aliases", + "baryons", + "chemical_elements", + "styles", + "unorthodoxes", + "gauge_bosons", + "leptons" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + name{this}; + Field + version{this}; + Field + format{this}; + + // children + Field> + aliases{this}; + Field> + baryons{this}; + Field> + chemicalElements{this}; + Field> + styles{this}; + Field> + unorthodoxes{this}; + Field> + gaugeBosons{this}; + Field> + leptons{this}; + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->name, \ + this->version, \ + this->format, \ + this->aliases, \ + this->baryons, \ + this->chemicalElements, \ + this->styles, \ + this->unorthodoxes, \ + this->gaugeBosons, \ + this->leptons \ + ) + + // default + PoPs() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit PoPs( + const wrapper + &name, + const wrapper + &version = {}, + const wrapper + &format = {}, + const wrapper> + &aliases = {}, + const wrapper> + &baryons = {}, + const wrapper> + &chemicalElements = {}, + const wrapper> + &styles = {}, + const wrapper> + &unorthodoxes = {}, + const wrapper> + &gaugeBosons = {}, + const wrapper> + &leptons = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + name(this,name), + version(this,version), + format(this,format), + aliases(this,aliases), + baryons(this,baryons), + chemicalElements(this,chemicalElements), + styles(this,styles), + unorthodoxes(this,unorthodoxes), + gaugeBosons(this,gaugeBosons), + leptons(this,leptons) + { + Component::finish(); + } + + // from node + explicit PoPs(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + PoPs(const PoPs &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + name(this,other.name), + version(this,other.version), + format(this,other.format), + aliases(this,other.aliases), + baryons(this,other.baryons), + chemicalElements(this,other.chemicalElements), + styles(this,other.styles), + unorthodoxes(this,other.unorthodoxes), + gaugeBosons(this,other.gaugeBosons), + leptons(this,other.leptons) + { + Component::finish(other); + } + + // move + PoPs(PoPs &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + name(this,std::move(other.name)), + version(this,std::move(other.version)), + format(this,std::move(other.format)), + aliases(this,std::move(other.aliases)), + baryons(this,std::move(other.baryons)), + chemicalElements(this,std::move(other.chemicalElements)), + styles(this,std::move(other.styles)), + unorthodoxes(this,std::move(other.unorthodoxes)), + gaugeBosons(this,std::move(other.gaugeBosons)), + leptons(this,std::move(other.leptons)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + PoPs &operator=(const PoPs &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + name = other.name; + version = other.version; + format = other.format; + aliases = other.aliases; + baryons = other.baryons; + chemicalElements = other.chemicalElements; + styles = other.styles; + unorthodoxes = other.unorthodoxes; + gaugeBosons = other.gaugeBosons; + leptons = other.leptons; + } + return *this; + } + + // move + PoPs &operator=(PoPs &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + name = std::move(other.name); + version = std::move(other.version); + format = std::move(other.format); + aliases = std::move(other.aliases); + baryons = std::move(other.baryons); + chemicalElements = std::move(other.chemicalElements); + styles = std::move(other.styles); + unorthodoxes = std::move(other.unorthodoxes); + gaugeBosons = std::move(other.gaugeBosons); + leptons = std::move(other.leptons); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/top/PoPs/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class PoPs + +} // namespace top +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/PoPs/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/PoPs/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/PoPs/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/ReactionSuite.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/ReactionSuite.hpp new file mode 100644 index 000000000..c841510c4 --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/ReactionSuite.hpp @@ -0,0 +1,430 @@ + +// THIS FILE WAS AUTOGENERATED! +// DO NOT MODIFY! + +#ifndef GNDS_V2_0_TOP_REACTIONSUITE +#define GNDS_V2_0_TOP_REACTIONSUITE + +#include "GNDS/v2.0/general/Styles.hpp" +#include "GNDS/v2.0/top/PoPs.hpp" +#include "GNDS/v2.0/general/Reactions.hpp" +#include "GNDS/v2.0/general/ApplicationData.hpp" +#include "GNDS/v2.0/general/ExternalFiles.hpp" +#include "GNDS/v2.0/general/Resonances.hpp" +#include "GNDS/v2.0/general/Sums.hpp" +#include "GNDS/v2.0/general/Productions.hpp" +#include "GNDS/v2.0/general/FissionComponents.hpp" +#include "GNDS/v2.0/general/OrphanProducts.hpp" +#include "GNDS/v2.0/general/IncompleteReactions.hpp" + +namespace GNDS { +namespace v2_0 { +namespace top { + +// ----------------------------------------------------------------------------- +// top:: +// class ReactionSuite +// ----------------------------------------------------------------------------- + +class ReactionSuite : + public Component +{ + friend class Component; + + // ------------------------ + // For Component + // ------------------------ + + // Names: this namespace and class, and original nodes (as in XML <...>) + static auto NAMESPACE() { return "top"; } + static auto CLASS() { return "ReactionSuite"; } + static auto NODENAME() { return "reactionSuite"; } + + // Core Interface multi-query to transfer information to/from core Nodes + static auto KEYS() + { + return + // comment + ++Child(special::comment) / CommentConverter{} | + + // metadata + std::string{} + / Meta<>("projectile") | + std::string{} + / Meta<>("target") | + std::string{} + / Meta<>("evaluation") | + std::string{} + / Meta<>("format") | + std::string{} + / Meta<>("projectileFrame") | + std::string{} + / Meta<>("interaction") | + + // children + --Child + ("styles") | + --Child + ("PoPs") | + --Child + ("reactions") | + --Child> + ("applicationData") | + --Child> + ("externalFiles") | + --Child> + ("resonances") | + --Child> + ("sums") | + --Child> + ("productions") | + --Child> + ("fissionComponents") | + --Child> + ("orphanProducts") | + --Child> + ("incompleteReactions") + ; + } + + // Data member names. Usually - but not necessarily - the same as the node + // names appearing in KEYS(). These are used by Component's prettyprinter. + static const auto &FIELDNAMES() + { + static const std::vector names = { + "comment", + "projectile", + "target", + "evaluation", + "format", + "projectileFrame", + "interaction", + "styles", + "PoPs", + "reactions", + "applicationData", + "externalFiles", + "resonances", + "sums", + "productions", + "fissionComponents", + "orphanProducts", + "incompleteReactions" + }; + return names; + } + + // Data member names, as they'll be presented in the Python bindings. + static const auto &PYTHONNAMES() + { + static const std::vector names = { + "comment", + "projectile", + "target", + "evaluation", + "format", + "projectile_frame", + "interaction", + "styles", + "po_ps", + "reactions", + "application_data", + "external_files", + "resonances", + "sums", + "productions", + "fission_components", + "orphan_products", + "incomplete_reactions" + }; + return names; + } + + // ------------------------ + // Public interface + // ------------------------ + +public: + + using component_t = Component; + using Component::construct; + + // ------------------------ + // Data members + // ------------------------ + + // comment + Field> comment{this}; + + // metadata + Field + projectile{this}; + Field + target{this}; + Field + evaluation{this}; + Field + format{this}; + Field + projectileFrame{this}; + Field + interaction{this}; + + // children + Field + styles{this}; + Field + PoPs{this}; + Field + reactions{this}; + Field> + applicationData{this}; + Field> + externalFiles{this}; + Field> + resonances{this}; + Field> + sums{this}; + Field> + productions{this}; + Field> + fissionComponents{this}; + Field> + orphanProducts{this}; + Field> + incompleteReactions{this}; + + // shortcuts + #define NJOY_GNDSTK_SHORTCUT(to,name) decltype(to.name) &name = to.name + NJOY_GNDSTK_SHORTCUT(PoPs(),aliases); + NJOY_GNDSTK_SHORTCUT(PoPs(),baryons); + NJOY_GNDSTK_SHORTCUT(PoPs(),chemicalElements); + NJOY_GNDSTK_SHORTCUT(styles().evaluated(),documentation); + NJOY_GNDSTK_SHORTCUT(PoPs(),gaugeBosons); + NJOY_GNDSTK_SHORTCUT(PoPs(),leptons); + NJOY_GNDSTK_SHORTCUT(styles().evaluated(),projectileEnergyDomain); + NJOY_GNDSTK_SHORTCUT(styles().evaluated(),temperature); + NJOY_GNDSTK_SHORTCUT(PoPs(),unorthodoxes); + #undef NJOY_GNDSTK_SHORTCUT + + // ------------------------ + // Constructors + // ------------------------ + + #define NJOY_GNDSTK_COMPONENT(blockdata) \ + Component( \ + blockdata, \ + this->comment, \ + this->projectile, \ + this->target, \ + this->evaluation, \ + this->format, \ + this->projectileFrame, \ + this->interaction, \ + this->styles, \ + this->PoPs, \ + this->reactions, \ + this->applicationData, \ + this->externalFiles, \ + this->resonances, \ + this->sums, \ + this->productions, \ + this->fissionComponents, \ + this->orphanProducts, \ + this->incompleteReactions \ + ) + + // default + ReactionSuite() : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(); + } + + // from fields, comment excluded + explicit ReactionSuite( + const wrapper + &projectile, + const wrapper + &target = {}, + const wrapper + &evaluation = {}, + const wrapper + &format = {}, + const wrapper + &projectileFrame = {}, + const wrapper + &interaction = {}, + const wrapper + &styles = {}, + const wrapper + &PoPs = {}, + const wrapper + &reactions = {}, + const wrapper> + &applicationData = {}, + const wrapper> + &externalFiles = {}, + const wrapper> + &resonances = {}, + const wrapper> + &sums = {}, + const wrapper> + &productions = {}, + const wrapper> + &fissionComponents = {}, + const wrapper> + &orphanProducts = {}, + const wrapper> + &incompleteReactions = {} + ) : + NJOY_GNDSTK_COMPONENT(BlockData{}), + projectile(this,projectile), + target(this,target), + evaluation(this,evaluation), + format(this,format), + projectileFrame(this,projectileFrame), + interaction(this,interaction), + styles(this,styles), + PoPs(this,PoPs), + reactions(this,reactions), + applicationData(this,applicationData), + externalFiles(this,externalFiles), + resonances(this,resonances), + sums(this,sums), + productions(this,productions), + fissionComponents(this,fissionComponents), + orphanProducts(this,orphanProducts), + incompleteReactions(this,incompleteReactions) + { + Component::finish(); + } + + // from node + explicit ReactionSuite(const Node &node) : + NJOY_GNDSTK_COMPONENT(BlockData{}) + { + Component::finish(node); + } + + // copy + ReactionSuite(const ReactionSuite &other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,other.comment), + projectile(this,other.projectile), + target(this,other.target), + evaluation(this,other.evaluation), + format(this,other.format), + projectileFrame(this,other.projectileFrame), + interaction(this,other.interaction), + styles(this,other.styles), + PoPs(this,other.PoPs), + reactions(this,other.reactions), + applicationData(this,other.applicationData), + externalFiles(this,other.externalFiles), + resonances(this,other.resonances), + sums(this,other.sums), + productions(this,other.productions), + fissionComponents(this,other.fissionComponents), + orphanProducts(this,other.orphanProducts), + incompleteReactions(this,other.incompleteReactions) + { + Component::finish(other); + } + + // move + ReactionSuite(ReactionSuite &&other) : + NJOY_GNDSTK_COMPONENT(other.baseBlockData()), + comment(this,std::move(other.comment)), + projectile(this,std::move(other.projectile)), + target(this,std::move(other.target)), + evaluation(this,std::move(other.evaluation)), + format(this,std::move(other.format)), + projectileFrame(this,std::move(other.projectileFrame)), + interaction(this,std::move(other.interaction)), + styles(this,std::move(other.styles)), + PoPs(this,std::move(other.PoPs)), + reactions(this,std::move(other.reactions)), + applicationData(this,std::move(other.applicationData)), + externalFiles(this,std::move(other.externalFiles)), + resonances(this,std::move(other.resonances)), + sums(this,std::move(other.sums)), + productions(this,std::move(other.productions)), + fissionComponents(this,std::move(other.fissionComponents)), + orphanProducts(this,std::move(other.orphanProducts)), + incompleteReactions(this,std::move(other.incompleteReactions)) + { + Component::finish(other); + } + + // ------------------------ + // Assignment operators + // ------------------------ + + // copy + ReactionSuite &operator=(const ReactionSuite &other) + { + if (this != &other) { + Component::operator=(other); + comment = other.comment; + projectile = other.projectile; + target = other.target; + evaluation = other.evaluation; + format = other.format; + projectileFrame = other.projectileFrame; + interaction = other.interaction; + styles = other.styles; + PoPs = other.PoPs; + reactions = other.reactions; + applicationData = other.applicationData; + externalFiles = other.externalFiles; + resonances = other.resonances; + sums = other.sums; + productions = other.productions; + fissionComponents = other.fissionComponents; + orphanProducts = other.orphanProducts; + incompleteReactions = other.incompleteReactions; + } + return *this; + } + + // move + ReactionSuite &operator=(ReactionSuite &&other) + { + if (this != &other) { + Component::operator=(std::move(other)); + comment = std::move(other.comment); + projectile = std::move(other.projectile); + target = std::move(other.target); + evaluation = std::move(other.evaluation); + format = std::move(other.format); + projectileFrame = std::move(other.projectileFrame); + interaction = std::move(other.interaction); + styles = std::move(other.styles); + PoPs = std::move(other.PoPs); + reactions = std::move(other.reactions); + applicationData = std::move(other.applicationData); + externalFiles = std::move(other.externalFiles); + resonances = std::move(other.resonances); + sums = std::move(other.sums); + productions = std::move(other.productions); + fissionComponents = std::move(other.fissionComponents); + orphanProducts = std::move(other.orphanProducts); + incompleteReactions = std::move(other.incompleteReactions); + } + return *this; + } + + // ------------------------ + // Custom functionality + // ------------------------ + + #include "GNDS/v2.0/top/ReactionSuite/src/custom.hpp" + #undef NJOY_GNDSTK_COMPONENT +}; // class ReactionSuite + +} // namespace top +} // namespace v2_0 +} // namespace GNDS + +#endif diff --git a/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/ReactionSuite/src/custom.hpp b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/ReactionSuite/src/custom.hpp new file mode 100644 index 000000000..9bf4b251a --- /dev/null +++ b/versions/GNDS-v2.0/GNDS/src/GNDS/v2.0/top/ReactionSuite/src/custom.hpp @@ -0,0 +1,4 @@ + +private: + + static inline helpMap help = {}; diff --git a/versions/GNDS-v2.0/all.json b/versions/GNDS-v2.0/all.json new file mode 100644 index 000000000..15a1b5ef7 --- /dev/null +++ b/versions/GNDS-v2.0/all.json @@ -0,0 +1,35 @@ +{ + "//": "Initial cut at GNDS v2.0", + + "Project": "GNDS", + "Version": "v2.0", + + "JSONFiles": [ + "top.json", + "general.json", + "reduced.json", + "g2d.json", + "g3d.json" + ], + + "Enumerators": { + "BoundaryCondition": [ ], + "ContributorType": [ ], + "DateType": [ ], + "DecayType": [ ], + "Encoding": [ ], + "Energy": [ ], + "Frame": [ ], + "GridStyle": [ ], + "HashAlgorithm": [ ], + "Interaction": [ ], + "Interpolation": [ ], + "InterpolationQualifier": [ ], + "Length": [ ], + "Parity": [ ], + "RelationType": [ ], + "StorageOrder": [ ] + }, + + "Changes": "changes.json" +} diff --git a/versions/GNDS-v2.0/changes.json b/versions/GNDS-v2.0/changes.json new file mode 100644 index 000000000..1b5eccb93 --- /dev/null +++ b/versions/GNDS-v2.0/changes.json @@ -0,0 +1,196 @@ +{ + "// Changes to node names" : "", + "name" : { + "double" : "Double" + }, + + "// Changes to node metadata a.k.a. attributes: type and default" : "", + "metadata" : { + "// Change json spec's 'type' to a valid GNDStk type" : "", + "type" : { + "// spec corrections" : "", + "bodyText" : "std::string", + "attributeValue" : "std::string", + "date" : "std::string", + "checksum" : "std::string", + "Boolean" : "bool", + + "// enumerators" : "", + "boundaryCondition" : "enums::BoundaryCondition", + "contributorType" : "enums::ContributorType", + "dateType" : "enums::DateType", + "decayType" : "enums::DecayType", + "encoding" : "enums::Encoding", + "energy" : "enums::Energy", + "frame" : "enums::Frame", + "gridStyle" : "enums::GridStyle", + "hashAlgorithm" : "enums::HashAlgorithm", + "algorithm" : "enums::HashAlgorithm", + "interaction" : "enums::Interaction", + "interpolation" : "enums::Interpolation", + "interpolationQualifier" : "enums::InterpolationQualifier", + "length" : "enums::Length", + "parity" : "enums::Parity", + "relationType" : "enums::RelationType", + "storageOrder" : "enums::StorageOrder" + }, + + "// Change json spec's 'default' to a valid GNDStk value" : "", + "default" : { + + "// values that really mean: no default" : "", + " \\\\kern-1ex": "", + "`' (i.e. unitless)": "", + "`' (no label)": "", + "`none'": "", + + "// spec corrections" : "", + "\\\\attr{lin-lin}" : "enums::Interpolation::linlin", + + "// ***ENUMERATOR boundaryCondition" : "", + "EliminateShiftFunction" : "enums::BoundaryCondition::EliminateShiftFunction", + "NegativeOrbitalMomentum" : "enums::BoundaryCondition::NegativeOrbitalMomentum", + "Brune" : "enums::BoundaryCondition::Brune", + "Given" : "enums::BoundaryCondition::Given", + + "// ***ENUMERATOR contributorType" : "", + "ContactPerson" : "enums::ContributorType::ContactPerson", + "DataCollector" : "enums::ContributorType::DataCollector", + "DataCurator" : "enums::ContributorType::DataCurator", + "DataManager" : "enums::ContributorType::DataManager", + "Distributor" : "enums::ContributorType::Distributor", + "Editor" : "enums::ContributorType::Editor", + "HostingInstitution" : "enums::ContributorType::HostingInstitution", + "Producer" : "enums::ContributorType::Producer", + "ProjectLeader" : "enums::ContributorType::ProjectLeader", + "ProjectManager" : "enums::ContributorType::ProjectManager", + "ProjectMember" : "enums::ContributorType::ProjectMember", + "RegistrationAgency" : "enums::ContributorType::RegistrationAgency", + "RegistrationAuthority" : "enums::ContributorType::RegistrationAuthority", + "RelatedPerson" : "enums::ContributorType::RelatedPerson", + "Researcher" : "enums::ContributorType::Researcher", + "ResearchGroup" : "enums::ContributorType::ResearchGroup", + "RightsHolder" : "enums::ContributorType::RightsHolder", + "Sponsor" : "enums::ContributorType::Sponsor", + "Supervisor" : "enums::ContributorType::Supervisor", + "WorkPackageLeader" : "enums::ContributorType::WorkPackageLeader", + "Other" : "enums::ContributorType::Other", + + "// ***ENUMERATOR dateType" : "", + "accepted" : "enums::DateType::accepted", + "available" : "enums::DateType::available", + "copyrighted" : "enums::DateType::copyrighted", + "collected" : "enums::DateType::collected", + "created" : "enums::DateType::created", + "issued" : "enums::DateType::issued", + "submitted" : "enums::DateType::submitted", + "updated" : "enums::DateType::updated", + "valid" : "enums::DateType::valid", + "withdrawn" : "enums::DateType::withdrawn", + + "// ***ENUMERATOR decayType" : "", + "SF" : "enums::DecayType::SpontaneousFission", + "beta-" : "enums::DecayType::BetaMinus", + "beta+" : "enums::DecayType::BetaPlus", + "EC" : "enums::DecayType::ElectronCapture", + "electroMagnetic" : "enums::DecayType::ElectroMagnetic", + "IT" : "enums::DecayType::IsomericTransition", + "n" : "enums::DecayType::Neutron", + "p" : "enums::DecayType::Proton", + "d" : "enums::DecayType::Deuteron", + "t" : "enums::DecayType::Triton", + "alpha" : "enums::DecayType::Alpha", + "atomicRelaxation" : "enums::DecayType::AtomicRelaxation", + + "// ***ENUMERATOR encoding" : "", + "ascii" : "enums::Encoding::ascii", + "utf8" : "enums::Encoding::utf8", + + "// ***ENUMERATOR energy" : "", + "eV" : "enums::Energy::eV", + "MeV" : "enums::Energy::MeV", + + "// ***ENUMERATOR frame" : "", + "lab" : "enums::Frame::lab", + "centerOfMass" : "enums::Frame::centerOfMass", + + "// ***ENUMERATOR gridStyle" : "", + "none" : "enums::GridStyle::none", + "points" : "enums::GridStyle::points", + "boundaries" : "enums::GridStyle::boundaries", + "parameters" : "enums::GridStyle::parameters", + + "// ***ENUMERATOR hashAlgorithm" : "", + "md5" : "enums::HashAlgorithm::md5", + "sha1" : "enums::HashAlgorithm::sha1", + + "// ***ENUMERATOR interaction" : "", + "nuclear" : "enums::Interaction::nuclear", + "atomic" : "enums::Interaction::atomic", + "thermalNeutronScatteringLaw" : "enums::Interaction::thermalNeutronScatteringLaw", + + "// ***ENUMERATOR interpolation" : "", + "flat" : "enums::Interpolation::flat", + "charged-particle" : "enums::Interpolation::chargedparticle", + "lin-lin" : "enums::Interpolation::linlin", + "lin-log" : "enums::Interpolation::linlog", + "log-lin" : "enums::Interpolation::loglin", + "log-log" : "enums::Interpolation::loglog", + + "// ***ENUMERATOR interpolationQualifier" : "", + "direct" : "enums::InterpolationQualifier::direct", + "unitBase" : "enums::InterpolationQualifier::unitBase", + "correspondingEnergies" : "enums::InterpolationQualifier::correspondingEnergies", + "correspondingPoints" : "enums::InterpolationQualifier::correspondingPoints", + + "// ***ENUMERATOR length" : "", + "m" : "enums::Length::m", + "cm" : "enums::Length::cm", + "fm" : "enums::Length::fm", + + "// ***ENUMERATOR parity" : "", + "-1" : "enums::Parity::minus", + "+1" : "enums::Parity::plus", + + "// ***ENUMERATOR relationType" : "", + "IsCitedBy" : "enums::RelationType::IsCitedBy", + "Cites" : "enums::RelationType::Cites", + "IsSupplementTo" : "enums::RelationType::IsSupplementTo", + "IsSupplementedBy" : "enums::RelationType::IsSupplementedBy", + "IsContinuedBy" : "enums::RelationType::IsContinuedBy", + "Continues" : "enums::RelationType::Continues", + "Describes" : "enums::RelationType::Describes", + "IsDescribedBy" : "enums::RelationType::IsDescribedBy", + "HasMetadata" : "enums::RelationType::HasMetadata", + "IsMetadataFor" : "enums::RelationType::IsMetadataFor", + "HasVersion" : "enums::RelationType::HasVersion", + "IsVersionOf" : "enums::RelationType::IsVersionOf", + "IsNewVersionOf" : "enums::RelationType::IsNewVersionOf", + "IsPreviousVersionOf" : "enums::RelationType::IsPreviousVersionOf", + "IsPartOf" : "enums::RelationType::IsPartOf", + "HasPart" : "enums::RelationType::HasPart", + "IsPublishedIn" : "enums::RelationType::IsPublishedIn", + "IsReferencedBy" : "enums::RelationType::IsReferencedBy", + "References" : "enums::RelationType::References", + "IsDocumentedBy" : "enums::RelationType::IsDocumentedBy", + "Documents" : "enums::RelationType::Documents", + "IsCompiledBy" : "enums::RelationType::IsCompiledBy", + "Compiles" : "enums::RelationType::Compiles", + "IsVariantFormOf" : "enums::RelationType::IsVariantFormOf", + "IsOriginalFormOf" : "enums::RelationType::IsOriginalFormOf", + "IsIdenticalTo" : "enums::RelationType::IsIdenticalTo", + "IsReviewedBy" : "enums::RelationType::IsReviewedBy", + "Reviews" : "enums::RelationType::Reviews", + "IsDerivedFrom" : "enums::RelationType::IsDerivedFrom", + "IsSourceOf" : "enums::RelationType::IsSourceOf", + "IsRequiredBy" : "enums::RelationType::IsRequiredBy", + "Requires" : "enums::RelationType::Requires", + "Obsoletes" : "enums::RelationType::Obsoletes", + "IsObsoletedBy" : "enums::RelationType::IsObsoletedBy", + + "// ***ENUMERATOR storageOrder" : "", + "row-major" : "enums::StorageOrder::rowMajor", + "column-major" : "enums::StorageOrder::columnMajor" + } + } +} diff --git a/versions/GNDS-v2.0/compile b/versions/GNDS-v2.0/compile new file mode 100755 index 000000000..e7d00a51b --- /dev/null +++ b/versions/GNDS-v2.0/compile @@ -0,0 +1,36 @@ +#!/bin/bash + +# Simple compilation command for the example codes in this directory. +# We assume here that GNDStk points to the base GNDStk/ directory of +# the repo, and that deps points to GNDStk/build/_deps/. (Which also +# means essentially that you should build GNDStk's test suite first.) +# You may need tweaks below, e.g. to /usr... stuff. +COMPILE=" + clang++ -std=c++17 + -IGNDStk/src + -IGNDStk/simple-json/src + -IGNDS/src + -Ideps/pugixml-adapter-src/src/src + -Ideps/hdf5-src/include + -Ideps/log-src/src + -Ideps/spdlog-src/include + -I/usr/include/hdf5/serial + -DHIGHFIVE_USE_BOOST=OFF + -L/usr/lib/x86_64-linux-gnu/hdf5/serial + -lhdf5 + -fno-show-column + -Wno-unused-command-line-argument + -Wall -Wextra -Wpedantic " + +# If the compiler and/or flags are changed, consider deleting pugixml.o +# so that it gets compiled again, given this conditional... +if [ ! -f "pugixml.o" ]; then + echo 'Compiling pugixml.cpp...' + $COMPILE deps/pugixml-adapter-src/src/src/pugixml.cpp -c -o pugixml.o +fi + +# Compile examples +echo 'Compiling the examples...' +$COMPILE 1.cpp pugixml.o -o 1 & +$COMPILE 2.cpp pugixml.o -o 2 & +wait $(jobs -p) diff --git a/versions/GNDS-v2.0/g2d.json b/versions/GNDS-v2.0/g2d.json new file mode 100644 index 000000000..6610b0c5d --- /dev/null +++ b/versions/GNDS-v2.0/g2d.json @@ -0,0 +1,26 @@ +{ + "namespace": "g2d", + + "array": { + "metadata": { + "shape": { + "type": "string", + "required": true + }, + "compression": { + "type": "string", + "required": false + }, + "symmetry": { + "type": "string", + "required": false + } + }, + "children": { + "values": { + "times": "1", + "required": true + } + } + } +} diff --git a/versions/GNDS-v2.0/g3d.json b/versions/GNDS-v2.0/g3d.json new file mode 100644 index 000000000..4083b0162 --- /dev/null +++ b/versions/GNDS-v2.0/g3d.json @@ -0,0 +1,72 @@ +{ + "namespace": "g3d", + + "array": { + "metadata": { + "shape": { + "type": "string", + "required": true + }, + "compression": { + "type": "string", + "required": false + }, + "symmetry": { + "type": "string", + "required": false + } + }, + "children": { + "starts": { + "REMARK": "use the with metadatum label == 'start'", + "name": "values", + "label": "starts", + "times": "1", + "required": false + }, + "lengths": { + "REMARK": "use the with metadatum label == 'lengths'", + "name": "values", + "label": "lengths", + "times": "1", + "required": false + }, + "values": { + "times": "1", + "required": true, + "REMARK": "use the node that has no metadata", + "filter": "[](auto &node) { return node.metadata.size() == 0; }" + } + } + }, + + "starts": { + "name": "values", + "metadata": { + "valueType": { + "type": "string", + "required": true + }, + "label": { + "type": "string", + "required": true + } + }, + "vector": "int" + }, + + "lengths": { + "name": "values", + "metadata": { + "valueType": { + "type": "string", + "required": true + }, + "label": { + "type": "string", + "required": true + } + }, + "vector": "int" + } +} diff --git a/versions/GNDS-v2.0/general.json b/versions/GNDS-v2.0/general.json new file mode 100644 index 000000000..37484cb7b --- /dev/null +++ b/versions/GNDS-v2.0/general.json @@ -0,0 +1,4143 @@ +{ + "namespace": "general", + + "CoulombPlusNuclearElastic": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "href": { + "type": "string", + "required": false + }, + "pid": { + "type": "string", + "required": false + }, + "productFrame": { + "type": "string", + "required": false + }, + "identicalParticles": { + "type": "bool", + "required": false + } + }, + "children": { + "RutherfordScattering": { + "times": "1", + "required": false + }, + "nuclearAmplitudeExpansion": { + "times": "1", + "required": false + }, + "nuclearPlusInterference": { + "times": "1", + "required": false + } + } + }, + + "RutherfordScattering": { + }, + + "nuclearAmplitudeExpansion": { + "children": { + "nuclearTerm": { + "times": "1", + "required": true + }, + "realInterferenceTerm": { + "times": "1", + "required": true + }, + "imaginaryInterferenceTerm": { + "times": "1", + "required": true + } + } + }, + + "nuclearTerm": { + "children": { + "regions2d": { + "times": "1", + "required": false + }, + "XYs2d": { + "times": "1", + "required": false + } + } + }, + + "realInterferenceTerm": { + "children": { + "regions2d": { + "times": "1", + "required": false + }, + "XYs2d": { + "times": "1", + "required": false + } + } + }, + + "imaginaryInterferenceTerm": { + "children": { + "regions2d": { + "times": "1", + "required": false + }, + "XYs2d": { + "times": "1", + "required": false + } + } + }, + + "nuclearPlusInterference": { + "metadata": { + "muCutoff": { + "type": "double", + "required": true + } + }, + "children": { + "crossSection": { "namespace": "reduced", + "times": "1", + "required": true + }, + "distribution": { "namespace": "reduced", + "times": "1", + "required": true + } + } + }, + + "MadlandNix": { + "children": { + "EFL": { + "times": "1", + "required": true + }, + "EFH": { + "times": "1", + "required": true + }, + "T_M": { + "times": "1", + "required": true + } + } + }, + + "EFL": { + "metadata": { + "value": { + "type": "double", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "EFH": { + "metadata": { + "value": { + "type": "double", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "T_M": { + "children": { + "XYs1d": { + "times": "1", + "required": true + } + } + }, + + "atomic": { + "children": { + "configurations": { + "times": "1", + "required": true + } + } + }, + + "configurations": { + "children": { + "configuration": { + "times": "1+", + "required": true + } + } + }, + + "configuration": { + "metadata": { + "subshell": { + "type": "string", + "required": true + }, + "electronNumber": { + "type": "double", "//":"is 'double' always correct for this?", + "required": true + } + }, + "children": { + "bindingEnergy": { + "times": "1", + "required": true + }, + "decayData": { + "times": "1+", + "required": true + } + } + }, + + "bindingEnergy": { + "children": { + "double": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "averageEnergies": { + "children": { + "averageEnergy": { + "times": "1+", + "required": true + } + } + }, + + "averageEnergy": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "value": { + "type": "double", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + }, + "children": { + "uncertainty": { + "times": "1", + "required": false + } + } + }, + + "standard": { + "children": { + "double": { "namespace": "reduced", + "times": "1", + "required": true + } + } + }, + + "spectra": { + "children": { + "spectrum": { + "times": "1+", + "required": true + } + } + }, + + "spectrum": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "pid": { + "type": "string", + "required": true + } + }, + "children": { + "discrete": { + "times": "1+", + "required": true + }, + "continuum": { + "times": "1", + "required": false + } + } + }, + + "discrete": { + "metadata": { + "type": { + "type": "string", + "required": false + } + }, + "children": { + "intensity": { + "times": "1", + "required": true + }, + "energy": { + "times": "1", + "required": true + }, + "internalConversionCoefficients": { + "times": "1", + "required": false + }, + "positronEmissionIntensity": { + "times": "1", + "required": false + } + } + }, + + "continuum": { + "children": { + "XYs1d": { + "times": "1", + "required": true + } + } + }, + + "positronEmissionIntensity": { + "metadata": { + "value": { + "type": "double", + "required": true + } + }, + "children": { + "uncertainty": { + "times": "1", + "required": false + } + } + }, + + "intensity": { + "metadata": { + "value": { + "type": "double", + "required": true + } + }, + "children": { + "uncertainty": { + "times": "1", + "required": false + } + } + }, + + "internalConversionCoefficients": { + "children": { + "shell": { + "times": "1+", + "required": true + } + } + }, + + "incidentEnergies": { + "children": { + "incidentEnergy": { + "times": "1+", + "required": true + } + } + }, + + "incidentEnergy": { + "metadata": { + "label": { + "type": "string", + "required": true + } + }, + "children": { + "energy": { + "times": "1", + "required": true + }, + "yields": { + "times": "1", + "required": true + } + } + }, + + "covarianceSections": { + "children": { + "covarianceSection": { + "times": "1+", + "required": true + } + } + }, + + "covarianceSection": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "crossTerm": { + "type": "bool", + "required": false + } + }, + "children": { + "rowData": { + "times": "1", + "required": true + }, + "columnData": { + "times": "1", + "required": false + }, + "covarianceMatrix": { + "times": "1", + "required": false + }, + "mixed": { + "times": "1", + "required": false + }, + "sum": { + "times": "1", + "required": false + } + } + }, + + "mixed": { + "metadata": { + "label": { + "type": "string", + "required": true + } + }, + "children": { + "covarianceMatrix": { + "times": "1+", + "required": true + }, + "sum": { + "times": "1+", + "required": false + }, + "shortRangeSelfScalingVariance": { + "times": "1", + "required": false + } + } + }, + + "// I noticed that 'label' always looked like an int, in particular": "", + "// 1, in the following. As elsewhere, we'll make it a string.": "", + "shortRangeSelfScalingVariance": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "type": { + "type": "string", + "required": true + }, + "dependenceOnProcessedGroupWidth": { + "type": "string", + "required": true + } + }, + "children": { + "gridded2d": { + "times": "1", + "required": true + } + } + }, + + "sum": { + "metadata": { + "label": { + "type": "string", + "required": false + }, + "domainMin": { + "type": "double", + "required": false + }, + "domainMax": { + "type": "double", + "required": false + }, + "domainUnit": { + "type": "string", + "required": false + } + }, + "children": { + "summand": { + "times": "1+", + "required": true + } + } + }, + + "summand": { + "metadata": { + "ENDF_MFMT": { + "type": "string", + "required": false + }, + "coefficient": { + "type": "string", + "required": false + }, + "href": { + "type": "string", + "required": false + } + } + }, + + "rowData": { + "metadata": { + "ENDF_MFMT": { + "type": "string", + "required": false + }, + "dimension": { + "type": "int", + "required": false + }, + "href": { + "type": "string", + "required": true + } + }, + "children": { + "slices": { + "times": "1", + "required": false + } + } + }, + + "columnData": { + "metadata": { + "ENDF_MFMT": { + "type": "string", + "required": false + }, + "href": { + "type": "string", + "required": true + } + }, + "children": { + "slices": { + "times": "1", + "required": false + } + } + }, + + "slices": { + "children": { + "slice": { + "times": "1+", + "required": true + } + } + }, + + "slice": { + "metadata": { + "dimension": { + "type": "int", + "required": true + }, + "domainValue": { + "type": "int", + "required": false + }, + "domainMin": { + "type": "double", + "required": false + }, + "domainMax": { + "type": "double", + "required": false + }, + "domainUnit": { + "type": "string", + "required": false + } + } + }, + + "covarianceMatrix": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "type": { + "type": "string", + "required": true + }, + "productFrame": { + "type": "string", + "required": false + } + }, + "children": { + "gridded2d": { + "times": "1", + "required": true + } + } + }, + + "parameterCovariances": { + "children": { + "parameterCovariance": { + "times": "1+", + "required": true + }, + "averageParameterCovariance": { + "times": "1+", + "required": false + } + } + }, + + "averageParameterCovariance": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "crossTerm": { + "type": "bool", + "required": false + } + }, + "children": { + "covarianceMatrix": { + "times": "1", + "required": true + }, + "rowData": { + "times": "1", + "required": true + }, + "columnData": { + "times": "1", + "required": false + } + } + }, + + "parameterCovariance": { + "metadata": { + "label": { + "type": "string", + "required": true + } + }, + "children": { + "rowData": { + "times": "1", + "required": true + }, + "parameterCovarianceMatrix": { + "times": "1", + "required": true + } + } + }, + + "parameterCovarianceMatrix": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "type": { + "type": "string", + "required": true + } + }, + "children": { + "array": { "namespace": "g3d", + "times": "1", + "required": true + }, + "parameters": { + "times": "1", + "required": true + } + } + }, + + "parameters": { + "children": { + "parameterLink": { + "times": "1+", + "required": true + } + } + }, + + "parameterLink": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "href": { + "type": "string", + "required": true + }, + "nParameters": { + "type": "int", + "required": false + }, + "matrixStartIndex": { + "type": "int", + "required": false + } + } + }, + + "boundAtomCrossSection": { + "metadata": { + "value": { + "type": "double", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "e_critical": { + "metadata": { + "value": { + "type": "double", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "e_max": { + "metadata": { + "value": { + "type": "double", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "scatteringAtom": { + "metadata": { + "pid": { + "type": "string", + "required": true + }, + "numberPerMolecule": { + "type": "int", + "required": true + }, + "primaryScatterer": { + "type": "bool", + "required": false + } + }, + "children": { + "mass": { + "times": "1", + "required": true + }, + "e_critical": { + "times": "1", + "required": false + }, + "e_max": { + "times": "1", + "required": true + }, + "boundAtomCrossSection": { + "times": "1", + "required": true + }, + "selfScatteringKernel": { + "times": "1", + "required": true + }, + "T_effective": { + "times": "1", + "required": false + } + } + }, + + "scatteringAtoms": { + "children": { + "scatteringAtom": { + "times": "1+", + "required": true + } + } + }, + + "selfScatteringKernel": { + "metadata": { + "symmetric": { + "type": "bool", + "required": false + } + }, + "children": { + "gridded3d": { + "times": "1", + "required": false + }, + "SCTApproximation": { + "times": "1", + "required": false + }, + "freeGasApproximation": { + "times": "1", + "required": false + } + } + }, + + "freeGasApproximation": { + }, + + "S_table": { + "children": { + "gridded2d": { + "times": "1", + "required": true + } + } + }, + + "T_effective": { + "children": { + "XYs1d": { + "times": "1", + "required": true + } + } + }, + + "thermalNeutronScatteringLaw": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "href": { + "type": "string", + "required": true + } + } + }, + + "thermalNeutronScatteringLaw1d": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "href": { + "type": "string", + "required": true + } + } + }, + + "thermalNeutronScatteringLaw_coherentElastic": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "pid": { + "type": "string", + "required": true + }, + "productFrame": { + "type": "string", + "required": true + } + }, + "children": { + "S_table": { + "times": "1", + "required": true + } + } + }, + + "thermalNeutronScatteringLaw_incoherentElastic": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "pid": { + "type": "string", + "required": true + }, + "productFrame": { + "type": "string", + "required": true + } + }, + "children": { + "boundAtomCrossSection": { + "times": "1", + "required": true + }, + "DebyeWallerIntegral": { + "times": "1", + "required": true + } + } + }, + + "thermalNeutronScatteringLaw_incoherentInelastic": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "pid": { + "type": "string", + "required": true + }, + "productFrame": { + "type": "string", + "required": true + }, + "primaryScatterer": { + "type": "string", + "required": true + }, + "calculatedAtThermal": { + "type": "bool", + "required": false + } + }, + "children": { + "scatteringAtoms": { + "times": "1", + "required": true + } + } + }, + + "unorthodox": { + "metadata": { + "id": { + "type": "string", + "required": true + } + }, + "children": { + "mass": { + "times": "1", + "required": true + } + } + }, + + "unorthodoxes": { + "children": { + "unorthodox": { + "times": "1+", + "required": true + } + } + }, + + "SCTApproximation": { + }, + + "DebyeWallerIntegral": { + "children": { + "XYs1d": { + "times": "1", + "required": true + } + } + }, + + "documentation": { + "children": { + "authors": { + "times": "1", + "required": true + }, + "dates": { + "times": "1", + "required": true + }, + "title": { + "times": "1", + "required": true + }, + "body": { + "times": "1", + "required": true + }, + "endfCompatible": { + "times": "1", + "required": false + } + } + }, + + "authors": { + "children": { + "author": { + "times": "1+", + "required": true + } + } + }, + + "author": { + "metadata": { + "name": { + "type": "string", + "required": true + } + } + }, + + "dates": { + "children": { + "date": { + "times": "1+", + "required": true + } + } + }, + + "date": { + "metadata": { + "value": { + "type": "string", + "required": true + }, + "dateType": { + "type": "string", + "required": true + } + } + }, + + "title": { + "string": true, + "cdata": true + }, + + "body": { + "string": true, + "cdata": true + }, + + "endfCompatible": { + "string": true, + "cdata": true + }, + + "applicationData": { + "children": { + "institution": { + "times": "1", + "required": true + } + } + }, + + "institution": { + "metadata": { + "label": { + "type": "string", + "required": false + } + }, + "children": { + "ENDFconversionFlags": { + "times": "1", + "required": true + } + } + }, + + "double": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "value": { + "type": "double", + "required": true + }, + "unit": { + "type": "string", + "required": false + } + }, + "children": { + "uncertainty": { + "times": "1", + "required": false + } + } + }, + + "string": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "value": { + "type": "string", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "integer": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "value": { + "type": "int", + "required": true + }, + "unit": { + "type": "string", + "required": false + } + } + }, + + "aliases": { + "children": { + "alias": { + "times": "1+", + "required": false + }, + "metaStable": { + "times": "1+", + "required": false + } + } + }, + + "alias": { + "metadata": { + "id": { + "type": "string", + "required": false + }, + "pid": { + "type": "string", + "required": false + } + } + }, + + "ENDFconversionFlags": { + "metadata": { + "flags": { + "type": "string", + "required": false + }, + "href": { + "type": "string", + "required": false + } + }, + "children": { + "conversion": { + "times": "1+", + "required": true + } + } + }, + + "conversion": { + "metadata": { + "flags": { + "type": "string", + "required": true + }, + "href": { + "type": "string", + "required": true + } + } + }, + + "link": { + "metadata": { + "href": { + "type": "string", + "required": true + } + } + }, + + "externalFiles": { + "children": { + "externalFile": { + "times": "1+", + "required": true + } + } + }, + + "externalFile": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "path": { + "type": "string", + "required": true + }, + "checksum": { + "type": "string", + "required": false + }, + "algorithm": { + "type": "string", + "required": false + } + } + }, + + "decayData": { + "children": { + "decayModes": { + "times": "1", + "required": true + }, + "averageEnergies": { + "times": "1", + "required": false + } + } + }, + + "decayModes": { + "children": { + "decayMode": { + "times": "1+", + "required": true + } + } + }, + + "decayMode": { + "metadata": { + "label": { + "type": "string", + "required": false + }, + "mode": { + "type": "string", + "required": false + } + }, + "children": { + "probability": { + "times": "1", + "required": true + }, + "decayPath": { + "times": "1", + "required": true + }, + "photonEmissionProbabilities": { + "times": "1", + "required": false + }, + "Q": { + "times": "1", + "required": false + }, + "spectra": { + "times": "1", + "required": false + } + } + }, + + "elapsedTimes": { + "children": { + "elapsedTime": { + "times": "1+", + "required": true + } + } + }, + + "elapsedTime": { + "metadata": { + "label": { + "type": "string", + "required": true + } + }, + "children": { + "time": { + "times": "1", + "required": true + }, + "yields": { + "times": "1", + "required": false + }, + "incidentEnergies": { + "times": "1", + "required": false + } + } + }, + + "time": { + "children": { + "double": { "namespace": "general", + "times": "1", + "required": false + }, + "string": { + "times": "1", + "required": false + } + } + }, + + "axes": { + "children": { + "axis": { + "times": "1+", + "required": true + }, + "grid": { + "times": "1+", + "required": false + } + } + }, + + "axis": { + "metadata": { + "index": { + "type": "int", + "required": true + }, + "label": { + "type": "string", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "grid": { + "metadata": { + "index": { + "type": "int", + "required": true + }, + "label": { + "type": "string", + "required": true + }, + "unit": { + "type": "string", + "required": true + }, + "style": { + "type": "string", + "required": true + }, + "interpolation": { + "type": "string", + "required": false + } + }, + "children": { + "link": { + "times": "1", + "required": false + }, + "values": { + "times": "1", + "required": false + } + } + }, + + "fraction": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "value": { + "type": "string", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "shell": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "value": { + "type": "double", + "required": true + } + }, + "children": { + "uncertainty": { + "times": "1", + "required": false + } + } + }, + + "temperature": { + "metadata": { + "value": { + "type": "double", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "yields": { + "children": { + "nuclides": { "namespace": "reduced", + "times": "1", + "required": true + }, + "values": { + "times": "1", + "required": true + }, + "uncertainty": { + "times": "1", + "required": true + } + } + }, + + "decayPath": { + "children": { + "decay": { + "times": "1+", + "required": true + } + } + }, + + "decay": { + "metadata": { + "index": { + "type": "int", + "required": true + }, + "mode": { + "type": "string", + "required": false + }, + "complete": { + "type": "bool", + "required": false + } + }, + "children": { + "products": { "namespace": "general", + "times": "1", + "required": false + } + } + }, + + "products": { + "children": { + "product": { "namespace": "general", + "times": "1+", + "required": false + } + } + }, + + "product": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "pid": { + "type": "string", + "required": true + } + }, + "children": { + "multiplicity": { + "times": "1", + "required": false + }, + "distribution": { "namespace": "general", + "times": "1", + "required": false + }, + "outputChannel": { "namespace": "reduced", + "times": "1", + "required": false + }, + "averageProductEnergy": { + "times": "1", + "required": false + } + } + }, + + "distribution": { + "children": { + "thermalNeutronScatteringLaw": { + "times": "1", + "required": false + }, + "uncorrelated": { + "times": "1", + "required": false + }, + "unspecified": { + "times": "1", + "required": false + }, + "branching3d": { + "times": "1", + "required": false + }, + "angularTwoBody": { + "times": "1", + "required": false + }, + "energyAngular": { + "times": "1", + "required": false + }, + "KalbachMann": { + "times": "1", + "required": false + }, + "angularEnergy": { + "times": "1", + "required": false + }, + "CoulombPlusNuclearElastic": { + "times": "1", + "required": false + }, + "coherentPhotonScattering": { + "times": "1", + "required": false + }, + "incoherentPhotonScattering": { + "times": "1", + "required": false + } + } + }, + + "mass": { + "metadata": { + "value": { + "type": "double", + "required": false + }, + "unit": { + "type": "string", + "required": false + } + }, + "children": { + "double": { "namespace": "general", + "times": "1", + "required": false + } + } + }, + + "spin": { + "children": { + "fraction": { + "times": "1", + "required": true + } + } + }, + + "parity": { + "children": { + "integer": { + "times": "1", + "required": true + } + } + }, + + "charge": { + "children": { + "integer": { + "times": "1", + "required": true + } + } + }, + + "halflife": { + "children": { + "string": { + "times": "1", + "required": false + }, + "double": { "namespace": "general", + "times": "1", + "required": false + } + } + }, + + "baryons": { + "children": { + "baryon": { + "times": "1+", + "required": true + } + } + }, + + "baryon": { + "metadata": { + "id": { + "type": "string", + "required": true + } + }, + "children": { + "mass": { + "times": "1", + "required": true + }, + "spin": { + "times": "1", + "required": true + }, + "parity": { + "times": "1", + "required": true + }, + "charge": { + "times": "1", + "required": true + }, + "halflife": { + "times": "1", + "required": true + }, + "decayData": { + "times": "1", + "required": false + } + } + }, + + "nucleus": { + "metadata": { + "id": { + "type": "string", + "required": true + }, + "index": { + "type": "int", + "required": true + } + }, + "children": { + "mass": { + "times": "1", + "required": false + }, + "spin": { + "times": "1", + "required": false + }, + "parity": { + "times": "1", + "required": false + }, + "charge": { + "times": "1", + "required": true + }, + "halflife": { + "times": "1", + "required": false + }, + "energy": { + "times": "1", + "required": true + }, + "decayData": { + "times": "1", + "required": false + } + } + }, + + "metaStable": { + "metadata": { + "id": { + "type": "string", + "required": true + }, + "pid": { + "type": "string", + "required": true + }, + "metaStableIndex": { + "type": "int", + "required": true + } + } + }, + + "covariance": { + "metadata": { + "label": { + "type": "string", + "required": false + }, + "href": { + "type": "string", + "required": false + } + }, + "children": { + "array": { "namespace": "general", + "times": "1", + "required": false + } + } + }, + + "productYields": { + "children": { + "productYield": { + "times": "1+", + "required": true + } + } + }, + + "productYield": { + "metadata": { + "label": { + "type": "string", + "required": false + } + }, + "children": { + "nuclides": { "namespace": "reduced", + "times": "1", + "required": false + }, + "elapsedTimes": { + "times": "1", + "required": true + } + } + }, + + "// remark": [ + "Notably, the existing sfy-*.xml files seem to have three completely", + "different nodes. One contains some number of ", + "child nodes. Another, always located inside nodes,", + "contains an array of strings, for example:", + " Cr66 Cr67 Cr68 Cr70 ... ", + "Finally, another, always located in nodes, always (in the", + "present collection of sfy-*.xml files, at least) has only an 'href'", + "string metadatum. The last two appear to be intended to represent", + "the same thing, with one possibly just referring to the other instead", + "of providing the vector of strings directly. With this in mind, I've", + "provided one spec for the first of the above varieties of", + " nodes, and one more to handle the second and third types." + ], + + "nuclides": { + "children": { + "nuclide": { + "times": "1+", + "required": true + } + } + }, + + "nuclide": { + "metadata": { + "id": { + "type": "string", + "required": true + } + }, + "children": { + "mass": { + "times": "1", + "required": false + }, + "charge": { + "times": "1", + "required": true + }, + "nucleus": { + "times": "1", + "required": true + }, + "decayData": { + "times": "1", + "required": false + }, + "fissionFragmentData": { + "times": "1", + "required": false + } + } + }, + + "isotopes": { + "children": { + "isotope": { + "times": "1+", + "required": true + } + } + }, + + "isotope": { + "metadata": { + "symbol": { + "type": "string", + "required": true + }, + "A": { + "type": "int", + "required": true + } + }, + "children": { + "nuclides": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "array": { + "metadata": { + "shape": { + "remark": "comma-separated pair of ints; use string for now", + "type": "string", + "required": true + }, + "compression": { + "type": "string", + "required": false + } + }, + "children": { + "values": { + "times": "1", + "required": true + } + } + }, + + "values": { + "vector": "double" + }, + + "reactions": { + "children": { + "reaction": { + "times": "1+", + "required": true + } + } + }, + + "reaction": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "ENDF_MT": { + "type": "int", + "required": true + }, + "fissionGenre": { + "type": "string", + "required": false + } + }, + "children": { + "crossSection": { "namespace": "general", + "times": "1", + "required": true + }, + "outputChannel": { "namespace": "general", + "times": "1", + "required": true + }, + "doubleDifferentialCrossSection": { + "times": "1", + "required": false + } + } + }, + + "crossSection": { + "children": { + "XYs1d": { + "times": "1", + "required": false + }, + "regions1d": { + "times": "1", + "required": false + }, + "reference": { + "times": "1", + "required": false + }, + "resonancesWithBackground": { + "times": "1", + "required": false + }, + "CoulombPlusNuclearElastic": { + "times": "1", + "required": false + }, + "thermalNeutronScatteringLaw1d": { + "times": "1", + "required": false + } + } + }, + + "outputChannel": { + "metadata": { + "genre": { + "type": "string", + "required": true + }, + "process": { + "type": "string", + "required": false + } + }, + "children": { + "Q": { + "times": "1", + "required": true + }, + "products": { "namespace": "general", + "times": "1", + "required": false + }, + "fissionFragmentData": { + "times": "1", + "required": false + } + } + }, + + "doubleDifferentialCrossSection": { + "children": { + "CoulombPlusNuclearElastic": { + "times": "1", + "required": false + }, + "coherentPhotonScattering": { + "times": "1", + "required": false + }, + "incoherentPhotonScattering": { + "times": "1", + "required": false + }, + "thermalNeutronScatteringLaw_coherentElastic": { + "times": "1", + "required": false + }, + "thermalNeutronScatteringLaw_incoherentElastic": { + "times": "1", + "required": false + }, + "thermalNeutronScatteringLaw_incoherentInelastic": { + "times": "1", + "required": false + } + } + }, + + "projectileEnergyDomain": { + "metadata": { + "min": { + "type": "double", + "required": true + }, + "max": { + "type": "double", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "Q": { + "children": { + "double": { "namespace": "general", + "times": "1", + "required": false + }, + "constant1d": { + "times": "1", + "required": false + } + } + }, + + "multiplicity": { + "children": { + "constant1d": { + "times": "1", + "required": false + }, + "XYs1d": { + "times": "1", + "required": false + }, + "regions1d": { + "times": "1", + "required": false + }, + "polynomial1d": { "namespace": "general", + "times": "1", + "required": false + }, + "reference": { + "times": "1", + "required": false + }, + "branching1d": { + "times": "1", + "required": false + }, + "branching3d": { + "times": "1", + "required": false + }, + "unspecified": { + "times": "1", + "required": false + } + } + }, + + "gridded2d": { + "children": { + "axes": { + "times": "1", + "required": true + }, + "array": { "namespace": "g2d", + "times": "1", + "required": true + } + } + }, + + "gridded3d": { + "children": { + "axes": { + "times": "1", + "required": true + }, + "array": { "namespace": "g3d", + "times": "1", + "required": true + } + } + }, + + "probability": { + "children": { + "double": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "styles": { + "children": { + "evaluated": { + "times": "1", + "required": true + }, + "crossSectionReconstructed": { + "times": "1", + "required": false + } + } + }, + + "constant1d": { + "metadata": { + "label": { + "type": "string", + "required": false + }, + "value": { + "type": "double", + "required": true + }, + "domainMin": { + "type": "double", + "required": true + }, + "domainMax": { + "type": "double", + "required": true + } + }, + "children": { + "axes": { + "times": "1", + "required": true + } + } + }, + + "polynomial1d": { + "metadata": { + "label": { + "type": "string", + "required": false + }, + "domainMin": { + "type": "double", + "required": true + }, + "domainMax": { + "type": "double", + "required": true + } + }, + "children": { + "axes": { + "times": "1", + "required": true + }, + "values": { + "times": "1", + "required": true + }, + "uncertainty": { + "times": "1", + "required": false + } + } + }, + + "function1ds": { + "children": { + "Legendre": { + "times": "1+", + "required": true + }, + "XYs1d": { + "times": "1+", + "required": false + }, + "regions1d": { + "times": "1+", + "required": false + } + } + }, + + "uncertainty": { + "children": { + "covariance": { + "times": "1", + "required": false + }, + "standard": { + "times": "1", + "required": false + }, + "listOfCovariances": { + "times": "1", + "required": false + }, + "polynomial1d": { "namespace": "reduced", + "times": "1", + "required": false + } + } + }, + + "XYs1d": { + "metadata": { + "label": { + "type": "string", + "required": false + }, + "index": { + "type": "int", + "required": false + }, + "interpolation": { + "type": "string", + "required": false + }, + "outerDomainValue": { + "type": "double", + "required": false + } + }, + "children": { + "axes": { + "times": "1", + "required": false + }, + "values": { + "times": "1", + "required": true + }, + "uncertainty": { + "times": "1", + "required": false + } + } + }, + + "energy": { + "metadata": { + "value": { + "type": "double", + "required": false + }, + "unit": { + "type": "string", + "required": false + } + }, + "children": { + "double": { "namespace": "general", + "times": "1", + "required": false + }, + "uncertainty": { + "times": "1", + "required": false + }, + "NBodyPhaseSpace": { + "times": "1", + "required": false + }, + "primaryGamma": { + "times": "1", + "required": false + }, + "discreteGamma": { + "times": "1", + "required": false + }, + "XYs2d": { + "times": "1", + "required": false + }, + "generalEvaporation": { + "times": "1", + "required": false + }, + "evaporation": { + "times": "1", + "required": false + }, + "weightedFunctionals": { + "times": "1", + "required": false + }, + "simpleMaxwellianFission": { + "times": "1", + "required": false + }, + "MadlandNix": { + "times": "1", + "required": false + } + } + }, + + "evaluated": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "date": { + "type": "string", + "required": true + }, + "library": { + "type": "string", + "required": true + }, + "version": { + "type": "string", + "required": true + } + }, + "children": { + "documentation": { + "times": "1", + "required": true + }, + "temperature": { + "times": "1", + "required": false + }, + "projectileEnergyDomain": { + "times": "1", + "required": false + } + } + }, + + "chemicalElements": { + "children": { + "chemicalElement": { + "times": "1+", + "required": true + } + } + }, + + "chemicalElement": { + "metadata": { + "symbol": { + "type": "string", + "required": true + }, + "Z": { + "type": "int", + "required": true + }, + "name": { + "type": "string", + "required": true + } + }, + "children": { + "atomic": { + "times": "1", + "required": false + }, + "isotopes": { + "times": "1", + "required": false + } + } + }, + + "incompleteReactions": { + "children": { + "reaction": { + "times": "1+", + "required": true + } + } + }, + + "orphanProducts": { + "children": { + "orphanProduct": { + "times": "1+", + "required": true + } + } + }, + + "orphanProduct": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "ENDF_MT": { + "type": "int", + "required": true + } + }, + "children": { + "crossSection": { "namespace": "general", + "times": "1", + "required": true + }, + "outputChannel": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "fissionComponents": { + "children": { + "fissionComponent": { + "times": "1+", + "required": false + } + } + }, + + "fissionComponent": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "ENDF_MT": { + "type": "int", + "required": true + }, + "fissionGenre": { + "type": "string", + "required": true + } + }, + "children": { + "crossSection": { "namespace": "general", + "times": "1", + "required": true + }, + "outputChannel": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "crossSectionReconstructed": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "derivedFrom": { + "type": "string", + "required": true + }, + "date": { + "type": "string", + "required": true + } + } + }, + + "gaugeBosons": { + "children": { + "gaugeBoson": { + "times": "1+", + "required": true + } + } + }, + + "gaugeBoson": { + "metadata": { + "id": { + "type": "string", + "required": true + } + }, + "children": { + "mass": { + "times": "1", + "required": true + }, + "spin": { + "times": "1", + "required": true + }, + "parity": { + "times": "1", + "required": true + }, + "charge": { + "times": "1", + "required": true + }, + "halflife": { + "times": "1", + "required": true + } + } + }, + + "leptons": { + "children": { + "lepton": { + "times": "1+", + "required": true + } + } + }, + + "lepton": { + "metadata": { + "id": { + "type": "string", + "required": true + }, + "generation": { + "type": "string", + "required": true + } + }, + "children": { + "mass": { + "times": "1", + "required": true + }, + "spin": { + "times": "1", + "required": true + }, + "parity": { + "times": "1", + "required": true + }, + "charge": { + "times": "1", + "required": true + }, + "halflife": { + "times": "1", + "required": true + } + } + }, + + "resonances": { + "metadata": { + "href": { + "type": "string", + "required": false + } + }, + "children": { + "scatteringRadius": { + "times": "1", + "required": false + }, + "resolved": { + "times": "1", + "required": false + }, + "unresolved": { + "times": "1", + "required": false + } + } + }, + + "branching1d": { + "metadata": { + "label": { + "type": "string", + "required": true + } + } + }, + + "branching3d": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "productFrame": { + "type": "string", + "required": true + } + } + }, + + "resolved": { + "metadata": { + "domainMin": { + "type": "double", + "required": true + }, + "domainMax": { + "type": "double", + "required": true + }, + "domainUnit": { + "type": "string", + "required": true + } + }, + "children": { + "BreitWigner": { + "times": "1", + "required": false + }, + "RMatrix": { + "times": "1", + "required": false + } + } + }, + + "RMatrix": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "approximation": { + "type": "string", + "required": true + }, + "boundaryCondition": { + "type": "string", + "required": true + }, + "calculateChannelRadius": { + "type": "bool", + "required": false + }, + "supportsAngularReconstruction": { + "type": "bool", + "required": false + } + }, + "children": { + "PoPs": { "namespace": "top", + "times": "1", + "required": false + }, + "resonanceReactions": { + "times": "1", + "required": true + }, + "spinGroups": { + "times": "1", + "required": true + } + } + }, + + "spinGroups": { + "children": { + "spinGroup": { + "times": "1+", + "required": true + } + } + }, + + "spinGroup": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "spin": { + "type": "int", + "required": true + }, + "parity": { + "type": "int", + "required": true + } + }, + "children": { + "channels": { + "times": "1", + "required": true + }, + "resonanceParameters": { + "times": "1", + "required": true + } + } + }, + + "channels": { + "children": { + "channel": { + "times": "1+", + "required": true + } + } + }, + + "channel": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "resonanceReaction": { + "type": "string", + "required": true + }, + "L": { + "type": "int", + "required": true + }, + "channelSpin": { + "type": "int", + "required": true + }, + "columnIndex": { + "type": "int", + "required": true + } + }, + "children": { + "scatteringRadius": { + "times": "1", + "required": false + }, + "hardSphereRadius": { + "times": "1", + "required": false + } + } + }, + + "unresolved": { + "metadata": { + "domainMin": { + "type": "double", + "required": true + }, + "domainMax": { + "type": "double", + "required": true + }, + "domainUnit": { + "type": "string", + "required": true + } + }, + "children": { + "tabulatedWidths": { + "times": "1", + "required": true + } + } + }, + + "tabulatedWidths": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "approximation": { + "type": "string", + "required": true + }, + "useForSelfShieldingOnly": { + "type": "bool", + "required": false + } + }, + "children": { + "resonanceReactions": { + "times": "1", + "required": true + }, + "Ls": { + "times": "1", + "required": true + }, + "PoPs": { "namespace": "top", + "times": "1", + "required": false + }, + "scatteringRadius": { + "times": "1", + "required": false + } + } + }, + + "resonanceReactions": { + "children": { + "resonanceReaction": { + "times": "1+", + "required": true + } + } + }, + + "resonanceReaction": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "ejectile": { + "type": "string", + "required": false + }, + "eliminated": { + "type": "bool", + "required": false + } + }, + "children": { + "link": { + "times": "1", + "required": true + }, + "hardSphereRadius": { + "times": "1", + "required": false + }, + "Q": { + "times": "1", + "required": false + }, + "scatteringRadius": { + "times": "1", + "required": false + } + } + }, + + "hardSphereRadius": { + "children": { + "constant1d": { + "times": "1", + "required": true + } + } + }, + + "Ls": { + "children": { + "L": { + "times": "1+", + "required": true + } + } + }, + + "L": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "value": { + "type": "int", + "required": true + } + }, + "children": { + "Js": { + "times": "1", + "required": true + } + } + }, + + "Js": { + "children": { + "J": { + "times": "1+", + "required": true + } + } + }, + + "J": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "value": { + "type": "int", + "required": true + } + }, + "children": { + "levelSpacing": { + "times": "1", + "required": true + }, + "widths": { + "times": "1", + "required": true + } + } + }, + + "levelSpacing": { + "children": { + "XYs1d": { + "times": "1", + "required": false + }, + "constant1d": { + "times": "1", + "required": false + } + } + }, + + "widths": { + "children": { + "width": { + "times": "1+", + "required": true + } + } + }, + + "width": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "resonanceReaction": { + "type": "string", + "required": true + }, + "degreesOfFreedom": { + "type": "int", + "required": true + } + }, + "children": { + "XYs1d": { + "times": "1", + "required": false + }, + "constant1d": { + "times": "1", + "required": false + }, + "regions1d": { + "times": "1", + "required": false + } + } + }, + + "unresolvedRegion": { + "children": { + "XYs1d": { + "times": "1", + "required": false + }, + "regions1d": { + "times": "1", + "required": false + } + } + }, + + "BreitWigner": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "approximation": { + "type": "string", + "required": true + }, + "calculateChannelRadius": { + "type": "bool", + "required": false + } + }, + "children": { + "resonanceParameters": { + "times": "1", + "required": true + }, + "PoPs": { "namespace": "top", + "times": "1", + "required": false + }, + "scatteringRadius": { + "times": "1", + "required": false + } + } + }, + + "resonanceParameters": { + "children": { + "table": { + "times": "1", + "required": true + } + } + }, + + "scatteringRadius": { + "children": { + "constant1d": { + "times": "1", + "required": false + }, + "XYs1d": { + "times": "1", + "required": false + } + } + }, + + "photonEmissionProbabilities": { + "children": { + "shell": { + "times": "1", + "required": true + } + } + }, + + "table": { + "metadata": { + "rows": { + "type": "int", + "required": true + }, + "columns": { + "type": "int", + "required": true + } + }, + "children": { + "columnHeaders": { + "times": "1", + "required": true + }, + "data": { + "times": "1", + "required": true + } + } + }, + "data": { + "vector": "double" + }, + + "columnHeaders": { + "children": { + "column": { + "times": "1+", + "required": true + } + } + }, + + "column": { + "metadata": { + "index": { + "type": "int", + "required": true + }, + "name": { + "type": "string", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "simpleMaxwellianFission": { + "children": { + "U": { + "times": "1", + "required": true + }, + "theta": { + "times": "1", + "required": true + } + } + }, + + "weightedFunctionals": { + "children": { + "weighted": { + "times": "1+", + "required": true + } + } + }, + + "weighted": { + "children": { + "XYs1d": { + "times": "1", + "required": true + }, + "evaporation": { + "times": "1", + "required": true + } + } + }, + + "evaporation": { + "children": { + "U": { + "times": "1", + "required": true + }, + "theta": { + "times": "1", + "required": true + } + } + }, + + "generalEvaporation": { + "children": { + "U": { + "times": "1", + "required": true + }, + "theta": { + "times": "1", + "required": true + }, + "g": { + "times": "1", + "required": true + } + } + }, + + "U": { + "metadata": { + "value": { + "type": "double", + "required": true + }, + "unit": { + "type": "string", + "required": true + } + } + }, + + "theta": { + "children": { + "XYs1d": { + "times": "1", + "required": false + }, + "regions1d": { + "times": "1", + "required": false + } + } + }, + + "g": { + "children": { + "XYs1d": { + "times": "1", + "required": false + } + } + }, + + "NBodyPhaseSpace": { + "metadata": { + "numberOfProducts": { + "type": "int", + "required": true + } + }, + "children": { + "mass": { + "times": "1", + "required": true + } + } + }, + + "primaryGamma": { + "metadata": { + "value": { + "type": "double", + "required": true + }, + "domainMin": { + "type": "double", + "required": true + }, + "domainMax": { + "type": "double", + "required": true + } + }, + "children": { + "axes": { + "times": "1", + "required": true + } + } + }, + + "discreteGamma": { + "metadata": { + "value": { + "type": "double", + "required": true + }, + "domainMin": { + "type": "double", + "required": true + }, + "domainMax": { + "type": "double", + "required": true + } + }, + "children": { + "axes": { + "times": "1", + "required": true + } + } + }, + + "productions": { + "children": { + "production": { + "times": "1+", + "required": true + } + } + }, + + "production": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "ENDF_MT": { + "type": "int", + "required": true + } + }, + "children": { + "crossSection": { "namespace": "general", + "times": "1", + "required": true + }, + "outputChannel": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "resonancesWithBackground": { + "metadata": { + "label": { + "type": "string", + "required": true + } + }, + "children": { + "resonances": { + "times": "1", + "required": true + }, + "background": { + "times": "1", + "required": true + }, + "uncertainty": { + "times": "1", + "required": false + } + } + }, + + "background": { + "children": { + "resolvedRegion": { + "times": "1", + "required": false + }, + "fastRegion": { + "times": "1", + "required": true + }, + "unresolvedRegion": { + "times": "1", + "required": false + } + } + }, + + "resolvedRegion": { + "children": { + "XYs1d": { + "times": "1", + "required": false + }, + "regions1d": { + "times": "1", + "required": false + } + } + }, + + "fastRegion": { + "children": { + "XYs1d": { + "times": "1", + "required": false + }, + "regions1d": { + "times": "1", + "required": false + } + } + }, + + "reference": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "href": { + "type": "string", + "required": true + } + } + }, + + "regions1d": { + "metadata": { + "label": { + "type": "string", + "required": false + }, + "outerDomainValue": { + "type": "double", + "required": false + } + }, + "children": { + "axes": { + "times": "1", + "required": false + }, + "uncertainty": { + "times": "1", + "required": false + }, + "function1ds": { "namespace": "reduced", + "times": "1", + "required": true + } + } + }, + + "regions2d": { + "children": { + "axes": { + "times": "1", + "required": true + }, + "function2ds": { + "times": "1", + "required": true + }, + "uncertainty": { + "times": "1", + "required": false + } + } + }, + + "function2ds": { + "children": { + "XYs2d": { + "times": "1+", + "required": true + } + } + }, + + "angularTwoBody": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "productFrame": { + "type": "string", + "required": true + } + }, + "children": { + "XYs2d": { + "times": "1", + "required": false + }, + "regions2d": { + "times": "1", + "required": false + }, + "recoil": { + "times": "1", + "required": false + }, + "isotropic2d": { + "times": "1", + "required": false + } + } + }, + + "recoil": { + "metadata": { + "href": { + "type": "string", + "required": true + } + } + }, + + "listOfCovariances": { + "children": { + "covariance": { + "times": "1+", + "required": true + } + } + }, + + "XYs2d": { + "metadata": { + "index": { + "type": "int", + "required": false + }, + "interpolation": { + "type": "string", + "required": false + }, + "interpolationQualifier": { + "type": "string", + "required": false + }, + "outerDomainValue": { + "type": "double", + "required": false + } + }, + "children": { + "axes": { + "times": "1", + "required": false + }, + "function1ds": { "namespace": "general", + "times": "1", + "required": true + }, + "uncertainty": { + "times": "1", + "required": false + } + } + }, + + "XYs3d": { + "metadata": { + "interpolationQualifier": { + "type": "string", + "required": false + } + }, + "children": { + "axes": { + "times": "1", + "required": false + }, + "function2ds": { + "times": "1+", + "required": true + } + } + }, + + "Legendre": { + "metadata": { + "outerDomainValue": { + "type": "double", + "required": true + } + }, + "children": { + "values": { + "times": "1", + "required": true + } + } + }, + + "delayedNeutrons": { + "children": { + "delayedNeutron": { + "times": "1+", + "required": true + } + } + }, + + "delayedNeutron": { + "metadata": { + "label": { + "type": "string", + "required": true + } + }, + "children": { + "rate": { + "times": "1", + "required": true + }, + "product": { "namespace": "reduced", + "times": "1", + "required": true + } + } + }, + + "rate": { + "children": { + "double": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "fissionEnergyReleases": { + "children": { + "fissionEnergyRelease": { + "times": "1+", + "required": true + } + } + }, + + "fissionEnergyRelease": { + "metadata": { + "label": { + "type": "string", + "required": true + } + }, + "children": { + "promptProductKE": { + "times": "1", + "required": true + }, + "promptNeutronKE": { + "times": "1", + "required": true + }, + "delayedNeutronKE": { + "times": "1", + "required": true + }, + "promptGammaEnergy": { + "times": "1", + "required": true + }, + "delayedGammaEnergy": { + "times": "1", + "required": true + }, + "delayedBetaEnergy": { + "times": "1", + "required": true + }, + "neutrinoEnergy": { + "times": "1", + "required": true + }, + "nonNeutrinoEnergy": { + "times": "1", + "required": true + }, + "totalEnergy": { + "times": "1", + "required": true + } + } + }, + + "promptProductKE": { + "children": { + "polynomial1d": { "namespace": "general", + "times": "1", + "required": false + }, + "XYs1d": { + "times": "1", + "required": false + } + } + }, + + "promptNeutronKE": { + "children": { + "polynomial1d": { "namespace": "general", + "times": "1", + "required": false + }, + "XYs1d": { + "times": "1", + "required": false + } + } + }, + + "delayedNeutronKE": { + "children": { + "polynomial1d": { "namespace": "general", + "times": "1", + "required": false + }, + "XYs1d": { + "times": "1", + "required": false + } + } + }, + + "promptGammaEnergy": { + "children": { + "polynomial1d": { "namespace": "general", + "times": "1", + "required": false + }, + "XYs1d": { + "times": "1", + "required": false + } + } + }, + + "delayedGammaEnergy": { + "children": { + "polynomial1d": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "delayedBetaEnergy": { + "children": { + "polynomial1d": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "neutrinoEnergy": { + "children": { + "polynomial1d": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "nonNeutrinoEnergy": { + "children": { + "polynomial1d": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "totalEnergy": { + "children": { + "polynomial1d": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "averageProductEnergy": { + "children": { + "XYs1d": { + "times": "1", + "required": true + } + } + }, + + "multiplicitySums": { + "children": { + "multiplicitySum": { + "times": "1+", + "required": true + } + } + }, + + "multiplicitySum": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "ENDF_MT": { + "type": "int", + "required": true + } + }, + "children": { + "multiplicity": { + "times": "1", + "required": true + }, + "summands": { + "times": "1", + "required": true + } + } + }, + + "coherentPhotonScattering": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "href": { + "type": "string", + "required": false + }, + "pid": { + "type": "string", + "required": false + }, + "productFrame": { + "type": "string", + "required": false + } + }, + "children": { + "formFactor": { + "times": "1", + "required": false + }, + "realAnomalousFactor": { + "times": "1", + "required": false + }, + "imaginaryAnomalousFactor": { + "times": "1", + "required": false + } + } + }, + + "incoherentPhotonScattering": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "href": { + "type": "string", + "required": false + }, + "pid": { + "type": "string", + "required": false + }, + "productFrame": { + "type": "string", + "required": false + } + }, + "children": { + "scatteringFactor": { + "times": "1", + "required": false + } + } + }, + + "scatteringFactor": { + "children": { + "XYs1d": { + "times": "1", + "required": true + } + } + }, + + "formFactor": { + "children": { + "XYs1d": { + "times": "1", + "required": true + } + } + }, + + "realAnomalousFactor": { + "children": { + "XYs1d": { + "times": "1", + "required": true + } + } + }, + + "imaginaryAnomalousFactor": { + "children": { + "XYs1d": { + "times": "1", + "required": true + } + } + }, + + "angularEnergy": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "productFrame": { + "type": "string", + "required": true + } + }, + "children": { + "XYs3d": { + "times": "1", + "required": true + } + } + }, + + "KalbachMann": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "productFrame": { + "type": "string", + "required": true + } + }, + "children": { + "f": { + "times": "1", + "required": false + }, + "r": { + "times": "1", + "required": false + } + } + }, + + "f": { + "children": { + "XYs2d": { + "times": "1", + "required": true + } + } + }, + + "r": { + "children": { + "XYs2d": { + "times": "1", + "required": true + } + } + }, + + "energyAngular": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "productFrame": { + "type": "string", + "required": true + } + }, + "children": { + "XYs3d": { + "times": "1", + "required": false + } + } + }, + + "uncorrelated": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "productFrame": { + "type": "string", + "required": true + } + }, + "children": { + "angular": { + "times": "1", + "required": true + }, + "energy": { + "times": "1", + "required": true + } + } + }, + + "unspecified": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "productFrame": { + "type": "string", + "required": false + } + } + }, + + "sums": { + "children": { + "crossSectionSums": { + "times": "1", + "required": false + }, + "multiplicitySums": { + "times": "1", + "required": false + } + } + }, + + "crossSectionSums": { + "children": { + "crossSectionSum": { + "times": "1+", + "required": true + } + } + }, + + "crossSectionSum": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "ENDF_MT": { + "type": "int", + "required": true + } + }, + "children": { + "summands": { + "times": "1", + "required": true + }, + "Q": { + "times": "1", + "required": true + }, + "crossSection": { "namespace": "general", + "times": "1", + "required": true + } + } + }, + + "summands": { + "children": { + "add": { + "times": "1+", + "required": true + } + } + }, + + "add": { + "metadata": { + "href": { + "type": "string", + "required": true + } + } + }, + + "angular": { + "children": { + "isotropic2d": { + "times": "1", + "required": false + }, + "XYs2d": { + "times": "1", + "required": false + } + } + }, + + "isotropic2d": { + } +} diff --git a/versions/GNDS-v2.0/reduced.json b/versions/GNDS-v2.0/reduced.json new file mode 100644 index 000000000..dd08b32b9 --- /dev/null +++ b/versions/GNDS-v2.0/reduced.json @@ -0,0 +1,155 @@ +{ + "namespace": "reduced", + + "function1ds": { + "children": { + "Legendre": { + "times": "1+", + "required": true + }, + "XYs1d": { + "times": "1+", + "required": false + } + } + }, + + "outputChannel": { + "metadata": { + "genre": { + "type": "string", + "required": true + }, + "process": { + "type": "string", + "required": false + } + }, + "children": { + "Q": { + "times": "1", + "required": true + }, + "products": { "namespace": "reduced", + "times": "1", + "required": false + } + } + }, + + "products": { + "children": { + "product": { "namespace": "reduced", + "times": "1+", + "required": true + } + } + }, + + "product": { + "metadata": { + "label": { + "type": "string", + "required": true + }, + "pid": { + "type": "string", + "required": true + } + }, + "children": { + "multiplicity": { + "times": "1", + "required": true + }, + "distribution": { "namespace": "reduced", + "times": "1", + "required": true + } + } + }, + + "distribution": { + "children": { + "thermalNeutronScatteringLaw": { + "times": "1", + "required": false + }, + "uncorrelated": { + "times": "1", + "required": false + }, + "unspecified": { + "times": "1", + "required": false + }, + "XYs2d": { + "times": "1", + "required": false + }, + "branching3d": { + "times": "1", + "required": false + } + } + }, + + "polynomial1d": { + "metadata": { + "domainMin": { + "type": "double", + "required": true + }, + "domainMax": { + "type": "double", + "required": true + } + }, + "children": { + "axes": { + "times": "1", + "required": true + }, + "values": { + "times": "1", + "required": true + } + } + }, + + "double": { + "metadata": { + "value": { + "type": "double", + "required": true + } + } + }, + + "nuclides": { + "metadata": { + "href": { + "type": "string", + "required": false + } + }, + "vector": "string" + }, + + "crossSection": { + "children": { + "XYs1d": { + "times": "1", + "required": false + }, + "regions1d": { + "times": "1", + "required": false + }, + "reference": { + "times": "1", + "required": false + } + } + } +} diff --git a/versions/GNDS-v2.0/top.json b/versions/GNDS-v2.0/top.json new file mode 100644 index 000000000..61db80caf --- /dev/null +++ b/versions/GNDS-v2.0/top.json @@ -0,0 +1,185 @@ +{ + "namespace": "top", + + "reactionSuite": { + "metadata": { + "projectile": { + "type": "string", + "required": true + }, + "target": { + "type": "string", + "required": true + }, + "evaluation": { + "type": "string", + "required": true + }, + "format": { + "type": "string", + "required": true + }, + "projectileFrame": { + "type": "string", + "required": true + }, + "interaction": { + "type": "string", + "required": true + } + }, + "children": { + "styles": { + "times": "1", + "required": true + }, + "PoPs": { "namespace": "top", + "times": "1", + "required": true + }, + "reactions": { + "times": "1", + "required": true + }, + "applicationData": { + "times": "1", + "required": false + }, + "externalFiles": { + "times": "1", + "required": false + }, + "resonances": { + "times": "1", + "required": false + }, + "sums": { + "times": "1", + "required": false + }, + "productions": { + "times": "1", + "required": false + }, + "fissionComponents": { + "times": "1", + "required": false + }, + "orphanProducts": { + "times": "1", + "required": false + }, + "incompleteReactions": { + "times": "1", + "required": false + } + } + }, + + "PoPs": { + "metadata": { + "name": { + "type": "string", + "required": true + }, + "version": { + "type": "string", + "required": true + }, + "format": { + "type": "string", + "required": true + } + }, + "children": { + "aliases": { + "times": "1", + "required": false + }, + "baryons": { + "times": "1", + "required": false + }, + "chemicalElements": { + "times": "1", + "required": false + }, + "styles": { + "times": "1", + "required": false + }, + "unorthodoxes": { + "times": "1", + "required": false + }, + "gaugeBosons": { + "times": "1", + "required": false + }, + "leptons": { + "times": "1", + "required": false + } + } + }, + + "covarianceSuite": { + "metadata": { + "projectile": { + "type": "string", + "required": true + }, + "target": { + "type": "string", + "required": true + }, + "evaluation": { + "type": "string", + "required": true + }, + "interaction": { + "type": "string", + "required": true + }, + "format": { + "type": "string", + "required": true + } + }, + "children": { + "externalFiles": { + "times": "1", + "required": false + }, + "styles": { + "times": "1", + "required": true + }, + "covarianceSections": { + "times": "1", + "required": false + }, + "parameterCovariances": { + "times": "1", + "required": false + } + } + }, + + "fissionFragmentData": { + "children": { + "productYields": { + "times": "1", + "required": false + }, + "delayedNeutrons": { + "times": "1", + "required": false + }, + "fissionEnergyReleases": { + "times": "1", + "required": false + } + } + } +}